Rainfall prediction method and device, equipment and storage medium

By constructing an encoder-decoder structure and feature extraction conversion module that integrates moisture conservation equations, the problem of difficult to balance the physical interpretability and computational efficiency of existing rainfall prediction models is solved, and the accuracy of high-intensity rainfall recognition and medium- and low-intensity rainfall capture is improved, which improves the physical consistency and computational efficiency of the prediction results.

CN120430346APending Publication Date: 2025-08-05CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510554872.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-29
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

The existing rainfall prediction model is difficult to take into account both physical interpretability and computational efficiency. The existing deep learning model has a "black box" feature in rainfall prediction, which is difficult to meet the requirements for physical consistency and generalization in practical applications.

Method used

A rainfall prediction model with fusion moisture conservation equation was constructed, and the encoder-decoder structure was adopted. The model was trained through cascade iteration, combined with global feature extraction, local feature extraction and feature fusion, and a feature extraction conversion module and a loss function of fusion moisture conservation equation were introduced to improve the physical consistency and prediction accuracy of the model.

Benefits of technology

The recognition ability of high-intensity rainfall is significantly improved, the capture accuracy of medium- and low-intensity rainfall is enhanced, the optimization and integration of characteristics of different scales is achieved, and the physical consistency and computational efficiency of the prediction results are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120430346A_ABST
    Figure CN120430346A_ABST
Patent Text Reader

Abstract

The invention relates to the field of artificial intelligence, and discloses a rainfall prediction method, device and equipment and a storage medium, the method comprises the following steps: constructing a rainfall prediction model fused with a moisture conservation equation, the rainfall prediction model adopting an encoder-decoder structure; training the rainfall prediction model in a cascade iteration mode to obtain a trained rainfall prediction model; acquiring current environment data; inputting the current environment data into the trained rainfall prediction model, performing global feature extraction, local feature extraction and feature fusion through a feature extraction and conversion module in an encoder, and performing data compression; and performing global feature extraction, local feature extraction and feature fusion through a feature extraction and conversion module in the decoder to perform data reconstruction, and outputting a rainfall prediction result. The method improves the recognition capability of high-intensity rainfall, improves the capture precision of medium-low-intensity rainfall, achieves the optimization and integration of different scale features, and improves the physical consistency of prediction results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a rainfall prediction method, device, equipment and storage medium. Background Art

[0002] Numerical weather prediction systems (NWPs) are a core tool for modern weather forecasting and are widely used by meteorological agencies worldwide. Their workflow encompasses pre-processing, data assimilation, model prediction, and post-processing, with significant progress achieved in each of these areas in recent years.

[0003] With the development of deep learning technology, significant achievements have been made in many fields. In the field of rainfall prediction, researchers have conducted extensive work based on different deep learning networks, such as convolutional neural networks (CNNs), convolutional recurrent neural networks (ConvRNNs), and transformer networks, to improve the accuracy of rainfall forecasts. Physics-inspired deep learning is an interdisciplinary approach that organically integrates the data processing and feature learning capabilities of deep learning models with the fundamental principles, laws, and prior knowledge of physics. This approach fully exploits complex patterns in the data while ensuring that the neural network conforms to the laws of physics. Currently, physics-inspired deep learning methods are mainly implemented through two approaches: physics-inspired hybrid models and physics-inspired loss functions.

[0004] Physics-guided hybrid models involve incorporating data flows from physics models into deep learning models. For example, Cho K et al. proposed the WRF-Hydro-LSTM hybrid model based on the Weather Research and Forecasting Hydrological Modeling System (WRF-Hydro) and the LSTM model. In this model, an LSTM network is used to predict the error between WRF-Hydro simulations and observations. Compared to a simple LSTM network, the simulation residuals reduce the uncertainty of the output results.

[0005] Physics-guided loss functions incorporate physical principles into their design. For example, to more accurately forecast solar winds, Johnson R et al. proposed a physics-based loss function based on Ohm's law in plasma and incorporated it into various models, including CNN, ResNet, and LSTM. Experimental results show that using this physics-based loss function can effectively improve model performance.

[0006] Existing deep learning rainfall prediction models lack the constraints of physical formulas, making it difficult for existing methods to balance physical interpretability with computational efficiency. While models based on physical mechanisms offer the advantage of interpretability, they are computationally expensive. Deep learning models, while offering excellent computational efficiency and prediction accuracy, suffer from "black box" characteristics, making them difficult to meet the physical consistency and generalization requirements of practical rainfall prediction applications.

[0007] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention

[0008] The main purpose of the present invention is to provide a rainfall prediction method, device, equipment and storage medium, aiming to solve the technical problem in the prior art that it is difficult to strike a balance between the efficiency and physical interpretability of rainfall prediction.

[0009] To achieve the above-mentioned object, the present invention provides a rainfall prediction method, which comprises: constructing a rainfall prediction model that integrates a water conservation equation, wherein the rainfall prediction model adopts an encoder-decoder structure; training the rainfall prediction model through a cascade iterative method to obtain a trained rainfall prediction model; acquiring current environmental data; inputting the current environmental data into the trained rainfall prediction model, performing global feature extraction, local feature extraction, and feature fusion for data compression through a feature extraction and conversion module in the encoder, and then performing global feature extraction, local feature extraction, and feature fusion for data reconstruction through a feature extraction and conversion module in the decoder, and outputting a rainfall prediction result.

[0010] Preferably, the encoder and decoder in the rainfall prediction model both adopt a four-level hierarchical structure; Each hierarchical stage of the encoder and the decoder is composed of a feature extraction and conversion module, which performs dimensionality reduction, dimensionality increase and feature enhancement operations on the feature map corresponding to the current environment data in spatial and channel dimensions, extracts multi-scale global features and multi-scale local features, and then performs feature fusion on the global features and the local features.

