A short-term precipitation prediction method based on convolutional network with small attention mechanism and its application

By adopting a convolutional network model based on a small attention mechanism in precipitation prediction, the problem of inaccurate precipitation spatial distribution and intensity prediction is solved, and high-precision prediction of short-term precipitation is achieved.

CN118606628BActive Publication Date: 2025-03-25HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410756981.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2025-03-25
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

In the prior art, there are problems of inaccurate prediction of precipitation spatial distribution and inaccurate prediction of precipitation intensity.

Method used

The convolutional network model based on a small attention mechanism is adopted to obtain key information in the precipitation map through the RFA feature extraction module, and the attention mechanism is used to achieve better spatial attention.

Benefits of technology

The accuracy of prediction of intensity and spatial distribution prediction of precipitation in the short term (0-3 hours) is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606628B_ABST
    Figure CN118606628B_ABST
Patent Text Reader

Abstract

The present invention discloses a short-term precipitation prediction method based on a convolutional network with a small attention mechanism. The method comprises the following steps: step 1, obtaining radar precipitation map data of previous years and performing data processing and data enhancement as input data of the model; step 2, constructing and training the convolutional network model of the small attention mechanism, wherein the convolutional network model based on the small attention mechanism is designed as a 4-layer convolutional network; step 3, inputting the processed radar precipitation map into the convolutional network model based on the small attention mechanism to obtain the corresponding prediction result; step 4, analyzing the error between the input data and the prediction data, calculating the error index and the accuracy index, analyzing the model performance according to the input data and the prediction data, and calculating the performance index. The method realizes the efficient extraction and recognition of the features of the radar precipitation map, and helps to improve the clarity of the spatial distribution prediction of precipitation and the accuracy of the precipitation intensity prediction in the precipitation prediction task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of precipitation prediction and deep learning technology in the meteorological field, and specifically refers to a short-term precipitation prediction method based on a convolutional network with a small attention mechanism and its application. Background Art

[0002] Precipitation forecasting plays a key role in meteorological research and is of vital importance to agriculture, water resources management, disaster prevention and mitigation, etc. Accurate prediction of precipitation on a short time scale can significantly improve disaster prevention and mitigation capabilities and reduce the losses caused by floods and waterlogging.

[0003] At present, the main method of precipitation forecasting is still the numerical weather forecast model (NWP), which plays an important role in generating precipitation forecasts for the next few hours, days, or even weeks. However, it involves solving a series of partial differential equations composed of atmospheric physical quantities. The complex mathematical modeling and calculation process make each forecast take a long time, which is not suitable for short-term precipitation forecasts within 0-3 hours. In recent years, with the rapid development of artificial intelligence technology, short-term precipitation forecasting based on artificial neural networks has become the mainstream way to supplement traditional numerical weather forecast models. Unlike traditional numerical weather forecasting methods that rely on model-driven, artificial neural networks only need to analyze and learn relevant historical meteorological data (wind speed, precipitation, cloud cover, etc.) to complete end-to-end rainfall forecasts, simplifying the forecast process.

[0004] However, the current traditional methods mainly use CNN models, which have low prediction accuracy for the spatial distribution and intensity of precipitation clusters. This paper proposes a short-term precipitation prediction method based on a convolutional network with a small attention mechanism, which obtains key information in the precipitation map through the RFA feature extraction module, and uses the attention mechanism to achieve better spatial attention, which can greatly improve the prediction accuracy. Summary of the invention

[0005] The purpose of the present invention is to provide a short-term precipitation prediction method based on a convolutional network with a small attention mechanism, so as to solve the technical problems of inaccurate prediction of precipitation spatial distribution and inaccurate prediction of precipitation intensity in the prior art.

[0006] In order to solve the above technical problems, the technical solution of the present invention is:

[0007] A short-term precipitation prediction method based on a convolutional network with a small attention mechanism. It includes the following steps:

[0008] Step 1: Obtain radar precipitation map data from previous years and perform data processing and data enhancement as the input data X∈R of the model B×C×H×WWhere B is the length of the precipitation map sequence; C is the image channel; H is the image length; and W is the image width.

[0009] Step 2: construct and train the convolutional network model of the small attention mechanism, wherein the convolutional network model based on the small attention mechanism is designed as a 4-layer convolutional network. Each convolutional network layer includes a deep feature extraction module and a decoder, and the deep feature extraction module includes channel space attention, reconstructed channel space convolution, deep feature downsampling, global average pooling layer, one-dimensional pooling layer, Sigmoid activation layer and other parts.

[0010] Step 3: Input the processed radar precipitation map into the convolutional network model based on the small attention mechanism to obtain the corresponding prediction results.

[0011] Step 4: Analyze the error between the input data and the predicted data, and calculate the error index and accuracy index. Analyze the model performance based on the input data and the predicted data, and calculate the performance index.

