An Unsupervised Anomaly Detection in Electricity Consumption Using Reinforcement Learning and Time Series Forest Based Framework
Jihan Ghanim, Mariette Awad · 2025
Read An Unsupervised Anomaly Detection in Electricity Consumption Using Reinforcement Learning and Time Series Forest Based Framework by Jihan Ghanim, Mariette Awad (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2501-00107.txt.
Introduction
Jihan Ghanim and Mariette Awad present a self-choosing anomaly detector for power use data in a paper whose journal version is dated 2024. Odd readings in electricity data take many forms, so no single detector catches them all. Their system pairs a time series forest method with reinforcement learning that picks which detector to run.
The method needs no labeled examples, which are costly to build. On real-time data it beat every single detector on the F1 score, a balance of precision and recall. On synthetic data it scored 0.989, second only to one rival. It also beat GPT-4 asked to act as a detector. Tests across three more data sets showed each detector shines on a different anomaly type, which is why choosing matters.
Catalog record
| CREATOR | Jihan Ghanim, Mariette Awad |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 57 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2501-00107
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
An Unsupervised Anomaly Detection in Electricity Consumption Using Reinforcement Learning and Time Series Forest Based Framework Jihan Ghanim, Mariette Awad Abstract Anomaly detection (AD) plays a crucial role in time series applications, primarily because time series data is employed across real-world scenarios. Detecting anomalies poses significant challenges since anomalies take diverse forms making them hard to pinpoint accurately. Previous research has explored different AD models, making specific assumptions with varying sensitivity toward particular anomaly types. To address this issue, we propose a novel model selection for unsupervised AD using a combination of time series forest (TSF) and reinforcement learning (RL) approaches that dynamically chooses an AD technique. Our approach allows for effective AD without explicitly depending on ground truth labels that are often scarce and expensive to obtain. Results from the real-time series dataset demonstrate that the proposed model selection approach outperforms all other AD models in terms of the F1 score metric. For the synthetic dataset, our proposed model surpasses all other AD models except for KNN, with an impressive F1 score of 0.989. The proposed model selection framework also exceeded the performance of GPT-4 when prompted to act as an anomaly detector on the synthetic dataset. Exploring different reward functions revealed that the original reward function in our proposed AD model selection approach yielded the best overall scores. We evaluated the performance of the six AD models on an additional three datasets, having global, local, and clustered anomalies respectively, showing that each AD model exhibited distinct performance depending on the type of anomalies. This emphasizes the significance of our proposed AD model selection framework, maintaining high performance across all datasets, and showcasing superior performance across different anomaly types. Keywords : anomaly detection, reinforcement learning, model selection, time series forest, time series power consumption 1 Introduction Anomaly detection (AD) finds widespread use in various applications [ 1 ] , including smart grids [ 2 ] , Internet of Things (IoT) [ 3 ] , medical systems [ 4 ] , financial fraud detection systems [ 5 ] , and blockchain networks [ 6 ] . With the prevalence of cloud infrastructure and IoT-enabled devices, there is a vast availability of time series data [ 7 ] . Consequently, AD for time series data is gaining attraction, particularly in data-driven applications [ 8 ] . Anomalies, also called outliers, represent observations that deviate from the rest of the dataset [ 9 ] or exhibit deviations from most of the sequence’s distributions or patterns [ 10 ] . For example, anomalies in power grid meter measurements may indicate potential cyber-attacks or malfunctions [ 11 , 12 ] . Similarly, anomalies in time series power consumption patterns can lead to errors in power consumption predictions, resulting in underproduction or overproduction of electricity [ 13 ] . In finance, outliers in time series can signify ”illegal activities like fraud, risk, network intrusions, account takeover, and money laundering” [ 5 ] . Thus, time series AD plays a crucial role in ensuring operational efficiency, reliability, and security in real-world applications [ 8 ] . However, AD often falls short of achieving expected performance in data-driven real-world systems. This is primarily due to the scarcity, cost, and impracticality of obtaining labeled data in large quantities [ 8 ] . In real-world applications, a limited quantity of labeled anomalies can be provided through methods like active learning or identification by domain experts [ 14 , 15 , 16 ] . Therefore, it is preferable to employ unsupervised AD techniques that do not rely on labeled data [ 8 ] . Furthermore, given the complexity of data in real-world systems, data abnormalities manifest in various forms [ 17 ] . AD techniques that assume specific abnormalities may tend to rely on certain aspects more than others, making them sensitive to specific types of anomalies while potentially overlooking others. Consequently, there is a need for a universal AD model that outperforms other AD models on different types of data [ 1 ] . To address this, leveraging multiple AD models at different time steps can be beneficial when applied to a particular time series data. This can be achieved by designing an AD selection model that chooses the optimal AD model from a pool of candidate models at each time step [ 18 ] . The predicted label (normal or anomalous) at each time step depends on the output of the currently selected anomaly detector. Reinforcement learning (RL), a machine learning domain that maximizes numerical rewards by mapping situations to actions at each time step, can be employed for this purpose [ 19 ] . In a RL setting, an agent aims to learn the optimal decision-making policy to maximize the overall reward. RL has demonstrated success in various model selection applications, such as RL model selection for wind speed prediction [ 20 ] and RL-based model combination for time series forecasting [ 21 ] . This study proposes an RL-based model selection approach for AD (RLAD) in time series datasets. To address the challenge of gathering labeled data which is both expensive and time-consuming [ 22 ] , we focus on six unsupervised AD techniques that do not require labeled data for training. To implement the RL agent without explicit reliance on ground truth labels in its reward function, we utilize six time series forest (TSF) models. Each TSF is trained to classify a specific AD model’s incorrect and correct predictions. Our proposed AD model selection framework utilizes the classifications from these six classifiers for the majority of data points and ground truth labels for the remaining data points [ 23 ] . In other words, our approach requires a portion of ground truth labels instead of explicit reliance on all ground truth labels. We compare our RL-based model selection approach with an RL model selection that solely relies on ground truth labels in its reward function and another approach that relies only on the classifications of the TSFs in its reward function. Our proposed RLAD framework yields promising results, outperforming all AD candidate models on the real dataset and all AD models except for KNN on the synthetic dataset. Additionally, we conduct a study on different reward scenarios, including adaptive rewards with varying exploration epsilons, in the context of our AD model selection approach. The results indicate that the original reward function with a decaying exploration rate produces the best scores in terms of precision, recall, and F1 score evaluation metrics. We also examine the impact of different types of anomalies on the performance of the AD techniques by testing them on three synthetic datasets: one with local anomalies, another with global anomalies, and a third with clustered anomalies. The performance of each AD model varies across different types of anomalies, whereas our proposed AD model selection approach consistently achieves high scores across global, local, and clustered datasets, respectively. 2 Related Work Due to the emerging spread of time series problems [ 24 ] , the field of AD has garnered substantial attention for the analysis of time series data [ 25 ] . It can be categorized into three main groups: unsupervised, semi-supervised, and supervised methods [ 26 ] . While supervised or semi-supervised methods