Wave height prediction method based on memory mechanism

By introducing a combination of memory mechanism and time encoding module, the existing wave prediction methods are solved in the complex calculation and insufficient utilization of historical information, and more efficient and accurate wave height prediction is achieved.

CN120123846BActive Publication Date: 2025-08-29CHENGDU UNIV OF INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510203174.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2025-08-29
Estimated Expiration
2045-02-24

AI Technical Summary

Technical Problem

The existing wave prediction methods are complex and time-consuming to calculate. Deep learning models have shortcomings in utilizing historical information, making it difficult to effectively capture long-term patterns of spatial and temporal changes, and memory networks perform poorly in long-term dependency capture and adaptability.

Method used

The wave height prediction method based on the memory mechanism is adopted, and the Memo module is dynamically captured and utilized. The time encoding module and attention mechanism are combined to optimize the utilization of historical information and improve prediction accuracy.

Benefits of technology

It significantly improves the accuracy and performance of wave height prediction, can make more efficient use of historical information, adapt to complex wave height variation modes, and improves prediction flexibility and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123846B_ABST
    Figure CN120123846B_ABST
Patent Text Reader

Abstract

The present invention discloses a wave height prediction method based on a memory mechanism, belonging to the technical field of significant wave height prediction, comprising the following steps: S1, obtaining an ERA5 significant wave height prediction dataset; S2, dividing the preprocessed ERA5 significant wave height prediction dataset into a training set, a validation set, and a test set; S3, preprocessing the training set; S4, generating a memory feature map; S5, training a memory mechanism Memo module; S6, completing the detection of the memory mechanism Memo module, and using the final memory mechanism Memo module to perform predictions. The wave height prediction method based on a memory mechanism proposed in the present invention achieves the best results among many mainstream prediction algorithms when performing wave height predictions, can more effectively utilize historical information, and thus significantly improves the performance and accuracy of wave height predictions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of significant wave height prediction, and in particular relates to a wave height prediction method based on a memory mechanism. Background Art

[0002] The ocean, covering over 70% of the Earth's surface, is a dynamic system, with waves being one of its most influential elements. Accurately predicting wave characteristics is crucial for the marine industry, coastal engineers, and meteorological agencies. Traditional meteorological wave forecasting methods rely on physical models such as SWAN and ECWMF. These models suffer from computational complexity and long processing times. With advances in artificial intelligence, deep learning models have rapidly emerged and gained widespread application in meteorology. They offer an alternative that overcomes the limitations of traditional wave forecasting methods and have become an important area of ​​research.

[0003] Deep learning has been widely used in the field of forecasting. In particular, Transformer models, such as FourCastNet, have been applied to spatiotemporal forecasting tasks by using a self-attention mechanism to capture relationships between different elements in an input sequence. However, the quadratic time complexity of the self-attention mechanism poses challenges when processing images, leading to poor performance and increased memory consumption. The CNN model (UNet) has been widely used in spatiotemporal forecasting tasks due to its ability to effectively model spatiotemporal evolving patterns. However, it struggles to accurately represent temporal features. The performance of these deep learning spatiotemporal modeling methods is limited by their ineffective utilization of historical information. In deep learning, spatiotemporal forecasting refers to the process of predicting future states by modeling and analyzing data with both spatial and temporal dimensions. For example, the ConvLSTM combines a convolutional network with an LSTM network to effectively capture spatiotemporal correlations and has been applied to rainfall forecasting. With the advent of the Transformer, it has rapidly been applied to meteorology. FourCastNet, which employs an adaptive Fourier neural operator, provides accurate, high-resolution forecasts for global weather forecasting. ST-LSTM improves on the ConvLSTM by introducing a space-time LSTM, capable of simultaneously extracting and storing spatial and temporal representations, achieving excellent performance in multiple spatiotemporal forecasting tasks. The SimVP model achieves excellent performance with a simple network structure, suggesting that complex networks like LSTM may not be the best choice for spatiotemporal prediction. The TAU model employs a temporal attention unit (TAU) to focus on temporal evolution and uses a parallel attention network to enhance spatiotemporal prediction learning. The SwinLSTM model improves the accuracy of spatiotemporal prediction by effectively capturing global spatial dependencies and combining Swin transformer blocks with LSTM units. The WaST model utilizes a three-dimensional discrete wavelet transform to effectively capture and process low- and high-frequency components, thereby enhancing spatiotemporal prediction learning.

[0004] These methods primarily emphasize spatiotemporal representation in forecasting tasks. However, insufficient use of historical information limits their ability to capture long-term patterns of spatiotemporal variation. The shortcomings of existing technologies include:

[0005] 1. Traditional numerical forecasting typically involves complex equations and numerical calculations, requiring extensive computing resources. This makes efficient prediction difficult, especially when processing large amounts of data. Accurately predicting wave characteristics is crucial for marine economics, coastal development, and meteorological services. However, traditional wave prediction methods primarily rely on physical models, such as SWAN and ECWMF. These methods are computationally complex and require long processing times, resulting in low efficiency in real-time applications. Therefore, there is an urgent need to develop new prediction models to improve the speed and accuracy of wave characteristic prediction.

