Spatiotemporal combined prediction method based on CNN-LSTM and deep learning

Through the spatio-temporal combination prediction method based on CNN-LSTM and deep learning, and using the MI algorithm and PSO algorithm to optimize parameters, the problem of insufficient single-site characteristic data in wind power prediction is solved, and higher prediction accuracy and stability are achieved, especially in Demonstrated better performance in multi-site wind power data forecasting.

CN113673775BActive Publication Date: 2024-10-25STATE GRID ECONOMIC TECH RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110981226.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-25
Publication Date
2024-10-25
Estimated Expiration
2041-08-25

AI Technical Summary

Technical Problem

Existing wind power prediction methods mainly rely on the characteristic data of a single site and ignore the spatiotemporal connections between adjacent wind farm sites, resulting in certain limitations in prediction accuracy.

Method used

A spatio-temporal combination prediction method based on CNN-LSTM and deep learning is used to analyze the temporal and spatial correlation of the data through the MI algorithm. After dimensionality reduction, the CNN network is used to extract spatial information and the LSTM network is used to obtain time-dependent information, and AT is added to the LSTM network. layer, combined with the PSO algorithm optimization parameters, to construct the MI-CNN-ALSTM-PSO model for prediction.

Benefits of technology

It improves the accuracy and stability of wind power power prediction, performs better than conventional combination models, reduces prediction errors, and especially shows better performance in multi-site wind power data prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113673775B_ABST
    Figure CN113673775B_ABST
Patent Text Reader

Abstract

The present invention discloses a spatiotemporal combined prediction method based on CNN-LSTM and deep learning, including: S1, analyzing the time and space correlation of the original data set through the MI mutual information algorithm, eliminating the redundant information between the data, and reducing the dimension of the original data; S2, establishing a MI-CNN-LSTM model, predicting the data after dimension reduction, CNN is used to extract the spatial information of each site, and LSTM is used to obtain the dependency information between time series data; S3, adding an AT layer between the LSTM layer and the output layer of the LSTM network to obtain the MI-CNN-ALSTM model, and performing model learning on the training set data; S4, introducing a PSO algorithm to optimize the training parameters to obtain the MI-CNN-ALSTM-PSO model; S5, predicting the test set to obtain the final predicted value. The MI-CNN-ALSTM-PSO spatiotemporal combined prediction model proposed by the present invention further improves the wind power prediction accuracy and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of wind power prediction, and in particular to a spatiotemporal combined prediction method based on CNN-LSTM and deep learning. Background Art

[0002] In the past few decades, the global wind power installed capacity has grown rapidly. At present, wind energy, as a clean, green and renewable energy, is widely used in real life. Therefore, the wind power forecast of wind farms can provide an effective reference for the transmission of power and circuit construction in urban construction.

[0003] At present, wind power prediction models can be divided into three categories: time series models, machine learning and combined models. Time series models include autoregressive models (AR), moving average models (MA), autoregressive moving average models (ARMA), autoregressive integrated moving average models (ARIMA), etc. Time series models have good prediction effects in linear and stationary time series prediction. In order to improve the prediction effect in nonlinear and non-stationary time series, some machine learning methods such as BP (Back Propagation) neural network and support vector machine (SVR) are used for wind power prediction, and the effect is improved. In addition, the prediction effect of the combined model is further improved than that of a single machine learning method. He Yaoya uses a wind power prediction combined model based on ensemble empirical mode decomposition (EEMD) and least absolute shrinkage selection operator-quantized regression neural network (LASSO-QNN), which has a good ability to improve wind power prediction performance and measure and reduce the uncertainty of the prediction process. Jeng-Shyang Pan proposed a wind power prediction model that combines the adaptive multi-group salmon swarm algorithm AMSSA with the BP neural network, and achieved good prediction results for wind power prediction; He Yaoyao proposed a multi-core parallel quantile regression neural network (MPQRNN) based on the parallel master-slave (MS) model. The algorithm divides the complex prediction tasks on all quantiles into multiple parallel subtasks, which run independently on different cores, so that the performance advantages of multi-core CPUs can be fully utilized and the computational efficiency of the joint operation model can be improved. MPQRNN can not only improve the training efficiency of QRNN, but also obtain accurate wind power prediction results. ZhewenNiu proposed a sequence model based on the attention gated recurrent unit (AGRU) to improve the accuracy and stability of prediction; ZongxiQu proposed a BP neural network prediction model with a new hybrid decomposition technology (HDT) and an improved flower pollination algorithm (FPA), which is very suitable for non-stationary multi-step wind speed prediction; Kejun Wang used the K-means clustering algorithm to process numerical weather forecasts, and selected weather values ​​that have a huge impact on the prediction accuracy as the input of the DBN (deep belief network) model, and the prediction results were better than those of the BP neural network.Yan Jiang proposed a probabilistic wind speed prediction framework based on enhanced variational mode decomposition, deep feature selection and multi-error correction. The results show that this method has good prediction ability and may be more suitable for non-stationary and non-Gaussian data; Peng Lu proposed a multi-output support vector machine (MSVM) model based on spatiotemporal (ST) analysis to predict the wind power of multiple wind farms; Li Han proposed spatial reconstruction (PSR) to reconstruct the phase space of the wind power system, and then used principal component analysis (PCA) to minimize the impact of delay time and improper phase size, and then used the resource allocation network (RAN) to establish a prediction model. The analysis results show that the prediction error in 48 hours is about 3%, which is significantly lower than the error obtained by other prediction methods, and the model can predict the wind power of turbines with different capacities and altitudes; Liu HongChi proposed a VMD-BPNN combined model to improve the accuracy of wind power prediction. Shengdong Du proposed a temporal attention encoding and decoding model based on bidirectional long-term and short-term (Bi-LSTM) to deal with time series problems, which can adaptively learn long-term dependent and hidden related features. Song Li proposed a comprehensive method for wind farm power generation prediction consisting of neural network, wavelet transform, feature selection and partial least squares regression (PLSR), which effectively overcomes the non-stationarity of wind power levels and improves prediction accuracy. Ping Jiang proposed a V-SVM (V support vector machine) hybrid wind speed prediction model, which selects the wind speed characteristics of adjacent sites as input and uses the CS (Cuckoo Search) algorithm to adjust the model parameters. The model has good nonlinear fitting ability and higher accuracy.

