A Radar Echo Extrapolation Method Based on Dynamic Weight Loss
By designing a dynamic weighted loss function in the radar echo extrapolation method and dynamically adjusting the loss weights to optimize the prediction model, the problem of error accumulation is solved, and the accuracy and effectiveness of short-term forecasts are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2026-04-03
Smart Images

Figure CN115792853B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of remote sensing information processing, and more specifically to a radar echo extrapolation method based on dynamic weight loss. Background Technology
[0002] Short-term forecasting refers to predicting the intensity of future precipitation within 2 hours. Radar echo extrapolation is the primary technique for 0-2 hour nowcasting, but its effective timeframe in actual forecasts is limited to less than 1 hour. Nowcasting is an important means of early warning of localized severe weather, providing timely and effective meteorological support services for agriculture, tourism, transportation, and people's daily activities. However, the inherent complexity and nonlinearity of short-duration precipitation systems make predicting the distribution of short-duration rainfall in a given area extremely challenging. Traditional short-term forecasting methods include radar echo extrapolation, mesoscale numerical models, and conceptual models. Numerical models, widely used in medium- and long-term forecasts, utilize complex atmospheric physics equations to simulate weather processes, but they perform poorly in nowcasting because they require large amounts of real-time atmospheric data, making it difficult to generate high-resolution short-term forecasts; furthermore, they require large-scale computer computations, resulting in enormous costs. Conceptual model forecasting relies on the forecaster's subjective judgment, and its results lack sufficient detail. Therefore, radar echo extrapolation remains the dominant method for operational short-term forecasting.
[0003] In recent years, deep learning has been applied to numerous fields, including object detection, semantic segmentation, and image recognition. Their commonality lies in building models to learn from large amounts of data to fit a nonlinear system. This is why utilizing large amounts of meteorological radar data for short-term forecasting has gradually attracted the attention of many researchers. Compared to traditional radar echo extrapolation methods, deep learning-based methods have more powerful modeling capabilities. In 2015, a team from the Hong Kong University of Science and Technology first combined Long Short-Term Memory (LSTM) networks with Convolutional Neural Networks (CNNs) to propose the ConvLSTM model. This model replaces the Hadamard product in the fully connected LSTM with convolutional operations, thus increasing the model's ability to learn spatial information, not just temporal information. This is achieved by replacing the Hadamard multiplier with convolutional operations in the transformation formula within the LSTM to capture spatiotemporal motion features. However, the introduction of convolutional kernels leads to spatial position invariance, which is a drawback for meteorological models with rotation and deformation characteristics. Subsequently, in 2017, the team further improved upon ConvLSTM, proposing the Trajectory Gate Recurrent Unit (TrajGRU) model. This model offered some improved distortion resistance compared to its predecessor, but its performance in practical applications was not significantly different from ConvLSTM. Also in 2017, Wang et al. proposed a spatio-temporal LSTM (ST-LSTM) model with a sawtooth connection structure, capable of both horizontal and vertical transmission of memory states between layers. By introducing temporal and spatial memory units, it can effectively model shape deformation and motion trajectories. However, ST-LSTM suffers from the gradient vanishing problem. To address this issue, the team proposed the PredRNN++ model, an upgraded version of PredRNN, in 2018, which captures long-term memory dependencies by introducing gradient highway unit modules. In 2019, the team proposed the Memory in Memory (MIM) model, which views the problem of spatiotemporal sequence prediction from the perspective of nonstationarity. This network has achieved better results than other networks in spatiotemporal sequence tasks such as handwritten digit prediction, rainfall prediction, traffic prediction and human behavior prediction.
[0004] Previous studies have used more complex recurrent units (RONs) to improve the accuracy of radar echo extrapolation, such as PredRNN, MIM, and E3D-LSTM. While these models have improved spatiotemporal prediction performance, they have significantly increased the number of parameters, memory consumption, and training time. On the other hand, some studies have directly used mean squared error (MSE) or mean absolute error (MAE) to train the model. However, the prediction difficulty varies for each frame of echo image, and the error is greater for images predicted later. Directly calculating MSE and MAE losses does not take into account the error characteristics of the prediction results, limiting the forecast performance of later images. Existing technologies include some prediction model optimization based on loss functions. For example, patent application number 2020109616071 discloses a weather radar echo extrapolation method based on an improved TrajGRU network. This method adds a layer of radar image sequence input and calculates the loss function weight for each layer of radar data based on the magnitude of the obtained loss function value, assigning different weight values to different loss values. However, although this method takes into account the design of weight values for the loss function, it mainly designs the weight values for the two-layer radar sequences and does not improve the problem of error accumulation caused by the model using the existing loss function. Summary of the Invention
[0005] Purpose of the invention: This invention provides a radar echo extrapolation method based on dynamic weight loss. By designing a dynamic weight optimization loss function assigned to each frame of image, a more accurate extrapolation result is obtained, thus solving the cumulative error generated by existing radar echo extrapolation methods.
[0006] Technical solution: This invention provides a radar echo extrapolation method based on dynamic weight loss, specifically including:
[0007] (1) A dynamic loss function is constructed based on the prediction results of the existing short-term forecast model, wherein the existing short-term forecast model is a model that uses radar echo extrapolation to predict precipitation intensity; the dynamic loss function DWL formula is:
[0008]
[0009] In the formula, w i Represents the dynamic weight at the i-th prediction time; k, b, and x are all hyperparameters; This represents the absolute error at the i-th prediction time. Let y represent the predicted echo image at the i-th prediction time. i This represents the observed echo image at the i-th prediction time, where i∈[1,m], and m is the length of the radar echo sequence; WL i Let represent the loss at the i-th prediction time. The specific formula for calculating the loss at each prediction time is as follows:
[0010]
[0011]
[0012]
[0013] In the formula, L represents the weighted loss function at any prediction time; β represents the shrinkage factor, γ represents the magnification factor; B-MSE represents the weighted MSE, B-MAE represents the weighted MAE, L ssim = 1 - SSIM, where SSIM represents the structural similarity function; R t,h,w This represents the reflectance of the label at pixel coordinates (t, h, w). The weight represents the predicted reflectance at pixel coordinates (t, h, w). t,h,w The weight represents the pixel coordinates (t, h, w);
[0014] (2) Collect radar echo data and establish a radar echo extrapolation dataset. Divide the radar echo extrapolation dataset into a training set and a validation set according to a certain ratio.
[0015] (3) Input the training set data into the short-term forecast model to train the model, obtain the dynamic loss function to optimize the short-term forecast model, and input the validation set data into the optimized short-term forecast model to obtain the prediction results.
[0016] Furthermore, the existing short-term forecast models in step (1) include: ConvLSTM model, TrajGRU model, and PredRNN model.
[0017] Furthermore, in step (1), weight t,h,w The specific formula is as follows:
[0018]
[0019] Furthermore, the specific formula for SSIM in step (1) is as follows:
[0020]
[0021] In the formula, μ Y The mean of the true values. This represents the mean of the predicted values; σ represents the covariance between the true and predicted values, used to measure the structural similarity of images; Y The variance represents the true value; C1 and C2 represent the variance of the predicted values, used to estimate the contrast of the image; both C1 and C2 are constants.
[0022] Furthermore, in step (3), k = b = 1 and x = e.
[0023] Furthermore, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described method. A computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method.
[0024] Beneficial effects: The radar echo extrapolation method based on dynamic weight loss described in this invention has significant advantages over existing technologies: by obtaining the absolute error between the prediction result and the actual result at any prediction time, a time-based dynamic weight is designed, and the calculation of the loss function is optimized according to the dynamic weight, thereby solving the problem of error accumulation caused by the use of existing loss functions in existing prediction models and improving the extrapolation results to be more accurate. Attached Figure Description
[0025] Figure 1 The diagram shown is a flowchart of the method described in this invention;
[0026] Figure 2 The diagram shown is a schematic diagram of the prediction structure described in this invention;
[0027] Figure 3 The figure shown is a graph illustrating the variation of the mean absolute error (MAE) of this invention. Figure 3 (a) shows the mean absolute error (MAE) variation curve based on the ConvLSTM model using the method described in this invention. Figure 3 (b) shows the mean absolute error (MAE) variation curve based on the TrajGRU model using the method described in this invention;
[0028] Figure 3 (c) shows the mean absolute error (MAE) variation curve based on the PredRNN model using the method described in this invention;
[0029] Figure 4 The image shown is a visualization comparing the final prediction results obtained using the method described in this invention with those obtained using existing technologies. Detailed Implementation
[0030] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0031] like Figure 1 As shown, this invention provides a radar echo extrapolation method based on dynamic weight loss, specifically including:
[0032] Step 1: Construct a dynamic loss function based on the prediction results of existing short-term forecast models.
[0033] The short-term forecast model selected is a model based on radar echo extrapolation method in the existing technology. The mainstream short-term forecast models include: ConvLSTM model, TrajGRU model, and PredRNN model.
[0034] like Figure 2 As shown, the process of constructing the dynamic loss function specifically includes:
[0035] (1) Assume that the predicted future radar echo sequence of length m is {y1, y2, ... y...} m The prediction result is: and y i Let represent the predicted echo image and the observed echo image at time i, respectively. The absolute error at time i is expressed as .
[0036] Define the prediction difficulty of the echo image at the i-th prediction time as d. i The larger the image error, the more difficult the image prediction. Therefore, image error is used to represent the difficulty of prediction. The specific formula is as follows, with values ranging from 0 to 1. The larger the value, the greater the proportion of the total loss, meaning the image is more difficult to predict. The specific formula is:
[0037]
[0038] The difficulty of different tasks is determined by the prediction results of the current prediction model, so the loss weight for each frame is dynamically adjusted. The greater the difficulty of a task, the greater the loss weight it receives, meaning the greater the penalty imposed by the prediction model, and vice versa.
[0039] Therefore, the loss weight for the i-th prediction time can be expressed as the following formula:
[0040]
[0041] In the formula, w i Let k, b, and x represent the dynamic weights at the i-th prediction time; k, b, and x are all hyperparameters, i ∈ p1, m.
[0042] (2) For the loss function corresponding to each prediction time, this invention selects B-MSE and B-MAE to improve the prediction capability of radar echoes. The weighted MSE and MAE can be expressed as follows:
[0043]
[0044]
[0045] in,
[0046]
[0047] In the formula, R t,h,w This represents the reflectance of the label at pixel coordinates (t, h, w). The weight represents the predicted reflectance at pixel coordinates (t, h, w). t,h,w This represents the weight of the pixel with coordinates (t, h, w).
[0048] (3) To improve image structural similarity and resolution, L is added to the loss function. ssim = 1 - SSIM, where SSIM represents the structural similarity function, and the formula is:
[0049]
[0050] In the formula, μ Y The mean of the true values. This represents the mean of the predicted values; σ represents the covariance between the true and predicted values, used to measure the structural similarity of images; Y The variance represents the true value; C1 and C2 represent the variance of the predicted values, used to estimate the contrast of the image; both C1 and C2 are constants.
[0051] Based on (2) and (3), the present invention constructs a weighted loss function as follows:
[0052]
[0053] In the formula, β represents the weighted loss function corresponding to any prediction time; β represents the shrinkage coefficient, and γ represents the amplification coefficient; β and γ are used to adjust the numerical difference between the two loss functions.
[0054] (4) Combining the proposed dynamic weight w i The final dynamic loss function, DWL formula, is:
[0055]
[0056] In the formula, WL i This represents the loss at the i-th prediction time.
[0057] In this embodiment, k = b = 1, where b is a bias to prevent the weight from being 0; x is set to e, where e is the natural constant, and β = 5 × 10⁻⁶. -4 γ = 1 × 10 4 .
[0058] Step 2: Acquire radar echo data and establish a radar echo extrapolation dataset.
[0059] Specifically, the radar echo data used in this invention is selected from the C-band dual-polarization weather radar data operated by Nanjing University, named NJU-CPOL. The selected time range is from 2014 to 2019, including 268 precipitation events. The selected radar data scan range is a 256×256 km area with a 3 km contour surface, and the radar scan interval is approximately 6 minutes. Since the data size is insufficient for model training, the 256×256 image is first cropped to 128×128, and its continuous images are sliced using a 15-frame-wide sliding window to divide them into several disjoint subsets. Therefore, each sequence consists of 15 frames, and the observations of the first 5 frames (30 minutes) of each sequence are used as the input to the prediction model, and the observations of the last 10 frames (60 minutes) are used as the output of the prediction model.
[0060] A radar echo extrapolation dataset was built based on the acquired radar echo sequences, and the dataset was divided into a training set and a validation set at an 8:1 ratio. In this embodiment, a training set of 4000 samples and a validation set of 500 samples were obtained.
[0061] Step 3: Input the training set data into the short-term forecast model for training and obtain the dynamic loss function. Replace the original loss function in the short-term forecast model with the obtained dynamic loss function to optimize the short-term forecast model. Input the validation set data into the optimized short-term forecast model for prediction.
[0062] To verify that the present invention provides better prediction performance than existing technologies, three sets of experiments were prepared, using ConvLSTM, TrajGRU, and PredRNN models for prediction, respectively. Each set used a different loss function, including MSE, MSE+MAE, WL, and DWL. The Adam optimizer was used for model training with an initial learning rate of 0.001. An automatic learning rate decay method was used; if the loss value did not decrease after every 5 epochs, the learning rate would decay by 0.1. The batch size for each iteration was set to 5.
[0063] Two common meteorological precipitation evaluation indices were used: the Critical Success Index (CSI) and the Balanced F-Score (FSC). The CSI is defined as the harmonic mean of precision and recall, while the FC combines the results of precision and recall. The FC value ranges from 0 to 1, with values closer to 1 indicating better model performance and values closer to 0 indicating worse performance. Assuming there are two classes, positive and negative, represented by 1 and 0 respectively, the confusion matrix is constructed as shown in Table 1.
[0064] Table 1 Echo Prediction Results
[0065]
[0066] Therefore, the formulas for calculating the CSI and FSC indices are:
[0067]
[0068]
[0069] in,
[0070] CSI and FSC metrics can directly reflect the quality of a model; the higher the CSI and FSC, the better the model performance.
[0071] Based on the above evaluation metrics, three different thresholds of 20, 30, and 35 dBZ were set to test the prediction results. In addition, MAE was used to evaluate model performance, and its calculation formula is as follows, where Y... i and These represent the actual data and predicted data for the labels, respectively.
[0072]
[0073] Finally, the comparison results of different loss methods based on the ConvLstm model in terms of CSI, FSC, and MAE are shown in Table 2:
[0074] Table 2
[0075]
[0076]
[0077] As shown in Table 2, for the ConvLstm model, the WL loss improves all metrics compared to MSE or MSE+MAE, but the DWL method performs best. With a threshold of 35 dBZ, compared to the first three methods, the WL loss improves the CSI metric by 0.1125, 0.1544, and 0.0194 respectively, representing improvements of 36.48%, 57.94%, and 4.83%; and the FSC metric improves by 0.1378, 0.2050, and 0.0206 respectively, representing improvements of 30.77%, 53.86%, and 3.65%. The MAE metric decreases by 0.611, 0.497, and 0.468 compared to the first three methods.
[0078] Table 3 shows the comparison results of different loss methods based on the TrajGRU model in terms of CSI, FSC and MAE:
[0079] Table 3
[0080]
[0081] As shown in Table 3, for the TrajGRU model, the DWL method in this study outperforms other methods in all three indices, while the MSE method performs the worst. With a threshold of 30 dBZ, compared to MSE, MSE+MAE, and WL methods, the DWL method improves the CSI index by 0.0926, 0.0919, and 0.0017 respectively, representing improvements of 16.17%, 16.03%, and 0.26%; the FSC index improves by 0.0784, 0.0755, and 0.0012 respectively, representing improvements of 10.88%, 10.44%, and 0.15%; and the MAE index decreases by 0.873, 0.631, and 0.214 compared to the other three methods.
[0082] Table 4 shows the comparison results of different loss methods used based on the TrajGRU model in terms of CSI, FSC and MAE:
[0083] Table 4
[0084]
[0085] As shown in Table 4, for the PredRNN model, the MSE method performed the worst, while the DWL method in this study outperformed the other three loss methods, demonstrating the best performance. With a threshold of 35 dBZ, compared to the other three loss methods, the DWL method improved the CSI index by 0.0408, 0.0210, and 0.0109 respectively, representing improvements of 8.46%, 4.18%, and 2.13%; improved the FSC index by 0.0379, 0.0191, and 0.0104 respectively, representing improvements of 5.86%, 2.87%, and 1.54%; and decreased the MAE index by 0.792, 0.478, and 0.222 respectively.
[0086] In addition, according to Figure 3 (a) Figure 3 (b) and Figure 3 (c) shows the mean absolute error (MAE) variation curve. The dynamic weight loss method proposed in this invention has the smallest mean absolute error compared to other loss methods. Combined with... Figure 4 The visualization shown compares the final prediction results using the method described in this invention with those using existing technologies. The dynamic weight loss method proposed in this invention has superior performance compared to other loss methods.
Claims
1. A radar echo extrapolation method based on dynamic weight loss, characterized in that, Includes the following steps: (1) A dynamic loss function is constructed based on the prediction results of the existing short-term forecast model, wherein the existing short-term forecast model is a model that uses radar echo extrapolation to predict precipitation intensity; the dynamic loss function DWL formula is: In the formula, w i Represents the dynamic weight at the i-th prediction time; k, b, and x are all hyperparameters; This represents the absolute error at the i-th prediction time. Let y represent the predicted echo image at the i-th prediction time. i WL represents the observed echo image at the i-th prediction time, where i ∈ [1, m], and m is the length of the radar echo sequence. i Let represent the loss at the i-th prediction time. The specific formula for calculating the loss at each prediction time is as follows: In the formula, Let L represent the weighted loss function at any prediction time; β represents the shrinkage factor, γ represents the magnification factor; B-MSE represents the weighted MSE, B-MAE represents the weighted MAE, and L... ssim = 1 - SSIM, where SSIM represents the structural similarity function; R t,h,w This represents the reflectance of the tag at pixel coordinates (t, h, w). The weight represents the predicted reflectance at pixel coordinates (t, h, w). t,h,w The weight represents the pixel coordinates (t, h, w); (2) Collect radar echo data and establish a radar echo extrapolation dataset. Divide the radar echo extrapolation dataset into a training set and a validation set according to a certain ratio. (3) Input the training set data into the short-term forecast model to train the model, obtain the dynamic loss function to optimize the short-term forecast model, and input the validation set data into the optimized short-term forecast model to obtain the prediction results.
2. The radar echo extrapolation method based on dynamic weight loss according to claim 1, characterized in that, The existing short-term forecast models in step (1) include: ConvLSTM model, TrajGRU model, and PredRNN model.
3. The radar echo extrapolation method based on dynamic weight loss according to claim 1, characterized in that, In step (1) weight t,h,w The specific formula is as follows:
4. The radar echo extrapolation method based on dynamic weight loss according to claim 1, characterized in that, The specific formula for SSIM in step (1) is as follows: In the formula, μ Y The mean of the true values. This represents the mean of the predicted values; σ represents the covariance between the true and predicted values, used to measure the structural similarity of images; Y The variance represents the true value; C1 and C2 represent the variance of the predicted values, used to estimate the contrast of the image; both C1 and C2 are constants.
5. The radar echo extrapolation method based on dynamic weight loss according to claim 1, characterized in that, In step (1), k = b = 1 and x = e.
6. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 5.