Analysis and Prediction of Regional Electricity Consumption Based on BP Neural Network

: Electricity consumption forecasting is one of the most important tasks for power system workers, and plays an important role in regional power systems. Due to the difference in the trend of power load and the past in the new normal, the influencing factors are more diversified, which makes it more difficult to predict the current electricity consumption. In this paper, the grey system theory and BP neural network are combined to predict the annual electricity consumption in Jiangsu. According to the historical data of annual electricity consumption and the six factors affecting electricity consumption, the gray correlation analysis method is used to screen the important factors, and three factors with large correlation degree are selected as the input parameters of BP neural network. The power forecasting model uses nearly 18 years of data to train and validate the model. The results show that the gray correlation analysis and BP neural network method have higher accuracy in power consumption prediction, and the calculation is more convenient than traditional methods.


Introduction
The regional power grid electricity consumption forecast refers to the demand for electric energy from local individuals and business users. Based on the research on historical data, it makes a reasonable estimate of the regional electricity consumption, so that the relevant departments can work in the formulation and Policy reference. Power load forecasting is critical to the reliable and economical operation of power systems. Accurate power load forecasting helps grid companies to establish appropriate operational practices and bidding strategies and is an important basis for developing power development plans. Therefore, electricity consumption forecasting is a basic work that grid companies attach great importance to, and the forecast results may directly affect the company's benefits. Accurate electricity consumption forecasting has important reference value for rational design of power grid transformation, peak power consumption, and power generation planning. It is of great significance for the establishment of energy-saving society and industrial policies, and contributes to environmental protection targets such as energy conservation and emission reduction. Sustainable economic development. There are many methods for predicting electricity consumption. Traditional methods include linear regression prediction algorithms based on historical data statistics, time series prediction methods, and gray-scale model combination prediction methods [Wang, Huang and Xiong (2018)]. In recent years, with the deepening of machine learning algorithms, Machine learning-based algorithms such as neural networks, support vector machines [Pan, Cheng, Yang et al. (2014)], particle swarm optimization, genetic algorithms, and other intelligent prediction methods have emerged. In this paper, the method of combining gray correlation degree with BP neural network is adopted. Taking Jiangsu Province as an example, the MATLAB software is used to predict and analyze the region's electricity consumption. The rest of this paper is organized as follows: In Section 2, we analyze and determine Determination of factors affecting electricity consumption based on grey correlation theory, and a regional power consumption prediction training method based on BP neural network is proposed, while an example experimental is performed to show its feasibly. In the last Section, conclusion and discussion are conducted finally.

Determination of factors affecting electricity consumption based on grey correlation 2.1 Analysis of factors affecting power consumption
There are many factors affecting electricity consumption, such as population factors, temperature changes, national policy orientation, and economic development levels. Some of these factors have certain effects on electricity consumption, and some are random [Qu (2011)]. According to the principle of the influencing factor correlation model, the more influential factors input, the higher the accuracy of the prediction results. In order to increase the accuracy of power consumption analysis and forecast, this paper selects six factors that have an obvious influence on electricity consumption, namely, local GDP, per capita income, total power generation, total energy consumption, total fixed assets investment, and residents. The level of consumption and the degree of relevance is judged by the degree of gray correlation. Taking Jiangsu area as an example, this paper queries and collects the "Jiangsu Statistical Yearbook" to obtain quantitative analysis from six influencing factors from 1999 to 2017 and the annual electricity consumption statistics of Jiangsu Province as raw data.

Grey correlation analysis of factors affecting electricity consumption
Through utilizing the gray correlation degree theory [Zeng and Liu (2014)] to analyze the six influencing factors of electricity consumption, the correlation coefficient between each impact factor and electricity consumption is obtained. The specific steps are as follows.
Step 1: Determining the sequence of features and factors: For gray correlation analysis, the first task is to choose the feature sequence to be referenced and the sequence of factors to be compared [Ding, Wu and Chang (2016); Zhu (2015)]. In this paper, the power consumption is taken as the characteristic sequence, which is denoted as ( ) and ( 18) m m = data is collected: Here, the six factors affecting the power consumption are selected as the factor sequence, which is denoted as ( ) i x t , among which there are ( 6) n n = sub-sequences, and each sub-sequence collects m data: (1) Step 2: Data processing: According to the actual situation of the selected data, the initial value operator is used for calculation.
, and the initial value of the data is: (2) Step 3: Calculate the maximum difference and the minimum difference between the two poles: Calculate the difference sequence between the factor sequence and the feature sequence, ( ) i k ∆ , and find the maximum value M and minimum value m of the two- Step 4: Grey correlation coefficient and grey correlation degree: the correlation coefficient between the feature sequence and the factor sequence at the kth point is, where M is the maximum value of ( ) ( ) is the value at time k , and α is the resolution coefficient. Therefore, the degree of association between the feature sequence and the factor sequence is: We use MATLAB software to analyze and calculate the correlation between the annual electricity consumption in Hubei Province and the six influencing factors (shown in Tab. 1). It can be seen from the table that the three factors of annual power generation, household consumption level and regional GDP in Jiangsu Province are highly correlated with regional electricity consumption, so they are input into the BP neural network prediction model as decision variables.  [Zhuang, Hu and Yu (2014)] is a multi-layer forward network algorithm with error backpropagation. It is the most widely used multi-layer feedforward neural network. It consists of input layer, hidden layer, and output layer, as shown in Fig. 1. Each layer of the neural network is composed of a plurality of neurons that can be calculated in parallel. The neurons in different levels are completely interconnected, and the neurons in the same layer are not connected to each other [Huang, Wu and Wang (2016)].

