Electricity Demand Forecasting Using ANN

5
1 Abstract: - Demand forecasts are important for energy suppliers, electricity generation, transmission, distributors. Since the electricity demand is volatile in nature; it cannot be stored and has to be consumed instantly. The aim of this study detail with electricity consumption towards forecast future projection of demand. The input variables used are Population, GDP, gross national income, Industry, Consumer price index and Per capita power consumption. The approach method using artificial neural network (ANN) based on Feed-Forward neural network, trained by using incremental backpropagation (BP) algorithm. Forecasting capability is evaluated by calculating the Mean Square Error (MSE). Index Terms: Electricity Demand, Feed-Forward N.N, backpropagation, Root Mean Square Error. I. INTRODUCTION Expanding access to energy means including 1.2 billion people: 0.6 billion that still have no access to electricity (81% of whom live in the rural areas) and 0.4 billion that only has access to unreliable electricity networks. We need machine technique and practical approaches, as a mechanism that receives inputs directly and transmits to development, electricity plays a central role in both fighting poverty and addressing climate change. Medium and long-term load fore- casting using Artificial neural network algorithm has achieved satisfactory results [2-5] . The implementation tasks can be divided into four headings: I. DATA ENCODING AND NORMALIZATION II. ARTIFICIAL NEURAL NETWORK III. TRAINING IV. COMPUTING ACCURACY This subdivision is data pre-processing and sent to Feed-Forward neural network and training using incremental back-propagation is used to predict the following year electricity load and it is implemented in visual studio 2015 community using C# language. II. DATA ENCODING AND NORMALIZATION One of the essential keys to working with artificial NN is data encoding and normalization. After all data has been collected we may have some data in non-numeric data and high magnitude data. After all data has been converted to Encoding non- numeric output data to numeric values by using 1-of- N encoding, encoding non-numeric input data to numeric values by using 1-of-(N-1) encoding and apply normalization to high magnitude using any one out of two different types of normalization, Gaussian normalization and min-max normalization. Fig. 1: Data normalization In general, the min-max normalized value for some value x is (x - min) / (max - min)very simple, the Gaussian normalized value for some value x is (x - mean) / standard deviation. III. ARTIFICIAL NEURAL NETWORK An artificial neural network will accept one or more inputs and produces one or more outputs. The basic neural network input to process (hidden layer) and process to output computation is known the feed- forward NN mechanism. Electricity Demand Forecasting Using ANN K Naren Chandra (15MCC1023) * Department of Computer Science Engineering, VIT University, Chennai-600128, India Phone: 9790723239*, E-mail:[email protected]

Transcript of Electricity Demand Forecasting Using ANN

Page 1: Electricity Demand Forecasting Using ANN

1

Abstract: - Demand forecasts are important for energy

suppliers, electricity generation, transmission,

distributors. Since the electricity demand is volatile in

nature; it cannot be stored and has to be consumed

instantly. The aim of this study detail with electricity

consumption towards forecast future projection of

demand. The input variables used are Population, GDP,

gross national income, Industry, Consumer price index

and Per capita power consumption. The approach

method using artificial neural network (ANN) based on

Feed-Forward neural network, trained by using

incremental backpropagation (BP) algorithm.

Forecasting capability is evaluated by calculating the

Mean Square Error (MSE).

Index Terms: Electricity Demand, Feed-Forward N.N,

backpropagation, Root Mean Square Error.

I. INTRODUCTION

Expanding access to energy means including 1.2

billion people: 0.6 billion that still have no access to

electricity (81% of whom live in the rural areas) and

0.4 billion that only has access to unreliable electricity

networks. We need machine technique and practical

approaches, as a mechanism that receives inputs

directly and transmits to development, electricity plays

a central role in both fighting poverty and addressing

climate change. Medium and long-term load fore-

casting using Artificial neural network algorithm has

achieved satisfactory results [2-5].

The implementation tasks can be divided into four

headings:

I. DATA ENCODING AND NORMALIZATION

II. ARTIFICIAL NEURAL NETWORK

III. TRAINING

