Hourly Electricity Load Forecasting in
Smart Grid Using Deep Learning
Abdul Basit Majeed Khan1, Nadeem Javaid2(B
), Orooj Nazeer1, Maheen
Zahid2, Mariam Akbar2, and Majid Hameed Khan3
1Abasyn University Islamabad Campus, Islamabad 44000, Pakistan
2COMSATS University Islamabad, Islamabad 44000, Pakistan
3Group 3 Technology Limited, Aldridge, UK
Abstract. In this paper, a Deep Learning (DL) technique is introduced
to forecast the electricity load accurately. We are facing energy shortage
in today’s world. So, it is the need of the hour that proper scenario should
be introduced to overcome this issue. For this purpose, moving towards
Smart Grids (SG) from Traditional Grids (TG) is required. Electricity
load is a factor which plays a major role in forecasting. For this purpose,
we proposed a model which is based on selection, extraction and classi-
ﬁcation of historical data. Grey Correlation based Random Forest (RF)
and Mutual Information (MI) is performed for feature selection, Kernel
Principle Component Analysis (KPCA) is used for feature extraction and
enhanced Convolutional Neural Network (CNN) is used for classiﬁcation.
Our proposed scheme is then compared with other benchmark schemes.
Simulation results proved the eﬃciency and accuracy of the proposed
model for hourly load forecasting of one day, one week and one month.
Keywords: Deep learning ·Smart grid ·Random forest ·Mutual
Smart Grid (SG) is an advanced form of energy distribution system. Before this
advance technology, Traditional Grids (TG) are used for storage and distribu-
tion of electricity. They are always planted away from the power usage areas.
Electricity is transmitt by long transmission wires. Energy can only be provided
from the main power plant using traditional power structure. Traditional power
system makes very hard to control the energy, because when electricity leaves
the power plant, energy ﬁrms have no more control on distribution, and this
may cause the loss of energy. SG is used for eﬃcient and reliable distribution of
electricity. It is a two way communication among utility and consumer . Utili-
ties and consumers, both are able to handle the operations of grid system. With
Springer Nature Switzerland AG 2020
L. Barolli et al. (Eds.): IMIS 2019, AISC 994, pp. 185–196, 2020.
186 A. B. M. Khan et al.
the eﬃcient and smart digital structure electricity ﬁrms have better control on
power distribution. Power consumption and generation is easily monitored while
transferring from source to destination in SG. Through this technology, energy
which is generate by renewable resources can also be include in main power grid.
SG also overcome the cost of operations for utilities and low electricity cost for
Smart meters are used to record the consumer’s load of electricity consump-
tion and send back to utilities. For the eﬃcient and reliable prediction of future
power consumption, accurate electricity load forecasting is necessary. As the
recorded data is very large; referred to big data, it is diﬃcult to forecast the
accurate load of electricity. In this research, we use diﬀerent Artiﬁcial Neural
Network (ANN) and Deep Learning (DL) based classiﬁers to forecast the bet-
ter accuracy of load. DL techniques, help us to ﬁnd hidden patterns from the
large data accurately. Data pre-processing is also performed to calculate valuable
features from large dataset. These methods give us accurate prediction of load
which beats previous methods. The main objective of this research is to provide
eﬃcient method to forecast the electricity load with higher accuracy.
1.1 Problem Statement
In SG technology, we have a lot of challenges regarding energy consumption and
distribution. Both the customer and distributer, want to get advantages from
the technology. This is only possible when the eﬃcient consumption of electricity
is occurred. Load forecasting have a great impact on reducing electricity con-
sumption in SG. One of the key problem in power generation system is accurate
prediction of load. When load is predicted accurately, it helps power generators
and distributors to improve their power grid operations, and produce electric-
ity according to the demand of consumer. Moreover, when the production is
reduced, cost is also reduced. Many ANN and DL techniques, also made lot of
eﬀorts in forecasting better accuracy of load. To solve this issue, we proposed a
DL based technique which gives better result in terms of accuracy.
In this paper, accurate load prediction is our primary goal. For this purpose a
DL based technique is proposed. In this work, we proposed enhanced Covolutinal
Neural Network (CNN), classiﬁer to predict electricity load. The contributions
of this paper are describes as follows:
•Selection of best features using Grey Correlation Analysis (GCA) based, Ran-
dom forest (RF) and Mutual Information (MI) is made at the start of process.
•Extract the important features using Kernel Principle Component Analysis
•Enhanced the model by tune hyperparameters.
•Predict the accurate hourly electricity load.
•Improves the eﬃciency of model by removing overﬁtting problem.
Hourly Electricity Load Forecasting in Smart Grid . . . 187
2 Related Work
Electricity price and load are the most dominant factors in electricity market. To
make the market competitive and beneﬁcial, price and load forecasting are key
approaches in SG, to be implemented. Large datasets are diﬃcult to process with
traditional computational and statistical models , however, authors proposed
an eﬀective DL based framework for better forecasting of electricity price and
load. Firstly, data pre-processing is done then Hybrid Feature Selection and
Extraction (HFSE) is used for prediction of electricity load and price. However,
this model has over-ﬁtting problem. Another method used for load forecasting
CNN, implemented in , which is further compared with ANN and Support
Vector Machine (SVM) algorithms, shows the more accurate load forecasting for
a single residential building. In this method, many CNN layers are used on old
data before implementing the ﬁnal task, and then testing of method is done by
use of already labelled dataset. This paper is implemented in resolution of one-
hour data. The drawback is that this method only consider the data before the
day of forecasting and data which is unknown at the time of prediction, might
have eﬀect on implementation of ANN, and it has a bad eﬀect on accuracy of
In , framework consist of ANN is used for electricity price forecasting.
Diﬀerent clustering algorithms are used for feature extraction and then ANN
algorithm is applied.
Data mining is also useful to predict the electricity load in SG. Author in
 used a framework based on selecting the most appropriate features from