[0011] Preferably, the encoding process of the encoder is expressed by the following formula:

[0012] Where, and is the output feature of the feature extraction module, Indicates the number of stages, represents the block merging operation, and X represents the input data; The decoding of the decoder is expressed by the following formula:

[0013] Where, 、 and is the output feature of each stage of the decoder, and PE represents the block expansion operation.

[0014] Preferably, the feature extraction and conversion module includes: the first input data enters the layer normalization module; the data after normalization processing is input in parallel into two W-MSA modules with different window sizes; the output results of the two W-MSAs are added; the added data is residually connected with the first input data; the data X1 obtained by the residual connection is then layer normalized by the LN module, and then enters the MLP module, extracts and converts features through nonlinear transformation, and obtains data X2 after residual connection; the data X2 obtained after the residual connection is layer normalized and then enters two SW-MSA modules with different window sizes in parallel, and data X3 is obtained after addition; the data X3 passes through the LN layer and enters the MLP module, and after feature transformation and extraction, the output result Y is obtained, and the output result Y includes global features.

[0015] Preferably, the feature extraction conversion module also includes: the second input data enters the local feature extraction unit, first undergoes a convolution layer, and the convolution layer performs local feature extraction on the second input data to generate a preliminary feature representation; the preliminary feature representation enters a module composed of a batch normalization layer and a ReLU activation function, and the processed data then enters a Triplet Attention module to obtain local features.

[0016] Preferably, the feature fusion unit of the feature extraction and conversion module splices the local features and the global features along the channel dimension; the spliced data enters the CBAM attention module, and the attention mechanism is applied from the two dimensions of channel and space; the data processed by the CBAM module enters the convolution layer again for feature extraction; the generated features are separated into and Two feature matrices; feature matrices Perform Hadamard product operation with the feature map obtained by the convolution layer of the local feature, and the feature matrix Perform a Hadamard product operation on the feature map obtained by the convolution layer with the global feature; add the results of the two Hadamard products to obtain the fused features.

[0017] Preferably, a rainfall prediction model integrating the water conservation equation is constructed, including: The loss function of the fused water conservation equation is added to the rainfall prediction model. The fused water conservation equation describes the relationship between the water vapor content, evaporation rate and rainfall in the atmosphere. The mathematical form is as follows:

[0018] Where, is the zonal wind speed (m / s), is the meridional wind speed (m / s), is the vertical wind speed (m / s), is the specific humidity (g / g), is the evapotranspiration rate (mm / h), is the rainfall value; The evapotranspiration rate is calculated according to the Makkink formula:

[0019] Where, is the derivative of saturation vapor pressure with respect to temperature, is the psychrometric constant (joules per square meter), is the latent heat of vaporization (J / g), is the global radiation (Pa / °C).

[0020] In addition, to achieve the above-mentioned purpose, the present invention further proposes a rainfall prediction device comprising: A construction module is used to construct a rainfall prediction model that integrates the water conservation equation, and the rainfall prediction model adopts an encoder-decoder structure; a training module is used to train the rainfall prediction model through a cascade iterative method to obtain a trained rainfall prediction model; an acquisition module is used to obtain current environmental data; a prediction module is used to input the current environmental data into the trained rainfall prediction model, perform global feature extraction, local feature extraction and feature fusion for data compression through the feature extraction and conversion module in the encoder, and then perform global feature extraction, local feature extraction and feature fusion for data reconstruction through the feature extraction and conversion module in the decoder, and output the rainfall prediction result.

[0021] In addition, to achieve the above-mentioned object, the present invention further proposes a rainfall prediction device, on which a rainfall prediction program is stored. When the rainfall prediction program is executed by a processor, the steps of the rainfall prediction method described above are implemented.

[0022] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a rainfall prediction program is stored. When the rainfall prediction program is executed by a processor, the steps of the rainfall prediction method described above are implemented.

[0023] This paper proposes a rainfall prediction method: (1) The global feature extraction unit significantly improves the model's ability to identify high-intensity rainfall; (2) The local feature extraction unit effectively enhances the model's accuracy in capturing low- and medium-intensity rainfall; (3) The feature fusion unit achieves the optimal integration of features at different scales; and (4) The hybrid loss function that integrates the water conservation equation significantly improves the physical consistency of the prediction results. These experimental results fully confirm the rationality and effectiveness of the SwinRainNet architecture design. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 1 is a schematic structural diagram of a rainfall prediction method in a hardware operating environment according to an embodiment of the present invention; Figure 2 This is a flow chart of a first embodiment of a rainfall prediction method according to the present invention; Figure 3 1 is a structural diagram of a global feature extraction unit in an embodiment of a rainfall prediction method of the present invention; Figure 4 1 is a structural diagram of a local feature extraction unit in an embodiment of a rainfall prediction method of the present invention; Figure 5 This is a structural diagram of a feature fusion unit in an embodiment of a rainfall prediction method of the present invention; Figure 6 1 is a structural diagram of the SwinRainNet model in an embodiment of the rainfall prediction method of the present invention; Figure 7 : is a SwinRainNet cascade iterative prediction graph in an embodiment of the rainfall prediction method of the present invention; Figure 8 is a graph of CSI values of various models at different thresholds in an embodiment of the rainfall prediction method of the present invention; Figure 9 is a graph of HSS values of various models at different thresholds in an embodiment of the rainfall prediction method of the present invention; Figure 10 : WMSE, WRMSE, SSIM and physical consistency diagram of each model in the embodiment of the rainfall prediction method of the present invention; Figure 11 This is a visualization comparison diagram of the prediction results in the embodiment of the rainfall prediction method of the present invention; Figure 12 Graph showing the CSI values of various models under different thresholds in the ablation experiment in an embodiment of the rainfall prediction method of the present invention.