[0006] 2. Although deep learning models can capture short-term temporal features, they are still insufficient in effectively extracting and utilizing long-term historical information, limiting their performance in complex spatiotemporal prediction. When applying the self-attention mechanism, its quadratic time complexity leads to performance degradation and excessive memory usage when processing large-scale images. Furthermore, while CNN structures (such as UNet) perform well in modeling spatiotemporal evolution, they still have shortcomings in capturing dynamic temporal features. These challenges limit the effectiveness of deep learning in spatiotemporal prediction, especially in terms of its potential in leveraging historical data, which has not been fully realized.

[0007] 3. Memory-based methods have difficulty capturing long-term dependencies and have poor adaptability, which limits their effectiveness in complex spatiotemporal predictions. For example, long short-term memory (LSTM) networks can process time series data, but their performance in capturing long-term dependencies is less than ideal. Although some models such as LMC-Memory enhance the utilization of historical information by maintaining updateable memory parameters, their method of integrating all data into the same memory space limits the effective extraction of information. Memory networks such as Memoria can store and access information in predictions, but because their memory function does not participate in model training and optimization, they have poor adaptability. This shows that current memory-based methods still need further exploration and improvement. Summary of the Invention

[0008] In order to solve the above problems, the present invention proposes a wave height prediction method based on a memory mechanism.

[0009] The technical solution of the present invention is: a wave height prediction method based on a memory mechanism comprises the following steps:

[0010] S1. Obtain the ERA5 significant wave height prediction dataset;

[0011] S2, preprocessing the ERA5 significant wave height prediction dataset, and dividing the preprocessed ERA5 significant wave height prediction dataset into a training set, a validation set, and a test set;

[0012] S3, preprocessing the training set;

[0013] S4. Input the preprocessed training set into the memory mechanism Memo module to generate a memory feature map;

[0014] S5. Train the memory mechanism Memo module based on the memory feature map and the validation set;

[0015] S6. Input the test set into the trained memory mechanism Memo module to complete the detection of the memory mechanism Memo module, and use the final memory mechanism Memo module to make predictions.

[0016] Furthermore, S4 includes the following sub-steps:

[0017] S41, performing convolution processing and downsampling processing on the preprocessed training set in sequence to obtain a first feature map, a second feature map, a third feature map, a fourth feature map, and a fifth feature map;

[0018] S42, inputting the fifth feature map into the temporal encoding module and the feedforward network layer in sequence to obtain a temporal feature map;

[0019] S43, combining the temporal feature maps and inputting them into the self-attention mechanism network layer to obtain a spatiotemporal feature map;

[0020] S44. Input the spatiotemporal feature map into the memory mechanism Memo module to obtain a memory feature map.

[0021] Furthermore, S42 includes the following sub-steps:

[0022] S421: Input the fifth feature map into the time encoding module for splitting to obtain a number of time segments to form a time vector;

[0023] S422, input the time vector into the feedforward network layer, map the time vector to the linear layer, and obtain a reconstructed vector;

[0024] S423. Obtain a time feature graph using the reorganized vector.

[0025] Furthermore, S43 includes the following sub-steps:

[0026] S431, grouping the time feature graph, and performing normalization and convolution processing on each group in turn to obtain a query, key, and value;

[0027] S432, calculating the similarity between the query and the key, and converting the similarity into an attention score using a softmax function;

[0028] S434. Perform weighted summation on the values ​​according to the attention scores to obtain an attention result.

[0029] S435, reorganize the attention results to obtain an attention feature map;

[0030] S436. Combine the temporal feature map and the attention feature map to obtain a spatiotemporal feature map.

[0031] Furthermore, S44 includes the following sub-steps:

[0032] S441, extracting several input vectors of the spatiotemporal feature map;

[0033] S442, calculating the L2 square distance between the input vector and each memory vector in the memory mechanism Memo module;

[0034] S443, combining each input vector with the memory vector corresponding to its minimum L2 square distance to obtain a real-time memory feature map;

[0035] S444. Update the real-time memory feature map by calculating the mean square error between the real-time memory feature map and the spatiotemporal feature map to obtain a memory feature map.

[0036] Furthermore, S5 includes the following sub-steps:

[0037] S51, obtaining a prediction result according to the first feature map, the second feature map, the third feature map, the fourth feature map, the fifth feature map, and the memory feature map;

[0038] S52. Train the memory mechanism Memo module based on the prediction results and the true value of the validation set.

[0039] Furthermore, S51 includes the following sub-steps:

[0040] S511, upsampling the memory feature map and inputting it into the attention network layer to obtain a sixth feature map;

[0041] S512, combining and upsampling the sixth feature map and the fourth feature map to obtain a seventh feature map;

[0042] S513, after inputting the seventh feature map into the attention network layer, combining the seventh feature map and the third feature map and upsampling them to obtain an eighth feature map;

[0043] S514: After inputting the eighth feature map into the attention network layer, the eighth feature map and the second feature map are combined and up-sampled to obtain a ninth feature map;

[0044] S515. After inputting the ninth feature map into the attention network layer, the ninth feature map is combined with the first feature map to obtain a prediction result.

[0045] Furthermore, S52 includes the following sub-steps:

