A Computer Vision and Transformer-Based Framework for Short-Term Energy Consumption Forecasting in Smart Grids

Main Article Content

Ahmed Saadi

Abstract


Accurate short-term energy consumption forecasting is critical for the efficient operation of smart grids to balance the loads in advance, implement demand response on the consumer side, and reduce distribution costs. However, most of the existing deep learning methods, including LSTMs and CNN-based models, are unable to capture both long-range temporal patterns and the fine-grained local patterns within high-resolution smart meter data simultaneously. In this paper, we propose a novel hierarchical transformer-based framework called EF-Transformer for short-term energy forecasting, which consists of a multi-scale patch embedding module, a dual-branch temporal attention encoder, and an adaptive decomposition gate that decomposes and handles non-stationary trend and seasonal components. We evaluate the proposed model on three publicly available benchmark datasets, including the UCI Individual Household Electric Power Consumption dataset, the Electricity Load Diagrams 2011-2014 dataset, and the Smart Meter Energy Consumption dataset, and on the UCI household dataset, EF-Transformer achieves the best MAE of 0.091 kWh, RMSE of 0.134 kWh, and MAPE of 2.87% among the state-of-the-art models, including LSTM, Auto former, Informer, and Patch-TST. We conduct ablation experiments to demonstrate that all the components of the architecture contribute to the state-of-the-art performance, and overall, EF-Transformer provides a scalable and interpretable solution for smart grid operators who require accurate short-term consumption forecasts at both household and grid levels.




 

Article Details

Section

Computer Science

How to Cite

A Computer Vision and Transformer-Based Framework for Short-Term Energy Consumption Forecasting in Smart Grids . (2026). AlKadhim Journal for Computer Science, 4(3), 110-121. https://doi.org/10.61710/pxx89666

References

[1] Y. Wang, Q. Chen, T. Hong and C. Kang, "Review of Smart Meter Data Analytics: Applications, Methodologies, and Challenges," in IEEE Transactions on Smart Grid, vol. 10, no. 3, pp. 3125-3148, May 2019, doi: 10.1109/TSG.2018.2818167.

[2] A. Marinakis, M. Glavic and T. Van Cutsem, "Minimal Reduction of Unscheduled Flows for Security Restoration: Application to Phase Shifter Control," in IEEE Transactions on Power Systems, vol. 25, no. 1, pp. 506-515, Feb. 2010, doi: 10.1109/TPWRS.2009.2030423.

[3] N. B. Badhe, R. P. Neve, V. P. Yele, S. Abhang, K. M. Dhule, and D. Mali, “An optimized system for predicting energy usage in smart grids using temporal fusion transformer and Aquila optimizer,” Front. Artif. Intell., vol. 8, Art. no. 1542320, Apr. 2025, doi: 10.3389/frai.2025.1542320.

[4] Giacomazzi, Elena & Haag, Felix & Hopf, Konstantin. (2023). Short-Term Electricity Load Forecasting Using the Temporal Fusion Transformer: Effect of Grid Hierarchies and Data Sources. 353-360. 10.1145/3575813.3597345.

[5] C. Wu, J. Li, W. Liu, Y. He, and S. Wang, “Deep learning integration optimization of electric energy load forecasting and market price based on the ANN–LSTM–transformer method,” Front. Energy Res., vol. 11, Art. no. 1292204, Nov. 2023, doi: 10.3389/fenrg.2023.1292204.

[6] W. Kong, Z. Y. Dong, Y. Jia, D. J. Hill, Y. Xu, and Y. Zhang, “Short-term residential load forecasting based on LSTM recurrent neural network,” IEEE Trans. Smart Grid, vol. 10, no. 1, pp. 841–851, Jan. 2019, doi: 10.1109/TSG.2017.2753802.

[7] J. Chung and B. Jang, “Accurate prediction of electricity consumption using a hybrid CNN-LSTM model based on multivariable data,” PLOS ONE, vol. 17, no. 11, Art. no. e0278071, Nov. 2022, doi: 10.1371/journal.pone.0278071.

