Study of the Load Forecasting based on AKDC and LSTM algorithms

As one of the traditional research subjects of power system, load forecasting has always been a hot research direction of related experts and scholars. This paper uses an extended algorithm combining the advantages of adaptive K-means algorithm and distributed clustering algorithm, improves the traditional K-means algorithm, and uses LSTM algorithm to build a load prediction model. LSTMS can learn the advantages of long distance time series dependence to recognize load patterns from the horizontal (time dimension). The simulation results show that the LSTM algorithm based on Adam optimizer improves the accuracy of load prediction, and the proposed algorithm is verified.


Introduction
The flexible scheduling of power system depends on load forecasting, and the prerequisite of load forecasting is to understand the load characteristics of users.Power system load forecasting is an important part of power system planning [1].It predicts future demand based on known demand.The result can reflect the development status and level of load to a certain extent, and the power production department and management department make production plan and development plan accordingly.According to the different forecasting time range, power load forecasting methods can be divided into long-term, medium-term, short-term and ultra-short-term forecasting.Long-term load forecast usually refers to the forecast of more than 10 years, medium-term load forecast usually refers to the forecast of about 5 years, medium and long-term load forecast is forecast on an annual basis, mainly used for the planning and construction of power system.Short-term load projections are usually within a year.Forecast units include month, week, day and hour.It is mainly used to regulate and guide the daily operation of the power sector [2]- [4].
In this paper, an extended algorithm combining the advantages of adaptive K-means algorithm and distributed clustering algorithm is used to improve the traditional K-means algorithm to extract the load characteristics.In addition, LSTM method is used to build load prediction model.LSTMS can learn the advantages of long distance time series dependence to recognize load patterns from the horizontal (time dimension).In the simulation, the LSTM algorithm based on Adam optimizer improves the accuracy of load prediction[5].

Figure 1. LSTM networks topology
Figure 1 shows the LSTM networks topology.Long Short Term Memory network (LSTM) was proposed and improved and popularized by Sepp Hochreiter and Jurgen Schmidhuber in 1997.LSTM neural network is an improved algorithm based on RecurrentNeural Networks (RNN).A memory unit is introduced into each neuron of the hidden layer, and three gate control units, namely forgetting gate, input gate and output gate, are used to control the state of the memory unit, which solves the problem that common RNN cannot learn long distance time sequence dependencer [6].
The memory unit, together with the hidden state, remembers the history information of the sequence data.The information in the memory unit is controlled by three gated units.The memory gate deletes the information in the memory unit according to ht-1 and xt.The forgetting door is: In Formula (1), σ is sigmoid activation function; Wf is the forgetting gate weight; bf is the forgetting door offset.The input gate adds information to the memory unit according to ht-1 and xt, as shown in Formula (2) and Formula (3).
[ ] 1 ( ) [ ] Where: it is the information to be remembered; Ct was the candidate memory unit for updating memory unit.Wi and Wc are input gate weights; bi and bc are input gate offset.
After the calculation of forgetting gate and output gate is completed, the memory unit is updated using Formula (4).[ ] 1 ( ) ) Where: Wo is the weight of the output gate; bo is the output gate offset.The load prediction model is constructed by replacing the neurons in common RNN with LSTM.The advantage of LSTM to learn the long distance time sequence dependence is used to learn the hidden historical operation rules in the power load.

Adam optimization algorithm
Adam is an optimization algorithm proposed in 1997 and widely used in the field of deep learning.
Adam is different from classical stochastic gradient descent.Classical stochastic gradient descent maintains a single learning rate (called alpha) for all weight updates, and the learning rate does not change during training.In Adam, each network weight (parameter) maintains a learning rate and is adjusted separately as learning unfolds.The method calculates the adaptive learning rate of different parameters through the first and second moments of the gradient [7].
Adam algorithm combines the advantages of AdaGrad (adaptive gradient algorithm) and RMSProp (root mean square propagation) algorithm, which can also be seen as the combination of RMSProp algorithm and momentum method, with the advantages of both.
In this paper, Adam optimizer is adopted, which greatly improves the prediction.

