A fusion attention residual bidirectional LSTM hail time series prediction method

CN122172200BActive Publication Date: 2026-09-04JIANGXI PROVINCIAL METEOROLOGICAL DATA CENT (JIANGXI PROVINCIAL METEOROLOGICAL ARCHIVES)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610645544.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-12
Publication Date
2026-09-04
Estimated Expiration
2046-05-12

AI Technical Summary

Technical Problem

[0005]基于此,本发明的目的是提供一种融合注意力残差双向LSTM冰雹时序预测方法,旨在解决现有技术中缺少一种精准、稳定的融合注意力残差双向LSTM冰雹时序预测方法的问题

Benefits of technology

[0018]本发明以冰雹发生前连续多帧雷达回波数据为基础,通过构建三维时序特征向量、双向长短期记忆网络时序编码结合注意力机制的特征融合方式,以及加权随机采样与Focal Loss 结合的模型训练策略完成冰雹发生概率预测,整个预测流程依托雷达回波时序数据的深度挖掘自主实现,特征提取与模型训练更贴合冰雹的时序演变规律,大幅提升了模型对冰雹时序特征的捕捉与关键信息的融合能力,实现了高精度、高鲁棒性的融合注意力残差双向LSTM冰雹时序预测。同时,该方法通过多维度的时序特征构建充分刻画冰雹演变的多尺度信号,借助注意力机制自适应聚焦冰雹预测的关键时序片段,结合针对性的模型训练策略解决样本失衡问题,能够针对性攻克现有技术中特征提取维度单一、时序信息捕捉僵化、关键信息融合能力不足,以及冰雹样本稀疏导致的模型漏报偏差等痛点,有效挖掘雷达回波数据中的时序演变规律,充分捕捉冰雹发生发展的时序上下文信息,显著降低冰雹预测的漏报率与误报率,提升冰雹短临预测的精准度与稳定性。因此,本发明解决了现有技术中缺少一种不依赖额外预测模型、成本低且效率高的融合注意力残差双向LSTM冰雹时序预测方法的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122172200B_ABST
    Figure CN122172200B_ABST
Patent Text Reader

Abstract

The application provides a fusion attention residual bidirectional LSTM hail time sequence prediction method, which first acquires radar echo data of multiple continuous frames before hail occurrence for pretreatment and construction of a three-dimensional time sequence feature vector; performs linear transformation and ReLU activation operation on the feature vector based on a preset prediction model to determine a high-dimensional feature, and performs forward and backward time sequence coding on the high-dimensional feature by using a bidirectional long short-term memory network to determine a hidden state sequence containing time sequence context information; calculates an attention weight of each time sequence frame based on the hidden state sequence, performs weighted summation on the hidden state sequence according to the attention weight to generate an attention context vector, and adds the attention context vector and a global mean vector in the time dimension of the hidden state sequence to obtain a fusion feature vector, so as to predict the probability of hail occurrence based on the fusion feature vector. The application solves the problem of lacking a precise and stable hail time sequence prediction method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hail prediction technology, and in particular to a time-series hail prediction method that integrates attention residual bidirectional LSTM. Background Technology

[0002] Hail, a sudden and destructive severe convective weather phenomenon, poses a serious threat to agriculture, transportation, infrastructure, and public safety. Accurate and timely forecasting of hail is a crucial aspect of meteorological disaster prevention and mitigation. Currently, short-term forecasts (0-2 hours) for severe convective weather such as hail mainly rely on real-time monitoring data from Doppler weather radar. Therefore, deeply mining and utilizing the temporal evolution information within radar observation data is the technological foundation for achieving accurate forecasting.

[0003] In recent years, artificial intelligence technologies, represented by deep learning, have provided new technical pathways for processing radar time-series data and uncovering the patterns of hail occurrence and development due to their powerful temporal pattern recognition and feature learning capabilities. Existing technical solutions mainly focus on feature engineering and model architecture, such as using recurrent neural networks (RNNs) and their improved long short-term memory networks (LSTMs) to capture the temporal dependence of echo evolution, or introducing attention mechanisms to enable the model to focus on key time segments.