[0004] However, the above methods mainly use signal decomposition, weight allocation, deep learning, regression model and parameter optimization methods in the process of wind speed or wind power prediction, and mainly predict data based on the front and back dependencies of time series. Moreover, most wind power wind speed prediction methods only use the characteristic data of a single site, without considering the potential spatiotemporal connection of the characteristics of adjacent sites of the wind farm, and ignoring their spatial characteristic information, which makes the prediction accuracy have certain limitations. Summary of the invention

[0005] In order to better utilize multi-site spatiotemporal data to predict wind power, this paper uses the temporal and spatial correlation of multi-site wind power data of two wind farms and deep learning methods to conduct prediction research, and provides a spatiotemporal combined prediction method based on CNN-LSTM and deep learning. The deep learning algorithms of the present invention include MI algorithm, AT algorithm and PSO algorithm.

[0006] The technical solution adopted by the present invention to overcome the technical problems is:

[0007] A spatiotemporal combined prediction method based on CNN-LSTM and deep learning includes the following steps:

[0008] S1. Analyze the temporal and spatial correlation of the original data set through the MI mutual information algorithm, eliminate redundant information between data, and reduce the dimension of the original data;

[0009] S2, establish the MI-CNN-LSTM model to predict the data after dimension reduction in step S1, where the CNN network is used to extract the spatial information of each site, and the LSTM network is used to obtain the dependency information between time series data;

[0010] S3. Add an AT layer between the LSTM layer and the output layer of the LSTM network to obtain the MI-CNN-ALSTM model, and perform model learning on the training set data;

[0011] S4, introduce the PSO algorithm to optimize the training parameters and obtain the MI-CNN-ALSTM-PSO model;

[0012] S5. Predict the test set through the MI-CNN-ALSTM-PSO model to obtain the final prediction value.

[0013] Furthermore, in step S1, the original data set is the wind power data with m-dimensional features collected from n sites in the past t hours, expressed as:

[0014] X=(X 1 , X 2 ,...,X m ) n×t =(X1, X2, ..., X t )∈R n×m×t

[0015] In the above formula, n is the observation site number, t is the window length of the observation time series, and m is the data feature dimension;

[0016] The characteristic data at time t is described as:

[0017]

[0018] In the above formula, WP is wind power, WS is wind speed, WD is wind direction, TE is temperature, PA is air pressure, DE is air density, and i is site number.

[0019] Furthermore, in step S2, the m-dimensional feature data of the n stations are organized into a matrix of n rows and m columns, and the matrix of t moments is constructed as a time distribution layer;

[0020] The input layer dimension of the CNN network is n×m×t, and the output of the convolutional layer feature map is for:

[0021]

[0022] In the above formula, X i+n,j+m is the value of the nth row and mth column of the input matrix, f cov (.) is the activation function, w n,m is the weight of the convolution kernel n rows and m columns, b n,m is the convolution kernel bias, k is the sliding window size, and the input matrix uses multiple convolution kernels for convolution operation;

[0023] The CNN pooling layer performs dimensionality reduction and downsampling through filters and sliding window steps, and then flattens the data into a one-dimensional array through the flattening layer. in As time series input to the LSTM layer of the LSTM network.

[0024] Furthermore, in step S2, the LSTM network internally includes three gate structures and a state module for storing memory;

[0025] Let C t The state information stored in this LSTM unit, x t is the input layer’s input, h t is the output of the hidden layer of this unit, f t For the forget gate, i t is the input gate, is the current time information, o t is the output gate, “×” represents matrix element multiplication, “+” represents addition operation, and σ is the sigmoid function;

[0026] Forget gate: used to control the previous unit state C t-1 The degree of being forgotten is expressed as follows:

[0027] f t =σ(W f *[h t-1 ,x t ]+b f )

[0028] Input gate: It is used to control which information is added to this unit. Its expression is as follows:

[0029] i t =σ(W i *[h t-1 ,x t ]+b i )

[0030] Unit storage status information: used to t and i tSelectively record new information to C t The expression is as follows:

[0031]

[0032]

[0033] Output gate: used to convert C t Activate and control C t The degree of filtering is expressed as follows:

[0034] o t =σ(W o *[h t-1 ,x t ]+b o )

[0035] h t =o t *tanh(C t )

[0036] Among them, W f , W i , W o f t 、i t , o t The corresponding weight matrix, b f 、b i , b o f t 、i t , o t The corresponding bias term, tanh, is the hyperbolic tangent activation function, defined as follows:

[0037] σ(x)=1 / (1+e -x )

[0038] tanh(x)=(e x -e -x ) / (e x +e -x )

[0039] The traditional LSTM network structure includes an input layer, an LSTM layer, and an output layer. The output layer converts h into t After a fully connected layer, the final prediction value y is obtained t :

[0040] y t =σ(W y *h t +by )

[0041] In the above formula, W y and b y are the weight matrix and bias term respectively.

[0042] Furthermore, in step S3, after adding an AT layer between the LSTM layer and the output layer of the LSTM network, the attention mechanism vector G is obtained by the following formula: t :

