Short-term rainfall prediction method based on radar echo map and attention enhancement

By using a predictive recursive neural network model based on radar echo graph in short-term rainfall prediction, long-term dependencies are established using attention-weighted matrix, the problems of information loss and low prediction success rate are solved, and the prediction of heavy rainfall is significantly improved ability.

CN118938356APending Publication Date: 2024-11-12GUILIN UNIV OF ELECTRONIC TECH +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410985868.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The prior art has problems such as information loss and difficulty in establishing long-term dependencies in short-term rainfall predictions, especially in heavy rain predictions above 40dbz, which is mainly due to the failure of effective utilization of historical information sources.

Method used

Using a predictive recursive neural network model based on radar echo graph, the attention-weighted matrix spans multiple time steps and historical information sources, establishes long-term dependencies, thereby restoring gradually lost information sources, combining convolutional layers and self-attention mechanisms , enhance prediction ability.

Benefits of technology

It effectively solves the problem of information loss and improves the prediction ability of heavy rainfall, especially in heavy rain predictions above 40dbz, which significantly improves the prediction success rate and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118938356A_ABST
    Figure CN118938356A_ABST
Patent Text Reader

Abstract

The invention provides a short-term rainfall prediction method based on a radar echo map and attention enhancement. Comprising the following steps: 1, collecting a radar echo map, and dividing into a training set sample and a test set sample; 2, training a prediction recurrent neural network model by using a training set sample, and inputting continuous N frames of radar echo maps into the network model to obtain N hidden states; comprising the following steps: (3) constructing (N-1) pairs of hidden states from different time steps; 4, calculating an attention weighting matrix between hidden states; 5, the hidden state of the current time step is convolved and then added with the attention weighting matrix to output a new hidden state; 6, taking the new hidden state as a hidden state which is finally output by the prediction recurrent neural network model; 7, storing a prediction recurrent neural network model obtained after training of a training set sample; and 8, inputting continuous N frames of radar echo maps in a test set sample into the prediction recurrent neural network model to extrapolate M frames of radar echo maps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of meteorological forecasting, and in particular relates to a short-term rainfall prediction method based on radar echo graph and attention enhancement. Background Art

[0002] In the field of meteorology, short-term rainfall prediction is a crucial task, and its goal is to predict the rainfall in the next 0-2 hours. Accurate short-term rainfall prediction is of great significance for urban flood control, farmland irrigation, traffic safety, etc. However, due to the relatively short period and low frequency of heavy rainfall events, the number of available heavy rainfall data samples is limited. In addition, traditional numerical prediction methods usually require the use of complex physical parameterization schemes and numerical algorithms, which not only require a large amount of computing resources, but also require a long computing time, which makes it more difficult to accurately predict short-term rainfall. At present, the mainstream methods based on convolutional and recurrent neural networks have some problems in short-term rainfall prediction. For example, with the increase of forecast time, the problem of information being easily lost after being transmitted layer by layer in the neural network becomes more and more serious, and it is difficult to establish long-term dependencies. Especially for heavy rain prediction above 40dbz, the success rate of prediction is low, which has a lot to do with the ineffective use of historical information sources. Summary of the invention

[0003] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide a method for predicting short-term rainfall based on radar echogram and attention enhancement.

[0004] In order to achieve the above object and other related objects, the present invention provides a method for predicting short-term rainfall based on radar echogram and attention enhancement, the method comprising the following steps:

[0005] Step 1: Collect radar echo images and divide them into training set samples and test set samples;

[0006] Step 2: Use the training set samples to train the prediction recursive neural network model, and input N consecutive frames of radar echo images into the network model to obtain N hidden states;

[0007] Step 3: Construct N-1 pairs of hidden states from different time steps;

[0008] Step 4: Calculate the attention weight matrix between hidden states;

[0009] Step 5: The hidden state of the current time step is convolved and added to the attention weight matrix to output a new hidden state;

[0010] Step 6: Use the new hidden state as the hidden state of the final output of the predicted recurrent neural network model;

[0011] Step 7: Save the prediction recursive neural network model obtained after training the training set samples;

[0012] Step 8: Input N consecutive frames of radar echo images in the test set samples into the predictive recursive neural network model to extrapolate M frames of radar echo images.

[0013] Preferably, the radar echo map is obtained by standardizing and gray-scale conversion of radar echo base data, setting the radar reflectivity exceeding 70dbz equal to 70dbz, and linearly mapping the data in the range of 0-70dbz to 0-255 pixel values ​​to obtain an 8-bit grayscale map;