[0025] Figure 13 is the HSS value of each model under different thresholds in the ablation experiment in the embodiment of the rainfall prediction method of the present invention Figure 14 These are the WMSE, WRMSE, SSIM and physical consistency diagrams of each model in the ablation experiment in the embodiment of the rainfall prediction method of the present invention.

[0026] Figure 15 This is a spatiotemporal generalization experimental diagram in an embodiment of the rainfall prediction method of the present invention.

[0027] Figure 16 This is a generalization experiment diagram of the NCEP2 reanalysis rainfall dataset distribution in an embodiment of the rainfall prediction method of the present invention.

[0028] Figure 17 This is a generalization experiment diagram of the HKO-7 radar rainfall dataset distribution in an embodiment of the rainfall prediction method of the present invention; Figure 18 This is a structural block diagram of the first embodiment of the rainfall prediction device of the present invention.

[0029] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0030] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0031] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a rainfall prediction device in the hardware operating environment involved in an embodiment of the present invention.

[0032] like Figure 1 As shown, the rainfall prediction device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. In the present invention, the wired interface of the user interface 1003 may be a USB interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 may be a high-speed random access memory (RAM) or a non-volatile memory (NVM), such as a disk drive. The memory 1005 may also be a storage device independent of the processor 1001.

[0033] Those skilled in the art will understand that Figure 1The structure shown in the figure does not constitute a limitation to the rainfall prediction device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0034] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module and a rainfall prediction program.

[0035] exist Figure 1 In the rainfall prediction device shown, the network interface 1004 is mainly used to connect to the backend server and communicate data with the backend server; the user interface 1003 is mainly used to connect to the user device; the rainfall prediction device calls the rainfall prediction program stored in the memory 1005 through the processor 1001 and executes the rainfall prediction method provided by the embodiment of the present invention.

[0036] Based on the above hardware structure, an embodiment of the rainfall prediction method of the present invention is proposed.

[0037] Reference Figure 2 , Figure 2 1 is a flow chart of the first embodiment of the rainfall prediction method of the present invention, which provides the first embodiment of the rainfall prediction method of the present invention.

[0038] In a first embodiment, the rainfall prediction method includes the following steps: Step S10: constructing a rainfall prediction model integrating the water conservation equation, wherein the rainfall prediction model adopts an encoder-decoder structure.

[0039] In a specific implementation, the execution subject of this embodiment is the rainfall prediction device, wherein the rainfall prediction device can be an electronic device such as a personal computer or a server, and this embodiment does not limit this. This paper proposes a new feature extraction conversion module FEM, which consists of a global feature extraction unit, a local feature extraction unit, and a feature fusion unit for fusing two scale features. The purpose of introducing the global feature extraction unit in FEM is to efficiently obtain global information and enhance the sensitivity of the model to high-intensity rainfall. The global feature extraction unit proposed in this embodiment is based on the (moving) window multi-head attention mechanism ((S)W-MSA), which achieves effective capture of global information while maintaining computational efficiency through self-attention calculation within the local window. Its specific structure is as follows Figure 3 shown.

[0040] Furthermore, in this embodiment, the feature extraction and conversion module includes: the first input data enters the layer normalization module; the data after normalization processing is input in parallel into two W-MSA modules with different window sizes; the output results of the two W-MSAs are added; the added data is residually connected with the first input data; the data X1 obtained by the residual connection is then layer normalized by the LN module, and then enters the MLP module, extracts and converts features through nonlinear transformation, and obtains data X2 after residual connection; the data X2 obtained after the residual connection is layer normalized and then enters two SW-MSA modules with different window sizes in parallel, and data X3 is obtained after addition; the data X3 passes through the LN layer and enters the MLP module, and after feature transformation and extraction, the output result Y is obtained, and the output result Y includes global features.

[0041] It should be noted that the input data X first enters the layer normalization module, which normalizes the data to stabilize its distribution. After normalization, the data is fed in parallel into two W-MSA modules with different window sizes. These window sizes can be 9 and 5, or other values, though this embodiment does not limit this. Next, the outputs of the two W-MSA modules are added together and then residually connected with the input data X to produce X1. X1 undergoes layer normalization again in the LN module before entering the MLP module for further feature extraction and transformation through nonlinear transformation. After residual connection, X2 is obtained. X2 also undergoes layer normalization before entering two SW-MSA modules with different window sizes (also 9 and 5) in parallel. After addition, X3 is obtained. Using the moving window mechanism, the feature extraction module can obtain different global information. After passing through the LN layer, X3 is fed into the MLP module for feature transformation and extraction, resulting in the output Y. The entire process goes through multiple LN, (S)W-MSA and MLP, supplemented by residual connections, to continuously normalize, extract and fuse data to learn global features.

[0042] The formula for this process is as follows:

[0043] Where, It is a W-MSA module with a window of 5. It is a SW-MSA module with a window of 5. It is a W-MSA module with window 9. It is a SW-MSA module with a window of 9.

[0044] The input data is typically a global benchmark rainfall dataset.

[0045] Furthermore, in this embodiment, the feature extraction conversion module also includes: the second input data enters the local feature extraction unit, first undergoes a convolution layer, and the convolution layer performs local feature extraction on the second input data to generate a preliminary feature representation; the preliminary feature representation enters a module composed of a batch normalization layer and a ReLU activation function, and the processed data then enters a Triplet Attention module to obtain local features.

