Optimized Ensemble Deep Learning for User Load Forecasting and Residual-Based Anomaly Detection
Abstract
Accurate load forecasting (LF) and effective anomaly detection (AD) at the individual household level are crucial for ensuring efficient energy management in smart grids. Yet, it remains challenging due to high variability in user behavior and data anomalies. This paper proposes an integrated two-stage consumer level framework that combines multiple deep learning LF models with residual-based AD for smart grid monitoring. In the first stage, six diverse deep learning models: LSTM, CNN-LSTM, GRU, Bi-LSTM, DNN, and TCN are combined using an optimization approach based on Sequential Least Squares Programming (SLSQP) to compute optimal ensemble weights. The proposed ensemble model demonstrated better predictive accuracy compared to individual models, achieving lower RMSE, MAE, and MAPE, along with higher R2 scores, for both one-day and seven-day ahead forecasting tasks. The models are trained on a subset of consumption users with different load profiles from the ISSDA load dataset of 5,000 customers. Secondly, for anomaly detection, residuals computed from the forecasting errors are analyzed using Isolation Forest, Local Outlier Factor, and Autoencoder methods, complemented by a dynamic thresholding strategy to account for temporal variability. To evaluate generalization capability, the proposed framework was further validated using another electricity load dataset from the UCI repository. Experimental results demonstrated that the forecasting–detection pipeline effectively adapts to varying consumption behaviors, yielding improved forecasting accuracy and more reliable AD, particularly over longer forecasting horizons. In addition, analyses of computational complexity and scalability confirmed its suitability for practical smart-grid deployment.