[0043]

[0044] In the above formula, is the softmax activation function, W h is the weight vector, b h is the bias term;

[0045] According to the following formula, G t With h t Perform element-wise multiplication to get the output of the AT layer

[0046]

[0047] According to y in step S2 t =σ(W y *h t +b y ),Will As the input of the subsequent LSTM output layer, and get the predicted value y t :

[0048]

[0049] Furthermore, step S4 specifically includes the following steps:

[0050] S41, Initialization: Randomly initialize particle parameters P ξ , and define the particles of the initial population, giving them initial velocity and position;

[0051] S42, Iteration: Each particle searches for the optimal solution in the exploration space individually and records it as the current individual extreme value. The iteration function is as follows:

[0052] v ξ+1 =v ξ +c1*rand()*(pbest ξ -x ξ )+c2*rand()*gbest ξ -x ξ )

[0053] x ξ+1=x ξ +v ξ+1

[0054] In the above formula, v ξ is the speed of the ξth iteration, c1 and c2 are learning factors, rand() is a random number between (0,1), and the particle searches for the local optimal solution pbest(P ξ ) and the global optimal solution gbest(P ξ ) to determine the subsequent position, x ξ is the position of the ξth iteration;

[0055] S43, optimization: Each particle performs optimization individually and shares its individual extreme value with other particles in the entire particle swarm, and finds the best individual extreme value as the current global optimal solution of the entire particle swarm;

[0056] S44, Evaluation: Each iteration process trains the combined model and calculates the predicted value and evaluation index RMSE;

[0057] S45, stop iteration: The MI-CNN-ALSTM-PSO model stops when the maximum number of iterations is reached and the RMSE is optimal during the search process, otherwise it returns to step S42 to continue updating particles.

[0058] The beneficial effects of the present invention are:

[0059] 1. Since the original data set is multi-site multi-dimensional characteristic wind power data, the present invention analyzes the time and space correlation of the data set through the MI algorithm, eliminates redundant information between the data, and reduces the dimension of the original data set.

[0060] 2. The present invention considers the data correlation of each site, uses the CNN network to extract the spatial information of each site from the reduced-dimensional data, obtains the time-dependent information through the LSTM network, and proposes a CNN-LSTM spatiotemporal combined prediction model, which has better prediction performance than the conventional combination model.

[0061] 3. The present invention designs a CNN-LSTM spatiotemporal prediction model, and adopts deep learning algorithms such as MI, AT, and PSO to improve it, and proposes a spatiotemporal combined prediction model of MI-CNN-ALSTM-PSO to further improve the accuracy and stability of wind power prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flowchart of a spatiotemporal combined prediction method based on CNN-LSTM and deep learning according to an embodiment of the present invention.

[0063] Figure 2 Schematic diagram of the internal structure of the LSTM network of an embodiment of the present invention.

[0064] Figure 3 Schematic diagram of the structure of the CNN-LSTM model of an embodiment of the present invention.

[0065] Figure 4 Schematic diagram of the structure of the MI-CNN-LSTM model of an embodiment of the present invention.

[0066] Figure 5 Schematic diagram of the structure of the ALSTM model according to an embodiment of the present invention.

[0067] Figure 6 Schematic diagram of the structure of the MI-CNN-ALSTM model of an embodiment of the present invention.

[0068] Figure 7 Schematic diagram of the process of the PSO algorithm according to an embodiment of the present invention.

[0069] Figure 8 This is a wind power data curve diagram of station A8 in area A according to an embodiment of the present invention.

[0070] Fig. 9 This is a wind power data curve diagram of station B8 in zone B according to an embodiment of the present invention.

[0071] Fig.10 This is a graph showing actual wind speed of wind power generation at site A8 according to an embodiment of the present invention.

[0072] Fig.11 1 is the ACF and PACF diagram of wind power and wind speed data in area A according to an embodiment of the present invention.

[0073] Fig.12 is a comparison diagram of prediction errors of various models in the embodiment of the present invention, wherein: Fig.12 (a) is a comparison chart of prediction models for area A. Fig.12 (b) is a comparison chart of prediction models for area B. Fig.12 (a) and (b) show models M1, M2, M3, M4, and M5. Fig.12 Shown in (c) and (d) are models M6, M7, M8, M9, M10.

[0074] Fig.13 This is a comparison chart of prediction accuracy and stability of region A according to an embodiment of the present invention.

[0075] Fig.14 This is a comparison chart of prediction accuracy and stability of region B according to an embodiment of the present invention. DETAILED DESCRIPTION

[0076] In order to facilitate those skilled in the art to better understand the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. The following is only exemplary and does not limit the protection scope of the present invention.

[0077] like Figure 1 As shown, an embodiment of the present invention discloses a spatiotemporal combined prediction method based on CNN-LSTM and deep learning, comprising the following steps:

[0078] S1. Analyze the temporal and spatial correlation of the original data set through the MI mutual information algorithm, eliminate redundant information between data, and reduce the dimension of the original data.

[0079] S2. Establish the MI-CNN-LSTM model to predict the data after dimensionality reduction in step S1, where the CNN network is used to extract the spatial information of each site, and the LSTM network is used to obtain the dependency information between time series data.

[0080] S3. Add an AT layer between the LSTM layer and the output layer of the LSTM network to obtain the MI-CNN-ALSTM model, and perform model learning on the training set data.

[0081] S4. The PSO algorithm is introduced to optimize the training parameters and the MI-CNN-ALSTM-PSO model is obtained.

[0082] S5. Predict the test set through the MI-CNN-ALSTM-PSO model to obtain the final prediction value.

[0083] 1. About MI Mutual Information Algorithm