[0046] S521, calculating the first mean square error between the prediction result and the true value of the validation set;

[0047] S522, calculating a second mean square error between the memory feature map and the spatiotemporal feature map;

[0048] S523: Add the first mean square error and the second mean square error and perform gradient descent optimization to complete the training of the memory mechanism Memo module.

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

[0050] (1) This paper designs a wave height prediction method based on a memory mechanism for effective wave height prediction. The present invention introduces an updateable Memo module, which enables the model to dynamically capture and utilize key historical node information. This module can not only store important historical data, but also optimize this information through continuous updating, thereby improving the accuracy of prediction.

[0051] (2) In order to model temporal relationships, the present invention combines a time encoding module and an attention mechanism to provide an implicit representation of temporal features. The time encoding module can effectively capture the temporal dependencies in time series data, while the attention mechanism allows the model to focus on the historical information most relevant to the current prediction. This combination makes the model more flexible in processing spatiotemporal data and can better cope with complex wave height variation patterns.

[0052] (3) A large number of experiments have shown that the wave height prediction method based on the memory mechanism proposed in the present invention has achieved the best results among many mainstream prediction algorithms when performing wave height prediction. It can more effectively utilize historical information, thereby significantly improving the performance and accuracy of wave height prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 This is a flow chart of the wave height prediction method based on the memory mechanism;

[0054] Figure 2 This is a schematic diagram of the Memo-UNet network structure proposed in the present invention;

[0055] Figure 3This is a structural diagram of the Memo module of the memory mechanism;

[0056] Figure 4 It is a structural diagram of the time coding module;

[0057] Figure 5 This is a qualitative result diagram of region 1 of the present invention on the ERA5 dataset;

[0058] Figure 6 This is a qualitative result diagram of region 2 of the present invention on the ERA5 dataset;

[0059] Figure 7 It is the R2 score map of the present invention on different regions of the ERA5 dataset;

[0060] Figure 8 It is the cumulative error map of the present invention on different regions of the ERA5 dataset;

[0061] Figure 9 is the error space distribution diagram of the present invention in region 1 on the ERA5 dataset;

[0062] Figure 10 This is the error space distribution diagram of the present invention in region 2 on the ERA5 dataset. DETAILED DESCRIPTION

[0063] The embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0064] like Figure 1 As shown, the present invention provides a wave height prediction method based on a memory mechanism, comprising the following steps:

[0065] S1. Obtain the ERA5 significant wave height prediction dataset;

[0066] S2, preprocessing the ERA5 significant wave height prediction dataset, and dividing the preprocessed ERA5 significant wave height prediction dataset into a training set, a validation set, and a test set;

[0067] S3, preprocessing the training set;

[0068] S4. Input the preprocessed training set into the memory mechanism Memo module to generate a memory feature map;

[0069] S5. Train the memory mechanism Memo module based on the memory feature map and the validation set;

[0070] S6. Input the test set into the trained memory mechanism Memo module to complete the detection of the memory mechanism Memo module, and use the final memory mechanism Memo module to make predictions.

[0071] The present invention constructs an effective wave height prediction network that utilizes historical information, which is similar to human memory. When predicting the future, the model is able to combine key historical node information of similar wave conditions previously encountered, thereby improving prediction accuracy. The memory mechanism of Memo-UNet is implemented through the Memo module, which includes memory extraction and optimization components. The memory extraction component retrieves the most relevant memories related to the wave state to assist in prediction, while filtering out irrelevant historical information. The memory optimization component optimizes these memories through gradient descent, enabling it to enhance the dynamic evolution pattern of key historical node information. In order to model temporal relationships, the model also combines time encoding and attention mechanisms, which provide implicit representations for temporal relationships.

[0072] In this embodiment of the present invention, the processing of S3 specifically includes:

[0073] Step 31: The sample interval is 3 hours, and the prediction step is set to 8 previous time points (24 hours) to predict the next 8 time points (24 hours). Predictions are made for two different ocean regions, each with a size of 256×256. These regions contain ocean areas and have some missing values. A mean-based interpolation method is then used to replace missing values. All variables in the dataset are then standardized to eliminate dimensional differences between different variables.

[0074] Step 32: The dataset used in this invention contains 20 input variables describing various environmental conditions relevant to wave modeling. For each input variable, the values ​​from time t-8 to time t-1, as well as the wave height values ​​from time t to time t+7, are extracted and the correlation coefficient is calculated. All variables with an absolute value of the Pearson correlation coefficient greater than 0.1 are selected as input. These selected variables show a higher correlation with future wave heights and serve as input to the Memo-UNet method. This selection process is intended to enhance the prediction process by excluding irrelevant inputs that may introduce noise.

[0075] In this embodiment of the present invention, S4 includes the following sub-steps:

[0076] S41, performing convolution processing and downsampling processing on the preprocessed training set in sequence to obtain a first feature map, a second feature map, a third feature map, a fourth feature map, and a fifth feature map;

[0077] S42, inputting the fifth feature map into the temporal encoding module and the feedforward network layer in sequence to obtain a temporal feature map;

[0078] S43, combining the temporal feature maps and inputting them into the self-attention mechanism network layer to obtain a spatiotemporal feature map;

