A medium- and long-term ocean wave significant wave height prediction method based on EmaDformer
Through the dual attention mechanism and linear module of the EmaDformer model, combined with exponential moving average and dynamic projection technology, the problem of long-term time dependence and local information capture of effective waves in ocean waves is solved, and the prediction accuracy and accuracy are improved.
Patent Information
- Application Number
- CN202410798770.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-06-20
AI Technical Summary
The existing technology cannot effectively capture the long-term time dependence and local information of the effective waves of sea waves, resulting in insufficient prediction accuracy and ignoring the impact of relevant features on target features.
Using the dual attention enhancement model based on EmaDformer, through the multi-head dual attention mechanism and linear module, combined with exponential moving average and dynamic projection technology, local time series characteristics and time series trend information are captured to build a medium- and long-term effective wave height prediction method for sea waves.
It significantly improves the mid- and long-term prediction performance and improves the prediction accuracy, allowing the model to better capture local information and time series change trends.
Smart Images

Figure CN118364230B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of time series prediction, and in particular to a medium- and long-term ocean wave significant wave height prediction method based on EmaDformer. Background Art
[0002] Wave height is one of the most important parameters of ocean waves. Its accurate prediction not only plays an important role in underwater engineering and coastal protection engineering, but also provides an important reference for the efficient use of wave energy. Extending the prediction time of significant wave height (SWH) is a key requirement for practical applications such as extreme weather warning and long-term energy consumption planning. Therefore, the medium- and long-term prediction accuracy of significant wave height needs to be improved urgently.
[0003] The traditional wave height numerical prediction model has a complex calculation process and a long running time. Its principle is to obtain information such as wave height and period by combining a hybrid method of physical simulation and data-driven prediction. Numerical models include the nearshore wave simulation SWAN model, the WAM model based on the principle of energy conservation, and the numerical wave model WAVEWATCHⅢ (WW3). Due to the nonlinear and non-stationary characteristics of ocean waves, these methods cannot achieve high prediction accuracy. Summary of the invention
[0004] Purpose of the invention: The purpose of the present invention is to provide a medium- and long-term ocean wave significant wave height prediction method based on EmaDformer, which solves the problem that the current significant wave height prediction method cannot capture the dependency relationship between local information and time series trend information, as well as the problem that it ignores the influence of related features on target features and cannot capture medium- and long-term time dependencies.
[0005] Technical solution: The method for predicting the medium- and long-term ocean wave significant wave height based on EmaDformer described in the present invention comprises the following steps:
[0006] (1) Use the ERA5 reanalysis dataset to obtain significant wave height data and other environmental ocean data, and perform preprocessing to obtain a time series dataset;
[0007] (2) The principal component analysis (PCA) method is used to calculate the cumulative contribution rate of marine environmental data and set the cumulative contribution rate threshold to obtain the processed time series data set;
[0008] (3) Construct a dual attention enhancement model, namely the EmaDformer model, and train it to obtain the effective wave height prediction results;
[0009] (4) Denormalize the prediction results to obtain the predicted effective wave height.
[0010] Furthermore, in step (1), firstly, the effective wave height data of three points in the East China Sea and three points in the South China Sea are selected, with a time resolution of 1 h and a spatial resolution of 0.5°×0.5°; other marine environmental data include: 10 m wind latitudinal component, longitudinal component, sea surface temperature, average wave period, atmospheric pressure, sea level pressure, average wave direction, with a time resolution of 1 h and a spatial resolution of 0.5°×0.5°; and then normalization is performed.
[0011] Furthermore, in step (2), if the calculated cumulative contribution rate is lower than the cumulative contribution rate threshold, it is deleted; otherwise, it is retained; the final data set includes: effective wave height, latitudinal and longitudinal components of 10m wind.
[0012] Furthermore, step (3) is specifically as follows: the EmaDformer model includes an encoder and a decoder; wherein the encoder includes a multi-head dual attention module, a linear module and a feedforward neural network module; the decoder includes a masked multi-head dual attention module, a multi-head dual attention module, a linear module and a feedforward neural network module; the prediction data set is divided into a training set, a validation set and a test set in a ratio of 7:1:2, and training is performed.
[0013] Furthermore, step (3) includes the following steps:
[0014] (31) Use sine and cosine functions of different frequencies for position encoding, then add the position encoding result to the input sequence and perform layer normalization, and then use it as the input of the encoder and decoder;
[0015] (32) The position-encoded data is input into the encoder, where the multi-head dual attention module is used to obtain the dependency between local time series features and obtain local information to improve the medium- and long-term prediction performance; it includes a multi-head self-attention mechanism and a multi-head EmaD attention mechanism; where the multi-head self-attention mechanism is used to obtain the relationship between time series data values and extract the complete information in the time series. The formula is as follows:
[0016] ;
[0017] ;
[0018] in, Indicates multiple attentions, Indicates The attention of a head, Indicates The query vector of the head, Indicates The key vector of the head, Indicates The value vector of heads, h represents the total number of heads, The final mapped weight matrix, represents the connection function;
[0019] in, The formula is as follows:
[0020] ;
[0021] in, represents the query vector, represents the key vector, represents a value vector, represents dimension, T represents transpose;
[0022] The multi-head EmaD attention mechanism is used to obtain the correlation between signals and the dynamic dependency between multiple features, including an exponential moving average module and a dynamic projection module; the formula of the exponential moving average module is as follows:
[0023] Let the input sequence be ,but:
[0024] ;
[0025] in, represents the parameter of weight reduction, As the output result, Output results for history;
[0026] The dynamic projection module formula is as follows:
[0027] ;
[0028] in, Represents the result after exponential sliding average, , represents the length of the input sequence, represents the input feature dimension, , Represents the model dimension, , , and represents the learnable parameters of the multilayer perceptron, Represents operations on matrix multiplication, addition, and transposition to obtain a new and matrix;
[0029] but:
[0030] ;
[0031] ;
[0032] in, Indicates The attention of a head, Indicates The query vector after the head is calculated by the exponential sliding average function, Indicates The key vectors of the heads are calculated by dynamic projection and exponential sliding average function respectively. Indicates The value vector of heads calculated by dynamic projection technology, h represents the total number of heads, The final mapped weight matrix, represents the connection function;
[0033] The Projection module is introduced to directly add the results of multi-head dual attention, including two layers of perceptrons, GeLU activation function layer and layer normalization. The formula is as follows:
[0034] ;
[0035] in, To output the result, and is the learnable parameter of the first layer perceptron, and are the learnable parameters of the second layer perceptron;
[0036] The linear module is used to establish linear relationships and trends between time series and obtain long-term dependencies in the data. The formula is as follows:
[0037] ;
[0038] ;
[0039] in, represents the input sequence matrix, Represents dimension flip; represents the learnable weight matrix, To output the result;
[0040] The feedforward neural network module is used to obtain the mapping relationship between input and output, including two sets of linear transformations and the ReLU function between the two sets of linear transformations;
[0041] (33) The encoded data is decoded by a decoder, wherein the masked multi-head dual attention module is used to mask the decoder input sequence; the multi-head dual attention module is used to obtain the dependency between local time series features and obtain local information, the linear module is used to obtain the long-term trend dependency in the time series, and the feedforward neural network module is used to obtain the mapping relationship between input and output.
[0042] Furthermore, in step (4), the denormalization formula is as follows:
[0043] ;
[0044] in, represents the predicted data after denormalization, is the maximum value of the data, is the minimum value of the data, Predict data for the EmaDformer model.
[0045] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: the exponential moving average function (EMA) and dynamic projection technology (DP) are applied to the query, keyword and value matrices to form EmaD attention. Compared with the original attention in Transformer, the dual attention mechanism can capture the dependency between local time series features, thereby better capturing local information and improving medium- and long-term prediction performance; linear modules are added to both the encoder and the decoder, and the linear modules are combined with each module in EmaDformer. The model can use the linear modules to capture the trend information after the output of each time step, learn more data change trends, and significantly improve the model prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is the system principle diagram of the present invention;
[0047] Figure 2 is a structural diagram of the EmaDformer of the present invention;
[0048] Figure 3 4 is a structural diagram of the dual attention module in the EmaDformer of the present invention. DETAILED DESCRIPTION
[0049] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.
[0050] like Figure 1 As shown, an embodiment of the present invention provides a method for predicting the medium- and long-term ocean wave significant wave height based on EmaDformer, comprising the following steps:
[0051] (1) The ERA5 reanalysis dataset was used to obtain significant wave height data and other environmental ocean data, and preprocessed to obtain a time series dataset. First, the significant wave height data of three points in the East China Sea and three points in the South China Sea were selected, with a temporal resolution of 1 h and a spatial resolution of 0.5°×0.5°. Other marine environmental data included: 10 m wind latitudinal component, meridional component, sea surface temperature, mean wave period, atmospheric pressure, sea level pressure, mean wave direction, with a temporal resolution of 1 h and a spatial resolution of 0.5°×0.5°. Then, normalization was performed.
[0052] (2) The principal component analysis (PCA) method is used to calculate the cumulative contribution rate of the marine environmental data, and a cumulative contribution rate threshold is set to obtain the processed time series data set. If the calculated cumulative contribution rate is lower than the cumulative contribution rate threshold, it will be deleted; otherwise, it will be retained. The final data set includes: effective wave height, latitudinal and longitudinal components of 10m wind.
[0053] (3) Construct a dual attention enhancement model, namely the EmaDformer model, and train it to obtain the evaluation index value and effective wave height prediction results; Figure 2 As shown, the details are as follows: the EmaDformer model includes an encoder and a decoder; the encoder includes a multi-head dual attention module, a linear module and a feedforward neural network module; the decoder includes a masked multi-head dual attention module, a multi-head dual attention module, a linear module and a feedforward neural network module; the prediction data set is divided into a training set, a validation set and a test set in a ratio of 7:1:2, and training is performed. The following steps are included:
[0054] (31) Use sine and cosine functions of different frequencies for position encoding, then add the position encoding result to the input sequence and perform layer normalization, and then use it as the input of the encoder and decoder;
[0055] (32) The position-encoded data is input into the encoder, where Figure 3 As shown in the figure, the multi-head dual attention module is used to obtain the dependency between local time series features and obtain local information to improve the medium- and long-term prediction performance; it includes a multi-head self-attention mechanism and a multi-head EmaD attention mechanism; among them, the multi-head self-attention mechanism is used to obtain the relationship between time series data values and extract complete information in the time series. The formula is as follows:
[0056] ;
[0057] ;
[0058] in, Indicates multiple attentions, Indicates The attention of a head, Indicates The query vector of the head, Indicates The key vector of the head, Indicates The value vector of heads, h represents the total number of heads, The final mapped weight matrix, represents the connection function;
[0059] in, The formula is as follows:
[0060] ;
[0061] in, represents the query vector, represents the key vector, represents a value vector, represents dimension, T represents transpose;
[0062] The multi-head EmaD attention mechanism is used to obtain the correlation between signals and the dynamic dependency between multiple features, including an exponential moving average module and a dynamic projection module; the formula of the exponential moving average module is as follows:
[0063] Let the input sequence be ,but:
[0064] ;
[0065] in, represents the parameter of weight reduction, As the output result, Output results for history;
[0066] The dynamic projection module formula is as follows:
[0067] ;
[0068] in, Represents the result after exponential sliding average, , represents the length of the input sequence, represents the input feature dimension, , Represents the model dimension, , , and represents the learnable parameters of the multilayer perceptron, Represents operations on matrix multiplication, addition, and transposition to obtain a new and matrix;
[0069] but:
[0070] ;
[0071] ;
[0072] in, Indicates The attention of a head, Indicates The query vector after the head is calculated by the exponential sliding average function, Indicates The key vectors of the heads are calculated by dynamic projection and exponential sliding average function respectively. Indicates The value vector of heads calculated by dynamic projection technology, h represents the total number of heads, The final mapped weight matrix, represents the connection function;
[0073] The Projection module is introduced to directly add the results of multi-head dual attention, including two layers of perceptrons, GeLU activation function layer and layer normalization. The formula is as follows:
[0074] ;
[0075] in, To output the result, and is the learnable parameter of the first layer perceptron, and are the learnable parameters of the second layer perceptron;
[0076] The linear module is used to establish linear relationships and trends between time series and obtain long-term dependencies in the data. The formula is as follows:
[0077] ;
[0078] ;
[0079] in, represents the input sequence matrix, Represents dimension flip; represents the learnable weight matrix, To output the result;
[0080] The feedforward neural network module is used to obtain the mapping relationship between input and output, including two sets of linear transformations and the ReLU function between the two sets of linear transformations;
[0081] (33) The encoded data is decoded by a decoder, wherein the masked multi-head dual attention module is used to mask the decoder input sequence; the multi-head dual attention module is used to obtain the dependency between local time series features and obtain local information, the linear module is used to obtain the long-term trend dependency in the time series, and the feedforward neural network module is used to obtain the mapping relationship between input and output, thereby improving the model's expressiveness and better capturing local information.
[0082] (4) Denormalize the prediction results to obtain the predicted effective wave height. The denormalization formula is as follows:
[0083] ;
[0084] in, represents the predicted data after denormalization, is the maximum value of the data, is the minimum value of the data, Predict data for the EmaDformer model.
[0085] The present invention selects 4 deep learning models to compare with the present invention model and calculates the root mean square error (RMSE) and mean absolute error (MAE) of each model at three points E1, E2 and E3 in the East China Sea test set and three points S1, S2 and S3 in the South China Sea test set. The longitude and latitude values are E1 (124°E, 31°N), E2 (131°E, 25°N) and E3 (120°E, 24°N), S1 (116°E, 18°N), S2 (119°E, 13°N) and S3 (121°E, 20°N). As shown in Tables 1 and 2. The results show that the predicted values obtained by the present invention model at all locations are closer to the observed values than other models, and good prediction performance is achieved.
[0086] Table 1 Evaluation indicators of different models at observation points in the East China Sea
[0087]
[0088] Table 2 Evaluation indicators of different models at observation points in the South China Sea
[0089] .
Claims
1. A medium- and long-term ocean wave significant wave height prediction method based on EmaDformer, characterized in that: The following steps are involved: (1) Use the ERA5 reanalysis dataset to obtain significant wave height data and other environmental ocean data, and perform preprocessing to obtain a time series dataset; (2) The principal component analysis (PCA) method is used to calculate the cumulative contribution rate of marine environmental data and set the cumulative contribution rate threshold to obtain the processed time series data set; (3) A dual attention enhancement model, namely the EmaDformer model, is constructed and trained to obtain the effective wave height prediction results; specifically, the EmaDformer model includes an encoder and a decoder; the encoder includes a multi-head dual attention module, a linear module and a feedforward neural network module; the decoder includes a masked multi-head dual attention module, a multi-head dual attention module, a linear module and a feedforward neural network module; the prediction data set is divided into a training set, a validation set and a test set in a ratio of 7:1:2, and training is performed; the following steps are included: (31) Use sine and cosine functions of different frequencies for position encoding, then add the position encoding result to the input sequence and perform layer normalization, and then use it as the input of the encoder and decoder; (32) The position-encoded data is input into the encoder, wherein the multi-head dual attention module is used to obtain the dependency between local time series features and obtain local information; it includes a multi-head self-attention mechanism and a multi-head EmaD attention mechanism; wherein the multi-head self-attention mechanism is used to obtain the relationship between the values of the time series data and extract the complete information in the time series, and the formula is as follows: ; ; in, Indicates multiple attentions, Indicates The attention of a head, Indicates The query vector of the head, Indicates The key vector of the head, Indicates The value vector of heads, h represents the total number of heads, The final mapped weight matrix, represents the connection function; in, The formula is as follows: ; in, represents the query vector, represents the key vector, represents a value vector, represents dimension, T represents transpose; The multi-head EmaD attention mechanism is used to obtain the correlation between signals and the dynamic dependencies between multiple features, including an exponential moving average module and a dynamic projection module; the formula of the exponential moving average module is as follows: Let the input sequence be ,but: ; in, represents the parameter of weight reduction, As the output result, Output results for history; The dynamic projection module formula is as follows: ; in, Represents the result after exponential sliding average, , represents the length of the input sequence, represents the input feature dimension, , Represents the model dimension, , , and represents the learnable parameters of the multilayer perceptron, Represents operations on matrix multiplication, addition, and transposition to obtain a new and matrix; but: ; ; in, Indicates The attention of a head, Indicates The query vector after the head is calculated by the exponential sliding average function, Indicates The key vectors of the heads are calculated by dynamic projection and exponential sliding average function respectively. Indicates The value vector of heads calculated by dynamic projection technology, h represents the total number of heads, The final mapped weight matrix, represents the connection function; The Projection module is introduced to directly add the results of multi-head dual attention, including two layers of perceptrons, GeLU activation function layer and layer normalization. The formula is as follows: ; in, To output the result, and is the learnable parameter of the first layer perceptron, and are the learnable parameters of the second layer perceptron; The linear module is used to establish linear relationships and trends between time series and obtain long-term dependencies in the data. The formula is as follows: ; ; in, represents the input sequence matrix, Represents dimension flip; represents the learnable weight matrix, To output the result; The feedforward neural network module is used to obtain the mapping relationship between input and output, including two sets of linear transformations and the ReLU function between the two sets of linear transformations; (33) The encoded data is decoded by a decoder, wherein the masked multi-head dual attention module is used to mask the decoder input sequence; the multi-head dual attention module is used to obtain the dependency relationship between local time series features and obtain local information, the linear module is used to obtain the long-term trend dependency relationship in the time series, and the feedforward neural network module is used to obtain the mapping relationship between input and output; (4) Denormalize the prediction results to obtain the predicted effective wave height.
2. The method for predicting medium- and long-term ocean wave significant wave height based on EmaDformer according to claim 1, characterized in that: In step (1), firstly, the effective wave height data of three points in the East China Sea and three points in the South China Sea are selected, with a time resolution of 1 hour and a spatial resolution of 0.5°×0.5°; other marine environmental data include: 10m wind latitudinal component, meridional component, sea surface temperature, average wave period, atmospheric pressure, sea level pressure, average wave direction, with a time resolution of 1 hour and a spatial resolution of 0.5°×0.5°; then normalization is performed.
3. The method for predicting medium- and long-term ocean wave significant wave height based on EmaDformer according to claim 1, characterized in that: In step (2), if the calculated cumulative contribution rate is lower than the cumulative contribution rate threshold, it is deleted; otherwise, it is retained; the final data set includes: effective wave height, latitudinal and longitudinal components of 10m wind.
4. The method for predicting medium- and long-term ocean wave significant wave height based on EmaDformer according to claim 1, characterized in that: In step (4), the denormalization formula is as follows: ; in, represents the predicted data after denormalization, is the maximum value of the data, is the minimum value of the data, Predict data for the EmaDformer model.