[0084] In the process of wind farm prediction, there is a certain correlation between the multidimensional characteristic variables of each wind farm site. The mutual information method uses the calculation of the mutual information function to determine the correlation factor. It is a nonlinear analysis method and has a wide range of applications in time series prediction and feature screening. The mutual information of two random variables x and y can be defined as:

[0085]

[0086] Where p(x,y) is the joint probability density function of x and y, and p(x) and p(y) are the marginal probability density functions of x and y, respectively.

[0087] In this embodiment, step S1 analyzes the temporal and spatial correlation of the original data set through the MI mutual information algorithm, eliminates redundant information between data, and reduces the dimension of the original data. The original data set is the wind power data with m-dimensional features collected from n sites in the past t hours, expressed as:

[0088] X=(X 1 , X 2 ,...,X m ) n×t =(X1, X2, ..., Xt )∈R n×m×t (2)

[0089] In the above formula, n is the observation site number, t is the window length of the observation time series, and m is the data feature dimension;

[0090] The characteristic data at time t is described as:

[0091]

[0092] In the above formula, WP is wind power, WS is wind speed, WD is wind direction, TE is temperature, PA is air pressure, DE is air density, and i is site number.

[0093] The multi-dimensional characteristic wind power prediction problem in this paper is to give a given observation sequence historical data X = (X1, X2, ..., X t-1 ), X t ∈R n×m×t , find the nonlinear mapping relationship between the observed feature variable X and the target prediction variable Y(t), that is, find a nonlinear mapping function such that Y(t) = F(X1, X2, ..., X t-1 ).

[0094] 2. About CNN Convolutional Neural Network

[0095] Convolutional neural network (CNN) is a feed-forward multi-layer neural network with only one direction from input to output and powerful grid data processing capabilities.

[0096] The CNN convolution steps mainly include:

[0097] The convolution layer extracts the weights of data at different positions by performing inner product between the sliding window data and the convolution kernel to obtain a new matrix, namely the feature map.

[0098] The pooling layer is a dimensionality reduction sampling operation. It obtains the average or maximum value of the window data through a sliding window method similar to the convolution layer. Its function is to gradually reduce the spatial size of the data body, reduce the number of network parameters, reduce the consumption of computing resources, and effectively control overfitting. Through this downsampling method, features with large values ​​can be activated to the maximum extent and interference and noise information can be removed.

[0099] The fully connected layer fully connects all neurons in the feature map extracted after pooling to the units in this layer, and then passes through several hidden units in the output layer to obtain the final output result.

[0100] 3. LSTM Network

[0101] LSTM can solve the problems of gradient explosion, gradient vanishing and inability to preserve historical information in the long time series training process of Recurrent Neural Network (RNN). Compared with traditional RNN network, LSTM network can perform better in longer time series.

[0102] The LSTM network consists of three gate structures and a state module for storing memory, such as Figure 2 As shown;

[0103] Let C t The state information stored in this LSTM unit, x t is the input layer’s input, h t is the output of the hidden layer of this unit, f t For the forget gate, i t is the input gate, is the current time information, o t is the output gate, “×” represents matrix element multiplication, “+” represents addition operation, and σ is the sigmoid function.

[0104] Forget gate: used to control the previous unit state C t-1 The degree of being forgotten is expressed as follows:

[0105] f t =σ(W f *[h t-1 ,x t ]+b f ) (4)

[0106] Input gate: It is used to control which information is added to this unit. Its expression is as follows:

[0107] i t =σ(W i *[h t-1 ,x t ]+b i ) (5)

[0108] Unit storage status information: used to t and i t Selectively record new information to C t The expression is as follows:

[0109]

[0110]

[0111] Output gate: used to convert C t Activate and control C tThe degree of filtering is expressed as follows:

[0112] o t =σ(W o *[h t-1 ,x t ]+b o ) (8)

[0113] h t =o t *tanh(C t ) (9)

[0114] In formulas (4)-(9), W f , W i , W o f t 、i t , o t The corresponding weight matrix, b f 、b i , b o f t 、i t , o t The corresponding bias term, tanh, is the hyperbolic tangent activation function, defined as follows:

[0115] σ(x)=1 / (1+e -x ) (10)

[0116] tanh(x)=(e x -e -x ) / (e x +e -x ) (11)

[0117] The traditional LSTM network structure includes an input layer, an LSTM layer, and an output layer. The output layer converts h into t After a fully connected layer, the final prediction value y is obtained t :

[0118] y t =σ(W y *h t +b y ) (12)

[0119] In the above formula, W y and b y are the weight matrix and bias term respectively.

[0120] IV. CNN-LSTM Model

[0121] CNN has good spatial grid data feature extraction capabilities, and LSTM can better analyze the dependencies between time series data. Therefore, the present invention combines CNN with LSTM.

[0122] Specifically, in step S2, for the multi-site multidimensional feature data of the present invention, the data of m features of n sites are organized into a matrix of n rows and m columns, and the matrix data of t moments are constructed as a time distribution layer to obtain more step information of time series data.

[0123] The input layer dimension of the CNN model is n×m×t (6×6×30), and the output of the CNN convolutional layer feature map for:

[0124]

[0125] In the above formula, X i+n,j+m is the value of the nth row and mth column of the input matrix, f cov (.) is the activation function, w n,m is the weight of the convolution kernel n rows and m columns, b n,m is the convolution kernel bias, k is the sliding window size, and the input matrix uses multiple convolution kernels for convolution operation.