[0014] The 8-bit grayscale images constitute a radar echo data set;

[0015] The radar echo data set is divided into training set samples and test set samples in a ratio of 8:2;

[0016] The training set samples and the test set samples contain input and output of radar echo images.

[0017] Preferably, N consecutive frames of radar echo images in the training set samples are input, and the prediction recursive neural network model is capable of processing structural data with time series, and the hidden state of the output of each time step is used as the input of the next time step to obtain N hidden states.

[0018] Preferably, the hidden state at the current time t is combined with the past N-1 hidden states to form N-1 pairs of hidden states from different time steps.

[0019] Preferably, the N-1 hidden states are hidden states of historical time steps, and the K value and the V value are derived from the hidden states of the input historical time steps;

[0020] The hidden state at the current time t is the hidden state of the current time step, and the Q value comes from the hidden state of the input current time step;

[0021] According to the Q, K and V values, dot product the transpose of Q and K, then divide it by the dimension of the hidden state, normalize the result to the 0-1 range through softmax, and finally multiply it with V to get the attention weighted matrix;

[0022] There are N-1 attention weighting matrices, and then the N-1 attention weighting matrices are summed to obtain the attention weighting matrix between N-1 pairs of hidden states.

[0023] Preferably, the hidden state of the current time step is output after passing through a convolutional layer;

[0024] The attention weighting matrix is ​​calculated by Q, K, and V for N-1 pairs of hidden states, and the attention weighting matrix is ​​reshaped to the same dimension as the hidden state of the current time step;

[0025] The output of the convolution of the hidden state of the current time step is added to the reshaped attention weighted matrix, and finally a new hidden state is output.

[0026] Preferably, the new hidden state vector is used as the hidden state output by the current prediction recursive neural network model.

[0027] The hidden state vector is a hidden state obtained by the predictive recursive neural network model according to the storage unit and the output gate;

[0028] The original input of the prediction recursive neural network model is converted into four parts: input gate, forget gate, storage unit and output gate after passing through the convolution layer;

[0029] The storage unit is obtained by passing the original input of the prediction recursive neural network model through the convolution layer;

[0030] The output gate is obtained by passing the original input of the prediction recursive neural network model through the convolution layer;

[0031] Preferably, the training set samples are used to train the predictive recursive neural network model, and the root mean square error is used as a training indicator of the predictive recursive neural network model. The model is saved when the indicator size no longer changes.

[0032] Preferably, N consecutive frames of radar echograms in the test set samples are sent to the prediction recursive neural network model to output a sequence of M consecutive frames of radar echograms;

[0033] The radar echo map sequence can be used as a visualization result of short-term rainfall, and the prediction time is 0-2 hours.

[0034] As described above, the short-term rainfall prediction method based on radar echogram and attention enhancement proposed by the present invention has the following beneficial effects:

[0035] (1) In terms of data, the present invention only uses a single radar echo map data, avoiding the uncertainty brought by the integration of other meteorological data, and can also reduce the complexity of the model and reduce the calculation cost; at the same time, the short-term rainfall prediction timeliness is relatively short, and the calculation needs to be completed in a short time. The radar echo map obtained in real time can be used as input to predict the rainfall map in the next 0-2 hours in real time.

[0036] (2) In the benchmark model, the prediction recurrent neural network used has the characteristics of capturing spatiotemporal structure and processing time series. The continuous radar echo images are used as time series data, and the state changes of clouds on the radar echo images are used as spatial information. The prediction recurrent neural network is good at processing spatiotemporal prediction problems such as radar echo image prediction. In addition, the prediction recurrent neural network has one more memory unit than the traditional convolutional recurrent network, and has a stronger ability to predict heavy rainfall.

[0037] (3) In terms of algorithm, based on the idea of ​​self-attention mechanism, a relationship is established between the hidden state at the current moment and the hidden state of multiple time steps in the past, focusing on the useful information sources in the historical time steps, and summing up the multiple attention weighted matrices calculated to obtain a new hidden state. The difference from the traditional method is that the attention weighted matrix is ​​established across multiple time steps and different hidden states, that is, the gradually lost information source is recovered from the past information, and a long-term dependency relationship is established.