[0004] However, these mainstream methods still face systemic challenges in achieving high-precision fusion-attention residual bidirectional LSTM hail time-series prediction. Specifically, feature extraction often relies on single-dimensional raw observations, making it difficult to comprehensively characterize the multi-scale signals of hail evolution; the model's mechanism for capturing time-series dependencies and fusing key information is relatively rigid, lacking adaptability to different development stages; and the mismatch between extremely sparse hail samples and conventional training strategies leads to severe underreporting bias in the model. Summary of the Invention

[0005] Based on this, the purpose of this invention is to provide a fusion attention residual bidirectional LSTM hail time series prediction method, aiming to solve the problem that there is a lack of an accurate and stable fusion attention residual bidirectional LSTM hail time series prediction method in the prior art.

[0006] A hail time series prediction method based on a fusion attention residual bidirectional LSTM according to an embodiment of the present invention includes: Multiple consecutive frames of radar echo data prior to the hailstorm were acquired for preprocessing and a three-dimensional temporal feature vector was constructed. Based on a preset prediction model, the feature vector is subjected to linear transformation and ReLU activation operation to determine high-dimensional features, and the high-dimensional features are then subjected to forward and backward temporal encoding using a bidirectional long short-term memory network to determine the hidden state sequence containing temporal context information. The attention weights of each time frame are calculated based on the hidden state sequence. The hidden state sequence is then weighted and summed according to the attention weights to generate an attention context vector. The attention context vector and the global mean vector of the hidden state sequence in the time dimension are added together to obtain a fusion feature vector. The probability of hail is then predicted based on the fusion feature vector. The preset prediction model is trained using a strategy that combines weighted random sampling with the Focal Loss loss function.

[0007] In addition, the hail time series prediction method based on the above embodiments of the present invention may also have the following additional technical features: Furthermore, the steps for constructing a three-dimensional temporal feature vector include: For each frame of data after preprocessing, its original feature value, the first-order difference feature value relative to the previous frame, and the cumulative feature value relative to the first frame are calculated synchronously. The original feature values, first-order difference feature values, and cumulative feature values ​​are concatenated to form the three-dimensional time-series feature vector.

[0008] Furthermore, the step of calculating the attention weights for each temporal frame based on the hidden state sequence includes: The hidden state sequence is linearly transformed by a weight matrix and a bias term and then activated by the tanh function. The activation result is multiplied by an attention vector to obtain the original attention score for each frame. The original attention scores are normalized using the Softmax function to obtain the attention weights for each time frame.

[0009] Furthermore, the weighted random sampling step includes calculating the sampling weight of positive samples and the sampling weight of negative samples based on the number of positive and negative hail samples, and performing probability sampling based on the sampling weight corresponding to the sample label. The expression for the Focal Loss function is as follows:

[0010] in, To predict the probability, when the object is a positive sample When the object is a negative sample , The category average coefficient, γ For focusing parameters.

[0011] Furthermore, the step of calculating the attention weights for each temporal frame is a multi-granularity attention calculation, which includes the following steps: Short-time granular attention calculation, medium-time granular attention calculation, and full-time granular attention calculation are performed in parallel to obtain the corresponding context vectors. The short-time granular attention calculation is based on the difference between the hidden states of adjacent frames, the medium-time granular attention calculation is based on the difference between the hidden states across multiple frames, and the full-time granular attention calculation is based on the original hidden states of each frame. Multiple context vectors are concatenated and fusion weights are generated through a learnable gating network. The multiple context vectors are then weighted and summed based on the fusion weights to generate the final attention context vector.

[0012] Furthermore, the step of adding the attention context vector and the global mean vector of the hidden state sequence in the time dimension includes: The attention context vector is concatenated with the global mean vector, and a gating scalar is generated based on the concatenation result. Based on the gating scalar, the attention context vector and the global mean vector are weighted and summed, and the calculation formula is as follows:

[0013] in, To fuse feature vectors, For gated scalars, For attention context vectors, This is the global mean vector.

[0014] Furthermore, the steps preceding the construction of the three-dimensional temporal feature vector include: The target physical parameters are calculated based on the radar echo data. The target physical parameters include at least one or more of the following: vertical liquid water content density, temporal variation index, and local spatial homogeneity characteristics. The original values, first-order difference values, and cumulative values ​​corresponding to the target physical parameters are constructed and incorporated into the three-dimensional temporal feature vector.

