0% found this document useful (0 votes)
33 views39 pages

MY Thesis

Uploaded by

Santosh Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views39 pages

MY Thesis

Uploaded by

Santosh Saini
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Load Forecasting through Deep Neural Network & Smart

Meter Data Analytics

A Dissertation submitted to the Department of Electrical Engineering in the partial


fulfilment for the award of the degree of

MASTER OF TECHNOLOGY
in
POWER ELECTRONICS & DRIVES
By

PRIYESH SAINI
Roll No: 31904205

UNDER THE GUIDANCE OF


Dr Ratna Dahiya
Professor, Department of EE

DEPARTMENT OF ELECTRICAL ENGINEERING

NATIONAL INSTITUTE OF TECHNOLOGY


(Institution of National Importance)

KURUKSHETRA, HARYANA - 136119


(2019 – 2021)
CONTENTS

CANDIDATE’S DECLERATION I

CERTIFICATE II

ACKNOWLEDGMENT III

NOMENCLATURE IV

ABSTRACT V

Chapter 1 INTRODUCTION

1.1 Background 1
1.2 Conceptual Definitions 2

Chapter 2 LITERATURE SURVEY

2.1 Literature Review 5

2.2 Literature Gap 6

2.3 Methodology of our Model 6

Chapter 3 BIG DATA ANALYTICS

3.1 What is Big Data 7

3.2 Big Data Characteristics in Smart Grid 7

3.3 Data Sources in Smart Grid 9

3.4 Scope of BDA in Smart Grid 10

Chapter 4 ARTIFICIAL NEURAL NETWORK


4.1 ANN 11

4.2 Commonly used Activation Function 13

Chapter 5 MODEL DEVELOPMENT

5.1 Data Pre-processing 14

5.2 Data Visualisation 16

5.3 Data Normalization 20

5.4 Training & Testing Dataset 22

5.5 Fitting the LSTM Model 22

Chapter 6 RESULTS 24

CONCLUSION 28

REFERENCES 29
LIST OF FIGURES

Figure 1.1 Venn diagram illustrating the interconnectedness of several domains 3

Figure 1.2 Types of Data Analytics 4

Figure 3.1 Five Vs of Big Data 8

Figure 3.2 Different sources of data in Smart Grid 9

Figure 3.3 Various application of BDA in Smart Grid 10

Figure 4.1 Anatomy of a Biological Neuron 11

Figure 4.2 Functioning of Human Brain 11

Figure 4.3 Functioning of ANN 12

Figure 4.4 Basic Architecture of MLP 12

Figure 4.5 Working of Activation Function 13

Figure 4.6 Generalized structure of ANN 13

Figure 4.7 Commonly used Activation Function 13

Figure 5.1 Raw Dataset 14

Figure 5.2 Processed Dataset 15

Figure 5.3 Number of records per year 16

Figure 5.4 Normalised values 21

Figure 5.5 Dividing the dataset 22

Figure 5.6 Training and Testing Data 22

Figure 5.7 Summary of LSTM model 23

Figure 6.1 R2 Score, MSE and RMSE values 27


LIST OF GRAPHS

Graph 5.1 Visualising the processed dataset 16

Graph 5.2 Energy consumption pattern of a day 17

Graph 5.3 Energy consumption pattern for October 2004 18

Graph 5.4 Energy consumption pattern for November 2004 19

Graph 5.5 Energy demand in different Seasons 20

Graph 5.6 Energy demand wrt days 20

Graph 5.7 Dataset following Gaussian Curve 21

Graph 6.1 Training vs Validation loss 24

Graph 6.2 Actual Values Vs Predicted Values 25

Graph 6.3 Zoomed View of Actual VS Predicted values for next 300 hours 26
CANDIDATE’S DECLARATION

Hereby, I PRIYESH SAINI, student of Master of Technology (Power Electronics &


Drives), Department of Electrical Engineering at National Institute of Technology
Kurukshetra, declare that I own full responsibility for the information, results and conclusion
provided in this dissertation “Load Forecasting through Deep Neural Network & Smart
Meter Data Analytics” submitted to the Department of Electrical Engineering, National
Institute of Technology, Kurukshetra, Haryana for the award of the degree of Master of
Technology in Power Electronics & Drives. I have completely taken care of acknowledging the
contribution of others in this academic work. I further declare that in case of any violation of
intellectual property rights or copyrights found at any stage, I as the candidate will be solely
responsible for the same.