[0012] Preferably, in step 1, the size of the 765x760 radar precipitation image is cropped to 224x224 to remove useless information in the blank space and speed up the model training.

[0013] Preferably, each data sequence in step 1 includes 30 radar precipitation images, of which the first 12 images are used as input data and the last 18 images are used as output data. Each precipitation image represents the precipitation information of a region within 5 minutes.

[0014] Preferably, the feature extraction method of the deep feature extraction module in the small attention convolutional network is:

[0015]

[0016] Among them, F c is the extracted feature; A is the input data; α is the learnable parameter.

[0017] The definition of Q is as follows:

[0018]

[0019] in is the reconstructed spatial channel convolution used by the feature extraction module; φ is the small parallel channel spatial attention used by the feature extraction module; Sig is the Sigmoid activation function used.

[0020] When feature F is obtained c After that, it is input into the decoder through one branch, and the other branch is input into the secondary feature extraction module through the downsampling module, and the above steps are repeated.

[0021] Preferably, the training method of the convolutional network model based on the small attention mechanism is: using a smooth L1 function as a loss function, and its calculation method is shown in formula (1.1).

[0022]

[0023] Preferably, the present invention uses MSE, RMSE and Accuracy as evaluation indicators in the test and evaluation stage, and the calculation methods of the three are shown in (1.2)(1.3)(1.4):

[0024]

[0025]

[0026]

[0027] Where n is the total number of input data; y i Enter data for the current time; is the predicted value of the current input; TP is the true positive example, which is the number of positive samples correctly predicted as positive by the model; TN is the true negative example, which is the number of negative samples correctly predicted as negative by the model; FP is the false positive example, which refers to the number of negative samples incorrectly predicted as positive by the model; FN is the false negative example, which refers to the number of positive samples incorrectly predicted as negative by the model.

[0028] The present invention also provides an application of a short-term precipitation prediction method based on a convolutional network with a small attention mechanism, which obtains a real-time radar precipitation map and performs data preprocessing, takes the preprocessed data as input, and applies a convolutional network model with a small attention mechanism to predict precipitation within 0-3 hours.

[0029] The present invention has the following characteristics and beneficial effects:

[0030] The above technical solution is adopted. This method uses a small attention convolutional network model and a custom feature extraction module to effectively extract key features from radar precipitation map data. It uses a small attention mechanism to highlight precipitation clusters in radar precipitation maps, suppress irrelevant areas in the map, and achieve better spatial attention. It effectively improves the accuracy of the model's prediction of precipitation intensity and spatial distribution in the short term (0-3 hours). BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0032] Figure 1 This is a flow chart of the precipitation prediction method based on a convolutional network with a small attention mechanism of the present invention.

[0033] Figure 2 Schematic diagram of the structure of the small attention mechanism in the present invention.

[0034] Figure 3 This is a specific implementation of the small-scale attention mechanism in the present invention.

[0035] Figure 4 It is a schematic diagram of the structure of the deep feature extraction module in the present invention. DETAILED DESCRIPTION

[0036] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments may be combined with each other.

[0037] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and the like are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", and the like may explicitly or implicitly include one or more features. In the description of the present invention, unless otherwise specified, "multiple" means two or more.

[0038] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood by specific circumstances.

[0039] Example 1

[0040] This embodiment provides a short-term precipitation prediction method based on a convolutional network with a small attention mechanism, such as Figure 1 As shown, the following steps are included:

[0041] Step 1: Obtain radar precipitation map data from previous years and perform data preprocessing and data enhancement as the input data X∈R of the model B×C×H×W , where B is the length of the precipitation map sequence; C is the image channel; H is the image length; and W is the image width.

[0042] In this embodiment, the radar precipitation map obtained is an available public precipitation dataset, including 320,000 radar precipitation maps; during the data preprocessing process, the precipitation map, which was originally 765x760 in size, was cropped to 256x256 in size, and the original dataset was divided into a sequence of 30 images. Data enhancement is to randomly rotate the precipitation map during the training process to enhance the robustness to view changes.

[0043] Step 2: construct and train a convolutional network model of a small attention mechanism, wherein the convolutional network model of the small attention mechanism includes several layers of parallel convolutional networks, each layer of the convolutional network includes a deep feature extraction module and a decoder; specifically, the deep feature extraction module includes channel space attention, reconstructed channel space convolution, deep feature downsampling, global average pooling layer, one-dimensional pooling layer, Sigmoid activation layer and other parts.

[0044] Specifically, Figure 2 As shown, the data is input to the deep feature extraction module, and then the features are connected to the decoder part through jump connections.

[0045] Step 3: Input the processed radar precipitation map into the convolutional network model based on the small attention mechanism. The features extracted by the deep feature extraction module in the upper convolutional network are jump-connected to the decoder, and then input into the deep feature extraction module in the lower convolutional network after deep downsampling. Then, the prediction results output by each layer of the convolutional network are spliced ​​to obtain the final prediction result.

