Wind speed prediction method for coastal stations based on Top-K spatiotemporal graph attention network
By using the Top-K space-time graph attention network in wind speed prediction, combining spatial and temporal correlation, the problems of insufficient accuracy and high uncertainty in wind speed prediction in the prior art are solved, and more efficient and reliable wind speed prediction is achieved.
Patent Information
- Application Number
- CN202410342299.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-25
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-03-25
AI Technical Summary
In the prediction of wind speed in coastal areas, the problems of insufficient spatial feature extraction, incomplete processing of time correlation and insufficient combination of space-time correlation in the prior art have problems, resulting in insufficient prediction accuracy and high uncertainty.
The method based on Top-K space-time graph attention network is adopted, and the spatial correlation between sites is captured through the Top-K space-time graph attention module, the time self-attention module mines the temporal correlation of the site itself, and adaptive fusion is performed through the feature fusion module, and finally generates a wind speed prediction sequence using the inference layer.
It improves the accuracy and reliability of wind speed prediction, enhances the model's ability to capture long-term wind speed changes, reduces the uncertainty of prediction, and achieves efficient prediction of wind speeds at all stations in coastal areas.
Smart Images

Figure CN118656776B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for predicting wind speed at coastal sites based on a Top-K spatiotemporal graph attention network, which is used for meteorological forecasting. Background Art
[0002] Accurately predicting wind speed in coastal areas is of great significance for the identification and early warning of extreme meteorological events. However, wind speed prediction is challenging due to complex factors such as external characteristics and spatiotemporal correlations.
[0003] Non-deep learning prediction methods in previous studies can be divided into deterministic methods and statistical methods. Deterministic methods use meteorological principles and mathematical equations to simulate the physical and chemical reactions of the atmosphere. Although well-established theories provide valuable insights into wind speed prediction, deterministic methods are hampered by prior knowledge, diverse usage restrictions, and unreliable and limited data. Statistical methods can be divided into two categories: classical machine learning methods and traditional machine learning methods. As a classical machine learning method, autoregressive integrated moving average (ARIMA) has high prediction accuracy, but ARIMA requires a lot of statistical data and relies on specific empirical rules. Commonly used traditional machine learning models, including artificial neural networks (ANNs), support vector machines (SVNs), and random forests (RFs), have improved prediction accuracy, but these methods have limited ability to extract complex nonlinear spatiotemporal correlations in data and often perform well only on small-scale data sets.
[0004] In recent years, many advanced deep learning techniques have shown great potential in processing spatiotemporal data, so deep learning techniques have been widely used in wind speed prediction. Among deep learning models, the commonly used architectures are convolutional neural networks and long short-term memory (CNN-LSTM) models. In the spatial module, the CNN model is used to extract spatial features between multiple sites; in the temporal module, the LSTM model is used to capture temporal correlation. However, the spatial feature extraction process based on CNN has the risk of impersonating the original spatial information, and LSTM may forget information when processing long sequence data, resulting in the loss of key time information, making the model lose the ability to capture long-term wind speed changes, and the uncertainty of the prediction increases. Although the graph attention network and long short-term memory (GAT-LSTM) have higher prediction accuracy, GAT ignores the adverse effects of the neighboring nodes that contribute the least to the target when extracting spatial features, and does not consider the combination of spatiotemporal correlation and the inherent temporal dependence of the target site in the data, and the phenomenon of prediction accuracy offset will occur in the long-term wind speed. The former: the model loses the ability to capture long-term wind speed changes and the uncertainty of the prediction increases; the latter: the phenomenon of prediction accuracy offset will occur in the long-term wind speed. Summary of the invention
[0005] Purpose of the invention: In view of the problems and shortcomings of the prior art, the present invention provides a coastal station wind speed prediction method based on Top-K spatiotemporal graph attention network with good prediction effect and good practicality.
[0006] Technical solution: A method for coastal station wind speed prediction based on Top-K spatiotemporal graph attention network, including:
[0007] Step 1: Generate input data;
[0008] Step 2: Build a wind speed prediction model;
[0009] Step 3: Train the prediction model constructed in step 2;
[0010] Step 4: Calculate the accuracy of the model prediction. If the accuracy exceeds the preset threshold, execute step 5; otherwise, return to step 3.
[0011] Step 5: Input the generated data into the trained prediction model to obtain the wind speed forecast values for all stations in the coastal area.
[0012] Preferably, the step 1 is specifically:
[0013] Wind speed data and auxiliary characteristic data of all stations in the coastal area are collected, and the data are preprocessed to generate two types of input data.
[0014] More preferably, the wind speed data of the site is: the historical wind speed data of all monitoring sites in a specific coastal area; the auxiliary feature data is the auxiliary feature data related to each wind speed monitoring site, including temperature, divergence, specific humidity, relative humidity, convective effective potential energy, etc.
[0015] Preferably, the step 2 is specifically:
[0016] Based on the principle of deep learning, the wind speed prediction model of encoder, decoder and inference layer is constructed. The encoder is mainly composed of Top-K spatial graph attention module, temporal self-attention module and feature fusion module. The Top-K spatial graph attention module is used to capture the spatial correlation between stations in historical data, the temporal self-attention module is used to mine the temporal correlation of each station in historical data, and the feature fusion module is used to fuse the spatial and temporal correlation in historical data. The structure of the decoder is the same as that of the encoder, which is mainly used to extract and fuse the spatial and temporal correlation in the prediction time step. The inference layer is used to combine the fused features of the encoder and decoder to iteratively generate a prediction sequence.
[0017] More preferably, for the Top-K spatial graph attention module: the input of this module is a graph structure constructed by wind speeds of multiple stations in a specific coastal area and related auxiliary feature data, the nodes in the graph represent stations in the coastal area, and the edges represent the correlation between stations. The specific implementation steps of the Top-K spatial graph attention module are as follows: first, use a multi-layer graph attention network to calculate the attention score between the target node and other nodes in the graph; second, use the Top-K mechanism to retain the other nodes with the top K% scores to calculate the next layer of attention scores; third, perform multi-layer iterations according to steps one and two, and finally output spatial correlation features.
[0018] More preferably, for the temporal self-attention module: the input of this module is the sequence structure data constructed by wind speed and related auxiliary feature data, a multi-head self-attention mechanism is used to mine the temporal correlation of the site itself, and then the temporal correlation features are output.
[0019] More preferably, for the feature fusion module: the input of this module is the sequence structure data constructed by the spatial correlation features output by the Top-K spatial graph attention module and the temporal correlation features output by the temporal self-attention module, the spatial correlation features are fused with the temporal correlation features using the time step as an identifier, and then the spatiotemporal correlation features are output.
[0020] More preferably, the encoder is composed of a Top-K spatial graph attention module, a temporal self-attention module and a feature fusion module, and the input of the encoder is a graph structure and sequence structure data generated by historical wind speed and related auxiliary feature data. The Top-K spatial graph attention module is used to capture the spatial correlation between sites, the temporal self-attention module is used to mine the temporal correlation hidden in the data, and the feature fusion module performs adaptive fusion according to the importance of spatiotemporal correlation.
[0021] More preferably, the decoder is composed of a Top-K spatial graph attention module, a temporal self-attention module and a feature fusion module, and the input of the decoder is a graph structure and sequence structure data generated by the wind speed at the predicted time step and related auxiliary feature data. The Top-K spatial graph attention module is used to capture the spatial correlation between sites, the temporal self-attention module is used to mine the temporal correlation hidden in the data, and the feature fusion module performs adaptive fusion according to the importance of spatiotemporal correlation.
[0022] More preferably, the input of the inference layer is the sequence structure data constructed by the spatiotemporal correlation features of the historical time step output by the encoder and the spatiotemporal correlation features of the predicted time step output by the decoder. We first use a multi-head self-attention mechanism to evaluate the impact of the spatiotemporal correlation features of the historical time step on the spatiotemporal correlation features of each predicted time step, and then use a fully connected network to output the prediction result of the next time step.
[0023] More preferably, the step 3 is specifically as follows:
[0024] The overall model is trained, and the back propagation algorithm is used to fine-tune the model according to the results of the loss function.
[0025] More preferably, the loss function is specifically:
[0026]
[0027] Where T is the time step length of the prediction sequence, N is the number of target sites, and y t,i represents the wind speed observation value at station i at time step t, and is the predicted wind speed at station i at time step i, λ is the regularization parameter, and W is the weight parameter of the network.
[0028] A computer-readable storage medium stores a computer program for executing the coastal site wind speed prediction method based on the Top-K spatiotemporal graph attention network as described above.
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. Good prediction effect: The wind speed prediction method in the present invention is based on environmental spatiotemporal big data and deep learning theory. It utilizes a large amount of accumulated wind speed data of coastal stations and uses a fully connected network for processing; then, the coastal station wind speed prediction based on the Top-K spatiotemporal graph attention network proposed in the present invention is used to deeply extract the complex and dynamic spatiotemporal dependencies in the historical and predicted wind speed changes, and finally outputs the predicted values of all stations in the coastal area, which achieves better prediction accuracy than traditional methods and thus has practical application value.
[0031] 2. Good practicability: The wind speed prediction method in the present invention can directly predict the wind speed of all stations in the current coastal area without the need to process data for each station in turn. The data processing speed is fast, the range is wide, and the practicability is good. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 The figure is a flow chart of the wind speed prediction method in the present invention.
[0033] Figure 2 This is an overall structural diagram of the coastal site wind speed prediction model of the Top-K spatiotemporal graph attention network in an embodiment of the present invention. DETAILED DESCRIPTION
[0034] The present invention is further explained below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0035] Deep learning has attracted the attention of researchers for its powerful ability to process massive spatiotemporal data. The present invention uses deep learning's ability to learn big data to establish a multi-site wind speed prediction model for coastal areas. The following is a specific implementation method:
[0036] A wind speed prediction method for coastal stations based on Top-K spatiotemporal graph attention network, the process is as follows Figure 1 As shown, including:
[0037] Step 1: Generate input data;
[0038] There are N stations in the coastal area, and the wind speed data for the past T time intervals are known. The wind speed at time step t is expressed as in represents the wind speed data of the ith station at time step t, C represents the dimension of the target feature, where the target feature refers to, for example, the 2-minute average wind direction (°), the 2-minute average wind speed (m / s) or the maximum wind speed (m / s). The sampling frequency is extended to hours by the averaging method. Dividing T into historical time steps with an interval of hours, the input historical wind speed data can be expressed as Where P represents the number of historical time steps, N represents the total number of stations in the coastal area, and C represents the dimension of the current prediction target feature. A two-layer fully connected network is introduced to transform the dimension of X from C to d model / 2, which can be expressed as:
[0039] Auxiliary features include: 100u: east-west wind component at 100 meters above the ground (m / s); 100v: north-south wind component at 100 meters above the ground (m / s); 10u: east-west wind component at 10 meters above the ground (m / s); 10v: north-south wind component at 10 meters above the ground (m / s); 2d: dew point temperature at 2 meters above the ground (℃); 2t: air temperature at 2 meters above the ground (℃); cape: effective convective potential energy (J / kg); capes: effective convective shear (m^ 2s^-2); cp: convective precipitation, cumulative amount (mm); deg0l: 0 degree altitude (m); lcc: low cloud coverage, (0-1); msl: mean sea level pressure (hPa); skt: surface temperature (℃); sp: surface pressure (hPa); sst: sea surface temperature (℃); tcc: total cloud cover, (0-1); Isobaric surface data: contains 1000, 950, 925, 900, 850, 700, 500, 200 levels. For example, the data of 1000hPa isobaric surface are as follows, and the other levels are similar: d_L1000: divergence (10^-6s^-1); q_L1000: specific humidity (g / kg); r_L1000: relative humidity (%); t_L1000: temperature (℃); u_L1000: east-west wind component (m / s); v_L1000: north-south wind component (m / s); w_L1000: linear velocity (Pa / s); There are 72 auxiliary features in total. The sampling frequency of each feature is extended to hours by averaging. In addition, we can collect the data of the same historical time step T auxiliary features through the meteorological forecast system. Therefore, the auxiliary features can be expressed as: We use a 2-layer fully connected network to unify the dimension of auxiliary features from 72 to d model / 2, expressed as
[0040] Wind speed data in historical time steps With auxiliary features Combined, the input data of the historical time step can be obtained, expressed as: By performing the same operation on the wind speed data and auxiliary features at the prediction time step T, the input data of the prediction time step can be obtained, which is expressed as:
[0041] Step 2: Build a wind speed prediction model;
[0042] The specific structure of the model is as follows Figure 2 The model is mainly composed of three parts: encoder, decoder and inference layer. The encoder is mainly composed of Top-K spatial graph attention module, temporal self-attention module and feature fusion module. The structure of the decoder is the same as that of the encoder.
[0043] The Top-K spatial graph attention module consists of multiple layers of graph attention networks.
[0044] The input of the graph attention network is the time step The wind speed at time step t is The attention scores between different sites can be calculated i,j :
[0045]
[0046] Among them, e i,j represents the attention score of site j to site i, σ represents the activation function sigmoid, W Att is the parameter matrix in the graph attention mechanism, W is the weight matrix of the node input features, x i and x j They represent site i and site j at the same time step, ⊕ is the splicing operation, and W Att and W are learnable parameters.
[0047] In order to facilitate the comparison of coefficients between different nodes, we use the softmax function to normalize the coefficients of all adjacent nodes. After normalization, the attention score B of site j to site i is i,j The calculation formula is as follows:
[0048]
[0049] The Top-K mechanism retains the top K% of the nodes to calculate the next layer of attention scores. The calculation formula is as follows:
[0050]
[0051] in, represents the sites with the top K% attention scores for site i, TopK(·) represents the function of retaining the other nodes with the top K% scores, B i =(B i,1 ,B i,2 ,...,B i,N ) represents the attention scores of all sites on site i.
[0052] Get the result of Top-K graph attention network:
[0053] f(X TopK )=σ(B′·X TopK ·W′)
[0054] in, represents the Top-K sites of all sites, σ represents the activation function sigmoid, B′ represents the attention matrix of the retained points, and W′ represents the training parameters.
[0055] The self-attention mechanism converts f(X TopK ) is encoded into three matrices, called Q, K, and V. The similarity is calculated by performing matrix multiplication on the transpose of Q and K, and then the resulting value is converted into an attention score using the softmax function. The calculation formula for this process is as follows:
[0056] Q=W q f(X TopK )
[0057] K=W k f(X TopK )
[0058] V=W v f(X TopK )
[0059]
[0060] Among them, W q ,W k and W v are trainable parameters with the same shape, Self-Att represents the function for calculating the self-attention score, and d k Represents the dimension of K.
[0061] The multi-head self-attention mechanism divides attention into h heads and concatenates their outputs to obtain the final result. The calculation formula is as follows:
[0062]
[0063] Multi-Head(Q,K,V)=Concat(head1,…,head h )W O
[0064] in, and represents the parameters of linear projection from Q, K and V, Multi-Head represents the function of calculating h attention heads at the same time, W o represents the projection parameter matrix that remaps the concatenated result to the original dimension, and Concat(·,·,…,·) represents the function of concatenating the input matrices.
[0065] After being processed by multiple layers of Top-K graph attention networks, the spatial correlation features finally output by the Top-K graph attention network module can be expressed as:
[0066] S=(STimestep1 ,S Timestep2 ,…,S Timestept )
[0067] The temporal self-attention module is composed of a multi-head self-attention mechanism. The input is the time step The steps are similar to the multi-head self-attention mechanism in the Top-K graph attention network module. After multi-head self-attention processing, the time-related features finally output by the temporal self-attention module are obtained, which can be expressed as:
[0068] T=(T Timestep1 ,T Timestep2 ,…,T Timestept )
[0069] The input of the feature fusion module is the spatial correlation feature S output by the Top-K spatial graph attention module and the temporal correlation feature T output by the temporal self-attention module. The spatial correlation feature and the temporal correlation feature are fused using the time step as an identifier to obtain the spatiotemporal correlation feature, which can be expressed as:
[0070] (S,T)={(S Timestep1 ,T Timestep1 ),(S Timestep2 ,T Timestep2 ),…,(S Timestept ,T Timestept )}
[0071] The encoder consists of a Top-K spatial graph attention module, a temporal self-attention module, and a feature fusion module. The input of the encoder is the historical time step You can get:
[0072]
[0073] Among them, (S,T) Enc represents the spatiotemporal correlation features obtained by inputting historical time steps, represents the spatial correlation characteristics of the historical time step t-T+i, Represents the time-dependent features of the historical time step t-T+i.
[0074] The decoder uses the same structure as the encoder. The input to the decoder is the predicted time step You can get:
[0075]
[0076] Among them, (S,T) Dec represents the spatiotemporal correlation features obtained at the input prediction time step, represents the spatial correlation features of the predicted time step t+i, represents the time-dependent features of the prediction time step t+i.
[0077] The inference layer consists of a multi-head self-attention mechanism and a fully connected network. At time step t+i, the outputs of the encoder and decoder are (ST, T) respectively. Enc and (ST,T) Enc and As input, after multi-head self-attention processing, the final predicted feature representation is obtained Use the fully connected network to output the predicted value of time step t+i+1, and the calculation formula is as follows:
[0078]
[0079] Among them, the wind speed forecast value at time step t+t+1, W FNN is the weight matrix of the fully connected network and b is the bias vector.
[0080] Step 3: Train the prediction model constructed in step 2;
[0081] For the constructed model, we construct training set, validation set and test set. We use the training set data to initialize and train the model, use the validation set and evaluation indicators to adjust the model parameters, and use the test set to test the model effect. It is worth mentioning that we train the model once for each target in wind speed and make predictions.
[0082] In this embodiment, the proportions of the training data set, the validation data set and the test data set are 70%, 10% and 20% respectively.
[0083] The loss function is used for training and the model is fine-tuned to complete the model training, and finally the wind speed forecast values for the next T time steps for all stations in the coastal area are output.
[0084] The loss function is specifically:
[0085]
[0086] Where T is the time step length of the prediction sequence, N is the number of target sites, and y t,i represents the wind speed observation value at station i at time step t, and is the predicted wind speed at station t at time step t, λ is the regularization parameter, and W is the weight parameter of the network;
[0087] Step 4: Calculate the accuracy of the model prediction. If the accuracy exceeds the preset threshold, execute step 5; otherwise, return to step 3.
[0088] Step 5: Predetermine one of the prediction targets, input the multi-station data in the coastal area into the trained prediction model, and obtain the wind speed prediction values of all stations in the next T time steps.
[0089] Obviously, those skilled in the art should understand that the steps of the coastal site wind speed prediction method based on the Top-K spatiotemporal graph attention network of the above-mentioned embodiment of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.
Claims
1. A method for coastal site wind speed prediction based on Top-K spatiotemporal graph attention network, characterized in that: The steps include: Step 1: Generate input data; Step 2: Build a wind speed prediction model; Step 3: Train the prediction model constructed in step 2; Step 4: Calculate the accuracy of the prediction model trained in step 3. If the accuracy exceeds the preset threshold, execute step 5; otherwise, return to step 3. Step 5: Input the input data generated in step 1 into the trained prediction model to obtain the wind speed forecast values for all stations in the coastal area; In the step 1, the wind speed data and auxiliary feature data of all stations in the coastal area are collected, and the data are preprocessed to generate two types of input data: (1) the wind speed data of the station is: the historical wind speed data of all monitoring stations in a set coastal area; (2) the auxiliary feature data is the auxiliary feature data related to each wind speed monitoring station; In the step 2, a wind speed prediction model is constructed based on the deep learning principle; the wind speed prediction model includes an encoder, a decoder and an inference layer; the encoder includes a Top-K spatial graph attention module, a temporal self-attention module and a feature fusion module, and the input of the encoder is a graph structure and sequence structure data generated by historical wind speed and related auxiliary feature data; the Top-K spatial graph attention module is used to capture the spatial correlation between sites in the historical data, the temporal self-attention module is used to mine the temporal correlation of each site in the historical data, and the feature fusion module is used to fuse the spatial and temporal correlations in the historical data; The structure of the decoder is the same as that of the encoder, and the two can be executed in parallel. The decoder is used to extract and fuse the spatial and temporal correlations in the prediction time step. The input of the decoder is the graph structure and sequence structure data generated by the wind speed at the prediction time step and related auxiliary feature data. The inference layer is used to iteratively generate the prediction sequence by combining the fused features of the encoder and decoder. For the Top-K spatial graph attention module: the input of this module is a graph structure constructed by wind speeds of multiple stations in a specific coastal area and related auxiliary feature data. The nodes in the graph represent stations in the coastal area, and the edges represent the correlation between stations. The specific implementation steps of the Top-K spatial graph attention module are as follows: first, a multi-layer graph attention network is used to calculate the attention score between the target node and other nodes in the graph; second, the Top-K mechanism is used to retain the other nodes with the top K% scores to calculate the next layer of attention scores; third, multiple layers are iterated according to steps one and two, and finally the spatial correlation features are output; For the temporal self-attention module: the input of this module is the sequence structure data constructed by wind speed and related auxiliary feature data. The multi-head self-attention mechanism is used to mine the temporal correlation of the station itself, and then the temporal correlation features are output; For the feature fusion module: the input of this module is the sequence structure data constructed by the spatial correlation features output by the Top-K spatial graph attention module and the temporal correlation features output by the temporal self-attention module. The spatial correlation features are fused with the temporal correlation features using the time step as an identifier, and then the spatiotemporal correlation features are output; The input of the inference layer is the sequence structure data constructed by the spatiotemporal correlation features of the historical time steps output by the encoder and the spatiotemporal correlation features of the predicted time steps output by the decoder; first, a multi-head self-attention mechanism is used to evaluate the influence of the spatiotemporal correlation features of the historical time steps on the spatiotemporal correlation features of each predicted time step, and then a fully connected network is used to output the prediction result of the next time step.
2. The method for coastal site wind speed prediction based on Top-K spatiotemporal graph attention network according to claim 1 is characterized in that: The step 3 is specifically: training the overall model, and fine-tuning the model using the back propagation algorithm according to the result of the loss function during training; the loss function is specifically: Where T is the time step length of the prediction sequence, N is the number of target sites, and y t,i represents the wind speed observation value at station i at time step t, and is the predicted wind speed at station i at time step t, λ is the regularization parameter, and W is the weight parameter of the network.
3. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the coastal site wind speed prediction method based on Top-K spatiotemporal graph attention network as described in any one of claims 1-2.
Citation Information
Patent Citations
Residual service life prediction method based on DBN-LSTM semi-supervised joint model
CN114218872A
Coastal station wind speed prediction method based on space-time attention joint gating network
CN117420615A