[0046] It should be understood that in addition to the global feature extraction unit described above, this embodiment designs a local feature extraction unit based on a convolutional neural network and an attention mechanism. This unit is designed to extract local features from the input data, thereby improving the prediction performance for medium and low intensity rainfall. The structure of the local feature extraction unit is as follows: Figure 4 shown.

[0047] Specifically, after the input data enters the local feature extraction unit, it will first go through a convolution layer. Usually, the size of the convolution layer is 3×3, but it can also be other values. This embodiment does not limit this. The convolution layer extracts local features of the input data and generates a preliminary feature representation. Next, the data enters a module composed of a batch normalization layer and a ReLU activation function. The batch normalization layer can stabilize the data distribution and accelerate model training. The ReLU activation function introduces nonlinear transformations to further enhance the feature extraction capabilities of the model. The data then enters the Triplet Attention module, which performs attention calculations on features from multiple dimensions, thereby enhancing important features and suppressing secondary features, thereby improving the expressiveness of features. After repeating the above process, a local feature map can be obtained.

[0048] Furthermore, in this embodiment, the feature fusion unit of the feature extraction and conversion module splices the local features and the global features along the channel dimension; the spliced data enters the CBAM attention module, and the attention mechanism is applied from the channel and space dimensions; the data processed by the CBAM module enters the convolution layer again for feature extraction; the generated features are separated into and Two feature matrices; feature matrices Perform Hadamard product operation with the feature map obtained by the convolution layer of the local feature, and the feature matrix Perform a Hadamard product operation on the feature map obtained by the convolution layer with the global feature; add the results of the two Hadamard products to obtain the fused features.

[0049] It is understandable that this embodiment proposes a new feature fusion unit (FFU) to solve the problem that most feature fusion methods use simple addition or multiplication operations to integrate local features and global features. The formula for the fusion process is as follows:

[0050] Where, and Represent local features and global features respectively, and They correspond to the global and local forgetting matrices respectively, and the values are controlled between 0 and 1 through the sigmoid function to indicate whether the corresponding features are remembered or forgotten. It is Hadamard.

[0051] The specific structure of the feature fusion unit is as follows Figure 5 As shown. The unit first splices the local features and global features along the channel dimension to integrate local and global information. The spliced data enters the CBAM attention module, which applies the attention mechanism from the channel and space dimensions. After being processed by the CBAM module, the data enters the convolution layer again for feature extraction, and the generated features are then separated into and Two feature matrices. Then, Perform Hadamard product operation with the feature map obtained by the convolution layer of the local feature, The Hadamard product operation is performed on the feature map obtained by the convolution layer with the global feature to strengthen the weight of the corresponding feature. Finally, the results of the two Hadamard products are added to obtain the fused feature.

[0052] Furthermore, in this embodiment, a rainfall prediction model integrating the water conservation equation is constructed, including: adding a loss function of the integrated water conservation equation to the rainfall prediction model. The integrated water conservation equation describes the relationship between the water vapor content, evaporation rate, and rainfall in the atmosphere, and has the following mathematical form:

[0053] Where, is the zonal wind speed (m / s), is the meridional wind speed (m / s), is the vertical wind speed (m / s), is the specific humidity (g / g), is the evapotranspiration rate (mm / h), is the rainfall value; The evapotranspiration rate is calculated according to the Makkink formula:

[0054] Where, is the derivative of saturation vapor pressure with respect to temperature, is the psychrometric constant (joules per square meter), is the latent heat of vaporization (J / g), is the global radiation (Pa / °C).

[0055] Among the factors influencing rainfall, the transport effects of wind speed and specific humidity far outweigh the impact of evaporation rate. Vertical wind speed exhibits significant spatial variability, making its measurement complex and costly. The ERA5 dataset also does not include these two variables. Therefore, to apply the moisture conservation equation to the loss function, this paper discards the vertical wind speed terms for evaporation rate and specific humidity. The simplified moisture conservation equation is as follows:

[0056] Based on the above formula, we can use the following formula to determine whether the rainfall value of a pixel point conforms to the water conservation equation. When the value is 0, it means that the rainfall value at this pixel completely follows the water conservation equation: The larger the value, the less consistent the rainfall value at that pixel is with the water conservation equation.

[0057]

[0058] Furthermore, by extending this formula to all pixels of the entire feature map, we can derive the physical loss function of the entire feature map. This function is used to measure the degree of conformity of the entire result map with the water conservation equation. Its mathematical form is as follows:

[0059] Where, It is specific humidity, is the number of pressure layers, is the zonal wind speed (m / s), is the meridional wind speed (m / s). The above formula is a loss function in differential form and is not operational. Therefore, the present invention uses the finite difference method to approximate the partial derivative, and its formula form is as follows:

[0060] In the experiment of this embodiment, the time interval Take 1 hour. is the distance in the latitude direction, which is 27.75 kilometers. The distance in the longitude direction needs to be calculated based on the latitude of the point. , calculated as follows:

[0061] In the GHPD dataset produced in this embodiment, the H value is 8. At this time, the loss function of the PrecipUNet model is:

[0062] Where, is a coefficient, which is taken as 1.4 in this embodiment. The optimal value is obtained by searching in the range of , with increments of 0.1. WMSE is the weighted mean square error.

[0063] Furthermore, in this embodiment, the encoder and decoder in the rainfall prediction model both adopt a four-level hierarchical structure; each level stage of the encoder and the decoder is composed of a feature extraction and conversion module, which performs dimensionality reduction, dimensionality increase and feature enhancement operations on the feature map corresponding to the current environmental data in spatial and channel dimensions, extracts multi-scale global features and multi-scale local features, and then performs feature fusion on the global features and the local features.

