Anomaly Detection in Electrical Energy Consumption Using Long Short-Term Memory (LSTM)

Abstract Views: 6   PDF Downloads: 2

Authors

  • Andi Zulherry Universitas Muhammadiyah Sumatera Utara
  • Mhd. Basri Universitas Muhammadiyah Sumatera Utara
  • muhammad Gunawan Universitas Muhammadiyah Sumatera Utara

DOI:

https://doi.org/10.56211/tsabit123

Keywords:

Anomaly Detection; Electrical Energy Consumption; Long Short-Term Memory; Smart Meter; Time Series; Machine Learning

Abstract

The increasing deployment of smart meters has generated large volumes of electrical energy consumption data, creating new opportunities for intelligent anomaly detection to reduce non-technical losses, equipment failures, and abnormal consumption patterns. Conventional statistical and rule-based approaches often struggle to capture complex temporal dependencies in sequential electricity usage data. This study proposes a Long Short-Term Memory (LSTM)-based anomaly detection model to identify abnormal electricity consumption patterns with high accuracy. A time-series dataset consisting of historical hourly electricity consumption records was collected from smart metering systems and preprocessed through missing-value imputation, normalization using Min-Max Scaling, and sequence windowing. The proposed LSTM model was trained to learn normal consumption behavior and detect anomalies based on prediction error using an adaptive threshold determined from reconstruction residuals. Model performance was evaluated using accuracy, precision, recall, F1-score, and Area Under the Receiver Operating Characteristic Curve (AUC), and compared with conventional Machine Learning methods, including Support Vector Machine (SVM) and Isolation Forest. Experimental results demonstrate that the proposed LSTM model achieved an accuracy of 97.3%, precision of 96.8%, recall of 97.9%, F1-score of 97.3%, and an AUC of 0.985, outperforming the baseline models in detecting anomalous electricity consumption patterns. The superior performance is attributed to the LSTM architecture's ability to model long-term temporal dependencies and nonlinear consumption behaviors. These findings indicate that LSTM provides an effective and reliable approach for real-time anomaly detection in smart energy systems, supporting intelligent energy management, reducing power losses, and improving the operational reliability of modern electrical distribution networks.

Downloads

Download data is not yet available.

References

Book: Single Author

[1] Indah Purnama Sari. Algoritma dan Pemrograman. Medan: UMSU Press, 2023, pp. 290.

[2] Indah Purnama Sari. Buku Ajar Pemrograman Internet Dasar. Medan: UMSU Press, 2022, pp. 300.

[3] Indah Purnama Sari. Buku Ajar Rekayasa Perangkat Lunak. Medan: UMSU Press, 2021, pp. 228.

Book: Two or More Authors

[4] Janner Simarmata Arsan Kumala Jaya, Syarifah Fitrah Ramadhani, Niel Ananto, Abdul Karim, Betrisandi, Muhammad Ilham Alhari, Cucut Susanto, Suardinata, Indah Purnama Sari, Edson Yahuda Putra. Komputer dan Masyarakat. Medan: Yayasan Kita Menulis, 2024, pp.162.

[5] Mahdianta Pandia, Indah Purnama Sari, Alexander Wirapraja Fergie Joanda Kaunang, Syarifah Fitrah Ramadhani Stenly Richard Pungus, Sudirman, Suardinata Jimmy Herawan Moedjahedy, Elly Warni, Debby Erce Sondakh. Pengantar Bahasa Pemrograman Python. Medan : Yayasan Kita Menulis, 2024, pp.180

[6] Zelvi Gustiana Arif Dwinanto, Indah Purnama Sari, Janner Simarmata Mahdianta Pandia, Supriadi Syam, Semmy Wellem Taju Fitrah Eka Susilawati, Asmah Akhriana, Rolly Junius Lontaan Fergie Joanda Kaunang. Perkembangan Teknologi Informatika. Medan: Yayasan Kita Menulis, 2024, pp.158

[7] Roberto Kaban, Andi Ikmal Rachman, Indah Purnama Sari, Andi Zulherry, Mhd Basri, Nur Fadilah, Nurul Maulidiyah, David JM Sembiring, Gelard Untirtha Pratama, Ronal Ronal, Rizki Yustisia Sari, Riah Ukur Ginting, Mardhiyatna Mardhiyatna, Ahyuna Ahyuna, Medan : Yayasan Kita Menulis, 2026.

Journal Article from the Internet

[8] S. Hochreiter and J. Schmidhuber, "Long Short-Term Memory," Neural Computation, vol. 9, no. 8, pp. 1735–1780, 1997.