Date: PRIYESH SAINI

Place: NIT Kurukshetra (Roll No: 31904205)

I
CERTIFICATE

This is to certify that this dissertation report entitled “Load Forecasting through Deep Neural
Network & Smart Meter Data Analytics” submitted by Mr PRIYESH SAINI to the
Electrical Engineering Department, National Institute of Technology, Kurukshetra for the
award of the degree Master of Technology in Power Electronics & Drives, Haryana, India,
is a record of the student’s work carried out under my supervision and guidance.

To the best of my knowledge, this dissertation report has not been submitted in part or full
elsewhere in any other University or Institution for the award of any degree. It is further
understood that by this certificate the undersigned docs do not endorse or approve any statement
made, opinion expressed, or any conclusion drawn therein but approve the dissertation report
only for the purpose for which it is submitted.

Dr Ratna Dahiya
Professor
Department of Electrical Engineering
National Institute of Technology
Kurukshetra – 136119
Haryana, INDIA

II
ACKNOWLEDGMENT

It is my privilege to acknowledge with respect & gratitude, the keen valuable and ever-available
guidance rendered by Dr Ratna Dahiya without her counsel and guidance, it would have been
impossible to complete the thesis in this manner.

I will always be highly grateful to Dr L.M. Saini, Head of the Department of Electrical
Engineering, for providing this opportunity to carry out the present work. The guidance and
encouragement received from the other faculty members of the Electrical Engineering
Department, NIT Kurukshetra has been of great help in carrying out the present work and is
acknowledged with reverential thanks for their intellectual support throughout this work.

Finally, I am indebted to my family, for their ever-available help in accomplishing this task.
Above all, I am thankful to the almighty God for giving me the strength to carry out the present
work.

PRIYESH SAINI

Roll No: 31904205

III
NOMENCLATURE

IoT Internet of Things

ANN Artificial Neural Network

AMI Advanced Metering Infrastructure

PMU Phase Measurement Unit

EV Electric Vehicle

AEP American Electric Power

LSTM Long Short-Term Memory

AI Artificial Intelligence

DRM Demand Response Management

MDA Meter Data Analytics

IV
ABSTRACT

Due to the exceptional progress in the field of Information and Communication Technology in
the past decades, an information layer is added to the existing power infrastructure which
collects a large amount of data for its analysis. This power grid system combined with the
information layer is popularly known as Smart Grid. Unlike a conventional power grid, a Smart
grid allows the bidirectional flow of both power and data between the generator and consumer.
Smart grid consists of several IoT devices like Smart Meters and Phase Measurement Units
(PMU).

In recent years, smart meter data analytics have become an invincible tool to tackle Smart grid
problems such as fault and theft detection, energy forecasting, power quality monitoring etc.
The smart grid generates a wide range of data at a very fast rate which can be used to deal with
the aforementioned problems.

The challenge of load forecasting using sophisticated Machine and Deep learning algorithms
has gained significant attention due to advancement in power generation through renewable
resources and the expansion of the Electric Vehicle (EV) market around the world. However,
designing an accurate load forecasting model that can operate on a wide variety of data is still
an area of extensive research.

Our methodology involves the application of the LSTM model from the Sci-kit Learn library
to predict the future load demand using the past recorded data. The raw dataset used is provided
by American Electric Power (AEP). To yield accurate result, data is normalized using a Min
Max scaler. During the training of the model, the Hyperbolic tangent function is used as an
activation function. For evaluation of the accuracy of the model R-square metric is used. Our
model has outperformed other all models in terms of accuracy.

V
CHAPTER 1

INTRODUCTION

1.1 BACKGROUND