[0064] In the specific implementation, the encoder-decoder structure is used to build the rainfall prediction model SwinRainNet. The design of SwinRainNet adopts the encoder-decoder structure, and its overall structure is as follows Figure 6 As shown in the figure, both the encoder and decoder adopt a four-level hierarchical structure, and each stage exhibits a specific feature transformation law: as the network layer deepens, the dimension of the feature data gradually increases, while the spatial resolution decreases accordingly. Specifically, the encoder stage implements a bottom-up feature extraction process from stage one to stage four, while the decoder performs a top-down feature reconstruction process from stage four to stage one. Each stage of the encoder and decoder is composed of a Feature Extraction Module (FEM). This module performs operations such as dimensionality reduction, dimensionality increase, and feature enhancement on the feature map in the spatial and channel dimensions to extract multi-scale feature information.

[0065] In the encoder, each stage consists of a block merging operation and a feature extraction module. For a given input X, the encoding process can be expressed as follows:

[0066] Where, and is the output feature of the feature extraction module, Indicates the number of stages, represents the block merging operation, and X represents the input data.

[0067] Next, in the decoder part, the decoding process can be expressed as follows:

[0068] Where, 、 and is the output feature of each stage of the decoder, and PE represents the block expansion operation.

[0069] Step S20: training the rainfall prediction model in a cascade iterative manner to obtain a trained rainfall prediction model.

[0070] It is understandable that a number of representative deep learning models are selected for comparison with the rainfall prediction model SwinRainNet. Specifically: SA1: Regarding datasets, all experiments in this paper were conducted on the Global Benchmark Rainfall Dataset (GHPD), a deep learning dataset. The dataset is divided into three parts: training, validation, and test. The five years 1997, 2002, 2007, 2012, and 2017 serve as the validation set; the five years 1998, 2003, 2008, 2013, and 2018 serve as the test set; and the remaining 30 years serve as the training set. This partitioning strategy ensures that the training data covers different phases of the atmospheric multi-year oscillation.

[0071] In terms of models, this embodiment selected several representative deep learning models for comparison with the SwinRainNet model, including: ResNet, PredRNN, MIM, SwinT, GraphCast, Pangu, and FuXi.

[0072] To comprehensively evaluate the model, this paper uses six indicators, including critical success index (CSI), Heidke Skill Score (HSS), WMSE, WRMSE, SSIM, and physical consistency.

[0073] SA2: This embodiment uses cascade iterative prediction to train the model. Next, the training process of the SwinRainNet model is used as an example to explain. Figure 7As shown in Figure 1, the trained SwinRainNet model is fine-tuned for specific 8-hour prediction windows to achieve optimal performance within the window. In this example, these windows are named SwinRainNet-Short (0-8 hours), SwinRainNet-Medium (9-16 hours), and SwinRainNet-Long (17-24 hours).

[0074] During the forecasting process, the SwinRainNet-Short model first performs a forecast for hours 0-8. The SwinRainNet-Short model uses an iterative forecasting approach, taking the data from the first three time steps as input and progressively completing an 8-hour rainfall forecast in one-hour time steps. After completing the 0-8 hour forecast, the SwinRainNet-Medium model's parameters are initialized using the SwinRainNet-Short model's weights and fine-tuned to ensure optimal performance for the 9-16 hour forecast. The 6th, 7th, and 8th outputs of the SwinRainNet-Short model serve as the first input to the SwinRainNet-Medium model. A similar process is used for forecasting time steps 17-24.

[0075] SA3: Compare the values of each model on six indicators. Table 1 shows the average CSI value predicted by each model for 24 hours under different thresholds. Figure 8 The table shows the hourly CSI values. As can be seen from the table, SwinRainNet performs best under all rainfall intensity conditions, indicating that the SwinRainNet model has the highest accuracy rate in forecasts. Furthermore, the CSI values of all models decrease with increasing rainfall intensity thresholds, indicating that forecasting high-intensity rainfall is more difficult than forecasting low and medium-intensity rainfall. However, SwinRainNet's CSI value decreases the least, indicating that the SwinRainNet model has a greater advantage under high-intensity rainfall conditions.

[0076] Table 1 24-hour average CSI values of each model under different thresholds

[0077] Table 2 shows the average HSS values predicted by each model for 24 hours under different thresholds. Figure 9 The specific HSS values for each hour are shown in Table 2. As can be seen from Table 2, similar to the CSI values, the average HSS values of each model also decrease with the increase of the threshold, which further confirms the difficulty and complexity of high-intensity rainfall prediction. SwinRainNet achieves the highest average HSS value under each rainfall intensity, which means that the improvement over random guessing is the highest. Especially in r At 30:00, its HSS value of 0.3332 was significantly ahead of other models, further demonstrating the advantages of the SwinRainNet model under high-intensity rainfall.

[0078] Table 2 24-hour average HSS values of each model under different thresholds

[0079] Table 3 shows the average WMSE, WRMSE, SSIM and physical consistency of each model's 24h prediction. Figure 10 The specific values of these indicators per hour are shown in Table 3 and Figure 9 Analysis shows that SwinRainNet achieves optimal values for all four indicators. Specifically, the lowest WMSE and WRMSE mean that SwinRainNet's predictions are closer to the actual rainfall conditions and more accurate. The SwinRainNet model's outstanding performance in the SSIM indicator demonstrates the highest consistency in spatial structure between its predictions and the true values, demonstrating its excellent ability to capture the spatial distribution characteristics of rainfall. Furthermore, SwinRainNet also achieved optimal results in the physical consistency assessment, demonstrating that the model can better adhere to the water conservation equation, ensuring the rationality and interpretability of the prediction results at the physical level.