IV. COMPUTING ACCURACY

This subdivision is data pre-processing and sent to

Feed-Forward neural network and training using

incremental back-propagation is used to predict the

following year electricity load and it is implemented

in visual studio 2015 community using C# language.

II. DATA ENCODING AND NORMALIZATION

One of the essential keys to working with artificial NN

is data encoding and normalization.

After all data has been collected we may have some

data in non-numeric data and high magnitude data.

After all data has been converted to Encoding non-

numeric output data to numeric values by using 1-of-

N encoding, encoding non-numeric input data to

numeric values by using 1-of-(N-1) encoding and

apply normalization to high magnitude using any one

out of two different types of normalization, Gaussian

normalization and min-max normalization.

Fig. 1: Data normalization

In general, the min-max normalized value for some

value x is (x - min) / (max - min)— very simple, the

Gaussian normalized value for some value x is (x -

mean) / standard deviation.

III. ARTIFICIAL NEURAL NETWORK

An artificial neural network will accept one or more

inputs and produces one or more outputs. The basic

neural network input to process (hidden layer) and

process to output computation is known the feed-

forward NN mechanism.

Electricity Demand Forecasting Using ANN K Naren Chandra (15MCC1023) *

Department of Computer Science Engineering, VIT University, Chennai-600128, India Phone: 9790723239*, E-mail:[email protected]

Page 2: Electricity Demand Forecasting Using ANN

2

Fig. 2: Neural Network Architecture

Understanding the feed-forward NN mechanism is

important to know how to create NN, which will make

predictions.

A NN computes in several stages to get output and the

feed-forward NN mechanism is explained by using

Fig. 2, there are six inputs each line connecting one

node to another represents a weight constant. The

weight is labeled IHWEIGHT [0] [0] it represents the

weight from input GDP to hidden 1 and the weight in

the lower right corner is labeled HOWEIGHT [12] [0]

it represents the weight from hidden 7 to output. All

hidden and output layer nodes has an arrow pointing

to it this are called the bias values.

The first stage in the feed-forward NN mechanism is

to compute for all hidden nodes. The value of hidden

1 node and is computed as the product of each input

value and its associated weight are summed then

associated bias value is added.

From Fig. 3 Pre-activation sum function applied by

the activation function, it will be explained in detail

next section, but for now it's enough to say that the

activation function is the hyperbolic tangent function,

which is usually abbreviated tanh.

Hidden 1 = tanh (pre-activation sum)

After all, hidden node output values have been

computed, these values are used as inputs to the output

nodes and it’s computed slightly differently from the

hidden nodes. The preliminary output sums, before

activation, for output nodes are computed the same

way as hidden node sums, the activation function for

the output layer is called the softmax function.

For 1ouput:

output = exp (pre-activation output sum) / exp (pre-

activation output sum)

For n output:

output = exp (pre-activation output sum) / sum of all

sum of all= exp (pre-activation output 1 sum) +…...+

exp (pre-activation output n sum)

Fig. 3: Activation Functions

If we look at Figures 2, we will see these are the final

output values computed by the neural network. Where

exp function is the math constant e = 2.71828. . . raised

to the xth power. Notice the output values sum is 1.0,

which is not a coincidence that is the point of using the

softmax function.

A. Activation Functions

In above the hyperbolic tangent function for hidden

layer node activation and the softmax function for

output layer node activation. There is a third common

activation function called the logistic sigmoid function

In general, the hyperbolic tangent function is the best

choice for hidden layer activation. For output layer

activation, if neural network is performing

classification where the dependent variable to be

predicted has three or more values softmax activation

is the best choice. If neural network is performing

classification where the dependent variable has

exactly two possible values the logistic sigmoid

activation function is the best choice for output layer

activation.

IV. TRAINING

The ultimate goal of a neural network is to make a

prediction. In order to make a prediction, a neural

network must first be trained. Training a neural

network means finding a set of good weights and bias

values so that the known outputs of some training data

match the outputs computed using the weights and

Page 3: Electricity Demand Forecasting Using ANN