[0079] S44. Input the spatiotemporal feature map into the memory mechanism Memo module to obtain a memory feature map.

[0080] In this embodiment of the present invention, S42 includes the following sub-steps:

[0081] S421: Input the fifth feature map into the time encoding module for splitting to obtain a number of time segments to form a time vector;

[0082] S422, input the time vector into the feedforward network layer, map the time vector to the linear layer, and obtain a reconstructed vector;

[0083] S423. Obtain a time feature graph using the reorganized vector.

[0084] In this embodiment of the present invention, S43 includes the following sub-steps:

[0085] S431, grouping the time feature graph, and performing normalization and convolution processing on each group in turn to obtain a query, key, and value;

[0086] S432, calculating the similarity between the query and the key, and converting the similarity into an attention score using a softmax function;

[0087] S434. Perform weighted summation on the values ​​according to the attention scores to obtain an attention result.

[0088] S435, reorganize the attention results to obtain an attention feature map;

[0089] S436. Combine the temporal feature map and the attention feature map to obtain a spatiotemporal feature map.

[0090] In this embodiment of the present invention, S44 includes the following sub-steps:

[0091] S441, extracting several input vectors of the spatiotemporal feature map;

[0092] S442, calculating the L2 square distance between the input vector and each memory vector in the memory mechanism Memo module;

[0093] S443, combining each input vector with the memory vector corresponding to its minimum L2 square distance to obtain a real-time memory feature map;

[0094] S444. Update the real-time memory feature map by calculating the mean square error between the real-time memory feature map and the spatiotemporal feature map to obtain a memory feature map.

[0095] In this embodiment of the present invention, S5 includes the following sub-steps:

[0096] S51, obtaining a prediction result according to the first feature map, the second feature map, the third feature map, the fourth feature map, the fifth feature map, and the memory feature map;

[0097] S52. Train the memory mechanism Memo module based on the prediction results and the true value of the validation set.

[0098] In this embodiment of the present invention, S51 includes the following sub-steps:

[0099] S511, upsampling the memory feature map and inputting it into the attention network layer to obtain a sixth feature map;

[0100] S512, combining and upsampling the sixth feature map and the fourth feature map to obtain a seventh feature map;

[0101] S513, after inputting the seventh feature map into the attention network layer, combining the seventh feature map and the third feature map and upsampling them to obtain an eighth feature map;

[0102] S514: After inputting the eighth feature map into the attention network layer, the eighth feature map and the second feature map are combined and up-sampled to obtain a ninth feature map;

[0103] S515. After inputting the ninth feature map into the attention network layer, the ninth feature map is combined with the first feature map to obtain a prediction result.

[0104] In this embodiment of the present invention, S52 includes the following sub-steps:

[0105] S521, calculating the first mean square error between the prediction result and the true value of the validation set;

[0106] S522, calculating a second mean square error between the memory feature map and the spatiotemporal feature map;

[0107] S523: Add the first mean square error and the second mean square error and perform gradient descent optimization to complete the training of the memory mechanism Memo module.

[0108] The following is an explanation with reference to specific embodiments. It should be noted that SE refers to the squeeze-excitation attention mechanism; FFN refers to the feedforward neural network, a basic artificial neural network structure; ConvBlock refers to the Convolution Block, which is composed of a stacked (normalization layer, activation function, 3×3 convolution layer) with a head-to-tail residual connection, and is the basic component of the method of the present invention; AttnBlock refers to the Attention Block, which is composed of two different ConvBlocks interspersed with the self-attention mechanism; SEBlock refers to the Squeeze and Excitation Block, which is composed of two different ConvBlocks using Squeeze and Excitation.

[0109] This invention relates to the field of significant wave height prediction, primarily addressing the problem of existing prediction methods' inadequate utilization of extensive historical information. Deep learning, a mainstream approach to wave height prediction, has demonstrated superior performance far exceeding that of traditional methods. However, most neural network architectures employed in deep learning fail to effectively utilize the extensive historical information present in the observed data, failing to capture dynamic evolution patterns and resulting in low prediction accuracy.

[0110] Aiming at the problem that the existing wave height prediction lacks the use of historical information, this paper proposes an effective wave height prediction network based on an updateable memory mechanism. Figure 2 The network structure diagram proposed in this invention is shown in Figure 1. Its input data are multiple variables of continuous time series with high correlation with wave height, and its output is the predicted future significant wave height. Specifically, the original input dimension is (8×7)×256×256. Figure 2 The input, represented as L × W × H, represents the observation data of seven variables at eight consecutive past time points. The resulting prediction has dimensions of (8 × 1) × 256 × 256, representing the significant wave height prediction for eight consecutive past time points. To integrate time and variables, we fuse the time and variable channels for better spatiotemporal modeling.

[0111] Figure 2 The ConvBlock in the example is a feedforward network containing convolutional layers. It serves as the foundational mapping operation for this method, extracting spatiotemporal features from the data. The down and up operations represent downsampling and upsampling of the data, respectively, capturing features at different scales by varying the resolution of the data. Represents combining two input data. AttnBlock is a feedforward network combined with the self-attention mechanism, which uses the relationship between the channels of the input feature map to calculate the importance weight of each channel. SEBlock is a feedforward network with SE channel attention mechanism. N and M represent the number of memory elements (1024) and the dimension of the memory vector respectively. Z and Represent the memory feature map and the time feature map, respectively. TimeEncoding represents the proposed time encoding module. y, m, d, h, and ts represent year, month, day, hour, and timestamp, respectively, representing the time encoding module's splitting of time information into different dimensions. The final prediction result is represented by Y′.

