NILMFormer: Non-Intrusive Load Monitoring that Accounts for Non-Stationarity

Adrien Petralia, Philippe Charpentier, Youssef Kadhi, Themis Palpanas

Introduction

Non-Intrusive Load Monitoring (NILM) is often described as the "holy grail" of energy efficiency. It aims to disaggregate a single household's total power signal into the consumption of individual appliances—such as heaters, dishwashers, or electric vehicle (EV) chargers—without requiring expensive per-plug sensors. However, real-world smart meter data presents a significant challenge: non-stationarity.

Most deep learning models operate on small windows of data where the statistical properties (mean and variance) change drastically depending on which high-power appliances are active. A window where a space heater is running looks fundamentally different from one where only a few LED bulbs are on. Standard models often struggle with this distribution drift, leading to inaccurate energy estimates. NILMFormer addresses this by incorporating a unique stationarization scheme and timestamp-based positional encoding.

Methodology

NILMFormer introduces a sequence-to-sequence Transformer architecture designed to handle non-stationary time-series data through three key innovations:

  1. Subsequence Stationarization (TokenStats): Rather than simply normalizing input data and discarding the original scale, NILMFormer extracts the mean (\mu) and standard deviation (\sigma) of each window. These are projected into a vector called TokenStats and fed into the Transformer as a dedicated token, allowing the model to retain knowledge of the signal's original scale.
  2. Output De-stationarization (ProjStats): To convert normalized predictions back into actual Watts, the model uses a learnable projection (ProjStats) of the input statistics. This ensures that the predicted appliance power is correctly scaled relative to the total aggregate power.
  3. TimeRPE (Timestamp Related Positional Encoding): Standard Transformers use generic positional encodings. NILMFormer replaces these with TimeRPE, which encodes discrete time information (minute, hour, day of week, month). This allows the model to learn human behavioral patterns—for instance, recognizing that EVs typically charge at night while heaters are seasonal.
The NILMFormer architecture featuring TokenStats for normalization and TimeRPE for temporal context.

The backbone of the model utilizes Multi-Head Diagonally Masked Self-Attention (DMSA) and a feature extractor composed of Dilated Residual Units, enabling efficient capture of patterns across various time scales.

Datasets and Evaluation

The authors evaluated NILMFormer across four diverse datasets to ensure robustness:

  • UKDALE and REFIT: Public benchmarks focusing on high-frequency (1-minute) data for small appliances in UK households.
  • EDF Industrial Datasets: Two private datasets from Electricité De France. EDF 1 includes over 350 houses with 10-minute sampling for heavy loads (heaters, water heaters), while EDF 2 focuses on EV charging with 30-minute sampling.

Key Results and Impact

NILMFormer demonstrates a significant leap in performance over existing state-of-the-art methods like BERT4NILM and UNet-NILM. On average, the model achieved a 15% improvement in Mean Absolute Error (MAE) and a 22% boost in Matching Ratio (MR).

Qualitative comparison of NILMFormer against other baselines, showing its superior ability to track true appliance power.

Beyond benchmark scores, the model shows exceptional utility in real-world energy restitution. When providing daily or monthly feedback to customers, NILMFormer reduced error by 51% for daily estimates compared to traditional regression approaches like XGBoost. This performance has led to its large-scale deployment at EDF, where it currently serves 3.6 million customers, handling approximately 100 requests per second.

Conclusion and Future Work

While NILMFormer excels at identifying high-power, intermittent loads, it faces a minor challenge known as the "Fridge Problem." Because refrigerators are "always-on" and represent a constant baseline, the stationarization scheme—which is optimized for detecting shifts—occasionally struggles to isolate this steady signal. Future research will focus on refining the architecture to better handle these constant base loads and exploring performance on even lower-frequency data common in international markets.

Summary updated

BibTeX
@inproceedings{petralia2025nilmformer,
  author = {Adrien Petralia and Philippe Charpentier and Youssef Kadhi and Themis Palpanas},
  title = {{NILMFormer: Non-Intrusive Load Monitoring that Accounts for Non-Stationarity}},
  booktitle = {ACM SIGKDD Conference on Knowledge Discovery and Data Mining},
  year = {2025},
}
Figure