[0038] (4) The proposed short-term rainfall prediction method based on radar echo map and attention enhancement effectively solves the problem that the model is difficult to establish long-term dependencies between spatiotemporal information, resulting in information loss. The traditional attention mechanism often only establishes an attention weight matrix based on the hidden state vector of the current time step to obtain the spatiotemporal information of the current time step, while the attention enhancement spans different time steps and establishes an attention weight matrix with the historical hidden state. The obtained attention weight matrix is ​​summed and connected with the output of the convolution of the hidden state of the current time step to achieve attention enhancement and focus on useful historical information sources. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to further illustrate the contents described in the present invention, the specific embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. It should be understood that these drawings are only used as typical examples and should not be regarded as limiting the scope of the present invention.

[0040] Figure 1 is a flow chart of a short-term rainfall prediction method provided by the present invention;

[0041] Figure 2 It is a frame of radar echo image at a certain time period on June 18, 2022;

[0042] Figure 3 It is a diagram of the internal structure of the predictive recurrent neural network;

[0043] Figure 4 It is a graph of the CSI index values ​​of the five extrapolation models changing over time;

[0044] Figure 5 It is the curve diagram of HSS index values ​​of five extrapolation models changing with time;

[0045] Figure 6 It is a visualization of the predicted radar echogram results; DETAILED DESCRIPTION

[0046] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following specific embodiments are only used to explain this application.

[0047] The embodiment of the present invention provides a short-term rainfall prediction method based on radar echogram and attention enhancement. The specific idea is to establish an attention weighted matrix with historical information sources across multiple time steps and establish a long-term dependency relationship, so as to recover the currently missing information from historical features with less information loss. Specifically, the following steps are included:

[0048] Step 1: Collect radar echo images and divide them into training set samples and test set samples;

[0049] The radar echo map is obtained by standardizing and gray-scale conversion of radar echo base data. Assuming that when reading the radar echo map, matrix a is obtained, a[a>70]=70, and the radar reflectivity greater than 70dbz is equal to 70dbz, then the gray-scale conversion is performed by the following formula:

[0050]

[0051] Among them, pixel_value is the pixel value of the radar echo image, and plxel_dbz is the radar reflectivity value.

[0052] The training set samples and validation set data samples are radar echo images collected by region, such as Figure 2 It is a frame of radar echo image in a certain period of time on June 18, 2022.

[0053] Step 2: Use the training set samples to train the prediction recursive neural network model, and input N consecutive frames of radar echo images into the network model to obtain N hidden states;

[0054] The predictive recursive neural network described above divides the original input data into an input gate, a forget gate, a memory unit, and an output gate, such as Figure 3 It is a diagram of the internal structure of a predictive recurrent neural network.

[0055] The hidden state is obtained by multiplying the output gate and the memory unit through the tanh function. The specific formula is as follows:

[0056]

[0057] Among them, i t is the input gate at time t, f t is the forget gate at time t, o t is the output gate at time t, c t is the memory unit at time t, H t is the hidden state of the output at time t, * represents the convolution operation, represents the Hadamard product, σ represents the activation function sigmoid, and b is the bias value.

[0058] Step 3: Construct N-1 pairs of hidden states from different time steps;

[0059] The hidden state of the current time step and the hidden state of the historical time step construct an attention mechanism, and calculate the attention weighted matrix value between the two. A total of N-1 pairs can be constructed.

[0060] Step 4: Calculate the attention weight matrix between hidden states;

[0061] The calculation steps of the attention weight matrix are as follows:

[0062] 1) Build Q t , K t 、V t Vector Matrix

[0063] Q t , K t 、V t The three vector matrices are derived from the original input, by transforming the hidden state H of the current time step t and the hidden state H at the N-1 frame history time step t-τ (τ∈1:N) establishes information dependency between the time dimension and the space dimension, forming N-1 pairs of input features (Η t ,H t-τ ), and finally mapped to the query vector Key Vector Sum value vector (in

[0064] Q=H t , K=H t-τ ,,V=H t-τ ).

[0065] 2) Calculating attention scores

[0066]

[0067] By measuring and The degree of correlation between them is the subsequent V t i Assign appropriate weights. The role of softmax is to normalize the vector to obtain a weight matrix between 0 and 1. is the dimension of the vector. head i represents the multi-head attention mechanism, Represents positional encoding.

[0068] 3) Calculate the weighted matrix and combine the weighted values

