Short temporary rainfall forecasting method, device and equipment based on multi-source data and memory
By fusing radar and numerical model data with a Transformer-based multi-branch generator, the uncertainty and accuracy issues in short-term precipitation forecasts are resolved, achieving high-precision and timely precipitation forecasts.
Patent Information
- Application Number
- CN202511337800.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-09-18
AI Technical Summary
Existing short-term precipitation forecast methods have uncertainty and insufficient accuracy within the 3-12 hour range. A single data source cannot accurately capture the complex evolution of the precipitation process, and it is difficult to integrate the features of multi-source data.
A Transformer-based multi-branch generator is adopted to preprocess the radar combined reflectivity factor data and numerical pattern data, and an improved Swin Transformer module is used for feature extraction and data fusion. The cross-attention mechanism and MLP layer are combined for prediction to achieve efficient fusion of multi-source data.
It has improved the accuracy and timeliness of short-term precipitation forecasts, can more accurately capture the complex dynamics of precipitation processes, reflect the wide-ranging impact of weather systems, and significantly improve forecast performance.
Smart Images

Figure CN120821005A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of weather forecasting, and in particular to a method, apparatus, device and memory for forecasting short-term precipitation based on multi-source data. Background Art
[0002] Short-term precipitation forecasts, especially heavy precipitation, are crucial for disaster prevention and mitigation. In recent years, rapid advances in weather radar technology and radar extrapolation algorithms have significantly improved precipitation nowcasting capabilities (0-3 hours), especially for severe convective precipitation. Simultaneously, the development of modern numerical weather prediction has also significantly enhanced short- to medium-term precipitation forecasting capabilities (12-72 hours). However, due to the nonlinear nature of precipitation height, the accuracy of radar extrapolation decreases significantly with forecast time. Furthermore, numerical models are subject to the "spin-up" phenomenon, resulting in low reliability in the first six hours. Consequently, short-term precipitation nowcasts of 3-12 hours have always been subject to significant uncertainty. Effectively improving the accuracy and reliability of short-term precipitation nowcasts is crucial for monitoring and warning of severe weather events throughout the entire timeframe. Existing short-term precipitation forecasting methods primarily focus on numerical prediction and radar echo extrapolation.
[0003] Numerical model-based short-term precipitation forecasting methods simulate atmospheric state, properties, and motion using existing physical models. Their effectiveness in medium- and long-term weather forecasting has been validated in operational practice. However, inherent limitations of numerical models lead to the following bottlenecks in their effectiveness in nowcasting: Numerical models suffer from forecast start-up delays, resulting in computationally expensive models that fail to meet the timeliness requirements of nowcasting. While numerical forecast products offer good quality for larger-scale weather systems, they are less refined for small- and medium-scale systems, resulting in significant uncertainty in the first six hours of forecasts. Ensemble forecasting has been proposed to incorporate both observational uncertainty and uncertainty in physical processes within numerical models. However, due to the need for numerous repeated calculations under multiple initial field conditions and model parameter schemes, the computational overhead is high. Furthermore, their spatial and temporal resolution is limited by the model's inherent resolution, making them ineffective in addressing the shortcomings of low-resolution models in short-term precipitation forecasting.
[0004] Short-term precipitation forecasting methods based on radar echo extrapolation can be categorized into two types: traditional echo extrapolation methods and deep learning-based methods. Traditional echo extrapolation methods, such as centroid tracking and optical flow, are mostly based on certain approximate assumptions. These assumptions are generally only applicable to analyzing relatively stable echo motion trends and are difficult to effectively predict the complex and rapid evolution of severe convection. Limited by the complexity of the echo extrapolation model, they still have shortcomings in terms of forecast timeliness and accuracy. Compared with traditional methods, radar echo extrapolation methods based on deep learning have achieved significant improvements in forecast accuracy and validity. However, relying solely on reflectivity factors as input often fails to fully capture the complex evolution mechanisms inherent in weather systems. As the extrapolation time increases, forecast uncertainty gradually increases, and model prediction accuracy decreases.
[0005] Because precipitation processes involve numerous factors, a single data source often struggles to accurately capture their complex evolution. In actual forecasting, forecasters can comprehensively analyze weather radar data, meteorological satellite remote sensing data, and numerical model output to predict precipitation from different perspectives and at different spatiotemporal scales. Therefore, fusing features from multiple data sources can enhance forecast reliability. However, because the features from different data sources have different spatiotemporal scales and physical meanings, feature-level fusion is more challenging. Summary of the Invention
[0006] Based on this, it is necessary to provide a short-term precipitation forecast method, device, equipment and storage based on multi-source data to address the above technical problems.
[0007] A short-term precipitation forecast method based on multi-source data, the method comprising: Step S1: pre-processing the acquired radar combined reflectivity factor data and the combined data at the first and second preset heights to obtain three sample sequences.
[0008] Step S2: Input the three sample sequences into a multi-branch generator based on Transformer that has undergone adversarial training to obtain the short-term precipitation forecast results; the multi-branch generator includes: a feature extraction network, an encoding layer, and a decoding layer; the encoding layer includes multiple stacked improved Swin Transformer modules.
[0009] Step S2 specifically includes: The three sample sequences are input into the feature extraction network to obtain multi-source data features; the multi-source data features include: combined features at the first and second preset heights, data fusion features of the combined features at the first and second preset heights, and data features of the radar combined reflectivity factor.
[0010] Position encoding is performed on multi-source data features to obtain position encoding results.
[0011] The position encoding result is input into the encoding layer, and multiple Swin modules are used for feature extraction in each improved Swin Transformer module. The data is fused through the cross attention mechanism and MLP layer to obtain the final encoding features.
[0012] The final encoded features are input into the decoding layer and predicted by multiple prediction heads to obtain the short-term precipitation forecast results.
[0013] A short-term precipitation forecasting device based on multi-source data, the device comprising: The data preprocessing module is used to preprocess the acquired radar combined reflectivity factor data and the combined data at the first and second preset heights to obtain three sample sequences.
[0014] The short-term precipitation forecast module is used to input three sample sequences into a multi-branch generator based on Transformer that has undergone adversarial training to obtain short-term precipitation forecast results; the multi-branch generator includes: a feature extraction network, an encoding layer, and a decoding layer; the encoding layer includes multiple stacked improved Swin Transformer modules.
[0015] The short-term precipitation forecast module is also used to input the three sample sequences into the feature extraction network to obtain multi-source data features; the multi-source data features include: combined features at the first and second preset heights, data fusion features of the combined features at the first and second preset heights, and data features of the radar combined reflectivity factor; the multi-source data features are positionally encoded, and multiple Swin modules are used in each improved Swin Transformer module for feature extraction. Data fusion is performed through a cross-attention mechanism and an MLP layer to obtain a position encoding result; the position encoding result is input into the encoding layer to obtain the final encoding feature; the final encoding feature is input into the decoding layer, and prediction is performed through multiple prediction heads to obtain the short-term precipitation forecast result.
[0016] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any of the above-mentioned short-term precipitation forecasting methods based on multi-source data when executing the computer program.
[0017] A computer-readable memory stores a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned methods for short-term precipitation forecasting based on multi-source data.
[0018] The above-mentioned short-term precipitation forecasting method, apparatus, device and memory based on multi-source data, the method is based on a short-term precipitation forecasting network that integrates radar data and numerical model prior data. By effectively combining the advantages of the two, the correlation and complementarity between radar data and numerical models are fully exploited, achieving higher accuracy and timeliness in short-term precipitation forecasting. By performing deep learning training on multi-source data, the trained network can provide high-resolution and accurate precipitation forecast results, significantly improving the performance of short-term precipitation forecasting. The short-term precipitation forecasting method based on the integration of radar data and numerical model prior data in this method can more accurately capture the complex dynamics of the precipitation process, fully reflect the extensive impact of the weather system, and effectively improve the accuracy of short-term precipitation forecasting; the extrapolation timeliness can be further improved by adjusting the network structure and increasing the number of output data frames of the prediction sequence. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 1 is a flow chart of a method for short-term precipitation forecasting based on multi-source data in one embodiment; Figure 2 1. A schematic diagram of the overall flow of a method for short-term precipitation forecasting based on multi-source data in one embodiment; Figure 3 This is an overall framework diagram of a short-term precipitation forecast model based on multi-source data in another embodiment; Figure 4 A schematic diagram of the encoding layer and decoding layer network of a Transformer-based multi-branch prediction generator in another embodiment; Figure 5 A structural diagram of a Swin module in another embodiment; Figure 6 This is a diagram of the Cross-Attention structure in another embodiment; Figure 7 This is a schematic diagram of a discriminator network based on PatchGAN in another embodiment. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0021] In one embodiment, Figure 1 、 Figure 2 As shown, a short-term precipitation forecast method based on multi-source data is provided, which includes the following steps: Step S1: pre-processing the acquired radar combined reflectivity factor data and the combined data at the first and second preset heights to obtain three sample sequences.
[0022] Specifically, the numerical product data and weather radar echo product data are read and preprocessed. The processed normalized data is cropped and labeled to output gridded numerical products and high-temporal-resolution combined reflectivity factor products. The gridded numerical products include meteorological data such as the geopotential height and relative humidity at the first preset altitude (850hPa) and the geopotential height and relative humidity at the second preset altitude (500hPa). The radar combined reflectivity factor data is the weather radar echo product data.
[0023] The three sample sequences are: a first sample sequence corresponding to the combined data at a first preset height, a second sample sequence corresponding to the combined data at a second preset height, and a third sample sequence corresponding to the radar combined reflectivity factor data.
[0024] Step S2: Input the three sample sequences into a multi-branch generator based on Transformer that has undergone adversarial training to obtain the short-term precipitation forecast results; the multi-branch generator includes: a feature extraction network, an encoding layer, and a decoding layer; the encoding layer includes multiple stacked improved Swin Transformer modules.
[0025] Step S2 specifically includes: Step S2-1: Input the three sample sequences into the feature extraction network to obtain multi-source data features; the multi-source data features include: combined features at the first and second preset heights, data fusion features of the combined features at the first and second preset heights, and data features of the radar combined reflectivity factor.
[0026] Step S2-2: Position-encode the multi-source data features to obtain position-encoded results.
[0027] Step S2-3: The position encoding result is input into the encoding layer. Multiple Swin modules are used for feature extraction in each improved Swin Transformer module. The data is fused through the cross attention mechanism and MLP layer to obtain the final encoding features.
[0028] Step S2-4: The final encoded features are input into the decoding layer, and are predicted by multiple prediction heads to obtain the short-term precipitation forecast results.
[0029] Specifically, a multi-branch generator based on Transformer is constructed: the feature extraction network uses the VGG19 network to extract the numerical pattern data features and radar data features of the training samples, where the numerical pattern data features include: the data features of the potential height Z and relative humidity RH sample set at 850hPa, and the data features of the potential height Z and relative humidity RH sample set at 500hPa; the radar data features include: the data features of the combined reflectivity factor CR sample set.
[0030] The encoding layer includes multiple improved Transformer modules to extract and fuse multimodal input features. The improved Transformer module adopts an encoder-decoder architecture and receives meteorological feature sequences of multiple different altitude layers as input, including the combined reflectivity factor feature sequence and the combined features of potential height and relative humidity of different pressure layers. Through multi-branch parallel processing and feature fusion mechanism, it realizes deep modeling of complex meteorological phenomena.
[0031] The decoding layer generates different types of prediction results through multiple dedicated output heads. The improved Swin Transformer module is used to extract features using multiple Swin modules and fuse multi-source data through a cross-attention mechanism and MLP layers.
[0032] Based on the network structure of VGG19 and Transformer, in order to improve the accuracy and timeliness of short-term precipitation forecasts, numerical forecasts can provide large-scale background information and reveal a wider range of meteorological system dynamics. Radar echo data mainly reflects local weather phenomena and has strong timeliness and spatial resolution. A short-term precipitation forecast model is designed by fusing radar data and numerical model prior data. By fusing the characteristics of multi-source data to model the correlation and complementarity of multi-source products, the problem that a single data source is difficult to accurately capture its complex evolution law, the extrapolation accuracy is low, and the effective time is short is solved.
[0033] The trained network can fully explore the correlation and complementarity between multi-source data, improve the spatial resolution and timeliness of precipitation forecasts, and is of great significance for short-term precipitation forecasts.
[0034] In the above-mentioned short-term precipitation forecasting method based on multi-source data, the short-term precipitation forecasting network based on the fusion of radar data and numerical model prior data effectively combines the advantages of the two, fully exploits the correlation and complementarity between radar data and numerical models, and achieves higher accuracy and timeliness in short-term precipitation forecasting. By performing deep learning training on multi-source data, the trained network can provide high-resolution and accurate precipitation forecast results, significantly improving the performance of short-term precipitation forecasting. In this method, the short-term precipitation forecasting method based on the fusion of radar data and numerical model prior data can more accurately capture the complex dynamics of the precipitation process, fully reflect the extensive impact of the weather system, and effectively improve the accuracy of short-term precipitation forecasting; the extrapolation timeliness can be further improved by adjusting the network structure and increasing the number of output data frames of the prediction sequence.
[0035] In one embodiment, the combined data includes: geopotential height and relative humidity; step S1 includes: obtaining numerical product data and weather radar echo product data; the numerical product data includes: geopotential height and relative humidity at a first preset height and a second preset height; the weather radar echo product data includes: radar combined reflectivity factor data; the geopotential height and relative humidity at the first preset height and the second preset height are gridded, normalized, and clipped to obtain two corresponding groups of normalized data after clipping; the two groups of normalized data after clipping are divided according to a preset time series length and a preset sliding window width. The radar combination reflectivity factor data are preprocessed, and the preprocessing results are normalized and cropped to obtain normalized radar combination reflectivity factor data after size cropping; according to the preset sliding window width and twice the preset time series length, data sequence samples of the radar combination reflectivity factor are generated as the third sample sequence; according to the data sequence samples of the numerical model product data and the data sequence samples of the radar combination reflectivity factor, the multi-source data samples are determined.
[0036] Specifically, as a preference, the first preset height is 850 hPa, and the second preset height is 500 hPa.
[0037] Step S1-1: Preprocessing of numerical model products: Read the numerical model products of the potential height Z and relative humidity RH at 850 hPa and 500 hPa and perform data preprocessing to obtain gridded and normalized numerical data, and divide them into training sample set, verification sample set and test sample set.
[0038] Step S1-1-1: Read the numerical model product data: According to the numerical model output product format, read the product data and decode it, take the altitude layers 850hPa and 500hPa as the extraction fields, and extract the potential height Z and relative humidity RH data information of the corresponding layers.
[0039] Step S1-1-2: Data preprocessing: Read the data in step S1-1-1, map the original data to a regular grid through a gridding operation, and then perform normalization processing to crop the normalized data to the same size.
[0040] Step S1-1-3: Dataset division: For the normalized data obtained after size cropping in step S1-1-2, a data sample set is generated according to a certain time series length and sliding window width, and the sample set is divided into a training sample set, a validation sample set, and a test sample set according to a certain ratio.
[0041] Step S1-1-3-1, generate data sequence sample set: set sample sequence length , sliding window width , the first Frame step size , after the sample sequence Frame step size , move forward Frame data as model input sequence ,back Frame data as label sequence , the sample sequence sequence_length is expressed as: ; The data sequence sample set sequence is: ; ; ; in, , , , , , , , , Indicates the first to the data, continuous in time; , , , , , , , , , , Indicates the first to the data, the time interval is , , , , , , , , , , , , , , , , , , Represents data separately , , , , , , , , , , , , , , , , , corresponding moments; Input sequence Middle data and tag sequence The first data The time interval is ; The time interval between the corresponding data of the latter sequence and the previous sequence is the sliding window width The corresponding duration; Indicates the numeric product category, represents a multi-source product collection, ,and , .
[0042] Step S1-2: Weather radar echo product preprocessing: Read the weather radar echo product with the combined reflectivity factor CR and perform data preprocessing. The normalized data obtained after data processing is cropped and divided into a training sample set, a validation sample set, and a test sample set.
[0043] Step S1-2-1, read weather radar echo product data: read and decode the data according to the weather radar data format, starting from the upper left corner, write the data in a manner such that the column number increases with longitude and the row number increases with latitude, obtain the data block, convert the data block into meteorological element regular grid data according to the data layer number and longitude and latitude coordinates in the file header, and store the decoded data file separately according to the file header and data block; Step S1-2-2, radar data preprocessing: read the data block in step S1-2-1, convert the stored value into the actual value of the meteorological element according to the coding relationship, and then perform normalization processing to obtain normalized data; Step S1-2-3, data set division: For the normalized data obtained in step S1-2-2, select the main echo area in the same area as the numerical model product, crop the normalized data to the same size, generate a data sample set based on a certain time series length and sliding window width, and divide the sample set into a training sample set, a verification sample set, and a test sample set according to a certain ratio.
[0044] Step S1-2-3-1, generate data sequence sample set: set sample sequence length , sliding window width , the step size of the first 10 frames in the sample sequence , the step size of the last 10 frames in the sample sequence , move forward Frame data as model input sequence ,back Frame data as label sequence , the sample sequence sequence is expressed as: ; ; ; in, , , , , , , , , Represents the 1st to Lth data in the input sequence, which are continuous in time; , , , , , , , , , , Represents the 1st to Lth data in the tag sequence, with a time interval of , , , , , , , , , , , , , , , , , , Represents data separately , , , , , , , , , , , , , , , , , The corresponding moment.
[0045] Input sequence The Lth data and tag sequence The first data The time interval is ; The time interval between the corresponding data of the latter sequence and the previous sequence is the sliding window width The corresponding duration; Represents the radar combined reflectivity factor data CR, represents a multi-source product collection, , .
[0046] In one embodiment, a short-term precipitation forecast model based on multi-source data includes: a multi-branch generator based on Transformer and a PatchGAN discriminator; the PatchGAN discriminator is used to judge the authenticity of the short-term precipitation forecast results of the multi-branch generator during the model training stage; the combined data includes: potential height and relative humidity; the adversarial training process of the multi-branch generator based on Transformer includes: obtaining a training sample set, each training sample includes: a first sample sequence corresponding to the potential height and relative humidity at a first preset height, a second sample sequence corresponding to the potential height and relative humidity at the first preset height, and a third sample sequence corresponding to the radar combined reflectivity factor data; inputting the training sample into the multi-branch generator based on Transformer In the branch generator, the predicted values of the potential height and relative humidity at the first preset height, the predicted values of the potential height and relative humidity at the second height, the predicted precipitation and the predicted report sequence are obtained; in the PatchGAN discriminator, the predicted values of the potential height and relative humidity at the first preset height, the predicted values of the potential height and relative humidity at the second height, the predicted precipitation and the predicted report sequence are compared with the true values of the potential height and relative humidity at the first preset height, the true values of the potential height and relative humidity at the second height, the true value of the hourly precipitation and the true value of the radar echo sequence respectively. According to the comparison results and the loss function, the Transformer-based multi-branch generator is reversely trained until the preset stopping condition is met, and a trained Transformer-based multi-branch generator is obtained.
[0047] Specifically, the short-term precipitation forecast model based on multi-source data includes a Transformer-based multi-branch generator and a PatchGAN discriminator; the Transformer-based multi-branch generator includes: a feature extraction network, an encoding layer and a decoding layer; the encoding layer includes multiple stacked improved Transformer modules; the decoding layer includes multiple prediction heads; the feature extraction network is used to extract the numerical pattern data features and radar data features of the training samples using the VGG network; the improved Transformer module is used to use multiple Swin modules to process each type of feature sequence separately, and then use the cross attention layer and the MLP layer to fuse them to obtain the encoding features; the decoding layer is used to make predictions based on the output of the encoding layer to obtain the short-term precipitation forecast results; the PatchGAN discriminator is used to judge the authenticity of the short-term precipitation forecast results of the multi-branch generator during the model training stage.
[0048] The PatchGAN discriminator network receives the multi-branch predicted image and real image output by the generator, and distinguishes true and false samples through the convolutional neural network structure. It uses multiple convolutional layers and downsampling layers to finally output the true and false discrimination probability.
[0049] The adversarial generative network is constructed based on the Transformer-based multi-branch generator and the PatchGAN discriminator. The Transformer-based multi-branch generator uses the attention mechanism to fuse the features of multi-source data for prediction. The PatchGAN discriminator is responsible for evaluating the authenticity of the generated results and optimizing the network through the adversarial training mechanism. After the training is completed, the network parameters are saved. Test model: The sample data of the test set is input into the trained generator to finally obtain the predicted radar echo image, hourly precipitation and numerical product prediction results, thereby realizing short-term precipitation forecast. The overall framework of the short-term precipitation forecast model based on multi-source data is as follows: Figure 3 shown.
[0050] Training process: Initialize the network model, use the training sample set to train the Transformer-based multi-branch generator, and use the prediction results of the Transformer-based multi-branch generator and the real label data in step S1 to train the PatchGAN discriminator. Optimize the network parameters through the adversarial training mechanism and save the network parameters after training.
[0051] The data in the test sample set are input into the trained Transformer-based multi-branch generator to predict the potential height Z and relative humidity RH at 850hPa and 500hPa respectively, and the prediction results of the combined reflectivity product and hourly precipitation are output at the same time, thereby realizing short-term precipitation forecast.
[0052] In one embodiment, the loss function in the training process of the short-term precipitation forecast model adopts mean square error, and the total loss function of the short-term precipitation forecast model is expressed as: ; in, is the total loss; Predict the loss for the combined reflectivity factor, The loss is predicted by the geopotential height Z and relative humidity RH at 850hPa, The loss is predicted by the potential height Z and relative humidity RH at 500hPa, Preset losses for hourly precipitation at the corresponding moment, and are the combined reflectivity factor prediction data and label data, and They are the predicted data of geopotential height Z and relative humidity RH at 850hPa, and are the predicted data of geopotential height Z and relative humidity RH at 500hPa, and are the hourly precipitation data at the corresponding time, is the weight hyperparameter of each meteorological element.
[0053] In one embodiment, the feature extraction network includes multiple feature extraction modules; the feature extraction module is a VGG network; step 2-1 specifically includes: using the VGG network to extract features on the first sample sequence, the second sample sequence, and the third sample sequence, respectively, to obtain data features of the potential height and relative humidity at the first preset height, data features of the potential height and relative humidity at the first preset height, and data features of the radar combined reflectivity factor; splicing the data features of the potential height and relative humidity at the same height to obtain the combined features at the corresponding height; splicing the combined feature vectors at the first preset height and the second preset height to obtain data fusion features.
[0054] Specifically, step S2-1-1: Initialize the feature extraction network. Define the VGG19 network structure and configure the relevant parameters for the model. Use the pre-training method to initialize the network weights. The model is trained using the Adam optimizer, initialize the model hyperparameters, and set the learning rate. , the number of samples input in each batch during the training phase , maximum number of training iterations .
[0055] Step S2-1-1-1: Construct convolution block C1: Convolution block C1 consists of two convolutions, The activation function and a pooling layer are applied after each convolution. Activation function. Convolution kernel size , convolution step size , fill with zero size , take maximum pooling Operation, pooling step , the number of feature maps output by the C1 layer , the width of the output feature map .
[0056] Step S2-1-1-2: Construct convolution block C2: Convolution block C2 consists of two convolutions, The activation function and a pooling layer are applied after each convolution. Activation function. Convolution kernel size , convolution step size , fill with zero size , take maximum pooling Operation, pooling step , the number of feature maps output by the C2 layer , the width of the output feature map .
[0057] Step S2-1-1-3: Construct convolution block C3: Convolution block C3 consists of four convolutions, The activation function and a pooling layer are applied after each convolution. Activation function. Convolution kernel size , convolution step size , fill with zero size , take maximum pooling Operation, pooling step , the number of feature maps output by the C3 layer , the width of the output feature map ; Step S2-1-1-4: Construct convolution block C4: Convolution block C4 consists of four convolutions, The activation function and a pooling layer are applied after each convolution. Activation function. Convolution kernel size , convolution step size , fill with zero size , take maximum pooling Operation, pooling step , the number of feature maps output by the C4 layer , the width of the output feature map ; Step S2-1-1-5: Construct convolution block C5: Convolution block C5 consists of four convolutions, The activation function and a pooling layer are applied after each convolution. Activation function. Convolution kernel size , convolution step size , fill with zero size , take maximum pooling Operation, pooling step , the number of feature maps output by the C5 layer , the width of the output feature map ; Step S2-1-1-6: Construct the fully connected layer T1: The fully connected layer T1 consists of three fully connected layers FC1, FC2, and FC3. The number of input feature maps of the T1 layer is , the number of output images of FC1 layer , output feature map size , the number of output images of FC2 layer , output feature map size , the number of output images of FC3 layer , output feature map size , the number of output images of the T1 layer , output data size .
[0058] Step S2-1-2: Multi-source data feature extraction: Feature extraction is performed on the various data input to the model through convolution operations, including the potential height Z and relative humidity RH at 850 hPa, the potential height Z and relative humidity RH at 500 hPa, and the combined reflectivity factor CR; Step S2-1-2-1: Multi-source data feature extraction: For the multi-source data sample set obtained in steps S1-1-3 and S1-2-3, for each sample sequence , , through the convolution operation, the data features of the potential height Z at 850hPa, the relative humidity RH at 850hPa, the potential height Z at 500hPa, the relative humidity RH at 500hPa and the combined reflectivity factor CR are extracted respectively, and the input sample frame And the corresponding convolution kernel Convolution, convolution result plus bias parameter , and then go through Function activation, output encoding features , and obtain the feature sequence , the calculation formula is as follows: ); in, is the input sample frame, is the output encoding feature, is the convolution kernel, is the bias parameter, represents the convolution operation, is the rectified linear unit activation function; The feature vectors of the potential height Z and relative humidity RH at the same altitude are spliced to form a combined feature vector to obtain a new feature sequence , , respectively denote the characteristic sequence of the combined reflectivity factor as , the combined characteristic sequence of all geopotential heights Z and relative humidity RH is , the combined characteristic sequence of geopotential height Z and relative humidity RH at 850hPa is , the combined characteristic sequence of geopotential height Z and relative humidity RH at 500hPa is in 、 、 、 .
[0059] Step S2-1-3: Network parameter training and update: During the model training process, batch training is used. Each time, a training sample set is obtained from step S1-1 and step S1-2. The batch size of training data used each time the network is input is defined as Through this process, the network parameters are trained and optimized, and the parameters in the training process are recorded as the weights in the convolution kernel. and bias , parameter learning is performed through the error back propagation algorithm; when the data set is iterated once, the validation sample set is used to evaluate the current model effect and optimize the hyperparameter settings.
[0060] Step 2-1-3-1: Use fusion features to train the generator network: Input the training sample set data into the generator network model, for a length Multi-source sample sequence , is the sample number, Frame data , used as training data for feature extraction and feature fusion, input the Transformer-based multi-branch prediction generator network, and output multiple prediction data of the last L frames in the decoding layer D1 , respectively select the combined reflectivity factor data in the last L frames of data , combined data of geopotential height Z and relative humidity RH at 850hPa , combined data of geopotential height Z and relative humidity RH at 500hPa , hourly precipitation data at the corresponding time As label data, the generator prediction results As fake samples, the real label data is used as real samples, and they are input into the PatchGAN discriminator for true and false discrimination; Step 2-1-3-2: Calculate loss: loss includes discriminator loss and multi-branch generator loss There are two parts. The discriminator distinguishes true from false for each patch area of the input data and outputs an N×N discrimination result matrix. Its loss function is: ; ; ; in, is the real label data, i.e. the real sample, The prediction result of the generator is the fake sample, Indicates the discriminator's response to the true sample The probability that a patch is considered true, Indicates the false sample The probability that a patch is considered true, is the discriminant matrix size output by PatchGAN, is the real sample discrimination loss, To generate sample discrimination loss, the discriminator should output a high probability value (close to 1) for real samples and a low probability value (close to 0) for generated samples. By minimizing the sum of these two losses, the discriminator is trained to correctly distinguish between true and false samples. The multi-branch generator needs to deceive the PatchGAN discriminator and make it think that each patch of generated data is real. Its loss function is By adversarial loss function and content loss function composition: ; ; in, Predict the results for the generator, Indicates that the discriminator believes that the generated data The probability that a patch is true, is the loss function weight hyperparameter.
[0061] Content loss function A combination of L1 loss and mean square error (MSE) loss is used to calculate the difference between the generator’s predicted data and the true labeled data: ; ; Mean Squared Error (MSE) loss Select the combined reflectivity factor prediction data output by the decoding layer D1 , the predicted data of geopotential height Z and relative humidity RH at 850hPa , the potential height Z and relative humidity RH prediction data at 500hPa , hourly precipitation data at the corresponding time Respectively with their respective label data , , , Calculate the loss, the formula is as follows: ; ; ; ; ; in, , is the sample serial number, is the sample sequence length, is the weight hyperparameter of each meteorological element, is the loss function hyperparameter; Step 2-1-3-3: Error back propagation to update parameters: According to the loss function, an alternating training strategy is used to update the parameters.
[0062] Fixed generator parameters , using the discriminator loss For the discriminator parameters Perform gradient descent update: ; Fixed discriminator parameters , using the generator loss For the discriminator parameters Perform gradient descent update: ; in, and are the gradients of the discriminator parameters and generator parameters, respectively, and are the discriminator parameters before and after updating respectively; and are the generator parameters before and after the update, and are the learning rates of the discriminator and the generator, respectively, usually set < To maintain training stability, the Adam optimizer is used to automatically perform gradient backpropagation and parameter updates. Step 2-1-3-4: Optimize and select network hyperparameters: Based on the results of the model on the validation sample set during training, select the hyperparameters of the model with the best performance as the final hyperparameters of the network model.
[0063] In one embodiment, the position coding result includes: the combined feature position coding result at the first preset height, the combined feature position coding result at the second preset height, the data fusion feature position coding result, and the data feature position coding result of the radar combined reflectivity factor; step 2-2 specifically includes: inputting the combined feature position coding result at the first preset height, the combined feature position coding result at the second preset height, the data fusion feature position coding result, and the data feature position coding result of the radar combined reflectivity factor into the first improved Transformer module, each feature is processed by the corresponding Swin module, and the outputs of all Swin modules are processed by the cross attention mechanism and then processed by the MLP layer to obtain the first coding Features; the first coding features include: the first coding features of the fused combined reflectivity factor and the combined features at the first preset height, the first coding features of the fused combined reflectivity factor and the combined features at the second preset height, and the first coding features of the fused combined reflectivity factor and the data fusion features at all preset heights; the first coding features are used as the input of the next improved Transformer module until the last Transformer module to obtain the final coding features; the final coding features include: the final coding features of the fused combined reflectivity factor and the combined features at the first preset height, the final coding features of the fused combined reflectivity factor and the combined features at the second preset height, and the final coding features of the fused combined reflectivity factor and the data fusion features at all preset heights.
[0064] Specifically, step S2-2-1: Initialize the encoding layer and decoding layer models of the Transformer-based multi-branch generator and the PatchGAN discriminator network. Define the PatchGAN discriminator and the encoding layer and decoding layer network structures of the Transformer-based multi-branch generator and configure relevant parameters for the model. Use the Orthogonal method to initialize the encoding layer and decoding layer weights, use the normal distribution to initialize the discriminator weights, train the multi-branch generator and discriminator using the Adam optimizer respectively, initialize the model hyperparameters, and set the learning rate of the generator and discriminator. (The discriminator learning rate is slightly lower), the number of samples input in each batch during the training phase , maximum number of training iterations .
[0065] The encoding layer and decoding layer network principles of the Transformer-based multi-branch prediction generator are as follows Figure 4 As shown, Figure 4 The improved Transformer module structure diagram is given in the following figure. The Swin module structure is as follows: Figure 5 shown.
[0066] Step S2-2-1-1: Extract the combined reflectivity factor feature sequence , the combined characteristic sequence of geopotential height Z and relative humidity RH at 850hPa , the combined characteristic sequence of geopotential height Z at 500hPa and relative humidity RH And all the combined characteristic sequences of geopotential height Z and relative humidity RH As the model input, it is converted into Token form and positionally encoded to obtain the input feature representation with position encoding.
[0067] Step S2-2-1-1-1: Calculate the Token size: Get the combined reflectivity factor feature sequence , the combined characteristic sequence of geopotential height Z and relative humidity RH at 850hPa , the combined characteristic sequence of geopotential height Z and relative humidity RH at 500hPa And all the combined characteristic sequences of geopotential height Z and relative humidity RH Cut into multiple patches, each patch corresponds to a data token, and the calculation formula is: ; ; ; ; in, is the combined reflectivity factor feature Token, and ,in Represents the combined reflectivity factor feature sequence, a is the number of combined reflectivity factor feature tokens, and d is the dimension of each token. The combined feature tokens of all geopotential heights Z and relative humidity RH are represented as ,and ,in Represents the combined feature sequence of all geopotential heights Z and relative humidity RH, b is the number of tokens of the combined feature of geopotential heights Z and relative humidity RH, and d is the dimension of each token. The combined feature token of geopotential heights Z and relative humidity RH at 850hPa is represented as ,and ,in represents the combined feature sequence of geopotential height Z and relative humidity RH at 850hPa, c is the number of tokens of the combined feature of geopotential height Z and relative humidity RH at 850hPa, and d is the dimension of each token. The combined feature token of geopotential height Z and relative humidity RH at 500hPa is represented by ,and ,in represents the combined feature sequence of the geopotential height Z and relative humidity RH at 500 hPa, e is the number of tokens of the combined feature of the geopotential height Z and relative humidity RH at 500 hPa, and d is the dimension of each token; Step S2-2-1-1-2: Calculate position encoding: For the obtained token features 、 、 、 Apply position embedding separately, for each Token, calculate the corresponding position encoding according to its position pos in the input sequence , the calculation process is expressed as: ; ; in Indicates the current location, represents the dimension index in the positional encoding, The total dimension of the position encoding is , indexed by its position and dimension , calculate the unique position encoding value. If it is an even dimension , using the sine function Computation, odd dimensions , using the cosine function Calculation. Add the position code and the sequence feature Token to obtain the input feature with position code. The calculation formula is expressed as: ; ; ; ; in, It is a token with position-enhanced combined reflectivity factor. is the token of all geopotential heights Z and relative humidity RH after position enhancement, It is the token of the geopotential height Z and relative humidity RH at 850hPa after position enhancement. It is the position-enhanced token of the geopotential height Z and relative humidity RH at 500 hPa; Step S2-2-1-1-2-1: Calculate the windowed self-attention mechanism: For the obtained input feature matrix 、 、 、 , calculate the self-attention of each feature matrix window in each Swin Block module. Layer, which divides the input features into non-overlapping local windows, each of which has a size of , in each window Internally calculate self-attention, the calculation formula is as follows: ; ; ; in, is the first The feature representation of the window is is the weight matrix learned during training, The weights used to generate the query matrix, The weights used to generate the key matrix, The weights used to generate the value matrix. , the input features Convert to query matrix , key matrix Sum Matrix , thereby calculating the correlation between tokens. Then use the self-attention formula to calculate each window, the calculation formula is as follows: ; in, is the query matrix and bond matrix The dot product of , similarity measure, is a scaling factor to avoid the inner product result being too large, is the dimension of the key, i.e. the key matrix The number of columns, function Dot product results Normalize to ensure that the attention weight of each Token is between [0,1] and the sum of all weights is 1. The weights calculated by the function are applied to the value matrix On the above, we get the weighted representation of each Token, that is, .
[0068] For the results of self-attention output, layer normalization is performed, and then a multi-layer perceptron is used for nonlinear transformation. The calculation formula is as follows: ; ; in, is the layer normalization function, For multi-layer perceptron transformation. After the above processing, the data enters the jump connection, and after completing a round of processing, the final output of this layer is obtained. , which is then passed to the next layer, and the calculation process is as follows: .
[0069] In the subsequent chapters of the Swin Block module Layer, offset the window After recalculating the self-attention in the window, for the offset window , get the new query ,key Sum Matrix, and calculate the offset window to calculate the self-attention. The calculation process is as follows: ; ; ; .
[0070] Repeat the layer normalization and residual connection operations until all blocks are processed, and then use the multi-layer perceptron MLP to obtain the processed combined reflectivity factor output , the combined output of all geopotential heights Z and relative humidity RH , the combined output of the geopotential height Z at 850hPa and the relative humidity RH , the combined output of the potential height Z at 500hPa and the relative humidity RH .
[0071] Step S2-2-1-1-2-2: Feature fusion: Adopt the Cross-Attention structure based on cross attention (cross attention layer as shown in Figure 6 The feature fusion strategy shown in Figure 2 outputs the processed combined reflectivity factor. The output of the combined characteristics of geopotential height Z and relative humidity RH after position enhancement The cross-attention mechanism is used for weighted fusion to obtain the fused feature output. The combined reflectivity factor is then output Combined feature output at different HPA levels 、 Perform cross attention fusion separately to obtain the fused feature output 、 , the calculation process is as follows: First, the output of the combined reflectivity factor focusing on the combined characteristics of geopotential height Z and relative humidity RH is obtained, specifically: ; ; ; ; in, is the query vector obtained by combining the reflectivity factor mapping, is the key vector and value vector obtained by the combined feature mapping of geopotential height Z and relative humidity RH, is the weight matrix learned during training, is the output of the combined reflectivity factor after position enhancement The weight matrix mapped to the query space, It is the output of the combined characteristics of geopotential height Z and relative humidity RH after position enhancement The weight matrix mapped to the key space, It is the output of the combined characteristics of geopotential height Z and relative humidity RH after position enhancement The weight matrix mapped to the value space, is the bias vector learned during the linear transformation process, is a scaling factor to avoid the inner product result being too large, is the dimension of the key, i.e. the key matrix The number of columns.
[0072] Similarly, the output of the combined characteristic of geopotential height Z and relative humidity RH and the combined reflectivity factor is: ; ; ; ; in, is the query vector obtained by combining the feature mapping of geopotential height Z and relative humidity RH, is the key vector and value vector obtained by combining the reflectivity factor mapping, is the weight matrix learned during training, It is the output of the combined characteristics of geopotential height Z and relative humidity RH after position enhancement The weight matrix mapped to the query space, is the output of the combined reflectivity factor after position enhancement The weight matrix mapped to the key space, is the output of the combined reflectivity factor after position enhancement The weight matrix mapped to the value space, is the bias vector learned during the linear transformation process, is a scaling factor to avoid the inner product result being too large, is the dimension of the key, i.e. the key matrix The number of columns.
[0073] After calculating the cross attention, two weighted representations are obtained, namely the output of the combined reflectivity factor focusing on the combined features of the potential height Z and the relative humidity RH The combined characteristics of geopotential height Z and relative humidity RH focus on the output of the combined reflectivity factor , the output is spliced and the processed fusion Token output is obtained through the multi-layer perceptron MLP, which is expressed as , the calculation formula is as follows: ; ; in, It means that two weighted outputs are spliced together. The length of the fused feature sequence and the size of the feature map after splicing remain unchanged, and the number of fused feature channels is expanded to twice the original number.
[0074] Repeat the above method to obtain the output of the fusion combination reflectivity factor, the potential height Z at 850hPa and the relative humidity RH , fusion combination reflectivity factor and 500hPa potential height Z and relative humidity RH output , specifically: ; .
[0075] Step S2-2-1-2: Construct sequence encoding layer E1: The encoding layer E1 consists of B Transformer Block modules. Each Transformer Block module contains a Swin Block module and a cross-attention layer. The Swin Block module calculates the self-attention mechanism of the single feature sequence window, and the cross-attention layer realizes feature fusion. The output of each Transformer Block is passed to the next TransformerBlock after residual connection and layer normalization until B Blocks complete all processing. The multi-layer perceptron MLP is used to obtain the output of the fused combination reflectivity factor with the potential height Z and relative humidity RH at 850hPa, the output of the fused combination reflectivity factor with the potential height Z and relative humidity RH at 500hPa, and the output of the fused combination reflectivity factor with all potential heights Z and relative humidity RH, which are expressed as , , ; Step S2-2-1-3: Construct the sequence decoding layer D1: The decoding layer D1 consists of multiple output heads. The output results of step S2-2-1-2 are passed to different output heads. Each head is responsible for outputting different types of feature representations. Each output head further maps the decoded features to the final prediction space through the fully connected layer FC Layer. The calculation process of each head can be expressed as: , where FC represents the fully connected layer, Indicates the size of the target image frame by frame, is the decoded feature; Step S2-2-1-3-1, decoding layer D1 processing: the feature sequence after position encoding and attention fusion 、 、 The input of this layer enters different output heads. Each input head consists of a fully connected layer (FC), which is responsible for mapping the input feature sequence and outputting the prediction result. The calculation formula of each output head is as follows: ; in, Represents the prediction results, It is The fully connected layer of the output head, It is The input features of the output head.
[0076] Step S2-2-2: Network parameter training and update: During the model training process, batch training is used to obtain a training sample set each time and obtain the corresponding real label data at the same time. The training data batch size used each time the network is input is defined as The generator prediction results are used as fake samples and the true labels are used as true samples to input the discriminator for true and false discrimination, and the discriminator parameters are updated. Then the generator is trained and optimized by generating adversarial loss and content loss. The parameters in the training process are recorded as weights in the convolution kernel. and bias , parameter learning is performed through error back propagation; when the data set is iterated once, the prediction effect of the generator is evaluated using the validation sample set to optimize the hyperparameter settings.
[0077] Step S2-3-1: Construct the PatchGAN discriminator network: The discriminator receives the multi-branch predicted image and the real image output by the generator, and uses the convolutional neural network structure to distinguish true and false samples. It uses multiple convolution layers and downsampling layers to finally output the true and false discrimination probability. The principle diagram of the discriminator network based on PatchGAN is as follows Figure 7 shown.
[0078] Step S2-3-1-1, construct the first convolution layer C64: The first convolution layer C64 is the first layer of the discriminator, receiving the input image, the convolution kernel size , convolution step size , fill with zero size The convolution operation has 64 output channels and a slope parameter of 0.2 is applied after each convolution. Activation function.
[0079] Step S2-3-1-2, construct the second convolutional layer C128: The second convolutional layer C128 consists of two sub-layers, the first sub-layer has a convolution kernel size of n128s2 , convolution step size , the number of output channels is 128, and the convolution kernel size of the second sublayer is n128s1 , convolution step size , the number of output channels is 128, and batch normalization is applied after each sublayer and Activation function.
[0080] Step S2-3-1-3, construct the third convolutional layer C256: The third convolutional layer C256 consists of two sub-layers, the first sub-layer has a convolution kernel size of n256s2 , convolution step size , the number of output channels is 256, and the convolution kernel size of the second sublayer is n256s1 , convolution step size , the number of output channels is 256, and batch normalization is applied after each sublayer and Activation function.
[0081] Step S2-3-1-4, construct the fourth convolutional layer C512: The fourth convolutional layer C512 consists of three sub-layers, the first sub-layer has a convolution kernel size of n512s2 , convolution step size , the number of output channels is 512, and the convolution kernel size of the second sublayer is n512s1 , convolution step size , the number of output channels is 512, and the convolution kernel size of the third sublayer is n512s2 , convolution step size , the number of output channels is 512, and batch normalization is applied after each sublayer and Activation function.
[0082] Step S2-3-1-5, construct the output layer: the output layer n8s2 receives the output of step S2-3-1-4 as input, and the convolution kernel size , convolution step size , the number of output channels is 1, followed by Activation function, outputs the probability value of true and false discrimination, and sets multiple output points at different levels of the network , thereby realizing multi-scale feature discrimination, where Represents the total number of network layers.
[0083] In one embodiment, steps 2-4 specifically include: processing the final coding features of the fused combined reflectivity factor and the combined features at the first preset height, the final coding features of the fused combined reflectivity factor and the combined features at the second preset height, and the final coding features of the fused combined reflectivity factor and the data fusion features at all preset heights through a prediction head to obtain a short-term precipitation forecast result; the short-term precipitation forecast result includes the radar combined reflectivity factor prediction result, the hourly precipitation prediction result, and the potential height and relative humidity prediction results at two preset heights.
[0084] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0085] In one embodiment, a short-term precipitation forecasting device based on multi-source data is provided, comprising: The data preprocessing module is used to preprocess the acquired radar combined reflectivity factor data and the combined data at the first and second preset heights to obtain three sample sequences.
[0086] The short-term precipitation forecast module is used to input three sample sequences into a multi-branch generator based on Transformer that has undergone adversarial training to obtain short-term precipitation forecast results; the multi-branch generator includes: a feature extraction network, an encoding layer, and a decoding layer; the encoding layer includes multiple stacked improved Swin Transformer modules.
[0087] The short-term precipitation forecast module is further used to input the first sample sequence, the second sample sequence, and the third sample sequence into the feature extraction network to obtain multi-source data features; the multi-source data features include: combined features at the first and second preset heights, data fusion features of the combined features at the first and second preset heights, and data features of the radar combined reflectivity factor; position encoding the multi-source data features to obtain position encoding results; input the position encoding results into the encoding layer to obtain final encoding features; input the final encoding features into the decoding layer, and perform prediction through multiple prediction heads to obtain short-term precipitation forecast results.
[0088] In one embodiment, the combined data includes: potential height and relative humidity; the data preprocessing module is further used to obtain numerical product data and weather radar echo product data; the numerical product data includes: potential height and relative humidity at a first preset height and a second preset height; the weather radar echo product data includes: radar combined reflectivity factor data; the potential height and relative humidity at the first preset height and the second preset height are gridded, normalized, and clipped to obtain two corresponding groups of normalized data after clipping; the two groups of normalized data after clipping are clipped according to a preset time series length and a preset sliding window width. The data are processed to obtain sequence samples corresponding to the potential height and relative humidity at the first preset height and the second preset height, as the first sample sequence and the second sample sequence; the radar combination reflectivity factor data are preprocessed, and the preprocessing results are normalized and cropped to obtain the normalized radar combination reflectivity factor data after size cropping; according to the preset sliding window width and twice the preset time series length, the data sequence samples of the radar combination reflectivity factor are generated as the third sample sequence; according to the data sequence samples of the numerical model product data and the data sequence samples of the radar combination reflectivity factor, the multi-source data samples are determined.
[0089] In one embodiment, a short-term precipitation forecast model based on multi-source data includes: a multi-branch generator based on Transformer and a PatchGAN discriminator; the PatchGAN discriminator is used to judge the authenticity of the short-term precipitation forecast results of the multi-branch generator during the model training stage; the combined data includes: potential height and relative humidity; the adversarial training process of the multi-branch generator based on Transformer in the short-term precipitation forecast module includes: obtaining a training sample set, each training sample includes: a first sample sequence corresponding to the potential height and relative humidity at a first preset height, a second sample sequence corresponding to the potential height and relative humidity at the first preset height, and a third sample sequence corresponding to the radar combined reflectivity factor data; inputting the training sample into the Transformer-based In the multi-branch generator of er, the predicted values of the potential height and relative humidity at the first preset height, the predicted values of the potential height and relative humidity at the second height, the predicted precipitation and the predicted return sequence are obtained; in the PatchGAN discriminator, the predicted values of the potential height and relative humidity at the first preset height, the predicted values of the potential height and relative humidity at the second height, the predicted precipitation and the predicted return sequence are compared with the true values of the potential height and relative humidity at the first preset height, the true values of the potential height and relative humidity at the second height, the true value of the hourly precipitation and the true value of the radar echo sequence respectively, and the Transformer-based multi-branch generator is reversely trained according to the comparison results and the loss function until the preset stopping condition is met, thereby obtaining a trained Transformer-based multi-branch generator.
[0090] In one embodiment, the loss function in the training process of the short-term precipitation forecast model in the short-term precipitation forecast module adopts mean square error, and the total loss function of the short-term precipitation forecast model is as shown in the expression of the total loss function of the short-term precipitation forecast model mentioned above.
[0091] In one embodiment, the feature extraction network includes multiple feature extraction modules; the feature extraction module is a VGG network. The short-term precipitation forecast module is further configured to perform feature extraction on the first sample sequence, the second sample sequence, and the third sample sequence using the VGG network, respectively, to obtain data features of the geopotential height and relative humidity at the first preset height, data features of the geopotential height and relative humidity at the first preset height, and data features of the radar combined reflectivity factor; concatenate the data features of the geopotential height and relative humidity at the same height to obtain a combined feature at the corresponding height; and concatenate the combined feature vectors at the first preset height and the second preset height to obtain a data fusion feature.
[0092] In one embodiment, the position coding result includes: a combined feature position coding result at a first preset height, a combined feature position coding result at a second preset height, a data fusion feature position coding result, and a data feature position coding result of a radar combined reflectivity factor. The short-term precipitation forecast module is also used to input the combined feature position encoding result at the first preset height, the combined feature position encoding result at the second preset height, the data fusion feature position encoding result, and the data feature position encoding result of the radar combined reflectivity factor into the first improved Transformer module, each feature is processed by the corresponding Swin module, and the outputs of all Swin modules are processed by the cross attention mechanism and then processed by the MLP layer to obtain a first encoding feature; the first encoding feature includes: the first encoding feature of the fused combined reflectivity factor and the combined feature at the first preset height, the first encoding feature of the fused combined reflectivity factor and the combined feature at the second preset height, and the first encoding feature of the fused combined reflectivity factor and the data fusion feature at all preset heights; the first encoding feature is used as the input of the next improved Transformer module until the last Transformer module to obtain the final encoding feature; the final encoding feature includes: the final encoding feature of the fused combined reflectivity factor and the combined feature at the first preset height, the final encoding feature of the fused combined reflectivity factor and the combined feature at the second preset height, and the final encoding feature of the fused combined reflectivity factor and the data fusion feature at all preset heights.
[0093] In one embodiment, the short-term precipitation forecast module is further used to process the final coding features of the fused combined reflectivity factor and the combined features at the first preset height, the final coding features of the fused combined reflectivity factor and the combined features at the second preset height, and the final coding features of the fused combined reflectivity factor and the data fusion features at all preset heights through a prediction head respectively to obtain a short-term precipitation forecast result; the short-term precipitation forecast result includes the radar combined reflectivity factor prediction result, the hourly precipitation prediction result, and the potential height and relative humidity prediction results at two preset heights.
[0094] The specific limitations of the short-term precipitation forecast device based on multi-source data can be found in the limitations of the short-term precipitation forecast method based on multi-source data above and will not be repeated here. Each module in the above-mentioned short-term precipitation forecast device based on multi-source data can be implemented in whole or in part via software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so that the processor can call and execute the corresponding operations of each of the above modules.
[0095] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiment when executing the computer program.
[0096] It can be understood that in addition to the memory and processor mentioned above, the above-mentioned computer device also includes other software and hardware components not listed in this specification. The specific components can be determined according to the specific model of the image processing computer in different application scenarios. This specification will not list them one by one in detail.
[0097] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiment are implemented.
[0098] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0099] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0100] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A short-term precipitation forecast method based on multi-source data, characterized in that: The method comprises: Step S1: pre-processing the acquired radar combined reflectivity factor data and the combined data at the first and second preset heights to obtain three sample sequences; Step S2: Input the three sample sequences into a multi-branch generator based on the adversarial training transformer to obtain the short-term precipitation forecast result; the multi-branch generator includes: a feature extraction network, an encoding layer, and a decoding layer; the encoding layer includes multiple stacked improved Swin Transformer modules; Step S2 specifically includes: Inputting the three sample sequences into the feature extraction network to obtain multi-source data features; the multi-source data features include: a combined feature at the first and second preset heights, a data fusion feature of the combined feature at the first and second preset heights, and a data feature of a radar combined reflectivity factor; Performing position encoding on the multi-source data features to obtain a position encoding result; The position encoding result is input into the encoding layer, multiple Swin modules are used in each improved Swin Transformer module for feature extraction, and data is fused through the cross attention mechanism and MLP layer to obtain the final encoding feature; The final encoded features are input into the decoding layer, and are predicted by multiple prediction heads to obtain a short-term precipitation forecast result.
2. The short-term precipitation forecast method based on multi-source data according to claim 1 is characterized in that: Step S1 includes: The combined data includes: geopotential height and relative humidity; step S1 includes: Acquire numerical product data and weather radar echo product data; the numerical product data includes: geopotential height and relative humidity at a first preset altitude and a second preset altitude; the weather radar echo product data includes: radar combined reflectivity factor data; The geopotential height and relative humidity at the first preset height and the second preset height are subjected to gridding, normalization, and clipping to obtain two corresponding sets of normalized data after clipping. The two groups of normalized data after size trimming are processed separately according to a preset time series length and a preset sliding window width to obtain sequence samples corresponding to the potential height and relative humidity at the first preset height and the second preset height as the first sample sequence and the second sample sequence; Preprocessing the radar combination reflectivity factor data, normalizing and clipping the preprocessing results to obtain normalized radar combination reflectivity factor data after size clipping; generating, according to a preset sliding window width and twice a preset time series length, a data sequence sample of the radar combination reflectivity factor as a third sample sequence; The multi-source data samples are determined according to the data series samples of the numerical model product data and the data series samples of the radar combination reflectivity factor.
3. The short-term precipitation forecast method based on multi-source data according to claim 1 is characterized in that: The short-term precipitation forecast model based on multi-source data includes: a multi-branch generator based on Transformer and a PatchGAN discriminator; the PatchGAN discriminator is used to determine the authenticity of the short-term precipitation forecast results of the multi-branch generator during the model training phase; the combined data includes: potential height and relative humidity; The adversarial training process of the Transformer-based multi-branch generator includes: Acquire a training sample set, each of the training samples comprising: a first sample sequence corresponding to the geopotential height and relative humidity at a first preset height, a second sample sequence corresponding to the geopotential height and relative humidity at a second preset height, and a third sample sequence corresponding to radar combined reflectivity factor data; Inputting the training samples into the Transformer-based multi-branch generator to obtain predicted values of geopotential height and relative humidity at a first preset height, predicted values of geopotential height and relative humidity at a second height, predicted precipitation, and a predicted return sequence; In the PatchGAN discriminator, the predicted values of the potential height and relative humidity at the first preset height, the predicted values of the potential height and relative humidity at the second height, the predicted precipitation, and the predicted report sequence are compared with the true values of the potential height and relative humidity at the first preset height, the true values of the potential height and relative humidity at the second height, the true value of the hourly precipitation, and the true value of the radar echo sequence, respectively. According to the comparison results and the loss function, the Transformer-based multi-branch generator is reversely trained until the preset stopping condition is met, thereby obtaining a trained Transformer-based multi-branch generator.
4. The short-term precipitation forecasting method based on multi-source data according to claim 3 is characterized in that: The loss function in the training process of the short-term precipitation forecast model adopts mean square error, and the total loss function of the short-term precipitation forecast model is: in, is the total loss; Predict the loss for the combined reflectivity factor, The loss is predicted by the geopotential height Z and relative humidity RH at 850hPa, The loss is predicted by the potential height Z and relative humidity RH at 500hPa, Preset losses for hourly precipitation at the corresponding moment, and are the combined reflectivity factor prediction data and label data, and They are the predicted data of geopotential height Z and relative humidity RH at 850hPa, and are the predicted data of geopotential height Z and relative humidity RH at 500hPa, and are the hourly precipitation data at the corresponding time, is the weight hyperparameter of each meteorological element.
5. The method for short-term precipitation forecasting based on multi-source data according to claim 1, characterized in that: The feature extraction network includes multiple feature extraction modules; The feature extraction module is a VGG network; Inputting the first sample sequence, the second sample sequence, and the third sample sequence into the feature extraction network to obtain multi-source data features, including: performing feature extraction on the first sample sequence, the second sample sequence, and the third sample sequence using a VGG network to obtain data features of the geopotential height and relative humidity at the first preset height, data features of the geopotential height and relative humidity at the first preset height, and data features of the radar combined reflectivity factor; The data features of geopotential height and relative humidity at the same height are spliced together to obtain the combined features at the corresponding height; The combined feature vectors at the first preset height and the second preset height are spliced to obtain data fusion features.
6. The method for short-term precipitation forecasting based on multi-source data according to claim 1, characterized in that: The position coding results include: a combined feature position coding result at a first preset height, a combined feature position coding result at a second preset height, a data fusion feature position coding result, and a data feature position coding result of a radar combined reflectivity factor; The position encoding result is input into the encoding layer to obtain the final fusion feature, including: The combined feature position encoding result at the first preset height, the combined feature position encoding result at the second preset height, the data fusion feature position encoding result, and the data feature position encoding result of the radar combined reflectivity factor are input into the first improved Transformer module, each feature is processed by the corresponding Swin module, and the outputs of all Swin modules are processed by the cross attention mechanism and then processed by the MLP layer to obtain a first encoding feature; the first encoding feature includes: a first encoding feature that fuses the combined reflectivity factor and the combined feature at the first preset height, a first encoding feature that fuses the combined reflectivity factor and the combined feature at the second preset height, and a first encoding feature that fuses the combined reflectivity factor and the data fusion features at all preset heights; The first coding feature is used as the input of the next improved Transformer module until the last Transformer module to obtain the final coding feature; the final coding feature includes: the final coding feature of the fusion combination reflectivity factor and the combined feature at the first preset height, the final coding feature of the fusion combination reflectivity factor and the combined feature at the second preset height, and the final coding feature of the fusion combination reflectivity factor and the data fusion features at all preset heights.
7. The method for short-term precipitation forecasting based on multi-source data according to claim 1, characterized in that: The final encoded features are input into the decoding layer and predicted by multiple prediction heads to obtain the short-term precipitation forecast results, including: The final coded features of the fused combined reflectivity factor and the combined features at the first preset height, the final coded features of the fused combined reflectivity factor and the combined features at the second preset height, and the final coded features of the fused combined reflectivity factor and the data fusion features at all preset heights are respectively processed through a prediction head to obtain a short-term precipitation forecast result; the short-term precipitation forecast result includes the radar combined reflectivity factor prediction result, the hourly precipitation prediction result, and the potential height and relative humidity prediction results at two preset heights.
8. A short-term precipitation forecasting device based on multi-source data, characterized in that: The device comprises: a data preprocessing module, configured to preprocess the acquired radar combined reflectivity factor data and the combined data at the first and second preset heights to obtain three sample sequences; The short-term precipitation forecast module is used to input three sample sequences into a multi-branch generator based on the adversarial training transformer to obtain the short-term precipitation forecast result. The multi-branch generator includes: a feature extraction network, an encoding layer, and a decoding layer; the encoding layer includes multiple stacked improved Swin Transformer modules; The short-term precipitation forecast module is also used to input three sample sequences into the feature extraction network to obtain multi-source data features; the multi-source data features include: combined features at the first and second preset heights, data fusion features of the combined features at the first and second preset heights, and data features of the radar combined reflectivity factor; the multi-source data features are position-encoded to obtain position encoding results; the position encoding results are input into the encoding layer, multiple Swin modules are used in each improved Swin Transformer module for feature extraction, and data fusion is performed through the cross-attention mechanism and the MLP layer to obtain final encoding features; the final encoding features are input into the decoding layer, and prediction is performed through multiple prediction heads to obtain short-term precipitation forecast results.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for short-term precipitation forecasting based on multi-source data according to any one of claims 1 to 7 are implemented.
10. A computer readable memory having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for short-term precipitation forecasting based on multi-source data according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Short temporary rainfall forecasting method and device
CN108535731A
Short temporary rainfall prediction method based on space-time attention and data fusion
CN114764602A
Radar echo extrapolation method based on multiple modes
CN115902806A
Short temporary rainfall forecasting method improved by using random mask and Transform
CN116051857A
Global marine environment forecasting method based on multilevel feature aggregation
CN117849903A
Cited By
Method for constructing local short temporary rainfall forecast model based on neural network
CN122241160A