Due to the technical advancements in the last decades, the demand for electrical energy has
grown considerably. It has become the most consumed as compared to other sources of energy
i.e. fossil fuel, oil & natural gas. Since electricity is not readily available in nature, it has become
a necessity to produce it. There are several ways for generating electrical energy, such as the
combustion of fossil fuels to produce steam, nuclear fission and kinetic energy of water.
Nevertheless, the challenge that remains is that electrical energy cannot be stored in large
quantity. Hence, it needs to be produced on the principle of demand to supply. A human being
spends a major portion of his lifetime inside buildings, which calls for a considerable demand
of energy to fulfil their needs and comfort. Moreover, the power demand changes continuously
throughout the day. Thus, the generated electricity needs to meet the instantaneous demand of
the consumer. This information about consumer’s consumption pattern can be obtained by
integrating information and communication technologies (ICT) into the conventional power
grid. This combination is known as the smart grid.

The smart grid is an intelligent electrical grid network that integrates sensors, Advanced
Metering Infrastructure (AMI) and Information & Communication Technology, to ensure an
economically efficient, stable and sustainable power system. The smart grid records the
interactions between the consumer and generation end to enable modern energy management
techniques. Smart grid has many pros and energy management tools such as energy monitoring
and decision support system that can guide decision-makers to track the energy waste and
dictate the areas where improvement is required. There are many solutions to optimize the use
of energy sources in the smart grid; however, they all rely on precise information about
generation and demand. Fortunately, due to the advancement of hardware technology in the last
decade, it is now possible to generate, store and process a huge amount of data using sensors,
AMIs and servers respectively.

Some of the challenges of smart grid on which extensive research is going on to solve them
using the recorded data includes Demand Response Management (DRM), Fault and theft
detection, Load Forecasting and Cyber Security. In this paper, our focus is on Load Forecasting
1
which comes under the category of Meter Data Analytics (MDA) and it aims to predict the
future demand based on past energy consumption patterns. Power companies employ load
forecasting to fulfil demand response management, Grid commitment, price estimation,
security and capacity of the network. Load forecasting is subdivided into four major categories:

a) Very short-term forecasting – Prediction for 15 min to 24 hours.

b) Short term forecasting – Prediction for 10 hours to 2 weeks.

c) Medium-term forecasting – 2 or 3 months to 5 years.

d) Long term forecasting – Prediction for 5 to 20 years.

Among all, Short-Term Load and Solar PV Forecasting are of utmost importance for effective
planning, energy optimization and electric vehicle charging system.

1.2 CONCEPTUAL DEFINITIONS

Before proceeding further, we need to understand several terminologies which are interrelated
and commonly used in different contexts while performing analytics in the smart grid. These
are:

Statistics: It is the study of the collection, analysis, interpretation, presentation, and


organization of data. Further, it can also be defined as the mathematics of estimating parameters
of populations based on data from different representative samples of those populations. In
statistics, the standard procedure for statisticians is to start with a null hypothesis (a default
position that there is no relationship between two quantities) which is compared with an
alternate hypothesis (a position that states there is a relationship between two quantities). The
decision to reject a hypothesis is taken based on various statistical tests which are performed
on different population samples.

Data Analytics: It is the discovery and communication of meaningful patterns in data. Data
analytics is a (sometimes automated) process used to discover novel, valid, useful and
potentially interesting knowledge from large data sources which is otherwise difficult to
uncover. If statistics is to be considered a branch of mathematics, data analytics is inclined
towards performing the same functionality for computer science. Visual tools and techniques
are the preferred means of communicating the results of performing data analytics.

Machine Learning: It is the ability of machines (associated with computers) to learn


automatically without being explicitly programmed. It deals with the representation and

2
generalization of data and creates a representation of instances and functions which are
evaluated on these data. Generalization is the unique property that the machine learning systems
will try to yield, that is, the ability of the systems to perform well even on unknown data
instances.

Artificial Intelligence: It is the intelligence exhibited by machines, as opposed to natural


intelligence exhibited by humans or animals. AI encompasses techniques that can endow an
object or a program with human-like intelligence. AI also includes intelligent agents, entities
that perceive their environment and take actions based on that perception.

Figure 1.1 Venn diagram illustrating the interconnectedness of several domains

The purpose of different types of analytics change is as follows:

● Descriptive analytics provide information about what happened and it marks the first step
that tries to identify useful data for further processing. It includes data visualization, data mining
or aggregation of reports.