[0126] The CNN pooling layer performs dimensionality reduction and downsampling through a 2×2 or 3×3 filter and a sliding window stride (stride = 2), maximally activating features with large weights, removing interference and noise information, and then flattening the data into a one-dimensional array through a flattening layer. in As a time series input to the LSTM layer of the LSTM network. Finally, the prediction results of the target site are obtained through the fully connected layer and the output layer, such as Figure 3 shown.

[0127] 5. About the MI-CNN-LSTM model

[0128] The MI sequence selection method can realize the feature processing of symmetric images, effectively remove about 50% of the model-based features and 95% of the symmetric image pixels without obvious loss, which shows that MI can eliminate irrelevant and redundant information and identify the most important features. In this embodiment, the original data of multi-dimensional features has a lot of noise. Directly inputting it into the CNN-LSTM model will interfere with the model prediction performance. Therefore, based on the CNN-LSTM model, the original data set X is selected by the MI mutual information algorithm and then used as the input of CNN, thereby reducing the data dimension of CNN convolution and reducing the algorithm consumption while maintaining the model prediction accuracy. The structure is as follows: Figure 4 The MI-CNN-LSTM model shown.

[0129] MI-CNN-ALSTM Model

[0130] In the traditional LSTM model, the LSTM layer is directly connected to the output layer. This embodiment combines LSTM with the attention mechanism, and adds the attention mechanism at the last moment of the LSTM hidden layer. The LSTM-Attention method in the prior art can effectively analyze the correlation between input and output to obtain more overall features of important time, and improve the network representation ability by learning feature weights. However, this embodiment aims to solve the problem of unstable wind power prediction results caused by drastic changes in wind speed. In order to allow the model to make better weight judgments and improve the prediction stability of the model, this embodiment proposes the ALSTM model, that is, adding an AT layer (i.e., Attention layer) between the original LSTM layer and the output layer. Its structure is as follows: Figure 5 As shown in the figure, the output of the LSTM layer at time t is associated with the final prediction result of the MI-CNN-ALSTM model using the attention mechanism. The activation function used by the AT layer is the softmax function, which is used to calculate the weight of the hidden layer vector; and the activation function used by the output layer is the sigmoid function, which is used to map the vector to the output.

[0131] Specifically, in step S3, after adding the AT layer between the LSTM layer and the output layer of the LSTM network, the attention mechanism vector G is obtained by formula (14): t :

[0132]

[0133] In formula (14), is the softmax activation function, W h is the weight vector, b h is the bias term;

[0134] According to the following formula, G t With h t Perform element-wise multiplication to get the output of the AT layer

[0135]

[0136] According to y in step S2 t =σ(W y *h t +b y ),Will As the input of the subsequent LSTM output layer, and get the predicted value y t :

[0137]

[0138] Based on the MI-CNN-LSTM model in step S2, by adding an attention mechanism to the LSTM network, we can obtain Figure 6 The MI-CNN-ALSTM model shown.

[0139] 7. PSO parameter optimization

[0140] In the process of using CNN and LSTM to predict multidimensional features, parameters such as the number of CNN filters (n_filters), CNN convolution kernel (n_kernel_size), LSTM hidden layer (n_lstm), and LSTM iteration number (n_batch) have a great impact on the model prediction performance, and the above hyperparameters need to be optimized. The PSO algorithm is an evolutionary computing technology based on the study of bird flock predation behavior, which finds the optimal solution through collaboration and information sharing among individuals in the group. Therefore, this embodiment uses PSO to optimize the above parameters of the MI-CNN-ALSTM model, uses different parameters to iteratively predict the test set, and uses the evaluation index RMSE (Root Mean Square Error) as the evaluation criterion for the optimal solution of the particle to find the optimal parameters, thereby obtaining the optimal wind power prediction result.

[0141] Specifically, the specific steps of the PSO algorithm described in step S4 are as follows: Figure 7 As shown:

[0142] S41, Initialization: Randomly initialize particle parameters P ξ =(n_filters,n_kernel_size,n_lstm,n_batch), and define the particles of the initial population, giving them initial speed and position;

[0143] S42, Iteration: Each particle searches for the optimal solution in the exploration space individually and records it as the current individual extreme value. The iteration function is as follows:

[0144] v ξ+1 =v ξ +c1*rand()*(pbest ξ -x ξ )+c2*rand()*gbest ξ -x ξ ) (17)

[0145] x ξ+1 =x ξ +v ξ+1 (18)

[0146] In formulas (17) and (18), v ξis the speed of the ξth iteration, c1 and c2 are learning factors, rand() is a random number between (0,1), and the particle searches for the local optimal solution pbest(P ξ ) and the global optimal solution gbest(P ξ ) to determine the subsequent position, x ξ is the position of the ξth iteration;

[0147] S43, optimization: Each particle performs optimization individually and shares its individual extreme value with other particles in the entire particle swarm, and finds the best individual extreme value as the current global optimal solution of the entire particle swarm, satisfying the calculation process of formula (17);

[0148] S44, Evaluation: Each iteration process trains the combined model and calculates the predicted value and RMSE;

[0149] S45, stop iteration: The MI-CNN-ALSTM-PSO model stops when the maximum number of iterations is reached and the RMSE is optimal during the search process, otherwise it returns to step S42 to continue updating particles.

[0150] 8. MI-CNN-ALSTM-PSO Model

[0151] Through the above steps S1-S4, the MI-CNN-ALSTM-PSO model is obtained, as shown in Figure 1 As shown, the MI-CNN-ALSTM-PSO model mainly includes the following parts:

[0152] (1) MI mutual information: The m-dimensional features of n stations in the past t hours are used as input data (30×6×6=1080). MI is used to perform preliminary feature selection on the original data (1080 dimensions) in the time dimension, and the top 360 dimensions with the highest weights are obtained to form a 30×6×2 grid data.

