NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Is Big Data Sufficient for a Reliable Detection of Non-Technical Losses?

Patrick O. Glauner, Angelo Migliosi, Jorge Augusto Meira, Eric Aislan Antonelo, Petko Valtchev, Radu State, Franck BettingerarXiv 2017

Abstract

Non-technical losses (NTL) occur during the distribution of electricity in power grids and include, but are not limited to, electricity theft and faulty meters. In emerging countries, they may range up to 40% of the total electricity distributed. In order to detect NTLs, machine learning methods are used that learn irregular consumption patterns from customer data and inspection results. The Big Data paradigm followed in modern machine learning reflects the desire of deriving better conclusions from simply analyzing more data, without the necessity of looking at theory and models. However, the sample of inspected customers may be biased, i.e. it does not represent the population of all customers. As a consequence, machine learning models trained on these inspection results are biased as well and therefore lead to unreliable predictions of whether customers cause NTL or not. In machine learning, this issue is called covariate shift and has not been addressed in the literature on NTL detection yet. In this work, we present a novel framework for quantifying and visualizing covariate shift. We apply it to a commercial data set from Brazil that consists of 3.6M customers and 820K inspection results. We show that some features have a stronger covariate shift than others, making predictions less reliable. In particular, previous inspections were focused on certain neighborhoods or customer classes and that they were not sufficiently spread among the population of customers. This framework is about to be deployed in a commercial product for NTL detection.

Introduction

In the power industry, Non-Technical Losses (NTL)—which include electricity theft, meter tampering, and billing errors—can account for up to 40% of total distribution in emerging economies. To combat this, utilities increasingly rely on machine learning (ML) to flag suspicious consumption patterns. However, these models often fall into the "Big Data trap": the assumption that more data automatically leads to better models.

The fundamental flaw lies in the "ground truth" labels derived from past physical inspections. Technicians do not inspect customers at random; they focus on specific neighborhoods, certain meter types, or areas with known issues. This creates a sampling bias, known in machine learning as covariate shift. If training data represents only a specific subset of customers, the resulting model will be unreliable when deployed across the entire grid.

Methodology: Quantifying Bias

The authors propose a framework to quantify covariate shift by treating it as a classification task. They take the "inspected" dataset (training) and the "uninspected" dataset (production) and assign them binary labels ($s=1$ and $s=0$). A Decision Tree classifier is then trained to distinguish between these two groups.

The Matthews Correlation Coefficient (MCC) is used to measure the classifier's performance. A high MCC indicates that the groups are easily distinguishable, proving a significant covariate shift exists. This approach ensures that the bias measurement is robust and not merely an artifact of model tuning.

Identifying Biased Features

The study utilized a massive real-world dataset from a Brazilian electricity provider, encompassing 3.6 million customers and 820,000 inspection results. Analysis revealed that bias is not distributed equally across features.

Heatmap of MCC values showing that Location and its combinations exhibit the highest covariate shift.

As shown in the heatmap above, Location is the primary source of bias (MCC = 0.22). This confirms that inspections are heavily clustered geographically. In contrast, features like "Voltage" and "Contract Status" showed almost no shift, suggesting they are more stable across both inspected and uninspected populations. When features are combined (e.g., Location + Number of wires), the MCC rises further, indicating even stronger bias in multi-dimensional customer profiles.

Hierarchical Visualization and the Granularity Effect

A key insight of the research is that bias is not uniform across different scales. The framework visualizes MCC values across four hierarchical levels: regions, municipalities, localities, and neighborhoods.

Geographic visualization of covariate shift at regional, municipal, local, and neighborhood levels.

At a regional level, the shift appears relatively smooth. However, as the analysis zooms into the neighborhood level, the bias becomes significantly more granular and extreme. This visualization reveals that certain small pockets are heavily over-sampled while others are almost entirely ignored, a critical finding for utilities attempting to deploy grid-wide detection models.

Conclusion and Future Work

This research demonstrates that simply increasing the volume of data is insufficient for reliable NTL detection if the underlying sampling bias remains unaddressed. The proposed framework provides a necessary tool for domain experts to identify and visualize these biases before deploying models.

Future work will focus on moving from measurement to correction. The authors plan to utilize spatial point processes to actively reduce spatial covariate shift, ensuring that future machine learning models are trained on samples that truly represent the entire power grid population.

Summary updated

Abstract

Non-technical losses (NTL) occur during the distribution of electricity in power grids and include, but are not limited to, electricity theft and faulty meters. In emerging countries, they may range up to 40% of the total electricity distributed. In order to detect NTLs, machine learning methods are used that learn irregular consumption patterns from customer data and inspection results. The Big Data paradigm followed in modern machine learning reflects the desire of deriving better conclusions from simply analyzing more data, without the necessity of looking at theory and models. However, the sample of inspected customers may be biased, i.e. it does not represent the population of all customers. As a consequence, machine learning models trained on these inspection results are biased as well and therefore lead to unreliable predictions of whether customers cause NTL or not. In machine learning, this issue is called covariate shift and has not been addressed in the literature on NTL detection yet. In this work, we present a novel framework for quantifying and visualizing covariate shift. We apply it to a commercial data set from Brazil that consists of 3.6M customers and 820K inspection results. We show that some features have a stronger covariate shift than others, making predictions less reliable. In particular, previous inspections were focused on certain neighborhoods or customer classes and that they were not sufficiently spread among the population of customers. This framework is about to be deployed in a commercial product for NTL detection.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
Global covariate shift of compound featuresTree models using all six featuresMaximum average Matthews correlation coefficient (MCC), overline{MCC}_max0.27325Electricity Theft Detection · split: test · features=all six
Source quote
L250: All │ 0.27325 │ 0.03014
Global covariate shift of single featuresTree models using locationMaximum average Matthews correlation coefficient (MCC), overline{MCC}_max0.22367Electricity Theft Detection · split: test · features=location
Source quote
L220: Location │ 0.22367 │ 0.03453
Global covariate shift of compound featuresTree models using location and number of wiresMaximum average Matthews correlation coefficient (MCC), overline{MCC}_max0.26206Electricity Theft Detection · split: test · features=location; number of wires
Source quote
L252: Location + number of wires │ 0.26206 │ 0.03676
Global covariate shift of single featuresTree models using classMaximum average Matthews correlation coefficient (MCC), overline{MCC}_max0.16255Electricity Theft Detection · split: test · features=class
Source quote
L222: Class │ 0.16255 │ 0.01371
Global covariate shift of single featuresTree models using number of wiresMaximum average Matthews correlation coefficient (MCC), overline{MCC}_max0.14111Electricity Theft Detection · split: test · features=number of wires
Source quote
L224: Number of wires │ 0.14111 │ 0.00794
Global covariate shift of single featuresTree models using meter typeMaximum average Matthews correlation coefficient (MCC), overline{MCC}_max0.13158Electricity Theft Detection · split: test · features=meter type
Source quote
L226: Meter type │ 0.13158 │ 0.00382
BibTeX
@misc{glauner2017is,
  author = {Patrick O. Glauner and Angelo Migliosi and Jorge Augusto Meira and Eric Aislan Antonelo and Petko Valtchev and Radu State and Franck Bettinger},
  title = {{Is Big Data Sufficient for a Reliable Detection of Non-Technical Losses?}},
  year = {2017},
  eprint = {1702.03767},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1702.03767},
}
Figure