[0112] Figure 3 The detailed process of the memory mechanism Memo module is shown in the figure. All element vectors in Calculate and select the relevant memory element v with the minimum L2 squared distance i In the graph, the calculation and selection of the minimum operations are represented by Calculate and argmin respectively. Finally, all relevant memory elements are combined into a memory feature map Z, and then returned to the Memo-UNet network to obtain the predicted result Y′. The mean square error loss value is calculated for the true value Y and the predicted result Y′, and the spatiotemporal feature map The mean square error loss value is calculated by using the memory feature map. The formula is shown in the bottom and upper right corners of the figure. The network weight W and memory feature map Z are updated by gradient descent respectively. η represents the learning rate of the present invention, which is set to 0.0003 in the experiment.

[0113] Figure 4 This is the detailed process of the time encoding module, which splits the one-dimensional time and maps it to a two-dimensional time feature map through FFN Where y, m, d, h, and ts represent the year, month, day, hour, and timestamp obtained by splitting the one-dimensional time information, respectively.

[0114] The core and main innovation of the target detection network of the present invention lies in the memory mechanism Memo module, time encoding and attention mechanism.

[0115] The method proposed in the present invention constructs a prediction network that uses historical information to model effective wave heights. The constructed prediction network includes three parts: a UNet backbone structure with multi-scale sampling, a memory mechanism Memo module, and time encoding for modeling time relationships. This model is similar to human memory. When making future predictions, it can combine key historical node information of similar wave conditions encountered previously, thereby improving the accuracy of the prediction. The memory mechanism of Memo-UNet is implemented through the Memo module, which includes two parts: memory extraction and optimization. The memory extraction part is responsible for retrieving the most important memories related to the wave state to support predictions and filtering out irrelevant historical information. The memory optimization part refines these memories through gradient descent so that they can better reflect the dynamic evolution pattern of key historical node information. In order to model time relationships, we also combine the time encoding module and the attention mechanism to provide an implicit representation of time features. This design enables the model to more effectively capture spatiotemporal changes, thereby improving the performance of wave height prediction. The method specifically includes:

[0116] Step 1: Prepare the ERA5 significant wave height prediction dataset for wave height prediction;

[0117] Step 2: Preprocess the ERA5 wave height prediction dataset obtained in Step 1. The wave height data is provided on a regular 1 / 5° grid with a 3-hour time step. The experimental period covers 2016 to 2019. Specifically, 2016 to 2018 are used for training, while the first 240 days of 2019 are retained for validation, and the remainder of 2019 is used for testing.

[0118] Step 3: Preprocess the ERA5 wave height prediction dataset from step 2 to obtain the correlation between different variables and predicted wave height, as shown in Table 1.

[0119] Table 1

[0120]

[0121]

[0122] Step 31, the sample time interval is 3 hours, and the prediction step is set to 8 previous time points (24 hours) to predict the next 8 time points (24 hours). Predictions were made in two different ocean regions, each with a size of 256×256. Region 1 has a longitude range of -180° to -129° and a latitude range of -51.2° to -0.2°, which is an area in the Pacific Ocean; Region 2 has a longitude range of 52.6° to 103.6° and a latitude range of -61° to -10°, which is an area in the Indian Ocean. These areas contain some missing values, and a mean-based interpolation method is used to replace the missing values. All variables in the dataset are then standardized to eliminate the dimensional differences of different variables;

[0123] Step 32. The dataset used in the present invention contains 20 input variables that describe various environmental conditions relevant to wave modeling. For each input variable, the values ​​from time t-8 to time t-1, as well as the wave height values ​​from time t to time t+7, are extracted, and the correlation coefficient is calculated. The results are shown in Table 1. All variables with an absolute value of the Pearson correlation coefficient greater than 0.1 are selected as input. These selected variables show a higher correlation with the predicted future wave height and are used as input to the Memo-UNet method. This selection process is intended to enhance the prediction process by excluding irrelevant inputs that may introduce noise;

[0124] Step 4: Input the training set processed in step 3 into the constructed prediction network to train the network. The training process specifically includes:

[0125] Step 41: Input the pre-processed training set into the Memo-UNet backbone. Define the input size as W×H. First, pass a ConvBlock to obtain the first feature map C1 of W×H. Then, after four downsampling and Convblock, obtain spatiotemporal feature maps of different scales. The second feature map C2, The third characteristic graph C3, The fourth characteristic graph C4, The fifth feature map C5. Each feature map is obtained based on the previous feature map or input.

[0126] Step 42: Split the specific time variables in the input variables into time segments of year, month, day, hour and timestamp. Input all time segments into the feedforward network layer to obtain the time feature graph of time representation.