[0080] Table 3 Average values of WMSE, WRMSE, SSIM and physical consistency of each model over 24 hours

[0081] In order to more intuitively compare the global rainfall predictions of each model, this paper randomly selected samples from the validation set and carried out three rounds of iterations to visualize the iteration results. At the same time, the weighted mean square error between each model and the true value is marked in the lower right corner of each picture for intuitive display and comparative analysis. Figure 11 It can be seen that in the three-hour forecast, the prediction effect of the SwinRainNet model is significantly better than that of other models.

[0082] An ablation experiment was conducted on the rainfall prediction model SwinRainNet. Specifically: SB1: The model without a global feature extraction unit is denoted as SwinRainNet w / o (without) global. The model without a local feature extraction unit is denoted as SwinRainNet w / o local. The model that changes the method of fusing local and global features to addition is denoted as SwinRainNet w / o FFU. The model trained only with the WMSE loss function is denoted as SwinRainNet w / o physical-loss. Ablation experiments are conducted.

[0083] Table 4 shows the average CSI values of each model in the 24-hour ablation experiment under different thresholds. Figure 12 Specific CSI values for each hour are presented.

[0084] Table 4 Average CSI values of each model in 24 hours of ablation experiments under different thresholds

[0085] Table 5 shows the 24-hour average HSS values of each model in the ablation experiment under different thresholds. Figure 13 The specific HSS value for each hour is displayed.

[0086] Table 5 Average HSS values of each model in the ablation experiment for 24 hours under different thresholds

[0087] The results showed that when 、 and When , SwinRain-Net w / o local results are significantly better than SwinRainNet w / o global, and when or This superiority is not obvious when the global feature extraction unit is used. This indicates that the global feature extraction unit pays more attention to high-intensity rainfall, while the local feature extraction unit is insensitive to high-intensity rainfall. Comparing the performance of the SwinRainNet w / o global model with other models in the three tables on the six indicators, it can be found that the performance of the SwinRainNet w / oglobal model is basically the worst. This is consistent with the actual situation, because the local feature extraction unit is just a simple combination of the convolution layer and the Triplet Attention module, with few parameters and poor fitting ability. However, after combining these two extraction units through the FEM module, all indicators have been improved, including and The CSI and HSS scores indicate that the local feature extraction layer indeed focuses on low- and medium-intensity rainfall. In other words, both the global and local feature extraction units are performing as expected. Furthermore, SwinRainNet outperforms SwinRainNet without FFU across all metrics, demonstrating that the designed FFU effectively balances the fusion of local and global features. Specifically, it adaptively weights local and global features based on the characteristics of the input data, significantly improving prediction performance.

[0088] Table 6 shows the average WMSE, WRMSE, SSIM and physical consistency of each model in the 24h ablation experiment. Figure 14 The specific values of these indicators are shown every hour.

[0089] Table 6 Average WMSE, WRMSE, SSIM and physical consistency of each model in the ablation experiment for 24 hours

[0090] The four models trained using the hybrid loss function—SwinRainNet, SwinRainNet w / o global, SwinRainNet w / o local, and SwinRainNet w / o FFU—perform well in terms of physical consistency, effectively reflecting the physical laws of the water conservation equation. Furthermore, according to Table 6, SwinRainNet achieves the lowest WMSE and WRMSE values. While counterintuitive, this demonstrates that incorporating physical laws into the model can enhance its performance.

[0091] A generalization experiment was conducted on the SwinRainNet model. Specifically: SC1: Conduct three sets of generalization experiments. Specifically, verify the spatiotemporal generalization of the SwinRainNet model on the ERA5 dataset from 2019 to 2023.

[0092] Table 7. 24-hour average CSI values of each model in the spatiotemporal generalization experiment

[0093] Table 8 24-hour average HSS values of each model in the spatiotemporal generalization experiment

[0094] Table 9 24-hour average WMSE, WRMSE, and SSIM of each model in the spatiotemporal generalization experiment

[0095] Tables 7, 8, and 9 show the calculation results of various indicators of the three models SwinRainNet, Pangu, and FuXi when conducting spatiotemporal generalization experiments on the ERA5 dataset.

[0096] Figure 15 The performance degradation of the indicators in Tables 7, 8, and 9 compared with those in Tables 1, 2, and 3 is shown.

[0097] like Figure 15 As shown, the performance of SwinRainNet decreased by 1%-4.8%, that of Pangu by 3.2%-7.9%, and that of FuXi by 2.9%-8.6%. The errors of all three models were within 10%, indicating that the model's strategy for partitioning the training, validation, and test sets was reasonable and that the model had learned the data characteristics of different phases of atmospheric oscillations from the training data. Furthermore, SwinRainNet exhibited the smallest performance decrease, significantly lower than the Pangu and FuXi models. This result demonstrates that the SwinRainNet model, designed in this paper and based on a physics-guided deep learning architecture, can effectively capture the physical laws underlying the water conservation equation and leverage these laws to improve the model's spatiotemporal generalization.

[0098] SC2: The out-of-distribution generalization of the SwinRainNet model is verified on the NCEP2 reanalysis dataset rainfall dataset and the HKO-7 radar rainfall dataset.

[0099] Table 10 24-hour mean CSI values of the NCEP2 reanalysis rainfall dataset

[0100] Table 11 24-hour mean HSS values of the NCEP2 reanalysis rainfall dataset

[0101] Table 12 24-hour mean WMSE, WRMSE, and SSIM of the NCEP2 reanalysis rainfall dataset