● Diagnostic analytics aims to understand the cause of events and system behaviour and tries
to identify challenges and opportunities.

● Predictive analytics are used to make probabilistic predictions to identify trends to determine
what might happen in the future.
3
● Prescriptive analytics is applied to identify the best outcome to events, given the system’s
parameters, and draw strategies to deal with similar events in the future. It uses tools such as
simulation techniques and decision support to explore optimal strategies to best take advantage
of a future opportunity or to mitigate future risk.

Figure 1.2 Types of Data Analytics

4
CHAPTER 2

LITERATURE SURVEY

2.1 LITERATURE REVIEW

The techniques used to predict energy consumption are classified into two broad categories;
engineering and statistical. The first technique involves the application of mathematical
equations to present the thermal performance of the systems. Although this method is highly
accurate and reliable, it is difficult to generalize and require a high degree of detail and expertise
to perform costly and elaborate computations. On the contrary, the second method does not
require such detailed data about the simulated area and instead, it learns from real-time and past
data. The second technique is further categorized into parametric and non-parametric. The
parametric methods utilize the past consumption data as well as the principles of regression and
time series techniques to perform load forecasting. For instance, the studies focusing on
Multiple Linear Regression (MLR) [3], Auto-Regressive Integrated Moving Average (ARIMA)
[4], [5] and Seasonal ARIMA (SARIMA) [6] comes under this category. The non-parametric
methods, however, focus on load-related and non-related variables as well as various training
algorithms to perform short-term load forecasting. The studies which employ machine learning
and Artificial-Intelligence-based techniques such as ANN [9] and neuro-fuzzy systems [10]
belong to this group.

Extensive research has been done on short term load forecasting in the field of big data analytics
of smart grid and renewable sources of energy. [1]-[3]. Several approaches have been taken
since the early 90’s such as Artificial Neural Network (ANN) [4]-[6] and fuzzy logic [7]. Recent
methods include Regression Analysis, Time-series approach, Auto Regressive Moving Average
(ARMA) and Auto-Regressive Integrated Moving Average (ARIMA) model. But these
methods work best only in fitting linear curves. Since the load consumption pattern is often
non-linear, seasonal and complex, such models do not produce accurate results. [8],[9]. The
method of forecasting using 1D Convolution Neural Network (CNN) is also proposed in
reference [10].

5
2.2 LITERATURE GAP

In this paper, we have worked on an improved version of the Recurrent Neural Network (RNN)
known as the Long Short-Term Memory (LSTM) algorithm to fit the non-linear dataset of
energy consumption. The dataset for this project is provided by American Electric Power
(AEP). The dataset has a total of 1,21,273 records which provides information about the energy
consumption along with time and date stamp. The data is collected from 31st Dec 2004 to 2nd
Jan 2018. To visualize the data Matplotlib and Seaborn libraries are used while applying Deep
learning algorithms, Keras using TensorFlow as the backend is used.

Earlier models as shown in references presented several models using advanced and
complicated algorithms to produce an accurate result. However, as the algorithms become more
complex it took more time to train the model. Also, it needs an advanced hardware specification
to run these models which is a costly affair. Michele Banko and Eric Brill in their paper [11]
proved that even a simple algorithm can yield outstanding result given that data is sufficient.
The authors suggested that it is not just algorithm development but also the collection of data
on which we should invest time and money. A similar idea of “Data matters more than
algorithm” was propagated by Peter Norvig in his research paper [11] in 2009.

Hence, in this paper, we have given significant importance to preparing the data to fit for the
algorithm to work. Raw data is processed using min-max scalar and other standardization
features of the Sklearn library. Using the feature selection process, important parameters are
extracted which then are further used in the final data on which the deep learning algorithm is
applied. Finally, the accuracy of the model is evaluated in terms of the loss function and the R
square metric.

2.3 METHODOLOGY OF OUR MODEL

The proposed model is divided into five steps

1. Data Pre-processing
2. Data Visualization
3. Data Normalization
4. Preparing Training and Test data
5. Fitting the LSTM model

6
CHAPTER 3

BIG DATA ANALYTICS

3.1 WHAT IS BIG DATA?

