A sea surface temperature prediction method based on adaptive spatiotemporal graph neural network
By adopting an adaptive spatiotemporal graph neural network in sea surface temperature prediction, the problem of relying on predefined graph structure for sea surface temperature prediction in the prior art is solved, and more efficient and accurate sea surface temperature prediction is achieved.
Patent Information
- Application Number
- CN202411630251.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2044-11-15
AI Technical Summary
The existing sea surface temperature prediction methods rely too much on predefined graph structures, making it difficult to effectively deal with complex time series dependencies, and the graph learning process and space-time prediction are interdependent, making it difficult to control the learning direction of the model, resulting in limited ability to improve prediction performance.
Using an adaptive spatiotemporal graph neural network method, the spatiotemporal prediction module, graph learning module and adjacency matrix update module are alternately trained, and the weight of the adjacency matrix is dynamically adjusted to approximate the spatial correlation of sea surface temperature.
It improves the accuracy and efficiency of sea surface temperature prediction, can more accurately determine the spatial dependence of sea surface temperature, and enhances the prediction performance of the model.
Smart Images

Figure CN119128534B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ocean prediction technology, and in particular to a sea surface temperature prediction method based on an adaptive spatiotemporal graph neural network. Background Art
[0002] Sea surface temperature (SST) is an important parameter that affects the global atmosphere-ocean energy cycle. Its abnormal changes will lead to frequent extreme weather and climate events caused by sea-air interactions such as tropical cyclones and El Niño. Accurate prediction of SST with spatiotemporal distribution characteristics is conducive to early warning and protection of natural disasters, and is of great significance to the fields of marine environment and marine research. Current sea surface temperature prediction methods take into account spatiotemporal characteristics, but there are still deficiencies in extracting spatial information. The existing GCN method relies on a predefined graph structure and has limitations in processing complex time series dependencies. At the same time, due to the interdependence of the graph learning process and spatiotemporal prediction, it is difficult to control the learning direction of the model when training the existing graph learning network, and the ability to improve the prediction performance is limited. Summary of the invention
[0003] Purpose of the invention: The purpose of the present invention is to provide a sea surface temperature prediction method based on an adaptive spatiotemporal graph neural network to solve the problem that the current sea surface temperature prediction method is too dependent on a predefined graph structure.
[0004] Technical solution: The sea surface temperature prediction method based on an adaptive spatiotemporal graph neural network described in the present invention comprises the following steps:
[0005] (1) The optimal interpolation sea surface temperature (OISST) dataset provided by NOAA's official website was used to select the two-dimensional sea surface temperature data of the Bohai Sea and the East China Sea;
[0006] (2) Preprocess the collected two-dimensional data set to obtain spatiotemporal data with time coding and an initial adjacency matrix; and divide it into a training set, a validation set, and a test set;
[0007] (3) Construct an SST prediction model based on an adaptive spatiotemporal graph convolutional network. The SST prediction model includes a spatiotemporal prediction module, a graph learning module, and an adjacency matrix update module.
[0008] (4) The test set is input into the trained model for prediction, and the result is denormalized and the prediction error is calculated with the observed value.
[0009] Furthermore, step (2) includes the following steps:
[0010] (21) Time-coding the spatiotemporal data according to the year cycle; constructing the initial adjacency matrix through Euclidean distance and Pearson correlation coefficient calculation to provide a structured graphical representation for the time series data of sea surface temperature;
[0011] (22) The input two-dimensional SST data is standardized and the standardized two-dimensional data is divided into a training set, a validation set, and a test set.
[0012] Furthermore, step (3) is as follows: the preprocessed training set is sequentially trained through the spatiotemporal prediction module to obtain model parameters; then, a new adjacency matrix is generated through the graph learning module; then, the generated new adjacency matrix is added to the adjacency matrix update module, and in the adjacency matrix update module, the weighted adjacency matrix is summed to obtain an updated adjacency matrix; finally, the updated adjacency matrix is re-input into the spatiotemporal prediction module, and the training is repeated alternately to obtain the optimal model parameters; wherein the spatiotemporal prediction module is composed of three groups of spatiotemporal blocks ST block, residual connection and skip connection; each spatiotemporal block contains an attention layer, a temporal convolution layer, a graph convolution layer and a residual connection.
[0013] Furthermore, step (3) includes the following steps:
[0014] (31) The training set and the initial adjacency matrix are input into the spatiotemporal prediction module to train the model parameters; the spatiotemporal prediction module contains three groups of stacked spatiotemporal blocks, each of which consists of an attention layer, a temporal convolution layer and a graph convolution layer; the attention layer consists of multiple spatial attention layers, which are used to model the spatial dependencies at different time steps; the temporal convolution layer uses dilated convolution to collect temporal features with periodic characteristics; the graph convolution layer consists of two groups of propagation layers, which process the inflow and outflow information through each node respectively; at the same time, residual connections are added to prevent gradient disappearance or gradient explosion.
[0015] (32) Next, the parameters of the spatiotemporal prediction model in step (31) are set unchanged, and the graph learning module is trained to generate a new adjacency matrix; wherein the graph learning module uses a learnable parameterized adjacency matrix to approximate the spatial correlation between sea surface temperatures, and the formula is as follows:
[0016] The formula is as follows:
[0017] ;
[0018] in, , Perform Kaiming uniform initialization, , , N is the number of nodes, is the hidden feature dimension; Represents a random number between 0 and 1 that can be learned by N nodes; Diag(Λ) represents the diagonal matrix of Λ; the stored gradient is used to adjust the parameters of the model , and , so that the loss function value changes in the direction of minimization; through the sparsity enhanced by the activation function, and using the adaptive aggregation module to convert the old adjacency matrix and new space Dependency combination, the formula is as follows:
[0019] ;
[0020] ;
[0021] Among them, the graph learning module is in the first round of training process. is the adjacency matrix of the initial input During the cycle training, is the adjacency matrix output by the previous adjacency matrix update module; h is the convolution layer with a convolution kernel of 1 × 1, is an element-by-element multiplication; the sparse adjacency matrix is calculated as follows:
[0022] ;
[0023] in, and is a diagonal matrix, , , is the threshold, filter Weak ties, setting , N is the number of nodes;
[0024] (33) Add the adjacency matrix generated in step (32) to the adjacency matrix update module. In the adjacency matrix update module, the weighted adjacency matrix is summed to obtain the updated adjacency matrix. The adjacency matrix update module dynamically adjusts the weight of the adjacency matrix through the prediction error so that the updated adjacency matrix reflects the data space dependency. The prediction loss of each adjacency matrix is calculated and compared with the maximum prediction loss. The weighted sum of all adjacency matrices is used as the updated adjacency matrix and re-entered into the spatiotemporal prediction module to enter a new round of model parameter training. The number of adjacency matrices in the adjacency matrix set is set to an upper limit. Each adjacency matrix in and the processed SST data are input into the trained spatiotemporal prediction module to calculate the corresponding prediction loss. The formula is as follows:
[0025] ;
[0026] in, represents the prediction loss, is the kth adjacency matrix, X represents the input data, Y is the observed value, is the learnable parameter of the STPM module, which combines all prediction losses into a vector , , is the maximum value, weight vector This is determined by the following function:
[0027] ;
[0028] in, The function is defined as:
[0029] ;
[0030] in, Function Compute The difference between each element in and the maximum loss value is mapped into a weight value through an exponential function to quantify the relative importance of each adjacency matrix; the updated adjacency matrix is calculated by the weighted sum of all adjacency matrices and is updated as:
[0031] ;
[0032] in, is the number of adjacency matrices; Normalized by formula.
[0033] Furthermore, step (4) is as follows:
[0034] (41) Input the two-dimensional test set preprocessed in step (2) into the trained model to obtain the prediction result, and perform denormalization on the result. The formula is as follows:
[0035] ;
[0036] in, Represents the data after model prediction. and are the standard deviation and mean respectively;
[0037] (42) Calculate the error between the denormalized data and the observed values; It is used to calculate the mean absolute error between the predicted and observed values. It is used to calculate the root mean square error between the predicted value and the observed value. Used to calculate the mean absolute percentage error; the calculation formula is:
[0038] ;
[0039] ;
[0040] ;
[0041] in, i , j represents the spatial grid coordinates, K Represents the total number of test samples, I represents the total number of grid points in the latitudinal direction, J Indicates the total number of grid points in the longitudinal direction; represents the SST value predicted by the corresponding spatial grid model, Represents the SST observation value of the corresponding spatial grid point.
[0042] The sea surface temperature prediction system based on the adaptive spatiotemporal graph neural network described in the present invention comprises:
[0043] Acquisition module: used to use the optimal interpolation sea temperature OISST data set provided by NOAA official website to select the two-dimensional sea surface temperature data of Bohai Sea and East China Sea;
[0044] Preprocessing module: used to preprocess the collected two-dimensional data set to obtain spatiotemporal data with time coding and the initial adjacency matrix; and divide it into training set, validation set and test set;
[0045] SST prediction model construction module: used to build an SST prediction model based on an adaptive spatiotemporal graph convolutional network; the SST prediction model includes: a spatiotemporal prediction module, a graph learning module, and an adjacency matrix update module;
[0046] Prediction module: used to input the test set into the trained model for prediction, denormalize the results, and calculate the prediction error with the observed values.
[0047] Furthermore, in the preprocessing module, the details are as follows:
[0048] The spatiotemporal data are time-coded according to the year cycle; the initial adjacency matrix is constructed by calculating the Euclidean distance and Pearson correlation coefficient to provide a structured graphical representation for the time series data of sea surface temperature;
[0049] The input two-dimensional SST data is standardized and divided into training set, validation set and test set.
[0050] Furthermore, in the SST prediction model construction module, the details are as follows: the preprocessed training set is trained in the spatiotemporal prediction module in turn to obtain the model parameters; then, a new adjacency matrix is generated through the graph learning module; then the generated new adjacency matrix is added to the adjacency matrix update module, and in the adjacency matrix update module, the weighted adjacency matrix is summed to obtain the updated adjacency matrix; finally, the updated adjacency matrix is re-input into the spatiotemporal prediction module, and the training is repeated alternately in turn to obtain the optimal model parameters; among them, the spatiotemporal prediction module consists of 3 groups of spatiotemporal blocks ST block, residual connection and skip connection; each spatiotemporal block contains an attention layer, a temporal convolution layer, a graph convolution layer and residual connection.
[0051] Furthermore, in the SST prediction model construction module, the details are as follows:
[0052] The training set and the initial adjacency matrix are input into the spatiotemporal prediction module, and the model parameters are obtained through training. The spatiotemporal prediction module contains three groups of stacked spatiotemporal blocks, each of which consists of an attention layer, a temporal convolution layer, and a graph convolution layer. The attention layer consists of multiple spatial attention layers, which are used to model spatial dependencies at different time steps. The temporal convolution layer uses dilated convolution to collect temporal features with periodic characteristics. The graph convolution layer consists of two groups of propagation layers, which process the inflow and outflow information through each node respectively. At the same time, residual connections are added to prevent gradient disappearance or gradient explosion.
[0053] Next, the parameters of the spatiotemporal prediction model are set unchanged, and the graph learning module is trained to generate a new adjacency matrix. The graph learning module uses a learnable parameterized adjacency matrix to approximate the spatial correlation between sea surface temperatures. The formula is as follows:
[0054] ;
[0055] in, , Perform Kaiming uniform initialization, , , N is the number of nodes, is the hidden feature dimension; Represents a random number between 0 and 1 that can be learned by N nodes; Diag(Λ) represents the diagonal matrix of Λ; the stored gradient is used to adjust the parameters of the model , and , so that the loss function value changes in the direction of minimization; through the sparsity enhanced by the activation function, and using the adaptive aggregation module to convert the old adjacency matrix and new space Dependency combination, the formula is as follows:
[0056] ;
[0057] ;
[0058] Among them, the graph learning module is in the first round of training process. is the adjacency matrix of the initial input During the cycle training, is the adjacency matrix output by the previous adjacency matrix update module; h is the convolution layer with a convolution kernel of 1 × 1, is an element-by-element multiplication; the sparse adjacency matrix is calculated as follows:
[0059] ;
[0060] in, and is a diagonal matrix, , , is the threshold, filter Weak ties, setting , N is the number of nodes;
[0061] The generated adjacency matrix is added to the adjacency matrix update module. In the adjacency matrix update module, the weighted adjacency matrix is summed to obtain the updated adjacency matrix. The adjacency matrix update module dynamically adjusts the weight of the adjacency matrix through the prediction error, so that the updated adjacency matrix reflects the data space dependency. The prediction loss of each adjacency matrix is calculated and compared with the maximum prediction loss. The weighted sum of all adjacency matrices is used as the updated adjacency matrix, which is re-entered into the spatiotemporal prediction module to enter a new round of model parameter training. Among them, the number of adjacency matrices in the adjacency matrix set is set to an upper limit. Each adjacency matrix in and the processed SST data are input into the trained spatiotemporal prediction module to calculate the corresponding prediction loss. The formula is as follows:
[0062] ;
[0063] in, represents the prediction loss, is the kth adjacency matrix, X represents the input data, Y is the observed value, is the learnable parameter of the STPM module, which combines all prediction losses into a vector , , is the maximum value, weight vector This is determined by the following function:
[0064] ;
[0065] in, The function is defined as:
[0066] ;
[0067] in, Function Compute The difference between each element in and the maximum loss value is mapped into a weight value through an exponential function to quantify the relative importance of each adjacency matrix; the updated adjacency matrix is calculated by the weighted sum of all adjacency matrices and is updated as:
[0068] ;
[0069] in, is the number of adjacency matrices; Normalized by formula.
[0070] Furthermore, in the prediction module, the details are as follows:
[0071] The preprocessed test set is input into the trained model to obtain the prediction results, and the results are denormalized. The formula is as follows:
[0072] ;
[0073] in, Represents the data after model prediction. and are the standard deviation and mean respectively;
[0074] Calculate the error between the denormalized data and the observed values; It is used to calculate the mean absolute error between the predicted and observed values. It is used to calculate the root mean square error between the predicted value and the observed value. Used to calculate the mean absolute percentage error; the calculation formula is:
[0075] ;
[0076] ;
[0077] ;
[0078] in, i , j represents the spatial grid coordinates, K represents the total number of test samples, I represents the total number of grid points in the latitudinal direction, J Indicates the total number of grid points in the longitudinal direction; represents the SST value predicted by the corresponding spatial grid model, Represents the SST observation value of the corresponding spatial grid point.
[0079] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: (1) The training framework of the present invention consists of a spatiotemporal prediction module, a graph learning module and an adjacency matrix update module, and is trained through alternating cycles; (2) The present invention uses a graph learning module to adaptively parameterize the adjacency matrix to approximate the spatial correlation of sea temperature data; (3) The present invention proposes an adjacency matrix update module, which is a module that dynamically calculates the weights of the adjacency matrix by predicting the change in loss. The calculated weighted matrix can more accurately determine the spatial dependency. BRIEF DESCRIPTION OF THE DRAWINGS
[0080] Figure 1 It is the overall implementation flow chart of the present invention;
[0081] Figure 2 It is a structural diagram of the AdapSTGCN prediction model of the present invention;
[0082] Figure 3 It is a structural diagram of the graph learning layer of the present invention. DETAILED DESCRIPTION
[0083] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0084] like Figure 1 As shown, an embodiment of the present invention provides a sea surface temperature prediction method based on an adaptive spatiotemporal graph neural network, comprising the following steps:
[0085] Step 1. Use the optimal interpolation sea temperature OISST dataset provided by the NOAA official website to select the two-dimensional sea surface temperature data of the Bohai Sea and the East China Sea. The experimental data of the present invention uses the optimal interpolation sea temperature OISST dataset provided by the NOAA website, and selects the daily average sea surface temperature data of the Bohai Sea and the East China Sea research areas from January 1, 1983 to December 31, 2023 as the research object. The Bohai Sea dataset covers the area from 37.375°N to 40.875°N and 117.625°E to 121.375°E; the East China Sea dataset covers the area from 27.625°N to 32.125°N and 123.125°E to 126.375°E. The temporal resolution is 1 day and the spatial resolution is 0.25°×0.25°.
[0086] Step 2: Preprocess the collected two-dimensional data set to obtain spatiotemporal data with time coding and the initial adjacency matrix required for model training. Standardize and divide the data to obtain the training set, validation set, and test set. The following steps are included:
[0087] Step 2.1, time-encode the two-dimensional SST data in step 1 and obtain the initial adjacency matrix;
[0088] Step 2.1.1: Time coding: Process the time series collected in step 1. Assume that the time series is , for any time t , the time encoding calculation is as follows:
[0089] ;
[0090] Among them, t is the date information, Indicates that the date is the first day of the corresponding year. The time encoding variable information of this moment Added to SST data After time coding, all SST time series data have time coding information added.
[0091] Step 2.1.2: Calculate the adjacency matrix for the data after temporal coding and embedding in step 2.1.1. To improve the prediction performance of the spatiotemporal prediction module, the Euclidean distance and correlation coefficient between nodes are used to construct the initial adjacency matrix.
[0092] The calculation formula of the Euclidean distance adjacency matrix is as follows:
[0093] ;
[0094] in, represents the distance between node i and node j, is the distance threshold, r is the scaling factor, The correlation coefficient adjacency matrix is obtained by calculating the Pearson correlation coefficient, and the formula is:
[0095] ;
[0096] ;
[0097] in, and are the historical time series vectors of the i-th and j-th nodes respectively, yes and The standard deviation between yes and The covariance between is the threshold value.
[0098] The normalized calculation of the k-th adjacency matrix is as follows:
[0099] ;
[0100] in, yes The matrix after Laplace normalization is: , is a diagonal matrix, .
[0101] After normalization and Perform a merge calculation to obtain the initial adjacency matrix elements , the formula is as follows:
[0102] ;
[0103] in, is a symbolic function, when It takes 1 when it is, otherwise it takes 0.
[0104] Step 2.2: Standardize and divide the data after time encoding and adjacency matrix calculation into training set, validation set, and test set.
[0105] Step 2.2.1: Before model training, the sea surface temperature data was standardized. The standardization process formula is as follows:
[0106] ;
[0107] in, is the mean value of the data, is the standard deviation.
[0108] Step 2.2.2: For the standardized data, divide the entire data set into three subsets in chronological order, with the first 37 years of data as the training set, the next 2 years of data as the validation set, and the last 2 years of data as the test set.
[0109] Step 3: Construct an SST prediction model based on an adaptive spatiotemporal graph convolutional network. Figure 2As shown, the preprocessed two-dimensional training set is sequentially trained by the spatiotemporal prediction module to obtain model parameters; then, a new adjacency matrix is generated by the graph learning module; then the adjacency matrix is added to the adjacency matrix set, and in the adjacency matrix update module, the weighted adjacency matrix is summed to obtain an updated adjacency matrix; finally, the updated adjacency matrix is re-input into the spatiotemporal prediction module, and the optimized model parameters are obtained by alternating and cyclic training. Among them, the SST prediction model consists of three modules: spatiotemporal prediction, graph learning, and adjacency matrix update. Among them, the spatiotemporal prediction module consists of three groups of spatiotemporal blocks (ST blocks), residual connections, and jump connections. Each spatiotemporal block contains an attention layer, a temporal convolution layer, and a graph convolution layer. In order to prevent gradient disappearance and gradient explosion, residual connections are added; the graph learning module approximates the spatial correlation of SST by parameterizing the adjacency matrix; the adjacency matrix update module generates the adjacency matrix that best adapts to the dynamic spatial correlation of SST by weighting. The model obtains the optimal parameters by alternating and cyclic training. It includes the following steps:
[0110] Step 3.1. Input the two-dimensional training set and the initial adjacency matrix preprocessed in step 2 into the spatiotemporal prediction module to train the model parameters. The spatiotemporal prediction module contains three sets of stacked spatiotemporal blocks, each of which consists of an attention layer, a temporal convolution layer, and a graph convolution layer. The attention layer consists of multiple spatial attentions, which are used to model spatial dependencies at different time steps. The temporal convolution layer uses dilated convolution to collect temporal features with periodic characteristics. The graph convolution layer consists of two sets of propagation layers, which process the inflow and outflow information through each node respectively. At the same time, residual connections are added to prevent gradient disappearance or gradient explosion.
[0111] Step 3.1.1: Input the preprocessed two-dimensional training set received in step 3.1 into the attention layer. Use the input matrix To calculate the node attention matrix First, transform the input tensor X from shape Convert to To facilitate subsequent calculations. and Weight the input to generate the query space :
[0112] ;
[0113] in, , The time steps are weighted, Weight channels and time, N is the number of nodes, C is the number of channels, and T is the input time step. The shape of the calculation result is , represents the weighted time step feature of each node. Using weight The input X is weighted by features to obtain the key space K:
[0114] ;
[0115] in, is the feature weighting matrix, is the key space, which represents the feature weight of each node in the time dimension. Multiply, through Activate the function and add the bias term b to finally get the attention matrix between nodes :
[0116] ;
[0117] in, is a learnable value matrix, output The attention matrix shows the attention relationship between different nodes. Weight the input X to get the final output :
[0118] ;
[0119] Among them, the result Contains features that weight the spatial relationships between nodes.
[0120] ;
[0121] in, is the spatial attention matrix, which represents the dependencies between different nodes.
[0122] Step 3.1.2: Input the data passed through step 3.1.1 into the temporal convolution layer to extract the temporal features of the data. In order to extract the deep temporal features in the time series, the temporal convolution layer extracts the temporal features through two one-dimensional dilated convolution layers. Each dilated convolution layer contains four convolution kernels of different scales, namely 1×2, 1×3, 1×6 and 1×7. For a given input sequence, each dilated convolution kernel (where k represents the width of the convolution kernel) is multiplied by the element at the corresponding position of the input sequence, and the sum is used to generate the corresponding feature map. The dilated convolution captures longer-distance temporal dependencies at time t by introducing a dilated factor without increasing the number of parameters:
[0123] ;
[0124] in, represents the dilated convolution operation, sis the index of the convolution kernel. The feature maps from different convolution kernels are combined along the channel dimension through the splicing operation to form the final output sequence Z, as shown below:
[0125] ;
[0126] Finally, the Tanh and Sigmoid activation functions are introduced to output the results of the temporal convolution layer. The temporal convolution layer uses multi-scale convolution operations to fully capture the temporal characteristics of the input sequence.
[0127] Step 3.1.3: Input the data and adjacency matrix from step 3.1.2 into the graph convolution layer to extract the spatial features of the data. To further capture the dependencies between spatial nodes, the graph convolution layer fuses the information of a node with the information of its adjacent nodes. The graph convolution layer passes through two sets of propagation layers PL, each of which inputs the feature map output by the temporal convolution layer, as well as the adjacency matrix or the transpose of the adjacency matrix. This allows the model to handle asymmetric graph structures more flexibly and improves the modeling capabilities of complex graph data.
[0128] Taking the propagation layer PL of the feature map and adjacency matrix output by the input temporal convolution layer as an example, this layer includes two steps: information propagation and linear fitting. The information propagation step is defined as follows:
[0129] ;
[0130] in, is the hidden state of the k-th layer output, usually composed of the k-1th layer β is a hyperparameter used to control the ratio of the original state of the node, β=0.15; The feature map representing the output of the temporal convolutional layer; is the matrix of A after Laplace normalization,
[0131] The linear fitting step is defined as follows:
[0132] ;
[0133] Where K is the propagation depth, is the output hidden state of the graph convolutional layer, , is the linear parameter of the i-th layer.
[0134] Step 3.2: Next, set the parameters of the spatiotemporal prediction model in step 3.1 unchanged, train the graph learning module, and generate a new adjacency matrix. Figure 3 As shown, the graph learning module proposes a method that can calculate the adjacency matrix of spatial nodes that changes adaptively over time during the model training process.
[0135] Since there is a clear causal relationship in SST prediction, that is, temperature changes in one region will lead to changes in another region, the present invention uses a learnable parameterized adjacency matrix to approximate the spatial correlation between sea surface temperatures, as shown below:
[0136] ;
[0137] in, , Perform Kaiming uniform initialization, , , N is the number of nodes, is the hidden feature dimension; Represents a random number between 0 and 1 that can be learned by N nodes; Diag(Λ) represents the diagonal matrix of Λ; the stored gradient is used to adjust the parameters of the model , and , so that the loss function value changes in the direction of minimization; through the sparsity enhanced by the activation function, and using the adaptive aggregation module to convert the old adjacency matrix and new space Dependency combination, the formula is as follows:
[0138] ;
[0139] ;
[0140] Among them, the graph learning module is in the first round of training process. is the adjacency matrix of the initial input During the cycle training, is the adjacency matrix output by the previous adjacency matrix update module; h is the convolution layer with a convolution kernel of 1 × 1, is an element-by-element multiplication; the sparse adjacency matrix is calculated as follows:
[0141] ;
[0142] in, and is a diagonal matrix, , , is the threshold, filter Weak ties, setting , N is the number of nodes;
[0143] Step 3.3: Add the adjacency matrix generated in step 3.2 to the adjacency matrix update module. In the adjacency matrix update module, the weighted adjacency matrix is summed to obtain the updated adjacency matrix. The adjacency matrix update module dynamically adjusts the weight of the adjacency matrix through the prediction error, so that the updated adjacency matrix can accurately reflect the spatial dependency of the data. First, the prediction loss of each adjacency matrix is calculated, and the difference between it and the maximum prediction loss is given to quantify its impact on the prediction result; in turn, the weight is calculated by the Softmax function to reflect the importance of the adjacency matrix; finally, all adjacency matrices are weighted and summed as the updated adjacency matrix, which is re-entered into the spatiotemporal prediction module to enter a new round of model parameter training.
[0144] An upper limit is set for the number of adjacency matrices in the adjacency matrix set. The adjacency matrix with the largest prediction loss will be replaced by the adjacency matrix generated by the graph learning module in the next round of model training to ensure that the number of matrices in the adjacency matrix set does not exceed the set upper limit.
[0145] First, each adjacency matrix and the processed SST data are input into the trained spatiotemporal prediction module to calculate the corresponding prediction loss. The formula is as follows:
[0146] ;
[0147] in, represents the prediction loss, is the kth adjacency matrix, X represents the input data, Y is the observed value, is the learnable parameter of the STPM module, which combines all prediction losses into a vector , , is the maximum value, weight vector This is determined by the following function:
[0148] ;
[0149] in, The function is defined as:
[0150] ;
[0151] in, Function Compute The difference between each element in and the maximum loss value is mapped into a weight value through an exponential function to quantify the relative importance of each adjacency matrix; the updated adjacency matrix is calculated by the weighted sum of all adjacency matrices and is updated as:
[0152] ;
[0153] in, is the number of adjacency matrices; Normalized by formula. In each round of model parameter training, the weights of the adjacency matrix are gradually optimized through the above steps to improve the prediction performance of the model.
[0154] Step 4: Input the two-dimensional test set into the trained model for prediction, perform denormalization on the result, and calculate the prediction error with the observed value.
[0155] Step 4.1: Input the two-dimensional test set preprocessed in step 2 into the trained model to obtain the prediction results, and perform denormalization on the results. The formula is as follows:
[0156] ;
[0157] in, Represents the data after model prediction. and are the standard deviation and mean respectively;
[0158] Step 4.2, calculate the error between the de-standardized data and the observed value in step 4.1; It is used to calculate the mean absolute error between the predicted and observed values. It is used to calculate the root mean square error between the predicted value and the observed value. Used to calculate the mean absolute percentage error; the calculation formula is:
[0159] ;
[0160] ;
[0161] ;
[0162] in, i , j represents the spatial grid coordinates, K Represents the total number of test samples, I represents the total number of grid points in the latitudinal direction, J Indicates the total number of grid points in the longitudinal direction; represents the SST value predicted by the corresponding spatial grid model, Represents the SST observation value of the corresponding spatial grid point.
[0163] In a specific embodiment of the present invention, the optimal interpolation sea temperature OISST data provided by the National Oceanic and Atmospheric Administration (NOAA) of the United States is selected as the research object. The present invention uses data from January 1, 1983 to December 31, 2019 as a training set, and data from January 1, 2020 to December 31, 2021 as a validation set to predict future sea surface temperature data. The prediction results are shown in Tables 1 and 2, and the following indicators are used for evaluation; when other conditions of the model are the same, the model proposed by the present invention is compared with MGCN and STAGCN to predict future sea surface temperature data. The results of the comparative experiments based on the above indicators are shown in Tables 1 and 2.
[0164] Table 1 Error statistics of sea surface temperature prediction in the East China Sea
[0165] ;
[0166] Table 2 Error statistics of sea surface temperature prediction in Bohai Sea area
[0167] ;
[0168] It can be seen from Tables 1 and 2 that, no matter in the East China Sea or the Bohai Sea, the A_RMSE, A_MAE and A_MAPE values of the proposed prediction model on the test set are the smallest, which fully confirms the prediction advantage of the present invention.
[0169] The embodiment of the present invention also provides a sea surface temperature prediction system based on an adaptive spatiotemporal graph neural network, comprising:
[0170] Acquisition module: used to use the optimal interpolation sea temperature OISST data set provided by NOAA official website to select the two-dimensional sea surface temperature data of Bohai Sea and East China Sea;
[0171] Preprocessing module: used to preprocess the collected two-dimensional data set to obtain spatiotemporal data with time coding and the initial adjacency matrix; and divide it into training set, validation set and test set; the details are as follows:
[0172] The spatiotemporal data are time-coded according to the year cycle; the initial adjacency matrix is constructed by calculating the Euclidean distance and Pearson correlation coefficient to provide a structured graphical representation for the time series data of sea surface temperature;
[0173] The input two-dimensional SST data is standardized and divided into training set, validation set and test set.
[0174] SST prediction model construction module: used to construct an SST prediction model based on an adaptive spatiotemporal graph convolutional network; wherein the SST prediction model includes: a spatiotemporal prediction module, a graph learning module, and an adjacency matrix update module; specifically as follows: the preprocessed training set is trained in turn through the spatiotemporal prediction module to obtain model parameters; then, a new adjacency matrix is generated through the graph learning module; then, the generated new adjacency matrix is added to the adjacency matrix update module, and in the adjacency matrix update module, the weighted adjacency matrix is summed to obtain an updated adjacency matrix; finally, the updated adjacency matrix is re-input into the spatiotemporal prediction module, and the training is repeated alternately in turn to obtain the optimal model parameters; wherein, the spatiotemporal prediction module consists of three groups of spatiotemporal blocks ST block, residual connection and skip connection; each spatiotemporal block contains an attention layer, a temporal convolution layer, a graph convolution layer and a residual connection.
[0175] The details are as follows:
[0176] The training set and the initial adjacency matrix are input into the spatiotemporal prediction module, and the model parameters are obtained through training. The spatiotemporal prediction module contains three groups of stacked spatiotemporal blocks, each of which consists of an attention layer, a temporal convolution layer, and a graph convolution layer. The attention layer consists of multiple spatial attention layers, which are used to model spatial dependencies at different time steps. The temporal convolution layer uses dilated convolution to collect temporal features with periodic characteristics. The graph convolution layer consists of two groups of propagation layers, which process the inflow and outflow information through each node respectively. At the same time, residual connections are added to prevent gradient disappearance or gradient explosion.
[0177] Next, the parameters of the spatiotemporal prediction model are set unchanged, and the graph learning module is trained to generate a new adjacency matrix. The graph learning module uses a learnable parameterized adjacency matrix to approximate the spatial correlation between sea surface temperatures. The formula is as follows:
[0178] ;
[0179] in, , Perform Kaiming uniform initialization, , , N is the number of nodes, is the hidden feature dimension; Represents a random number between 0 and 1 that can be learned by N nodes; Diag(Λ) represents the diagonal matrix of Λ; the stored gradient is used to adjust the parameters of the model , and , so that the loss function value changes in the direction of minimization; through the sparsity enhanced by the activation function, and using the adaptive aggregation module to convert the old adjacency matrix and new space Dependency combination, the formula is as follows:
[0180] ;
[0181] ;
[0182] Among them, the graph learning module is in the first round of training process. is the adjacency matrix of the initial input During the cycle training, is the adjacency matrix output by the previous adjacency matrix update module; h is the convolution layer with a convolution kernel of 1 × 1, is an element-by-element multiplication; the sparse adjacency matrix is calculated as follows:
[0183] ;
[0184] in, and is a diagonal matrix, , , is the threshold, filter Weak ties, setting , N is the number of nodes;
[0185] The generated adjacency matrix is added to the adjacency matrix update module. In the adjacency matrix update module, the weighted adjacency matrix is summed to obtain the updated adjacency matrix. The adjacency matrix update module dynamically adjusts the weight of the adjacency matrix through the prediction error, so that the updated adjacency matrix reflects the data space dependency. The prediction loss of each adjacency matrix is calculated and compared with the maximum prediction loss. The weighted sum of all adjacency matrices is used as the updated adjacency matrix, which is re-entered into the spatiotemporal prediction module to enter a new round of model parameter training. Among them, the number of adjacency matrices in the adjacency matrix set is set to an upper limit. Each adjacency matrix in and the processed SST data are input into the trained spatiotemporal prediction module to calculate the corresponding prediction loss. The formula is as follows:
[0186] ;
[0187] in, represents the prediction loss, is the kth adjacency matrix, X represents the input data, Y is the observed value, is the learnable parameter of the STPM module, which combines all prediction losses into a vector , , is the maximum value, weight vector This is determined by the following function:
[0188] ;
[0189] in, The function is defined as:
[0190] ;
[0191] in, Function Compute The difference between each element in and the maximum loss value is mapped into a weight value through an exponential function to quantify the relative importance of each adjacency matrix; the updated adjacency matrix is calculated by the weighted sum of all adjacency matrices and is updated as:
[0192] ;
[0193] in, is the number of adjacency matrices; Normalized by formula.
[0194] Prediction module: used to input the test set into the trained model for prediction, denormalize the result, and calculate the prediction error with the observed value. The details are as follows:
[0195] The preprocessed test set is input into the trained model to obtain the prediction results, and the results are denormalized. The formula is as follows:
[0196] ;
[0197] in, Represents the data after model prediction. and are the standard deviation and mean respectively;
[0198] Calculate the error between the denormalized data and the observed values; It is used to calculate the mean absolute error between the predicted and observed values. It is used to calculate the root mean square error between the predicted value and the observed value. Used to calculate the mean absolute percentage error; the calculation formula is:
[0199] ;
[0200] ;
[0201] ;
[0202] in, i , j represents the spatial grid coordinates, K Represents the total number of test samples, I represents the total number of grid points in the latitudinal direction, J Indicates the total number of grid points in the longitudinal direction; represents the SST value predicted by the corresponding spatial grid model, Represents the SST observation value of the corresponding spatial grid point.
Claims
1. A sea surface temperature prediction method based on an adaptive spatiotemporal graph neural network, characterized in that: The following steps are involved: (1) The optimal interpolation sea surface temperature (OISST) dataset provided by NOAA's official website was used to select the two-dimensional sea surface temperature data of the Bohai Sea and the East China Sea; (2) Preprocess the collected two-dimensional data set to obtain spatiotemporal data with time coding and the initial adjacency matrix; And divide it into training set, validation set and test set; including the following steps: (21) Time-coding the spatiotemporal data according to the year cycle; constructing the initial adjacency matrix through Euclidean distance and Pearson correlation coefficient calculation to provide a structured graphical representation for the time series data of sea surface temperature; (22) Standardizing the input two-dimensional SST data and dividing the standardized two-dimensional data into a training set, a validation set, and a test set; (3) Construct an SST prediction model based on an adaptive spatiotemporal graph convolutional network; wherein the SST prediction model includes: a spatiotemporal prediction module, a graph learning module, and an adjacency matrix update module; specifically, the preprocessed training set is sequentially trained through the spatiotemporal prediction module to obtain model parameters; then, a new adjacency matrix is generated through the graph learning module; then, the generated new adjacency matrix is added to the adjacency matrix update module, and in the adjacency matrix update module, the weighted adjacency matrix is summed to obtain an updated adjacency matrix; finally, the updated adjacency matrix is re-input into the spatiotemporal prediction module, and the training is repeated alternately to obtain the optimal model parameters; wherein the spatiotemporal prediction module consists of three groups of spatiotemporal blocks ST blocks, residual connections, and skip connections; each spatiotemporal block contains an attention layer, a temporal convolution layer, a graph convolution layer, and a residual connection; including the following steps: (31) The training set and the initial adjacency matrix are input into the spatiotemporal prediction module to train the model parameters; the spatiotemporal prediction module contains three groups of stacked spatiotemporal blocks, each of which consists of an attention layer, a temporal convolution layer, and a graph convolution layer; the attention layer consists of multiple spatial attention layers, which are used to model the spatial dependencies at different time steps; the temporal convolution layer uses a dilated convolution to collect temporal features with periodic characteristics; the graph convolution layer consists of two groups of propagation layers, which process the inflow and outflow information of each node respectively; at the same time, a residual connection is added; (32) Next, the parameters of the spatiotemporal prediction model in step (31) are set unchanged, and the graph learning module is trained to generate a new adjacency matrix; wherein the graph learning module uses a learnable parameterized adjacency matrix to approximate the spatial correlation between sea surface temperatures, and the formula is as follows: ; in, , Perform Kaiming uniform initialization, , , N is the number of nodes, is the hidden feature dimension; Represents a random number between 0 and 1 that can be learned by N nodes; Diag(Λ) represents the diagonal matrix of Λ; the stored gradient is used to adjust the parameters of the model , and , so that the loss function value changes in the direction of minimization; through the sparsity enhanced by the activation function, and using the adaptive aggregation module to convert the old adjacency matrix and new space Dependency combination, the formula is as follows: ; ; Among them, the graph learning module is in the first round of training process. is the adjacency matrix of the initial input During the cycle training, is the adjacency matrix output by the previous adjacency matrix update module; h is the convolution layer with a convolution kernel of 1 × 1, is an element-by-element multiplication; the sparse adjacency matrix is calculated as follows: ; in, and is a diagonal matrix, , , is the threshold, filter Weak ties, setting , N is the number of nodes; (33) Add the adjacency matrix generated in step (32) to the adjacency matrix update module. In the adjacency matrix update module, the weighted adjacency matrix is summed to obtain the updated adjacency matrix. The adjacency matrix update module dynamically adjusts the weight of the adjacency matrix through the prediction error so that the updated adjacency matrix reflects the data space dependency. The prediction loss of each adjacency matrix is calculated and compared with the maximum prediction loss. The weighted sum of all adjacency matrices is used as the updated adjacency matrix and re-entered into the spatiotemporal prediction module to enter a new round of model parameter training. The number of adjacency matrices in the adjacency matrix set is set to an upper limit. Each adjacency matrix in and the processed SST data are input into the trained spatiotemporal prediction module to calculate the corresponding prediction loss. The formula is as follows: ; in, represents the prediction loss, is the kth adjacency matrix, X represents the input data, Y is the observed value, is the learnable parameter of the STPM module, which combines all prediction losses into a vector , , is the maximum value, weight vector This is determined by the following function: ; in, The function is defined as: ; in, Function Compute The difference between each element in and the maximum loss value is mapped into a weight value through an exponential function to quantify the relative importance of each adjacency matrix; the updated adjacency matrix is calculated by the weighted sum of all adjacency matrices and is updated as: ; in, is the number of adjacency matrices; Normalized by formula; (4) The test set is input into the trained model for prediction, and the result is denormalized and the prediction error is calculated with the observed value.
2. The method for predicting sea surface temperature based on an adaptive spatiotemporal graph neural network according to claim 1, characterized in that: Step (4) is as follows: (41) Input the two-dimensional test set preprocessed in step (2) into the trained model to obtain the prediction results, and perform denormalization on the results. The formula is as follows: ; in, Represents the data after model prediction. and are the standard deviation and mean respectively; (42) Calculate the error between the denormalized data and the observed values; It is used to calculate the mean absolute error between the predicted and observed values. It is used to calculate the root mean square error between the predicted value and the observed value. Used to calculate the mean absolute percentage error; the calculation formula is: ; ; ; in, i , j represents the spatial grid coordinates, K Represents the total number of test samples, I represents the total number of grid points in the latitudinal direction, J Indicates the total number of grid points in the longitudinal direction; represents the SST value predicted by the corresponding spatial grid model, Represents the SST observation value of the corresponding spatial grid point.
3. A sea surface temperature prediction system based on an adaptive spatiotemporal graph neural network, characterized in that: include: Acquisition module: used to use the optimal interpolation sea temperature OISST data set provided by NOAA official website to select the two-dimensional sea surface temperature data of Bohai Sea and East China Sea; Preprocessing module: used to preprocess the collected two-dimensional data set to obtain spatiotemporal data with time coding and the initial adjacency matrix; and divide it into training set, validation set and test set; the details are as follows: The spatiotemporal data are time-coded according to the year cycle; the initial adjacency matrix is constructed by calculating the Euclidean distance and Pearson correlation coefficient to provide a structured graphical representation for the time series data of sea surface temperature; Standardize the input two-dimensional SST data and divide the standardized two-dimensional data into training set, validation set and test set; SST prediction model construction module: used to construct an SST prediction model based on an adaptive spatiotemporal graph convolutional network; wherein the SST prediction model includes: a spatiotemporal prediction module, a graph learning module, and an adjacency matrix update module; specifically as follows: the preprocessed training set is sequentially trained through the spatiotemporal prediction module to obtain model parameters; then, a new adjacency matrix is generated through the graph learning module; then, the generated new adjacency matrix is added to the adjacency matrix update module, and in the adjacency matrix update module, the weighted adjacency matrix is summed to obtain an updated adjacency matrix; finally, the updated adjacency matrix is re-input into the spatiotemporal prediction module, and the training is alternately cycled to obtain the optimal model parameters; wherein, the spatiotemporal prediction module consists of three groups of spatiotemporal blocks ST block, residual connection and skip connection; each spatiotemporal block contains an attention layer, a temporal convolution layer, a graph convolution layer and a residual connection; specifically as follows: The training set and the initial adjacency matrix are input into the spatiotemporal prediction module to train the model parameters. The spatiotemporal prediction module contains three groups of stacked spatiotemporal blocks, each of which consists of an attention layer, a temporal convolution layer, and a graph convolution layer. The attention layer consists of multiple spatial attentions, which are used to model spatial dependencies at different time steps. The temporal convolution layer uses dilated convolution to collect temporal features with periodic characteristics. The graph convolution layer consists of two groups of propagation layers, which process the inflow and outflow information of each node respectively. At the same time, residual connections are added. Next, the parameters of the spatiotemporal prediction model are set unchanged, and the graph learning module is trained to generate a new adjacency matrix. The graph learning module uses a learnable parameterized adjacency matrix to approximate the spatial correlation between sea surface temperatures. The formula is as follows: ; in, , Perform Kaiming uniform initialization, , , N is the number of nodes, is the hidden feature dimension; Represents a random number between 0 and 1 that can be learned by N nodes; Diag(Λ) represents the diagonal matrix of Λ; the stored gradient is used to adjust the parameters of the model , and , so that the loss function value changes in the direction of minimization; through the sparsity enhanced by the activation function, and using the adaptive aggregation module to convert the old adjacency matrix and new space Dependency combination, the formula is as follows: ; ; Among them, the graph learning module is in the first round of training process. is the adjacency matrix of the initial input During the cycle training, is the adjacency matrix output by the previous adjacency matrix update module; h is the convolution layer with a convolution kernel of 1 × 1, is an element-by-element multiplication; the sparse adjacency matrix is calculated as follows: ; in, and is a diagonal matrix, , , is the threshold, filter Weak ties, setting , N is the number of nodes; The generated adjacency matrix is added to the adjacency matrix update module. In the adjacency matrix update module, the weighted adjacency matrix is summed to obtain the updated adjacency matrix. The adjacency matrix update module dynamically adjusts the weight of the adjacency matrix through the prediction error, so that the updated adjacency matrix reflects the data space dependency. The prediction loss of each adjacency matrix is calculated and compared with the maximum prediction loss. The weighted sum of all adjacency matrices is used as the updated adjacency matrix, which is re-entered into the spatiotemporal prediction module to enter a new round of model parameter training. Among them, the number of adjacency matrices in the adjacency matrix set is set to an upper limit. Each adjacency matrix in and the processed SST data are input into the trained spatiotemporal prediction module to calculate the corresponding prediction loss. The formula is as follows: ; in, represents the prediction loss, is the kth adjacency matrix, X represents the input data, Y is the observed value, is the learnable parameter of the STPM module, which combines all prediction losses into a vector , , is the maximum value, weight vector This is determined by the following function: ; in, The function is defined as: ; in, Function Compute The difference between each element in and the maximum loss value is mapped into a weight value through an exponential function to quantify the relative importance of each adjacency matrix; the updated adjacency matrix is calculated by the weighted sum of all adjacency matrices and is updated as: ; in, is the number of adjacency matrices; Normalized by formula; Prediction module: used to input the test set into the trained model for prediction, denormalize the results, and calculate the prediction error with the observed values.
4. The sea surface temperature prediction system based on adaptive spatiotemporal graph neural network according to claim 3 is characterized in that: In the prediction module, the details are as follows: The preprocessed test set is input into the trained model to obtain the prediction results, and the results are denormalized. The formula is as follows: ; in, Represents the data after model prediction. and are the standard deviation and mean respectively; Calculate the error between the denormalized data and the observed values; It is used to calculate the mean absolute error between the predicted and observed values. It is used to calculate the root mean square error between the predicted value and the observed value. Used to calculate the mean absolute percentage error; the calculation formula is: ; ; ; in, i , j represents the spatial grid coordinates, K represents the total number of test samples, I represents the total number of grid points in the latitudinal direction, J Indicates the total number of grid points in the longitudinal direction; represents the SST value predicted by the corresponding spatial grid model, Represents the SST observation value of the corresponding spatial grid point.
Citation Information
Patent Citations
Sea surface temperature prediction-oriented graph space-time sampling aggregation network
CN118964867A