Artificial Neural Network Based Short Term Electrical Load Forecasting
Artificial Neural Network Based Short Term Electrical Load Forecasting
Artificial Neural Network Based Short Term Electrical Load Forecasting
Oon Yi Her, Mohd Saiful Azimi Mahmud, Mohamad Shukri Zainal Abidin, Razman Ayop,
Salinda Buyamin
School of Electrical Engineering, Faculty of Engineering, Universiti Teknologi Malaysia Skudai, Johor Bahru, Malaysia
Corresponding Author:
Mohd Saiful Azimi Mahmud
Control and Mechatronics Engineering Division, School of Electrical Engineering, Faculty of Engineering
Universiti Teknologi Malaysia Skudai, 81310 Skudai Johor, Malaysia
Email: [email protected]
1. INTRODUCTION
Electrical energy is a very crucial resource of modern human society as it powered various
important industries that satisfy human needs. However, electricity is difficult to be produced and distributed
especially in large scale area. In addition to that, electrical energy storage system does not have widespread
implementation due to economic reasoning as most of the generated electricity must be consumed
immediately. Therefore, to ensure that the power system distribution operation to be running smoothly, an
efficient load forecasting system is required [1]. In general, electrical load forecasting is divided into three
types which are short-term load forecasting (STLF), medium-term load forecasting (MTLF) and long-term
load forecasting [2]. Each type is divided based on different forecasting ranges. In designing load forecasting
system, an inaccurate forecast will cause a mismatch between demand and generation of electrical power and
eventually it will result in significant amount of money loss. Thus, the selection of load forecasting method
needs to be chosen based on its application to solve specific load forecasting type.
Load forecasting methods can be categorized in three major groups which are traditional forecasting
technique, Modified forecasting technique and soft computing technique. All types of load forecasting
methods have their own advantage and disadvantage and their usage is dependent on the load pattern, type of
model inputs and forecasting time horizon. In traditional forecasting method, conventional mathematical
techniques such as regression [3], [4], multiple-regression [5] and exponential smoothing [6], [7] is usually
used. From all available traditional forecasting methods, the multiple-regression technique is the most
popular and has been widely used to forecast the load that are affected by numerous factors from
meteorological effects, electricity prices, economic growth and others.
The modified traditional forecasting method is designed by modifying the traditional methods to
enable the automatic parameter correction of forecasting model under changing environmental conditions.
Some of the techniques used in modified traditional forecasting are adaptive load forecasting [8], [9],
stochastic time series [10] and support vector machine [11], [12]. By comparing all methods in this category,
the adaptive load forecasting method has the most advantages as the demand forecasting model parameters
are automatically corrected to keep track of the changing load conditions, thus enable the prediction system
to be used on-line.
Recently, soft computing techniques have been emerging as a flexible approach to forecast the
electrical load in power system. This technique mimics the human reasoning system to employ the ability to
produce mode of reasoning that is approximate rather than accurate. This method using algorithms such as
fuzzy logic [13]−[15], artificial neural network (ANN) [16]−[19] and evolutionary algorithms such as genetic
algorithm [20]−[22] and particle swarm optimizations [23]−[25]. In soft computing method, each factor
affecting the forecast is considered as a cost and the method will exploit all possibilities to find the potential
solution based on the computed costs.
Each algorithm in soft computing techniques has its own advantages and disadvantages. In fuzzy
logic based method, the knowledge must be adapted accurately using fuzzy rules as the quality of the
forecasting system will be mainly affected by the fuzzy rules. In ANN based methods, the selection of the
parameters needed in training the models must be carefully chosen as each parameter will affect the
performance of the forecasting system. Finally, solution generated by the evolutionary algorithm usually fall
into local minimum thus creating low quality electrical load prediction for power systems. Therefore, the
implementation of soft computing technique needs a careful design process to create an efficient load
forecasting system.
As ANN comes with different configuration, this paper proposed analysis on the effect of ANN
parameters towards short-term load forecasting system. In this paper, multiple layers feed forward network
will be used which will predict the electrical usage a day ahead in 24-hours using historical data, day of
week, week of month and month of year as the inputs. The analysis of different number of hidden layers and
activation function types are conducted in this paper to find the most optimized parameters in short team load
forecasting.
2. RESEARCH METHOD
Figure 1 shows the overall process for short term load forecasting. In this paper, a densely connected
feedforward ANN with backpropagation learning algorithm will be used to implement the short-term load
forecast. Based on Figure 1, the process of SLTF starts with the data initialization where the historical data
were loaded. Then, the data was preprocessed where encoding process is executed in this stage. After the date
has been loaded, the model will be trained where different activation function will be used to find the best
activation function for the model. Finally, the hidden layer experiment is conducted where different number
of hidden layers will be tested to analyze the effect of number of hidden layers towards the prediction quality.
In this paper, 48 input neurons will be used and 50 hidden neurons were arbitrary chosen to forecast the
electrical load. In the output layer, 24 neurons were selected and mean absolute error is used as the loss
function which will be optimized using gradients descent algorithm using Keras SGD class. As a result, a
total of 3674 trainable parameters for single layer model, 6224 trainable parameters for two layers model and
8774 trainable parameters for three layers model is required for this architecture.
Artificial neural network based short term electrical load forecasting (Oon Yi Her)
588 ISSN: 2088-8694
To implement the input data into the ANN, bit encoding method is used in this paper. 7 input
neurons were used for the day of week data. For instance, if it is Sunday, the first neurons of day of week
neurons group will give 1 as input and 5 neurons will be used for the week of month. The month of year will
used 12 neurons input following the similar method. It should be noted that the day of week, week of month
and month of year inputs should be 24 hours load input day date. For instance, if the forecast day is 5
September 2018 and the input day is 3 September 2018, the day of week is Monday and will be encoded as
0100000, it is second week of the month so it will be encoded as 01000 and ninth month of the year and
encode as 000000001000. Then the 24-hours load input data will be taken from 3 September 2018 to predict
the load on 5 September 2018.
As shown in (1), 𝑋 is the exact value of our data, 𝑋’ is the normalized value, 𝑋𝑚𝑎𝑥 represents the
maximum value of dataset and 𝑋𝑚𝑖𝑛 represents the minimum value of the dataset. The maximum load value
used is 1048 MWh and the minimum load value used is 291 MWh. Both of these values are the highest and
lowest load from year 2016 until 2017. In addition, any load value from year 2018 that exceed this minimum
and maximum range will be removed. Finally, the chosen parameter is measure based on the value of mean
absolute percentage error (MAPE). Daily best and worst absolute percentage error were recorded for
performance analysis. The testing MAPE will be plotted against the training MAPE for overfitting analysis in
this paper. The description of overfitting analysis is shown in Figure 3.
For overfitting analysis, a secondary training loop has been set up based to Figure 3. At every 50
training epochs, the training MAPE will be inspected either it has been falling under certain range given in
Int J Pow Elec & Dri Syst, Vol. 13, No. 1, March 2022: 586-593
Int J Pow Elec & Dri Syst ISSN: 2088-8694 589
the conditions shown in Figure 3. If it falls into the range, the current model will be stored. The original
attempt was conducted to train the models to a very low training MAPE, as low as 3%. However, overfitting
occurred much sooner and more often than expected. Therefore, this secondary training loop is the attempt to
capture a model just before it over-trained occurs to the model.
Artificial neural network based short term electrical load forecasting (Oon Yi Her)
590 ISSN: 2088-8694
(a) (b)
(c) (d)
Figure 4. Test MAPE vs train MAPE (a) Tanh, (b) sigmoid, (c) softsign, and (d) exponential
Table 2. Average absolute percentage error for the best and worst forecast day
Model Best Individual Day Average Worst Individual Day Average
Absolute Percentage Error (%) Absolute Percentage Error (%)
Tanh 1.38 48
Sigmoid 4.18 68.23
Softsign 2.32 47.94
Exponential 3.65 52.02
By referring to the table, the lowest average absolute percentage Error for the best individual day is
found to be from Tanh and then followed by softsign, exponential and sigmoid. However, the lowest average
absolute percentage error for the worst individual day is found to be from softsign and then followed by
Tanh, exponential and sigmoid. Although Tanh falls into second place, the percentage difference is low as it
is only about 0.06%. Based on this analysis, Tanh activation function has been selected as the ANN model in
investigating the effect of hidden layer number to the forecasting performance which will be explained in the
next section.
Int J Pow Elec & Dri Syst, Vol. 13, No. 1, March 2022: 586-593
Int J Pow Elec & Dri Syst ISSN: 2088-8694 591
table, it can be shown that the two hidden layers model has shown superiorities compared to three hidden
layers model with lower MAPE in test and train MAPE. Therefore, the two hidden layer model is
recommended to be used in short term load forecasting.
(a) (b)
Figure 5. Test MAPE vs train MAPE (a) two hidden layers and (b) three hidden layers
Figure 6 shows the best day forecast sample where Figure 6 (a) is for two hidden layer and Figure 6 (b)
is for three hidden layers. Figure 7 shows the worst day forecast sample in a day where Figure 7 (a) is for two
hidden layer and Figure 7 (b) is for three hidden layers. Table 4 shows the average absolute percentage error for
the best and worst forecast day for two and three hidden layers. From the table, it can be shown that the two
hidden layers model shows better performance compared to the three hidden layers. Therefore, it is highly
recommended to use two hidden layers Tanh activation function in predicting the short-term electrical load.
(a) (b)
Figure 6. Best day forecast sample in (a) two hidden layers and (b) three hidden layers
(a) (b)
Figure 7. Worst day forecast sample in (a) two hidden layers and (b) three hidden layers
Table 4. Average absolute percentage error for the best and worst forecast day for different hidden layer
Model Best individual day average Worst individual day average absolute
absolute percentage error (%) percentage error (%)
Two hidden layers (Tanh) 1.29 47.9
Three hidden layers (Tanh) 2.49 51.24
Artificial neural network based short term electrical load forecasting (Oon Yi Her)
592 ISSN: 2088-8694
4. CONCLUSION
The objective of this paper is to investigate the best ANN configuration for short term load
forecasting. To find the most optimized ANN configuration, the performance of different ANN activation
function is conducted where single hidden layer of Tanh, sigmoid, softsign and exponential function is
chosen and the performance was measured and compared. Based on the comparison, Tanh activation function
shows the best performance with 1.38% best individual day average absolute percentage error and 48% worst
individual day average absolute percentage error. Due to its best performance in load forecasting using single
hidden layer, Tanh activation function has been chosen to investigate the performance of different number of
hidden layers in load forecasting. Based on the result, the ANN with two hidden layers has shown a better
performance compared with ANN with three hidden layers. Therefore, the higher number of hidden layers
does not indicate better forecasting performance. For future works, it is suggested that the number of inputs
can be increased to include weather data to improve the load forecasting performance for different climate
conditions.
ACKNOWLEDGEMENTS
The authors are grateful to the Universiti Teknologi Malaysia and the Ministry of Higher Education
(MOHE), for their partial financial support through their research funds, Vote No. R.J130000.2651.17J53.
REFERENCES
[1] B. Michel, J. A. D. Massignan, T. M. O. Santos, J. B. A. London Jr., and C. D. Maciel, “Multiple Households Very Short-Term
Load Forecasting using Bayesian Networks,” Electric Power Systems Research, vol. 189, pp. 106733, 2020, doi:
10.1016/j.epsr.2020.106733.
[2] S. Fallah, R. C. Deo, M. Shojafar, M. Conti, and S. Shamshirband, “Computational Intelligence Approaches for Energy Load
Forecasting in Smart Energy Management Grids: State of the Art, Future Challenges and Research Directions,” Energies, vol. 11,
pp. 596, 2018, doi: 10.3390/en11030596.
[3] D. Grzegorz, “Pattern-based Local Linear Regression Models for Short-Term Load Forecasting,” Electric Power Systems
Research, vol. 130, pp. 139-147, 2016, doi: 10.1016/j.epsr.2015.09.001.
[4] W. Zeyu, X. Zhou, J. Tian, and T. Huang, “Hierarchical Parameter Optimization based Support Vector Regression for Power
Load Forecasting,” Sustainable Cities and Society, vol. 71, pp. 102937, 2021, doi: 10.1016/j.scs.2021.102937.
[5] N. Hannah, S. New, A. Cohen, and B. Ramachandran, “Load Forecasting using Multiple Linear Regression with Different
Calendars,” Distributed Energy Resources in Microgrids, pp. 405-417, 2019, doi: 10.1016/B978-0-12-817774-7.00016-8.
[6] F. Juan Rendon-Sanchez, and M. Lilian de Menezes, “Structural Combination of Seasonal Exponential Smoothing Forecasts
Applied to Load Forecasting,” European Journal of Operational Research, vol. 275, pp. 916-924, 2019, doi:
10.1016/j.ejor.2018.12.013.
[7] E. Meira de Oliveira, and F. Luiz Cyrino Oliveira, “Forecasting mid-long Term Electric Energy Consumption through bagging
ARIMA and Exponential Smoothing Methods,” Energy, vol. 144, pp. 776-778, 2018, doi: doi.org/10.1016/j.energy.2017.12.049.
[8] N. Thomas and G. Markus, “A Generally Applicable, Simple and Adaptive Forecasting Method for the Short-Term Heat Load of
Consumers,” Applied Energy, vol. 241, pp. 73-81, 2019, doi: 10.1016/j.apenergy.2019.03.012.
[9] C. Qing, W. Zhang, K. Zhu, D. Zhou, H. Dai, and Q. Wu, “A Novel Trilinear Deep Residual Network with Self-Adaptive
Dropout Method for Short-Term Load Forecasting,” Expert Systems with Applications, vol. 182, pp. 115272, 2021, doi:
10.1016/j.eswa.2021.115272.
[10] F. Tingting and L. Risto, “Evaluation of a Multiple Linear Regression Model and SARIMA Model in Forecasting Heat Demand
for District Heating System,” Applied Energy, vol. 179, pp. 544-552, 2016, doi: 10.1016/j.apenergy.2016.06.133.
[11] Y. Ailing, L. Weide, and Y. Xuan, “Short-Term Electricity Load Forecasting based on Feature Selection and Least Squares
Support Vector Machine,” Knowledge-Based Systems, vol. 163, pp. 159-173, 2019, doi: 10.1016/j.knosys.2018.08.027.
[12] Aasim, S. N. Singh, and A. Mohapatra, “Data Driven Day-Ahead Electrical Load Forecasting through Repeated Wavelet
Transform Assisted SVM Model,” Applied Soft Computing, vol. 111, pp. 107730, 2021, doi: 10.1016/j.asoc.2021.107730.
[13] M. Malekizadeh, H. Karami, M. Karimi, A. Moshari, and M. J. Sanjari, “Short-Term Load Forecast using Ensemble Neuro-Fuzzy
Model,” Energy, vol. 196, pp. 117-127, 2020, doi: 10.1016/j.energy.2020.117127.
[14] A. Danladi, M. Yohanna, M. I. Puwu, and B. M. Garkida, “Long-Term Load Forecast Modelling using a Fuzzy Logic Approach,”
Pacific Science Review A: Natural Science and Engineering, vol. 18, pp. 123-127, 2016, doi: 10.1016/j.psra.2016.09.011.
[15] L. Chen, “A Fuzzy Theory-based Machine Learning Method for Workdays and Weekends Short-Term Load Forecasting,” Energy
and Buildings, vol. 245, pp. 111072, 2021, doi: 10.1016/j.enbuild.2021.111072.
[16] H. Azim, M. M. Nezhad, E. Pirshayan, D. A. Garcia, F. Keynia, and L. D. Santoli, “Short-Term Electricity Price and Load
Forecasting in Isolated Power Grids based on Composite Neural Networks and Gravitational Search Optimization Algorithm,”
Applied Energy, vol. 277, pp. 115503, 2020, doi: 10.1016/j.apenergy.2020.115503.
[17] C. Gopal, M. Pipattanasomporn, V. Garg, and S. Rahman, “Robust Short-Term Electrical Load Forecasting Framework for
Commercial Buildings using Deep Recurrent Neural Networks,” Applied Energy, vol. 278, pp. 115410, 2020, doi:
10.1016/j.apenergy.2020.115410.
[18] D. Hanane, F. Bagheri, H. Le, and L. Dessaint, “Neural Network Model for Short-Term and Very-Short-term Load Forecasting in
District Buildings,” Energy and Buildings, vol. 203, pp. 109408, 2019, doi: 10.1016/j.enbuild.2019.109408.
[19] S. H. Chan Zeke, H. W. Ngan, A. B. Rad, A. K. David, and N. Kasabov, “Short-Term ANN Load Forecasting from Limited Data
using Generalization Learning Strategies,” Neurocomputing, vol. 70, pp. 409-419, 2006, doi: 10.1016/j.neucom.2005.12.131.
Int J Pow Elec & Dri Syst, Vol. 13, No. 1, March 2022: 586-593
Int J Pow Elec & Dri Syst ISSN: 2088-8694 593
[20] S. M.-Carbonell, E. Sanchez, and A. Munoz, “Rethinking Weather Station Selection for Electric Load Forecasting using Genetic
Algorithms,” International Journal of Forecasting, vol. 36, pp. 695-712, 2020, doi: 10.1016/j.ijforecast.2019.08.008.
[21] Y. Feng and X. Xiaozhong, “A Short-Term Load Forecasting Model of Natural Gas based on Optimized Genetic Algorithm and
Improved BP Neural Network,” Applied Energy, vol. 134, pp. 102-113, 2014, doi: 10.1016/j.apenergy.2014.07.104.
[22] X. J. Luo and O. L. Oyedele, “Forecasting Building Energy Consumption: Adaptive Long-Short Term Memory Neural Networks
Driven by Genetic Algorithm,” Advances Engineering Informatics, vol. 50, pp. 101357, 2021, doi: 10.1016/j.aei.2021.101357.
[23] Z. Nianyin, H. Zhang, W. Liu, J. Liang, and F. E. Alsaadi, “A Switching Delayed PSO Optimized Extreme Learning Machine for
Short-Term Load Forecasting,” Neurocomputing, vol. 240, pp. 175-182, 2017, doi: 10.1016/j.neucom.2017.01.090.
[24] M. Han and T. Jing Min, “Short-Term Load Forecasting of Microgrid based on Chaotic Particle Swarm Optimization, “ Procedia
Computer Science, vol. 166, pp. 546-550, 2020, doi: 10.1016/j.procs.2020.02.026.
[25] A. P. Adedeji, S. Akinlabi, N. Madushele, and O. O. Olatunji, “Wind Turbine Power Output Very Short-Term Forecast: A
Comparative Study of Data Clustering Techniques in a PSO-ANFIS Model,” Journal of Cleaner Production, vol. 254, pp.
120135, 2020, doi: 10.1016/j.jclepro.2020.120135.
[26] Website to United State energy information administration for load data. [Online]. Address:
https://www.eia.gov/beta/electricity/gridmonitor/dasboard/electric_overview/US48/US48.
BIOGRAPHIES OF AUTHORS
Razman Ayop received the bachelor’s degree in electrical engineering, the master’s
degree in electrical engineering with specialization in power system, and the PhD degree in
electrical engineering from Universiti Teknologi Malaysia (UTM), Johor, Malaysia, in 2013,
2015, and 2018, respectively. He is a Senior Lecturer with UTM and a member of Power
Electronics and Drives Research Group, School of Electrical Engineering. His research interests
include renewable energy and power electronics. This includes the photovoltaic (PV) emulator,
maximum power point tracking (MPPT) converter, standalone energy management and sizing,
PV modelling, vehicle to grid (V2G) system, particle swarm optimization, and fuzzy logic
controller. He can be contacted at email: [email protected].
Artificial neural network based short term electrical load forecasting (Oon Yi Her)