[0153] (2) CNN convolution: Convolution and pooling are performed on the data after MI feature selection to fully extract the spatial features of the data. The data is flattened into a one-dimensional array with temporal and spatial features as the input of LSTM.

[0154] (3) CNN-LSTM model: CNN extracts multi-site spatial information, and LSTM obtains time series memory information. The CNN-LSTM model fully considers the temporal and spatial information of each site in the wind farm, further improving the multi-site prediction capability.

[0155] (4) AT attention mechanism: The LSTM-AT model combined with the local AT mechanism is used to learn the model of the training set data. Further attention is paid to the output weight of the LSTM at the last moment to improve the prediction ability.

[0156] (5) PSO parameter optimization: The PSO algorithm is used to optimize the model training parameters.

[0157] (6) Data prediction: Use the network model optimized by PSO to predict the test set and obtain its predicted value.

[0158] IX. Experiment and Analysis

[0159] This embodiment experiments and analyzes the spatiotemporal combined prediction method based on CNN-LSTM and deep learning.

[0160] 1. Experimental Dataset

[0161] The experimental data comes from the National Renewable Energy Laboratory (NERL) of the United States, and is taken from the wind farms on Santa Cruz Island (approximately 120°W, 34°N) and San Miguel Island (approximately 120°W, 34°N). From July 28 to October 5, 2019 (10,000 data points), the sampling interval of the data set is 10 minutes. This data set can be obtained from the official website of the National Renewable Energy Laboratory (NERL).

[0162] The selected wind farm is located on the southwest coast of the Pacific Ocean. The terrain is low in the northwest and the dominant wind direction is northwest. The research area of ​​the wind power station is shown in Table 1.

[0163] Table 1 Site location information

[0164]

[0165]

[0166] Sites A8 and B8 are selected as target sites, and their wind power data are as follows: Figure 8 and Fig. 9 As shown in the figure, the experiment uses the first 8000 data (solid curve part) as the training set, and the last 2000 data (dashed curve part) as the test set; it should be noted here that Figure 8 and 9 The horizontal solid lines in the figure represent the average value. The wind power data of this site has the following characteristics:

[0167] 1) Wind power data is highly random and volatile;

[0168] 2) The geographical location of this area is quite special. It is located on an offshore island, with strong wind speed changes, unpredictable wind direction, and unpredictable atmospheric environment. These external conditions will make wind power prediction more difficult, and can also further verify the effectiveness of the combined prediction model proposed in this invention.

[0169] 2. Data processing and analysis

[0170] 1) Normalization

[0171] The dimensional original data set is transformed into a dimensionless scalar in the range of 0 to 1. This not only makes the subsequent model processing faster, but also facilitates the comparison and weighting of indicators of different units or magnitudes.

[0172] y=(x-Min) / (Max-Min) (19)

[0173] Among them, x is the original data, Min is the maximum value in the data set x, Min is the minimum value in the data set x, and y is the normalized output value.

[0174] 2) Data relevance

[0175] Fig.10 The trend comparison of wind speed and wind power at site A8 shows that wind power and wind speed data have consistent synchronous change trends. In addition, the actual wind power data of each site in area A are highly synchronized.

[0176] Table 2 Correlation between wind power at each site in Area A and wind power at the forecast point

[0177]

[0178] Table 2 shows the correlation analysis between the distance between the site in area A and the target site and the WP of the target site. It can be seen that the characteristics of the site close to A8 are highly correlated with it. On the contrary, the correlation is small, and the correlation of wind power data is positively correlated with the distance. Through the correlation analysis of wind power data of each site in area A, it can be seen that the distance and correlation of sites A5, A6, A8, A10, A11, and A12 have good reference, so the relevant data of these sites are used for prediction.

[0179] The correlation analysis of the sites in area B is shown in Table 3. Similarly, area B selects B8 as the central site to be predicted, and the relevant data of sites B6, B7, B8, B9, B10, and B13 are selected for prediction.

[0180] Table 3 Correlation between wind power at each site in Area B and wind power at the forecast point

[0181]

[0182] 3) Wind power autocorrelation analysis

[0183] In order to determine the time step of the subsequent prediction model, ACF and PACF are used to accurately analyze the autocorrelation of wind power data. Fig.11It can be seen that within the wind power data interval, the ACF graph feature is tailing, while the PACF graph feature is truncation. Therefore, the wind power data meets the characteristics of the autoregressive (AR) model. From the ACF graph, it can be seen that the wind power data enters the confidence interval when it lags about 30, so the time step of the prediction model is initially determined to be 30.

[0184] 4) Feature Dimension

[0185] Table 4 shows the correlation analysis of multi-dimensional characteristics of the prediction site. It can be seen that wind power and wind speed are highly correlated, wind direction is also an important factor affecting wind power, while density, air pressure, etc. have little impact on wind power.

[0186] Table 4 Comparison of correlations of multidimensional features of predicted sites

[0187]

[0188] (III) Evaluation indicators

[0189] The following three evaluation indicators are used in this experiment. Among them: N is the total number of wind power prediction samples, y(t) is the wind power data recorded by the original observation station at time t, is the wind power forecast value at time t. The smaller the MAE, RMSE and MASE values ​​are, the higher the prediction accuracy of the model is.

[0190] Mean absolute error:

[0191] Root mean square error:

[0192] Mean absolute scaled error:

[0193] 4. Comparative Experimental Benchmark Model

[0194] Table 5 Experimental comparison with baseline models

[0195]

[0196] The main parameter settings of each model are shown in Table 6.

[0197] Table 6 Main parameters of each model

[0198]

[0199]

[0200] 5. Prediction model experimental data analysis