[0046] Step 4: Analyze the error between the input data and the predicted data, calculate the error index and the accuracy index, analyze the model performance based on the input data and the predicted data, and calculate the performance index.

[0047] Step 5: After performance analysis, if the performance indicators of the model meet the requirements, the model should be used for short-term precipitation prediction. The model provided in this embodiment is used for precipitation prediction within 0-3 hours.

[0048] In this embodiment, the key information in the precipitation map is obtained through the RFA feature extraction module, and the attention mechanism is used to achieve better spatial attention, which can greatly improve the prediction accuracy.

[0049] Example 2

[0050] The difference between this embodiment and embodiment 1 is that Figure 2 As shown, in step 2, the convolutional network model of the constructed small attention mechanism is provided with 4 layers of convolutional networks, and the deep feature extraction module of each layer of convolutional network extracts features, and the extracted features are jump-connected to the decoder, and the features are connected to the secondary deep feature extraction module through downsampling. Finally, the accurate precipitation value is output through 1x1 convolution.

[0051] In a further configuration of this embodiment, when training the convolutional network model of the small attention mechanism, a smooth L1 function is used as the loss function, and its calculation method is as follows.

[0052]

[0053] In this embodiment, the experiments in this embodiment are all carried out under the Pytorch deep learning framework. The Pytorch version is 2.0.1, and an NVIDIA 3090 GPU is used for training. The num-workers parameter is set to 32. The weight decay is set to 0.0004. The number of training rounds is set to 200, and a warm-up strategy is used in the first 5 rounds to make the training process more stable. The learning rate is set to 0.1, and the learning rate is adjusted according to the performance changes of the model after every 10 rounds. If the model performance is not significantly optimized, it is adjusted, and normal optimization is not adjusted. Early is set to 15. If the model performance does not change significantly within 15 rounds, it is considered that the model performance has reached the optimal level and training is stopped.

[0054] Further, such as Figure 3 As shown, the deep feature extraction module includes parallel channel space attention, channel space reconstruction convolution, and deep downsampling modules.

[0055] Step 3: Input the processed radar precipitation map into the convolutional network model based on the small attention mechanism to obtain the corresponding prediction results.

[0056] Among them, the deep feature extraction module extracts features in the following way:

[0057]

[0058] Among them, F c is the extracted feature; A is the input data; α is the learnable parameter.

[0059] The definition of Q is as follows:

[0060]

[0061] in is the reconstructed spatial channel convolution used by the feature extraction module; φ is the parallel channel spatial attention used by the feature extraction module; Sig is the Sigmoid activation function used. When the feature F is obtained c Afterwards, it is input into the decoder through one branch and into the secondary feature extraction module through the downsampling module through the other branch.

[0062] Specifically, Figure 4 As shown, the parallel channel spatial attention module structure has a main structure divided into a left spatial attention module and a right channel attention module, and the two are carried out in parallel and synchronously.

[0063] The specific operation method in the channel theme is: input X∈R B×C×H×W Input to the spatial attention module, the input passes through the maximum pooling layer and the average pooling layer to generate X′∈R B×1×H×W , X″∈R B×1×H×W , add the two together through the Concat function and input them into the multi-layer perceptron to obtain their relationship.

[0064] The specific operation mode of the spatial attention is: input X∈R B×C×H×W After vertical one-dimensional pooling and horizontal one-dimensional pooling, Y′∈R is generated respectively B×C×1×W ,Y″∈R B×C×H×1 , the two are aggregated through the Concat function and input into the batch normalization layer.

[0065] The results obtained from the channel attention module and the spatial attention module are aggregated through the Concat function and input into the multi-layer perceptron to obtain the relationship between them, and the two are separated through the Split function. Finally, the weight values ​​of the two are obtained through the Sigmoid activation function, and the input features are acted on through matrix multiplication.

[0066] Step 4: Use MSE, RMSE, and Accuracy as evaluation indicators. The calculation methods of the three are shown in (1.2)(1.3)(1.4):

[0067]

[0068]

[0069]

[0070] Where n is the total number of input data; y i Enter data for the current time; is the predicted value of the current input; TP is the true positive example, which is the number of positive samples correctly predicted as positive by the model; TN is the true negative example, which is the number of negative samples correctly predicted as negative by the model; FP is the false positive example, which refers to the number of negative samples incorrectly predicted as positive by the model; FN is the false negative example, which refers to the number of positive samples incorrectly predicted as negative by the model.

[0071] The following are the specific experiments and instructions added:

[0072] This example is compared with several advanced models on the same dataset, and the results are shown in Table 1.

[0073] Table 1: Comparison with advanced methods on the same dataset

[0074]

