A Hybrid CNN–Transformer Deep Learning Model for Household Electric Energy Consumption Forecasting
Elaf Adel Abbas, Raaid Alubady, Aqeel Sahi, Mohammed DiykhAn accurate electrical energy consumption forecast is important for grid stability and efficient energy management. However, existing models, including RNNs and their variants, often struggle to capture complex local patterns and long‐range temporal dependencies in high‐resolution energy data. This paper introduces a novel hybrid deep learning architecture that combines a convolutional neural network (CNN) with a transformer encoder. The CNN frontend is designed to extract key local features and short‐term fluctuations from the time series. The transformer’s self‐attention mechanisms model global, long‐term dependencies over these extracted features. A thorough evaluation is conducted using the benchmark individual household electric power consumption (IHEPC) datasets, including AMPds2 and IHEPC. The proposed model is evaluated across four horizons: minutely, hourly, daily and weekly. The results showed that the proposed CNN–transformer model outperformed the baseline models. Experimental results demonstrate that the proposed model consistently outperforms the baseline methods across hourly, daily and weekly forecasting horizons, achieving lower MSE, RMSE, MAE and MAPE values on the evaluated datasets. On the IHEPC hourly dataset, the proposed model achieved an MSE of 0.0459, RMSE of 0.2143, MAE of 0.1555 and MAPE of 18.12%, while the ablation study further demonstrated the performance gains obtained by integrating the CNN and transformer components. From a practical perspective, the proposed framework can help grid operators improve energy scheduling, resource allocation and operational planning. Its enhanced forecasting capability can also facilitate the reliable integration of renewable energy sources (RES), contributing to more sustainable and resilient smart‐grid systems with broader societal benefits.