[0201] This section mainly conducts experimental verification and comparative analysis on several algorithms and prediction models of the combined prediction model, including MI mutual information, CNN convolution, LSTM-AT, and PSO particle swarm optimization algorithm.

[0202] 1) CNN-LSTM convolutional model

[0203] The comparison of prediction indicators of various models is shown in Table 9. The 10 groups of average error indicators MAE, RMSE and MASE of CNN-LSTM are 0.196, 0.414 and 0.356 respectively, which are significantly lower than the single LSTM, VMD-LSTM, EEMD-LSTM and TCN model errors, indicating that CNN-LSTM has higher prediction accuracy.

[0204] 2) MI-CNN-LSTM model

[0205] Table 7 compares the results of MI feature selection and prediction using the MI-CNN-LSTM model. When the MI feature dimension is 900, the prediction index RMSE is 0.398. At this time, WP, WS, WD, TE are 180 dimensions, DE is 19 dimensions, and PA is 161 dimensions. Compared with the CNN-LSTM (1080 dimensions) model, the prediction error is reduced by 4%. When 360-dimensional data is selected, WP and WS are both 180, and the prediction result is the best (RMSE = 0.265).

[0206] Table 7 Analysis of MI feature dimension selection

[0207]

[0208]

[0209] This indicates that there is data redundancy when other feature dimensions are input into the CNN-LSTM model, which affects the prediction results. This is also similar to the results obtained from the previous correlation analysis.

[0210] Table 8 gives the first 60-dimensional data of the MI weights of the 360-dimensional data of the MI feature selection in area A, where the first 20-dimensional features are the wind power and wind speed of sites A5, A8, A10, and A11, which also shows that the results of the MI feature selection are similar to the results obtained from the distance and feature correlation analysis of each site in Table 10.

[0211] Table 8 MI feature selection results

[0212]

[0213] From the prediction result error indicators in Table 9, it can be seen that the final error indicators MAE, RMSE and MASE of MI-CNN-LSTM are 0.060, 0.265 and 0.164 respectively. Its error indicators are reduced by about 70%, 36% and 50% compared with the CNN-LSTM model, which shows that MI-CNN-LSTM has better prediction effect.

[0214] 3) MI-CNN-ALSTM model

[0215] The MI-CNN-LSTM-AT combined model convolves the grid data, improves the LSTM structure, and adds local AT. As can be seen from Table 9, the error indicators MAE, RMSE, and MASE of MI-CNN-ALSTM are 0.058, 0.247, and 0.152, respectively, which are 8%, 10%, and 7% lower than the error indicators of the MI-CNN-LSTM model, respectively. This shows that the prediction accuracy of the MI-CNN-ALSTM model after adding AT is significantly better than that of MI-CNN-LSTM. Fig.12 It can also be seen from the prediction error comparison bar chart that the prediction errors of all evaluation indicators of MI-CNN-ALSTM are the best in both regions.

[0216] Table 9 Comparison of prediction model errors between stations in area A and area B (MAE (kw), RMSE (kw), MASE (kw))

[0217]

[0218] 4) MI-CNN-ALSTM-PSO parameter optimization

[0219] Table 10 shows the PSO parameter optimization results. When the parameters n_filters, n_kernel_size, n_lstm, and n_batch are 46, 2, 37, and 64 respectively, the model prediction accuracy is the highest and the error is the smallest, so this group of parameters is selected as the model training parameters.

[0220] Table 10 MI-CNN-LSTM-AT model PSO particle swarm parameter optimization

[0221]

[0222]

[0223] (VI) Analysis of prediction accuracy and stability of combined model

[0224] Using models M3 to M10, 20 sets of prediction experiments were conducted on the wind speed data of sites in areas A and B, and the error index RMSE of the experimental results was compared. Fig.13 and Fig.14Box plot comparison of 20 groups of prediction results.

[0225] It can be seen from the figure that: 1) The average RMSE of the prediction error of CNN-LSTM is 0.48, which is better than EEMD-LSTM, VMD-LSTM and TCN. It can be shown that CNN convolution is significantly better than signal decomposition when dealing with multi-site correlation. 2) The average RMSE error of the MI-CNN-ALSTM model with AT and MI added is 0.24, and the prediction effect is also significantly improved. 3) From the perspective of stability, after the model proposed in this embodiment is optimized by the PSO particle swarm algorithm, its standard deviation is 0.021, which is more stable than the MI-CNN-ALSTM standard deviation of 0.025, and the prediction error is further reduced. At the same time, the error range of the prediction model is also more stable, and it is easier to train a better model.

[0226] (VII) Experimental Summary

[0227] Based on the comparative experimental data of area A and area B, the following conclusions can be drawn:

[0228] 1) MI effect: After MI feature extraction, redundant data is eliminated, such as DE and PA features, which are almost negligible. The experimental effect is significantly improved by predicting the extracted data.

[0229] 2) Conventional prediction models: The ARIMA model can predict the main trend of wind power, but it cannot accurately predict when the wind speed changes suddenly or when the wind power reaches a peak. Although the SVR and LSTM models can predict the general trend of wind power, they have a problem of prediction lag and cannot accurately predict the wind power at the next moment. Models such as TCN, VMD-LSTM and EEMD-LSTM establish related model predictions at multiple sites, but it is difficult to capture their spatial correlation, and the algorithm has a large time overhead and the prediction effect is not good.

[0230] 3) CNN-LSTM model: By convolving the grid composed of each site, CNN convolution can extract the spatial information of multiple sites and establish the connection between multiple sites. At the same time, combined with LSTM, it can ensure the integrity of time characteristics. CNN-LSTM fully combines the algorithmic advantages of the two models to improve wind power prediction performance.