[0015] Another objective of this invention is to provide a fusion attention residual bidirectional LSTM hail time series prediction system for implementing the aforementioned fusion attention residual bidirectional LSTM hail time series prediction method, the system comprising: The data processing module is used to acquire radar echo data from multiple consecutive frames before the hailstorm to preprocess and construct a three-dimensional temporal feature vector. The vector processing module is used to perform linear transformation and ReLU activation operations on the feature vector based on a preset prediction model to determine high-dimensional features, and to use a bidirectional long short-term memory network to perform forward and backward temporal encoding on the high-dimensional features to determine the hidden state sequence containing temporal context information. The prediction module is used to calculate the attention weights of each time frame based on the hidden state sequence, to perform a weighted summation of the hidden state sequence according to the attention weights to generate an attention context vector, and to add the attention context vector and the global mean vector of the hidden state sequence in the time dimension to obtain a fusion feature vector, so as to predict the probability of hail occurrence based on the fusion feature vector. The preset prediction model is trained using a strategy that combines weighted random sampling with the Focal Loss loss function.

[0016] Another objective of this invention is to provide a storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned fusion attention residual bidirectional LSTM hail time series prediction method.

[0017] Another objective of this invention is to provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the above-described fusion attention residual bidirectional LSTM hail time series prediction method.

[0018] This invention uses continuous multi-frame radar echo data before hail occurs as a basis. It achieves hail probability prediction by constructing a three-dimensional temporal feature vector, a feature fusion method combining bidirectional long short-term memory network temporal coding and attention mechanism, and a model training strategy combining weighted random sampling and Focal Loss. The entire prediction process is autonomously realized through in-depth mining of radar echo temporal data. Feature extraction and model training are more in line with the temporal evolution of hail, which greatly improves the model's ability to capture hail temporal features and fuse key information. It achieves high-precision and highly robust fusion attention residual bidirectional LSTM hail temporal prediction. Meanwhile, this method constructs a multi-scale signal that fully characterizes hail evolution through multi-dimensional temporal features, adaptively focuses on key temporal segments for hail prediction using an attention mechanism, and addresses the sample imbalance problem with targeted model training strategies. It effectively overcomes the pain points of existing technologies, such as single-dimensional feature extraction, rigid temporal information capture, insufficient key information fusion capabilities, and model underreporting bias caused by sparse hail samples. It effectively mines the temporal evolution patterns in radar echo data, fully captures the temporal context information of hail occurrence and development, significantly reduces the underreporting and false alarm rates of hail prediction, and improves the accuracy and stability of short-term hail prediction. Therefore, this invention solves the problem of the lack of a low-cost and efficient fusion attention residual bidirectional LSTM hail temporal prediction method that does not rely on additional prediction models. Attached Figure Description

[0019] Figure 1 This is a flowchart of a hail time series prediction method fused with attention residual bidirectional LSTM in the first embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a fusion attention residual bidirectional LSTM hail time series prediction system according to the second embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of the electronic device in the third embodiment of the present invention; The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation

[0020] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0022] Example 1 Please see Figure 1 The figure shows a hail time series prediction method fused with attention residual bidirectional LSTM in the first embodiment of the present invention, the method specifically including steps S01-S03.

[0023] S01: Acquire radar echo data from multiple consecutive frames prior to the hailstorm for preprocessing and constructing a three-dimensional temporal feature vector.

[0024] In practice, radar grid point data for T consecutive frames (e.g., T=10 frames, corresponding to frames 16-25, with a 6-minute interval between each frame) prior to the hail event are acquired. This data includes at least two key parameters: Composite Reflectivity (CR) and Vertically Integrated Liquid (VIL). Invalid values ​​in the data are replaced with NaN, where NaN is a descriptor. For grid points containing NaN, bidirectional linear interpolation is used to fill them along the time dimension. Missing values ​​at the beginning or end of the sequence are filled using the global mean. The filled CR and VIL data are then Z-score standardized. The calculation formula is as follows: , where μ is the characteristic mean and σ is the characteristic standard deviation.