3

bias values. The resulting weights and bias values for

a particular problem are often collectively called a

model and it’s used to predict the output for unseen

inputs that is computed for known output values.

The data set consists of a total of 5 items data set and

splits it randomly into a 4-item subset (80%) to be used

for training and a 1-item subset (20%) to be used for

testing, that is, to be used to estimate the probability of

a correct classification on data that has not been seen

before. Training a 6-7-1 fully connected feed-forward

NN using the back-propagation algorithm in

conjunction with a technique that is called incremental

training.

After training has completed, the accuracy of the

resulting model is computed on the training set and on

the test set.

A. Incremental Training

There are two main approaches for training a neural

network. As usual, the two approaches have several

different names but two of the most common terms are

Incremental and Batch. In high-level pseudo-code,

Batch Training is:

loop until done

o for each training item

compute error and

accumulate total error

o end for

o use total error to update weights and

bias values

end loop

The essence of batch training is that an error metric for

the entire training set is computed and then that single

error value is used to update all the neural network's

weights and biases.

In high-level Pseudo-code, incremental training is:

loop until done

o for each training item

compute error for current

item

use item's error to update

weights and bias values

o end for

end loop

In this training, weights and biases will be updated for

every training item. Based on some research evidence

suggests that incremental training given better results

than batch training.

In all training approaches there are two important

questions: “How do we determine when training is

finished?” and “How do we measure error?” will be

explained in detail main logic section.

B. Creating Training and Test Data

One of the strategies used in NN training is called

hold-out validation. It’s means to take the available

training data sets, and instead train the NN using all

the data, remove a portion of the data, typically

between 10–30%, to be used to estimate the

effectiveness of the trained model. The remaining part

of the available data is used for training.

Method Make-Train-Test accepts a matrix of data and

returns two matrices, the first return matrix holds a

random data 80% of the training data sets and the

another matrix is one that holds the other 20% of the

test data sets.

Algorithm for Make-Train-Test is:

compute number of rows for train matrix: =

n1

compute number of rows for test matrix: = n2

make a copy of the source matrix

scramble using the Fisher-Yates shuffle

algorithm the order of the rows of the copy

now copy first n1 rows of source copy into

train

copy remaining n2 rows of source copy into

test

return train and test matrices

It’s accepts a data matrix to split, and a seed value to

initialize the randomization process. The method

returns the resulting train and test matrices as out

parameter.

After creating the training and test matrices, it sent to

neural network. The number of input and output nodes

are determined by the source data: six numeric x-

values(input) and one y-value(output). Specifying a

good number of hidden nodes is one of the important

when working with neural networks. Even though

there has been much research done in this area, picking

a good value for the number of hidden nodes is mostly

a matter of trial and error.

C. Main Logic

After data preprocess and a NN instantiated, and

trained by using Max Epochs, Learning Rate,

Momentum, Exit Error. The Max Epochs variable sets

a hard limit on the number of iterations that will be

performed in the training code and it will not

determine when to stop the main training. The

Learning Rate and momentum values control the

speed at which the backpropagation converges to a

final set of weight and bias values if it’s turns out,

Page 4: Electricity Demand Forecasting Using ANN

4

back-propagation is extremely sensitive to the values

used for the learning rate and momentum. Even small

changes in these value can have very large effects

difference between a NN that predicts well and one

that predicts poorly.

For simplicity, the neural network has a fourth

parameter, an early-exit error threshold value of 0.040

that is hard-coded into Training.

The heart of Training has two exit conditions. The first

is a hard limit based on the Max Epochs value. The

second exit condition is a small error threshold based

on the mean squared error of the current model over

the entire training set. If anyone exit conditions

satisfied the Training will stop.

One interesting approach to the loop-exit issue is to

divide all available data into three sets rather than just

training and test sets. The third set is called the

validation set. For example, using a 60-20-20 split the

data set.

D. Mean Square Error

Training the neural network using the training data,

but inside the main training we should compute the

MSE on the validation data set. After some time, the

MSE on the validation set would drop but at some