[0231] 4) MI-CNN-ALSTM model: As can be seen from Table 3, after MI feature selection, the model is based on CNN-LSTM and adds an attention mechanism at the last moment of its output unit, so that the output pays more attention to the weight features of the previous moment, thereby further improving the prediction ability.

[0232] 5) MI-CNN-ALSTM-PSO model: The main functions include: improving the model's adaptability to sudden changes in wind power; being able to more accurately predict peaks and troughs in wind power; and the MI-CNN-ALSTM model based on PSO optimization makes the prediction accuracy more stable.

[0233] The above only describes the basic principles and preferred embodiments of the present invention. Those skilled in the art may make many changes and improvements based on the above description, and these changes and improvements should fall within the protection scope of the present invention.

Claims

1. A spatiotemporal combined prediction method based on CNN-LSTM and deep learning, characterized in that: The steps include: S1. Analyze the temporal and spatial correlation of the original data set through the MI mutual information algorithm, eliminate redundant information between data, and reduce the dimension of the original data; S2, establish the MI-CNN-LSTM model to predict the data after dimension reduction in step S1, where the CNN network is used to extract the spatial information of each site, and the LSTM network is used to obtain the dependency information between time series data; S3. Add an AT layer between the LSTM layer and the output layer of the LSTM network to obtain the MI-CNN-ALSTM model, and perform model learning on the training set data; S4, introduce the PSO algorithm to optimize the training parameters and obtain the MI-CNN-ALSTM-PSO model; S5. Predict the test set through the MI-CNN-ALSTM-PSO model to obtain the final prediction value; In step S1, the original data set is the wind power data with m-dimensional features collected from n sites in the past t hours, expressed as: X=(X 1 ,X 2 ,…,X m ) n×t (X1,X2,...,X t )∈R n×m×t In the above formula, n is the observation site number, t is the window length of the observation time series, and m is the data feature dimension; The characteristic data at time t is described as: In the above formula, WP is wind power, WS is wind speed, WD is wind direction, TE is temperature, PA is air pressure, DE is air density, and i is site number; In step S2, the LSTM network includes three gate structures and a state module for storing memory; Let C t The state information stored in this LSTM unit, x t is the input layer’s input, h t is the output of the hidden layer of this unit, f t For the forget gate, i t is the input gate, is the current time information, o t is the output gate, "×" represents matrix element multiplication, "+" represents addition operation, and σ is the sigmoid function; Forget gate: used to control the previous unit state C t-1 The degree of being forgotten is expressed as follows: f t =σ(W f *[h t-1 ,x t ]+b f ) Input gate: It is used to control which information is added to this unit. Its expression is as follows: i t =σ(W i *[h t-1 ,x t ]+b i ) Unit storage status information: used to t and i t Selectively record new information to C t The expression is as follows: Output gate: used to convert C t Activate and control C t The degree of filtering is expressed as follows: h t =o t *tanh(C t ) Among them, W f , W i , W c , W o f t 、i t , o t The corresponding weight matrix, b f 、b i 、b c 、b o f t 、i t , o t The corresponding bias term, tanh, is the hyperbolic tangent activation function, defined as follows: The traditional LSTM network structure includes an input layer, an LSTM layer, and an output layer. The output layer converts h into t After a fully connected layer, the final prediction value y is obtained t : y t =σ(W y *h t +b y ) In the above formula, W y and b y are the weight matrix and bias term respectively; In step S3, after adding the AT layer between the LSTM layer and the output layer of the LSTM network, the attention mechanism vector G is obtained by the following formula: t : In the above formula, is the softmax activation function, W h is the weight vector, b h is the bias term; According to the following formula, G t With h t Perform element-wise multiplication to get the output of the AT layer According to y in step S2 t =σ(W y *h t +b y ),Will As the input of the subsequent LSTM output layer, and get the predicted value y t :

2. The method according to claim 1, characterized in that: In step S2, the m-dimensional feature data of n stations are organized into a matrix of n rows and m columns, and the matrix of t moments is constructed as a time distribution layer; The input layer dimension of the CNN network is n×m×t, and the output of the convolutional layer feature map is for: In the above formula, X i+n,j+m is the value of the nth row and mth column of the input matrix, f cov (.) is the activation function, w n,m is the weight of the convolution kernel n rows and m columns, b n,m is the convolution kernel bias, k is the sliding window size, and the input matrix uses multiple convolution kernels for convolution operation; The CNN pooling layer performs dimensionality reduction and downsampling through filters and sliding window steps, and then flattens the data into a one-dimensional array through the flattening layer. in As time series input to the LSTM layer of the LSTM network.

3. The method according to claim 1, characterized in that Step S4 specifically includes the following steps: S41, Initialization: Randomly initialize particle parameters P ξ , and define the particles of the initial population, giving them initial velocity and position; S42, Iteration: Each particle searches for the optimal solution in the exploration space individually and records it as the current individual extreme value. The iteration function is as follows: x ξ+1 =x ξ +v ξ+1 In the above formula, v ξ is the speed of the ξth iteration, c1 and c2 are learning factors, rand() is a random number between (0,1), and the particle searches for the local optimal solution pbest ξ And the global optimal solution gbest ξ To determine the subsequent position, x ξ is the position of the ξth iteration; S43, optimization: Each particle performs optimization individually and shares its individual extreme value with other particles in the entire particle swarm, and finds the best individual extreme value as the current global optimal solution of the entire particle swarm; S44, Evaluation: Each iteration process trains the combined model and calculates the predicted value and evaluation index RMSE; S45, stop iteration: The MI-CNN-ALSTM-PSO model stops when the maximum number of iterations is reached and the RMSE is optimal during the search process, otherwise it returns to step S42 to continue updating particles.