[9] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. Cambridge, MA, USA: MIT Press, 2016.

[10] Zulherry, A., Sari, I.P., & Basri, M. (2026). Perancangan dan Implementasi Segmentasi LAN pada Infrastruktur Jaringan Skala Menengah. Hello World Jurnal Ilmu Komputer 4 (4), 202-206

[11] F. Chollet, Deep Learning with Python, 2nd ed. Shelter Island, NY, USA: Manning Publications, 2021.

[12] Sari, I.P., Al-Khowarizmi, A.K., & Batubara, I.H. (2021). Cluster Analysis Using K-Means Algorithm and Fuzzy C-Means Clustering For Grouping Students' Abilities In Online Learning Process. Journal of Computer Science, Information Technology and Telecommunication Engineering, Vol. 2 No. 1, page 139-144

[13] Ahlansyah, W., & Sari, I.P. (2026). Perancangan Tempat Sampah Pintar Berbasis IOT untuk Pemilahan Sampah Otomatis Menggunakan Sensor Infrared dan Pemantauan Real-Time. Hello World Jurnal Ilmu Komputer 5 (1), 59-68

[14] Sari, I.P., Fahroza, M.F., Mufit, M.I., & Qathrunad, I.F. (2021). Implementation of Dijkstra's Algorithm to Determine the Shortest Route in a City. Journal of Computer Science, Information Technology and Telecommunication Engineering,Vol. 2 No. 1, page 134-138

[15] Rangkuti, A.R.S., & Sari, I.P. (2026). Penggunaan Fitur Warna Cielab Dalam Segmentasi Kematangan Buah Kakao Dengan Algoritma K-Means Clustering. Hello World Jurnal Ilmu Komputer 5 (1), 36-46

[16] Sari, I.P., Al-Khowarizmi, A.K., Ramadhani, F., & Sulaiman, O.K. (2023). Implementation of the Selection Sort Algorithm to Sort Data in PHP Programming Language. Journal of Computer Science, Information Technology and Telecommunication Engineering, Vol. 4 No. 1, page 377-381

[17] Manurung, A.A., Nasution, M.D., & Sari, I.P. (2023). Implementation of Fuzzy K-Nearest Neighbor Method in Dengue Disease Classification. 2023 11th International Conference on Cyber and IT Service Management (CITSM)

[18] Ramadhani, F., Satria, A., & Sari, I.P. (2023). Implementasi Metode Fuzzy K-Nearest Neighbor dalam Klasifikasi Penyakit Demam Berdarah. Hello World Jurnal Ilmu Komputer 2 (2), 58-62

[19] G. E. Hinton and R. R. Salakhutdinov, "Reducing the Dimensionality of Data with Neural Networks," Science, vol. 313, no. 5786, pp. 504–507, 2006.

[20] Sari, I.P., Batubara, I.H., Ramadhani, F., & Wardani, S. (2022). Perancangan Sistem Antrian pada Wahana Hiburan dengan Metode First In First Out (FIFO). Sudo Jurnal Teknik Informatika 1 (3), 116-123

[21] Ramadhani, F., Satria, A., & Sari, I.P. (2022). Aplikasi internet berbasis website sebagai E-Commerce penjualan komponen sport car. Blend Sains Jurnal Teknik 1 (2), 69-75

[22] Sari, I.P., Al-Khowarizmi, A., & Ramadhani, F. (2021). User Interface Prototype Using User Centered System Design Method in Motorvice Information System. 2021 International Conference on Computer Science and Engineering (IC2SE) 1, 1-6

[23] Ramadhani, F., Al-Khowarizmi, A.K., & Sari, I.P. (2021). Improving the Performance of Naïve Bayes Algorithm by Reducing the Attributes of Dataset Using Gain Ratio and Adaboost. 2021 International Conference on Computer Science and Engineering (IC2SE) 1, 1-5

[24] Sitompul, D.N., Rahmatika, A., & Sari, I.P. (2023). Application of The Sales and Purchase Program Using The Rapid Application Development Model. Al'adzkiya International of Computer Science and Information Technology (AIoCSIT) Journal, Vol. 4 No. 1, page 6-16

[25] Sari, I.P., Ramadhani, F., Satria, A., & Apdilah, D. (2023). Implementasi Pengolahan Citra Digital dalam Pengenalan Wajah menggunakan Algoritma PCA dan Viola Jones. Hello World Jurnal Ilmu Komputer 2 (3), 146-157