point, when over-fitting begins to occur, the MSE on

the validation set would begin to increase. We should

identify at what epoch the MSE on the validation set

began to steadily increase and then use the weights and

bias values at that epoch for the final neural network

model. And then we should compute the accuracy of

the model on the unused test data set to get an estimate

of the model's accuracy for new data.

Training computes and checks the MSE value on

every iteration through the training. Computing MSE

is a will more time for each iteration, so an alternative

is to compute MSE only every 10 or 100 or 1,000

iterations.

After training has completed, the internal weights and

bias values that were determined by the training

process.

V. COMPUTING ACCURACY

The Result of the NN on the training data and testing

data is computed only after training has completed.

The accuracy of the test data is the very important out

of two accuracy result. The accuracy of the test data

gives us an estimate of the accuracy of the model on

new data with unknown y-values(output). A high

accuracy on the training data does not necessarily

indicate a good training, but a low accuracy on the test

data almost always indicates a poor training.

Fig. 4: Computing Accuracy Output

Method Accuracy uses a helper Max Index to find the

location of the largest computed y-value is correct or

incorrect prediction.

VI. CONCLUSION

Artificial NNs to forecasting electricity problems has

been studied in recent times, and so many number of

papers are report successful experiments and has been

published. However, not all the authors and

researchers in forecasting has not implemented in C#

language. Which has more advantages, in training we

can detected any inputs and data set has given wrong

by using diagnostic tools in visual studio 2015 if data

sets are very large can be stored in database and we

can new data sets to database, which makes efficient

computing and training. If we take less number of data

sets, we can’t make train Artificial NN as we seen Fig.

4 accuracy training and accuracy test data result is very

less compared to one.

REFERENCES

[1] Arunesh Kumar Singh, Ibraheem, S.

Khatoon, Md. Muazzam, D. K. Chaturvedi

“An Overview of Electricity Demand

Forecasting Techniques,” Vol.3, No.3, 2013-

National Conference on Emerging Trends in

Page 5: Electricity Demand Forecasting Using ANN

5

Electrical, Instrumentation &

Communication Engineering.

[2] R. Xu, G. K. Venayamoorthy, and D. C.

Wunsch, “Modeling of gene regulatory

networks with hybrid differential evolution

and particle swarm optimization,” Neural

Networks, Vol. 20, pp. 917– 927, 2007.

[3] Azadeh, S. F. Ghaderi, S. Tarverdian, and M.

Saberi, “Integration of artificial neural

networks and genetic algorithm to predict

electrical energy consumption,” Applied

Mathematics and Computation, Vol. 186, pp.

1731–1741, 2007.

[4] F. Hobbs, S. Jitprapaikulsarn, and S. Konda,

“Analysis of the value for unit commitment

of improved load forecasts,” IEEE Trans on

Power Systems, Vol. 14, no. 4, pp. 1342–

1348, 1999.

[5] S. A. Billings, and X. Hong, “Dual-

orthogonal radial basis function networks for

nonlinear time series prediction,” Neural

Networks, Vol. 18, pp. 479–493, 1998.

[6] L. Yue, Y. Zhang, Q. Zhong, and Z. Wang,

“Mid-long term load forecasting based on

fuzzy logic clustering neural network

approach,” Journal of North China Electric

Power University, Vol. 35, no. 2, pp. 42–46,

2008.

[7] A. Kazemi et al., “A Multi-Level Artificial

Neural Network for Gasoline Demand

Forecasting of Iran”, In Second International

Conference on Computer and Electrical

Engineering, pp. 61-64, 2009.

[8] A. Ghanhari, A. Naghavi, S.F. Ghaderi and

M. Sabaghian, “Artificial Neural Networks

and regression approaches comparison for

forecasting Iran’s annual electricity load”,

Proceeding International Conference on

Power Engineering Energy and Electrical

Drives. pp. 675-679, 2009.

[9] Sackdara, et al., “Electricity Demand

Forecasting of Electricity DU Lao (EDL)

using Neural Networks”, TENCON 2010, pp.

640-644, 2010.