Lightning early warning method and system of attention mechanism long-short term memory model
Through the attention mechanism long-short-term memory model, the temporal change information in meteorological data is extracted and integrated, which solves the problem that traditional lightning warning methods cannot adapt to the complexity of lightning activities, achieves lightning warning with high accuracy and advance time, and improves radar System security and efficiency.
Patent Information
- Application Number
- CN202410738983.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-27
AI Technical Summary
Traditional lightning early warning methods rely on empirical rules and statistical models, which cannot effectively adapt to the complexity and rapid changes of lightning activities, resulting in insufficient early warning accuracy and lead time, affecting the safety and efficiency of radar systems.
The attention mechanism long-short-term memory model is used to obtain and preprocess meteorological data, use the CNN network to extract feature sequences, and combine the multi-layer LSTM network and the attention mechanism layer to calculate the time series change information and similarity, and integrate them into atmospheric electric field value features. vectors, predictions are made, and the classification of lightning warnings is evaluated through wavelet transform.
The early warning accuracy of the lightning monitoring and early warning platform has been improved to about 97%, and the early warning time has been advanced by about 30 minutes. It has solved the comprehensive use time shortage of radar system and ancillary equipment status management and control, protection resource management and control, intelligence user information interaction and command decision-making of higher-level command organizations. problem.
Smart Images

