FedNILM: Applying Federated Learning to NILM Applications at the Edge

Yu Zhang, Guoming Tang, Qianyi Huang, Yi Wang, Kui Wu, Keping Yu, Xun Shao

TL;DR

This paper introduces FedNILM, a federated learning framework for privacy-preserving and personalized Non-Intrusive Load Monitoring (NILM) on resource-constrained edge devices. By combining model compression and unsupervised transfer learning, FedNILM enables accurate appliance energy disaggregation without compromising user privacy.

What Problem Does This Paper Address?

Non-intrusive load monitoring (NILM) aims to break down a household's total electricity consumption into individual appliance usage. This is valuable for energy saving, conservation program evaluation, and grid management. However, traditional NILM methods struggle with accuracy, and a major hurdle for modern deep learning-based NILM is the privacy concern associated with collecting household energy data. Federated Learning (FL) offers a solution by training models collaboratively without centralizing raw data. Yet, applying FL to NILM at the edge presents three key challenges: 1) edge resource restrictions (limited computation, memory, and storage), 2) model personalization (different households have unique appliance sets and usage patterns), and 3) training data scarcity (labeled appliance data is expensive to obtain). FedNILM aims to tackle these issues head-on.

Methods

FedNILM is built upon the state-of-the-art Seq2Point NILM model and integrates several novel techniques:

  • Federated Learning (FL): The core paradigm for privacy-preserving collaborative training. The cloud server aggregates model updates from edge clients, while raw data remains local.
  • Cloud Model Compression: To address edge resource constraints, FedNILM employs two compression strategies on the cloud-side NILM model:
  • Multi-Task Learning (MTL): Instead of training separate models for each appliance, MTL-Seq2Point shares representation layers across appliances, significantly reducing model size and computation.
  • Filter Pruning: This technique removes less important filters (weights) from convolutional layers, further shrinking the model and reducing computational overhead. The paper explores pruning percentages to balance performance and compression.
  • Personalized Edge Model Building (Unsupervised Transfer Learning): To handle domain shift and data scarcity at the edge, FedNILM uses unsupervised transfer learning. Specifically, it incorporates the Correlation Alignment (CORAL) loss. This method aligns the feature distributions between the pre-trained cloud model (source domain) and the local client data (target domain) without requiring labeled appliance data on the client. The convolutional layers are often frozen, while the fully connected layers are fine-tuned.

The overall workflow involves the cloud server training and compressing a model, distributing it to clients, clients personalizing it using their local data, and then uploading updates for federated averaging.

Datasets

The paper uses the following publicly available datasets for training and evaluation:

  • REDD: Used for training and evaluating cloud model compression.
  • UK-DALE: Used for evaluating the effectiveness of transfer learning and personalization.
  • REFIT: Used for training the initial NILM model for transfer learning experiments.

Key Insights and Ideas

  • FL is a viable path for private NILM: The paper demonstrates that FL can effectively enable NILM applications while respecting user privacy, a critical barrier to widespread adoption.
  • Compression is key for edge deployment: Simply applying FL to large NILM models won't work on edge devices. Combining MTL and filter pruning drastically reduces model size and computational cost, making edge inference feasible.
  • Unsupervised transfer learning bridges the domain gap: The CORAL loss is crucial for personalizing models without labeled data. This is a significant advantage given the difficulty of obtaining labeled appliance data at the household level.
  • Convolutional layers learn generic features, fully connected layers learn specific ones: This insight justifies the strategy of freezing convolutional layers and fine-tuning fully connected layers during transfer learning, as it effectively leverages pre-trained knowledge while adapting to local appliance signatures.
  • Pruning can sometimes improve generalization: Surprisingly, filter pruning, while intended for compression, can act as a regularization technique, potentially leading to better model generalization.

Key Results

  • Significant Compression: Combining MTL and filter pruning (60% filters) achieved a nearly 92% reduction in inference time and a 96% reduction in model space compared to the original Seq2Point model, with only a slight performance degradation (<10%).
  • Effective Personalization: Local transfer learning using CORAL improved performance by up to 45% in MAE, 85% in SAE, and 40% in F1-score compared to using the un-personalized cloud model on target datasets.
  • Performance Comparison: FedNILM achieved personalized energy disaggregation with state-of-the-art accuracy while ensuring privacy.

Limitations and Future Work

  • Limited Appliance Scope: The experiments focused on a specific set of appliances (washing machine, fridge, dish washer, microwave). Future work could explore a wider range of appliances.
  • Real-world Edge Device Performance: While the paper uses an edge device (Nvidia Jetson Nano) for simulation, further real-world deployment and testing on diverse edge hardware would be beneficial.
  • Federated Averaging Strategy: The paper mentions federated averaging but doesn't delve deeply into optimizing the aggregation process itself for NILM.
  • Exploration of Other Compression Techniques: While filter pruning and MTL are effective, exploring other model compression methods could yield further improvements.
  • Dynamic Appliance Discovery: The current framework assumes known appliances. Future work could explore methods for automatically discovering and identifying new appliances at the edge.

Summary updated

Abstract

Non-intrusive load monitoring (NILM) helps disaggregate a household’s main electricity consumption to energy usages of individual appliances, greatly cutting down the cost of fine-grained load monitoring towards the green home vision. To address the privacy concern in NILM applications, federated learning (FL) could be leveraged for NILM model training and sharing. When applying the FL paradigm in real-world NILM applications, however, we are faced with the challenges of edge resource restriction, edge model personalization, and edge training data scarcity. We present FedNILM, a practical FL paradigm for NILM applications at the edge client. Specifically, FedNILM delivers privacy-preserving and personalized NILM services to large-scale edge clients, by leveraging i) collaborative data aggregation through federated learning, ii) efficient cloud model compression via filter pruning and multi-task learning, and iii) personalized edge model building with unsupervised transfer learning. Our experiments on real-world energy data show that FedNILM can achieve personalized energy disaggregation with the state-of-the-art accuracy, while preserving the user privacy.
BibTeX
@article{zhang2021fednilm,
  author = {Yu Zhang and Guoming Tang and Qianyi Huang and Yi Wang and Kui Wu and Keping Yu and Xun Shao},
  title = {{FedNILM: Applying Federated Learning to NILM Applications at the Edge}},
  journal = {IEEE Trans. Green Commun. Netw.},
  year = {2021},
  url = {https://openreview.net/forum?id=4aQ_6Fuz4a},
}
Figure