the large datasets, and then used the hybrid of Na¨ıve Bayes(NB) and KNN
classiﬁers to forecast accurate electricity load. The proposed model uses two
steps to forecast load; data pre-processing and load estimation. In , author
used Hierarchal Learning Model (HLM), to ﬁnd the most dominant factors,
inﬂuenced on electric load consumption. The factors which have a lot of eﬀect
on electricity load usage are diﬀerentiated. This method used two strategies; time
series analysis and prediction step. Data is trained on Auto RegressiveIntegrated
Moving Average (ARIMA)and distance learning models. When forecasting of
load is done, and outcomes are compared with traditional methods, then it beats
the old techniques in terms of accuracy. In time series model, iterations are not
possible because inputs are received linearly.
A hybrid of SVR and Modiﬁed Fireﬂy Algorithm (MFA) is used to electric-
ity load forecasting, which claims to achieve best result. The proposed technique
ﬁnds better accuracy at the end of optimization . For the reliable functioning of
SG, load forecasting is necessary. In , authors forecast the load and price based
on long short term memory (LSTM). Proposed Deep (DLSTM) for prediction on
ISO NE-CA and NYISO dataset. This work is eﬀective for only DLSTM model.
A hybrid of supervised and unsupervised methods; the Dynamic Choice ANN
(DCANN), gives the considerable electricity price forecasting results. Firstly we
identify bad samples from the input dataset, and choose the best input parame-
ters for obtaining better output. Un-supervised learning helps us to choose values
randomly, and then these values are trained by supervised learning model. When
188 A. B. M. Khan et al.
the result is compared to other learning models DCANN performs better. The
drawback of this technique is that when the volatility of electricity price is on
peak, in summer, autumn and spring, price forecasting becomes diﬃcult and
the performance decreases . In , author derives a technique, which is used
for forecasting load in green buildings. The proposed Multi Point Fuzzy Predic-
tion (MPFP) technique use fuzzy functionality with big data, collected from the
buildings to forecast electric load curves. Energy Management System (EMS)
also used to control the distribution of energy consumption devices for accu-
rate load forecasting. Electricity Information is found by controlling the load
on smart meters. By using these patterns an eﬃcient database is created. The
MPFP forecasts the load curve and this information is given to EMS which after
examining peak load, charge or discharge storage devices to maintain the load
at same peak and reduce the cost. The accuracy of model is not satisfactory,
because data, taken for experiment is very less which caused bad accuracy.
Load forecasting is an initial need of EMS. In paper , Enhanced Logistic
regression (ELR), Classiﬁcation and Regression Tree (CART), RFE, RF and
Grey Wolf Optimization (GWO) techniques are used for forecasting the electric-
ity load and price. This work is working well in their model. A Bayesian Network
(BN) algorithm can also give the eﬃcient load forecasting results after ﬁnding
the dependency relationship among included variables. Eﬃcient input data is
provides to capture better output. Eﬃciency of algorithm can also be checked
by multi-scale setting; using both the spatial and temporal resolutions .
Most of the load forecasting theories are based on the historical and calen-
dar data. In this paper author proposed a method, which based on Root Mean
Square to predict the accuracy of forecasting load of residential buildings. Diﬀer-
ent input parameters are obtained from calendar data and historical data, and
features are extracted through proper pre-processing. This method also shows
that long dataset will cause in decreasing the forecasting accuracy. Author also
states that, one year old data is enough for accurate load forecast . In ,
authors implement a new online SVR method, which forecast load on the basis
of incoming data. The framework does not need to consider the historical data.
This method is only suitable for short term and fast load forecasting. Single out-
put is a drawback of this method. A series of data is used as input, and whenever
values are considered from diﬀerent time stamps, this method would stops work-
ing. This method could be further improved by implementing the large datasets
on SVR algorithm.
Residential electricity load forecasting has been playing an important role in
SM. A long short-term memory based Recurrent Neural Network (RNN) based
forecasting, with appliance consumption sequences is proposed to implement
such volatile problem. . In , a hybrid algorithm; Multi-Input Multi-Output
(MIMO) is used to forecast the electricity price and load, which is also a correla-
tion between price and load. Three steps are involved to forecast electricity price
and load; to make prior subsets, choose best input constraints and, at the end
forecast price and load concurrently. This method shows better forecast accu-
racy. A hybrid artiﬁcial neural network-based day-ahead load-forecasting model
Hourly Electricity Load Forecasting in Smart Grid . . . 189
for smart grids is proposed in . The proposed forecasting model comprises
•a pre-processing module;
•a forecast module; and
•an optimization module.
In , electricity consumption data is gathered from the consumers’ side and
make analysis of that data for forecasting of high electricity load. Data is gath-
ered from diﬀerent areas and then make analysis on the basis of appropriate
features. After analysis satisfactory results are achieved. The drawback is that
proposed model cannot capture the fast variations of the load . In paper ,
authors examine the short term price and load forecasting using diﬀerent selec-
tion methods and deep learning techniques. Another framework is implemented
in , which is described in three steps:
•Eliminate the redundant features,
•Dimensionality reduction, and
•Classiﬁcation of price forecasting.
However, results are enough satisfactory to forecast electricity price.
The structure of our proposed model is shown in Fig. 1. It consist of four parts,
i.e., data pre-processing, feature selection, feature extraction and classiﬁcation.
Fig. 1. Proposed system model
3.1 Preprocessing Data
The ﬁrst step of our proposed model is to preprocess the data. We used hourly
electricity load data of ISO-NE CA market. One year hourly load data of 2017
is used in our model. We divided the data into two parts i.e. training and testing
data. Training is done on 75% of data and remainig part is used for testing. Data
is also normalized at this stage.
190 A. B. M. Khan et al.
3.2 Feature Selection
In this section, we describe the method of feature selection. RF and MI tech-
niques, calculate important features from data. We also drop the features, which
have low importance. After combining the results of these two techniques we
select the features by deﬁning a thresh hold value, which drops the unimportant
features. RF importances are shown in Fig. 2while MI importances are shown
in Fig. 3. We found the importances in vector form.
Fig. 2. Feature importances using RF
3.3 Feature Extraction
Feature extraction is used to reduce dimentionality, and removes redudant fea-
tures from the data. KPCA is used in our scenario to extract the best features
from data. Radial basis KPCA identiﬁes the dimention of feature which helps
the model to perform well. Radial basis KPCA also campared with PCA and
linear kernel in the model.
In our proposed model, classiﬁcation is done with ECNN, which is described as.
Enhanced CNN In machine learning, enhanced CNN is a class of deep neural
network. It consist of one or more convolution layers, and then followed one by
one fully connected layer as in NN.Enhanced CNN contains input layer, multiple
Hourly Electricity Load Forecasting in Smart Grid . . . 191
Fig. 3. Feature importances using MI
hidden layers and output layer. Hidden layers consist of, convolutional layer,
dense layer, droupout layer, ﬂatten layer and pooling layer. The convolution
layer calculates the output of neurons that are associated with local boundary
or receptive ﬁelds in the input, each simulates a dot product with their weights
and a receptive ﬁeld by which they are connected to the input data. FFNN trains
the network and also classify the data.
In our model we use two convolutional layers. The ﬁrst layer consist of, 96
ﬁlters and 2 kernels and the second layer have 32 ﬁlters and 3 kernels. In addition,
one max pooling layer with pool size 2 is used in our network. Pooling layer sums
the output of large data into neuron and passes that input to the next layer.
Dropout layer is added to avoid overﬁtting. Flatten layer is also add to make
connection between convolution and dense layer. One dense layer is used in our
network. After the network is created, we compile it using the Adam optimizer.
Mean saqure error is used as loss function and accuracy is taken as metrics.
Finally we train the model with Keras ﬁt() function. The model trains for 155
epochs 30 batch size.
4 Simulation and Discussion
In this section, we discuss simulation results of our proposed technique in detail,
for showing productiveness and accuracy of electricity load prediction. Our model
results, summarized as follows.
4.1 Data Description and Simulation Setup
In this paper, we used the real time data of ISO New England Control Area (ISO
NE-CA), market data from January 2017 to December 2017. We consider the
192 A. B. M. Khan et al.
hourly data of each day. Our dataset is consist of 17 columns and 8,760 instances.
Each day consist of 24 instances. For this purpose we use a simulator, which
consist of Python framework with Intel Core i3, 4GB RAM, and 500GB hard
disk. Before moving to next step we normalize the load data through maximum
4.2 Simulation Results
After preprocess the data, we apply our techniques to get result. Results are
described in following sections.
RF and MI Based Feature Selection Feature selection plays important role
in acheieving accuracy. We apply GCA on our data to drop unimportant features.
After droping features, we splitt the data into training and testing sets. Training
set is consist of 75% instances of data while remaining instances are used for
testing. These sets are acting as a vector. After this, we apply two tehniques,
DT and MI to gain feature importances. Figure 2shows the important features
of DT technique, and Fig. 3shows the importances of MI technique. Then we
combine the results of both techniques and deﬁne a threshold value of 0.5 to
remove the features, which have low importance. Training speed and accuracy
can also be improved with increases in threshold, which drops the more feature
and gives best features.
Feature Extraction by KPCA After successful selection of feature, previous
output is used as input in this section for feature extraction. We use KPCA to
reduce dimentionality of features. Radial basis KPCA is applied on input and
compare with PCA and linear kernel principle which is shown in Fig. 4. Radial
basis KPCA gives the most representative features than other two Kernels.
Fig. 4. Feature extraction using KPCA
Hourly Electricity Load Forecasting in Smart Grid . . . 193
Load Forecasting In this section, We predict the electricity load by enhanced
CNN and compare the results with three existing classiﬁers. Python libraries;
Panadas, Tenseﬂow, Numpy and Keras are used to build the network. Sequential
model of Enhanced CNN is used, which helps network to work layer by layer.
In our scheme ﬁve layeyrs are used which are; covolution, Max-pooling, dense,
dropout and a ﬂatten layer. Each layer have its importance which helps the
model to predict accurate electricity load. The proposed model, reduces the
computational complexity and increases accuracy eﬃciently, which is big issue
in prediction. Figure 5shows the comparison of our scheme with SVR, Multi-
Layer Perceptron (MLP) and CNN, where electricity load prediction of enhanced
CNN is almost near to the targeted value. Our scheme predicts better in terms
of accuracy. Our prediction is also made on the hourly load of one day, one week
and one month.
Fig. 5. Comparison with diﬀerent classiﬁers
Hourly Load Forecasting In this section, we compared the results of hourly
pridiction with diﬀerent classiﬁers. One day prediction is consists of 24h of day,
one week prediction consists of 168 h, and one month prediction consists of 724 h.
Our model gives better result when compared with diﬀerent classiﬁers which is
shown in Figs. 6,7and 8.
In this work, we noticed that it is very diﬃcult to tune the hyperparameters
of network, because if size of hyperparameter increases then its computation
power becomes time consuming and if size is reduced, it fails to produce accurate
4.3 Performance Metrics
To calculate the performance and accuracy, two evaluators i.e. Mean Square
Error (MSE) and Mean Absolute Error (MAE), are assumed. MSE scores the
lowest error value i.e., 0.2792. Other models have greater error value when com-
pared to our model, which shows that our model outperforms in term of accuracy.
Error value comparison of our model with other classiﬁers, is shown in Fig.9.
194 A. B. M. Khan et al.
Fig. 6. Comparison of one day forecasting
Fig. 7. Comparison of one week forecasting
Fig. 8. Comparison of one month forecasting
Hourly Electricity Load Forecasting in Smart Grid . . . 195
Fig. 9. Error value comparison of diﬀerent techniques
In this paper, electricity load forecasting is done using DL techniques. The data
we used, is one year hourly data. This data is then normalized and splitt into
training and testing sets. Feature engineering is performed using three diﬀerent
techniques: DT, MI and KPCA. For predicting load, a new enhanced DL tech-
nique is also proposed in this paper. The new technique is termed as Enhanced
CNN. It outperforms the other benchmark techniques in load forecasting, on the
basis of accuracy.
1. Wang, K., Xu, C., Zhang, Y., Guo, S., Zomaya, A.: Robust big data analytics for
electricity price forecasting in the smart grid. IEEE Trans. on Big Data 5(1), 34–45
2. Amarasinghe, K., Marino, D.L., Manic, M.: Deep neural networks for energy load
forecasting. In: 2017 IEEE 26th International Symposium on Industrial Electronics
(ISIE), pp. 1483–1488. IEEE (2017)
3. Keles, D., Scelle, J., Paraschiv, F., Fichtner, W.: Extended forecast methods for
day-ahead electricity spot prices applying artiﬁcial neural networks. Appl. Energy
162, 218–230 (2016)
4. Saleh, A.I., Rabie, A.H., Abo-Al-Ez, K.M.: A data mining based load forecasting
strategy for smart electrical grids. Adv. Eng. Inform. 30(3), 422–448 (2016)
5. Zakarya, S., Abbas, H., Belal, M.: Long-term deep learning load forecasting based
on social and economic factors in the Kuwait region. J. Theor. Appl. Inf. Technol.
6. Kavousi-Fard, A., Samet, H., Marzbani, F.: A new hybrid modiﬁed ﬁreﬂy algo-
rithm and support vector regression model for accurate short term load forecasting.
Expert. Syst. Appl. 41(13), 6047–6056 (2014)
7. Mujeeb, S., Javaid, N., Ilahi, M., Wadud, Z., Ishmanov, F., Afzal, M.K.: Deep long
short-term memory: a new price and load forecasting scheme for big data in smart
cities. Sustainability 11(4), 987 (2019)
196 A. B. M. Khan et al.
8. Wang, J., Liu, F., Song, Y., Zhao, J.: A novel model: dynamic choice artiﬁcial
neural network (DCANN) for an electricity price forecasting system. Appl. Soft
Comput. 48, 281–297 (2016)
9. Chang, H.H., Chiu, W.Y., Hsieh, T.Y. (2016). Multipoint fuzzy prediction for load
forecasting in green buildings, pp. 562–567
10. Naz, A., Javed, M.U., Javaid, N., Saba, T., Alhussein, M., Aurangzeb, K.: Short-
term electric load and price forecasting using enhanced extreme learning machine
optimization in smart grids. Energies 12(5), 866 (2019)
11. Bassamzadeh, N., Ghanem, R.: Multiscale stochastic prediction of electricity
demand in smart grids using Bayesian networks. Appl. Energy 193, 369–380 (2017)
12. Lusis, P., Khalilpour, K.R., Andrew, L., Liebman, A.: Short-term residential load
forecasting: impact of calendar eﬀects and forecast granularity. Appl. Energy 205,
13. Vrablecov´a, P., Ezzeddine, A.B., Rozinajov´a, V., ˇ
S´arik, S., Sangaiah, A.K.: Smart
grid load forecasting using online support vector regression. Comput. Electr. Eng.
65, 102–117 (2018)
14. Zafar, I., Javaid, N., Iqbal, S., Aslam, S., Khan, A.Z., Abdul, W., Almogren, A.,
Alamri, A.: A Domestic Microgrid with Optimized Home Energy Management
System. Energies 11(4), 1002 (2018)
15. Shayeghi, H., Ghasemi, A., Moradzadeh, M., Nooshyar, M.: Simultaneous day-
ahead forecasting of electricity price and load in smart grids. Energy Convers.
Manag. 95, 371–384 (2015)
16. Ahmad, A., Javaid, N., Mateen, A., Awais, M., Khan, Z.: Short-term load forecast-
ing in smart grids: an intelligent modular approach. Energies 12(1), 164 (2019)
17. Jindal, A., Singh, M., Kumar, N.: Consumption-Aware Data Analytical Demand
Response Scheme for Peak Load Reduction in Smart Grid. IEEE Trans. Ind, Elec-
18. Shepero, M., van der Meer, D., Munkhammar, J., Widen, J.: Residential proba-
bilistic load forecasting: a method using Gaussian process designed for electric load
data. Appl. Energy 218, 159–172 (2018)
19. Zahid, M., Ahmed, F., Javaid, N., Abbasi, R.A., Kazmi, Z., Syeda, H., Ilahi, M.:
Electricity price and load forecasting using enhanced convolutional neural net-
work and enhanced support vector regression in Smart Grids. Electronics 8(2),
20. Wang, K., Xu, C., Guo, S.: Big data analytics for price forecasting in smart grids.
In: Global Communications Conference (GLOBECOM), 2016 IEEE pp 1–6. IEEE