[0025] Specifically, for each frame of preprocessed data, its original feature value, first-order difference feature value relative to the previous frame, and cumulative feature value relative to the first frame are calculated synchronously. The original feature value, first-order difference feature value, and cumulative feature value are then concatenated to form the three-dimensional temporal feature vector. By constructing a multi-scale temporal feature system, the physical evolution signals before hail occurs are comprehensively captured, significantly improving the feature recognition accuracy of hail precursors.

[0026] In practice, a three-dimensional temporal feature system of "original features + differential features + cumulative features" is constructed based on the preprocessed CR and VIL original features.

[0027] First, extract the original CR and VIL values ​​for each frame to form the original feature matrix:

[0028] in, For the original characteristic moments, , The first t The combined reflectance of the frame and the value of vertical liquid water content.

[0029] Secondly, calculate the adjacent frames. CR , VIL Differential features capture short-term characteristics preceding hailstorms.

[0030]

[0031] in, Let be the combined reflectance difference feature value of the t-th frame. Let be the vertical liquid water content difference feature value of the t-th frame. , , The difference characteristic matrix is ​​represented as:

[0032] in, It is the difference characteristic matrix.

[0033] Because CR / VIL sometimes exhibits abrupt changes 6-12 minutes before hail occurs, the calculation of "first-order difference can directly capture the intensity of short-term abrupt changes" is highly consistent with the physical mechanism of strong convection. If second-order difference, wavelet transform, or other methods are used, radar noise will be amplified, leading to model training divergence. First-order difference has the optimal signal-to-noise ratio and can also compensate for the deficiency of LSTM in capturing short-term abrupt changes. Therefore, this scheme adopts first-order difference, forming a complementary relationship with LSTM, which is the key design of feature and model matching in this invention.

[0034] Then, using frame 11 as the baseline, the cumulative changes in CR and VIL relative to the baseline frame are calculated for each frame to characterize the long-term evolution trend. The formula is as follows:

[0035]

[0036] The cumulative feature matrix is ​​represented as:

[0037] in, The cumulative characteristic matrix, Let be the cumulative characteristic value of the combined reflectance of frame t. Let be the cumulative characteristic value of vertical liquid water content in frame t.

[0038] The use of a fixed baseline frame for accumulation, rather than a sliding frame, is because the 30 minutes before the hailstorm (frame 16) is a critical starting point for storm cell formation. A fixed baseline can depict the true long-term evolution trend, while a sliding frame would disrupt physical consistency. Furthermore, it ensures strict alignment with the model input time sequence, avoiding feature confusion caused by misalignment. Simultaneously, it forms a short-term and long-term dual structure with the preceding differential features, together constituting a dual-driven structure for the three-dimensional feature system.

[0039] Finally, the original features, difference features, and cumulative features are concatenated according to their dimensions to form the final four-dimensional time-series feature vector.

[0040]

[0041] in, It is a four-dimensional temporal feature vector.

[0042] The final input feature dimension is 5 frames × 4-dimensional features.

[0043] Furthermore, prior to constructing the three-dimensional temporal feature vector, the steps include: calculating target physical parameters based on the radar echo data, wherein the target physical parameters include at least one or more of the following: vertical liquid water content density, temporal variation index, and local spatial homogeneity characteristics; constructing the original values, first-order difference values, and cumulative values ​​corresponding to the target physical parameters, and incorporating them into the three-dimensional temporal feature vector. By calculating the meteorological prior physical parameters, constructing features based on the original values, first-order difference values, and cumulative values, and incorporating them into the three-dimensional temporal feature vector, the feature representation is more closely aligned with the physical mechanism of hail, significantly improving the model's ability to perceive and identify hail precursors.

[0044] In practical implementation, to incorporate prior meteorological knowledge and enhance the characterization ability of features, the calculation and fusion of target physical parameters are also included before constructing the basic three-dimensional feature vector: First, calculate the target's physical parameters: Vertical liquid water content density: .in, The storm top height is the height of the t-th frame (which can be estimated from radar volume scan data). To prevent small constants from being divided by zero, this parameter better reflects the liquid water concentration in the embryo growth zone.

[0045] The temporal change index calculates the second-order difference (acceleration) between CR and VIL to capture burst enhancements. The same calculation is performed on VIL. This index effectively highlights development inflection points, among which... Let be the second-order difference eigenvalue of the combined reflectance of the t-th frame.