[0075] Among them, MSE and RMSE are error indicators, the lower the model error, the smaller the model error; ACC is the accuracy index, the higher the model accuracy, the higher the model accuracy; CSI is the model performance evaluation index, the higher the model performance, the better. As shown in Table 1, the model provided in this embodiment has achieved the most advanced results in almost all benchmark tests.

[0076] Example 3

[0077] This embodiment also provides an application of a short-term precipitation prediction method based on a convolutional network with a small attention mechanism, which obtains a real-time radar precipitation map and performs data preprocessing. The preprocessed data is used as input, and the convolutional network model with a small attention mechanism provided in Example 1 or 2 is applied to predict precipitation conditions within 0-3 hours.

[0078] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments including components are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.

Claims

1. A short-term precipitation prediction method based on a convolutional network with a small attention mechanism, characterized in that: The steps include: Step 1: Obtain radar precipitation map data from previous years and perform data preprocessing and data enhancement as the input data X∈R of the model B×C×H×W , where B is the length of the precipitation map sequence; C is the image channel; H is the image length; W is the image width; Step 2: construct and train a convolutional network model of a small attention mechanism, wherein the convolutional network model of the small attention mechanism includes several layers of parallel convolutional networks, and each layer of the convolutional network includes a deep feature extraction module and a decoder; Step 3: Input the processed radar precipitation map into the convolutional network model based on the small attention mechanism. The features extracted by the deep feature extraction module in the upper convolutional network are jump-connected to the decoder, and then input into the deep feature extraction module in the lower convolutional network after deep downsampling. Then, the prediction results output by each layer of the convolutional network are spliced ​​to obtain the final prediction result. The deep feature extraction module extracts features in the following way: where F c is the extracted feature; A is the input data; α is the learnable parameter; The definition of Q is as follows: in is the reconstructed spatial channel convolution used by the feature extraction module; φ is the parallel channel spatial attention used by the feature extraction module; Sig is the Sigmoid activation function used; The parallel channel spatial attention module structure has a main structure consisting of a left spatial attention module and a right channel attention module, both of which are carried out in parallel and synchronously; The specific operation of the spatial attention is: input X∈R B×C×H×W Input to the spatial attention module, the input passes through the maximum pooling layer and the average pooling layer to generate X′∈R B×1×H×W , X″∈R B×1×H×W , add the two together through the Concat function and input them into the multi-layer perceptron to obtain their relationship; The specific operation mode of the channel attention is: input X∈R B×C×H×W After vertical one-dimensional pooling and horizontal one-dimensional pooling, Y′∈R is generated respectively B×C×1×W ,Y″∈R B×C×H×1 , aggregate the two through the Concat function and input them into the batch normalization layer; The results obtained by the channel attention module and the results obtained by the spatial attention module are aggregated by the Concat function and input into the multi-layer perceptron to obtain the relationship between them. The spatial attention results and the channel attention results are initially divided by the Split function. For the spatial attention results, the spatial attention weight is obtained by using the Sigmoid activation function. For the channel attention results, the Split segmentation function is used again to obtain the channel attention results in the compressed horizontal and vertical axis spatial directions, and then the Sigmoid activation function is used to obtain the channel attention weights of the two. Finally, the spatial attention weight and the channel attention weight in the compressed horizontal and vertical axis directions are applied to the input features by matrix multiplication. Step 4: Analyze the error between the input data and the predicted data, calculate the error index and the accuracy index, analyze the model performance based on the input data and the predicted data, and calculate the performance index.

2. According to claim 1, a short-term precipitation prediction method based on a convolutional network with a small attention mechanism is characterized in that: The data preprocessing method is: cropping the center of the precipitation map originally with a size of 765x760 to a size of 256x256, and dividing the original data set into a sequence of 30 images.

3. The short-term precipitation prediction method based on a convolutional network with a small attention mechanism according to claim 1 is characterized in that: In step 1, data enhancement is performed by rotating the image and adding Gaussian noise of random intensity.

4. The short-term precipitation prediction method based on a convolutional network with a small attention mechanism according to claim 1 is characterized in that: The convolutional network model of the small attention mechanism is set with a 4-layer convolutional network.

5. The short-term precipitation prediction method based on a convolutional network with a small attention mechanism according to claim 1 is characterized in that: When training the convolutional network model of the small attention mechanism, a smooth L1 function is used as the loss function, which is calculated as follows 。 6. The short-term precipitation prediction method based on a convolutional network with a small attention mechanism according to claim 1, characterized in that: In step 4, MSE, RMSE and Accuracy are used as evaluation indicators.

7. An application of a short-term precipitation prediction method based on a convolutional network with a small attention mechanism, characterized in that: Obtain a real-time radar precipitation map and perform data preprocessing, and use it as input to apply the convolutional network model of the small attention mechanism described in any one of claims 1-6 to predict the precipitation within 0-3 hours.