Precipitation nowcasting method and system based on space-time attention diffusion model
By using a diffusion model based on STA UNet, the precipitation process is decomposed into motion field and intensity residual features. A spatiotemporal attention mechanism is introduced to solve the modeling uncertainty problem in precipitation nowcasting and achieve accurate precipitation prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-04
- Publication Date
- 2026-03-31
AI Technical Summary
Existing precipitation nowcasting models are unable to accurately capture the inherent dynamic mechanisms and uncertainties of precipitation evolution, leading to the accumulation of prediction errors and modeling uncertainties in simulating the spatiotemporal dynamics of precipitation.
We employ a diffusion model based on STA UNet, decompose the precipitation process into motion field and intensity residual features through an autoencoder, and introduce a spatiotemporal attention mechanism to extrapolate future precipitation evolution features, thereby mitigating modeling uncertainties.
It enables accurate prediction of precipitation processes, reduces forecast uncertainty, and improves prediction accuracy and stability.
Smart Images

Figure CN121765680A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of precipitation nowcasting technology, and particularly relates to a precipitation nowcasting method and system based on the spatiotemporal attention UNet diffusion model. Technical Background Precipitation nowcasting is of great significance in meteorology. Compared with general sequence forecasting, precipitation nowcasting faces greater challenges, mainly due to the severe uncertainties inherent in the precipitation process. These uncertainties arise from factors such as atmospheric chaos, observational errors, and inaccurate model simulations. For example, as the precipitation system evolves, seemingly minor errors in the initial conditions can lead to significant differences in the prediction results. Furthermore, the limitations of models in capturing the complex spatiotemporal dynamics of precipitation also cause prediction errors to accumulate over time. This invention focuses on the inherent uncertainties in the precipitation evolution process itself, as well as the modeling uncertainties in simulating the spatiotemporal dynamics of precipitation.
[0002] In recent years, deep learning technology has been widely applied to precipitation nowcasting, significantly advancing the field with its ability to understand and predict complex spatiotemporal patterns. Deterministic prediction models, such as convolutional long short-term memory networks and their variants, employ a combination of convolutional neural networks and recurrent neural networks to model the spatiotemporal characteristics of precipitation. However, these methods primarily focus on capturing direct temporal motion features, failing to adequately describe the intrinsic dynamic mechanisms of precipitation evolution. To address this limitation, researchers have attempted to decompose precipitation processes into physical dynamic processes, photoflow motion, or morphological deformation, to better model the spatiotemporal dynamics of precipitation. However, deterministic models struggle to fully account for the uncertainties in precipitation evolution and modeling. Deterministic models typically approximate the stochasticity of precipitation systems by predicting the mean, making it difficult to accurately capture the inherent uncertainties in precipitation evolution. Furthermore, the models have limited ability to characterize the complex dynamics of precipitation systems and capture long-term spatiotemporal dependencies, leading to discrepancies between model outputs and actual conditions, thus introducing additional uncertainties. The uncertainty of precipitation evolution increases the difficulty of modeling, while the limitations of the models themselves further amplify the uncertainty of precipitation nowcasting. These two types of uncertainty are intertwined and together constitute the main challenge of forecasting. Summary of the Invention
[0003] To address the aforementioned challenges and technical problems, this invention proposes a STA UNet-based diffusion model to simulate the spatiotemporal evolution of precipitation, thereby achieving accurate nowcasting of precipitation. This method treats nowcasting of precipitation as an extrapolation task of future precipitation evolution characteristics. Inspired by the continuity equation of precipitation evolution, this invention designs an autoencoder capable of decomposing the motion field and intensity residuals of precipitation processes from historical data and representing them as evolution characteristics. The STA UNet-based diffusion model models the extrapolated future precipitation evolution characteristics based on historical evolution characteristics, effectively considering the inherent uncertainties of the precipitation evolution process. Furthermore, STA UNet enhances its ability to model the spatial and temporal dependencies in precipitation processes by introducing a spatiotemporal attention mechanism, mitigating modeling uncertainties caused by the model's inability to fully and accurately depict the actual precipitation process. Finally, the decoder decodes the extrapolated evolution characteristics to generate accurate and stable short-term precipitation nowcasting results.
[0004] The technical solution adopted in this invention is: a precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model, comprising the following steps: S1, Construct an evolution feature encoder to decouple historical precipitation data into motion field features and intensity residual features; S2, construct a spatiotemporal feature diffusion model based on the STA UNet architecture, using motion field features and intensity residual features as conditions, and extrapolate future evolution features through noise iterative removal process; S3 constructs an evolution feature decoder, which uses motion field-guided Warp operation and intensity residual feature fusion to reconstruct future evolution features into future precipitation predictions.
[0005] Furthermore, the implementation process of step S1 is as follows: S11, the first UNet pathway, extracts features describing the vertical and horizontal motion of precipitation fields. ; S12, the second UNet pathway, extracts residual features describing changes in precipitation intensity. ; S13, Feature Fusion Layer, decouples and characterizes precipitation motion field information. Residual of precipitation intensity Learnable tags Substitution, i.e. ,in and These represent the height and width of the feature, respectively. Indicates the length of the input historical precipitation sequence; in , This indicates the length of the input historical precipitation sequence. , , These represent the height, width, and depth of the input precipitation data, respectively. This represents the number of measurements at each spatiotemporal coordinate point. , , This is the downsampling factor.
[0006] Furthermore, the implementation process of step S2 is as follows: During model training, future precipitation sequences will be used. Encoded as ,Will Divided into Frame fragment ,right Noise addition to obtain time steps Noisy clips , With the preceding fragment Concatenate the sequences and input them into STA UNet, specifying the sequence segment positions. Noise reduction steps Evolution characteristics of historical rainfall sequences For conditional embedding networks, iterative denoising is used to generate the first... Characteristics of future precipitation evolution in this segment During the model inference process, the input Replace with Gaussian noise; The specific process of STA UNet is as follows: and The concatenation result is concatenated with the embedding conditions, and a nonlinear transformation is performed through two residual blocks to extract deep features. Then, the features are standardized, and finally, attention is calculated at the same spatial location in all frames and at all spatial locations within a single frame through a temporal and spatial attention module.
[0007] Furthermore, the objective function of the spatiotemporal feature diffusion model is:
[0008] in, Represents real noise. This represents the noise in the prediction. For the first Step-by-step noise reduction state This is a prequel segment. For the number of noise reduction steps, For sequence segment position, It represents the mathematical expectation.
[0009] Furthermore, the temporal attention module simulates the effect of large convolutional kernels in the large kernel attention mechanism by combining DW, DWD, and PW operations to capture long-range temporal dependencies within segments. The temporal attention computation flow is as follows:
[0010] In the formula This represents the hidden layer features after the residual block has been normalized. For depthwise separable convolution, Represents depthwise dilated convolution. Characterizes pointwise convolution.
[0011] Furthermore, the spatial attention module employs depthwise convolutional weighted feature maps, and the spatial attention calculation process is as follows:
[0012]
[0013] In the formula This represents the hidden layer features obtained by concatenating the output of the residual block and the output of the temporal attention module. This means dividing the tensor into two equal parts, resulting in two separate tensors. , For depthwise separable convolution, Characterizing pointwise convolution, This is a stepwise multiplication method.
[0014] Furthermore, the implementation process of step S3 is as follows: S31: Reconstruction guided by future evolution features, using future evolution feature fragments obtained by extrapolation from a diffusion model. By piecing together the features of future evolution, we can obtain the characteristics of future evolution. h and w represent length and width; and the last frame of historical precipitation is used. As a benchmark, decoder By combining time steps Decoding future precipitation; the specific calculation process is as follows:
[0015] in Indicates the characteristics of the sports field Guided analysis of the last frame of historical precipitation The bilinear interpolation Warp operation was performed. Indicates the residual of precipitation intensity. This represents the future precipitation generated by the decoder reconstruction, where H and W are the length and width, respectively. S32: Loss functions for the sports field and intensity residuals, used to evaluate the final predicted future precipitation during training. and after Warp operation Intermediate results obtained later ,in This represents a random vector; the specific loss function is as follows:
[0016]
[0017]
[0018] In the formula Indicates the length of the predicted precipitation sequence. Indicates the first Frames of real precipitation data, The decoder generates the predicted precipitation in the first The value of the frame, This represents the intermediate result obtained after the Warp operation. The value of the frame, For pixel weights, and These represent the longitudinal and latitudinal components of the sports field information, respectively. The regularization coefficient is used. Indicates to The convolution operation is performed with a fixed kernel parameter: , This represents a two-dimensional convolution operation. Indicates the weighted reconstruction loss. This represents the smoothing regularization loss of the motion field. Indicates decoder, This represents the final loss of the decoder.
[0019] Furthermore, the pixel weight is defined as: .
[0020] The present invention also provides a precipitation nowcasting system based on the spatiotemporal attention UNet diffusion model, including a processor and a memory. The memory is used to store program instructions, and the processor is used to call the program instructions in the memory to execute the precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model as described in the above technical solution.
[0021] The present invention also provides a computer-readable storage medium, including a readable storage medium on which a computer program is stored, wherein when the computer program is executed, it implements the precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model as described in the above technical solution.
[0022] Compared with the prior art, the advantages and beneficial effects of the present invention are as follows: 1. A novel precipitation nowcasting model is proposed, which addresses the uncertainty in precipitation nowcasting by introducing random noise into the precipitation evolution characteristics and using spatiotemporal attention for accurate precipitation modeling.
[0023] 2. Based on the continuity equation of precipitation evolution, an evolution feature autoencoder was designed to represent the precipitation evolution process as a motion field and intensity residual, and decouple them into spatiotemporal evolution features.
[0024] 3. STA-UNet was developed in the diffusion component to more accurately simulate the spatial and temporal dependencies of precipitation through spatiotemporal attention, thereby reducing modeling uncertainty. Attached Figure Description
[0025] Figure 1 This is a flowchart illustrating the precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model of the present invention.
[0026] Figure 2 This is a schematic diagram of the encoder and decoder structure of the present invention.
[0027] Figure 3 This is a schematic diagram of the spatiotemporal attention UNet diffusion model of the present invention.
[0028] Figure 4 This is a schematic diagram of the spatiotemporal attention module of the present invention. Detailed Implementation
[0029] The technical solutions of the present invention will be described in detail below with reference to the accompanying drawings.
[0030] This invention provides a precipitation nowcasting method based on a spatiotemporal attention UNet diffusion model, such as... Figure 1 As shown, it includes the following steps: S1: Evolutionary Feature Encoder, used to process historical precipitation data Decoupling into motion field characteristics and intensity residual characteristics ,in, This indicates the length of the input historical precipitation sequence. , , These represent the height, width, and depth of the input precipitation data, respectively. This represents the number of measurements at each spatiotemporal coordinate point. , , The downsampling factor is used. In this implementation, historical precipitation data... downsampling factor Take 8, ; S2: Spatiotemporal feature diffusion module, based on the STA UNet architecture, using the aforementioned motion field features and intensity residual characteristics Given the condition, future evolutionary characteristics are extrapolated through an iterative noise removal process. In this embodiment, the length of the output predicted precipitation sequence is... ; S3: Evolutionary Feature Decoder, utilizing motion field-guided Warp operations. Integrating with strength residual characteristics, Reconstructing future precipitation forecasts ,satisfy ,in This is the last frame of historical precipitation.
[0031] The evolution feature encoder in step S1 is as follows: Figure 2 As shown in the encoder section, the specific implementation process includes: S11: The first UNet pathway extracts features describing the vertical and horizontal motion of precipitation fields. .
[0032] S12: Second UNet pathway, extracting residual features describing changes in precipitation intensity. .
[0033] S13: Feature fusion layer, which decouples and characterizes the precipitation motion field features. Characteristics of precipitation intensity Learnable tags Substitution, i.e. ,in and These represent the height and width of the feature, respectively. This indicates the length of the input historical precipitation sequence.
[0034] The spatiotemporal feature diffusion module in step S2 is as follows: Figure 3 As shown, the specific implementation process includes: S21: Piecewise autoregressive extrapolation, during model training, uses future precipitation sequences... Encoded as ,Will Divided into Frame fragment ,right Noise addition to obtain time steps Noisy clips , With the preceding fragment Concatenate the sequences and input them into STA UNet, specifying the sequence segment positions. Noise reduction steps and historical rainfall sequence evolution characteristics As a conditional embedding network, iterative denoising generates the first... Characteristics of future precipitation evolution in this segment During the model inference process, the input... Replace it with Gaussian noise.
[0035] S22: STA UNet denoiser. In this invention, the denoising diffusion probability model uses STA UNet (Spatio-TemporalAttention UNet) as the core of the denoiser. The specific process involves... and The splicing result is spliced with the embedding conditions in S21. The deep features are extracted by nonlinear transformation through two residual blocks, and then standardized. Finally, attention is calculated at the same spatial location in all frames and at all spatial locations within a single frame through the temporal and spatial attention modules.
[0036] S23: Time Attention Module, such as Figure 4 As shown, this invention simulates the effect of a large convolutional kernel in Large Kernel Attention (LKA) by combining DW, DWD, and PW operations to capture long-range temporal dependencies within a segment. The temporal attention calculation process is as follows:
[0037] In the formula This represents the hidden layer features after the residual block has been normalized. For depthwise separable convolution, Represents depthwise dilated convolution. Characterizes pointwise convolution.
[0038] S24: Spatial attention module, such as Figure 4 As shown, to effectively capture spatial information, this invention employs a deep convolutional weighted feature map, and a dual-branch structure further enhances spatial representation capabilities. The spatial attention calculation process is as follows:
[0039]
[0040] In the formula This represents the hidden layer features obtained by concatenating the output of the residual block and the output of the temporal attention module. This means dividing the tensor into two equal parts, resulting in two separate tensors. , For depthwise separable convolution, Characterizing pointwise convolution, This is a stepwise multiplication method.
[0041] S25: The objective function of the diffusion model is:
[0042] in, Represents real noise. This represents the noise in the prediction. For the first Step-by-step noise reduction state This is a prequel segment. For the number of noise reduction steps, For sequence segment position, It represents the mathematical expectation.
[0043] The evolution feature decoder in step S3 is as follows: Figure 2 As shown in the decoder section, the specific implementation process includes: S31: Reconstruction guided by future evolutionary features, using future evolutionary feature fragments obtained by extrapolation from a diffusion model. By piecing together the features of future evolution, we can obtain the characteristics of future evolution. And based on the last frame of historical precipitation As a benchmark, decoder By combining time steps Decoding future precipitation. The specific calculation process is as follows:
[0044] in Indicates the characteristics of the sports field Guided analysis of the last frame of historical precipitation The bilinear interpolation Warp operation was performed. Indicates the residual of precipitation intensity. This represents the future precipitation generated by the decoder reconstruction.
[0045] S32: The loss function for the sports field and intensity residuals during training. The final predicted future precipitation is evaluated separately. and after Warp operation Intermediate results obtained later ,in This represents a random vector. The specific loss function is as follows:
[0046]
[0047]
[0048] In the formula Indicates the length of the predicted sequence. Indicates the first Frames of real precipitation data, The decoder generates the predicted precipitation in the first The value of the frame, This represents the intermediate result obtained after the Warp operation. The frame value, pixel weight is defined as: , and These represent the longitudinal and latitudinal components of the sports field information, respectively. is the regularization coefficient. Indicates to Perform convolution operations with a fixed-parameter kernel (i.e., a Sobel filter): , This represents a two-dimensional convolution operation. Indicates the weighted reconstruction loss. This represents the smoothing regularization loss of the motion field. This represents the final loss of the decoder.
[0049] Overall, during the model training process, historical precipitation sequence data... and the future precipitation sequence data to be predicted All data are known; the training process involves using historical precipitation sequence data. Encoded as Future precipitation sequence data to be predicted Encoded as ,right Adding noise to obtain During training, STA UNet uses and Based on this, the restoration is obtained ,decoding Obtain predicted future precipitation sequence data During the model inference process, only historical precipitation sequence data are available. It is known that the reasoning process involves using historical precipitation sequence data. Encoded as ,by and Gaussian noise Based on this, we can deduce... ,decoding Obtain the predicted future precipitation sequence .
[0050] Compared to state-of-the-art methods, the CSI and HSS metrics were improved by at least 10.9% and 9.8%, respectively.
[0051] On the other hand, embodiments of the present invention also provide a precipitation nowcasting system based on the spatiotemporal attention UNet diffusion model, including a processor and a memory. The memory is used to store program instructions, and the processor is used to call the program instructions in the memory to execute the precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model as described in the above technical solution.
[0052] This invention also provides a computer-readable storage medium, including a computer program stored on the storage medium. When the computer program is executed, it implements the precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model as described in the above technical solution.
[0053] It should be understood that the above description of the preferred embodiments is quite detailed and should not be construed as a limitation on the scope of protection of this invention. Those skilled in the art, under the guidance of this invention, can make substitutions or modifications without departing from the scope of protection of the claims of this invention, all of which fall within the scope of protection of this invention. The scope of protection of this invention should be determined by the appended claims.
Claims
1. A precipitation nowcasting method based on a spatiotemporal attention diffusion model, characterized in that, Includes the following steps: S1, Construct an evolution feature encoder to decouple historical precipitation data into motion field features and intensity residual features; S2, construct a spatiotemporal feature diffusion model based on the STA UNet architecture, using motion field features and intensity residual features as conditions, and extrapolate future evolution features through noise iterative removal process; S3 constructs an evolution feature decoder, which uses motion field-guided Warp operation and intensity residual feature fusion to reconstruct future evolution features into future precipitation predictions.
2. The precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model according to claim 1, characterized in that: The implementation process of step S1 is as follows: S11, the first UNet pathway, extracts features describing the vertical and horizontal motion of precipitation fields. ; S12, the second UNet pathway, extracts residual features describing changes in precipitation intensity. ; S13, Feature Fusion Layer, decouples and characterizes precipitation motion field information. Residual of precipitation intensity Learnable tags Substitution, i.e. ,in and These represent the height and width of the feature, respectively. Indicates the length of the input historical precipitation sequence; in , This indicates the length of the input historical precipitation sequence. , , These represent the height, width, and depth of the input precipitation data, respectively. This represents the number of measurements at each spatiotemporal coordinate point. , , This is the downsampling factor.
3. The precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model according to claim 1, characterized in that: The implementation process of step S2 is as follows: During model training, future precipitation sequences will be used. Encoded as ,Will Divided into Frame fragment ,right Noise addition to obtain time steps Noisy clips , With the preceding fragment Concatenate the sequences and input them into STA UNet, specifying the sequence segment positions. Noise reduction steps Evolution characteristics of historical rainfall sequences For conditional embedding networks, iterative denoising is used to generate the first... Characteristics of future precipitation evolution in this segment During the model inference process, the input Replace with Gaussian noise; The specific process of STA UNet is as follows: and The concatenation result is concatenated with the embedding conditions, and a nonlinear transformation is performed through two residual blocks to extract deep features. Then, the features are standardized, and finally, attention is calculated at the same spatial location in all frames and at all spatial locations within a single frame through a temporal and spatial attention module.
4. The precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model according to claim 1, characterized in that: The objective function of the spatiotemporal feature diffusion model is: in, Represents real noise. This represents the noise in the prediction. For the first Step-by-step noise reduction state This is a prequel segment. For the number of noise reduction steps, For sequence segment position, It represents the mathematical expectation.
5. The precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model according to claim 3, characterized in that: The temporal attention module simulates the effect of large convolutional kernels in the large kernel attention mechanism by combining DW, DWD, and PW operations to capture long-range temporal dependencies within segments. The temporal attention computation flow is as follows: In the formula This represents the hidden layer features after the residual block has been normalized. For depthwise separable convolution, Represents depthwise dilated convolution. Characterizes pointwise convolution.
6. The precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model according to claim 5, characterized in that: The spatial attention module uses depthwise convolutional weighted feature maps. The spatial attention calculation process is as follows: In the formula This represents the hidden layer features obtained by concatenating the output of the residual block and the output of the temporal attention module. This means dividing the tensor into two equal parts, resulting in two separate tensors. , For depthwise separable convolution, Characterizing pointwise convolution, This is a stepwise multiplication method.
7. The precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model according to claim 3, characterized in that: The implementation process of step S3 is as follows: S31: Reconstruction guided by future evolution features, using future evolution feature fragments obtained by extrapolation from a diffusion model. By piecing together the features of future evolution, we can obtain the characteristics of future evolution. h and w are the length and width; Based on the last frame of historical precipitation As a benchmark, decoder By combining time steps Decoding future precipitation; the specific calculation process is as follows: in Indicates the characteristics of the sports field Guided analysis of the last frame of historical precipitation The bilinear interpolation Warp operation was performed. Indicates the residual of precipitation intensity. This represents the future precipitation generated by the decoder reconstruction, where H and W are the length and width, respectively. S32: Loss functions for the sports field and intensity residuals, used to evaluate the final predicted future precipitation during training. and after Warp operation Intermediate results obtained later ,in This represents a random vector; the specific loss function is as follows: In the formula Indicates the length of the predicted precipitation sequence. Indicates the first Frames of real precipitation data, The decoder generates the predicted precipitation in the first The value of the frame, This represents the intermediate result obtained after the Warp operation. The value of the frame, For pixel weights, and These represent the longitudinal and latitudinal components of the sports field information, respectively. The regularization coefficient is used. Indicates to The convolution operation is performed with a fixed kernel parameter: , This represents a two-dimensional convolution operation. Indicates the weighted reconstruction loss. This represents the smoothing regularization loss of the motion field. Indicates decoder, This represents the final loss of the decoder.
8. The precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model according to claim 7, characterized in that: Pixel weights are defined as follows: 。 9. A precipitation nowcasting system based on a spatiotemporal attention UNet diffusion model, characterized in that: It includes a processor and a memory, the memory being used to store program instructions, and the processor being used to call the program instructions in the memory to execute the precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The method includes a readable storage medium on which a computer program is stored, and when the computer program is executed, it implements the precipitation nowcasting method based on the spatiotemporal attention UNet diffusion model as described in any one of claims 1-8.