At present, there is no standardised definition to define the term ‘Big Data. But there is a
consensus among different descriptions:

This is an emerging technical problem brought by a dataset of large volume, various categories
and complicated structures which needs novel framework and techniques to excavate useful
information effectively. Therefore, the definition of big data depends on the ability of data
mining algorithms and the corresponding hardware equipment to deal with large volume
datasets (Zikopoulos & Eaton, 2011).

It is a relative concept instead of an absolute definition. Big data can be understood as the
amount of data beyond technology’s capability to store, manage and process efficiently (Kaisler
et al., 2012) as the data size increasing along with the evolvement of ICT technologies.

3.2 BIG DATA CHARACTERISTICS IN SMART GRID

The characteristics of big data in smart grid are also as per the universal 5 V big data model as
below:

(i) Volume – It refers to the vast amount of data generated, which makes datasets too large to
store and analyse using traditional database technology. The possible solution to this problem
is the distributed systems to store data in different locations, connect them by networks and
bring them together by software. In the smart grid, the widespread application of smart meter
and advanced sensor technology provides a huge amount of data.

(ii) Velocity – refers to the speed at which new data is generated and the speed at which data
moves around. The requirements for real-time exchange of data is increasing. With a sampling
rate of 4 times per hour, 1 million smart meters installed in the smart grid would result in 35.04
billion records, equivalent to 2920 Tb data in quantification.

7
(iii)Variety – refers to the types of data we can now use. In the past, we focus on structured data
that neatly fit into tables or rational databases such as financial or meteorological data. With
big data technology, we need to handle different types of unstructured data including messages,
social media conversations, digital images, sensor data, video or voice recordings and bring
them together with more traditional, structured data. According to the extensive data sources in
the smart grid, as shown in Fig. 3.2, the formats and dimensions of data are diverse in structure.

(iv) Veracity – refers to the messiness or trustworthiness of the data. The quality and accuracy
are less trustworthy with such a large amount of big data, which challenge the outcome data
analysis. Errors of measurements in the smart grid may exist due to imperfections in devices or
mistakes in data transmission. The secure and efficient power system operation relies on data
assessment and state estimation.

(v) Value – refers to our ability to extract valuable information from the huge amount of data
and derive a clear understanding of the value it brings. The larger the amount of data is, the
lower the density of valuable information will be. With the improvement of intelligent devices
adopted in the smart grid, more and more value of big data analytics is revealed according to
the various applications.

Figure 3.1 Five Vs of Big Data

8
3.3 DATA SOURCES IN SMART GRID

As an intelligent system of both energy and information, the smart grid is an abundant source
of information, which covers the data from the process of electricity generation, transmission,
distribution and consumption. These data include the electrical information from distribution
stations, distribution switch stations, electricity meters, and non-electrical information like
marketing, meteorological as well as regional economic data as shown in Fig. 3.2. Collection
and analysis of them provide essential help in scheduling of power plants, operation of
subsystems, maintenance for vital power equipment and business behaviour in marketing. The
data sources mentioned above can be sorted into three categories: measurement data, business
data and external data. Most of the operating parameters in the power system are measured
through installed sensors and smart meters, indicating the system’s current and historical status.
The weather conditions and social events like festivals are the external data that cannot be
measured from smart meters but have an impact on the operation and planning of the power
system. The business data mainly includes the marketing strategies and rivals’ behaviour.

Figure 3.2 Different sources of data in Smart Grid

9
3.4 SCOPE OF BDA IN SMART GRID

• Fault detection and prediction

• Predictive maintenance/condition-based maintenance

• Transient stability analysis

• Electric device state estimation/health monitoring

• Power quality monitoring

• Renewable energy forecasting

• Load forecasting

• Load profiling/balancing

Figure 3.3 Various application of BDA in Smart Grid

10
CHAPTER 4

ARTIFICIAL NEURAL NETWORK

4.1 ANN