[8] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, “Attention is all you need,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 30, 2017.

[9] H. Zhou, S. Zhang, J. Peng, S. Zhang, J. Li, H. Xiong, and W. Zhang, “Informer: Beyond efficient transformer for long sequence time-series forecasting,” in Proc. AAAI Conf. Artif. Intell., vol. 35, pp. 11106–11115, 2021, doi: 10.1609/aaai.v35i12.17325.

[10] H. Wu, J. Xu, J. Wang, and M. Long, “Autoformer: Decomposition transformers with auto-correlation for long-term series forecasting,” in Proc. Adv. Neural Inf. Process. Syst. (NeurIPS), vol. 34, pp. 22419–22430, 2021.

[11] Y. Nie, N. H. Nguyen, P. Sinthong, and J. Kalagnanam, “A time series is worth 64 words: Long-term forecasting with transformers,” in Proc. Int. Conf. Learning Representations (ICLR), 2023.

[12] I. Ahmad and M. A. Hafeez, “Energy load forecasting using a dual-stage attention-based recurrent neural network,” Appl. Sci., vol. 11, no. 21, Art. no. 10484, Nov. 2021, doi: 10.3390/app112110484.

[13] Y. Wang, W. Jiang, C. Wang, Q. Song, T. Zhang, Q. Dong, and X. Li, “An electricity load forecasting model based on multilayer dilated LSTM network and attention mechanism,” Front. Energy Res., vol. 11, Art. no. 1116465, May 2023, doi: 10.3389/fenrg.2023.1116465.

[14] P. Ran, K. Dong, X. Liu, and J. Wang, “Short-term load forecasting based on CEEMDAN and transformer,” Electr. Power Syst. Res., vol. 214, Art. no. 108885, 2023, doi: 10.1016/j.epsr.2022.108885.

[15] C. Xu and G. Chen, “Interpretable transformer-based model for probabilistic short-term forecasting of residential net load,” Int. J. Electr. Power Energy Syst., vol. 155, Art. no. 109515, 2024, doi: 10.1016/j.ijepes.2023.109515.

[16] B. Lim, S. Ö. Arık, N. Loeff, and T. Pfister, “Temporal fusion transformers for interpretable multi-horizon time series forecasting,” Int. J. Forecasting, vol. 37, no. 4, pp. 1748–1764, 2021, doi: 10.1016/j.ijforecast.2021.03.012.

[17] P. H. Canh, N. Q. Minh, N. D. Tien, and T. T. Q. Anh, “Short-term electricity load forecasting based on temporal fusion transformer model,” IEEE Access, vol. 10, pp. 106296–106304, 2022, doi: 10.1109/ACCESS.2022.3211941.

[18] C. Wu, J. Li, W. Liu, Y. He, and S. Wang, “Deep learning integration optimization of electric energy load forecasting and market price based on the ANN–LSTM–transformer method,” Front. Energy Res., vol. 11, Art. no. 1292204, 2023, doi: 10.3389/fenrg.2023.1292204.

[19] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” in Proc. Int. Conf. Learning Representations (ICLR), 2015.

[20] G. Hebrail and A. Berard, “Individual Household Electric Power Consumption Dataset,” UCI Machine Learning Repository, 2012. [Online]. Available: HTTPS://ARCHIVE.ICS.UCI.EDU/DATASET/235/INDIVIDUAL+HOUSEHOLD+ELECTRIC+POWER+CONSUMPTION

[21] A. Trindade, “Electricity Load Diagrams 2011–2014 Dataset,” UCI Machine Learning Repository, 2015. [Online]. Available: https://archive.ics.uci.edu/dataset/321/electricityloaddiagrams20112014

[22] Department of Energy and Climate Change (DECC), “Smart Meter Energy Consumption Data,” UK Government Open Data, 2013. [Online]. Available: https://data.london.gov.uk/dataset/smartmeter-energy-use-data-in-london-households

Similar Articles

You may also start an advanced similarity search for this article.