[0046] Local spatial homogeneity characteristics: For each grid point, the standard deviation of the CR values ​​within its surrounding 3×3 neighborhood is calculated and used as LocalStdt. Strong updrafts in the core region exhibit large reflectivity gradients, resulting in a higher LocalStdt value.

[0047] Secondly, an extended feature vector is constructed by building three-dimensional features of the aforementioned target physical parameters according to the same rules of original values, first-order difference values, and cumulative values. Finally, the three-dimensional features of all parameters are concatenated along the feature dimension to form the final three-dimensional temporal feature vector.

[0048] S02, based on the preset prediction model, the feature vector is subjected to linear transformation and ReLU activation operation to determine high-dimensional features, and the high-dimensional features are subjected to forward and backward temporal encoding using a bidirectional long short-term memory network to determine the hidden state sequence containing temporal context information.

[0049] Specifically, the preset prediction model is trained using a strategy combining weighted random sampling and the Focal Loss loss function. The weighted random sampling step includes calculating the sampling weights for positive and negative samples based on the number of positive and negative hail samples, and then performing probability sampling based on the sampling weights corresponding to the sample labels. The expression for the Focal Loss loss function is:

[0050] in, To predict the probability, when the object is a positive sample When the object is a negative sample , The category average coefficient, γ To focus on the parameters, when selecting the loss function, considering that CE tends to over-penalize easily classified negative samples, causing the model to be biased towards the negative class, and that Dice Loss is unstable in single-label time series prediction, this invention adopts Focal Loss, which can simultaneously address imbalanced and hard samples. By allowing the model to automatically reduce the weight of easily distinguishable samples and focus on learning the faint patterns of hail precursors, a dual balance mechanism can be formed with weighted random sampling.

[0051] Additionally, the AdamW optimizer was selected during the training of the preset prediction model, with a learning rate of 0.0003 and a weight decay of 10. -5 The updated formula is:

[0052] in, For learning rate, , For momentum estimation, This is the weight decay coefficient. Minimum value (take) ), These are the current model parameters. Choosing the AdamW optimizer allows weight decay to be applied directly to the parameters, resulting in more stable regularization. If Adam is used, weight decay is subject to variable dilution, and deep LSTMs are prone to overfitting. Furthermore, this model contains additive attention, residual fusion, and multi-layer LSTMs, resulting in a large parameter scale. The SGD optimizer converges too slowly and is unsuitable for model training. Therefore, the AdamW optimizer is the only optimizer that balances convergence speed and generalization performance, and it perfectly matches the cosine annealing scheduling used subsequently in the model, allowing for periodic restarts of related strategies.

[0053] The learning rate scheduling uses a cosine annealing restart strategy, with the following formula:

[0054] The maximum learning rate is 0.0003, and the minimum learning rate is 10. -5 , For the training rounds in the current cycle, This is the initial restart cycle. Upon restarting, a new cycle begins, and its length changes. The new cycle length is the product of the old cycle length and the cycle doubling factor, which is set to 2. Since the number of hailstorm samples is relatively small, the model is prone to getting trapped in local optima. Therefore, a warm restart is chosen to periodically increase the learning rate and escape local optima. Step descent can also cause training oscillations; a cosine curve ensures smooth convergence, better matching the characteristics of hail prediction tasks.

[0055] In practice, the input feature vector F is passed through a fully connected layer (Linear) and then activated by the ReLU function, mapping it to a high-dimensional space. The formula is: ,in, High-dimensional feature representation, For matrix weights, For bias terms, Given the input three-dimensional temporal feature vector, the ReLU activation function formula is: This alleviates the gradient vanishing problem. Then, bidirectional LSTM timing encoding is used to further... Input a bidirectional LSTM network with L layers (e.g., L=3). Each BiLSTM layer processes the sequence and outputs hidden states. Dropout (e.g., p=0.3) can be applied between layers to prevent overfitting. Finally, the forward and backward hidden states output by the last BiLSTM layer are concatenated along the feature dimension to obtain a hidden state sequence containing complete contextual information. ,in , This represents the number of hidden units in a unidirectional LSTM.

