Anomaly Detection in Electrical Energy Consumption Using Long Short-Term Memory (LSTM) - Andi Zulherry; Mhd. Basri; muhammad Gunawan (Tsabit Journal of Computer Science, 2026)
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.