[0127] Step 43: The time characteristic graph of step 42 Combined with the fifth feature map C5 in step 41, and then obtained through AttnBlock containing the self-attention mechanism to obtain the spatiotemporal feature map F1.

[0128] Step 44: Input the spatiotemporal feature map F1 into the AttnBlock containing the self-attention mechanism to obtain Then enter the memory mechanism Memo module, extract historical information from it and store it as a memory representation. Similar to human memory, this module retrieves relevant memory elements for the current input in the prediction step. Specifically: the spatiotemporal feature map F1 of step 43 is input to the network layer containing the self-attention mechanism, and then flattened to obtain The matrix of vectors For each Vectors in calculate Calculate the L2 square distance between the vector v represented by the memory in the Memo module. Combine the v with the minimum distance to get the memory corresponding to the input, and then reorganize the memory into Memory feature map Z.

[0129] The memory feature map Z of step 5 and step 44 is combined with the spatiotemporal feature map F1 obtained in step 43 to obtain the feature map F2. Then, through continuous decoding and upsampling to restore the dimension and size, the prediction space result is obtained. Specifically:

[0130] Step 51: Upsample the feature map F2 of step 5 to Then, the feature map F3 is obtained by SEBlock containing channel attention. The feature map F3 is combined with the fourth feature map C4 in step 41, and then upsampled to obtain The feature map F4 is input into SEBlock containing channel attention, and then combined with the third feature map C3 of step 41 and obtained by upsampling. The feature map F5 is input into the SEBlock containing channel attention, combined with the second feature map C2 in step 41, and upsampled to obtain the W×H feature map F6. The feature map F6 is input into the SEBlock containing channel attention, combined with the first feature map C1 in step 41, and passed through the SEBlock containing channel attention to obtain the final prediction Y′.

[0131] Step 52: Calculate the mean squared error E1 between the predicted result Y′ and the true value Y. Calculate the mean squared error E2 for the memory feature map Z from step 44 and the spatiotemporal feature map F1 from step 43. Add E1 and E2 and then perform gradient descent optimization on the Memo memory elements and the Memo-UNet parameter weights. Check whether the validation set has the best performance. If so, save the model weights at that point; otherwise, skip the optimization.

[0132] Step 6. Repeat steps 4 and 5 until 30 rounds of training are completed. Use the cosine annealing strategy for the learning rate of each gradient descent.

[0133] Step 7: Select the best network saved through verification, feed the test set into the network, calculate the mean absolute error, mean square error, and save the final detection effect graph.

[0134] In order to further illustrate the effectiveness of the method of the present invention, the method of the present invention is compared with other existing methods. In order to make a fair comparison, the officially released codes of other methods are used, and their experimental settings are followed, where all methods are implemented in the same computing environment, and quantitative and qualitative analysis are performed simultaneously. The 7 methods are specifically: Method 1 is the FouCastNet method, which uses an adaptive Fourier neural operator as its main architecture and can generate a large number of sub-models at a very low cost for ensemble prediction; Method 2 is SimVP, which achieves excellent performance through a simple network structure, proving that complex networks such as LSTM may not be the best choice for spatiotemporal prediction; Method 3 is UNet, which was originally used for medical image segmentation, but has been widely used in various prediction tasks due to its powerful feature extraction capabilities. Its symmetrical structure allows for the effective capture of contextual information; Method 4 is TAU, which uses an attention mechanism to process time evolution in parallel. At the same time, a novel differential dispersion regularization method is proposed to optimize the loss function of spatiotemporal prediction learning; Method 5 is WAST, which uses wavelet transform to extract the frequency domain information of the data, and proposes high-frequency focus loss to make up for the lack of high-frequency information supervision in MSE; Method 6 is PredRNNv2, which improves ConvLSTM by introducing spatiotemporal LSTM (ST-LSTM), and realizes the simultaneous extraction of storage space and time representations, and performs well in multiple spatiotemporal prediction tasks; Method 7 is LMC_Memory, which is a long-term motion context memory model with memory alignment learning, which is used to predict high-dimensional long-term motion context.

[0135] The effectiveness of the proposed method was evaluated using mean square error (MSE) and mean absolute error (MAE). Smaller MAE and MSE values ​​indicate better performance. Tables 2 and 3 show the overall performance comparisons of the proposed method with other methods in regions 1 and 2, respectively.

[0136] Table 2

[0137] Adoption Method Mean square error Mean absolute error Method 1 0.057 0.136 Method 2 0.046 0.125 Method 3 0.048 0.130 Method 4 0.052 0.137 Method 5 0.048 0.131 Method 6 0.045 0.124 Method 7 0.044 0.121 Method of the present invention 0.041 0.117

[0138] Table 3

[0139]

[0140]