AKDC algorithm
For the same model, its learning ability and simulation speed are directly related to the complexity of data.Too large data sample size will significantly reduce the learning ability and general adjustment ability of the same model.In order to solve this problem, cluster analysis method can be used to combine and extract similar data, so that users can only analyze the data in the cluster center.This paper adopts an extended algorithm (distributed clustering algorithm based on adaptive Kmeans, hereinafter referred to as AKDC), which combines the advantages of adaptive K-means algorithm and distributed clustering algorithm.Table 1 shows the comparison between the algorithm and common clustering.
Table 1.Algorithm comparison Firstly, the algorithm analysis is carried out on the local data, the invalid results are screened and cleared, and the local model is established according to the analysis results.Then the same or other more reasonable algorithm is used to cluster the uploaded local models.Finally, the result data is analyzed, and the local model is adjusted and optimized.After several adjustments, the global model with strong universality is obtained.After cluster analysis of local model and global model, this method can relieve communication pressure, accelerate data processing speed and ensure the accuracy of load prediction.In practical application, AKDC algorithm has high operability and relatively accurate results [8]- [10].
AKDC algorithm improves the traditional K-means algorithm, and its flow chart is shown in Figure 2.

Cluster analysis
In order to verify the algorithm, simulation experiments are carried out with appropriate measured data.The data includes load data from July 1 to September 26 (missing data from August 29 to September 1) and meteorological forecast data from July 1 to September 28 (repeating data from August 25 to August 26).Meteorological variables include instantaneous precipitation, temperature, short-wave radiation, relative humidity and wind speed.Meteorological data is the result of prior forecast.The time resolution is 15 minutes.Two kinds of clustering can be chosen: direct curve clustering and feature vector clustering.When the latter is adopted, this paper selects some factors that have a greater impact on load fluctuations as classification indexes [11]- [12], such as [maximum power, peak-to-total ratio, flat to total ratio, valley to total ratio, load rate] to form five-dimensional feature vectors.The clustering results are shown in Figure 3

Load forecasting
In order to verify the feasibility of the algorithm, this paper builds a prediction model based on the data provided by a substation, analyzes the prediction results, and defines the input and output of the model.The forecast results from September 17 to September 26 are shown in Figure 4.

Conclusion
In this paper, AKDC algorithm is used to realize the convergence of load characteristic curves, and LSTM algorithm is used to build a load prediction model, and relevant parameters are adopted to verify the accuracy of the model.When AKDC algorithm is adopted, the content includes curve clustering and load characteristics.LSTM can learn the advantages of long distance time series dependence and recognize load variation patterns from the horizontal (time dimension).In addition, Adam optimizer is used to improve the accuracy of load prediction and make the prediction performance more stable.Simulation results verify the effectiveness of these strategies.
Of course, there are still some limitations to this article.For example, there are few sources of load curve data, and the factors considered in the prediction are not complete enough.In future research, I will extend the algorithm proposed in this article to a wider range of applications.

4 )
The calculated result in the formula is Hadamard product.The output gate determines hi based on ht-1, xt ,Ct.

Figure 3 .
Figure 3.Comparison of clustering results

Figure 4 .
Figure 4. LSTM neural network daily load prediction resultsFigure5shows the comparison between actual and predicted loads in the future day.

Figure 5 .
Figure 5.Comparison of predicted and actual daily load of LSTM neural networkIn order to evaluate the error of prediction results, the mean absolute error (MAPE) was calculated in this paper.The lower the parameter, the smaller the error.The results showed that MAPE was 1.875%.

Figure 6 .
Figure 6.Comparison of predicted and actual daily load of LSTM neural network In addition, the relative root-mean-square error NRMSE is calculated by equation 7, NRMSE is 0.0014.
prediction accuracy is reasonable.The calculation results and images of the above parameters are shown in Figure6.