Short temporary rainfall forecasting method and system based on dynamic neural network architecture
By employing gradient summation sampling and a dynamic network architecture, combined with time-frequency dual-branch and balanced regression loss functions, the problems of data imbalance and insufficient computational resources in short-term precipitation forecasting are solved, achieving efficient and accurate meteorological forecasting.
Patent Information
- Application Number
- CN202511355174.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-22
- Publication Date
- 2025-12-23
AI Technical Summary
Existing deep learning models face the dual imbalances of data and optimization in short-term precipitation forecasting, as well as insufficient computational resources due to static architecture, resulting in unstable prediction performance and wasted computational resources.
We employ a gradient summation sampling strategy and a content-aware dynamic network architecture. By balancing data distribution through spatiotemporal gradient calculation and resampling, we adaptively allocate computation paths using a time-frequency dual-branch architecture and optimize the model using a balanced regression loss function.
It achieves efficient calculation and high-precision forecasting under different meteorological events, improves the forecasting ability for complex weather systems, reduces the waste of computing resources, and improves the accuracy and stability of forecasts.
Smart Images

Figure CN121189386A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of deep learning and weather forecasting, and relates to a short-term precipitation forecasting method and system based on a dynamic neural network architecture. Background Technology
[0002] Short-term precipitation forecasting is a key meteorological early warning technology, focusing on high spatiotemporal resolution precipitation prediction for the next 0-2 hours. This technology constructs predictive models based on the spatiotemporal evolution characteristics of multi-source observational data (such as radar, satellite, and ground stations) to achieve early warning of severe weather. As a time-driven forecasting method, short-term precipitation forecasting plays a crucial role in disaster prevention and mitigation, urban operation scheduling, and the protection of major events. Although traditional numerical weather prediction methods (such as the High Resolution Ensemble Forecasting System (HREF) used by the National Oceanic and Atmospheric Administration)... [1] While using rigorous differential equations to simulate atmospheric physical processes to capture weather evolution patterns, the accuracy of these forecasts is low due to the inherent chaotic nature of the Earth system. Furthermore, the enormous computational resources required limit their ability to meet the demands of short-term, minute-level updates.
[0003] In recent years, deep learning-based forecasting models have been widely applied in the field of short-term precipitation forecasting due to their powerful ability to handle complex spatiotemporal meteorological data, significantly improving the accuracy of short-term precipitation prediction. In 2022, Gao et al. proposed Earthformer, a spatiotemporal forecasting model based on the Transformer architecture. This model introduces the powerful long-distance dependency modeling capability of Transformer into typical spatiotemporal series data such as Earth system data, and effectively captures the complex dynamics in Earth system data through an innovative spatiotemporal attention mechanism. [2] Subsequently, Tang et al. proposed a hybrid architecture, SwinLSTM, which integrates SwinTransformer and LSTM. Through innovative recurrent unit design, it deeply combines the global spatial modeling capability of Transformer with the long-term dynamic capture advantage of LSTM, enabling more effective capture of complex spatiotemporal patterns in data. [3] Wu et al. proposed Earthfarsser, a multi-scale spatiotemporal dynamics modeling framework that integrates modular components such as local graph convolution and global Fourier neural operators into a single model. Through an innovative parallel branching architecture and dynamic fusion mechanism, it effectively balances the modeling requirements of local detail fidelity and long-range global correlation in complex spatiotemporal systems. [4] .
[0004] Although these deep learning-based spatiotemporal prediction model methods have achieved significant success in short-term precipitation forecasting, two key challenges remain: (1) Deep learning models face a dual imbalance challenge in short-term precipitation forecasting: precipitation observation datasets typically exhibit long-tailed distribution characteristics of meteorological dynamics, with scarce samples of high-impact weather events (such as hurricanes, thunderstorms, and hail) exhibiting high spatiotemporal variability, while the proportion of samples from routine meteorological events is too high. If a uniform sampling strategy is used to construct the training dataset on such data, and pixel-level regression losses (such as mean absolute error and mean squared error) are used to train the model, the predictive performance of the model for rare weather patterns will significantly degrade. [5] In current improvement schemes, data augmentation methods are difficult to implement due to their high computational cost and limited generalization gain; loss function reweighting mechanisms cannot achieve feature-specific optimization due to the lack of high-level semantic guidance. [6] Furthermore, the temporal distribution shift caused by seasonal sampling differences between training and testing data further exacerbates the systemic defects of existing deep learning methods. (2) The problem of limited model capabilities caused by static architecture: Current deep learning methods generally adopt static network architectures with constant complexity, ignoring the differentiated computational resource requirements of different meteorological models. Forecast models require higher computational resources to model complex weather systems rich in high-frequency textures, while only lightweight processing is needed to handle simple meteorological models. Therefore, static architectures either produce prediction fuzziness and distortion due to insufficient model capabilities in complex scenarios, or cause overfitting risks due to redundant computation in simple scenarios, resulting in an overall performance imbalance.
[0005] The relevant references are as follows: [1]Ravuri S, Lenc K, Willson M, et al. Skilful precipitation nowcasting using deep generative models of radar [J]. Nature, 2021, 597(7878): 672-7. [2]Gao Z, Shi X, Wang H, et al. Earthformer: Exploring space-timetransformers for earth system forecasting [C]. Advances in Neural Information Processing Systems, 2022, 35: 25390-403. [3]Tang S, Li C, Zhang P, et al. Swinlstm: Improving spatiotemporalprediction accuracy using swin transformer and lstm [C]. Proceedings of theIEEE / CVF international conference on computer vision, 2023: 13470-9. [4]Wu H, Liang Y, Xiong W, et al. Earthfarsser: Versatile spatio-temporal dynamical systems modeling in one model [C]. Proceedings of the AAAIconference on artificial intelligence, 2024, 38(14): 15906-14. [5]Yan W, Liu S, Zou Y, et al. Convolutional graph neural networkwith novel loss strategies for daily temperature and precipitationstatistical downscaling over South China [J]. Advances in AtmosphericSciences, 2025, 42(1): 232-47. [6]Zhu J, Zhang Q, Zhao Z, et al. Convective Development NowcastingUsing Dual Polarization Radar Based on Cross Modal Fusion [C]. 2023 IEEE 11thJoint International Information Technology and Artificial IntelligenceConference (ITAIC), 2023, 11: 1470-4. [7]Veillette M, Samsi S, Mattioli C J a I N I P S. Sevir: A stormevent imagery dataset for deep learning applications in radar and satellitemeteorology [JC. Advances in Neural Information Processing Systems, 2020, 33:22009-19. [8]Gao Z, Tan C, Wu L, et al. Simvp: Simpler yet better videoprediction [C]. Proceedings of the IEEE / CVF conference on computer vision andpattern recognition, 2022: 3170-80. [9]Wu H, Xu F, Chen C, et al. Pastnet: Introducing physical inductivebiases for spatio-temporal video prediction [C]. Proceedings of the 32nd ACMinternational conference on multimedia, 2024: 2917-26.
[10] Zeng H, Li Y, Niu R, et al. Enhancing spatiotemporal predictionthrough the integration of Mamba state space models and DiffusionTransformers [J]. Knowledge-Based Systems, 2025, 316: 113347. Summary of the Invention This invention addresses the shortcomings of existing technologies by proposing a short-term precipitation forecasting method and system based on a dynamic neural network architecture. A gradient summation sampling strategy prioritizes high-impact weather events with high spatiotemporal variability, mitigating the long-tail distribution problem from the perspective of dataset construction and helping the model learn complex meteorological changes from important trends. A content-aware dynamic network adaptively allocates multiple computational paths based on the gradient and spatiotemporal complexity of the input data, meeting the different computational resource requirements of complex weather systems with rich high-frequency textures and simple meteorological models. A balanced regression loss function combining pixel-level prediction and prior knowledge of the dataset is used to suppress regression bias and enhance the feature discrimination power of meteorological categories.
[0006] The technical solution adopted in this invention is a short-term precipitation forecasting method based on a dynamic neural network architecture. First, multi-source meteorological observation data is acquired, and a high-resolution gridded precipitation dataset is constructed through spatiotemporal alignment and fusion processing. This dataset is then normalized to eliminate scale differences. Subsequently, based on the spatiotemporal gradient complexity characteristics, the spatial and temporal gradients of the samples are calculated using the Sobel operator and inter-frame difference. Intervals are divided using linear interpolation, and an exponentially decaying sampling probability allocation mechanism is designed to resample the training set to balance the sample distribution. Next, a content-aware dynamic network is constructed. This network adopts a time-frequency dual-branch collaborative architecture. The time-domain branch extracts multi-scale spatial features through a NAFNet-enhanced encoder-decoder structure, while the frequency-domain branch captures multi-scale temporal features through dynamically activated FFT modules. Path vectors are dynamically generated based on the spatiotemporal complexity of the input data, adaptively controlling the computational paths of each level of the FFT modules in the frequency-domain branch to achieve synergistic optimization of computational efficiency and modeling accuracy. Finally, a balanced regression loss function is used to train the network. The fully trained model is then deployed to an operational platform through encapsulation, enabling efficient prediction of real-time meteorological observation streams. This method includes the following steps: Step 1: Acquire multi-source meteorological observation data, perform spatiotemporal alignment and fusion processing on the data to form high-resolution gridded meteorological data, and divide it into a training sample set and a test sample set with temporal continuity; Step 2: Perform gradient-based resampling on the training set; Step 3: Construct a content-aware dynamic network. The content-aware dynamic network adopts a time-frequency dual-branch architecture. The time-domain branch uses an encoder-decoder architecture to capture multi-scale spatial relationships that are crucial for weather model forecasting. The frequency-domain branch is used to capture multi-scale temporal relationships and perform high-quality modeling of weather models. The execution path of the frequency-domain branch is adaptively controlled according to the spatiotemporal complexity of the input data. Finally, the outputs of the two branches are summed element-wise and then subjected to three-dimensional convolution to obtain the final prediction result. Step 4: Use the loss function to train and test the content-aware dynamic network to obtain the final short-term precipitation forecast model and realize short-term precipitation forecast.
[0007] Furthermore, step 2, the gradient-based resampling, includes spatiotemporal gradient calculation, interval partitioning, and resampling. The spatiotemporal gradient calculation includes: using the Sobel operator to calculate the spatial gradient of the training data samples and obtaining the temporal gradient through first-order inter-frame differencing; the interval partitioning includes: using the spatiotemporal gradient magnitude as a complexity score for the samples, dividing the training sample set into intervals based on this score, and using linear interpolation to determine the boundary thresholds of each interval; the resampling includes: designing an exponentially decaying sampling probability allocation mechanism so that the sampling probability of each interval increases inversely proportional to the number of samples, generating normalized sample weights, and resampling the training sample set.
[0008] Furthermore, the specific implementation of step 2 includes: 2.1 Spatiotemporal gradient calculation: For each input sequence containing T time frames... The spatial gradient is calculated using the Sobel operator, and the temporal gradient is calculated using the first-order difference between frames; specifically including: Calculate the spatial gradient magnitude of frame t using the Sobel operator. The expression is:
[0009] in, This represents element-wise multiplication. Represents the horizontal convolution kernel. Represents the vertical convolution kernel; Calculating the temporal gradient magnitude using the first-order inter-frame difference method The expression for summing the absolute differences of all consecutive frames is:
[0010] in, This represents the number of time frames used for input training. Represents spatial averaging. Describe the spatial gradient magnitude of the (t+1)th frame. Describe the spatial gradient magnitude of the t-th frame; 2.2 Interval Partitioning: Based on the spatiotemporal gradient magnitude sorting results in 2.1, the training sample set is divided into... There are intervals, where the number of intervals is... From the formula: Confirmed, in the formula This is a proportional hyperparameter. The number of meteorological event categories; the threshold for each interval is determined by linear interpolation of the sorted gradient values. The expression is:
[0011] in, This indicates the floor function. Represents the total number of training samples. This represents the first value in the ascending order of the spatiotemporal gradient magnitude. Smaller values; 2.3 Resample the training sample set; specifically, for each interval... Assign sampling probability The probability is related to the number of samples. They are inversely proportional, and the expression is:
[0012] in, Represents the number of intervals. For high spatiotemporal gradient interval preference control parameters; each training sample The final sampling weights Reassignment by interval: Then based on the normalized weights Perform resampling.
[0013] Furthermore, the processing procedure for the time-domain branch is as follows: For a given input, reorganize it into a spatial tensor. Then it undergoes the following multi-stage processing: The encoder includes Level downsampling modules, each consisting of 2×2 convolution operations. It is cascaded with NAFNet modules to form a multi-scale feature extraction framework, expressed as:
[0014] in, , This is a 3×3 convolution operation. Representing the The feature map output by the downsampling module is NAFB, which is the core feature extraction module of the temporal branch. The first step is to normalize the input feature map through a two-dimensional layer, then extract spatial features through depthwise convolution to generate a feature map, and then generate channel weights through a channel attention mechanism. The weights are multiplied with the generated feature map, and then channel features are extracted through 1×1 pointwise convolution. In the second step, the feature map output from the previous step is passed through layer normalization, 1×1 pointwise convolution, gate unit, and 1×1 pointwise convolution to obtain the final output feature map. Decoder includes Each upsampling module recovers high-resolution features through pixel rearrangement upsampling and residual connections, expressed as:
[0015] in, Pixel rearrangement operator This means concatenating multiple vectors together. Representing the Feature map output by the upsampling module.
[0016] Furthermore, the frequency domain branch comprises three key components: an encoder, an FFT module, and a decoder. The encoder and decoder are identical to those in the time domain branch, except that they reassemble the original data into a time tensor. As input to this branch; The specific processing procedure of the FFT module is as follows: For the first... Level downsampling module output Before inputting into the FFT module, block embedding and position encoding are required. The expression is:
[0017] Here, PatchEmbed represents patch-level embedding, and LPE represents learnable location encoding, used to capture the spatiotemporal location of meteorological sequences. Representative at the The input to the FFT module in the downsampling stage; Then, from the path tensor Whether the adaptive control FFT module is activated, and the optimal execution path is selected for different weather models, is expressed as follows:
[0018] in, Representative at the In the first level of downsampling The output of FFTB.
[0019] Furthermore, the path tensor It is based on the time and space complexity of the input data. The specific process includes three parts: calculating the time and space complexity, calculating the multi-scale path based on the time and space complexity, and generating differentiable paths. Specifically, the time and space complexity is calculated using the Sobel operator to determine the space complexity. This is used to characterize the spatial texture complexity of each sample; the time complexity is calculated using the first-order difference between frames. It is used to characterize the intensity of sample movement within a batch.
[0020] Furthermore, the multi-scale path is calculated based on time and space complexity, specifically by transforming the time and space complexity into a scale-invariant path score through a normalized cumulative distribution, expressed as:
[0021] in, and These represent the normalized path scores in the spatial and temporal dimensions, respectively. This represents a positive infinitesimal quantity approaching 0, used to avoid cases where the denominator is 0; max indicates taking the maximum value. Then, hierarchical thresholding is used to generate the basic features for path decision-making, expressed as:
[0022] in, Represents the level threshold. , Represents the depth threshold. .
[0023] Furthermore, differentiable paths are generated, resulting in the final path tensor. It is generated by a differentiable gating mechanism that combines space and time complexity scores, and the expression is:
[0024] Here, STE stands for Pass-Through Estimator, used to implement binary decision-making. This represents a scaling factor, used to adjust the strength of the impact of time and space complexity on path selection. Represents the bias term. Indicates the number of layers in the encoder. Indicates the length of the frequency domain branch. This represents the model loss function; during forward propagation, discrete path tensors are generated according to the above steps. This is used to determine whether each FFT module in each layer of the frequency domain branch is executed; during backpropagation, where... Indicates the training batch size; uses Gradient approximation preserves end-to-end differentiability.
[0025] Furthermore, the loss function used in step 4 is the balanced regression loss function, and the specific calculation process is as follows: In short-term precipitation forecasting tasks, the forecast results Given a dataset with a Gaussian distribution, the ideal distribution for a balanced dataset is:
[0026] in, Indicates the input sample Below are the prediction results. The ideal equilibrium distribution of follows a mean of . variance is Gaussian distribution, denoted by Gaussian distribution, exp represents the natural exponential operation; However, in real meteorological datasets, due to the inherent spatiotemporal imbalance of precipitation events, the actual distribution of the training sample set is... To mitigate model bias caused by such imbalanced distributions, deviating from the ideal equilibrium assumption, the following loss function based on equilibrium regression is constructed:
[0027]
[0028] in, Represents the regularization coefficient. Represents all parameters of the model. and Represents the absorption constant. The model weight penalty norm is used to prevent overfitting, and MSE represents the mean squared error. Represents the actual precipitation value The set of all possible values, i.e., the integration interval. Represents the integral variable; To avoid the high computational cost of integration, an interval-based numerical integration method is used to transform the integration problem into a summation problem: First, the true distribution of the training set is uniformly divided into... There are several small intervals, and the center of each interval is: Then, kernel density estimation is applied to calculate the probability of the center point of each interval. Finally, the loss function is simplified to the following expression:
[0029] in, Represents the temperature coefficient.
[0030] This invention also provides a short-term precipitation forecasting system based on a dynamic neural network architecture, comprising the following modules: The dataset construction module is used to acquire multi-source meteorological observation data, and after spatiotemporal alignment and fusion processing, the data is formed into high-resolution gridded meteorological data, which is divided into a training sample set and a test sample set with temporal continuity. The resampling module is used to perform gradient-sum-based resampling on the training set; A dynamic network construction module is used to construct a content-aware dynamic network. The content-aware dynamic network adopts a time-frequency dual-branch architecture. The time-domain branch uses an encoder-decoder architecture to capture multi-scale spatial relationships that are crucial for weather model forecasting. The frequency-domain branch is used to capture multi-scale temporal relationships to perform high-quality modeling of weather models. The execution path of the frequency-domain branch is adaptively controlled according to the spatiotemporal complexity of the input data. Finally, the outputs of the two branches are summed element-wise and then subjected to three-dimensional convolution to obtain the final prediction result. The model training and deployment module is used to train and test the content-aware dynamic network using a loss function to obtain the final short-term precipitation forecast model and realize short-term precipitation forecasting.
[0031] Compared with existing technologies, the advantages and beneficial effects of this invention are as follows: This invention proposes a short-term precipitation forecasting method based on a dynamic neural network architecture, achieving a balance between computational efficiency and prediction accuracy through spatiotemporal dual-branch collaborative modeling and a content-aware path mechanism. This method innovatively introduces a dynamic path vector driven by spatiotemporal complexity, enabling the network to adaptively adjust the computational path based on the gradient characteristics and motion intensity of the input meteorological data, meeting the computational complexity requirements of different meteorological events. The designed balanced regression loss function effectively addresses the problem of uneven precipitation data distribution, improving the prediction accuracy in areas of heavy precipitation, and providing an efficient and reliable solution for operational short-term precipitation forecasting. Attached Figure Description
[0032] Figure 1 This is a flowchart of the short-term precipitation forecasting method according to an embodiment of the present invention.
[0033] Figure 2 This is a schematic diagram of resampling based on gradient summation in an embodiment of the present invention.
[0034] Figure 3 This is a content-aware dynamic network structure diagram according to an embodiment of the present invention.
[0035] Figure 4 This is a structural diagram of the NAFNet module in an embodiment of the present invention.
[0036] Figure 5 This is a structural diagram of the FFT module in an embodiment of the present invention.
[0037] Figure 6 This is the prediction result of the embodiment of the present invention on the SEVIR dataset.
[0038] Figure 7 This is a schematic diagram of a short-term precipitation forecasting system according to an embodiment of the present invention. Detailed Implementation
[0039] To facilitate understanding and implementation of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the embodiments described herein are only for explaining the present invention and are not intended to limit the present invention.
[0040] This invention addresses the shortcomings of imbalanced data distribution and insufficient generalization ability of static architectures in short-term precipitation forecasting by proposing a short-term precipitation forecasting method based on a dynamic neural network architecture. A gradient summation sampling strategy prioritizes high-impact weather events with high spatiotemporal variability, mitigating the long-tail distribution problem of precipitation forecast datasets and helping the model learn complex meteorological changes from important trends. A content-aware dynamic network adaptively allocates multiple computational paths based on the gradient and spatiotemporal complexity of the input data, simultaneously meeting the different computational resource requirements of complex weather systems with rich high-frequency textures and simple meteorological models. A balanced regression loss function combining pixel-level prediction and prior knowledge of the dataset suppresses regression bias and enhances the feature discrimination power of meteorological categories.
[0041] like Figure 1 The diagram shows a flowchart of a short-term precipitation forecasting method based on a dynamic neural network architecture according to the present invention. The method specifically includes the following steps: Step S11, Construction of precipitation dataset: Obtain multi-source meteorological observation data, perform spatiotemporal alignment and fusion processing on the data to form high-resolution gridded meteorological data, divide it into training sample set and test sample set with temporal continuity, where each sample contains 10 consecutive frames of historical observation data and the real precipitation field label for the next 10 frames, and perform standard normalization to solve the optimization problem caused by the inconsistency of the original data scale.
[0042] Step S12, Gradient-based resampling: The spatial gradient of the training data samples is calculated using the Sobel operator, and the temporal gradient is obtained by first-order inter-frame difference. The magnitude of the spatiotemporal gradient is used as the complexity score of the sample. The training set is divided into intervals based on the score, and the boundary threshold of each interval is determined by linear interpolation. An exponential decay sampling probability allocation mechanism is designed so that the sampling probability of each interval is inversely proportional to the number of its samples. Based on this, normalized sample weights are generated and the training set is resampled.
[0043] Step S13: Constructing a Content-Aware Dynamic Network (CNR): The CNR employs a time-frequency dual-branch architecture and path computation based on spatiotemporal complexity to address the limited model capabilities caused by static networks. Specifically, the time-domain branch uses an encoder-decoder architecture to capture multi-scale spatial relationships crucial for weather model forecasting; the frequency-domain branch captures multi-scale temporal relationships for high-quality modeling of weather models. The execution path of the frequency-domain prediction branch is adaptively controlled based on the spatiotemporal complexity of the input data to meet the computational complexity requirements of different weather events.
[0044] Step S14: Model Training and Deployment: Using the training and testing sets, and combining a balanced regression loss function, train and test the content-aware dynamic network to obtain the final short-term precipitation forecast model. Deploy the fully trained model and accept real-time meteorological observation streams to achieve short-term precipitation forecasting.
[0045] In step S11, the multi-source meteorological observation data includes infrared channels from geostationary meteorological satellites, base reflectivity from Doppler weather radar, and precipitation observations from ground meteorological station rain gauges. After spatiotemporal alignment and fusion, high-resolution gridded meteorological data is obtained, reflecting the actual precipitation amount and spatial distribution over a certain period. A precipitation dataset with temporal continuity is collected, with a spatial resolution of 1km × 1km and a temporal resolution of 5 minutes, divided into a training sample set and a test sample set in a 7:3 ratio. Each sample contains 10 consecutive frames of historical observation data and corresponding future 10 frames of observation data as ground truth labels.
[0046] This invention utilizes Z-Score standardization to standardize data, adjusting the data distribution to a normal distribution (or close to a normal distribution) with a mean of 0 and a standard deviation of 1, thereby improving the training efficiency and stability of the model. Specifically, the standardization process is as follows: first, the mean and standard deviation of the training set are calculated; then, the entire dataset is standardized using the following formula:
[0047] in The original data values, The mean of the training set. The variance of the training set. These are the standardized data values.
[0048] Step S12, gradient-based resampling, includes three sub-steps: spatiotemporal gradient calculation, interval partitioning, and resampling. Unlike methods that rely on a single statistical feature or perform simple gradient calculations between image sub-blocks, this invention extends the scope of gradient analysis to a two-dimensional spatiotemporal dimension, thereby establishing a robust and feasible index system. This index is specifically designed to characterize the complexity of spatiotemporal sequences to serve the purpose of generating a balanced sample set through resampling.
[0049] Spatiotemporal gradient calculation, for each input sequence containing T time frames. This invention uses the Sobel operator to calculate the spatial gradient and calculates the temporal gradient through first-order inter-frame differences. Specifically, it includes the following steps: Calculate the spatial gradient magnitude of frame t using the Sobel operator. The expression is:
[0050] in, This represents element-wise multiplication. Represents the horizontal convolution kernel. Represents a vertical convolution kernel.
[0051] Calculating the temporal gradient magnitude using the first-order inter-frame difference method The expression for summing the absolute differences of all consecutive frames is:
[0052] in, This represents the number of time frames used for input training. Represents spatial averaging. Describe the spatial gradient magnitude of the (t+1)th frame. Describe the spatial gradient magnitude of frame t.
[0053] To differentiate training samples of varying difficulty, this embodiment of the invention divides the training set into intervals based on the spatiotemporal gradient magnitude ranking result. There are intervals, where the number of intervals is... From the formula: Confirmed, in the formula This is a proportional hyperparameter. This represents the number of meteorological event categories. When there are no clear event categories, a hierarchical clustering algorithm is used to obtain them. The value is determined by linear interpolation of the sorted gradient values to determine the threshold for each interval. The expression is:
[0054] in, This indicates the floor function. Represents the total number of training samples. This represents the first value in the ascending order of the spatiotemporal gradient magnitude. Smaller values.
[0055] Resampling is used to address the optimization problem caused by the imbalanced distribution of the dataset. Specifically, for each interval... Assign sampling probability The probability is related to the number of samples. They are inversely proportional, and the expression is:
[0056] in, Represents the number of intervals. This is the preference control parameter for high spatiotemporal gradient intervals.
[0057] Each training sample The final sampling weights Reassignment by interval: Then based on the normalized weights Resampling is performed. High-complexity event samples are those whose spatiotemporal gradient magnitudes rank in the top 10% of the overall distribution. These samples correspond to high-impact events with intense spatiotemporal motion, such as hurricanes and thunderstorms, which occur less frequently. Simple pattern samples are those whose spatiotemporal gradient magnitudes rank in the top 20% of the overall distribution, corresponding to stable meteorological events such as clear skies and uniform cloud cover. After resampling the training set as described above, the selection probability of high-complexity event samples can be significantly improved, while suppressing the oversampling tendency of simple patterns. This invention automatically balances the occurrence frequency of meteorological events of different complexities through gradient distribution analysis. The resampling process is as follows: Figure 2 As shown. Because all gradient calculations are performed only once before training the model, the computational cost of this step is negligible during formal training. Furthermore, compared to class rebalancing methods that require manual event labeling, the unsupervised gradient analysis proposed in this invention avoids introducing human bias and automatically balances weather events of varying complexity.
[0058] In step S13, which constructs a content-aware dynamic network, a simple and effective dynamic network architecture is employed to overcome the limitations of static networks. This network adaptively selects the execution path based on the spatiotemporal complexity of the input samples to meet the differentiated computational resource requirements of different meteorological models. For example... Figure 3 As shown, the network includes two coordinating components: a time-frequency dual-branch architecture and path computation based on time-space complexity.
[0059] The time-frequency dual-branch architecture utilizes feature fusion from two complementary domains, the time domain and the frequency domain, to generate high-quality prediction results. Specifically, the time-domain prediction branch employs an encoder-decoder architecture to capture the multi-scale spatial relationships crucial for weather model forecasting. For a given input... ,in Describe the training batch size. Indicates the number of frames in the historical data. Indicates the number of channels. Indicates the feature map height. The feature map width is represented in this invention, which reorganizes it into a spatial tensor. Then it undergoes the following multi-stage processing: The encoder includes Level downsampling modules, each consisting of 2×2 convolution operations. It is cascaded with the NAFNet module (NAFB) to form a multi-scale feature extraction framework, expressed as:
[0060] in, , This is a 3×3 convolution operation. Representing the The feature map output by the subsampling module. NAFB is the core feature extraction module of the temporal prediction branch, and the specific results are shown in the figure. Figure 4 As shown. The first step involves normalizing the input feature map using a 2D layer, then extracting spatial features through depthwise convolution to generate a new feature map. Next, a channel attention mechanism generates channel weights, which are multiplied by the generated feature map. Finally, a 1×1 pointwise convolution extracts channel features. In the second step, the feature map output from the previous step is sequentially processed through layer normalization, a 1×1 pointwise convolution, a gated unit, and another 1×1 pointwise convolution to obtain the final output feature map. Furthermore, residual connections are used in the NAFB module to prevent gradient vanishing during backpropagation.
[0061] Decoder includes Each upsampling module recovers high-resolution features through pixel rearrangement upsampling and residual connections, expressed as:
[0062] in, The pixel rearrangement operator is an upsampling technique widely used in image super-resolution reconstruction tasks. This means concatenating multiple vectors together. Representing the Feature map output by the upsampling module.
[0063] The frequency domain prediction branch comprises three key components: an encoder, an FFT module (FFTB), and a decoder. These components are used to capture multi-scale temporal relationships and perform high-quality modeling of meteorological models. The encoder and decoder are identical to those in the time domain prediction branch, both using NAFB as their core feature extraction module. The difference lies in reconstructing the original data into a time tensor. As input to this branch.
[0064] The FFT module is the core module of the frequency domain prediction branch and is crucial for extracting time-dimensional features. Its specific structure is as follows: Figure 5As shown, the input data is first converted to the time domain using a Fast Fourier Transform (FFT). After passing through a Multilayer Perceptron (MLP), it is converted back to the time domain using an Inverse Fourier Transform (IFFT). Finally, the output data is obtained through a forward propagation layer. This module first performs a Fast Fourier Transform (FFT) on the input features to map the time-domain features to the frequency domain. Then, a MLP is used to modulate the frequency-domain features to enhance the representation capability of high-frequency meteorological signals. Finally, an Inverse Fourier Transform (IFFT) is used to reconstruct the time-domain features. The module adopts a residual connection structure, adding the modulated features to the original input features. Finally, a feedforward neural network (FFN) performs a nonlinear transformation and outputs the optimized features. Level downsampling module output Before inputting into the FFT module, block embedding and position encoding are required. The expression is:
[0065] Here, PatchEmbed represents patch-level embedding, and LPE represents learnable location encoding, used to capture the spatiotemporal location of meteorological sequences. Representative at the The input to the FFT module in the downsampling stage.
[0066] Then, from the path tensor Whether the adaptive control FFT module is activated, and the optimal execution path is selected for different weather models, is expressed as follows:
[0067] in, Representative at the In the first level of downsampling The output of FFTB.
[0068] The temporal branch captures multi-scale motion features of the input data, while the frequency branch analyzes global-local fine-grained convection patterns, achieving complementary spatiotemporal modeling. To fully combine the advantages of both domains, the outputs of the two branches are element-wise summed and then subjected to 3D convolution to obtain the final prediction result, expressed as:
[0069] in, For the final prediction result, This represents a 3D convolution, used to project feature maps from a high-dimensional latent space to the desired prediction space. This represents element-wise addition.
[0070] In the frequency domain prediction branch, to dynamically activate the FFT calculation module, this invention designs a path vector generation mechanism based on spatiotemporal complexity. This mechanism achieves efficient dynamic inference by quantifying the spatiotemporal complexity of the input data. The specific process includes three key steps: calculating spatiotemporal complexity, calculating multi-scale paths based on spatiotemporal complexity, and generating differentiable paths.
[0071] Similar to step S12, which uses gradient summation, the space complexity is calculated using the Sobel operator. This is used to characterize the spatial texture complexity of each sample; the time complexity is calculated using the first-order difference between frames. , used for the intensity of sample movement within a batch.
[0072] To calculate multi-scale paths based on time and space complexity, the time and space complexity is transformed into a scale-invariant path score through a normalized cumulative distribution, expressed as:
[0073] in, and These represent the normalized path scores in the spatial and temporal dimensions, respectively. This value is dynamically updated during training as input samples accumulate, but remains fixed during testing. Its purpose is to generate a normalized and scale-invariant complexity score for the current training set. Represents a positive infinitesimal quantity approaching 0, used to avoid cases where the denominator is 0. Then, hierarchical thresholding is used to generate the basic features for path decision-making, expressed as:
[0074] in, Represents the level threshold. This represents the depth threshold. This design ensures that samples with higher spatial complexity have a greater chance of entering deeper layers for sufficient spatial feature extraction. As the number of layers increases, samples with higher time complexity have a greater chance of undergoing sufficient frequency domain feature extraction. (Increases with depth).
[0075] Generate differentiable paths, the final path tensor It is generated by a differentiable gating mechanism that combines space and time complexity scores, and the expression is:
[0076] Here, STE stands for Pass-Through Estimator, used to implement binary decision-making. This represents a scaling factor, used to adjust the strength of the impact of time and space complexity on path selection. Represents the bias term. Indicates the number of layers in the encoder. Indicates the length of the frequency domain prediction branch. This represents the model loss function. During the forward propagation process, discrete path tensors are generated according to the steps described above. This is used to determine whether each FFT module in each layer of the frequency domain prediction branch is executed; during backpropagation, it employs... Gradient approximation preserves end-to-end differentiability.
[0077] In step S14, model training and deployment, to alleviate the imbalanced optimization problem, this invention designs a balanced regression loss function to optimize the content-aware dynamic network. In the short-term precipitation prediction task, the prediction results... The mean of a dataset can be considered as having a Gaussian distribution; therefore, the ideal distribution for a balanced dataset is:
[0078]
[0079] in, Indicates the input sample Below are the prediction results. The ideal equilibrium distribution of follows a mean of . variance is Gaussian distribution, Let represent a Gaussian distribution, and exp represent the natural exponential operation.
[0080] However, in real meteorological datasets, due to the inherent spatiotemporal imbalance of precipitation events, the actual distribution of the training set is... Deviation from the ideal equilibrium assumption. To mitigate model bias caused by such imbalanced distributions, this invention constructs the following loss function based on equilibrium regression:
[0081]
[0082] in, Represents the regularization coefficient. Represents all the parameters (weights) of the model. and Represents the absorption constant. The model weight penalty norm is used to prevent overfitting, and MSE represents the mean squared error. Represents the actual precipitation value The set of all possible values, i.e., the integration interval. Represents the integral variable.
[0083] To avoid the high computational cost of integration, this embodiment of the invention utilizes an interval-based numerical integration method to transform the integration problem into a summation problem. First, the true distribution of the training set is uniformly divided into... There are several small intervals, and the center of each interval is: Then, kernel density estimation is applied to calculate the probability of the center point of each interval. Finally, the loss function is simplified to the following expression:
[0084] in, This represents the temperature coefficient. This balanced regression loss function increases the gradient weights for low-probability samples, effectively balancing the direction of model optimization.
[0085] During model training, the input data needs to be converted into a tensor format supported by the training framework, and the AdamW optimizer is used to optimize the model. An initial learning rate of 0.001 is set, and a cosine annealing strategy is used to adjust the learning rate during optimization, allowing it to smoothly decay to [a higher value] after 100 training epochs. This helps the model converge more stably to a local optimum towards the end of training, while avoiding training instability that may result from sudden changes in the learning rate. Furthermore, an early stopping mechanism is employed to prevent overfitting. After training is complete, the trained model is packaged and deployed to the corresponding business platform. The collected real-time meteorological observation data is processed by a content-aware dynamic network to generate short-term precipitation forecasts. To verify the performance of the proposed method for short-term precipitation forecasting, we used the publicly available precipitation observation dataset SEVIR. [7] Above, the method of the present invention is compared with SimVP. [8] Earthformer [2] SwinLSTM [3] PAstNet [9] and MAD
[10] Several advanced methods were compared. Figure 6 The visualizations of different models' predictions over a 5- to 25-minute timeframe on the SEVIR dataset are presented intuitively. Visually, the method proposed in this invention can accurately capture the center of heavy precipitation and performs better than all the comparison methods.
[0086] To quantitatively evaluate the performance of the proposed method in short-term precipitation forecasting, we introduce several indices: Multi-Scale Critical Success Index (CSI-M), Structural Similarity Index (SSIM), Mean Absolute Error (MAE), and Mean Squared Error (MSE) to assess model performance. Higher values for the first two indices indicate better prediction performance, while lower values for the latter two indicate better prediction results. Quantitative comparison results on the publicly available precipitation observation dataset SEVIR are as follows: Table 1 Quantitative analysis of different methods on the SEVIR dataset
[0087] Qualitative and quantitative analysis results show that the method proposed in this invention maintains the highest prediction accuracy on the key indicators of the dataset, indicating that the method can select an appropriate calculation path according to the spatiotemporal complexity of the input data, has the ability to handle complex meteorological phenomena, and generates high-quality short-term precipitation prediction results, which is superior to existing advanced methods.
[0088] On the other hand, embodiments of the present invention provide a short-term precipitation forecasting system based on a dynamic neural network architecture, such as... Figure 7 As shown, it includes the following modules: Dataset Construction Module 21: Acquire multi-source meteorological observation data, perform spatiotemporal alignment and fusion processing on the data to form high-resolution gridded meteorological data, divide it into a training sample set and a test sample set with temporal continuity, where each sample contains 10 consecutive frames of historical observation data and the labels of the real precipitation field for the next 10 frames, and performs standard normalization to solve the optimization problem caused by the inconsistency of the scale of the original data.
[0089] Resampling module 22: It uses the Sobel operator to calculate the spatial gradient of the training data samples and obtains the temporal gradient through the first-order difference between frames; it divides the training set into intervals based on the spatiotemporal gradient values and uses linear interpolation to determine the boundary thresholds of each interval; it designs an exponential decay sampling probability allocation mechanism so that the sampling probability of high-complexity sample intervals increases inversely with the number of samples, thereby generating normalized sample weights and resampling the training set.
[0090] Dynamic Network Construction Module 23: The content-aware dynamic network employs a time-frequency dual-branch architecture and path computation based on spatiotemporal complexity to address the model capability limitations caused by static networks. Specifically, the time-domain branch uses an encoder-decoder architecture to capture multi-scale spatial relationships crucial for weather model forecasting; the frequency-domain branch captures multi-scale temporal relationships for high-quality modeling of weather models. The execution path of the frequency-domain prediction branch is adaptively controlled based on the spatiotemporal complexity of the input data to meet the computational complexity requirements of different weather events.
[0091] Model Training and Deployment Module 24: Using the training and testing sets, and combining a balanced regression loss function, the content-aware dynamic network is trained and tested to obtain the final short-term precipitation forecast model. The fully trained model is deployed and receives real-time meteorological observation streams to achieve short-term precipitation forecasting.
[0092] The specific implementation methods of each module are the same as those of each step, and will not be described in this invention.
[0093] It should be understood that the above description of the embodiments is quite detailed, but it should not be considered as a limitation on the scope of protection of this invention. Those skilled in the art can make substitutions or modifications under the guidance of this invention without departing from the scope of protection of the claims of this invention, and all such substitutions or modifications fall within the scope of protection of this invention. The scope of protection of this invention should be determined by the appended claims.
Claims
1. A short-term precipitation forecasting method based on a dynamic neural network architecture, characterized in that, Includes the following steps: Step 1: Acquire multi-source meteorological observation data, perform spatiotemporal alignment and fusion processing on the data to form high-resolution gridded meteorological data, and divide it into a training sample set and a test sample set with temporal continuity; Step 2: Perform gradient-based resampling on the training set; Step 3: Construct a content-aware dynamic network. The content-aware dynamic network adopts a time-frequency dual-branch architecture. The time-domain branch uses an encoder-decoder architecture to capture multi-scale spatial relationships that are crucial for weather model forecasting. The frequency-domain branch is used to capture multi-scale temporal relationships and perform high-quality modeling of weather models. The execution path of the frequency-domain branch is adaptively controlled according to the spatiotemporal complexity of the input data. Finally, the outputs of the two branches are summed element-wise and then subjected to three-dimensional convolution to obtain the final prediction result. Step 4: Use the loss function to train and test the content-aware dynamic network to obtain the final short-term precipitation forecast model and realize short-term precipitation forecast.
2. The short-term precipitation forecasting method based on a dynamic neural network architecture as described in claim 1, characterized in that: Step 2, gradient-based resampling, includes spatiotemporal gradient calculation, interval partitioning, and resampling. Spatiotemporal gradient calculation involves using the Sobel operator to calculate the spatial gradient of the training data samples and obtaining the temporal gradient through first-order inter-frame differencing. Interval partitioning involves using the spatiotemporal gradient magnitude as a complexity score for the samples, dividing the training sample set into intervals based on this score, and using linear interpolation to determine the boundary thresholds of each interval. Resampling involves designing an exponentially decaying sampling probability allocation mechanism so that the sampling probability of each interval increases inversely with the number of samples, generating normalized sample weights, and resampling the training sample set.
3. A short-term precipitation forecasting method based on a dynamic neural network architecture as described in claim 1 or 2, characterized in that: The specific implementation of step 2 includes: 2.1 Spatiotemporal gradient calculation: For each input sequence containing T time frames... The spatial gradient is calculated using the Sobel operator, and the temporal gradient is calculated using the first-order difference between frames; specifically including: Calculate the spatial gradient magnitude of frame t using the Sobel operator. The expression is: in, This represents element-wise multiplication. Represents the horizontal convolution kernel. Represents the vertical convolution kernel; Calculating the temporal gradient magnitude using the first-order inter-frame difference method The expression for summing the absolute differences of all consecutive frames is: in, This represents the number of time frames used for input training. Represents spatial averaging. Describe the spatial gradient magnitude of the (t+1)th frame. Describe the spatial gradient magnitude of frame t; 2.2 Interval Partitioning: Based on the spatiotemporal gradient magnitude sorting results in 2.1, the training sample set is divided into... There are intervals, where the number of intervals is... From the formula: Confirmed, in the formula For proportional hyperparameters, The number of meteorological event categories; the threshold for each interval is determined by linear interpolation of the sorted gradient values. The expression is: in, This indicates the floor function. Represents the total number of training samples. This represents the first value in the ascending order of the spatiotemporal gradient magnitude. Smaller values; 2.3 Resample the training sample set; specifically, for each interval... Assign sampling probability The probability is related to the number of samples. They are inversely proportional, and the expression is: in, Represents the number of intervals. For high spatiotemporal gradient interval preference control parameters; each training sample The final sampling weights Reassignment by interval: Then based on the normalized weights Perform resampling.
4. The short-term precipitation forecasting method based on a dynamic neural network architecture as described in claim 1, characterized in that: The processing procedure for the time-domain branch is as follows: For a given input, reorganize it into a spatial tensor. Then it undergoes the following multi-stage processing: The encoder includes Each downsampling module consists of a 2×2 convolution operation. It is cascaded with NAFNet modules to form a multi-scale feature extraction framework, expressed as: in, , This is a 3×3 convolution operation. Representing the The feature map output by the downsampling module is NAFB, which is the core feature extraction module of the temporal branch. The first step is to normalize the input feature map through a two-dimensional layer, then extract spatial features through depthwise convolution to generate a feature map, and then generate channel weights through a channel attention mechanism. The weights are multiplied with the generated feature map, and then channel features are extracted through 1×1 pointwise convolution. In the second step, the feature map output from the previous step is passed through layer normalization, 1×1 pointwise convolution, gate unit, and 1×1 pointwise convolution to obtain the final output feature map. Decoder includes Each upsampling module recovers high-resolution features through pixel rearrangement upsampling and residual connections, expressed as: in, Pixel rearrangement operator This means concatenating multiple vectors together. Representing the Feature map output by the upsampling module.
5. The short-term precipitation forecasting method based on a dynamic neural network architecture as described in claim 1, characterized in that: The frequency domain branch comprises three key components: an encoder, an FFT module, and a decoder. The encoder and decoder are identical to those in the time domain branch, except that they reassemble the original data into a time tensor. As input to this branch; The specific processing procedure of the FFT module is as follows: For the first... Level downsampling module output Before inputting into the FFT module, block embedding and position encoding are required. The expression is: Here, PatchEmbed represents patch-level embedding, and LPE represents learnable location encoding, used to capture the spatiotemporal location of meteorological sequences. Representative at the The input to the FFT module in the downsampling stage; Then, from the path tensor Whether the adaptive control FFT module is activated, and the optimal execution path is selected for different weather models, is expressed as follows: in, Representative at the In the first level of downsampling The output of FFTB.
6. The short-term precipitation forecasting method based on a dynamic neural network architecture as described in claim 5, characterized in that: The path tensor It is based on the time and space complexity of the input data. The specific process includes three parts: calculating the time and space complexity, calculating the multi-scale path based on the time and space complexity, and generating differentiable paths. Specifically, the time and space complexity is calculated using the Sobel operator to determine the space complexity. This is used to characterize the spatial texture complexity of each sample; the time complexity is calculated using the first-order difference between frames. It is used to characterize the intensity of sample movement within a batch.
7. The short-term precipitation forecasting method based on a dynamic neural network architecture as described in claim 6, characterized in that: Calculating multi-scale paths based on time and space complexity involves transforming the time and space complexity into a scale-invariant path score using a normalized cumulative distribution, expressed as: in, and These represent the normalized path scores in the spatial and temporal dimensions, respectively. This represents a positive infinitesimal quantity approaching 0, used to avoid cases where the denominator is 0; max indicates taking the maximum value. Then, hierarchical thresholding is used to generate the basic features for path decision-making, expressed as: in, Represents the level threshold. , Represents the depth threshold. .
8. The short-term precipitation forecasting method based on a dynamic neural network architecture as described in claim 7, characterized in that: Generate differentiable paths, the final path tensor It is generated by a differentiable gating mechanism that combines space and time complexity scores, and the expression is: Here, STE stands for Pass-Through Estimator, used to implement binary decision-making. This represents a scaling factor, used to adjust the strength of the impact of time and space complexity on path selection. Represents the bias term. Indicates the number of layers in the encoder. Indicates the length of the frequency domain branch. This represents the model loss function; during forward propagation, discrete path tensors are generated according to the above steps. This is used to determine whether each FFT module in each layer of the frequency domain branch is executed; during backpropagation, where... Indicates the training batch size; uses Gradient approximation preserves end-to-end differentiability.
9. The short-term precipitation forecasting method based on a dynamic neural network architecture as described in claim 1, characterized in that: The loss function used in step 4 is the balanced regression loss function, and the specific calculation process is as follows: In short-term precipitation forecasting tasks, the forecast results Given a dataset with a Gaussian distribution, the ideal distribution for a balanced dataset is: in, Indicates the input sample Below are the prediction results. The ideal equilibrium distribution of follows a mean of . variance is Gaussian distribution, denoted by Gaussian distribution, exp represents the natural exponential operation; However, in real meteorological datasets, due to the inherent spatiotemporal imbalance of precipitation events, the actual distribution of the training sample set is... To mitigate model bias caused by such imbalanced distributions, deviating from the ideal equilibrium assumption, the following loss function based on equilibrium regression is constructed: in, Represents the regularization coefficient. Represents all parameters of the model. and Represents the absorption constant. The model weight penalty norm is used to prevent overfitting, and MSE represents the mean squared error. Represents the actual precipitation value The set of all possible values, i.e., the integration interval. Represents the integral variable; To avoid the high computational cost of integration, an interval-based numerical integration method is used to transform the integration problem into a summation problem: First, the true distribution of the training set is uniformly divided into... There are several small intervals, and the center of each interval is: Then, kernel density estimation is applied to calculate the probability of the center point of each interval. Finally, the loss function is simplified to the following expression: in, Represents the temperature coefficient.
10. A short-term precipitation forecasting system based on a dynamic neural network architecture, characterized in that, Includes the following modules: The dataset construction module is used to acquire multi-source meteorological observation data, and after spatiotemporal alignment and fusion processing, it forms high-resolution gridded meteorological data, which is divided into a training sample set and a test sample set with temporal continuity. The resampling module is used to perform gradient-sum-based resampling on the training set; A dynamic network construction module is used to construct a content-aware dynamic network. The content-aware dynamic network adopts a time-frequency dual-branch architecture. The time-domain branch uses an encoder-decoder architecture to capture multi-scale spatial relationships that are crucial for weather model forecasting. The frequency-domain branch is used to capture multi-scale temporal relationships to perform high-quality modeling of weather models. The execution path of the frequency-domain branch is adaptively controlled according to the spatiotemporal complexity of the input data. Finally, the outputs of the two branches are summed element-wise and then subjected to three-dimensional convolution to obtain the final prediction result. The model training and deployment module is used to train and test the content-aware dynamic network using a loss function to obtain the final short-term precipitation forecast model and realize short-term precipitation forecasting.
Citation Information
Cited By
Loss function calculation method and device for sample imbalance data set
CN121682506A
A loss function calculation method and device for a sample unbalanced data set
CN121682506B
Extreme short temporary rainfall forecasting method and system based on wavelet domain decoupling and multi-course learning
CN121835455A