[0141] These tables show the average MSE and average MAE for eight time points (including the future 3 hours, 6 hours, 9 hours, 12 hours, 15 hours, 18 hours, 21 hours and 24 hours). The prediction performance varies across different prediction horizons, with short-term predictions having lower MSE and MAE values ​​and higher accuracy compared to long-term predictions. This observation can be attributed to the increased uncertainty and complexity in predicting wave heights over longer time intervals, which leads to deviations between predicted wave heights and actual values. The method of the present invention utilizes the Memo module to enhance the dynamic evolution of key historical node information, achieving higher accuracy in wave height prediction. It outperforms the comparison methods in all evaluation indicators. The indicator values ​​of all methods in region 2 are significantly higher than those in region 1 (the MSE value in region 2 is approximately 100% higher than that in region 1), indicating that the wave height conditions in region 2 are more complex. However, the method of the present invention achieves the best performance indicators under both the complex wave height conditions in region 2 and the relatively simple conditions in region 1. More specifically, in region 1, the average MSE of the method of the present invention at eight time points was 0.041, which exceeded the best-performing comparison method 7 (average MSE of 0.044), an improvement of 6.8%. In addition, the average MAE of the method of the present invention was 0.117, which was better than the comparison method 7 (average MAE of 0.121), an improvement of 3.1%. Similarly, in region 2, the average MSE of the method of the present invention was 0.084, which exceeded the best-performing comparison method 2 (average MSE of 0.092), an improvement of 8.6%. In addition, the average MAE of the method of the present invention was 0.164, which was better than the best-performing comparison method 6 (average MAE of 0.175), an improvement of 6.2%.

