Anomaly Detection in Temporal Power Grid Using an LSTM Autoencoder Two-Phase Framework †
Abstract
1. Introduction
2. Literature Review
3. Methodology
3.1. Dataset Description
3.2. Data Preprocessing
3.3. Model Architecture
3.3.1. Standard Autoencoder
- Encoder: It consists of three layers—an input layer, a hidden layer, and an output layer. The input layer is where data enters the network, the hidden layer is where data is transformed, and the output layer is where the encoder outputs a compressed version of the input. For input data x, the encoding process is defined as:where z is the latent representation, Wenc and benc are the encoder weights and biases, and σ is the activation function.
- Latent space: It serves as a bottleneck for information, forcing the model to learn only the relevant data attributes and helping to improve generalization.
- Decoder: It reconstructs compressed data to match the original input data closely. The decoder has hidden layers that progressively expand the latent vector back to a higher-dimensional space by successive transformations, and an output layer that produces reconstructed output that is intended to be as close as possible to the original input. The decoding process is defined as:where is the reconstructed output, and Wdec and bdec are the decoder weights and biases.
3.3.2. LSTM Autoencoder
3.4. Model Training
4. Results and Discussion
4.1. Model Performance
4.2. Anomaly Detection
4.3. Anomaly Attribution
4.4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Jabbari Zideh, M.; Khushalani Solanki, S. Multivariate physics-informed convolutional autoencoder for anomaly detection in power distribution systems with widespread deployment of distributed energy resources. Sustain. Energy Grids Netw. 2025, 44, 102022. [Google Scholar] [CrossRef]
- Powell, J.; McCafferty-Leroux, A.; Hilal, W.; Gadsden, S.A. Smart grids: A comprehensive survey of challenges, industry applications, and future trends. Energy Rep. 2024, 11, 5760–5785. [Google Scholar] [CrossRef]
- Hasan, M.K.; Habib, A.A.; Shukur, Z.; Ibrahim, F.; Islam, S.; Razzaque, M.A. Review on cyber-physical and cyber-security system in smart grid: Standards, protocols, constraints, and recommendations. J. Netw. Comput. Appl. 2023, 209, 103540. [Google Scholar] [CrossRef]
- Aghazadeh Ardebili, A.; Hasidi, O.; Bendaouia, A.; Khalil, A.; Khalil, S.; Luceri, D.; Longo, A.; Abdelwahed, E.H.; Qassimi, S.; Ficarella, A. Enhancing resilience in complex energy systems through real-time anomaly detection: A systematic literature review. Energy Inform. 2024, 7, 96. [Google Scholar] [CrossRef]
- Oyedeji, A.; Olukanmi, P. Intelligent Condition Monitoring of Power Transformers via Machine Learning. In 2025 33rd Southern African Universities Power Engineering Conference (SAUPEC); IEEE: New York, NY, USA, 2025; pp. 1–6. [Google Scholar]
- Finke, T.; Krämer, M.; Morandini, A.; Mück, A.; Oleksiyuk, I. Autoencoders for unsupervised anomaly detection in high energy physics. J. High Energy Phys. 2021, 2021, 161. [Google Scholar] [CrossRef]
- Ji, T.; Xu, P.; Guo, D.; Sun, L.; Ma, K.; Wang, Y.; Han, X. Variational Autoencoder Based Anomaly Detection in Large-Scale Energy Storage Power Stations. Energies 2025, 18, 2770. [Google Scholar] [CrossRef]
- Neloy, A.A.; Turgeon, M. A comprehensive study of auto-encoders for anomaly detection: Efficiency and trade-offs. Mach. Learn. Appl. 2024, 17, 100572. [Google Scholar] [CrossRef]
- Sahili, Z.; Al Awad, M. Spatio-Temporal Graph Neural Networks: A Survey. arXiv 2023, arXiv:2301.10569. [Google Scholar] [CrossRef]
- Zhang, Y.; Karve, P.M.; Mahadevan, S. Graph neural networks for power grid operational risk assessment under evolving grid topology. arXiv 2024, arXiv:2405.07343. [Google Scholar] [CrossRef]
- Cooper, A.; Bretas, A.; Meyn, S. Anomaly Detection in Power System State Estimation: Review and New Directions. Energies 2023, 16, 6678. [Google Scholar] [CrossRef]
- Zhang, J.E.; Wu, D.; Boulet, B. Time Series Anomaly Detection for Smart Grids: A Survey. In 2021 IEEE Electrical Power and Energy Conference (EPEC); IEEE: New York, NY, USA, 2021. [Google Scholar]
- Yin, T.; Naqvi, S.A.R.; Nandanoori, S.P.; Kundu, S. Advancing Cyber-Attack Detection in Power Systems: A Comparative Study of Machine Learning and Graph Neural Network Approaches. In 2024 Resilience Week (RWS); IEEE: New York, NY, USA, 2024; pp. 1–9. [Google Scholar]
- Wei, Y.; Jang-Jaccard, J.; Xu, W.; Sabrina, F.; Camtepe, S.; Boulic, M. LSTM-Autoencoder based Anomaly Detection for Indoor Air Quality Time Series Data. IEEE Sens. J. 2022, 23, 3787–3800. [Google Scholar] [CrossRef]
- Hu, D.; Zhang, C.; Yang, T.; Chen, G. Anomaly Detection of Power Plant Equipment Using Long Short-Term Memory Based Autoencoder Neural Network. Sensors 2020, 20, 6164. [Google Scholar] [CrossRef] [PubMed]
- Gong, X.; Liao, S.; Hu, F.; Hu, X.; Liu, C. Autoencoder-Based Anomaly Detection for Time Series Data in Complex Systems. In 2022 IEEE Asia Pacific Conference on Circuits and Systems (APCCAS); IEEE: New York, NY, USA, 2022; pp. 428–433. [Google Scholar]
- Xu, X.; Qin, F.; Zhao, W.; Xu, D.; Wang, X.; Yang, X. Anomaly Detection with GRU Based Bi-autoencoder for Industrial Multimode Process. Int. J. Control Autom. Syst. 2022, 20, 1827–1840. [Google Scholar] [CrossRef]
- Guha, D.; Chatterjee, R.; Sikdar, B. Anomaly Detection Using LSTM-Based Variational Autoencoder in Unsupervised Data in Power Grid. IEEE Syst. J. 2023, 17, 4313–4323. [Google Scholar] [CrossRef]
- Lin, R.; Chen, S.; He, Z.; Wu, B.; Zou, H.; Zhao, X.; Li, Q. Electricity Behavior Modeling and Anomaly Detection Services Based on a Deep Variational Autoencoder Network. Energies 2024, 17, 3904. [Google Scholar] [CrossRef]
- Shrestha, R.; Mohammadi, M.; Sinaei, S.; Salcines, A.; Pampliega, D.; Clemente, R.; Sanz, A.L.; Nowroozi, E.; Lindgren, A. Anomaly detection based on LSTM and autoencoders using federated learning in smart electric grid. J. Parallel Distrib. Comput. 2024, 193, 104951. [Google Scholar] [CrossRef]
- Harrou, F.; Bouyeddou, B.; Dairi, A.; Sun, Y. Exploiting Autoencoder-Based Anomaly Detection to Enhance Cybersecurity in Power Grids. Future Internet 2024, 16, 184. [Google Scholar] [CrossRef]
- Park, T.; Song, K.; Jeong, J.; Kim, H. Convolutional Autoencoder-Based Anomaly Detection for Photovoltaic Power Forecasting of Virtual Power Plants. Energies 2023, 16, 5293. [Google Scholar] [CrossRef]
- Bank, D.; Koenigstein, N.; Giryes, R. Autoencoders. In Machine Learning for Data Science Handbook: Data Mining and Knowledge Discovery Handbook; Rokach, L., Maimon, O., Shmueli, E., Eds.; Springer International Publishing: Cham, Switzerland, 2023; pp. 353–374. ISBN 978-3-031-24628-9. [Google Scholar]
- Lachekhab, F.; Benzaoui, M.; Tadjer, S.A.; Bensmaine, A.; Hamma, H. LSTM-Autoencoder Deep Learning Model for Anomaly Detection in Electric Motor. Energies 2024, 17, 2340. [Google Scholar] [CrossRef]
- Son, N.; Jung, M. Analysis of Meteorological Factor Multivariate Models for Medium- and Long-Term Photovoltaic Solar Power Forecasting Using Long Short-Term Memory. Appl. Sci. 2020, 11, 316. [Google Scholar] [CrossRef]




