Two-stage spatio-temporal prediction method and system for significant wave height based on diffusion residual correction
By employing a two-stage spatiotemporal prediction method, an improved 3D-Geoformer model is used to generate preliminary prediction results. The residuals are then corrected using a diffusion model, which solves the problems of error accumulation and inaccurate prediction of high wave areas in wave prediction, thereby improving prediction accuracy and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES)
- Filing Date
- 2026-04-03
- Publication Date
- 2026-06-09
AI Technical Summary
Existing deep learning models suffer from error accumulation and inaccurate prediction of high wave areas in wave prediction, especially during typhoons or strong winds, where the prediction error is too large. Furthermore, single-stage models are difficult to meet the business requirements of rapid prediction and short-term rolling updates.
A two-stage spatiotemporal prediction method based on diffusion residual correction is adopted. First, an improved 3D-Geoformer model is used to generate preliminary effective wave height prediction results. Then, residual correction is performed through the diffusion model to improve prediction accuracy.
It mitigated the accumulation of long-term biases, improved the forecast quality in high-wave areas, and enhanced the stability and accuracy of forecasts.
Smart Images

Figure CN121958993B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wave prediction technology, and in particular to a two-stage spatiotemporal prediction method and system for effective wave height based on diffusion residual correction. Background Technology
[0002] The statements in this section are merely background information relating to this disclosure and do not necessarily constitute prior art.
[0003] With the increasing global development and utilization of the ocean, the demand for refined sea state forecasts is constantly growing in maritime shipping, fisheries production, offshore wind power, and marine engineering construction. Significant wave height (SWH), as a core indicator describing the intensity of sea surface waves, plays a crucial role in typhoon warnings, route planning, and risk assessment. Traditional wave forecasting methods mainly rely on numerical wave models (such as WAVEWATCH III and SWAN). While these models can comprehensively simulate ocean dynamic processes, they depend on high-resolution wind fields, resulting in complex and time-consuming calculations that are difficult to meet the operational needs of rapid forecasting or short-term rolling updates.
[0004] In recent years, with the rapid development of artificial intelligence technology, deep learning models have been increasingly applied to the field of wave prediction. While existing deep learning prediction models can learn the spatiotemporal evolution patterns of waves from historical data, they are prone to error accumulation during multi-timeframe extrapolation, especially in high-wave areas caused by typhoons or strong winds. Limited by sample size and model structure capabilities, prediction errors tend to be large. Furthermore, most existing methods employ single-stage prediction, lacking further bias diagnosis and correction after model output. Expanding the model structure or replacing the network architecture cannot adequately address these issues. Summary of the Invention
[0005] To overcome the shortcomings of the prior art, this invention provides an effective two-stage spatiotemporal prediction method and system for wave height based on diffusion residual correction, aiming to improve the overall prediction accuracy of wave height and improve performance in extreme cases.
[0006] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:
[0007] In a first aspect, the present invention provides a two-stage spatiotemporal prediction method for effective wave height based on diffusion residual correction, comprising:
[0008] Acquire historical valid wave height data and its corresponding historical wind field data, as well as the concurrent forecast wind field data for the target prediction period;
[0009] The historical significant wave height data and the corresponding historical wind field data are input into the significant wave height spatiotemporal prediction model for processing to obtain preliminary significant wave height prediction results.
[0010] The historical significant wave height data, the preliminary significant wave height prediction results, and the concurrent forecast wind field data for the target prediction period are input into the residual correction module based on the diffusion model to compensate for the preliminary prediction error and obtain the final significant wave height prediction results.
[0011] The construction process of the residual correction module based on the diffusion model includes:
[0012] At any denoised time step of the diffusion model, an input tensor is constructed based on the noisy residual field of the current denoised time step, the preliminary effective wave height prediction results, the meridional wind field component of the same forecast, the zonal wind field component of the same forecast, and the forecast duration encoding channel.
[0013] Based on weighted denoising learning using continuous noise level sampling, a diffusion model is trained to reconstruct the true residual structure from residual samples contaminated with noise of different intensities.
[0014] During the inference phase, a deterministic ordinary differential equation solver is used. Starting from the Gaussian noise field, and under the joint constraints of the preliminary effective wave height prediction results, the meridional wind field component predicted at the same time, and the zonal wind field component predicted at the same time, the residual correction field is generated through stepwise iterative denoising.
[0015] The residual correction field is superimposed on the preliminary effective wave height prediction result to obtain the final effective wave height prediction result.
[0016] A further technical solution involves inputting the input tensor into the diffusion model during training and introducing a noise embedding mechanism based on feature linear modulation to adaptively adjust the feature distribution within the network according to the noise level.
[0017] A further technical solution is to improve the effective wave height spatiotemporal prediction model based on the 3D-Geoformer model, and adopt a dual-stream hybrid modeling architecture, including parallel Geoformer trunk branches and U-Net branches;
[0018] The Geoformer backbone receives historical valid wave height data and its corresponding historical wind field data. Periodic temporal feature encoding is introduced into the embedding module to obtain an input tensor containing temporal embedding representation. The input tensor is then smoothly divided into multiple blocks using an overlapping sliding window, and feature extraction is performed on each block to obtain wave height features. These wave height features are then weighted and fused using a spatial attention mechanism guided by physical distance constraints and wind field vectors to obtain corrected global features. A global feature enhancement mechanism based on frequency domain spectral analysis is used to enhance these global features, resulting in frequency domain enhanced features. Finally, a one-time parallel inference mechanism based on a non-autoregressive architecture is used to decode the frequency domain enhanced features, yielding the global flow prediction result.
[0019] The U-Net branch receives historical valid wave height data and extracts multi-scale spatial features. A Transformer bottleneck layer is embedded on the U-Net basis. After the multi-scale spatial features are processed by the Transformer bottleneck layer, latent features are obtained. Convolutional gated recurrent units are introduced in the U-Net decoding stage, and local flow prediction results are obtained based on the latent features.
[0020] By fusing the global flow prediction results and the local flow prediction results, a preliminary effective wave height prediction result is obtained.
[0021] A further technical solution, the spatial attention mechanism based on physical distance constraints and wind field vector guidance, includes:
[0022] Calculate the spherical great circle distance matrix between all pairs of spatial grid points and transform it into a distance weight matrix;
[0023] Extract the meridional and zonal wind field components from historical wind field data synchronized with historical significant wave height data, and map them into a wind field offset matrix.
[0024] Based on standard dot product attention, a distance weight matrix and a wind field bias matrix are introduced to obtain a spatial attention score matrix.
[0025] A further technical solution is that the global feature enhancement mechanism based on frequency domain spectral analysis includes:
[0026] The input deep features are orthogonally transformed from the spatial domain to the frequency domain to obtain complex spectral features in the frequency domain;
[0027] In the frequency domain, a complex weight matrix is used to adaptively weight different frequency components of the complex spectral features to screen and enhance key wave modes.
[0028] The modulated spectral features are restored back to the spatial domain, processed by a multilayer perceptron, and then fused with the input deep features through residual connections to obtain frequency domain enhanced features.
[0029] A further technical solution, the one-time parallel inference mechanism based on a non-autoregressive architecture, includes:
[0030] Based on the time average field of the historical input sequence, it is replicated and extended in the time dimension to the target prediction duration to form the initial query input;
[0031] By using the spatiotemporal attention mechanism in the decoder, the correlation between the initial query input and the memory matrix output by the encoder is calculated at once, and a direct mapping relationship between the historical observation sequence and the future multi-time prediction field is established.
[0032] Based on the direct mapping relationship, a global flow prediction result is generated in one go.
[0033] In a further technical solution, the effective wave height spatiotemporal prediction model adopts a combined loss function that integrates pixel-level error and texture gradient error.
[0034] Secondly, this invention provides an effective wave height two-stage spatiotemporal prediction system based on diffusion residual correction, comprising:
[0035] The data acquisition module is configured to acquire historical significant wave height data and its corresponding historical wind field data, as well as the concurrent forecast wind field data for the target prediction period.
[0036] The first-stage prediction module is configured to input the historical significant wave height data and its corresponding historical wind field data into the significant wave height spatiotemporal prediction model for processing, and obtain preliminary significant wave height prediction results.
[0037] The second-stage compensation module is configured to input the historical significant wave height data, the preliminary significant wave height prediction results, and the concurrent forecast wind field data for the target prediction period into the residual correction module based on the diffusion model to compensate for the preliminary prediction error and obtain the final significant wave height prediction results.
[0038] The construction process of the residual correction module based on the diffusion model includes:
[0039] At any denoised time step of the diffusion model, an input tensor is constructed based on the noisy residual field of the current denoised time step, the preliminary effective wave height prediction results, the meridional wind field component of the same forecast, the zonal wind field component of the same forecast, and the forecast duration encoding channel.
[0040] Based on weighted denoising learning using continuous noise level sampling, a diffusion model is trained to reconstruct the true residual structure from residual samples contaminated with noise of different intensities.
[0041] During the inference phase, a deterministic ordinary differential equation solver is used. Starting from the Gaussian noise field, and under the joint constraints of the preliminary effective wave height prediction results, the meridional wind field component predicted at the same time, and the zonal wind field component predicted at the same time, the residual correction field is generated through stepwise iterative denoising.
[0042] The residual correction field is superimposed on the preliminary effective wave height prediction result to obtain the final effective wave height prediction result.
[0043] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the effective wave height two-stage spatiotemporal prediction method based on diffusion residual correction as described in the first aspect.
[0044] Fourthly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the effective wave height two-stage spatiotemporal prediction method based on diffusion residual correction as described in the first aspect.
[0045] The above one or more technical solutions have the following beneficial effects:
[0046] This invention constructs a two-stage spatiotemporal prediction framework. In the first stage, the existing 3D-Geoformer model is improved to obtain an effective wave height spatiotemporal prediction model, generating a preliminary effective wave height prediction result with good performance. In the second stage, a residual learning mechanism based on a diffusion model is introduced to compensate for the preliminary prediction error, thereby alleviating the accumulation of long-term deviations, improving the prediction quality in high-wave areas, and improving prediction stability to a certain extent.
[0047] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0048] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0049] Figure 1 This is an overall flowchart of the effective wave height two-stage spatiotemporal prediction method based on diffusion residual correction according to an embodiment of the present invention;
[0050] Figure 2 This is a flowchart of the spatiotemporal prediction model for the effective wave height in the first stage of this invention.
[0051] Figure 3This is an architecture diagram of the Geoformer main branch of the effective wave height spatiotemporal prediction model in this embodiment of the invention;
[0052] Figure 4 This is a flowchart of the model training process according to an embodiment of the present invention. Detailed Implementation
[0053] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0054] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0055] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0056] Terminology Explanation:
[0057] Significant Wave Height (SWH): refers to the average height of the first 1 / 3 of all waves in a given time period, after sorting all waves on the sea surface from largest to smallest. It is a core physical quantity characterizing the intensity and energy level of sea surface waves.
[0058] Deep learning prediction models: These are models that use neural network structures to automatically learn the evolution patterns of ocean waves from historical observation data or reanalysis data, and output predictions of future effective wave heights.
[0059] Diffusion Model: A generative deep learning model that learns the probability distribution of target data by constructing a stochastic process of progressively adding noise and reverse denoising recovery.
[0060] Residual: refers to the difference between the true effective wave height and the output value of the deep learning prediction model, used to characterize the systematic error and random bias in the initial prediction.
[0061] Residual correction refers to the process of modeling and generating residuals based on a diffusion model, and then adding them to the initial prediction results to obtain a more accurate effective wave height prediction value.
[0062] Example 1
[0063] In recent years, with the rapid development of artificial intelligence technology, deep learning models have been increasingly applied to the field of ocean wave prediction. Single-stage deep learning models based on large-scale historical samples can directly output future wave field distributions, offering advantages such as computational efficiency and ease of deployment compared to traditional numerical simulations. However, ocean surface dynamic processes exhibit significant spatial nonlinearity, seasonal variations, and extreme event characteristics, which limits the limitations of existing deep learning models. On the one hand, prediction errors accumulate gradually with the forecast lead time, making it difficult for current models to fully characterize wave field propagation processes over a three-day or even longer timescale, leading to a decrease in forecast accuracy over time. On the other hand, due to the low probability of extreme wave conditions and the scarcity of training samples, models are more prone to fitting common low-wave scenarios, often exhibiting systematic biases under conditions such as typhoons and strong winds, resulting in insufficient predictive ability for high-wave areas. Furthermore, a single model structure cannot comprehensively characterize ocean dynamic mechanisms at different scales, such as wide-area wind field driving, local formation mechanisms, and energy transfer paths, further limiting the improvement of prediction performance. Therefore, relying solely on single-stage deep learning models is still insufficient to meet the operational needs for higher accuracy and wider applicability.
[0064] To address the aforementioned issues, existing research has explored various improvements at the model structure level, developing multiple technical approaches. Convolutional Neural Networks (CNNs)-based methods, through local receptive fields, multi-scale convolutional kernels, and deep stacked structures, can effectively extract local spatial features of ocean wave fields. Related work includes modern variants that fuse dilated convolutions, pyramidal convolutions, and attention convolution modules, improving the ability to represent multi-scale spatial processes. Meanwhile, sequence models such as Recurrent Neural Networks (RNNs) and Long Short-Term Memory Networks (LSTMs) are still widely used to learn the evolution of time series data, and further extensions such as gated recurrent structures, bidirectional modeling, and spatiotemporal hybrid structures have emerged, giving them longer-term memory and temporal representation capabilities. Furthermore, the Transformer framework and its variants are gradually becoming a research hotspot for spatiotemporal prediction tasks, possessing the advantage of characterizing long-distance dependencies due to its global self-attention mechanism. Some studies have introduced mechanisms such as relative position encoding, geographic location embedding, fusion of local and global attention, and multi-resolution feature fusion to achieve a balance between large-scale ocean wave propagation and regional local processes. Meanwhile, some works have further improved prediction performance by superimposing model size, introducing multi-source driving variables such as wind field, or combining fusion network structures.
[0065] Despite the continuous progress made by the above methods in terms of expressive power and local prediction accuracy, single-stage models still face challenges in areas such as long-term prediction error accumulation and amplified deviations in high-wave regions, indicating room for further improvement. In recent years, generative models, especially diffusion models, have demonstrated outstanding performance in image and speech generation. By characterizing data distribution and gradually eliminating noise, they excel at learning complex residual structures or difficult-to-model tail features. However, the application of this type of model in ocean dynamic prediction, particularly in the area of significant wave height, is still in the theoretical exploration stage, and there is a lack of mature solutions for effectively utilizing diffusion models to compensate for deep learning prediction errors.
[0066] Based on the above situation, this invention proposes a two-stage spatiotemporal prediction method. First, a deep learning prediction model is used to generate preliminary wave height prediction results. Then, the prediction residuals are learned and corrected based on a diffusion model, thereby improving the overall prediction accuracy and performance in extreme cases. This improves the problems of unstable prediction, error accumulation and significant deviation in high wave areas of existing methods.
[0067] like Figure 1 As shown, this embodiment discloses a two-stage spatiotemporal prediction method for effective wave height based on diffusion residual correction. The method includes the following steps:
[0068] S1: Obtain historical valid wave height data and its corresponding historical wind field data, as well as the concurrent forecast wind field data for the target prediction period;
[0069] S2: Input the historical significant wave height data and its corresponding historical wind field data into the significant wave height spatiotemporal prediction model for processing to obtain preliminary significant wave height prediction results;
[0070] S3: Input the historical significant wave height data, the preliminary significant wave height prediction results, and the concurrent forecast wind field data for the target prediction period into the residual correction module based on the diffusion model to compensate for the preliminary prediction error and obtain the final significant wave height prediction results.
[0071] (I) First Stage
[0072] In this embodiment, as Figure 2 , Figure 3 As shown, the effective wave height spatiotemporal prediction model is an improvement on the 3D-Geoformer model, adopting a dual-stream hybrid modeling architecture, including parallel Geoformer trunk branches and U-Net branches;
[0073] The Geoformer backbone receives historical valid wave height data and its corresponding historical wind field data. Periodic temporal feature encoding is introduced into the embedding module to obtain an input tensor containing temporal embedding representation. The input tensor is then smoothly divided into multiple blocks using an overlapping sliding window, and feature extraction is performed on each block to obtain wave height features. These wave height features are then weighted and fused using a spatial attention mechanism guided by physical distance constraints and wind field vectors to obtain corrected global features. A global feature enhancement mechanism based on frequency domain spectral analysis is used to enhance these global features, resulting in frequency domain enhanced features. Finally, a one-time parallel inference mechanism based on a non-autoregressive architecture is used to decode the frequency domain enhanced features, yielding the global flow prediction result.
[0074] The U-Net branch receives historical valid wave height data and extracts multi-scale spatial features. A Transformer bottleneck layer is embedded on the U-Net basis. After the multi-scale spatial features are processed by the Transformer bottleneck layer, latent features are obtained. Convolutional gated recurrent units are introduced in the U-Net decoding stage, and local flow prediction results are obtained based on the latent features.
[0075] By fusing the global flow prediction results and the local flow prediction results, a preliminary effective wave height prediction result is obtained.
[0076] A spatiotemporal prediction model for effective wave height (SWH) based on an improved 3D-Geoformer is constructed. Utilizing historical SWH fields, the spatiotemporal distribution of SWH for a target time period is predicted, generating preliminary SWH prediction results. The deep learning prediction model possesses the ability to jointly model the spatial distribution characteristics, temporal evolution patterns, and multi-scale propagation processes of ocean waves. An attention-based spatiotemporal prediction model structure is preferred, specifically an improved 3D-Geoformer spatiotemporal prediction architecture. This invention incorporates several improvements in the structural design and training process of this first-stage prediction model to enhance its ability to represent complex ocean wave evolution processes.
[0077] The basic prediction model originates from the 3D-Geoformer spatiotemporal prediction framework, whose core is a typical encoder-decoder structure. In this architecture, the preprocessing module transforms the input ocean-atmosphere variable field into a high-dimensional feature vector through linear embedding, position embedding, and time embedding. The encoder consists of multiple stacked spatiotemporal attention layers. By performing multi-head time-space attention computation, it can simultaneously acquire the long-distance dependencies between variables at all time points, thereby generating a memory matrix that reflects the laws of physical evolution. The decoder, by deconstructing the existing prediction field and combining it with the contextual memory provided by the encoder, uses the time attention module to progressively generate the prediction field for the next time step, and finally maps it back to the original physical space through the output module.
[0078] For the task of predicting significant wave height (SWH), this invention adapts and transforms the aforementioned framework. Although the original model was initially designed for 3D spatiotemporal heterogeneous field prediction such as ENSO, considering the strong spatial correlation of significant wave height in horizontal space (latitude and longitude), and its significant nonlinear fluctuation characteristics due to the influence of wide-area wind fields and local topography over time, the global self-attention mechanism of this model is very suitable for capturing the energy transmission path of ocean waves. In this embodiment, the traditional 3D field prediction is simplified to continuous prediction of the 2D spatiotemporal distribution (longitude × latitude × time) of the sea surface. By using the 2D significant wave height fields at multiple historical moments as input, and leveraging the model's ability to learn the spatial teleconnectivity of ocean waves during the encoding stage and its ability to remember temporal evolution trends during the decoding stage, preliminary modeling of future multi-time-dependent significant wave height distribution fields is achieved.
[0079] Key improvements to the 3D-Geoformer model structure include a temporal embedding mechanism that integrates physical periodic features, a smooth segmentation and fusion strategy based on overlapping sliding windows, a spatial attention mechanism based on physical distance constraints and wind field vector guidance, a global feature enhancement mechanism based on frequency domain spectral analysis, a one-time parallel inference mechanism based on a non-autoregressive architecture, and a two-stream hybrid modeling architecture based on U-Net and Transformer.
[0080] (1) Temporal embedding mechanism that integrates physical periodic features
[0081] Given the significant annual periodicity (e.g., monsoon influence) and seasonal evolution of significant wave height (SWH), the original 3D-Geoformer model's embedding module (make_embedding) only employs relative position encoding based on sequence indexing, failing to explicitly capture the impact of actual physical time on wave energy distribution. Therefore, this invention reconstructs the input embedding layer, proposing a hybrid embedding method that integrates physical time features. Specifically, in addition to retaining the original linear embedding and spatial embedding that map grid data to feature vectors, this invention introduces periodic temporal feature encoding.
[0082] This invention converts the physical timestamp corresponding to the input data into a Day of Year. ) and Hour of Day This is achieved by mapping the time to a continuous periodic numerical space through trigonometric function transformations, thus addressing the problem of discontinuous time values (e.g., December 31st and January 1st are physically continuous but numerically discontinuous). Physical time feature vector The calculation formula is as follows:
[0083]
[0084] To align this physical time feature with the model's high-dimensional hidden layer space, this invention utilizes a learnable linear projection layer. Map it to the hidden layer dimension of the model Consistent dimensions, and encoded with the original sequence position. The fusion is performed. The improved final temporal embedding representation is then obtained. The calculation is as follows:
[0085]
[0086] in, This is an improvement over the existing Transformer-based sine and cosine relative position encoding. For a multilayer perceptron mapping layer, This is a learnable balance coefficient (or can be set to 1).
[0087] Final input tensor Represented as:
[0088]
[0089] in, The original input is grid data (i.e., historical effective wave height field sequence). Spatial Embedding. This is a linear mapping layer that maps the original data into high-dimensional feature vectors.
[0090] Through the above improvements, the model explicitly incorporates the seasonal prior knowledge of the wave field during the encoding stage, enabling the prediction model to make more accurate trend inferences based on the physical time context when dealing with abrupt changes in effective wave height during typhoon season or monsoon transition period, which is significantly better than traditional methods that rely solely on sequence order.
[0091] (2) Smooth segmentation and fusion strategy based on overlapping sliding windows
[0092] When processing large-format spatial data, 3D-Geoformer employs a non-overlapping slicing method (i.e., the sliding step size equals the slice size), which causes numerical abrupt changes in the effective wave height field of the predicted output at the slice boundaries, resulting in obvious "blocky" artifacts or stitching marks. This invention proposes an improved strategy of overlapping block input and averaging fusion of overlapping regions.
[0093] Specifically, during the data input phase (corresponding to the `unfold_func` operation), this invention modifies the original segmentation logic, setting the step size of the sliding window (Stride, Smaller than the patch size This creates a bandwidth of [missing information] between adjacent slices. The overlapping region. This means the same grid point in the original spatial field. It will be included in multiple different input patches, which will then be fed into the model for feature extraction and prediction, thus enabling the point to integrate contextual information from different receptive fields.
[0094] In the decoding output and spatial reconstruction stage (corresponding to fold_func and subsequent processing), for overlapping regions that have been predicted multiple times in space, this invention does not use a simple overlay operation, but instead employs a weighted average method for fusion. Assume the reconstructed cumulative prediction field is... At the same time, a counting matrix with the same spatial size is constructed. This is used to record the number of times each grid point is predicted. The final smoothed prediction field. The calculation is as follows:
[0095]
[0096] in, Represents grid points Smoothed forecast value, Represents grid points The cumulative predicted value, Represents grid points The counting matrix, Indicates the first Each patch is a grid point The predicted value, This represents the total number of times the point is covered. This overlapping sampling and averaging fusion mechanism effectively eliminates the truncation effect at slice edges, significantly improving the continuity and smoothness of the effective wave height prediction field in spatial distribution, and better reflecting the physical characteristics of real ocean wave propagation.
[0097] (3) Spatial attention mechanism based on physical distance constraints and wind field vector guidance
[0098] The spatial attention mechanism based on physical distance constraints and wind field vector guidance includes: calculating the spherical great circle distance matrix between all pairs of spatial grid points and converting it into a distance weight matrix; extracting the meridional and zonal wind field components from historical wind field data synchronized with historical effective wave height data and mapping them into a wind field bias matrix; and introducing the distance weight matrix and wind field bias matrix on the basis of standard dot product attention to obtain a spatial attention score matrix.
[0099] To address the issue that the spatial attention module (S_attention) in the original 3D-Geoformer model relies solely on the similarity of hidden layer features to calculate global correlations, neglecting the physical spatial constraints and dynamic driving mechanisms of wave propagation, this invention proposes a novel physically-aware spatial attention mechanism. Existing global attention calculations easily lead to the model establishing false strong correlations (i.e., "spurious correlations") between vastly different unrelated sea areas, and it struggles to explicitly capture the direct driving effect of wind on waves. Therefore, this invention introduces a static physical distance bias term and a dynamic wind field guidance bias term based on the standard Scaled Dot-Product Attention.
[0100] Specifically, the improved attention calculation process includes two core revisions:
[0101] First, a distance-guided bias is introduced. Based on the physical property that effective wave height attenuates with propagation distance, the mutual influence between two points should decrease with increasing geographical distance. This invention pre-calculates the great circle distance matrix between all pairs of spatial grid points. It is then transformed into a distance weight matrix using a Gaussian kernel function or a learnable mapping. This matrix is added as a static bias to the attention score, forcing the model to focus more on nearby and mid-to-long-distance sea areas with physical causal relationships, and suppressing non-physical long-distance noise.
[0102] Second, a wind-field guided bias is introduced. Considering that the main energy of ocean waves originates from the sea surface wind field, this invention extracts the wind field vector from the input wind field data. (Zoological wind) and The (meridional wind) component is mapped to a wind field bias matrix of the same size as the attention map through a lightweight convolutional projection layer. This bias term enables the attention mechanism to dynamically perceive the modulating effect of wind direction and speed on the direction of wave energy transmission (e.g., the weight of the upwind region on the downwind region should be increased).
[0103] Improved spatial attention score matrix The calculation formula is as follows:
[0104]
[0105]
[0106] in, , , These are the query, key, and value vectors, respectively, representing the spatial dimensions. For the pre-computed spatial distance weight matrix, its elements Or adopt form; This is a dynamic bias term generated from the wind field components at the current moment; , The equilibrium coefficients are learnable. Through the above improvements, the model not only retains its ability to capture global teleconnections, but also explicitly integrates the geographical constraints and dynamic driving mechanisms of wave propagation, significantly improving the realism of physical field predictions.
[0107] (4) Global feature enhancement mechanism based on frequency domain spectral analysis
[0108] The global feature enhancement mechanism based on frequency domain spectral analysis includes: orthogonally transforming the input deep features from the spatial domain to the frequency domain to obtain complex spectral features in the frequency domain; adaptively weighting the different frequency components of the complex spectral features using a complex weight matrix in the frequency domain to screen and enhance key wave modes; restoring the modulated spectral features back to the spatial domain, processing them through a multilayer perceptron, and then fusing them with the input deep features through residual connections to obtain frequency domain enhanced features.
[0109] To address the problem that traditional deep learning models, which primarily perform calculations in the spatial domain, struggle to explicitly extract and capture the multi-scale periodic fluctuations and energy dispersion characteristics implicit in ocean wave fields, this invention introduces a frequency domain analysis block in parallel into the encoder structure of a 3D-Geoformer. As a typical physical wave field, the significant wave height field often exhibits a more pronounced sparsity and regularity in its energy distribution in the frequency domain compared to the spatial domain.
[0110] In its specific implementation, this invention utilizes Fast Fourier Transform (FFT) to orthogonally transform the input deep feature map from the spatial domain to the frequency domain. Within the frequency domain, a learnable complex weight matrix is used to adaptively weight or filter the spectral components at different frequencies to extract key wave modes that dominate future sea state evolution (typically corresponding to low-frequency large-scale energy transfer and high-frequency local wind and wave characteristics). Finally, the processed spectral features are restored back to the spatial domain using Inverse Fast Fourier Transform (iFFT) and fused with the original spatial domain features. This process not only achieves a global receptive field with near-linear computational complexity but also effectively captures the inherent physical periodicity of wave propagation.
[0111] Input features are The mathematical expression for this frequency domain enhancement process is as follows:
[0112]
[0113]
[0114] in, and These represent the two-dimensional fast Fourier transform and its inverse transform, respectively; The complex spectral characteristics in the frequency domain; These are learnable complex weights in the frequency domain, used to filter and modulate specific spectral components. This is the final feature output after frequency domain enhancement and superimposed residual connections. This module is a mapping function for extracting the real part of complex numbers. By introducing this module, the model can simultaneously utilize both "local features in the spatial domain" and "global periodic features in the frequency domain," significantly improving its ability to characterize the evolution of wave height fields under complex sea conditions.
[0115] (5) One-time parallel inference mechanism based on non-autoregressive architecture
[0116] The one-time parallel inference mechanism based on the non-autoregressive architecture includes: based on the time average field of the historical input sequence, it is copied and extended to the target prediction duration in the time dimension to form the initial query input; through the spatiotemporal attention mechanism in the decoder, the correlation between the initial query input and the memory matrix output by the encoder is calculated at one time to establish a direct mapping relationship between the historical observation sequence and the prediction field at multiple future times; based on the direct mapping relationship, the global flow prediction result is generated at one time.
[0117] To address the problem of prediction errors being propagated and amplified step by step with increasing time steps (i.e., the "exposure bias" phenomenon) caused by the auto-regressive inference mode commonly used in original 3D-Geoformer and traditional time series prediction models, which uses the predicted value of the previous time step as input to generate the result of the next time step through "rolling prediction", this invention reconstructs the decoding and inference process of the model and proposes a one-shot parallel inference mechanism based on a non-autoregressive architecture.
[0118] Specifically, this invention abandons the serial recursive generation method and aims to establish a direct mapping relationship between historical observation sequences and future multi-time prediction fields. In the decoder input stage, instead of relying on pseudo-historical data generated by the model itself, an initialization query tensor containing a complete future time dimension is constructed. In this embodiment, for historical significant wave height data and corresponding historical wind field data (meridian and zonal winds), the time average field or specific statistical feature map of the historical input sequence (i.e., the step size of the input historical data) is used to replicate and extend it in the time dimension to the target prediction duration. This forms the initial query input for the decoder. The model uses a spatiotemporal attention mechanism to compute data in one go. The memory matrix output by the encoder in 3D-Geoformer The relationship between them directly outputs all future values. The effective wave height field at each moment.
[0119] The main difference in the mathematical expression of this process lies in the fact that the traditional autoregressive model is: , for The prediction results for the time period, for The prediction result at time step, and the parallel inference mode of this invention is as follows:
[0120]
[0121] in, For the initial spatiotemporal query tensor, This is a tensor containing predictions for all future times, generated in a single operation. In this way, the future... The prediction result at time no longer explicitly depends on the first time. The predicted value at any given time fundamentally cuts off the error propagation link in the recursive process, significantly improving the stability and accuracy of the model in long-term predictions (such as the next 72 hours or more).
[0122] (6) A two-stream hybrid modeling architecture based on U-Net and Transformer
[0123] To address the contradiction that a single Transformer architecture is prone to losing local high-frequency details (such as nearshore wave textures or small-scale storm centers) during downsampling or tokenization when processing high-resolution ocean wave fields, and that a single CNN architecture struggles to capture long-distance teleconnection features, this invention designs a dual-stream hybrid modeling architecture based on 3D-Geoformer and U-Net. This architecture comprises two parallel processing paths: one retains the original Geoformer backbone as a "global stream" to capture large-scale wave evolution trends; the other is an improved U-Net embedded with a Transformer bottleneck layer and ConvGRU units as a "local stream" to refine the recovery of spatial details and enhance temporal coherence.
[0124] In practice, input data is simultaneously fed into both the global and local streams. In the local stream (U-Net branch), multi-scale spatial feature maps are first extracted through successive convolutional and pooling layers. To capture temporal evolution patterns even at low-resolution bottleneck layers, this invention embeds a miniature Transformer core at the bottom layer of U-Net. This core performs sequence modeling on the encoded spatiotemporal feature sequence, outputting latent features with temporal predictive capabilities. .
[0125] More importantly, in the decoding stage of U-Net, this invention introduces a Convolutional Gated Recurrent Unit (ConvGRU) to replace the traditional simple concatenation operation, thereby enhancing spatiotemporal recursive memory. At each time step... and each scale level The ConvGRU unit fuses the upsampled features of the current layer. The skip connection features corresponding to the encoder and the decoding state at the previous moment. This process ensures that the recovery of local details depends not only on the spatial information at the current moment but also on the explicit constraints of historical states. Finally, the model fuses the two outputs through a weighted summation.
[0126] State updates and final mixed output of ConvGRU in local flow The calculation formula is as follows:
[0127]
[0128]
[0129] in, The prediction field is the output of the global stream. The predicted field after local flow is reconstructed layer by layer by ConvGRU. The equilibrium coefficient is used. Through this dual-flow hybrid design, the model maintains accurate control over the wave propagation trend across the entire ocean while significantly improving its ability to reproduce the high-gradient wave height field near the eye of the typhoon and along the coast.
[0130] The effective wave height spatiotemporal prediction model based on the improved 3D-Geoformer is trained to obtain the trained effective wave height spatiotemporal prediction model based on the improved 3D-Geoformer.
[0131] This invention constructs a model training set based on significant wave height reanalysis data of a selected ocean region. A portion of the ocean area is selected, with a spatial resolution of [missing information]. (Corresponding to a grid size of 120×120), with a time resolution of 3 hours. For time series modeling, a sliding window method was used to construct sample pairs. The input sequence length was set to 24 time steps (i.e., data from the past 3 days), and the predicted sequence length was also 24 time steps. The dataset was strictly divided according to chronological order; for example, data from 2012 to 2020 was used as the training set for parameter optimization, data from 2021 was used as the evaluation set for monitoring model performance during training, and data from 2022 was used as the validation set for final testing. Model training followed... Figure 4 As shown. The chronological division of the dataset can be flexibly configured according to the actual situation, without specific limitations. In the preprocessing stage, interpolation is used to complete missing data, and a land-sea masking module is introduced to calculate the loss only for the ocean region, preventing gradient generation in the land region.
[0132] To overcome the problem that traditional mean square error (MSE) loss functions easily lead to blurred edges and loss of high-frequency details in predicted images, this invention proposes a combined loss function that integrates pixel-level error and texture gradient error. This loss function consists of two parts: a weighted root mean square error (RMSE) term and a Sobel gradient loss term. The RMSE term focuses on numerical accuracy, while the gradient loss term forces the model to learn the edge texture and extreme value distribution of the wave field by calculating the spatial gradient differences between the predicted and true fields in the horizontal and vertical directions. Total loss function. The calculation formula is as follows:
[0133]
[0134]
[0135]
[0136] in, For mean square error loss, This represents the total number of effective grid points within the entire spatial field. For grid points ( The true value of ) For grid points ( The predicted value of ) For gradient loss, and These represent the horizontal and vertical gradients extracted using the Sobel operator, respectively. and To balance the weighting coefficients, they are set to 1.0 and 0.35 respectively in this embodiment. By introducing gradient constraints, the model's sensitivity to high-gradient regions such as the eye of a typhoon is significantly improved.
[0137] The model was trained using the AdamW optimizer, with initial weight decay set to [value missing]. To achieve rapid convergence in the early stages of training and fine-grained search for the optimal solution in the later stages, this invention employs a one-cycle learning rate scheduling strategy. The learning rate exhibits a trend of first increasing and then decreasing, with the peak learning rate set to [value missing]. Furthermore, a cosine annealing strategy is employed for smooth transition. In addition, to address the exposure bias problem in sequence prediction tasks, this invention introduces a dynamic teacher coercion mechanism. In the early stages of training, the teacher coercion ratio is high, using real labels as decoder input to stabilize training; as the number of iterations increases, this ratio follows an exponential function. The loss is gradually reduced to 0.02, forcing the model to gradually adapt to the prediction flow generated by the autoregression, thereby enhancing the robustness of the inference phase. An early stopping mechanism is configured during training, automatically terminating training if the evaluation set loss does not decrease within 20 consecutive epochs to prevent overfitting.
[0138] (II) Second Stage
[0139] In this embodiment, the construction process of the residual correction module based on the diffusion model includes: at any denoising time step of the diffusion model, an input tensor is constructed based on the noisy residual field of the current denoising time step, the preliminary effective wave height prediction result, the meridional wind field component of the same-time forecast, the zonal wind field component of the same-time forecast, and the forecast duration encoding channel; based on weighted denoising learning of continuous noise level sampling, the diffusion model is trained to restore the true residual structure from residual samples of noise pollution of different intensities; in the inference stage, a deterministic ordinary differential equation solver is used to generate a residual correction field by iteratively denoising from the Gaussian noise field, under the joint constraints of the preliminary effective wave height prediction result, the meridional wind field component of the same-time forecast, and the zonal wind field component of the same-time forecast, starting from the Gaussian noise field; the residual correction field is superimposed on the preliminary effective wave height prediction result to obtain the final effective wave height prediction result.
[0140] Based on the preliminary effective wave height prediction results obtained in the first stage, a residual learning and correction module based on the diffusion model (the residual correction module based on the diffusion model) is constructed to model and generate the error field between the deep learning predictions and the actual observations. By learning the distribution characteristics of the prediction residuals during random noise disturbance and stepwise reverse denoising inference, the second stage can compensate for the systematic biases and complex local errors that the model could not fully learn in the first stage, thereby reducing the accumulation of prediction errors with forecast lead time and improving prediction performance under extreme sea state conditions.
[0141] In this embodiment, a generative residual repair mechanism based on an EDM architecture (a diffusion model based on U-Net) is constructed, aiming to recover the high-frequency details and physical structure lost in the first-stage prediction through a deterministic iterative denoising process. First, the residual field for the effective wave height prediction is defined. For the actual observation field The base prediction field of the first-stage improved 3D-Geoformer model The difference between them, i.e. The residual field physically carries the nonlinear wave components not captured by the model and the systematic biases under extreme sea conditions.
[0142] It should be noted that the second-stage diffusion model learns the residuals, which are the base prediction fields. The difference between the two is calculated by the data input to the diffusion model, as mentioned earlier. The input consists of historical significant wave height data, preliminary prediction results, and the concurrently forecasted wind field for the target prediction period. The preliminary prediction results form the basis of the 3D-Geoformer model's prediction field, while the actual observed field refers to the historical significant wave height data (which is equivalent to the actual data). In the second stage, the diffusion model internally calculates the difference between the actual data and the preliminary prediction results; this difference is also used during training and is referred to as the residual.
[0143] Unlike traditional probabilistic diffusion models that focus on generative diversity, this invention leverages the powerful distribution mapping capabilities of diffusion models as a conditional denoiser. During the training phase, the model learns how to reconstruct the true residual structure from residual samples contaminated with Gaussian noise of varying intensities. In the inference phase, random sampling is no longer performed; instead, a deterministic ordinary differential equation (ODE) solver based on the Heun algorithm is employed. This process starts from a standard Gaussian noise field and establishes a basic prediction field in the first stage. and the wind field forecast at the same time Under the joint constraints, by gradually stripping away noise, a residual correction field highly consistent with the current sea state dynamic mechanism is generated. The processed residual correction field is then added to the basic prediction field to obtain the corrected final prediction result. This physically guided generation method, which incorporates wind field driving information, enables the model to accurately correct the spatial texture and extreme value distribution of the wave height field based on the forcing effect of wind speed and direction, ultimately achieving refined correction of the effective wave height.
[0144] The diffusion model designed in this invention adopts an improved U-Net network architecture. Its core innovation lies in constructing a condition-guided mechanism that jointly constrains multi-dimensional physical variables. In order to ensure that the generated residual field can accurately match the current meteorological background and the prediction deviation pattern of the first stage, the model does not simply use the noisy residual as input, but explicitly inputs the basic prediction results of the first stage, physical driving variables, and time indicator variables into the input layer of the network.
[0145] At any time step in the diffusion process, the network's input tensor It is composed of the following five feature channels stitched together in the depth dimension: the noisy residual field of the current denoising step. The first stage Geoformer model output of the basic effective wave height prediction field Meridional wind field components predicted during the same period Zonal wind field components predicted during the same period and normalized forecast duration coding channel This design forces the convolutional network to reference the morphological distribution of the base prediction field and the dynamic driving direction of the wind field as soon as it extracts features, thereby ensuring that the generated residual correction is highly consistent with the physical evolution of ocean waves in terms of spatial structure. The formula for constructing the input tensor is as follows:
[0146]
[0147] in, This is for splicing operations.
[0148] In the process of feature extraction within the network, to precisely control the degree of denoising, this invention introduces a noise embedding mechanism based on feature linear modulation. (Noise standard deviation) First, it is mapped to a high-dimensional feature vector using sinusoidal embedding and a multilayer perceptron (MLP). Subsequently, in each residual module of U-Net, this vector is used to generate the corresponding scaling factor. Translation coefficient For the normalized feature map An affine transformation is performed. This mechanism allows the network to adaptively adjust the feature distribution based on the current noise intensity, thus focusing on global contour restoration in the early stages of denoising and on fine-tuning of minute textures in the later stages. The feature modulation process is described below:
[0149]
[0150] in, For characteristic linear modulation operation, This is a grouping normalization operation.
[0151] By combining the hard constraints (physical field splicing) at the input end with the soft conditions (noise level control) within the network, the diffusion model successfully established a high-dimensional mapping relationship from the coarse prediction field to the fine residual field.
[0152] This invention has specially designed the training and inference process of the diffusion model. Unlike the traditional discrete-time step probability model, this embodiment adopts continuous noise level modeling based on EDM theory and a second-order deterministic sampling strategy. The specific process includes two stages: weighted denoising learning in the training stage and residual generation and correction in the inference stage.
[0153] 1) Training phase: Weighted denoising learning based on log-normal distribution
[0154] During training, the input tensor is fed into the diffusion model, and a noise embedding mechanism based on feature linear modulation is introduced to adaptively adjust the feature distribution inside the network according to the noise level.
[0155] During training, the model aims to learn how to recover a clean residual field from noise of arbitrary intensity. First, this invention abandons the fixed discrete time step and instead uses a log-normal distribution. Standard deviation of continuous sampling noise This is to cover a wide noise range, from minor perturbations to complete signal destruction. Next, noisy residual samples are constructed using reparameterization techniques. ,in It is standard Gaussian noise.
[0156] Model Acceptance , and physical conditions Using base forecasts, wind field, etc. as input, directly predict the clean residual after denoising. To balance the learning difficulty under different noise levels, this invention employs an EDM weighted loss function, using dynamic weights. This allows the model to focus on overall structure recovery (high-noise areas) in the early stages of training and on detail texture correction (low-noise areas) in the later stages. Loss function The formula is as follows:
[0157]
[0158] in, For noise standard deviation Compared with standard Gaussian noise The mathematical expectation, For parameters A denoising neural network. Weighting coefficients. , The weight design, which represents the predicted standard deviation of the data distribution, ensures the consistency and stability of the training gradient across the entire noise variance scale.
[0159] 2) Inference Stage: Deterministic Residual Generation Based on Heun Solver
[0160] In the application phase, the residual correction process is modeled as a problem of solving an ordinary differential equation (ODE) that evolves from a Gaussian white noise distribution to the true residual data distribution. This invention employs Heun's second-order improved Euler algorithm as the ODE solver to achieve high-precision, low-step, and fast sampling.
[0161] First, the noise sequence is discretized into 18 decreasing noise levels according to the Karras scheduling strategy. Sampling from pure random noise start, Given the initial state of pure random noise, in each denoising step... In the first step, the model is used to perform first-order Euler prediction to obtain intermediate states. Then, these intermediate states are used to estimate correction terms for second-order trapezoidal correction. The iterative update formula for each step is as follows:
[0162]
[0163]
[0164] in, The denoised derivative at the current point. This represents the intermediate state of the noisy residual in the current denoising step. Let be the derivative of the Euler prediction point. Through this deterministic iterative denoising, the model can robustly "solve out" the residual field that best matches the current physical conditions. .
[0165] 3) Overlay and reconstruction of final predicted values
[0166] The correction residual obtained after the above diffusion generation process The values are standardized. Finally, they are denormalized and superimposed back onto the base prediction field from the first stage. The final effective wave height prediction result is obtained. :
[0167]
[0168] in, This is the inverse normalization function, used to restore the standardized correction residuals to their original physical dimensions. This refers to the element-wise multiplication operation of matrices. This is a land-sea mask matrix used to restrict residual correction to only take effect in the ocean region, thus avoiding interference with the land grid.
[0169] This overlay process not only corrects the numerical bias in the basic prediction, but more importantly, it introduces rich high-frequency texture details through the residual field, thereby achieving a refined reconstruction of the spatiotemporal distribution of ocean waves.
[0170] The two-stage spatiotemporal prediction framework proposed in this invention focuses on modeling the overall evolution trend and spatial structure of significant wave height in the first stage model, while the second stage diffusion model focuses on learning and correcting the prediction residuals. The two work together to improve the overall accuracy and reliability of significant wave height prediction while maintaining prediction stability.
[0171] In summary, this invention significantly improves the accuracy and physical consistency of effective wave height spatiotemporal prediction by constructing a two-stage prediction framework based on physically-perceived improved 3D-Geoformer and diffusion residual correction.
[0172] Compared to traditional numerical models that rely on high computing power and are time-consuming, and existing single deep learning models that are prone to long-term error accumulation, this invention, in its first stage, introduces a time embedding mechanism that integrates physical cycle features, a wind field vector-guided attention mechanism, and a frequency domain analysis module. This enables the model to explicitly capture the seasonal fluctuation patterns of ocean waves and long-distance energy transfer characteristics, enhancing the model's interpretability. Simultaneously, by employing a one-time parallel inference mechanism based on a non-autoregressive architecture combined with an overlapping block fusion strategy, the error propagation chain in traditional recursive prediction is fundamentally blocked, effectively eliminating spatial block artifacts in the prediction field and significantly enhancing the model's numerical stability and spatial smoothness in forecasts with a lead time of 72 hours and longer.
[0173] Furthermore, this invention innovatively introduces a diffusion model based on the EDM architecture to finely reconstruct the prediction residuals, effectively solving the problems of "loss of high-frequency details" and "underestimation of extreme values" caused by the smoothing effect of the loss function in conventional deep learning models under extreme sea conditions (such as typhoons and cold waves). By injecting the basic prediction field, the synchronous wind field dynamic factor, and the prediction time-related encoding as multi-dimensional physical strong conditions into the diffusion generation process, this invention can deterministically recover the high-frequency texture details and nonlinear wave components missed by the first-stage model. This "coarse prediction + fine correction" mechanism not only significantly reduces the root mean square error (RMSE) of the final generated wave field, but also greatly improves the peak capture capability in high-gradient regions such as the eye of the typhoon. The output results are more consistent with the real ocean dynamic characteristics in terms of texture structure and extreme value distribution, and can better meet the operational needs of refined marine disaster prevention and mitigation.
[0174] In some implementations, although this embodiment preferably employs a specifically modified 3D-Geoformer model, the core of the first stage lies in "extracting spatiotemporal features and generating a preliminary prediction field using deep learning." Therefore, this part of the model structure can be replaced with other neural network architectures with spatiotemporal modeling capabilities.
[0175] (1) Recurrent Neural Network (RNN) based architecture: Variants such as ConvLSTM (Convolutional Long Short-Term Memory Network), TrajGRU (Trajectory Gated Recurrent Unit), or PredRNN can be used. These models can also achieve spatiotemporal sequence prediction of effective wave height by passing historical states through recurrent units.
[0176] (2) Convolutional Neural Network (CNN) based architecture: 3D-CNN, ResNet (residual network) combined with U-Net architecture can be adopted, or Temporal Convolutional Network (TCN) based on dilated convolution can be used. Such models capture local and global features by stacking convolutional layers and can also be used as basic predictors.
[0177] (3) Other Transformer variants: In addition to Geoformer, Swing Transformer, Informer, Autoformer, or standard Vision Transformer (ViT) and its video prediction variants (such as VideoSwin Transformer) can also be used. Any model that has a self-attention mechanism and can process spatiotemporal sequence data can replace the first-stage model of this invention.
[0178] (4) Replacement of inference mode: This embodiment adopts a non-autoregressive one-time parallel inference mode. Alternatively, the first-stage model can also adopt the traditional autoregressive inference mode, that is, gradually generate the predicted values of future times and use the output of the previous step as the input of the next step.
[0179] In some implementations, this embodiment employs a deterministic ODE solver based on an EDM (Elucidated Diffusion Models) architecture, but the core of the second stage lies in "learning the residual distribution using a generative model." Therefore, this part can utilize other types of generative models or diffusion model variants:
[0180] Replacement of the sampling strategy in the diffusion model:
[0181] (1) The classic DDPM (Denoising Diffusion Probabilistic Models) architecture can be adopted, and Markov chains can be used for random sampling generation.
[0182] (2) DDIM (Denoising Diffusion Implicit Models) can be used to accelerate the inference process through skip sampling.
[0183] (3) Score-based generative models can be used to generate residuals by learning the gradient field (Score Function) of the data distribution and solving stochastic differential equations (SDE).
[0184] (4) Latent Diffusion: In this embodiment, diffusion is performed directly in the pixel space. Alternatively, a variational autoencoder (VAE) can be pre-trained to compress the residual field into a low-dimensional latent space, perform the diffusion process within the latent space, and finally decode back to the pixel space. This approach can further reduce the computational cost.
[0185] Replacement of conditional injection method: This embodiment adopts a channel-cascaded strong conditional method. As an alternative, a cross-attention mechanism can be used to inject the basic prediction field and wind field information as key / value into the network, or an adaptive normalization layer (AdaGN) can be used for conditional modulation.
[0186] In some implementations, this embodiment uses significant wave height (SWH) and a 10-meter wind field ( , This serves as the primary driving variable. In practical applications, other physical variables can be added or replaced based on the available data.
[0187] Add ocean physical variables: Sea surface pressure (MSLP), sea surface temperature (SST), water depth (Bathymetry, which is especially important for nearshore wave prediction) or flow field data can be introduced as additional channel inputs.
[0188] Replace the wind field representation: Use the sine / cosine values of the angles for wind speed and wind direction. / Quantity.
[0189] Incorporate multi-source data: Input data is not limited to reanalysis data, but can also incorporate satellite altimeter observation data, buoy measurement data, or radar observation data.
[0190] In some implementations, variations of the loss function are used:
[0191] For the first stage, in addition to MSE and Sobel gradient loss, L1 loss (MAE), perceptual loss, or structural similarity loss (SSIM Loss) can also be introduced.
[0192] For the second-stage diffusion model, in addition to the weighted loss of EDM, the standard variational lower bound loss or the simple noise prediction mean square error can be used.
[0193] Variations of the segmentation strategy: This embodiment employs an overlapping sliding window fusion strategy. Alternatively, non-overlapping segments can be used with feathering at the boundaries, or the entire image can be downsampled before being input into the model.
[0194] Example 2
[0195] This embodiment discloses an effective wave height two-stage spatiotemporal prediction system based on diffusion residual correction, including:
[0196] The data acquisition module is configured to acquire historical significant wave height data and its corresponding historical wind field data, as well as the concurrent forecast wind field data for the target prediction period.
[0197] The first-stage prediction module is configured to input the historical significant wave height data and its corresponding historical wind field data into the significant wave height spatiotemporal prediction model for processing, and obtain preliminary significant wave height prediction results.
[0198] The second-stage compensation module is configured to input the historical significant wave height data, the preliminary significant wave height prediction results, and the concurrent forecast wind field data for the target prediction period into the residual correction module based on the diffusion model to compensate for the preliminary prediction error and obtain the final significant wave height prediction results.
[0199] The construction process of the residual correction module based on the diffusion model includes:
[0200] At any denoised time step of the diffusion model, an input tensor is constructed based on the noisy residual field of the current denoised time step, the preliminary effective wave height prediction results, the meridional wind field component of the same forecast, the zonal wind field component of the same forecast, and the forecast duration encoding channel.
[0201] Based on weighted denoising learning using continuous noise level sampling, a diffusion model is trained to reconstruct the true residual structure from residual samples contaminated with noise of different intensities.
[0202] During the inference phase, a deterministic ordinary differential equation solver is used. Starting from the Gaussian noise field, and under the joint constraints of the preliminary effective wave height prediction results, the meridional wind field component predicted at the same time, and the zonal wind field component predicted at the same time, the residual correction field is generated through stepwise iterative denoising.
[0203] The residual correction field is superimposed on the preliminary effective wave height prediction result to obtain the final effective wave height prediction result.
[0204] Example 3
[0205] The purpose of this embodiment is to provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method of Embodiment 1.
[0206] Example 4
[0207] The purpose of this embodiment is to provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the method of Embodiment 1.
[0208] The steps and methods involved in the apparatuses of Embodiments 3 and 4 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.
[0209] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.
[0210] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0211] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A two-stage spatiotemporal prediction method for effective wave height based on diffusion residual correction, characterized in that, include: Acquire historical valid wave height data and its corresponding historical wind field data, as well as the concurrent forecast wind field data for the target prediction period; The historical significant wave height data and the corresponding historical wind field data are input into the significant wave height spatiotemporal prediction model for processing to obtain preliminary significant wave height prediction results. The historical significant wave height data, the preliminary significant wave height prediction results, and the concurrent forecast wind field data for the target prediction period are input into the residual correction module based on the diffusion model to compensate for the preliminary prediction error and obtain the final significant wave height prediction results. The construction process of the residual correction module based on the diffusion model includes: At any denoised time step of the diffusion model, an input tensor is constructed based on the noisy residual field of the current denoised time step, the preliminary effective wave height prediction results, the meridional wind field component of the same forecast, the zonal wind field component of the same forecast, and the forecast duration encoding channel. Based on weighted denoising learning using continuous noise level sampling, a diffusion model is trained to reconstruct the true residual structure from residual samples contaminated with noise of different intensities. During the inference phase, a deterministic ordinary differential equation solver is used. Starting from the Gaussian noise field, and under the joint constraints of the preliminary effective wave height prediction results, the meridional wind field component predicted at the same time, and the zonal wind field component predicted at the same time, the residual correction field is generated through stepwise iterative denoising. The residual correction field is superimposed on the preliminary effective wave height prediction result to obtain the final effective wave height prediction result.
2. The effective wave height dual-stage spatiotemporal prediction method based on diffusion residual correction as described in claim 1, characterized in that, During training, the input tensor is fed into the diffusion model, and a noise embedding mechanism based on feature linear modulation is introduced to adaptively adjust the feature distribution inside the network according to the noise level.
3. The effective wave height two-stage spatiotemporal prediction method based on diffusion residual correction as described in claim 1, characterized in that, The effective wave height spatiotemporal prediction model is an improvement on the 3D-Geoformer model, which adopts a dual-stream hybrid modeling architecture, including parallel Geoformer trunk branches and U-Net branches; The Geoformer backbone receives historical valid wave height data and its corresponding historical wind field data. It introduces periodic time feature encoding in the embedding module to obtain an input tensor with time embedding representation. The input tensor is then smoothly divided into multiple input blocks based on overlapping sliding windows, and feature extraction is performed on each block to obtain wave height features. Wave height features are weighted and fused using a spatial attention mechanism based on physical distance constraints and wind field vector guidance to obtain corrected global features. These global features are then enhanced using a global feature enhancement mechanism based on frequency domain spectral analysis to obtain frequency domain enhanced features. Finally, the frequency domain enhanced features are decoded using a one-time parallel inference mechanism based on a non-autoregressive architecture to obtain global flow prediction results. The U-Net branch receives historical valid wave height data, extracts multi-scale spatial features, and embeds a Transformer bottleneck layer on the basis of U-Net. After the multi-scale spatial features are processed by the Transformer bottleneck layer, latent features are obtained. In the U-Net decoding stage, a convolutional gated recurrent unit is introduced to reconstruct local flow prediction results based on latent features. By fusing the global flow prediction results and the local flow prediction results, a preliminary effective wave height prediction result is obtained.
4. The effective wave height dual-stage spatiotemporal prediction method based on diffusion residual correction as described in claim 3, characterized in that, The spatial attention mechanism based on physical distance constraints and wind field vector guidance includes: Calculate the spherical great circle distance matrix between all pairs of spatial grid points and transform it into a distance weight matrix; Extract the meridional and zonal wind field components from historical wind field data synchronized with historical significant wave height data, and map them into a wind field offset matrix. Based on standard dot product attention, a distance weight matrix and a wind field bias matrix are introduced to obtain a spatial attention score matrix.
5. The effective wave height dual-stage spatiotemporal prediction method based on diffusion residual correction as described in claim 3, characterized in that, The global feature enhancement mechanism based on frequency domain spectral analysis includes: The input deep features are orthogonally transformed from the spatial domain to the frequency domain to obtain complex spectral features in the frequency domain; In the frequency domain, a complex weight matrix is used to adaptively weight different frequency components of the complex spectral features to screen and enhance key wave modes. The modulated spectral features are restored back to the spatial domain, processed by a multilayer perceptron, and then fused with the input deep features through residual connections to obtain frequency domain enhanced features.
6. The effective wave height dual-stage spatiotemporal prediction method based on diffusion residual correction as described in claim 3, characterized in that, The one-time parallel inference mechanism based on the non-autoregressive architecture includes: Based on the time average field of the historical input sequence, it is replicated and extended in the time dimension to the target prediction duration to form the initial query input; By using the spatiotemporal attention mechanism in the decoder, the correlation between the initial query input and the memory matrix output by the encoder is calculated at once, and a direct mapping relationship between the historical observation sequence and the future multi-time prediction field is established. Based on the direct mapping relationship, a global flow prediction result is generated in one go.
7. The effective wave height dual-stage spatiotemporal prediction method based on diffusion residual correction as described in claim 3, characterized in that, The effective wave height spatiotemporal prediction model adopts a combined loss function that integrates pixel-level error and texture gradient error.
8. A two-stage spatiotemporal prediction system for effective wave height based on diffusion residual correction, characterized in that, include: The data acquisition module is configured to acquire historical significant wave height data and its corresponding historical wind field data, as well as the concurrent forecast wind field data for the target prediction period. The first-stage prediction module is configured to input the historical significant wave height data and its corresponding historical wind field data into the significant wave height spatiotemporal prediction model for processing, and obtain preliminary significant wave height prediction results. The second-stage compensation module is configured to input the historical significant wave height data, the preliminary significant wave height prediction results, and the concurrent forecast wind field data for the target prediction period into the residual correction module based on the diffusion model to compensate for the preliminary prediction error and obtain the final significant wave height prediction results. The construction process of the residual correction module based on the diffusion model includes: At any denoised time step of the diffusion model, an input tensor is constructed based on the noisy residual field of the current denoised time step, the preliminary effective wave height prediction results, the meridional wind field component of the same forecast, the zonal wind field component of the same forecast, and the forecast duration encoding channel. Based on weighted denoising learning using continuous noise level sampling, a diffusion model is trained to reconstruct the true residual structure from residual samples contaminated with noise of different intensities. During the inference phase, a deterministic ordinary differential equation solver is used. Starting from the Gaussian noise field, and under the joint constraints of the preliminary effective wave height prediction results, the meridional wind field component predicted at the same time, and the zonal wind field component predicted at the same time, the residual correction field is generated through stepwise iterative denoising. The residual correction field is superimposed on the preliminary effective wave height prediction result to obtain the final effective wave height prediction result.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the effective wave height two-stage spatiotemporal prediction method based on diffusion residual correction as described in any one of claims 1-7.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the effective wave height two-stage spatiotemporal prediction method based on diffusion residual correction as described in any one of claims 1-7.