[0069] After the second step, each pair (H t ,H t-τ ) and then with the value vector matrix V t i Multiplication output W1, W2, ..., W N-1 , and finally the weighted fusion is obtained z :

[0070]

[0071] Step 5: The hidden state of the current time step is convolved and added to the attention weight matrix to output a new hidden state;

[0072] The hidden state of the current time step is output through the convolution layer: Conv(H t );

[0073] New hidden state: H t =Conv(H t )+W z

[0074] Step 6: Use the new hidden state as the hidden state of the final output of the predicted recurrent neural network model;

[0075] The formula for predicting the output hidden state of the recurrent neural network model is updated to:

[0076]

[0077] H t =Conv(H t )+W z

[0078] Step 7: Save the prediction recursive neural network model obtained after training the training set samples;

[0079] Step 8: Input N consecutive frames of radar echo images in the test set samples into the predictive recursive neural network model to extrapolate M frames of radar echo images.

[0080] In order to verify the performance of the short-term rainfall prediction model and the effectiveness of the present invention, based on the meteorological data set provided by a province, based on the pytorch framework, the computer GPU is NVIDIA GeForce RTX 3090. The CUDA version is 11.3, and the pytorch version is 1.11. Here, the AM-PredRNN model is compared with four models including ConvLSTM, ConvGRU, TrajGRU, and PredRNN to verify the feasibility and advancement of the method. The mean square error MSE is used to verify the model, and the MSE formula is as follows:

[0081]

[0082] Among them, y i represents the real data, y i Represents the predicted data, and n represents the number of samples.

[0083] At the same time, the commonly used indicators of short-term rainfall prediction, CSI (Critical Success Index) and HSS (Heidke Skill Score), are used to evaluate the model performance. The specific formula is as follows:

[0084]

[0085] Among them, the thresholds of TN, FP, FN, and TP are set by binary classification method, see Table 1 for details.

[0086] Table 1

[0087] Actual\Forecast 0 1 0 TN FP 1 FN TP

[0088] Among them, TN: (0, 0) represents a true negative, the actual value is 0, and the predicted value is also 0. FP: (0, 1) represents a false positive, the actual value is 0, and the predicted value is 1. FN: (1, 0) represents a false negative, the actual value is 1, and the predicted value is 0. TP: (1, 1) represents a true positive, the actual value is 1, and the predicted value is also 1.

[0089] This experiment mainly uses radar echo images of the past 30 minutes to predict the rainfall in the next hour. That is, there are 15 radar echo images in each sample, the first 5 are used as input, and the last ten are used as output. After continuous training, the model with optimal parameters is obtained, and then the samples in the test set are used to verify the performance of the model. The main test is the prediction of heavy rainfall, especially heavy rain above 40dbz. The CSI and HSS values ​​of the short-term rainfall prediction method based on radar echogram and attention enhancement at 40dbz proposed in the present invention are better than those of other models. The CSI value of this model is improved by 55.04%, 49.15%, 43.18% and 46.99% respectively compared with ConvLSTM, ConvGRU, TrajGRU and PredRNN, and the HSS value of this model is improved by 51.16%, 43.61%, 37.34% and 42.95% respectively compared with ConvLSTM, ConvGRU, TrajGRU and PredRNN, which verifies that the problem of easy loss of information after layer-by-layer transmission in the neural network is improved with the increase of forecast timeliness in the method proposed in the present invention. Compared with other convolutional recurrent neural networks, this model is easier to establish long-term dependencies, and the success rate of heavy rain prediction is improved. The results are shown in Table 2. Figure 4 and Figure 5 The following are the curves of CSI and HSS indicators of five extrapolation models over time. In order to more intuitively see the effectiveness of the method of the present invention, the visualization of the predicted radar echo map results is given as follows: Figure 6 As shown in the figure, the first five pictures in the first row are inputs, the next ten pictures are ground truth radar echo pictures, and the second, third, fourth, fifth, and sixth rows are the prediction results of ConvLSTM, ConvGRU, TrajGRU, PredRNN, and AM-PredRNN respectively.

[0090] Table 2

[0091]

