Rainfall prediction method based on mixed attention mechanism driven model
By introducing a hybrid attention mechanism into the precipitation forecast model, combining self-attention and local attention mechanism, the information loss and redundant calculation problems of traditional models when processing radar echo data is solved, achieving higher precipitation forecast accuracy and efficiency.
Patent Information
- Application Number
- CN202411830225.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When traditional spatiotemporal prediction models process radar echo data, it is difficult to capture the global temporal change characteristics and local stability characteristics in the data at the same time, resulting in information loss, redundant calculation and other problems, which in turn limits the accuracy and efficiency of precipitation forecasts.
Using a model driven by a hybrid attention mechanism, the SA-MIMN module and the LA-MIMS module are constructed by introducing a self-attention mechanism and a local attention mechanism, and combining the spatiotemporal LSTM model, the spatiotemporal changes in radar echo data are effectively captured.
This method can adaptively adjust the weights of different time steps and spatial positions, accurately extract the characteristics of time change, and focus on the characteristic relationships of local areas, improve the accuracy and stability of precipitation forecasts and reduce the computational complexity.
Smart Images

Figure CN119782778A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of precipitation prediction technology, and in particular to a precipitation prediction method based on a hybrid attention mechanism driven model. Background Art
[0002] Weather forecasting, as an important part of meteorology, has immeasurable value for human production, life and natural disaster prevention. With the intensification of global climate change, the frequency and intensity of extreme weather events are increasing, posing severe challenges to human society and the natural environment. Accurate and timely precipitation forecasting has become the key to ensuring public safety and reducing disaster losses.
[0003] The researchers proposed that precipitation forecasting is a spatiotemporal sequence prediction problem. In the spatial dimension, a fixed-size spatial region is represented by a grid point, and each cell in the grid has a measurement value that changes over time, that is, the observation results at any time can be represented by a tensor. On this basis, the model can be used to predict the most likely sequence in the future through previous observation data.
[0004] At present, radar echo data is an important data source for precipitation forecasting. Its dynamic changes and spatial distribution characteristics contain rich precipitation information and spatiotemporal variation characteristics, including temporal variation characteristics and stability characteristics. These characteristics place extremely high demands on the performance of precipitation forecasting models. On the one hand, the temporal variation characteristics require the model to capture the long-term dependence and dynamic variation trends in the data in order to accurately predict future weather; on the other hand, the stability characteristics focus on the accurate characterization of local spatial structure and temporal continuity, which is crucial to improving the accuracy and reliability of forecasts.
[0005] However, traditional spatiotemporal prediction models often find it difficult to simultaneously meet these two requirements when processing radar echo data. In addition, existing models often face problems such as information loss and redundant calculations when processing global temporal variation features and local stable features, making it difficult to improve prediction performance. Therefore, it is necessary to provide a prediction model driven by a hybrid attention mechanism that can effectively capture the spatiotemporal variation features in radar echo data and improve the accuracy and efficiency of prediction. Summary of the invention
[0006] The purpose of the present invention is to provide a precipitation prediction method based on a hybrid attention mechanism driven model, which can effectively capture the spatiotemporal variation characteristics in radar echo data.
[0007] To achieve the above object, the present invention provides a precipitation prediction method based on a hybrid attention mechanism driven model, comprising:
[0008] Firstly, based on the MIM model, the self-attention mechanism and the local attention mechanism are introduced to construct the SA-MIMN module and the LA-MIMS module respectively, and a hybrid attention mechanism driven model is established;
[0009] Next, the spatiotemporal LSTM model is used to preliminarily obtain the initial hidden state of the observed precipitation sequence and use it as the input of the SA-MIMN module. After being processed by the self-attention mechanism, the gate control mechanism is used to transfer and update information to obtain the temporal variation characteristics of the differential features.
[0010] Then, the LA-MIMS module is used to perform local attention calculations on the cell state to obtain the corresponding local attention features. The information is then transmitted and updated through the gating mechanism to obtain the stationary features of the observed precipitation sequence, and then the predicted precipitation sequence is obtained.
[0011] Preferably, the SA-MIMN module includes a self-attention mechanism and a MIMN module; wherein the self-attention mechanism is used to distinguish the importance of spatiotemporal information, and the MIMN module is used to learn the time-varying characteristics of the differential features.
[0012] Preferably, the processing through the self-attention mechanism includes: first, converting the hidden state into Query, Key and Value vectors; then calculating the attention score of each element in, and then obtaining the corresponding weight vector; then, weighted summing to obtain the self-attention feature, and fusing it with the original feature.
[0013] Preferably, the MIMN module takes the differential features of the hidden features after processing by the self-attention mechanism as input and learns its time-varying features through the gate control mechanism.
[0014] Preferably, in the SA-MIMN module, information transmission and updating are performed through a gating mechanism, and the expression is as follows:
[0015]
[0016] In the formula, t represents the time step, l represents the number of network layers, H represents the hidden state, represents the hidden state after the self-attention mechanism, N represents the storage unit moved horizontally in the time-varying module, D represents the learned differential features, and W x , W n is the fusion weight of the corresponding feature, SA represents the self-attention mechanism, σ represents the sigmoid activation function, * represents convolution, ⊙ represents the Hadamard product, i represents the input gate, f represents the forget gate, and o represents the output gate.
[0017] Preferably, in the LA-MIMS module, information is transmitted and updated through a gating mechanism, and the expression is as follows:
[0018]
[0019] In the formula, C represents the storage unit state, S represents the storage unit of the stationary feature, T represents the predicted precipitation spatiotemporal sequence, and W d , W c , W s They are the fusion weights of the corresponding features, and LA represents the local attention mechanism.
[0020] Therefore, the present invention adopts the above-mentioned precipitation prediction method based on the hybrid attention mechanism driven model, which has the following technical effects:
[0021] (1) The self-attention mechanism is introduced to enable the model to adaptively adjust the weights of different time steps and spatial positions, thereby extracting time-varying features more accurately.
[0022] (2) The local attention mechanism is introduced to enable the model to focus on the feature relationships in the local area, improve the ability to capture stable features, and reduce computational complexity.
[0023] (3) By combining the dual attention mechanism, the importance of time-varying features and stable features is effectively balanced, which not only improves the prediction ability of the model, but also enhances its stability and timeliness.
[0024] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a schematic diagram of a SA-MIMN module in an embodiment of a precipitation prediction method based on a hybrid attention mechanism driven model;
[0026] Figure 2 is a schematic diagram of a LA-MIMS module in an embodiment of a precipitation prediction method based on a hybrid attention mechanism driven model;
[0027] Figure 3 The present invention is a schematic diagram of the HAMIM model structure in an embodiment of a precipitation prediction method based on a hybrid attention mechanism driven model. DETAILED DESCRIPTION
[0028] The present invention can be explained in more detail by the following examples. The purpose of disclosing the present invention is to protect all changes and improvements within the scope of the present invention. The present invention is not limited to the following examples.
[0029] Since traditional models often suffer from information loss or redundant calculation when processing global temporal variation features and local stable features at the same time, thus limiting the prediction effect, the present invention provides a hybrid attention mechanism driven model HAMIM for the prediction of precipitation spatiotemporal features.
[0030] Among them, the hybrid attention mechanism driven model HAMIM mainly consists of two parts: SA-MIMN module and LA-MIMS module, which are used to process the time-varying features and stationary features contained in radar data respectively. The key to this structure is to provide the necessary hidden states to generate differential features to better facilitate non-stationary modeling.
[0031] In the SA-MIMN module, this embodiment simulates the time-varying characteristics through a series of cascaded memories, rather than the simple and saturated forget gate in the spatiotemporal LSTM. Figure 1 As shown in Figure 1, the SA-MIMN module includes a self-attention mechanism and a MIMN module. The MIMN module converts the hidden state corresponding to the time step t≠1 and the number of network layers l≠1 into and As input, differential features are generated to capture the time-varying features based on the difference between two consecutive hidden representations. For the first layer, there is no corresponding previous layer. In this embodiment, the hidden state generated by the corresponding time step of the spatiotemporal LSTM is used as input to generate the differential features of the first layer. Compared with directly differentiating the original image adjacent in time, differentiating the hidden states adjacent in time can more obviously capture the time-varying features, because the spatiotemporal changes in the local area have been encoded into the hidden state through the bottom spatiotemporal LSTM layer.
[0032] However, excessive differential operations may lead to the loss of overall information, especially when the number of differential operations is too many, important features in the original data may be lost, thus affecting the model's ability to capture time-varying features. In addition, the MIMN module mainly focuses on global time-varying features and may ignore local features and detail information in the sequence. This means that when faced with extremely complex or rapidly changing dynamic systems, it is impossible to quickly adapt to and accurately capture these changes, thus affecting the accuracy of the prediction. To this end, this embodiment introduces a self-attention mechanism, which calculates the attention score between each element in the input sequence and other elements, and obtains the local dependencies between the elements, so that the model can better retain and utilize local feature information while capturing global time-varying features.
[0033] The self-attention mechanism in the SA-MIMN module is used to distinguish the importance of spatiotemporal information in the hidden state. The self-attention mechanism first converts the hidden state into Query, Key, and Value vectors through linear transformation, calculates the similarity score between each element and other elements, and then obtains the weight vector through the softmax function, and obtains the self-attention feature by weighted summation; then, the self-attention feature is fused with the original feature, and the transmission and update of information is controlled through the gating mechanism. The specific formula is as follows:
[0034]
[0035] In the formula, H represents the hidden state, which contains the dynamic change information learned by the model; D represents the time-varying characteristics of the differential feature, and W x , W n is the fusion weight of the corresponding feature; N represents the storage unit that moves horizontally in the time-varying module, which stores the information of the time-varying feature; SA represents the self-attention mechanism, σ represents the sigmoid activation function; * represents convolution, ⊙ represents the Hadamard product; i t is the input gate, which determines how much information in the hidden state and spatiotemporal memory state will be written into the memory unit in the network; t The forget gate controls the degree of forgetting of information in the memory unit to ensure that the model can adapt to the dynamic changes in the radar echo map; t The output gate is responsible for deciding how much information in the memory cell will be output to the next layer of the network or as the final prediction.
[0036] The self-attention mechanism can directly calculate the relationship between any two elements in the sequence. It is not limited by the length of the sequence, which helps the model maintain high prediction accuracy and adaptability when facing complex or rapidly changing dynamic systems, reduces the fluctuation range of prediction errors, and makes the prediction results more stable and reliable.
[0037] On the other hand, in order to make the model pay more attention to the feature changes in the local area, this embodiment introduces a local attention mechanism based on the MIMS module to process the stable features of the precipitation sequence. This can effectively capture low-order time-varying features such as spatial correlation and time dependence of pixel values, and the local attention mechanism only focuses on the local area of the input sequence, with less calculation, which helps to reduce the computational cost of the model and improve the computational efficiency of the model. In addition, the local attention mechanism can also automatically adjust the size of the local area of concern according to the different input data, which makes the model more flexible in processing stable features at different spatial scales.
[0038] like Figure 2As shown in the figure, using the LA-MIMS module, the storage unit state C is first filled, and then the local attention weight is used to calculate the local attention to obtain the local attention feature; then, it is fused with the original feature, and the transmission and update of information is controlled by the gating mechanism. The specific formula is as follows:
[0039]
[0040] Where C represents the storage unit state, which is used to store the long-term state; S represents the storage unit that moves horizontally in the stationary module; T represents the storage unit output by the LA-MIMS module, which contains the predicted precipitation spatiotemporal series; W d , W c , W s They are the fusion weights of the corresponding features, and LA represents the local attention mechanism.
[0041] Introducing the local attention mechanism in the LA-MIMS module helps capture smooth changes in the data. By focusing on local features, it can reduce the impact of noise and interference on the prediction results, thereby improving the accuracy and stability of the prediction.
[0042] The SA-MIMN module and the LA-MIMS module are combined to form a hybrid attention mechanism driven model HAMIM, such as Figure 3 As shown in the figure. The HAMIM model uses a dual attention mechanism of self-attention mechanism and local attention mechanism, which can more effectively balance the importance of time-varying features and stable features. In addition, by stacking multiple HAMIM modules, higher-order time-varying features can be captured, making the spatiotemporal process gradually stable and future sequences more predictable.
[0043] Therefore, the present invention adopts the above-mentioned precipitation prediction method based on the hybrid attention mechanism driven model to predict the spatiotemporal variation characteristics of the precipitation sequence, effectively balance the importance of time variation characteristics and stable characteristics, and improve the accuracy, stability and timeliness of the prediction.
[0044] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. A precipitation prediction method based on a hybrid attention mechanism driven model, characterized in that: include: Firstly, based on the MIM model, the self-attention mechanism and the local attention mechanism are introduced to construct the SA-MIMN module and the LA-MIMS module respectively, and a hybrid attention mechanism driven model is established; Next, the spatiotemporal LSTM model is used to preliminarily obtain the initial hidden state of the observed precipitation sequence and use it as the input of the SA-MIMN module. After being processed by the self-attention mechanism, the gate control mechanism is used to transfer and update information to obtain the temporal variation characteristics of the differential features. Then, the LA-MIMS module is used to perform local attention calculations on the cell state to obtain the corresponding local attention features. The information is then transmitted and updated through the gating mechanism to obtain the stationary features of the observed precipitation sequence, and then the predicted precipitation sequence is obtained.
2. A precipitation prediction method based on a hybrid attention mechanism driven model according to claim 1, characterized in that: The SA-MIMN module includes a self-attention mechanism and a MIMN module; the self-attention mechanism is used to distinguish the importance of spatiotemporal information, and the MIMN module is used to learn the temporal variation characteristics of differential features.
3. According to claim 1, a precipitation prediction method based on a hybrid attention mechanism driven model is characterized in that: The processing through the self-attention mechanism includes: first, converting the hidden state into Query, Key and Value vectors; then calculating the attention score of each element in order to obtain the corresponding weight vector; then, weighted summing is performed to obtain the self-attention feature and merging it with the original feature.
4. The precipitation prediction method based on a hybrid attention mechanism driven model according to claim 2, characterized in that: The MIMN module takes the differential features of the hidden features after processing by the self-attention mechanism as input and learns its time-varying features through the gate control mechanism.
5. The precipitation prediction method based on a hybrid attention mechanism driven model according to claim 1, characterized in that: In the SA-MIMN module, information is transmitted and updated through a gating mechanism, and the expression is as follows: In the formula, t represents the time step, l represents the number of network layers, H represents the hidden state, represents the hidden state after the self-attention mechanism, N represents the storage unit moved horizontally in the time-varying module, D represents the learned differential features, and W x , W n is the fusion weight of the corresponding feature, SA represents the self-attention mechanism, σ represents the sigmoid activation function, * represents convolution, ⊙ represents the Hadamard product, i represents the input gate, f represents the forget gate, and o represents the output gate.
6. The precipitation prediction method based on a hybrid attention mechanism driven model according to claim 1, characterized in that: In the LA-MIMS module, information is transmitted and updated through a gating mechanism, and the expression is as follows: In the formula, C represents the storage unit state, S represents the storage unit of the stationary feature, T represents the predicted precipitation spatiotemporal sequence, and W d , W c , W s They are the fusion weights of the corresponding features, and LA represents the local attention mechanism.