[0056] S03, calculate the attention weights of each time frame based on the hidden state sequence, and perform a weighted summation of the hidden state sequence according to the attention weights to generate an attention context vector. Then, add the attention context vector and the global mean vector of the hidden state sequence in the time dimension to obtain a fusion feature vector, and predict the probability of hail occurrence based on the fusion feature vector.

[0057] Specifically, the hidden state sequence is linearly transformed by a weight matrix and a bias term and activated by the tanh function; the activated result is multiplied by an attention vector to obtain the original attention score for each frame; the original attention score is normalized by the Softmax function to obtain the attention weight for each time frame.

[0058] In practice, the calculation of basic attention weights and the steps for feature fusion are as follows: First, the attention score is calculated: the LSTM output features are mapped to a 1-dimensional attention score, as shown in the following formula:

[0059] in, Let be the original attention score for frame t. The weight matrix is... For bias terms, This is the attention vector. Additive attention is used here, not dot product or scaled dot product. The LSTM model output is 256-dimensional, and dot product attention requires... While using the same dimension limits flexibility, additive attention, which can freely map dimensions and adapt to hidden layer outputs, is the only feasible option for this architecture. Nonlinear transformations are provided to make the model more sensitive to the subtle features of hail precursor frames. Using other attention methods can easily disrupt unique matching and cause residual connections to fail, so additive attention is chosen.

[0060] Secondly, attention weights are normalized: the attention scores are converted into weights using the Softmax function, as shown in the following formula:

[0061] in, Let be the normalized attention weights for frame t. It is an exponential function.

[0062] Then, the attention context vector is generated: the hidden state sequence is weighted and summed using normalized attention weights to obtain the context vector.

[0063]

[0064] in, These are the aggregated features after attention weighting. Let be the hidden state of frame t. This represents the total number of frames in the input sequence.

[0065] Finally, the global mean vector of the hidden state sequence is calculated, and the attention context vector is added to the global mean vector to obtain the fused feature. The calculation formula is as follows:

[0066] in, As a feature of fusion, The global mean feature output by the LSTM is used. Residual connections preserve the original feature information through feature addition, improving model training stability. To prevent gradient vanishing and complement additive attention, this scheme uses mean fusion. Methods such as concatenation and gated fusion can easily destroy the mathematical properties of the residuals and alter their dimensions. Therefore, element-wise addition is the only structure that can guarantee stable gradient backpropagation. In addition, attention and mean are fused locally and globally through keyframe focusing and stable global information, which is more in line with the design of hail prediction structure.

[0067] Furthermore, the step of calculating the attention weights for each temporal frame is a multi-granularity attention computation, which includes: performing short-time granularity attention computation, medium-time granularity attention computation, and full-time granularity attention computation in parallel to obtain corresponding context vectors; wherein, the short-time granularity attention computation is based on the difference of the hidden states of adjacent frames, the medium-time granularity attention computation is based on the difference of the hidden states across multiple frames, and the full-time granularity attention computation is based on the original hidden states of each frame; the multiple context vectors are concatenated, and a fusion weight is generated through a learnable gating network; the multiple context vectors are then weighted and summed according to the fusion weight to generate the final attention context vector.

[0068] In practical implementation, to capture evolution patterns at different time scales and enhance the model's adaptability to hail processes at different development stages, the aforementioned step of calculating attention weights can employ multi-granularity attention computation to capture evolution patterns at different time scales. Specifically, in this method, three sets of attention calculations are performed in parallel: Short-term granularity: based on differences between adjacent frames Calculate attention, capture dramatic changes.

[0069] Mid-time granularity: based on cross-frame differences (For example, k=3) Calculate attention and capture trends.

[0070] Full-time granularity: based on the original hidden state Calculate attention. Among them, Let be the short-time granularity difference vector of the t-th frame. Let be the short-time granularity difference vector for frame t.

[0071] The three sets of calculations described above will each generate a corresponding context vector. Then, the context vectors calculated at the three granularities are concatenated and used to generate a fusion weight vector through a learnable gating network. And by weighted summation, the final attention context vector, which incorporates multi-scale information, is obtained. Here is the weight matrix of the gated network. is the bias vector of the gated network.