[0092] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. By referring to the detailed description of the embodiments, any person skilled in the art may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A short-term rainfall prediction method based on radar echogram and attention enhancement, characterized in that: The method comprises the following steps: Step 1: Collect radar echo images and divide them into training set samples and test set samples; Step 2: Use the training set samples to train the prediction recursive neural network model, and input N consecutive frames of radar echo images into the network model to obtain N hidden states; Step 3: Construct N-1 pairs of hidden states from different time steps; Step 4: Calculate the attention weight matrix between hidden states; Step 5: The hidden state of the current time step is convolved and added to the attention weight matrix to output a new hidden state; Step 6: Use the new hidden state as the hidden state of the final output of the predicted recurrent neural network model; Step 7: Save the prediction recursive neural network model obtained after training the training set samples; Step 8: Input N consecutive frames of radar echo images in the test set samples into the predictive recursive neural network model to extrapolate M frames of radar echo images.

2. A method for predicting short-term rainfall based on radar echogram and attention enhancement according to claim 1, characterized in that: The step 1 is specifically as follows: The radar echo map is obtained by standardizing and gray-scale conversion of radar echo base data, setting the radar reflectivity above 70dbz equal to 70dbz, and linearly mapping the data in the range of 0-70dbz to 0-255 pixel values ​​to obtain an 8-bit grayscale image; The 8-bit grayscale images constitute a radar echo data set; The radar echo data set is divided into training set samples and test set samples in a ratio of 8:2; The training set samples and the test set samples contain input and output of radar echo images.

3. A method for predicting short-term rainfall based on radar echogram and attention enhancement according to claim 2, characterized in that: The step 2 is specifically as follows: N consecutive frames of radar echo images in the training set samples are input, and the predicted recursive neural network model is able to process structural data with time series, and the hidden state of the output of each time step is used as the input of the next time step to obtain N hidden states.

4. A method for predicting short-term rainfall based on radar echogram and attention enhancement according to claim 3, characterized in that: The step three is specifically as follows: The hidden state at the current time t is combined with the past N-1 hidden states to form N-1 pairs of hidden states from different time steps.

5. A method for predicting short-term rainfall based on radar echogram and attention enhancement according to claim 3, characterized in that: The step 4 is specifically as follows: The N-1 hidden states are the hidden states of the historical time step, and the K value and the V value are derived from the hidden states of the input historical time step; The hidden state at the current time t is the hidden state of the current time step, and the Q value comes from the hidden state of the current time step input; According to the Q, K and V values, dot product the transpose of Q and K, then divide it by the dimension of the hidden state, normalize the result to the 0-1 range through softmax, and finally multiply it with V to get the attention weighted matrix; There are N-1 attention weighting matrices, and then the N-1 attention weighting matrices are summed to obtain the attention weighting matrix between N-1 pairs of hidden states.

6. A method for predicting short-term rainfall based on radar echogram and attention enhancement according to claim 3, characterized in that: The step five is specifically as follows: The hidden state of the current time step is output after passing through the convolution layer; The attention weighting matrix is ​​calculated by Q, K, and V for N-1 pairs of hidden states, and the attention weighting matrix is ​​reshaped to the same dimension as the hidden state of the current time step; The output of the convolution of the hidden state of the current time step is added to the reshaped attention weighted matrix, and finally a new hidden state is output.

7. A method for predicting short-term rainfall based on radar echogram and attention enhancement according to claim 3, characterized in that: The step six is ​​specifically as follows: The new hidden state vector is used as the hidden state of the current prediction recursive neural network model output. The hidden state vector is a hidden state obtained by the predictive recursive neural network model according to the storage unit and the output gate; The original input of the prediction recursive neural network model is converted into four parts: input gate, forget gate, storage unit and output gate after passing through the convolution layer; The storage unit is obtained by passing the original input of the prediction recursive neural network model through the convolution layer; The output gate is obtained by passing the original input of the prediction recursive neural network model through the convolution layer.

8. A method for predicting short-term rainfall based on radar echogram and attention enhancement according to claim 4, characterized in that: The step seven is specifically as follows: The training set samples are used to train the prediction recursive neural network model, and the root mean square error is used as the training indicator of the prediction recursive neural network model. The model is saved when the indicator size no longer changes.

9. A method for predicting short-term rainfall based on radar echogram and attention enhancement according to claim 5, characterized in that: The step eight is specifically as follows: Use N consecutive frames of radar echo images in the test set samples to send them to the prediction recursive neural network model, and output a sequence of M consecutive frames of radar echo images; The radar echo map sequence can be used as a visualization result of short-term rainfall, and the prediction time is 0-2 hours.

Citation Information

Cited By

  • Meteorological prediction method based on memory flashback

    CN120543886A