A short-term load forecasting method based on Kmeans and FR-DBN
The DBN model is improved through Kmeans clustering and FR conjugation gradient method, and the problem of insufficient short-term load prediction accuracy of the power system is solved, and higher prediction accuracy and correlation are achieved, supporting the safe verification of the power system and the recent planning.
Patent Information
- Application Number
- CN202011307595.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-20
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2040-11-20
AI Technical Summary
The prior art has insufficient prediction accuracy in the short-term load prediction of power systems, which is difficult to meet the high-precision needs of the power market, affecting the safety verification and recent planning of the power system.
The Kmeans clustering algorithm is used to combine FR conjugation gradient method to improve the deep learning network (DBN), and the data learning rate is accelerated through Kmeans clustering, and the unsupervised feature learning mechanism of DBN is used to optimize the model with FR conjugation gradient method to perform power system Load forecast.
It improves the accuracy of load prediction, reduces prediction errors, enhances the correlation of prediction results, and improves the safety verification of the power system and the reliability of the recent plans.
Smart Images

Figure CN112330051B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power system load forecasting, and in particular to a short-term load forecasting method based on Kmeans and FR-DBN. Background Art
[0002] As society continues to progress and science and technology continue to develop, my country's power system and power grid management are becoming increasingly complex, modernized and perfect. The study of power system load forecasting has become an important research field in modern power system science. The study of power system load forecasting has a history of some time. With the development of computer technology and the improvement of power grid's requirements for load forecasting accuracy, the research on this topic is also deepening. Especially with the deepening of power market reform, it has become an important part of the power market technical support system and the main data source of the power trading market. Its prediction accuracy is of great significance to the power system. Summary of the invention
[0003] The purpose of the present invention is to overcome the above problems and provide a short-term load forecasting method based on Kmeans and FR-DBN.
[0004] The present invention provides a short-term load forecasting method based on Kmeans and FR-DBN, which is characterized in that: the short-term load forecasting method based on Kmeans and FR-DBN specifically includes:
[0005] Kmeans combined with the conjugate gradient method (FR) is used to improve the combined model of deep learning network (DBN) for power system load forecasting. The Kmeans clustering algorithm is used to batch data to accelerate the learning rate. At the same time, the DBN unsupervised feature learning mechanism is introduced into the load forecasting model, and then the FR conjugate gradient method is used for optimization. The prediction results and the time required for prediction are compared with the traditional prediction model.
[0006] (1) The Kmeans clustering algorithm is used to batch data to speed up the learning rate. Assume that the original data sample X contains load data, temperature, humidity, and precipitation in the past hour. 1 ,X 2 ,X 3 ,...,X n}, where each object has attributes of m dimensions.
[0007] First, we need to initialize k cluster centers {C 1 ,C 2 ,C 3 ,...,C k},1<k≤n, and then calculate the Euclidean distance from each object to each cluster center, as shown in the following formula:
[0008]
[0009] In the above formula, X i represents the i-th object 1≤i≤n,C j 1≤j≤k,X represents the jth cluster center it represents the tth attribute of the i-th object 1≤t≤m,C jt Represents the tth attribute of the jth cluster center.
[0010] Compare the distance from each object to each cluster center in turn, assign the object to the cluster closest to the cluster center, and get k clusters {S 1 ,S 2 ,S 3 ,...,S k}, that is, k batches of data.
[0011] (2) The DBN model is optimized using the FR conjugate gradient method. The DBN consists of multiple restricted Boltzmann machine (RBM) layers. RBM is a two-layer neural network. The first layer is called the visible layer and the second layer is called the hidden layer. The hidden layer and the visible layer are fully connected, and the connection weights can be expressed by the matrix W = (ω i,j ) indicates that the neurons in each layer are independent of each other.
[0012] Weight matrix W = (ω i,j ) specifies the hidden unit h j and visible layer unit v i In addition, for each visible layer unit v i With bias a i , for each hidden unit h j With bias b j For a given state vector h and v, the energy function of RBM can be expressed as:
[0013] E(v,h)=-a Τ vb Τ hh Τ W
[0014] The form of this energy function is similar to that of the Hopfield neural network. According to the energy function, the joint probability distribution between the hidden layer and the visible layer can be obtained:
[0015]
[0016] Among them, Z is the normalization factor, which is defined as e under all possible values of the node-E(v,h) Similarly, the marginal distribution of visible layer values can be obtained by summing all hidden layer state vectors:
[0017]
[0018] Since RBM is a bipartite graph, there are no edges connecting the layers, so whether the hidden layer is activated is conditionally independent given the value of the visible layer node, and the activation state of the visible layer node is also conditionally independent given the value of the hidden layer. For m visible layer nodes and n hidden layer nodes, the conditional probabilities of the state vector v to h and h to v are as follows:
[0019]
[0020] The sigmoid activation function is used between each layer in RBM. The activation probability of a single node is:
[0021] P(h j =1|v)=sigmoid(b j +W j ,:v)
[0022] P(v i =1|h)=sigmoid(a i +W T :, j h)
[0023] The FR conjugate gradient method solves the optimal solution problem as follows:
[0024]
[0025] Step factor α k It is obtained by some kind of linear search, and its general format is:
[0026] x k+1 =x k +α k d k , k=0,1,…
[0027] Search direction d k The format is as follows:
[0028]
[0029] where β k is a parameter, and g(x) is the gradient of f at x.
[0030] The short-term load forecasting method based on Kmeans and FR-DBN has the following criteria:
[0031] (1) MAPE value: The lower the MAPE value, the better the prediction effect;
[0032] (2) RMSE value: The lower the RMSE value, the smaller the error of the predicted load series and the smaller the fluctuation;
[0033] (3) Pearson coefficient: The higher the Pearson coefficient, the stronger the correlation between the predicted load sequence and the actual sequence, and the better the prediction effect.
[0034] The short-term load forecasting method based on Kmeans and FR-DBN, the algorithm function design specifically includes input parameters:
[0035] (1) The number of neurons in each layer of the four-layer RBM in DBN: 1000-500-250-30, which can be modified;
[0036] (2) Maximum number of iterations maxepoch;
[0037] (3) The learning rates of weights, visible unit biases, and hidden unit biases;
[0038] (4) A total of 841 sets of measured data, including original load value, temperature, relative humidity, precipitation in the past hour, 10-minute average wind direction, and 10-minute average wind speed.
[0039] The algorithm function design of the short-term load forecasting method based on Kmeans and FR-DBN specifically includes the output results:
[0040] (1) Load forecasting model prediction data and statistics of each data error;
[0041] (2) Comparison curves of real data and predicted data of DBN, CG-DBN, and FR-DBN models;
[0042] (3) Error and Pearson coefficient statistics table;
[0043] (4) Comparative analysis results: load forecasting model operation time and forecasting accuracy.
[0044] A short-term load forecasting method based on Kmeans and FR-DBN, characterized by:
[0045] (1) The Kmeans clustering algorithm is used to batch data to speed up the learning rate. Assume that the original data sample X contains n objects such as load data, temperature, humidity, and precipitation in the past hour.
[0046] X={X 1 ,X 2 ,X 3 ,...,X n}, where each object has attributes of m dimensions.
[0047] First, we need to initialize k cluster centers {C 1 ,C 2 ,C 3 ,...,C k},1<k≤n, and then calculate the Euclidean distance from each object to each cluster center, as shown in the following formula:
[0048]
[0049] In the above formula, X i represents the i-th object 1≤i≤n,C j 1≤j≤k,X represents the jth cluster center it represents the tth attribute of the i-th object 1≤t≤m,C jt Represents the tth attribute of the jth cluster center.
[0050] Compare the distance from each object to each cluster center in turn, assign the object to the cluster closest to the cluster center, and get k clusters {S 1 ,S 2 ,S 3 ,...,S k}, that is, k batches of data.
[0051] (2) The DBN model is optimized using the FR conjugate gradient method. The DBN consists of multiple restricted Boltzmann machine (RBM) layers. RBM is a two-layer neural network. The first layer is called the visible layer and the second layer is called the hidden layer. The hidden layer and the visible layer are fully connected, and the connection weights can be expressed by the matrix W = (ω i,j ) indicates that the neurons in each layer are independent of each other.
[0052] Weight matrix W = (ω i,j ) specifies the hidden unit h j and visible layer unit v i In addition, for each visible layer unit v i With bias a i , for each hidden unit h j With bias b j For a given state vector h and v, the energy function of RBM can be expressed as:
[0053] E(v,h)=-a Τ vb Τ hh Τ W
[0054] The form of this energy function is similar to that of the Hopfield neural network. According to the energy function, the joint probability distribution between the hidden layer and the visible layer can be obtained:
[0055]
[0056] Among them, Z is the normalization factor, which is defined as e under all possible values of the node -E(v,h) Similarly, the marginal distribution of visible layer values can be obtained by summing all hidden layer state vectors:
[0057]
[0058] Since RBM is a bipartite graph, there are no edges connecting the layers, so whether the hidden layer is activated is conditionally independent given the value of the visible layer node, and the activation state of the visible layer node is also conditionally independent given the value of the hidden layer. For m visible layer nodes and n hidden layer nodes, the conditional probabilities of the state vector v to h and h to v are as follows:
[0059]
[0060] The sigmoid activation function is used between each layer in RBM.
[0061] The FR conjugate gradient method solves the optimal solution problem as follows:
[0062]
[0063] Step factor α k It is obtained by some kind of linear search, and its general format is:
[0064] x k+1 =x k +α k d k , k=0,1,…
[0065] Search direction d k The format is as follows:
[0066]
[0067] where β k is a parameter, and g(x) is the gradient of f at x.
[0068] Advantages of the present invention:
[0069] The short-term load forecasting method based on Kmeans and FR-DBN described in the present invention improves the accuracy of load forecasting results, is conducive to safety verification and day-ahead planning, and is the basis for formulating day-ahead work plans and safety verification. Accurate load forecasting is a solid foundation for the balance of power generation and supply and safe and stable operation of State Grid Corporation of China. Improving the prediction accuracy, especially the accuracy of short-term load forecasting, has important engineering significance. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments:
[0071] Figure 1 is the algorithm flow chart;
[0072] Figure 2 Comparison curve between the true value and the prediction results of different models Figure 1 ;
[0073] Figure 3 Comparison curve between the true value and the prediction results of different models Figure 2 ;
[0074] Figure 4 Comparison curve between the true value and the prediction results of different models Figure 3 ;
[0075] Figure 5 Comparison curve between the true value and the prediction results of different models Figure 4 . DETAILED DESCRIPTION
[0076] Example
[0077] The present invention provides a short-term load forecasting method based on Kmeans and FR-DBN, which is characterized in that: the short-term load forecasting method based on Kmeans and FR-DBN specifically includes:
[0078] Kmeans combined with the conjugate gradient method (FR) is used to improve the combined model of deep learning network (DBN) for power system load forecasting. The Kmeans clustering algorithm is used to batch data to accelerate the learning rate. At the same time, the DBN unsupervised feature learning mechanism is introduced into the load forecasting model, and then the FR conjugate gradient method is used for optimization. The prediction results and the time required for prediction are compared with the traditional prediction model.
[0079] (1) The Kmeans clustering algorithm is used to batch data to speed up the learning rate. Assuming that the original data sample X is given, X = {X 1 ,X 2 ,X 3 ,...,X n}, where each object has attributes of m dimensions, including load data, temperature, humidity, and precipitation in the past hour.
[0080] First, we need to initialize k cluster centers {C 1 ,C 2 ,C 3 ,...,C k},1<k≤n, and then calculate the Euclidean distance from each object to each cluster center, as shown in the following formula:
[0081]
[0082] In the above formula, X i represents the i-th object 1≤i≤n,C j 1≤j≤k,X represents the jth cluster center it represents the tth attribute of the i-th object 1≤t≤m,C jt Represents the tth attribute of the jth cluster center.
[0083] Compare the distance from each object to each cluster center in turn, assign the object to the cluster closest to the cluster center, and get k clusters {S 1 ,S 2 ,S 3 ,...,S k}, that is, k batches of data.
[0084] (2) The DBN model is optimized using the FR conjugate gradient method. The DBN consists of multiple restricted Boltzmann machine (RBM) layers. RBM is a two-layer neural network. The first layer is called the visible layer and the second layer is called the hidden layer. The hidden layer and the visible layer are fully connected, and the connection weights can be expressed by the matrix W = (ω i,j ) indicates that the neurons in each layer are independent of each other.
[0085] Weight matrix W = (ω i,j ) specifies the hidden unit h j and visible layer unit v i In addition, for each visible layer unit v i With bias a i , for each hidden unit h j With bias b j For a given state vector h and v, the energy function of RBM can be expressed as:
[0086] E(v,h)=-a Τ vb Τ hh Τ W
[0087] The form of this energy function is similar to that of the Hopfield neural network. According to the energy function, the joint probability distribution between the hidden layer and the visible layer can be obtained:
[0088]
[0089] Among them, Z is the normalization factor, which is defined as e under all possible values of the node -E(v,h) Similarly, the marginal distribution of visible layer values can be obtained by summing all hidden layer state vectors:
[0090]
[0091] Since RBM is a bipartite graph, there are no edges connecting the layers, so whether the hidden layer is activated is conditionally independent given the value of the visible layer node, and the activation state of the visible layer node is also conditionally independent given the value of the hidden layer. For m visible layer nodes and n hidden layer nodes, the conditional probabilities of the state vector v to h and h to v are as follows:
[0092]
[0093]
[0094] The sigmoid activation function is used between each layer in RBM.
[0095] The FR conjugate gradient method solves the optimal solution problem as follows:
[0096]
[0097] Step factor α k It is obtained by some kind of linear search, and its general format is:
[0098] x k+1 =x k +α k d k , k=0,1,…
[0099] Search direction d k The format is as follows:
[0100]
[0101] where β k is a parameter, and g(x) is the gradient of f at x.
[0102] The short-term load forecasting method based on Kmeans and FR-DBN has the following criteria:
[0103] (1) MAPE value: The lower the MAPE value, the better the prediction effect;
[0104] (2) RMSE value: The lower the RMSE value, the smaller the error of the predicted load series and the smaller the fluctuation;
[0105] (3) Pearson coefficient: The higher the Pearson coefficient, the stronger the correlation between the predicted load sequence and the actual sequence, and the better the prediction effect.
[0106] The short-term load forecasting method based on Kmeans and FR-DBN, the algorithm function design specifically includes input parameters:
[0107] (1) The number of neurons in each layer of the four-layer RBM in DBN: 1000-500-250-30, which can be modified;
[0108] (2) Maximum number of iterations maxepoch;
[0109] (3) The learning rates of weights, visible unit biases, and hidden unit biases;
[0110] (4) A total of 841 sets of measured data, including original load value, temperature, relative humidity, precipitation in the past hour, 10-minute average wind direction, and 10-minute average wind speed.
[0111] The algorithm function design of the short-term load forecasting method based on Kmeans and FR-DBN specifically includes the output results:
[0112] (1) Load forecasting model prediction data and statistics of each data error;
[0113] (2) Comparison curves of real data and predicted data of DBN, CG-DBN, and FR-DBN models;
[0114] (3) Error and Pearson coefficient statistics table;
[0115] (4) Comparative analysis results: load forecasting model operation time and forecasting accuracy.
[0116] Step 1: After preprocessing the data, Kmeans clustering analysis is used for batch processing, and the batchdata data matrix is created with the number of data in each batch, the dimension of the data tuple, and the number of data batches, and the batchdata data size is obtained at the same time.
[0117] Step 2: From the input layer to the first hidden layer: After setting the initialization parameters, call the established RBM network structure model to start training data and obtain the bias value of the hidden layer through training.
[0118] Step 3: From the first hidden layer to the second hidden layer: read the hidden layer output of the previous RBM as the input of this RBM, set the number of nodes of the hidden layer, the number of input nodes is obtained from the data that has been read, and train the weights and bias of the hidden layer. The second hidden layer to the third hidden layer is the same as above.
[0119] Step 4: Connect the above four RBMs to train the data, and then use the BP algorithm to train the data to fine-tune the parameters. When pre-initializing the weights, use the obtained weights and biases to generate the data matrix. After the weight pre-initialization is completed, the number of nodes in each layer is obtained, and the number of nodes in the input layer and the output layer is the same.
[0120] Step 5: After repeating the iteration to the maximum number of iterations, start calculating the training reconstruction error, calculate the reconstruction error by match, and finally find the average value. After the training reconstruction error calculation is completed, calculate the test reconstruction error, and the steps are the same as the training reconstruction error calculation.
[0121] Step 6: After the test reconstruction error calculation is completed, the batches of data are merged, and the weight parameters are obtained after linear search optimization using the FR conjugate gradient method. The weight parameter W is a column vector. The W column vector is restored to a matrix and reassigned to the optimized parameters in turn.
[0122] Step 7: Call the trained model and input the data of various influencing factors for prediction and analysis.
[0123] The present invention is not limited to the above-mentioned embodiments. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention. The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.
Claims
1. A short-term load forecasting method based on Kmeans and FR-DBN, characterized by: The short-term load forecasting method based on Kmeans and FR-DBN specifically includes: The combined model of deep learning network DBN is improved by using Kmeans combined with conjugate gradient method FR to forecast the load of power system. The learning rate is accelerated by batching data through Kmeans clustering algorithm. At the same time, the DBN unsupervised feature learning mechanism is introduced into the load forecasting model, and then optimized by FR conjugate gradient method. The prediction results and the time required for prediction are compared with the traditional prediction model. (1) The Kmeans clustering algorithm is used to speed up the learning rate by batching data. Given an original data sample X, which contains n objects X = {X1, X2, X3, ..., X n }, where each object has attributes of m dimensions, including load data, temperature, humidity, and precipitation in the past hour; First, initialize k cluster centers {C1, C2, C3, ..., C k },1<k≤n, and then calculate the Euclidean distance from each object to each cluster center, as shown in the following formula: In the above formula, X i represents the i-th object 1≤i≤n,C j 1≤j≤k,X represents the jth cluster center it represents the tth attribute of the i-th object 1≤t≤m,C jt Represents the tth attribute of the jth cluster center; Compare the distance from each object to each cluster center in turn, assign the object to the cluster closest to the cluster center, and get k clusters {S1, S2, S3, ..., S k }, i.e. k batches of data; (2) The DBN model is optimized using the FR conjugate gradient method. The DBN consists of multiple restricted Boltzmann machine (RBM) layers. RBM is a two-layer neural network. The first layer is called the visible layer and the second layer is called the hidden layer. The hidden layer and the visible layer are fully connected, and the connection weights are expressed by the matrix W = (ω i,j ) indicates that the neurons in each layer are independent of each other; Weight matrix W = (ω i,j ) specifies the hidden unit h j and visible layer unit v i The weights between them; In addition, for each visible layer unit v i With bias a i , for each hidden unit h j With bias b j ; For a given state vector h and v, the energy function of RBM can be expressed as: E(v,h)=-a Τ v-b Τ h-h Τ Wv According to the energy function, the joint probability distribution between the hidden layer and the visible layer can be obtained: Among them, Z is the normalization factor, which is defined as e under all possible values of the node -E(v,h) Similarly, the marginal distribution of visible layer values is obtained by summing all hidden layer state vectors: RBM is a bipartite graph with no edges connecting the layers. Whether the hidden layer is activated is conditionally independent given the value of the visible layer nodes, and the activation state of the visible layer nodes is also conditionally independent given the value of the hidden layer. For m visible layer nodes and n hidden layer nodes, the conditional probabilities of the state vector v to h and h to v are as follows: The sigmoid activation function is used between each layer in RBM.
2. The short-term load forecasting method based on Kmeans and FR-DBN according to claim 1 is characterized by: The criteria for judgment are: (1) MAPE value: The lower the MAPE value, the better the prediction effect; (2) RMSE value: The lower the RMSE value, the smaller the error of the predicted load series and the smaller the fluctuation; (3) Pearson coefficient: The higher the Pearson coefficient, the stronger the correlation between the predicted load sequence and the actual sequence, and the better the prediction effect.
Citation Information
Patent Citations
Load curve parallel clustering method based on big data of electric power
CN104063480A
Short-term load forecasting method
CN105608512A
Power distribution network load prediction method
CN110766190A
Ultra-short-term bus load prediction method based on PSR-DBN
CN111080000A
Short term electrical load predication method
WO2019141040A1