[0072] Furthermore, the attention context vector and the global mean vector are concatenated, and a gating scalar is generated based on the concatenation result. Then, a weighted sum is calculated based on the gating scalar, using the following formula:

[0073] in, To fuse feature vectors, For gated scalars, For attention context vectors, The global mean vector is used. By adaptively allocating weights through gating scalars, attention features capture local key information, while the global mean preserves global information. The residual structure stabilizes gradient backpropagation, thus fusing local key features with global stable features, mitigating gradient vanishing, and retaining complete feature information.

[0074] Example 2 Please see Figure 2 The diagram shown is a structural block diagram of a fusion attention residual bidirectional LSTM hail time series prediction system proposed in the second embodiment of the present invention. This fusion attention residual bidirectional LSTM hail time series prediction system 200 includes: a data processing module 21, a vector processing module 22, and a prediction module 23, wherein: Data processing module 21 is used to acquire radar echo data of multiple consecutive frames before the hail occurs for preprocessing and to construct a three-dimensional temporal feature vector; The vector processing module 22 is used to perform linear transformation and ReLU activation operations on the feature vector based on a preset prediction model to determine high-dimensional features, and to use a bidirectional long short-term memory network to perform forward and backward temporal encoding on the high-dimensional features to determine the hidden state sequence containing temporal context information. Prediction module 23 is used to calculate the attention weight of each time frame based on the hidden state sequence, to perform weighted summation on the hidden state sequence according to the attention weight, to generate an attention context vector, and to add the attention context vector and the global mean vector of the hidden state sequence in the time dimension to obtain a fusion feature vector, so as to predict the probability of hail occurrence based on the fusion feature vector. The preset prediction model is trained using a strategy that combines weighted random sampling with the Focal Loss loss function.

[0075] Example 3 In another aspect, the present invention also proposes an electronic device, please refer to [link to relevant documentation]. Figure 3 The diagram shows an electronic device according to the third embodiment of the present invention, including a memory 20, a processor 10, and a computer program 30 stored in the memory and executable on the processor. When the processor 10 executes the computer program 30, it implements the above-described fusion attention residual bidirectional LSTM hail time series prediction method.

[0076] In some embodiments, the processor 10 may be a central processing unit (CPU), controller, microcontroller, microprocessor or other data processing chip, used to run program code stored in memory 20 or process data, such as executing access restriction programs.

[0077] The memory 20 includes at least one type of readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 20 can be an internal storage unit of an electronic device, such as the hard disk of the electronic device. In other embodiments, the memory 20 can also be an external storage device of the electronic device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc. Furthermore, the memory 20 can include both internal and external storage units of the electronic device. The memory 20 can be used not only to store application software and various types of data of the electronic device, but also to temporarily store data that has been output or will be output.

[0078] It should be pointed out that, Figure 3 The structure shown does not constitute a limitation on the electronic device. In other embodiments, the electronic device may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0079] This invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described fusion attention residual bidirectional LSTM hail time series prediction method.

[0080] Those skilled in the art will understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0081] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0082] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0083] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0084] The above embodiments merely illustrate several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this patent should be determined by the appended claims.

Claims

1. A hail time series prediction method integrating attention residual bidirectional LSTM, characterized in that, The method includes: Multiple consecutive frames of radar echo data prior to the hailstorm were acquired for preprocessing and a three-dimensional temporal feature vector was constructed. Based on a preset prediction model, the feature vector is subjected to linear transformation and ReLU activation operation to determine high-dimensional features, and the high-dimensional features are then subjected to forward and backward temporal encoding using a bidirectional long short-term memory network to determine the hidden state sequence containing temporal context information. The attention weights of each time frame are calculated based on the hidden state sequence. The hidden state sequence is then weighted and summed according to the attention weights to generate an attention context vector. The attention context vector and the global mean vector of the hidden state sequence in the time dimension are added to obtain a fusion feature vector. The probability of hail is then predicted based on the fusion feature vector. The preset prediction model is trained using a strategy that combines weighted random sampling and Focal Loss loss function. The steps for constructing a three-dimensional temporal feature vector include: For each frame of data after preprocessing, its original feature value, the first-order difference feature value relative to the previous frame, and the cumulative feature value relative to the first frame are calculated synchronously. The original feature values, first-order difference feature values, and cumulative feature values ​​are concatenated to form the three-dimensional time-series feature vector; The process of calculating the attention weights for each temporal frame is a multi-granularity attention computation, which includes the following steps: Short-time granular attention calculation, medium-time granular attention calculation, and full-time granular attention calculation are performed in parallel to obtain the corresponding context vectors. The short-time granular attention calculation is based on the difference between the hidden states of adjacent frames, the medium-time granular attention calculation is based on the difference between the hidden states across multiple frames, and the full-time granular attention calculation is based on the original hidden states of each frame. Multiple context vectors are concatenated and fusion weights are generated through a learnable gating network. The multiple context vectors are then weighted and summed based on the fusion weights to generate the final attention context vector. The step of adding the attention context vector and the global mean vector of the hidden state sequence in the time dimension includes concatenating the attention context vector with the global mean vector.