Figure 1: The topology of BP neural network
The annual power generation, regional GDP, and household consumption level are the three inputs ( 3 a = ) of the BP neural network electricity consumption prediction model.
The number of neurons in the hidden layer is determined as 10, i.e., 10 b = , by trial and error [Jing, Zhou and Jiang (2017); Shen, Wang, Gao et al. (2018)] and multiple debugging. At this time, the convergence is better, the mean square error of the fitting is small, and the output layer outputs the result by predicting the power consumption as a single neuron ( 1 c = ). The input information is passed to the output layer through the hidden layer. If the output is not ideal, the error will propagate back in the neuron path, and the weight of each layer of neurons will be adjusted. The error will be limited to the set range by continuous iteration.

Power consumption prediction training method based on BP neural network
Training the network is to obtain the connection weight of the network from the known samples. For the trained network, if a set of data other than the training sample set is input, the BP neural network calculates the corresponding connection weight using the training process. In response to the output, get an answer to the actual problem. The training method of the BP network belongs to the supervised algorithms. The main idea is to first initialize the network, assign a random number in each interval to each connection weight, set the error function, and give the calculation accuracy value and the maximum number of learning times. For a set of input samples, the actual output is calculated by the BP neural network. The inputs and outputs of the neurons of the hidden layer are calculated, and the partial derivative of the error function to each neuron of the output layer is calculated using the expected output and the actual output of the network. Using the partial derivative of each neuron in the output layer and the input and output of each neuron in the hidden layer, the initial weight is added to the corresponding adjustment amount to calculate the new weight. Calculate the global error and determine whether the network meets the accuracy requirement. When the error reaches the preset accuracy or the number of learning times is greater than the set maximum number, the algorithm ends. Otherwise, select the learning sample and the corresponding expected output and return to recalculate the hidden layer input and output, and proceed to the next round of learning, and then loop until the square of the output layer error reaches the set value.

Example experimental and results analysis
According to the analysis results in Tab. 1, when we conducted neural network training, the power consumption samples from 1999 to 2017 in Jiangsu Province can be divided into two parts: training samples and test samples. Among them, 14 groups from 1999 to 2013 were selected as training samples, 2014-The 4 sets of data for 2017 are used as test samples. In Matlab, our correlation function is selected as follows [Bao and Yu (2016); Li and Zeng (2014)]: the implicit layer transfer function is set to logsig, the output layer transfer function is selected as tandig, the training function is trainlm, the learning function is selected as leannddm, and the network performance function is MSE. The parameters are selected as follows: learning rate is 0.005, expected error is 0.00001, and maximum learning frequency is 1000. After the model is trained, the test sample is used to test and verify its accuracy and generalization ability, and the actual value and predicted value, as shown in Tab. 2, are obtained. It can be seen from Tab. 2 that the minimum relative error between the predicted result and the true value is 0.91%, the maximum relative error is 1.85%, and the average relative error is 1.51%. The comparison between the actual annual electricity consumption value and the predicted value in Jiangsu area is shown in Fig. 2. From the comparison between the predicted data and the actual data, the BP neural network has better prediction performance and less relative error, which can fully meet the decisionmaking needs [Ge, Jiao and Liu (2012); Wang, Huang and Xiong (2018)], and the prediction speed is fast and the operation is convenient. So, we can say It is an ideal prediction model.

Conclusion and discussion
Because there are many factors affecting the electricity consumption of residents and enterprises, it is the key to simplify the model and calculation to select the factors that have high correlation with the prediction results from many influencing factors. In this paper, the grey theory model is used to study the correlation between annual electricity consumption and six influencing factors in Jiangsu, and then three impact factors with high correlation with electricity consumption are selected to improve the accuracy and operability of the prediction model. There is a complex nonlinear relationship between the various factors of the prediction result, and it is very difficult to express it with an accurate mathematical model. Considering that BP neural network is a kind of nonlinear mapping, it can realize selfadjustment and deal with the problem of similar nonlinear relationship. This paper uses BP neural network technology to design a mathematical model that can predict regional electricity consumption. When applying the model to make predictions, it is only necessary to input the corresponding data into the model, and use the hidden layer to extract the characteristics and internal relations of the data, and use the error feedback to correct the model parameters to predict the power consumption more accurately, with prediction accuracy. High, simple method. The empirical calculation has a small relative error and average relative error between the prediction result and the real value of the model, which satisfies the prediction error requirement, and proves the validity of the BP neural network model, which can provide a good reference for the planning of relevant departments.