[0102] Tables 10, 11, and 12 show the calculation results of various indicators for the SwinRainNet, Pangu, and FuXi models when performing out-of-distribution generalization experiments on the NCEP2 reanalysis rainfall dataset.

[0103] Figure 16 The performance degradation of the indicators in Tables 10, 11, and 12 compared to Tables 1, 2, and 3 is shown. Figure 16As shown, the performance of SwinRainNet decreased by 15.9%-24%, that of Panu by 30.2%-42.4%, and that of FuXi by 26.9%-44.4%. As can be seen from the figure, SwinRainNet still performed the best, with its performance drop kept within 25%. This is likely because NCEP2 is also a reanalysis dataset, so the physical laws derived from the water conservation equation in SwinRainNet can still be effectively applied, giving the model good generalization outside the distribution. However, due to the lack of water conservation equation constraints, the performance of the Panu and FuXi models decreased significantly.

[0104] Tables 13, 14, and 15 show the calculation results of various indicators of the three models SwinRainNet, Pangu, and FuXi when performing out-of-distribution generalization experiments on the HKO-7 radar rainfall dataset.

[0105] Table 13 24-hour average CSI values of the HKO-7 radar rainfall dataset

[0106] Table 14 24-hour average HSS values of the HKO-7 radar rainfall dataset

[0107] Table 15 24-hour average WMSE, WRMSE, and SSIM of the HKO-7 radar rainfall dataset

[0108] Figure 17 The performance degradation of the indicators in Tables 13, 14, and 15 compared to those in Tables 1, 2, and 3 is shown. Figure 17 As shown in the figure, the performance degradation of SwinRainNet is between 22.6% and 38.8%, the performance degradation of Pangu is between 35.2% and 57.7%, and the performance degradation of FuXi is between 41% and 59.7%. Figure 17 The results show that the performance of the three models further degrades due to the different structures of radar data and reanalysis data. However, SwinRainNet still performs best and has the best out-of-distribution generalization.

[0109] Step S30: Acquire current environment data.

[0110] It should be understood that the current environmental data consists of input variables, including: gravity potential, temperature, specific humidity, meridional wind, azimuthal wind, 2-meter temperature, 10-meter meridional wind, 10-meter zonal wind, and / or topography. Input pressure layers include: 50hPa, 250Pa, 400hPa, 600hPa, 700hPa, 850hPa, 925hPa, and 1000hPa.

[0111] Step S40: Input the current environmental data into the trained rainfall prediction model, perform global feature extraction, local feature extraction and feature fusion for data compression through the feature extraction and conversion module in the encoder, and then perform global feature extraction, local feature extraction and feature fusion for data reconstruction through the feature extraction and conversion module in the decoder to output the rainfall prediction result.

[0112] It should be noted that the current environmental data is input into the trained rainfall prediction model. Figure 6 The encoder shown undergoes four levels of feature extraction and conversion modules FEM for data compression, and then undergoes four levels of feature extraction and conversion modules FEM for data reconstruction through the decoder to obtain rainfall prediction results.

[0113] This example designs a rainfall prediction model, SwinRainNet, that strictly adheres to the optimized water conservation equation. In comparative experiments on 24-hour rainfall prediction, SwinRainNet demonstrates significant advantages across multiple key evaluation metrics. Specifically, at multiple rainfall thresholds, including 0.5mm, 2mm, 5mm, 10mm, and 30mm, SwinRainNet's Critical Success Index (CSI) and Heidke Skill Score (HSS) outperform existing mainstream models. Furthermore, SwinRainNet achieves optimal performance in comprehensive metrics such as WMSR (weighted mean square error), WRMSE (weighted root mean square error), SSIM (structural similarity index), and physical consistency. For rainfall prediction on the GHPD dataset, for example, SwinRainNet achieves a 24-hour average WMSE of 13.8721, an average SSIM of 0.9175, and an average physical consistency of 12.4639. Compared with the current state-of-the-art FuXi model, SwinRainNet achieves 4.1% lower WMSE, 2.7% higher SSIM, and 59.1% better physical consistency.

[0114] To verify the importance of each model component, systematic ablation experiments were conducted. The results show that: (1) the global feature extraction unit significantly improves the model's ability to identify high-intensity rainfall; (2) the local feature extraction unit effectively enhances the model's accuracy in capturing low- and medium-intensity rainfall; (3) the feature fusion unit achieves optimal integration of features at different scales; and (4) the hybrid loss function that integrates the water conservation equation significantly improves the physical consistency of the prediction results. These experimental results fully confirm the rationality and effectiveness of the SwinRainNet architecture design.

[0115] To verify the generalization of the SwinRainNet model, spatiotemporal generalization experiments and out-of-distribution generalization experiments were conducted. The results show that the SwinRainNet model has the best generalization ability compared with other models under the constraints of the water conservation equation.

[0116] In addition, an embodiment of the present invention further provides a storage medium, on which a rainfall prediction program is stored. When the rainfall prediction program is executed by a processor, the steps of the rainfall prediction method described above are implemented.

[0117] In addition, refer to Figure 18 An embodiment of the present invention further proposes a rainfall prediction device, which includes: a construction module 10, used to construct a rainfall prediction model that integrates the water conservation equation, and the rainfall prediction model adopts an encoder-decoder structure; a training module 20, used to train the rainfall prediction model through a cascade iteration method to obtain a trained rainfall prediction model; an acquisition module 30, used to obtain current environmental data; and a prediction module 40, used to input the current environmental data into the trained rainfall prediction model, perform global feature extraction, local feature extraction and feature fusion for data compression through a feature extraction and conversion module in the encoder, and then perform global feature extraction, local feature extraction and feature fusion for data reconstruction through a feature extraction and conversion module in the decoder, and output a rainfall prediction result.