Nature has always been the source of inspiration for most of the inventions of mankind. Hence,
it should be of no surprise that the concept of Artificial Neural Network (ANN) is derived from
the inner workings of the human brain. In fact, in the rudimentary stages of its development,
the whole ANN idea was just about to somehow mimic the working of the human brain. Today,
however, it has evolved into a completely different field that can be used to handle problems of
nature that are often multivariate, non-linear and complex. Similar to the biological nervous
system, the basic building block in ANN are Neurons. They are responsible for transferring and
processing the information which is provided by sensory organs.

Figure 4.1 Anatomy of a Biological Neuron

Figure 4.2 Functioning of Human Brain

11
Figure 4.3 Functioning of ANN

A feed-forward neural network model also known as Multilayer Perceptron (MLP) consists of
three layers namely, input layer, hidden layer and output layer. The input layer consists of units
that pass the input data to the hidden layer without any loss of information. The hidden layer
consists of several neurons which can be set by tuning the hyperparameters. There can be more
than one hidden layer and it is determined by the dense parameter. The output layer provides
the output given by the hidden layer. The basic architecture of the MLP is shown in figure 4.4.

Figure 4.4 Basic Architecture of MLP

The three fundamental components in any neural network model are:

a) Weights associated with linkages within different layers.


b) A summing component is responsible for taking the weighted sum of inputs and
weights.
c) The activation function restricts the output of neurons.

It is an activation function that adds non-linearity to the network and enables the model to learn
from complicated data and fit a non-linear curve according to it. There are several activations
functions. Their usage depends on their location and the type of problem that needs to be solved.
Some of the popular activation functions, shown in Fig. 4.7 are step, sigmoid, hyperbolic

12
tangent, gaussian, Rectified Linear Unit (ReLU) and Leaky ReLU. In this paper, we have used
the hyperbolic tangent function for our problem which ranges from -1 to 1.

Figure 4.5 Working of Activation Function

Figure 4.6 Generalized structure of ANN

4.2 COMMONLY USED ACTIVATION FUNCTIONS

Figure 4.7 Commonly used Activation Function

13
CHAPTER 5

MODEL DEVELOPMENT

Load Forecasting requires a comprehensive understanding of past data. Hence preparing the
data before fitting is a crucial part of the project. The proposed model is divided into five steps

1. Data Pre-processing

2. Data Visualization

3. Data Normalization

4. Preparing Training and Test data

5. Fitting the LSTM model

5.1 DATA PRE-PROCESSING

In practical scenarios, the data which we get from several smart devices is often not suitable for
applying algorithms directly. It needs to be checked for corrupt data, missing values and
important features or insights which can be extracted from the raw dataset. The dataset for our
work is provided by American Electric Power (AEP). It contains 121273 records of energy
consumption (in megawatts) from 1st Oct 2004 to 3rd Oct 2018. The records are recorded on an
hourly basis i.e. 1 reading per hour.

Figure 5.1 Raw Dataset

14
No error or missing values were found in the dataset. To gain more insights into the data, the
DateTime library is used. This will extract information such as date, month, year, time week
and day. Furthermore, the consumption of energy also depends on weather conditions and
holidays. Therefore, we have used the holiday library which helped us to classify between
normal days and American holidays. Also, by using the if-else condition a new column was
created using a season function. The criteria for labelling the season based on the month is as
follows:

1. Winter – December to February


2. Spring – March to May
3. Summer – June to August
4. Autumn – September to November

Since America lies in the northern hemisphere, the above criteria of the season are based on the
seasonal cycle of the northern hemisphere. From Fig. 5.3, it is clear that the number of records
of energy consumption for the year 2004 is far less than in other years. This will create a bias
in the model hence, in the later stages, it is better to drop the records of the year 2004 and train
the model for the data recorded from 1 st January 2005. Since we still have large data to work
on, it will not have any impact on the performance and accuracy of the model.

Figure 5.2 Processed Dataset

15
Figure 5.3 Number of records per year

5.2 DATA VISUALISATION

It is widely accepted that graphs and diagrams are more comprehensive tools as compared to
tables. They enable us to gain more detailed insights into the trends of data in very little time.
Hence, we have used Matplotlib and Seaborn library to visualize our dataset.

Graph 5.1 Visualising the processed dataset