2. The hail time series prediction method fused with attention residual bidirectional LSTM according to claim 1, characterized in that, The steps for calculating the attention weights for each temporal frame based on the hidden state sequence include: The hidden state sequence is linearly transformed by a weight matrix and a bias term and then activated by the tanh function. The activation result is multiplied by an attention vector to obtain the original attention score for each frame. The original attention scores are normalized using the Softmax function to obtain the attention weights for each time frame.

3. The hail time series prediction method fused with attention residual bidirectional LSTM according to claim 1, characterized in that, The weighted random sampling steps include calculating the sampling weights of positive and negative samples based on the number of positive and negative hail samples, and performing probability sampling based on the sampling weights corresponding to the sample labels. The expression for the Focal Loss function is as follows: in, To predict the probability, when the object is a positive sample When the object is a negative sample , The category average coefficient, γ To focus parameters, These are the original predicted values.

4. The hail time series prediction method fused with attention residual bidirectional LSTM according to claim 1, characterized in that, The step of adding the attention context vector and the global mean vector of the hidden state sequence in the time dimension includes: The attention context vector is concatenated with the global mean vector, and a gating scalar is generated based on the concatenation result. Based on the gating scalar, the attention context vector and the global mean vector are weighted and summed, and the calculation formula is as follows: in, To fuse feature vectors, For gated scalars, For attention context vectors, This is the global mean vector.

5. The hail time series prediction method fused with attention residual bidirectional LSTM according to claim 1, characterized in that, The steps before constructing a 3D temporal feature vector include: The target physical parameters are calculated based on the radar echo data. The target physical parameters include at least one or more of the following: vertical liquid water content density, temporal variation index, and local spatial homogeneity characteristics. The original values, first-order difference values, and cumulative values ​​corresponding to the target physical parameters are constructed and incorporated into the three-dimensional temporal feature vector.

6. A hail time series prediction system integrating attention residual bidirectional LSTM, characterized in that, The system for implementing the fusion attention residual bidirectional LSTM hail time series prediction method according to any one of claims 1 to 5 includes: The data processing module is used to acquire radar echo data from multiple consecutive frames before the hailstorm to preprocess and construct a three-dimensional temporal feature vector. The vector processing module is used to perform linear transformation and ReLU activation operations on the feature vector based on a preset prediction model to determine high-dimensional features, and to use a bidirectional long short-term memory network to perform forward and backward temporal encoding on the high-dimensional features to determine the hidden state sequence containing temporal context information. The prediction module is used to calculate the attention weights of each time frame based on the hidden state sequence, to perform a weighted summation of the hidden state sequence according to the attention weights to generate an attention context vector, and to add the attention context vector and the global mean vector of the hidden state sequence in the time dimension to obtain a fusion feature vector, so as to predict the probability of hail occurrence based on the fusion feature vector. The preset prediction model is trained using a strategy that combines weighted random sampling with the Focal Loss loss function.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of a fusion attention residual bidirectional LSTM hail time series prediction method as described in any one of claims 1 to 5.

8. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a fusion attention residual bidirectional LSTM hail time series prediction method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Dam intelligent early warning method and system based on depth time sequence attention network

    CN120823468A

  • Plateau multi-source rainfall data fusion method and device based on deep bidirectional sequential network

    CN121786739A