[0118] Other embodiments or specific implementations of the rainfall prediction device of the present invention can refer to the above-mentioned method embodiments and will not be repeated here.

[0119] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0120] The serial numbers of the embodiments of the present invention are for descriptive purposes only and do not represent superiority or inferiority of the embodiments. In a unit claim that lists several means, several of these means may be embodied by the same item of hardware. The use of the terms first, second, and third, etc., does not denote any order and should be construed as identifiers.

[0121] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as a magnetic disk or optical disk) and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0122] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A rainfall prediction method, characterized in that: The rainfall prediction method comprises: Constructing a rainfall prediction model integrating a water conservation equation, wherein the rainfall prediction model adopts an encoder-decoder structure; Training the rainfall prediction model in a cascade iterative manner to obtain a trained rainfall prediction model; Get current environment data; The current environmental data is input into the trained rainfall prediction model, and global feature extraction, local feature extraction and feature fusion are performed by the feature extraction and conversion module in the encoder for data compression. Then, global feature extraction, local feature extraction and feature fusion are performed by the feature extraction and conversion module in the decoder for data reconstruction, and the rainfall prediction result is output.

2. The rainfall prediction method according to claim 1, wherein: In the rainfall prediction model, both the encoder and the decoder adopt a four-level hierarchical structure; Each hierarchical stage of the encoder and the decoder is composed of a feature extraction and conversion module, which performs dimensionality reduction, dimensionality increase and feature enhancement operations on the feature map corresponding to the current environment data in spatial and channel dimensions, extracts multi-scale global features and multi-scale local features, and then performs feature fusion on the global features and the local features.

3. The rainfall prediction method according to claim 2, wherein: The encoding process of the encoder is expressed by the following formula: Where, and is the output feature of the feature extraction module, Indicates the number of stages, represents the block merging operation, and X represents the input data; The decoding of the decoder is expressed by the following formula: Where, 、 and is the output feature of each stage of the decoder, and PE represents the block expansion operation.

4. The rainfall prediction method according to claim 1, wherein: The feature extraction and conversion module includes: The first input data enters the layer normalization module; After normalization, the data are input into two W-MSA modules with different window sizes in parallel; Add the output results of the two W-MSAs; Performing a residual connection on the added data and the first input data; The data X1 obtained by the residual connection is then normalized by the LN module and then enters the MLP module to extract and transform features through nonlinear transformation, and obtain data X2 after the residual connection; The data X2 obtained after the residual connection is normalized at the layer and then enters two SW-MSA modules with different window sizes in parallel, and the data X3 is obtained after addition; After passing through the LN layer, the data X3 is input into the MLP module, and after feature transformation and extraction, an output result Y is obtained, which includes global features.

5. The rainfall prediction method according to claim 4, wherein: The feature extraction and conversion module also includes: The second input data enters the local feature extraction unit and first passes through a convolution layer, which extracts local features of the second input data and generates a preliminary feature representation; The preliminary feature representation enters a module consisting of a batch normalization layer and a ReLU activation function. After processing, the data enters the Triplet Attention module to obtain local features.

6. The rainfall prediction method according to claim 5, wherein: The feature fusion unit of the feature extraction and conversion module splices the local features and the global features along the channel dimension; The spliced data enters the CBAM attention module, which applies attention mechanisms from two dimensions: channel and space. The data processed by the CBAM module enters the convolution layer again for feature extraction; The generated features are separated into and Two feature matrices; Feature Matrix Perform Hadamard product operation with the feature map obtained by the convolution layer of the local feature, and the feature matrix Perform Hadamard product operation on the feature map obtained by the convolution layer with the global feature; The results of the two Hadamard products are added to obtain the fused features.

7. The rainfall prediction method according to any one of claims 1 to 6, wherein: Construct a rainfall prediction model that integrates the water conservation equation, including: The loss function of the fused water conservation equation is added to the rainfall prediction model. The fused water conservation equation describes the relationship between the water vapor content, evaporation rate and rainfall in the atmosphere. The mathematical form is as follows: Where, is the zonal wind speed (m / s), is the meridional wind speed (m / s), is the vertical wind speed (m / s), is the specific humidity (g / g), is the evapotranspiration rate (mm / h), is the rainfall value; The evapotranspiration rate is calculated according to the Makkink formula: Where, is the derivative of saturation vapor pressure with respect to temperature, is the psychrometric constant (joules per square meter), is the latent heat of vaporization (J / g), is the global radiation (Pa / °C).

8. A rainfall prediction device, characterized in that: The rainfall prediction device comprises: A construction module is used to construct a rainfall prediction model integrating a water conservation equation, wherein the rainfall prediction model adopts an encoder-decoder structure; A training module, configured to train the rainfall prediction model in a cascade iterative manner to obtain a trained rainfall prediction model; Acquisition module, used to obtain current environment data; The prediction module is used to input the current environmental data into the trained rainfall prediction model, perform global feature extraction, local feature extraction and feature fusion for data compression through the feature extraction and conversion module in the encoder, and then perform global feature extraction, local feature extraction and feature fusion for data reconstruction through the feature extraction and conversion module in the decoder to output the rainfall prediction result.

9. A rainfall prediction device, characterized in that: The rainfall prediction device stores a rainfall prediction program, and when the rainfall prediction program is executed by a processor, the steps of the rainfall prediction method according to any one of claims 1 to 7 are implemented.

10. A storage medium, characterized in that: The storage medium stores a rainfall prediction program, which, when executed by a processor, implements the steps of the rainfall prediction method according to any one of claims 1 to 7.