Graph 5.1 gives an overview of what our data looks like. Clearly, there is a trend in energy
consumption. Over the years, the minimum load demand was 9581 MW while the maximum
was 25695 MW. To get more intuition about what daily load demand is, the energy
consumption of a random day is shown in Graph 5.2.

16
Graph 5.2 Energy consumption pattern of a day

Similarly, the energy consumption for October and November is shown in Graph 5.3 and 5.4
respectively.

17
.

Graph 5.3 Energy consumption pattern for October 2004

18
Graph 5.4 Energy consumption pattern for November 2004

To analyse the effect of other variables such as seasons and holidays over the energy demand
bar plots and kernel density plots are plotted as shown in Graph 5.5 and 5.6. It is evident that
load demand was higher for extreme weather situations such as for summer and winter seasons.
Interestingly, there was not much variation in the pattern of energy consumption between
holidays and normal days. Also, the number of holidays is very less as compared to normal

19
days hence, it is obvious that the holiday variable is not suitable for training our model.

Graph 5.5 Energy demand in different Seasons

Graph 5.6 Energy demand wrt days

5.3 DATA NORMALIZATION

Often in a dataset, the range of data values is very broad. It is very practical to find values of
order 104 and 10-4 simultaneously in the same dataset. This broad range can easily influence the
training of the model. If the absolute difference (D) is defined as

D = |Max Value – Min Value|

Then, if D is close to the Max value, the data close to the max value will influence the training
of the model and vice versa. This ultimately will create a bias that will hamper the accuracy of
our model. Another disadvantage of implementing a deep learning algorithm on a raw dataset
is Straight Line Accuracy. It is a situation when the accuracy of the model does not improve
with the number of epochs. This happens when gradients oscillate back and forth a lot before
finding optimum global or local minima. Obviously, this makes our model slow and resource
hungry.

20
To tackle the aforementioned predicaments, it is often recommended to either normalize or
standardize the data before training the model. In our project, we have used Min Max Scalar
for normalization. The equation to calculate the normalized value is as follows:

A−Amin
ANorm = Amax−Amin

Graph 5.7 Dataset following Gaussian Curve

It is to be noted that normalization becomes important when the dataset follows Gaussian
Curve. In such a situation normalization can lead to great improvements in terms of accuracy.

Figure 5.4 Normalised values

21
5.4 TRAINING & TESTING DATASET

Accuracy is one of the most important factors of any predictive model. Hence, once the model
is trained, it becomes imperative to test the accuracy of the prediction of the model. For this
purpose, we use out of sample accuracy in which a portion of the dataset is not used in training
the data. This data is later used to evaluate the accuracy of the model.

Accuracy = |True value – Predicted Value|

Training data is used to evaluate in-sample accuracy while testing data is used to evaluate out-
of-sample accuracy. In terms of practical utility later holds much greater importance than the
former. The dimension of generated training and testing data is shown in Fig. 5.6.

Figure 5.5 Dividing the dataset

Figure 5.6 Training and Testing Data

5.5 FITTING THE LSTM MODEL


After all the data processing, feature engineering and normalizing finally the dataset is ready
to apply Long Short-Term Model (LSTM) algorithm to train the model. In our work, we have
used hyperbolic tangent as an activation function which ranges from -1 to +1.

22
The summary of the LSTM model is shown in Fig 5.7.

Figure 5.7 Summary of LSTM model

23
CHAPTER 6

RESULTS

Our model predicts the future load demand by learning the non-linear and complex relationship
between the variables through the use of an improved version of Recurrent Neural Network i.e.
LSTM. While fitting the data, Adam optimizer is used, the number of epochs were 28 and each
batch size was set to 1000. It is clear from Graph 6.1 that with number epochs the validation
loss went on decreasing and the trained data neither suffers from overfitting nor underfitting.

Graph 6.1 Training vs Validation loss

The final output of the prediction is shown in Graph 6.2. It is visually evident that the prediction
made by our model is highly accurate and the credit for this is not just the LSTM algorithm but
also the processing of data so that even a basic algorithm can yield an accurate result. For the
sake of clarity, a zoomed view of comparison between actual and predicted values for the next
300 hours is shown in Graph 6.3. To quantify the accuracy, we have 3 evaluation metrics
namely; R2 score, Mean Square Error (MSE) and Root Mean Square Error (RMSE). Fig. 6.1
reveals the values of all the evaluation metrics used to evaluate the accuracy of the model.