Figure CN118709720A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of lightning warning, and more specifically, relates to a lightning warning method and system of an attention mechanism long short-term memory model. Background Art
[0002] Radar equipment often contains sensitive electronic components that are vulnerable to direct strikes or electromagnetic pulses (EMP) from lightning. Lightning warning can reduce the interference of lightning on radar operations, ensure that radar systems can continue to operate, and provide stable monitoring and data collection. This is especially important for critical areas such as meteorological monitoring. Lightning activity may cause interference to radar signals and affect the accuracy of radar data. Warning systems can help operators predict and identify these interferences, take appropriate measures to correct or eliminate errors, and ensure data quality. By reducing the damage caused by lightning strikes, lightning warning systems can help save the cost of repairing and replacing equipment, and also reduce the time of operation interruption caused by equipment damage. Warning systems allow radar managers to make emergency plans in advance, such as setting automatic or manual protection procedures, so as to be fully prepared before lightning strikes. Decision makers at radar sites can make more reasonable scheduling and personnel arrangement decisions based on lightning warning information, and optimize resource allocation. Lightning is a deadly natural phenomenon. If radar operators and maintenance personnel encounter lightning outdoors, they may be in danger of their lives. Lightning warning systems can promptly notify personnel to enter safe areas to protect their lives. Lightning warning can provide an alarm before lightning occurs, so that operators have time to take measures to protect equipment, such as turning off the power supply, disconnecting key circuits or using lightning protection facilities, thereby reducing equipment damage caused by lightning strikes. In short, the lightning warning system is crucial to improving the overall safety, reliability and efficiency of radar positions. It helps to protect the safety of important facilities and personnel and ensure the smooth completion of key tasks.
[0003] Traditional lightning warning methods mostly rely on empirical rules and statistical models, but these methods often cannot adapt to the complexity and rapid changes of lightning activities. In recent years, the development of deep learning technology has provided new solutions for lightning warning. In particular, the long short-term memory model (LSTM) has been shown to have significant advantages in dealing with time series prediction problems. However, traditional LSTM still has limitations in capturing complex spatiotemporal relationships. Summary of the invention
[0004] In order to solve the above technical problems, the present invention proposes a lightning warning method based on an attention mechanism long short-term memory model, comprising:
[0005] Acquire meteorological data, pre-process the meteorological data to generate sample data, input the sample data into a CNN network, perform convolution, pooling and dimensionality reduction operations on the sample data, and extract a feature sequence of the sample data;
[0006] Input the feature sequence into a multi-layer LSTM network, obtain the time series change information of the feature sequence, input the time series change information into the attention mechanism layer, calculate the similarity between each element in the time series change information and other elements, and normalize the similarity into the attention weight;
[0007] Through the fully connected layer, the time series change information and the attention weight are integrated into a feature vector of the atmospheric electric field value of a fixed length, and output as a predicted atmospheric electric field value through the output layer.
[0008] Further, preprocessing the meteorological data includes:
[0009] The meteorological data is converted into a format of specified input data, wherein the format of the specified input data includes: batch size, time step number and feature dimension, wherein the feature dimension includes atmospheric electric field value, temperature, humidity, wind speed, wind direction, air pressure, precipitation, and monthly parameters, and the batch size is set to 1, and the time step number is recorded as t.
[0010] Furthermore, the fully connected layer uses ReLU as an activation function.
[0011] Furthermore, it also includes: performing wavelet transform on the predicted atmospheric electric field value, evaluating the singularity of the predicted atmospheric electric field value through the wavelet coefficients after wavelet transform, checking the distribution and amplitude of the wavelet coefficients, evaluating the density of the waveform, and completing the classification of lightning warnings according to the density.
[0012] Furthermore, the CNN network adopts one-dimensional convolution, and the convolution kernel performs convolution in a single time domain direction.
[0013] The present invention also proposes a lightning warning system based on an attention mechanism long short-term memory model, comprising:
[0014] A feature sequence extraction module is used to obtain meteorological data, pre-process the meteorological data, generate sample data, input the sample data into a CNN network, perform convolution, pooling and dimensionality reduction operations on the sample data, and extract a feature sequence of the sample data;
[0015] An attention weight calculation module is used to input the feature sequence into a multi-layer LSTM network, obtain the time series change information of the feature sequence, input the time series change information into an attention mechanism layer, calculate the similarity between each element in the time series change information and other elements, and normalize the similarity into an attention weight;
[0016] The prediction module is used to integrate the time series change information and the attention weight into a feature vector of the atmospheric electric field value of a fixed length through a fully connected layer, and output it as a predicted atmospheric electric field value through an output layer.
[0017] Further, preprocessing the meteorological data includes:
[0018] The meteorological data is converted into a format of specified input data, wherein the format of the specified input data includes: batch size, time step number and feature dimension, wherein the feature dimension includes atmospheric electric field value, temperature, humidity, wind speed, wind direction, air pressure, precipitation, and monthly parameters, and the batch size is set to 1, and the time step number is recorded as t.
[0019] Furthermore, the fully connected layer uses ReLU as an activation function.
[0020] Furthermore, it also includes: performing wavelet transform on the predicted atmospheric electric field value, evaluating the singularity of the predicted atmospheric electric field value through the wavelet coefficients after wavelet transform, checking the distribution and amplitude of the wavelet coefficients, evaluating the density of the waveform, and completing the classification of lightning warnings according to the density.
[0021] Furthermore, the CNN network adopts one-dimensional convolution, and the convolution kernel performs convolution in a single time domain direction.
[0022] Compared with the prior art, the above technical solution conceived by the present invention has the following beneficial effects:
[0023] By adopting the lightning warning method of the long-short-term memory model that integrates the attention mechanism, the lightning monitoring and warning platform has a warning accuracy of about 97% and a warning time of about 60 minutes, which is 22% higher than the original system warning accuracy and about 30 minutes earlier. The platform can expand the main control of the hinged radar system, report the protection plan and strategy of the integrated protection system, provide accurate lightning intensity levels, and provide sufficient time for the radar station command and control system to make special situation decisions and for the superior command organization to deploy regional radar intelligence resources to replenish the network. It solves the problem of insufficient time for the comprehensive use of radar system and auxiliary equipment status control (25 minutes), protection resource control (1 minute), intelligence user information interaction (5 minutes to guide aviation training), and superior command organization command decision-making (5 minutes). BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 is a flow chart of the method of embodiment 1 of the present invention;
[0025] Figure 2 is a system structure diagram of Embodiment 2 of the present invention;
[0026] Figure 3 Schematic diagram of the self-attention mechanism of embodiment 1 of the present invention;
[0027] Figure 4 This is a schematic diagram of the lightning warning algorithm principle of Example 1 of the present invention. DETAILED DESCRIPTION
[0028] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0029] The method provided by the present invention can be implemented in the following terminal environment, and the terminal may include one or more of the following components: a processor, a storage medium, and a display screen. The storage medium stores at least one instruction, and the instruction is loaded and executed by the processor to implement the method described in the following embodiment.
[0030] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire terminal, and executes various functions of the terminal and processes data by running or executing instructions, programs, code sets or instruction sets stored in the storage medium, and calling data stored in the storage medium.
[0031] The storage medium may include a random access memory (RAM) or a read-only memory (ROM). The storage medium may be used to store instructions, programs, codes, code sets or instructions.
[0032] The display is used to show the interactive cross-section of each application.
[0033] All subscripts in the formulas of the present invention are only used to distinguish parameters and have no actual meaning.
[0034] In addition, those skilled in the art can understand that the structure of the above terminal does not constitute a limitation on the terminal, and the terminal may include more or fewer components, or combine certain components, or arrange the components differently. For example, the terminal also includes components such as a radio frequency circuit, an input unit, a sensor, an audio circuit, and a power supply, which will not be described in detail here.
[0035] Example 1
[0036] The embodiment of the present invention provides a lightning warning method based on an attention mechanism long short-term memory model, comprising:
[0037] Step 101, obtaining meteorological data, and preprocessing the meteorological data to generate sample data, inputting the sample data into a CNN network, performing convolution, pooling and dimensionality reduction operations on the sample data, and extracting a feature sequence of the sample data;
[0038] Specifically, preprocessing the meteorological data includes:
[0039] The meteorological data is converted into a format of specified input data, wherein the format of the specified input data includes: batch size, time step number and feature dimension, wherein the feature dimension includes atmospheric electric field value, temperature, humidity, wind speed, wind direction, air pressure, precipitation, and monthly parameters, and the batch size is set to 1, and the time step number is recorded as t.
[0040] Specifically, the CNN network adopts one-dimensional convolution, and the convolution kernel performs convolution in a single time domain direction.
[0041] Step 102, input the feature sequence into a multi-layer LSTM network, obtain the time series change information of the feature sequence, input the time series change information into an attention mechanism layer, calculate the similarity between each element in the time series change information and other elements, and normalize the similarity into an attention weight;
[0042] Step 103, through the fully connected layer, the time series change information and the attention weight are integrated into a feature vector of the atmospheric electric field value of a fixed length, and output as a predicted atmospheric electric field value through the output layer.
[0043] Specifically, the fully connected layer uses ReLU as the activation function.
[0044] Specifically, it also includes: performing wavelet transform on the predicted atmospheric electric field value, evaluating the singularity of the predicted atmospheric electric field value through the wavelet coefficients after wavelet transform, checking the distribution and amplitude of the wavelet coefficients, evaluating the density of the waveform, and completing the classification of lightning warnings according to the density.
[0045] The following is a specific example of the present invention, as shown below:
[0046] This Attention-LSTM model is divided into 7 layers. The specific structure and principle are as follows Figure 1 and Figure 4 shown.
[0047] The entire lightning warning model execution process is divided into the following 7 stages:
[0048] (1) Input layer
[0049] The format of input data is specified (batch size, time step, feature dimension), where the feature dimension includes atmospheric electric field value, temperature, humidity, wind speed, wind direction, air pressure, precipitation, and monthly parameters, a total of eight dimensions of feature parameters. Set the batch size to 1, the time step to t, and the feature dimension to 8, then a sample can be represented as a real number sequence matrix R t×8 , remember x i For R t×8 The vector representation of the data at the i-th time step in .
[0050] (2) CNN (Convolutional Neural Network) layer:
[0051] The CNN layer can extract the spatial connection between different feature values in the data, thereby making up for the shortcoming that LSTM cannot capture the spatial component of the data. At the same time, the features it extracts are still temporal. Sample data enters the CNN layer and undergoes convolution, pooling, and dimensionality reduction operations in sequence. For sequence data, this design adopts one-dimensional convolution, and the convolution kernel performs convolution in a single time domain direction. The number of convolution kernels is r, and the size is set to k, then x i , i+k-1 is R 1×n The real number matrix from the i-th time step to the i+k-1-th time step in the weight matrix W1 is a k×n real number matrix. A feature extraction is performed on the sequence vector of each k time step to obtain a feature o i The calculation formula is as follows:
[0052]
[0053] Among them, f is a nonlinear activation function, and b1∈R is a bias. When a convolution kernel extracts a sample sequence data, a feature map o of (t-k+1)×1 shape will be obtained. The calculation formula is as follows:
[0054] o=[o1,o2,…,o t-k+1 ] T (2)
[0055] CNN has a total of r convolution kernels, so it will eventually get r feature maps. After convolution, the maximum pooling operation is performed with a pooling size of 2 and a sliding step of 2, resulting in r feature maps of the shape [(t-k+1) / 2]×1. The calculation formula is as follows:
[0056]
[0057] These r feature maps are the features extracted by the CNN layer. They are reduced in dimension into a real vector of length r*(t-k+1) / 2, which stores the spatial connection between different eigenvalues in the sample data and is then input into the attention layer for further processing.
[0058] (3) LSTM layer:
[0059] LSTM has a memory function and can extract the time series change information of the nonlinear data of atmospheric electric field and meteorological elements. It introduces input gate, forget gate, output gate, and also adds candidate state, cell state and hidden state. Cell state stores long-term memory, which can alleviate the gradient disappearance, and hidden state stores short-term memory. This model uses multiple layers of LSTM. The output of the previous LSTM layer is the input of the next layer, which is passed down layer by layer. The output of the last LSTM hidden layer will enter the fully connected layer for further processing.
[0060] (4) Attention mechanism layer:
[0061] For each element in the sequence, the self-attention mechanism calculates the similarity between it and other elements and normalizes these similarities into attention weights. Then, the output of the self-attention mechanism can be obtained by weighted summing each element with the corresponding attention weight. Figure 3 As shown, the specific implementation process is as follows:
[0062] ①Embedded operation
[0063] First, embed the input to get a new vector a 1 , a 2 , a 3 , a 4 , a 5 , a 6 , a 7 , a 8 .
[0064] ②q, k operation
[0065] After the embedding operation, a 1 , a 2 , a 3 , a 4 , a 5 , a 6 , a 7 , a 8 It will be used as the input data of the attention mechanism.
[0066] The first step is for each a 1 , a 2 , a 3 , a 4 , a 5 , a 6 , a 7 , a 8 Will be multiplied by three matrices, namely W q , W k, W v , "q", "k" and "v" represent "Query", "Key" and "Value" respectively; it should be noted that the matrix W q , W k , W v It is shared throughout the process; the formula is as follows:
[0067] q i =W q a i (4)
[0068] k i =W k a i (5)
[0069] v i =W v a i (6)
[0070] If you need to calculate a 1 and a 2 , a 3 , a 4 , a 5 , a 6 , a 7 , a 8 The relationship (or association) between 1 and k 2 , k 3 , k 4 , k 5 , k 6 , k 7 , k 8 Perform matching calculation, the calculation formula is as follows:
[0071]
[0072] Where d represents the matrix dimensions of q and k. In the self-attention mechanism, the dimensions of q and k are the same. The reason is that the dot product of q and k is large.
[0073] In the second step, after the dot product operation of q and k, we get α 1,1 , α 1,2 , ..., α 1,8 ; Then, perform a softmax operation on it to get α 1,1 , α 1,2 , ..., α 1,8 ; Then, perform a softmax operation on it to get
[0074] ③v operation
[0075] In the v operation, the q and k operations are used to obtain and v 1 , v 2 , ..., v 8 Multiply them separately, as shown in the figure below, and the calculation formula is as follows:
[0076]
[0077] Correspondingly, And so on.
[0078] (5) Fully connected layer:
[0079] The fully connected layer integrates the weight features of the LSTM output to form a fixed-length feature vector, and uses ReLU as the activation function to enhance the model's expressiveness, mapping the weight parameters with time series features output by LSTM to the final output (predicted atmospheric electric field value). The mathematical formula of its activation function ReLU is:
[0080] f(x)=max(0,x) (9)
[0081] If the input x is positive, the ReLU function will output x itself; if the input is negative, the output is 0.
[0082] (6) Output layer:
[0083] The output layer specifies the prediction time step and finally outputs the prediction result of the corresponding step.
[0084] (7) Lightning warning classification (wavelet transform time series feature extraction):
[0085] The 1-hour atmospheric electric field sequence data predicted by the model is used to extract the predicted atmospheric electric field characteristics by wavelet transform. The singularity of the wavelet coefficients after wavelet transform is examined, and the distribution and amplitude of the wavelet coefficients are checked to evaluate the density of the waveform. The specific classification of lightning warning is realized. Specifically, the mathematical formula of discrete wavelet transform is:
[0086] cA[j, k] = ∑ n x[n]·φ j,k[n] (10)
[0087] cD[j, k] = ∑ n x[n]·ψ j,k[n] (11)
[0088] where j is the scale parameter, k is the translation parameter, φ j,k[n] and ψ j,k[n]They are the discrete samples of the scale function and wavelet function obtained by scaling and translating, respectively; cA[j, k]: approximate coefficient of the low-frequency part; cD[j, k]: detail coefficient of the high-frequency part; n: sample number.
[0089] The following is the lightning warning algorithm model training process, as shown below:
[0090] The training basis of the lightning warning algorithm model comes from the long-term accumulated real atmospheric electric field historical data. At the same time, the calibration data comes from the lightning warning information released by the National Meteorological Information Center and the lightning warning information confirmed by humans on site.
[0091] The methods of the first 7 stages in the lightning warning strategy and algorithm principle described above are applied to preprocess more than 60 million atmospheric electric field and meteorological data in the historical database collected by us, and then 8 feature quantities of each data [atmospheric electric field, temperature, humidity, wind speed, wind direction, air pressure, precipitation, monthly parameters] are obtained as training and test data sets. 45 million data are used as training sets and 15 million data are used as test sets.
[0092] (1) Training samples and hardware environment preparation
[0093] The 45 million training data points and their corresponding atmospheric electric field data are labeled, that is, the training samples are processed into text labels in the form of [N, T, H, W]. N represents the timestamp number, T represents the time step, H represents the vector dimension, and W represents the specific feature vector matrix R. T×H This process greatly reduces the high demand for computer resources in the training process and the inference process, so that it can quickly implement the inference process and the training process in computer equipment with lower resources, while always maintaining a high-speed inference process when facing the future atmospheric electric field data collection with higher sampling rates.
[0094] The hardware environment preparation is shown in the following table:
[0095] Table 1 Model training hardware environment
[0096]
[0097] (2) Data reading and network training
[0098] The processed data in step (1) is used to construct a Dataset class, encapsulate the corresponding Dataloader for batch data iteration, and set batch_size to read the data into the computer memory in batches.
[0099] The model training file mainly includes the main function, model training parameter setting function, model training function, model verification function, etc. The main steps of model training are as follows.
[0100] ①Construct data_loader for training.
[0101] ② Get all the parameters of the model and set the optimizer required for training.
[0102] ③ Adjust the model to the training state and perform data training in a loop.
[0103] ④ Obtain the data content required for each training, pass it into the model, and obtain the loss result.
[0104] ⑤ Determine whether gradient accumulation is needed. If necessary, divide the loss value by the number of accumulated steps and return the loss.
[0105] ⑥ Use the optimizer to update model parameters.
[0106] ⑦After each Epoch, a validation set prediction is performed, the results include the validation set loss and the accuracy of the summary part, and the model is saved.
[0107] After each epoch of training is completed, the model needs to be verified, mainly to evaluate the effect of the model on other data to ensure the generalization ability of the model.
[0108] (3) Model testing - evaluating the model reasoning effect
[0109] The model weight file generated in step (2) is introduced into the model, and the model is configured to the test state. 15 million test set data are read into the memory in batches, and the evaluation accuracy output is set. If the prediction accuracy output after a test set is completed is less than 95%, it is necessary to return to step (2) and retrain by adjusting the training parameters until the evaluation accuracy reaches 95% or above, indicating that a weight model file with high accuracy has been obtained. The model can be deployed to the on-site reasoning computer, and then docked or integrated with the intelligent monitoring software platform. When the on-site real-time atmospheric electric field data is sent to the computer, after the preprocessing of the first 6 stages in the lightning warning strategy and algorithm principle, the obtained weight file is imported into the model for forward reasoning and wavelet transform to quickly obtain the lightning warning level.
[0110] Example 2
[0111] like Figure 2 As shown, the embodiment of the present invention also proposes a lightning warning system of an attention mechanism long short-term memory model, including:
[0112] A feature sequence extraction module is used to obtain meteorological data, pre-process the meteorological data, generate sample data, input the sample data into a CNN network, perform convolution, pooling and dimensionality reduction operations on the sample data, and extract a feature sequence of the sample data;
[0113] Specifically, preprocessing the meteorological data includes:
[0114] The meteorological data is converted into a format of specified input data, wherein the format of the specified input data includes: batch size, time step number and feature dimension, wherein the feature dimension includes atmospheric electric field value, temperature, humidity, wind speed, wind direction, air pressure, precipitation, and monthly parameters, and the batch size is set to 1, and the time step number is recorded as t.
[0115] Specifically, the CNN network adopts one-dimensional convolution, and the convolution kernel performs convolution in a single time domain direction.
[0116] An attention weight calculation module is used to input the feature sequence into a multi-layer LSTM network, obtain the time series change information of the feature sequence, input the time series change information into an attention mechanism layer, calculate the similarity between each element in the time series change information and other elements, and normalize the similarity into an attention weight;
[0117] The prediction module is used to integrate the time series change information and the attention weight into a feature vector of the atmospheric electric field value of a fixed length through a fully connected layer, and output it as a predicted atmospheric electric field value through an output layer.
[0118] Specifically, the fully connected layer uses ReLU as the activation function.
[0119] Specifically, it also includes: performing wavelet transform on the predicted atmospheric electric field value, evaluating the singularity of the predicted atmospheric electric field value through the wavelet coefficients after wavelet transform, checking the distribution and amplitude of the wavelet coefficients, evaluating the density of the waveform, and completing the classification of lightning warnings according to the density.
[0120] Example 3
[0121] An embodiment of the present invention also proposes a storage medium storing multiple instructions, wherein the instructions are used to implement the lightning warning method of the attention mechanism long short-term memory model.
[0122] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.
[0123] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: Step 101, acquiring meteorological data, and preprocessing the meteorological data to generate sample data, inputting the sample data into a CNN network, performing convolution, pooling and dimensionality reduction operations on the sample data, and extracting a feature sequence of the sample data;
[0124] Specifically, preprocessing the meteorological data includes:
[0125] The meteorological data is converted into a format of specified input data, wherein the format of the specified input data includes: batch size, time step number and feature dimension, wherein the feature dimension includes atmospheric electric field value, temperature, humidity, wind speed, wind direction, air pressure, precipitation, and monthly parameters, and the batch size is set to 1, and the time step number is recorded as t.
[0126] Specifically, the CNN network adopts one-dimensional convolution, and the convolution kernel performs convolution in a single time domain direction.
[0127] Step 102, input the feature sequence into a multi-layer LSTM network, obtain the time series change information of the feature sequence, input the time series change information into an attention mechanism layer, calculate the similarity between each element in the time series change information and other elements, and normalize the similarity into an attention weight;
[0128] Step 103, through the fully connected layer, the time series change information and the attention weight are integrated into a feature vector of the atmospheric electric field value of a fixed length, and output as a predicted atmospheric electric field value through the output layer.
[0129] Specifically, the fully connected layer uses ReLU as the activation function.
[0130] Specifically, it also includes: performing wavelet transform on the predicted atmospheric electric field value, evaluating the singularity of the predicted atmospheric electric field value through the wavelet coefficients after wavelet transform, checking the distribution and amplitude of the wavelet coefficients, evaluating the density of the waveform, and completing the classification of lightning warnings according to the density.
[0131] Example 4
[0132] An embodiment of the present invention also proposes an electronic device, including a processor and a storage medium connected to the processor, wherein the storage medium stores multiple instructions, and the instructions can be loaded and executed by the processor so that the processor can execute a lightning warning method based on a long short-term memory model of an attention mechanism.
[0133] Specifically, the electronic device of this embodiment may be a computer terminal, and the computer terminal may include: one or more processors, and a storage medium.
[0134] Among them, the storage medium can be used to store software programs and modules, such as a lightning warning method of a long short-term memory model of an attention mechanism in an embodiment of the present invention, and the corresponding program instructions / modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the storage medium, that is, realizing the above-mentioned lightning warning method of a long short-term memory model of an attention mechanism. The storage medium may include a high-speed random storage medium, and may also include a non-volatile storage medium, such as one or more magnetic storage systems, flash memory, or other non-volatile solid-state storage media. In some instances, the storage medium may further include a storage medium remotely arranged relative to the processor, and these remote storage media may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0135] The processor can call the information and application stored in the storage medium through the transmission system to execute the steps: Step 101, obtain meteorological data, pre-process the meteorological data, generate sample data, input the sample data into the CNN network, perform convolution, pooling and dimensionality reduction operations on the sample data, and extract the feature sequence of the sample data;
[0136] Specifically, preprocessing the meteorological data includes:
[0137] The meteorological data is converted into a format of specified input data, wherein the format of the specified input data includes: batch size, time step number and feature dimension, wherein the feature dimension includes atmospheric electric field value, temperature, humidity, wind speed, wind direction, air pressure, precipitation, and monthly parameters, and the batch size is set to 1, and the time step number is recorded as t.
[0138] Specifically, the CNN network adopts one-dimensional convolution, and the convolution kernel performs convolution in a single time domain direction.
[0139] Step 102, input the feature sequence into a multi-layer LSTM network, obtain the time series change information of the feature sequence, input the time series change information into an attention mechanism layer, calculate the similarity between each element in the time series change information and other elements, and normalize the similarity into an attention weight;
[0140] Step 103, through the fully connected layer, the time series change information and the attention weight are integrated into a feature vector of the atmospheric electric field value of a fixed length, and output as a predicted atmospheric electric field value through the output layer.
[0141] Specifically, the fully connected layer uses ReLU as the activation function.
[0142] Specifically, it also includes: performing wavelet transform on the predicted atmospheric electric field value, evaluating the singularity of the predicted atmospheric electric field value through the wavelet coefficients after wavelet transform, checking the distribution and amplitude of the wavelet coefficients, evaluating the density of the waveform, and completing the classification of lightning warnings according to the density.
[0143] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0144] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0145] In the several embodiments provided by the present invention, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the system embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0146] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0148] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only storage medium (ROM, Read-Only Memory), random access storage medium (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0149] Obviously, the above embodiments are merely examples for the purpose of clear explanation, and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the invention.
Claims
1. A lightning warning method based on an attention mechanism long short-term memory model, characterized in that: include: Acquire meteorological data, pre-process the meteorological data to generate sample data, input the sample data into a CNN network, perform convolution, pooling and dimensionality reduction operations on the sample data, and extract a feature sequence of the sample data; Input the feature sequence into a multi-layer LSTM network, obtain the time series change information of the feature sequence, input the time series change information into the attention mechanism layer, calculate the similarity between each element in the time series change information and other elements, and normalize the similarity into the attention weight; Through the fully connected layer, the time series change information and the attention weight are integrated into a feature vector of the atmospheric electric field value of a fixed length, and output as a predicted atmospheric electric field value through the output layer.
2. The lightning warning method of the attention mechanism long short-term memory model according to claim 1 is characterized in that: Preprocessing the meteorological data includes: The meteorological data is converted into a format of specified input data, wherein the format of the specified input data includes: batch size, time step number and feature dimension, wherein the feature dimension includes atmospheric electric field value, temperature, humidity, wind speed, wind direction, air pressure, precipitation, and monthly parameters, and the batch size is set to 1, and the time step number is recorded as t.
3. The lightning warning method of the attention mechanism long short-term memory model according to claim 1 is characterized in that: The fully connected layer uses ReLU as the activation function.
4. The lightning warning method of the attention mechanism long short-term memory model according to claim 1 is characterized in that: Also includes: The predicted atmospheric electric field value is subjected to wavelet transformation, the singularity of the predicted atmospheric electric field value is evaluated through the wavelet coefficients after wavelet transformation, the distribution and amplitude of the wavelet coefficients are checked, the density of the waveform is evaluated, and the lightning warning is graded according to the density.
5. The lightning warning method of the attention mechanism long short-term memory model according to claim 1, characterized in that: The CNN network adopts one-dimensional convolution, and the convolution kernel performs convolution in a single time domain direction.
6. A lightning warning system based on an attention mechanism long short-term memory model, characterized in that: include: A feature sequence extraction module is used to obtain meteorological data, pre-process the meteorological data, generate sample data, input the sample data into a CNN network, perform convolution, pooling and dimensionality reduction operations on the sample data, and extract a feature sequence of the sample data; An attention weight calculation module is used to input the feature sequence into a multi-layer LSTM network, obtain the time series change information of the feature sequence, input the time series change information into an attention mechanism layer, calculate the similarity between each element in the time series change information and other elements, and normalize the similarity into an attention weight; The prediction module is used to integrate the time series change information and the attention weight into a feature vector of the atmospheric electric field value of a fixed length through a fully connected layer, and output it as a predicted atmospheric electric field value through an output layer.
7. A lightning warning system based on an attention mechanism long short-term memory model as claimed in claim 6, characterized in that: Preprocessing the meteorological data includes: The meteorological data is converted into a format of specified input data, wherein the format of the specified input data includes: batch size, time step number and feature dimension, wherein the feature dimension includes atmospheric electric field value, temperature, humidity, wind speed, wind direction, air pressure, precipitation, and monthly parameters, and the batch size is set to 1, and the time step number is recorded as t.
8. A lightning warning system based on an attention mechanism long short-term memory model as claimed in claim 6, characterized in that: The fully connected layer uses ReLU as the activation function.
9. A lightning warning system based on an attention mechanism long short-term memory model as claimed in claim 6, characterized in that: Also includes: The predicted atmospheric electric field value is subjected to wavelet transformation, the singularity of the predicted atmospheric electric field value is evaluated through the wavelet coefficients after wavelet transformation, the distribution and amplitude of the wavelet coefficients are checked, the density of the waveform is evaluated, and the lightning warning is graded according to the density.
10. A lightning warning system based on an attention mechanism long short-term memory model as claimed in claim 6, characterized in that: The CNN network adopts one-dimensional convolution, and the convolution kernel performs convolution in a single time domain direction.
Citation Information
Cited By
Microclimate prediction method, system and equipment based on attention mechanism and medium
CN119669933A
Lightning approaching trend forecasting method and system
CN120610337A
Multivariable time sequence fire early warning method and edge terminal
CN121053727A
Multivariate time series fire warning method and edge terminal
CN121053727B
