Abstract
Machine learning can perform electricity load prediction on the demand side. This paper compared the electricity prediction errors between two machine learning algorithms: Artificial Neural Network (ANN) and Long Short-Term Memory (LSTM) architecture. LSTM can solve the regression problem in time-series. Due to that, this paper applied LSTM. The traditional machine learning approach, ANN, was used to compare the effectiveness of LSTM in performing the time-series prediction. A dataset that consisted of historical electricity consumption data with independent variables was used in this study. The mean squared error (MSE) and mean absolute error (MAE) evaluation metrics were used to evaluate the models. The model generated using LSTM showed the lowest error with MSE value of 0.1238 and MAE value of 0.0388. These results indicated that choosing a suitable machine learning algorithm for the time-series problem could improve the model generated from the training session.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
Electricity is a form of energy that being used widely [1]. Coal, solar, and wind energy are the examples of primary sources of energy. These primary energy sources were used in electricity generation. There are two types of primary energy sources: renewable and non-renewable. The conventional way of generating electricity was from non-renewable sources. This method affects the environment in negative way by releasing carbon emission. The drawback of using non-renewable sources is overcome by the implementation of renewable energy. However, the integration of renewable energy is challenging to ensure the supply meets the demand. Electricity power generator companies can use electricity load prediction based on the consumers’ electricity usage pattern to estimate the power generation. The electricity forecasting able to predict for short-, medium, and long-term [2]. Short-term forecasting is suitable to predict the demand for less than a month [3]. As the prediction for a longer period such as monthly until decades, medium-, and long-term are more suitable. This study applied two machine learning algorithms in forecasting the electricity consumption pattern.
The research of machine learning in electricity area has been increased in recent years [4]. Supervised learning allows the machine to learn from historical electricity load data. In supervised learning, the training process learns based on the sample dataset. The training process produces a model, while the testing process evaluates the model quality using evaluation metric. The testing process uses a set of unknown data that only consists of features.
Regression is a machine learning algorithm used to predict in time-series [5]. There are many computational algorithms to solve regression problems such as Artificial Neural Network (ANN), Support Vector Machine (SVR) [3], and Regression Neural Network (RNN). These algorithms were revised into extended versions that include Deep ANN, Sequential Minimal Optimization (SMO) [6], Support Vector Regression (SVR) [7, 8], and Long Short-Term Memory (LSTM). RNN handles the sequential data and memorise previous inputs that are stored in the internal memory [7, 9]. The drawback of RNN is vanishing gradients caused by too small parameter updates. Gradients is important because it contain information used in RNN iteration. However, LSTM overcome this issue.
LSTM can memorise information for extended period because it has its own cell [10, 11]. LSTM works by repeating modules of a Neural Network (NN) with a few layers that communicate with each other [9].
The data input for machine learning represents by features and label. However, the data input for RNN and LSTM requires data transformation into features, time step, and label. The time step benefits LSTM in terms of prediction based on a specific period of time, whereby it is applied in time-series forecasting in predicting the future value derived from historical data patterns [12]. These algorithms apply in training phase to produce a model. The model is assessed using evaluation metric.
In RNN, the common evaluation metrics applied are mean absolute error (MAE), root mean square error (RMSE), and mean square error (MSE) [13, 14]. A lower evaluation metric value represents a better model [13,14,15].
The remainder of this paper is organised as follows: Sect. 2 provides a review of existing published works related to electricity load forecasting. Section 3 describes the case study applied to this paper. Section 4 describes the methodology employed in the chosen machine learning algorithm. Section 5 describes the experiment results that include the model quality and prediction values. Finally, Sect. 6 concludes the findings.
2 Review of Related Works
Liu et al. [16] applied historical electricity dataset on LSTM. The article generated two models from two machine learning algorithms, Elman Neural Network and LSTM. The article compared the prediction results made by these models for normal and special days. This article used mean absolute percentage error (MAPE) to evaluate the model. As the results, MAPE value for LSTM model is 2.13%, and Elman Neural Network is 5.19%. The model generated using LSTM achieved high precision compared to Elman Neural Network.
Hossen et al. [17] used the historical electricity load dataset with independent variables. Hossen et al. [17] used the two-year duration dataset, Almanac of Minutely Power Dataset (AMPDs) dataset. The data collected based on one-minute interval. The dataset consists of independent variables from the utility meters: power and water, and weather data. The article compared the execution between Deep Neural Network (DNN) using LSTM with Gated Recurrent Unit (GRU) and simple RNN. The result proven the lowest MAPE error rate, 24% is by the model generated from DNN using LSTM. The error rate of the model generated from GRU and simple RNN are 24.7% and 37.7% respectively.
Zheng et al. [2] used another set of independent variables in the dataset of study. Initially, the authors proposed to include independent variables such as temperature, humidity, rainfall, and wind speed. These independent variables went through the selection operator (Lasso) to identify which independent variables affect the electricity load. As the results, only average temperature added to the historical electricity load dataset. The dataset duration used was one year and 11 months. This research study applied Adaptive Moment Estimation (ADAM) optimiser in the execution. The study conducted in three categories: load dataset, load and temperature dataset, and load, time, and temperature dataset. The researcher used MAPE to evaluate the model. The best model was generated from the experiment that used the load, time, and temperature dataset with MAPE value of 6.00%. The MAPE result for the experiment that used only load feature is 8.52%. The model was used to predict electricity load in summer, autumn, winter, and spring seasons. Memarzadeh and Keynia [11] also compare the model performance on each season.
Wang et al. [18] compared the prediction performance among various traditional forecasting methods, such as Autoregressive Moving Average model (ARMA), Auto-regressive Fractionally Integrated Moving Average model (ARFIMA), and Backpropagation Neural Network (BPNN) with LSTM. The RMSE result for LSTM showed the lowest error among other traditional methods.
Karunathilake and Nagahamulla [19] studied the implementation of ANN in electricity load prediction. The researcher used RMSE, MAE, and R-squared (R2) to evaluate the model. The result of MAE value was 0.0211, RMSE value was 0.6328, and R2 value was 0.7385.
Table 1 summarises the machine learning algorithm applied, and the evaluation metrics used in the reviewed research articles.
3 Case Study: Danish Electricity Usage Dataset
Denmark is one of the developed countries that leads the implementation of renewable energy. This article intends to assist in predicting residential consumers’ electricity demand in Denmark. This study used the unpublished Danish electric power consumption dataset. The dataset was retrieved from a smart meter data of one household unit in Denmark with an hourly sampling rate throughout four years duration, between the year 2015 and year 2018. The dataset used consists of historical electricity load, year, month, day, hour, minute, weekend, holiday type, seasons, and day length columns.
The dataset is divided into the training, testing, and prediction dataset as shown in Table 2.
Table 2 summarises the total rows for each dataset. The training dataset consisted of 26,304 rows and ten columns. The target of the training data was the electricity load column. Other columns were used as features. The testing dataset had 8,760 rows that contained one-year of data. The prediction set had 24 rows that represented 24 h in a day. The prediction dataset is the subset of testing dataset.
4 Modelling Using LSTM and ANN
The prediction was performed based on a periodic of time. The data input used in ANN were samples and features. In LSTM, the data input consisted of samples, time steps, and features. The optimizer used is ADAM optimizer [20]. The programme flow is illustrated in Fig. 1.
The difference between LSTM and ANN is in the input layer process. LSTM ap-plied the LSTM method with input_shape parameter values set to time steps value, 24, and number of features. The execution for ANN applied the Dense method with input_shape parameter value set based on the number of features. The ANN and LSTM algorithms applied consist of one input layer, one hidden layer, and one output layer.
The programme produced two models, one model produced by ANN algorithm, and the other model produced by LSTM algorithm. These models were used in the testing phase to evaluate the model quality based on the evaluation metrics, namely MSE and MAE. The model was used in prediction phase to predict the electricity load of a certain duration. The actual values were compared with the actual value. The results’ pattern and difference were observed.
5 Experimental Results and Discussions
This section shows the results of the implementation of the proposed methodology. The models were trained, tested, and predicted on Intel® Core™ i7-3930K CPU with 6 cores and maximum clock frequency of 3.2 MHz. The software used was Jupyter Notebook on Anaconda Navigator. The TensorFlow Keras library was applied in the execution.
5.1 Training and Testing Datasets
The dataset used was a single household unit electricity load dataset comprising 35,064 rows of samples with nine columns representing features. The initial training data shape was 26,304 rows with nine columns, while the testing dataset shape was 8,760 rows and nine columns. This two-dimensional (2D) array data was applied with ANN algorithm.
For the implementation using LSTM, the time steps applied in this experiment were 24, which represented 24 h per day. The shapes were reshaped into three-dimensional (3D) array with 24 time steps. The new 3D training dataset shape was 1,096 samples, 24 time steps, and nine columns, while the testing set reshape value had 365 samples, 24 time steps, and nine columns.
5.2 Training and Testing Activities
The input for training activity was the training dataset. The output of the training activity was a model. The model generated was tested with the testing dataset. The result of testing activity was evaluated using evaluation metrics, MSE and MAE. Then, the prediction was made on the prediction set, represented for any of the day in 2018. The default epoch value was set to 50.
Table 3 summarises the result of testing process and the epoch required to complete the training on both datasets with ANN and LSTM.
There were two models generated, modelLSTM and modelANN. The lowest error rate produced by modelLSTM with MSE values of 0.1238, and MAE values of 0.0388. The total epoch used in LSTM was 26, while the ANN algorithm completed its training phase with 12 epochs.
5.3 Prediction Activity
The prediction was made for 24-h duration on 2nd April 2018. It was on Monday, in the spring season, in the beginning of the week, and no special occasion on this day in Denmark. The prediction was in hourly, started on 0000 h and ended on 2300 h. Table 4 shows the execution result for actual and prediction values of electricity load derived from the modelANN and modelLSTM.
Figure 2 illustrates the results of actual and predicted values by the ANN and LSTM models in Table 4.
Figure 2 shows the actual and prediction results by the modelANN and modelLSTM. The sample of one-day hourly electricity load was on 2nd April 2018. It falls in the spring season. The peak electricity load was identified in between 0600 h and 0900 h, and 1300 h and 1900 h. The electricity load decreased from 0000 h until 0600 h, followed by 1000 h until 1300 h.
The results by the LSTM algorithm was also proven to be better than the model generated by the ANN algorithm as stated in Table 3. This was obtained due to the ability of the LSTM algorithm in memorising the time-series input during the training session.
6 Conclusion
Electricity power generator companies can use electricity load prediction based on the consumers’ electricity usage pattern to estimate the power generation. This paper proposed the implementation of LSTM algorithm to predict electricity demand in time series. Experiments on the traditional machine learning algorithm, ANN, was executed to verify the performance of LSTM. The contribution of this paper is in the implementation with time-series prediction. The model generated using LSTM was proven to produce a lower error rate than the traditional algorithm, ANN, although independent variables were added into the input variables.
This experiment was conducted based on the historical electricity load data with independent variables of a single household unit. Future experiment should consider the implementation on Deep Learning algorithm.
References
Electricity explained - U.S. Energy Information Administration (EIA). https://www.eia.gov/energyexplained/electricity, Accessed 12 Dec 2020
Zheng, J., Chen, X., Yu, K., Gan, L., Wang, Y., Wang, K.: Short-term Power Load Forecasting of Residential Community Based on GRU Neural Network. 2018 International Conference on Power System Technology (POWERCON). (2018).
Md Salleh, N., Suliman, A., Jorgensen, B.: A systematic literature review of machine learning methods for short-term electricity forecasting. In: 2020 8th International Conference on Information Technology and Multimedia (ICIMU) (2020)
Zamee, M., Won, D.: Novel mode adaptive artificial neural network for dynamic learning: application in renewable energy sources power generation prediction. Energies 13, 6405 (2020)
Dave, A.: Regression in Machine Learning - Data Driven Investor – Medium. https://medium.com/datadriveninvestor/regression-in-machine-learning-296caae933ec, Accessed 25 June 2019
Bai, D., Lee, J., Kim, S., Kang, I.: Near ML modulation classification. In: IEEE Conference on Vehicular Technology (VTC). IEEE (2019)
Sikiric, G., Avdakovic, S., Subasi, A.: Comparison of machine learning methods for electricity demand forecasting in bosnia and herzegovina. Southeast Europe J. Soft Comput. 2, 12–14 (2013)
Basile, A., Napporn, T.: Current Trends and FUTURE Developments on (Bio- ) Membranes. Elsevier, San Diego (2020)
Xuan, Z., Zhubing, F., Liequan, L., Junwei, Y., Dongmei, P.: Comparison of four algorithms based on machine learning for cooling load forecasting of large-scale shopping mall. Energy Procedia 142, 1799–1804 (2017)
Salam, A., El Hibaoui, A.: Comparison of machine learning algorithms for the power consumption prediction : - case study of Tetouan city. In: 2018 6th International Renewable and Sustainable Energy Conference (IRSEC). IEEE (2019)
Memarzadeh, G., Keynia, F.: Short-term electricity load and price forecasting by a new optimal LSTM-NN based prediction algorithm. Electric Power Syst. Res. 192, 106995 (2021)
Singla, M., Gupta, J., Nijhawan, P., Oberoi, A.: Electrical load forecasting using machine learning. Int. J. Adv. Trends Comput. Sci. Eng. 8, 615–619 (2019)
Maklin, C.: R Squared Interpretation | R Squared Linear Regression. https://towardsdatascience.com/statistics-for-machine-learning-r-squared-explained-425ddfebf667, Accessed 02 Mar 2020
Kassambara, A.: Machine Learning Essentials: Practical Guide in R. CreateSpace Independent Publishing Platform (2018)
Shabbir, N., Ahmadiahangar, R., Kutt, L., Rosin, A.: Comparison of machine learning based methods for residential load forecasting. In: 2019 Electric Power Quality and Supply Reliability Conference (PQ) & 2019 Symposium on Electrical Engineering and Mechatronics (SEEM) (2019)
Liu, C., Jin, Z., Gu, J., Qiu, C.: Short-term load forecasting using a long short-term memory network. In: 2017 IEEE PES Innovative Smart Grid Technologies Conference Europe (ISGT-Europe) (2017)
Hossen, T., Nair, A., Chinnathambi, R., Ranganathan, P.: Residential Load Forecasting Using Deep Neural Networks (DNN). In: 2018 North American Power Symposium (NAPS) (2018)
Wang, H., Li, G., Wang, G., Peng, J., Jiang, H., Liu, Y.: Deep learning based ensemble approach for probabilistic wind power forecasting. Appl. Energy 188, 56–70 (2017)
Karunathilake, S.L., Nagahamulla, R.K.H.: Artificial neural networks for daily electricity demand prediction of Sri Lanka. IN: 2017 Seventeenth International Conference on Advances in ICT for Emerging Regions (ICTer). p. 128–133. IEEE, Colombo (2017)
Md Salleh, N., Suliman, A., Jørgensen, B.: Experiment on electricity consumption prediction using long short-term memory architecture on residential electrical consumer. In: The International Congress of Advanced Technology and Engineering (ICOTEN 2021) (2021)
Acknowledgement
The publication of this paper was funded by URND TNB Seeding Fund: U-TE-RD-20–08. The authors would like to thank the Institute of Informatics and Computing in Energy (IICE), Universiti Tenaga Nasional (UNITEN) for providing a platform to collaborate with the Center for Energy Informatics, Southern Denmark University (SDU).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Salleh, N.S.M., Suliman, A., Jørgensen, B.N. (2021). Comparison of Electricity Load Prediction Errors Between Long Short-Term Memory Architecture and Artificial Neural Network on Smart Meter Consumer. In: Badioze Zaman, H., et al. Advances in Visual Informatics. IVIC 2021. Lecture Notes in Computer Science(), vol 13051. Springer, Cham. https://doi.org/10.1007/978-3-030-90235-3_52
Download citation
DOI: https://doi.org/10.1007/978-3-030-90235-3_52
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-90234-6
Online ISBN: 978-3-030-90235-3
eBook Packages: Computer ScienceComputer Science (R0)