24
Graph 6.2 Actual Values Vs Predicted Values

25
Graph 6.3 Zoomed View of Actual VS Predicted values for next 300 hours

26
Figure 6.1 R2 Score, MSE and RMSE values

27
CONCLUSION

We proposed an RNN based model to predict the future load demand by analysing the
complicated relationship between several variables such as weather, holidays and energy
consumption habits. The model is made using a dataset provided by American Electric Power
(AEP). The results we obtained from our model are conclusive evidence that even by using
simple deep learning algorithms, high accuracy can be achieved. Processing the dataset and
making it suitable to fit the algorithm is the most crucial part of the project. The dataset should
be free from any missing or NaN values, corrupt or incorrect values. Proper feature engineering
is mandatory to identify the input variables that will greatly affect the prediction.

Due to the advancement in hardware technology and Artificial Intelligence, analytics of the
smart grid has become a hot topic for engineers and data scientist worldwide. There are
boundless opportunities for future researchers to work on. In the case of a more complicated
dataset where non-linearity is to its extreme, there is a need to identify other parameters and
variables which affects the energy consumption. To smoothen the process of data pre-
processing, feature extraction and normalization, a pipeline can be created which will reduce
the processing time. In addition to that, there is also an urgent need for more optimized deep
learning algorithms that is specific to load forecasting problem so that the result of the desired
accuracy can be achieved at low cost.

28
REFERENCES

[1] X. Zhang, M. Cheng, Y. Liu, D. H. Li and R. M. Wu, “Short-Term Load Forecasting Based
on Big Data Technologies,” Appl. Mech. Mater., vol. 687-691, no. 3, pp. 1186-1192, 2014.

[2] A. Ahmad, N. Javaid, M. Guizani, N. Alrajeh, and Z. A. Khan, “An Accurate and Fast
Converging Short-Term Load Forecasting Model for Industrial Applications in a Smart
Grid,” IEEE Trans. Ind.Informatics, vol. 13, no. 5, pp. 2587–2596, 2017.

[3] A. Asrari, T. X. Wu, and B. Ramos, “A Hybrid Algorithm for Short-Term Solar Power
Prediction - Sunshine State Case Study,” IEEE Trans. Sustain. Energy, vol. 8, no. 2, pp.
582–591, 2017.

[4] M. Beccali, M. Cellura, V. L. Brano, and A. Marvuglia, "Forecasting daily urban electric
load profiles using artificial neural networks," Energy Conversion and Management, vol.
45, no. 1819, pp. 2879 - 2900,2004.

[5] H. Hippert, C. Pedreira, and R. Souza, "Neural networks for short term load forecasting: a
review and evaluation," Power Systems, IEEE Transactions on, vol. 16, no. 1, pp. 44- 55,
Feb 200l.

[6] K. Gajowniezek and T. Zbkowski, "Short term electricity forecasting using individual
smart meter data," Procedia Computer Science, vol. 35, pp. 589 - 597, 2014.

[7] K. B. Song, Y. S. Baek, D. H. Hong, and G. lang, "Short-term load forecasting for the
holidays using fuzzy linear regression method," Power Systems, IEEE Transactions on,
vol. 20, no. 1, pp. 96-101, Feb 2005.

[8] Q. W. Luthuli, “Short Term Load Forecasting using Artificial Intelligence,” 2016 IEEE
PES PowerAfrica, pp. 129–133, 2016.

[9] Endesr robinson, Ed., An Introductory Study on Time Series Modelling and Forecasting
Ratnadip Adhikari R. K. Agrawal, Revised Ed. Holden-Day, 1976.

[10] Abraham Kaligambe, Goro Fujita, “Short Term Load Forecasting for Commercial
Buildings Using 1D Convolutional Neural Networks”, 2020 IEEE PES/IAS PowerAfrica,
2020.

[11] Aurelien Geron, “Hands-on Machine Learning with Scikit-Learn, Keras and
TensorFlow”, O’Reilly Publication 2nd edition.

29

You might also like