[26] Batubara, I.H., Sari, I.P., Siregar, E.F.S., & Lubis, B.S. (2021). Meningkatkan Kemampuan Penalaran Matematika Melalui Metode Penemuan Terpandu Berbantuan Software Autograph. Seminar Nasional Teknologi Edukasi Sosial dan Humaniora 1 (1), 699-705

[27] Ardini, R.D., & Sari, I.P. (2026). Implementasi Algoritma Support Vector Machine (SVM) Dan Logistic Regression Dalam Menganalisis Sentimen Tanggapan Masyarakat Terhadap Tiktok Shop Di Social Media. Hello World Jurnal Ilmu Komputer 5 (1), 23-35

[28] Apdilah, D., & Sari, I.P. (2021). Optimization Of The Fuzzy C-Means Cluster Center For Credit Data Grouping Using Genetic Algorithms. Al'adzkiya International of Computer Science and Information Technology (AIoCSIT) Journal, Vol. 2 No. 2, page 156-163

[29] Sari, I.P., Ramadhani, F., Satria, A., & Sulaiman, O.K. (2023). Leukocoria Identification: A 5-Fold Cross Validation CNN and Adaboost Hybrid Approach. 2023 6th International Seminar on Research of Information Technology and Intelligent Systems (ISRITI). 486-491

[30] Sitompul, M.F.A., & Sari, I.P. (2026). Implementasi Algoritma Dijkstra Dalam Penentuan Rute Distribusi Beras SPHP Di Perum Bulog Kanwil Sumut. Hello World Jurnal Ilmu Komputer 4 (4), 218-225

[31] Sari, I.P., Al-Khowarizmi, A.K., Sulaiman, O.K., & Apdilah, D. (2023). Implementation of Data Classification Using K-Means Algorithm in Clustering Stunting Cases. Journal of Computer Science, Information Technology and Telecommunication Engineering, Vol. 4 No. 2, page 402-412

[32] Sari., I.P, Batubara., I.H, Al-Khowarizmi., A, & PP Hariani. (2022). Perancangan Sistem Informasi Pengelolaan Arsip Digital Berbasis Web untuk Mengatur Sistem Kearsipan di SMK Tri Karya. Wahana Jurnal Pengabdian kepada Masyarakat 1 (1), 18-24

[33] Habibi., F, Qathrunada., I.F, & Anggraini., T. (2023). “Design and Build a Tourism Website Using Shopify Framework”. Hanif Journal of Information Systems. Vol. 1 No. 1, 2023.

[34] Sari., I.P, A Syahputra, N Zaky, RU Sibuea, & Z Zakhir. (2022). Perancangan sistem aplikasi penjualan dan layanan jasa laundry sepatu berbasis website. Blend sains jurnal teknik 1 (1), 31-37

[35] Sari., I.P, A Azzahrah, FQ Isnaini, L Nurkumala, & A Thamita. (2022). Perancangan sistem absensi pegawai kantoran secara online pada website berbasis HTML dan CSS. Blend sains jurnal teknik 1 (1), 8-15

[36] Septiana., D. (2024). Forecasting Rice Prices with Holt-Winter Exponential Smoothing Model. Hanif Journal of Information Systems. Vol. 1 No. 2, 2024.

[37] Sulaiman, O.K., & Sari, I.P. (2021). Implementation Data Mining For Level Analysis Traffic Violation By Algorithm Association Rule. Al'adzkiya International of Computer Science and Information Technology (AIoCSIT) Journal, Vol. 2 No. 2, page 128-135

[38] Sari, I.P., Hariani, P.P ., Al-Khowarizmi, A.K., Ramadhani, F., Sulaiman, O.K., Satria, A., & Manurung, A.A. (2024). CLUSTERING HIV/AIDS DISEASE USING K-MEANS CLUSTERING ALGORITHM. Proceeding International Seminar on Islamic Studies. Vol. 5, No. 1 (2024), 1668-1676

[39] P. Malhotra, L. Vig, G. Shroff, and P. Agarwal, "Long Short Term Memory Networks for Anomaly Detection in Time Series," in Proceedings of the European Symposium on Artificial Neural Networks (ESANN), Bruges, Belgium, 2015, pp. 89–94.

[40] Zulherry, A., Riadi, I., & Umar, R. (2026). Anomaly Detection in Cloud Device-Based Information Technology Infrastructure Using Isolation Forest Algorithm. Journal Of Informatics And Telecommunication Engineering 9 (2)