| PV Output | Load Profile | Load Dispatch | DG Output | Loss | Voltage | Time Step | |
|---|---|---|---|---|---|---|---|
| Mean | 0.00411 | 0.0789 | 0.0722 | 0.00588 | 0.995 | 0.00156 | 8759.500 |
| Std | 0.0140 | 0.0901 | 0.0853 | 0.0265 | 0.0217 | 0.00319 | 5057.592 |
| Min | 0.0 | 0.0 | 0.0 | 0.0 | 0.9500 | 0.0 | 0.0 |
| Max | 0.120 | 0.840 | 0.836 | 0.250 | 1.0495 | 0.0297 | 17,519.000 |
| Training Phase | Model Type | Convergence Epoch | Validation Loss (MSE) |
|---|---|---|---|
| 1 | Standard AE | 47 | 0.001515 |
| 1 | LSTM-AE | 89 | 0.000185 |
| 2 | Standard AE | 45 | 0.001472 |
| 2 | LSTM-AE | 57 | 0.000179 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Oyedeji, A.; Olukanmi, P. Anomaly Detection in Temporal Power Grid Using an LSTM Autoencoder Two-Phase Framework. Eng. Proc. 2026, 140, 6. https://doi.org/10.3390/engproc2026140006
Oyedeji A, Olukanmi P. Anomaly Detection in Temporal Power Grid Using an LSTM Autoencoder Two-Phase Framework. Engineering Proceedings. 2026; 140(1):6. https://doi.org/10.3390/engproc2026140006
Chicago/Turabian StyleOyedeji, Ajibola, and Peter Olukanmi. 2026. "Anomaly Detection in Temporal Power Grid Using an LSTM Autoencoder Two-Phase Framework" Engineering Proceedings 140, no. 1: 6. https://doi.org/10.3390/engproc2026140006
APA StyleOyedeji, A., & Olukanmi, P. (2026). Anomaly Detection in Temporal Power Grid Using an LSTM Autoencoder Two-Phase Framework. Engineering Proceedings, 140(1), 6. https://doi.org/10.3390/engproc2026140006