[0142] In order to more intuitively illustrate the effectiveness of the method of the present invention, the accuracy of predicting significant wave heights is compared between the existing method and the method of the present invention. Figure 5 and Figure 6 This is the qualitative result of the effective wave height prediction for different ocean regions. The first row is the true value of the input and predicted wave heights, and the remaining rows are the prediction results of different methods. Figure 5 As shown in Figure 3, the method of the present invention performs well in both bright and dark areas and can well preserve the contour shape. Figure 6 In the figure, SimVP, UNet, and WAST fail to capture the wave height information in the black area on the left (in Figure 5 (At t=16). Regarding the waveform in the right triangular region, other methods struggled to produce accurate predictions, with significant deviations in the wave outline. Compared to other methods, our method demonstrated greater accuracy in both the outline and details of the wave pattern.

[0143] Figure 7The R2 (R-squared) scores of all methods in different ocean regions are shown, which indicate the goodness of fit of the model to the predicted wave height. The R2 index ranges from 0 to 1, where 1 indicates a perfect prediction of the variability of the dependent variable and 0 indicates that the model cannot make an accurate prediction. Figure 6 As shown in the figure, the vertical axis represents the R2 score of the model in region 2, and the horizontal axis represents the R2 score of the model in region 1. Therefore, the upper right corner indicates that the model fits both regions well, while the lower left corner indicates a poor fit. The method of the present invention is located in the upper right corner, indicating that it has excellent fit results in both regions. Specifically, the R2 score of the method of the present invention in region 1 is 0.929, and the R2 score in region 2 is 0.936.

[0144] Figure 8 The cumulative mean squared error (MSE) of different methods in two regions is shown. The eight time points in the data correspond to 24 hours, representing one day. The horizontal axis represents the cumulative number of days, while the vertical axis represents the cumulative MSE value. It can be observed that the blue line representing the method of the present invention is always below the lines of other methods. This shows that the method of the present invention achieves the best performance in all prediction time intervals. As the cumulative number of days increases, the method of the present invention maintains a consistently low cumulative MSE, resulting in a smaller prediction error than all other methods.

[0145] Table 4

[0146]

[0147]

[0148] Figure 9 and Figure 10 The spatial distribution of the mean absolute error (MAE) of wave height predictions for different methods over regions 1 and 2 is shown. Warm colors indicate low MAE error values, while cool colors indicate high MAE error values. Lower MAE corresponds to more accurate predictions. Table 4 shows Figure 9 and Figure 10 The percentage of regions with different MAE ranges in the proposed method is lower in the region with high MAE values, indicating that there are fewer regions that are difficult to predict, while the percentage of regions with low MAE values ​​is higher, indicating that there are more regions with more accurate predictions.

[0149] exist Figure 9 In region 1, the method of the present invention shows a relatively large red area (according to Figure 9 The color caliper of , indicating MAE values ​​below 0.12), with an area percentage of 60.1%, indicates high prediction accuracy over a wider range. In addition, in the challenging blue and purple areas (according to Figure 9In the color caliper (indicates that the MAE value is higher than 0.25), the area displayed by the method of the present invention is slightly smaller than that of other methods, which is only 2.4%.

[0150] exist Figure 10 In region 2, TAU, WAST, FourCastNet, and UNet show significant blue areas in the central region, indicating difficulties in predicting complex wave conditions. PredRNNv2, SimVP, and LMC show smaller blue areas in the central region, while the proposed method has almost no blue area. In the challenging blue and purple areas of region 2 (according to Figure 10 In the color caliper of area 2 (indicating a MAE value higher than 0.28), the area percentage of the method of the present invention is only 8.5%. Figure 10 The percentage of regions with MAE values ​​below 1.13 (the color caliper indicates MAE values ​​below 1.13) reached 49.2%. The percentage of regions with MAE values ​​below 1.13 was larger in the low MAE regions and smaller in the high MAE regions, demonstrating higher accuracy in predicting wave height changes.

[0151] The effectiveness of each proposed module is verified by ablation experiments. The evaluation dataset of the ablation experiment uses the ocean area of ​​region 1 of the ERA5 dataset.

[0152] Table 5

[0153] Memo Module Time Code Attention Mechanism MSE RMSE × × × 0.045 0.214 × × √ 0.044 0.211 × √ × 0.044 0.209 √ × × 0.041 0.203 √ √ √ 0.041 0.202

[0154] The quantitative results are shown in Table 5, where √ indicates that the module is used and × indicates that the module is not used. The method of the present invention removes the model of all methods as the baseline model. When modules are added one by one on the baseline, it is verified that the proposed method has obvious improvements. The introduction of the attention mechanism and the time coding module brought about a slight improvement. However, after adding the memory mechanism Memo module, the dynamic evolution law is learned from all samples, which significantly improves the performance and achieves a similar effect to that when all methods are combined. This result highlights the important role of the Memo module in the present invention. This process effectively uses historical information to assist prediction. This proves the effectiveness of the proposed module.

[0155] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and it should be understood that the scope of protection of the present invention is not limited to such specific descriptions and embodiments. Those skilled in the art can make various other specific variations and combinations based on the technical teachings disclosed in the present invention without departing from the essence of the present invention, and such variations and combinations are still within the scope of protection of the present invention.

Claims

1. A wave height prediction method based on a memory mechanism, characterized in that: The following steps are involved: S1. Obtain the ERA5 significant wave height prediction dataset; S2, preprocessing the ERA5 significant wave height prediction dataset, and dividing the preprocessed ERA5 significant wave height prediction dataset into a training set, a validation set, and a test set; S3, preprocessing the training set; S4. Input the preprocessed training set into the memory mechanism Memo module to generate a memory feature map; S5. Train the memory mechanism Memo module based on the memory feature map and the validation set; S6. Input the test set into the trained memory mechanism Memo module to complete the detection of the memory mechanism Memo module, and use the final memory mechanism Memo module to make predictions; The S4 includes the following sub-steps: S41, performing convolution processing and downsampling processing on the preprocessed training set in sequence to obtain a first feature map, a second feature map, a third feature map, a fourth feature map, and a fifth feature map; S42, inputting the fifth feature map into the temporal encoding module and the feedforward network layer in sequence to obtain a temporal feature map; S43, combining the temporal feature maps and inputting them into the self-attention mechanism network layer to obtain a spatiotemporal feature map; S44, inputting the spatiotemporal feature map into the memory mechanism Memo module to obtain a memory feature map; The S42 includes the following sub-steps: S421: Input the fifth feature map into the time encoding module for splitting to obtain a number of time segments to form a time vector; S422, input the time vector into the feedforward network layer, map the time vector to the linear layer, and obtain a reconstructed vector; S423, obtaining a time feature map using the reorganized vector; The S43 includes the following sub-steps: S431, grouping the time feature graph, and performing normalization and convolution processing on each group in turn to obtain a query, key, and value; S432, calculating the similarity between the query and the key, and converting the similarity into an attention score using a softmax function; S434. Perform weighted summation on the values ​​according to the attention scores to obtain an attention result. S435, reorganize the attention results to obtain an attention feature map; S436, combining the temporal feature map and the attention feature map to obtain a spatiotemporal feature map; The S44 includes the following sub-steps: S441, extracting several input vectors of the spatiotemporal feature map; S442, calculating the L2 square distance between the input vector and each memory vector in the memory mechanism Memo module; S443, combining each input vector with the memory vector corresponding to its minimum L2 square distance to obtain a real-time memory feature map; S444. Update the real-time memory feature map by calculating the mean square error between the real-time memory feature map and the spatiotemporal feature map to obtain a memory feature map.

2. The wave height prediction method based on the memory mechanism according to claim 1 is characterized in that: The S5 comprises the following sub-steps: S51, obtaining a prediction result according to the first feature map, the second feature map, the third feature map, the fourth feature map, the fifth feature map, and the memory feature map; S52. Train the memory mechanism Memo module based on the prediction results and the true value of the validation set.

3. The wave height prediction method based on the memory mechanism according to claim 2 is characterized in that: The S51 includes the following sub-steps: S511, upsampling the memory feature map and inputting it into the attention network layer to obtain a sixth feature map; S512, combining and upsampling the sixth feature map and the fourth feature map to obtain a seventh feature map; S513, after inputting the seventh feature map into the attention network layer, combining the seventh feature map and the third feature map and upsampling them to obtain an eighth feature map; S514: After inputting the eighth feature map into the attention network layer, the eighth feature map and the second feature map are combined and up-sampled to obtain a ninth feature map; S515. After inputting the ninth feature map into the attention network layer, the ninth feature map is combined with the first feature map to obtain a prediction result.

4. The wave height prediction method based on the memory mechanism according to claim 2 is characterized in that: The S52 includes the following sub-steps: S521, calculating the first mean square error between the prediction result and the true value of the validation set; S522, calculating a second mean square error between the memory feature map and the spatiotemporal feature map; S523: Add the first mean square error and the second mean square error and perform gradient descent optimization to complete the training of the memory mechanism Memo module.

Citation Information

Patent Citations

  • WIFI hotspot information modifying method and device

    CN107567072A

  • WIFI hotspot information pushing method, receiving method and devices

    CN107613471A