[41] Sari, I.P., & Zulherry, A. (2025). Development of A Smart Monitoring System for IoT–Based Tide Observation. Al'adzkiya International of Computer Science and Information Technology (AIoCSIT) Journal, 6 (2), 18-23

[42] Zulherry, A., Gunawan, M., & Sari, I.P. (2025). Development of an Android-Based Smart Health Monitoring Device for Heartbeat Detection. Al'adzkiya International of Computer Science and Information Technology (AIoCSIT) Journal, 6 (2), 43-47

[43] Sari, I.P., Zulherry, A., Basri, M., & Hayani W. (2025). Pembelajaran Pemrograman berbasis Machine Learning sebagai Upaya Peningkatan Computational Thinking. Jurnal Penelitian, Pendidikan dan Pengajaran: JPPP 6 (3), 245-250

[44] Bisono, A. T., & Zulherry, A. (2025). Analisis sentimen game Genshin Impact untuk mengetahui reaksi dan harapan pemain menggunakan metode Naïve Bayes. sudo Jurnal Teknik Informatika, 4(2), 183-193.

[45] Basri, M., & Zulherry, A. (2025). Analysis of the Impact of Gambling and Online Loans in the Perspective of Informatics, Islam, and Kemuhammadiyahan. Ar-Rasyid: Jurnal Pendidikan Agama Islam, 5(1), 65-73.

[46] Asadel, A., & Zulherry, A. (2025). Detecting Zero-Width Characters Obfuscated in Phishing URLs using the XGBOOST Algorithm. Hanif Journal of Information Systems 3 (1), 43-53

[47] V. Chandola, A. Banerjee, and V. Kumar, "Anomaly Detection: A Survey," ACM Computing Surveys, vol. 41, no. 3, pp. 1–58, 2009.

[48] H. Liu, M. Shah, and W. Jiang, "Deep Learning for Time Series Classification and Forecasting: A Survey," Data Mining and Knowledge Discovery, vol. 35, no. 6, pp. 2283–2318, 2021.

[49] International Energy Agency (IEA), Electricity Market Report 2024. Paris, France: IEA Publications, 2024.

[50] Zulherry, A., Sari, I.P., & Basri, M. (2025). Perancangan Aplikasi Monitoring Kehadiran Pegawai Menggunakan RFID. sudo Jurnal Teknik Informatika 4 (4), 378-384

[51] Ichsan, A., Zulherry, A., Lubis, T. A., & Shahnaz, B. A. Z. (2025). Utilization of Mobile Applications to Speed Up The Search for Android-Based Index Places. IJATCoS: Indonesian Journal of Applied Technology. Computer and Science, 2(1).

[52] Amada, E.P., & Zulherry, A. (2025). Klasterisasi Minat Dan Bakat Siswa Menggunakan Metode X-Means Berbasis Web: Studi Kasus SMA Negeri 1 Hamparan Perak. sudo Jurnal Teknik Informatika 4 (4), 276-283.

[53] Zulherry, A., Ramadhani, F., & Satria, A. (2024). Klasifikasi Data Tracer Study Dengan Pemanfaatan Data Mining Menggunakan Algoritma Support Vector Machine dan Neural Network. Portal Riset dan Inovasi Sistem Perangkat Lunak 2 (1), 45-54

[54] Zulherry, A. (2023). Decision making for network security with simple additive weighting method. Journal of Intelligent Decision Support System (IDSS), 6(3), 155-159.

[55] Zulherry, A., Gunawan, T. S., & Wanayumini, W. (2021). Analisis Hasil Pendukung Keputusan Mendapatkan Rumah Dinas Perusahaan Menggunakan Metode Analytical Hierarchy Process (AHP) dan Technique for Order Preference by Similarity to Ideal Solution (TOPSIS). Jurnal Media Informatika Budidarma, 5(2), 695-704.

[56] A. Géron, Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow, 3rd ed. Sebastopol, CA, USA: O'Reilly Media, 2023.

[57] T. Hastie, R. Tibshirani, and J. Friedman, The Elements of Statistical Learning: Data Mining, Inference, and Prediction, 2nd ed. New York, NY, USA: Springer, 2009.

[58] P. H. C. Eilers and J. J. Goeman, "Enhancing scatterplots with smoothed densities," Bioinformatics, vol. 20, no. 5, pp. 623-628, March 2004. [Online]. Available: www.oxfordjournals.org. [Accessed Sept. 18, 2004].

Downloads

Published

2026-07-15

PlumX Metrics