A multi-task lightning early warning method, device and medium based on a sequence attention mechanism
Patent Information
- Application Number
- CN202611153211.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]然而,尽管深度学习模型在雷电预测领域取得了阶段性成果,但在实际业务化应用中,仍存在以下四个维度的技术缺陷:(1)时空依赖捕获的局限性,现有模型多采用标准CNN 或简单 LSTM,前者在提取空间特征时受限于固定感受野,后者在处理长序列时易出现梯度消失
本发明采用多任务学习(Multi-Task Learning,MTL)框架,利用共享的特征表征同时预测雷电的空间位置(回归任务)、时间概率(分类任务)和强度等级(多分类/分级任务)。通过引入序列注意力机制,模型能够根据输入的时序特征流,动态调整不同区域(空间维度)和不同时段(时间维度)的特征贡献度,确保系统对异常电荷积累区域的高度敏感性。
Smart Images

Figure CN123012765A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of lightning warning, and in particular to a multi-task lightning warning method, device, and medium based on a sequence attention mechanism. Background Technology
[0002] Lightning, as one of the most destructive phenomena in severe convective weather, exhibits extremely complex nonlinear dynamics in its occurrence and development, and is highly spatially limited while being remarkably sudden and short-lived in time. With the increasing demands of modern society for power infrastructure, air transport, and the protection of life and property, establishing high-precision short- and medium-term lightning warning systems has become a core research area at the intersection of meteorological science and artificial intelligence.
[0003] Early lightning warnings primarily relied on heuristic extrapolation techniques and traditional numerical weather prediction (NWP) models. Radar echo extrapolation methods, such as the cross-correlation method (COTREC) and optical flow methods, predict the probability of lightning occurrence within the next hour by tracking the movement vector of convective cells. However, these methods are essentially linear predictions based on image geometric transformations and cannot characterize the complex physical processes within convective cells, such as charge accumulation, convective activity, and breakdown discharge. Numerical weather prediction (NWP) models simulate atmospheric conditions by solving fluid dynamics and thermodynamic equations. While NWP models have irreplaceable advantages in describing large-scale atmospheric circulation, they often struggle to provide accurate lightning strike times and coordinates when dealing with localized lightning activity at the hundred-meter scale, limited by their grid resolution and simplified parameterization schemes. In recent years, the remarkable performance of deep learning technology in processing high-dimensional spatiotemporal data has prompted researchers to explore lightning forecasting models based on convolutional neural networks (CNNs), recurrent neural networks (RNNs), and their variants (such as LSTM and ConvLSTM). These models have significantly improved the accuracy of short-term forecasts by learning historical evolution patterns from radar reflectivity, satellite infrared cloud images, and lightning location data.
[0004] However, despite the progress made by deep learning models in lightning prediction, there are still technical defects in the following four dimensions in practical applications: (1) Limitations of spatiotemporal dependency capture. Most existing models use standard CNN or simple LSTM. The former is limited by a fixed receptive field when extracting spatial features, and the latter is prone to gradient vanishing when processing long sequences. This lack of representation ability makes it impossible for the model to effectively model the long-range spatiotemporal correlation in the dynamic evolution of thunderstorm clouds, and thus shows significant evolution lag or spatial positioning deviation in actual forecasts. (2) Lack of single-task prediction dimension. Most studies simplify lightning prediction to a binary classification task (whether there is lightning), ignoring the synchronous quantification of the precise location, probability of occurrence and intensity level of lightning strikes. This single information dimension is difficult to support the refined needs of differentiated and graded lightning protection early warning in fields such as power dispatching and precision instrument protection. (3) Static and non-adaptive nature of feature weights. Traditional models give the same weight to all regions and time steps in the feature extraction stage, without considering the differences in the contribution of meteorological variables to lightning triggering. Especially in extreme weather conditions with complex terrain or multiple cell convection, the model lacks the ability to adaptively focus on key "trigger cells," which can easily lead to missed or false alarms of sudden lightning events. (4) Model degradation and catastrophic forgetting: the existing offline training mode makes it difficult for the model to absorb the latest observation data after deployment, and it cannot cope with the seasonal model drift caused by climate change. The model performance degrades over time, and the computational cost of retraining the entire model is extremely high, which cannot meet the real-time requirements of meteorological operations. In addition, at the data fusion level, existing technologies often cannot achieve effective connection between short-term monitoring data (high frequency, local) and medium-term NWP products (low frequency, global), resulting in obvious performance gaps within the 30-minute to 12-hour forecast lead time window.
[0005] In summary, existing lightning warning technologies still face significant challenges in handling complex spatiotemporal nonlinear characteristics, multi-dimensional prediction requirements, real-time online model evolution, and deep fusion of multimodal data. Traditional physical models and static deep learning architectures often fail to balance forecast timeliness and accuracy, and are ill-equipped to handle dynamic data distribution shifts caused by seasonal or climatic changes. Summary of the Invention
[0006] The purpose of this invention is to construct a multi-task lightning early warning method, device, and medium based on a sequence attention mechanism. By introducing a sequence attention mechanism, the model can dynamically adjust the feature contribution of different regions (spatial dimension) and different time periods (temporal dimension) according to the input temporal feature flow, ensuring the system's high sensitivity to abnormal charge accumulation regions.
[0007] The objective of this invention can be achieved through the following technical solutions: A multi-task lightning early warning method based on sequence attention mechanism, the method includes the following steps: S1. Acquire multi-source meteorological data and perform alignment preprocessing; S2. Construct a shared feature encoder based on graph convolution and sequence attention mechanisms; S3. A multi-task independent head structure is adopted to construct three parallel decoding heads, including a spatial location regression head, an occurrence probability prediction head, and an intensity level classification head. A ternary hybrid loss function is set based on the output of the classification head. S4. Train the shared feature encoder and decoder head based on the ternary hybrid loss function, align the preprocessed data as the input of the model to obtain the lightning warning model, apply the lightning warning model to the actual lightning warning to obtain the warning result. In the actual lightning warning process, when the update cycle is reached, construct the samples in the buffer as an incremental training set, freeze the weights of the shared feature encoder, and update the weights of the three parallel decoders.
[0008] Furthermore, the shared feature encoder outputs shared features, which includes a spatial feature extraction layer and a sequence attention mechanism layer.
[0009] Furthermore, the spatial location regression head includes convolutional layers and fully connected layers, outputting a spatial location probability map of lightning occurrences.
[0010] Furthermore, the probability prediction head includes Softmax, which outputs the probability distribution of lightning occurrence within each future step.
[0011] Furthermore, the intensity level classification head includes a feature mapping layer that outputs the log probability of each lightning activity level.
[0012] Furthermore, the ternary mixture loss function is: ; in, Indicates positional loss. Indicates probability loss. Indicates strength loss. These are the learnable parameters for positional loss, probability loss, and intensity loss, respectively. This represents the ternary mixed loss function.
[0013] Furthermore, the updated weights of the three parallel decoders are: in For a smaller incremental learning rate, This represents the weights of the three parallel decoders. ∠ represents the ternary mixed loss function, and ▽ represents the change.
[0014] Furthermore, the method for updating the weights of the three parallel decoders is stochastic gradient descent.
[0015] In another aspect, the present invention proposes a multi-task lightning warning device based on a sequence attention mechanism, comprising a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the above-mentioned multi-task lightning warning method based on a sequence attention mechanism.
[0016] In another aspect, the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the above-described multi-task lightning warning method based on a sequence attention mechanism.
[0017] Compared with the prior art, the present invention has the following beneficial effects: This invention employs a multi-task learning (MTL) framework, utilizing shared feature representations to simultaneously predict the spatial location (regression task), temporal probability (classification task), and intensity level (multi-classification / hierarchical task) of lightning. By introducing a sequence attention mechanism, the model can dynamically adjust the feature contribution of different regions (spatial dimension) and different time periods (temporal dimension) based on the input temporal feature stream, ensuring the system's high sensitivity to areas of abnormal charge accumulation. Attached Figure Description
[0018] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0019] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0020] Example 1: This invention proposes a multi-task lightning early warning method based on sequence attention mechanism and incremental learning. The core logic of this scheme lies in constructing a deep learning system capable of dynamically sensing key spatiotemporal features, co-evolving across multiple dimensions of tasks, and possessing real-time online update capabilities.
[0021] This invention abandons the single-task prediction paradigm in model construction and adopts a multi-task learning (MTL) framework. It utilizes shared feature representations to simultaneously predict the spatial location (regression task), temporal probability (classification task), and intensity level (multi-classification / grading task) of lightning. By introducing a sequence attention mechanism, the model can dynamically adjust the feature contribution of different regions (spatial dimension) and different time periods (temporal dimension) based on the input temporal feature stream, ensuring the system's high sensitivity to areas of abnormal charge accumulation. Furthermore, to address the degradation problem in long-term model operation, this invention introduces an incremental learning mechanism based on a sliding time window. This mechanism allows the model to fine-tune and optimize parameters by fusing the latest lightning monitoring data without touching the entire old dataset, thereby achieving online maintenance of predictive performance.
[0022] This invention includes the following steps: Step 1) In this invention, multimodal spatiotemporal data acquisition and alignment preprocessing are the foundation for building the early warning model. The system constructs a dual-channel data stream according to the forecast lead time requirements. For short-term forecasts within 30 minutes, high spatiotemporal resolution real-time monitoring data is acquired. For medium-term forecasts of 1-12 hours, numerical weather prediction (NWP) products are further loaded. To ensure spatiotemporal consistency, this invention employs pixel-wise sampling to map data of different resolutions to a unified spatial grid. At the same time, a length of [length missing] is used. Sliding time window for historical observations The input feature tensor is truncated to form the input feature tensor. ,in This represents the number of feature channels.
[0023] Step 2) In this invention, the shared feature encoder based on graph convolution (GCN) and sequence attention mechanism is the core for extracting deep spatiotemporal features. First, the gridded feature tensor is fed into the spatial feature extraction layer, and the graph convolution operator is used... The non-Euclidean spatial relationships between sites are handled. Subsequently, a sequence attention mechanism is introduced to dynamically weight the feature distribution along the time axis. A query matrix is generated through a linear transformation. Key matrix Sum matrix Calculate attention weights: This mechanism enables the model to automatically focus on critical time steps where there are dramatic changes in the electric field or a sharp increase in radar echo, generating a hidden state matrix containing global spatiotemporal dependency information. This matrix, as a shared representation, is simultaneously passed to multiple subsequent task branches, achieving efficient feature reuse and implicit regularization between tasks.
[0024] Step 3) In this invention, a multi-task-specific head structure is used to simultaneously achieve lightning location regression, probability classification, and intensity assessment. Shared features. The data is fed into three parallel decoding heads: (a) Spatial location regression head: using convolutional layers and fully connected layers to fit the coordinate offset of lightning occurrence, outputting a spatial location probability map at a resolution of 1km. (b) Probability prediction head: Through Softmax normalization, output the probability distribution of lightning occurrence within each future step size. (c) Intensity Level Classification Head: Maps features to discrete labels for lightning activity levels (LAL1-6), outputting the log-probability of each level. To balance the convergence speed of each task, this invention employs a ternary hybrid loss function based on homoscedastic uncertainty: in, The variance parameter is a learnable parameter used to adaptively adjust the relative weights of position regression loss, probabilistic cross-entropy, and hierarchical classification loss during training, ensuring that the model is not biased towards any single task. The trained shared feature encoder and three parallel decoders together form the lightning warning model.
[0025] Step 4) In this invention, an incremental learning update mechanism based on a sliding time window is introduced to address mode drift. To enable the model to absorb the latest observation feedback online, this invention designs a real-time update strategy of "data buffer - model fine-tuning". Define the window length. (e.g., 10 days) and update cycle (e.g., 24 hours). Whenever accumulated... After receiving new data at the specified step size, the system automatically constructs an incremental training set from the samples in the buffer. During the update phase, the weights of the underlying shared encoder are frozen, and only stochastic gradient descent (SGD) is used to adjust the weights of each task head. Make fine adjustments: in A relatively small incremental learning rate is used. Through this sliding window-based periodic update, the model can capture the evolution of lightning triggering patterns caused by seasonal climate change in real time, significantly reducing the degradation of prediction performance after deployment. To address the degradation problem in long-term model operation, this invention introduces an incremental learning mechanism based on a sliding time window. This mechanism allows the model to fine-tune and optimize parameters by fusing the latest lightning monitoring data without touching the entire old dataset, thereby achieving online maintenance of prediction performance. After obtaining the lightning warning model, the parameters of the decoder head are updated based on the sliding time window incremental learning mechanism. The decoder head with updated parameters is then used in the lightning warning model to perform actual lightning warnings, obtaining the coordinates, time period, and prediction level of the lightning strike prediction.
[0026] Step 5) Construct a multi-dimensional evaluation index system for the accuracy of lightning warnings. To objectively evaluate the accuracy of the model, this invention constructs the following index system for different tasks: (a) Spatial positioning accuracy: The root mean square error (RMSE) is used to evaluate the distance deviation between the predicted lightning strike coordinates and the actual location. During the verification process, 8km is set as the "evaluation tolerance radius," that is, the actual lightning strike point within 8km of the predicted point is counted as a "hit"; (b) Time occurrence reliability index: The CSI (Critical Success Index) is used to comprehensively measure the hit rate and false alarm rate. The formula is as follows: (c) Consistency of intensity assessment: By comparing the predicted LAL (Lightning Activity Level) level with the actual observed value, the F1-Score of the multi-classification task is calculated to ensure the scientific nature of the graded early warning.
[0027] The advantages of this invention are: 1) Significantly improved ability to capture sudden features: Because this invention employs a sequence attention mechanism, the model can automatically identify and reinforce key time nodes and spatial regions (such as abnormal jumps in electric field intensity or areas of increased radar reflectivity) that play a crucial role in triggering lightning, based on the input temporal feature stream. Therefore, this invention overcomes the prediction lag caused by the equal weighting of all regions in traditional convolutional models, enabling the system to more sensitively capture the precursor signals of lightning and improve the timeliness of early warning.
[0028] 2) Achieved collaborative evolution and robust prediction of multi-dimensional features: Because this invention employs a multi-task learning framework and introduces a dynamic loss weighting mechanism based on homoscedastic uncertainty, the three related tasks of lightning strike location, probability of occurrence, and intensity level can be simultaneously optimized under shared feature representation. Therefore, this invention not only solves the problem of incomplete representation of lightning activity by single-task models but also enhances the model's generalization ability through implicit regularization constraints between tasks, providing a more comprehensive and stable quantitative reference for power dispatching and disaster prevention decisions.
[0029] 3) Successfully solved the problems of model performance degradation and environmental adaptability: Because this invention adopts an incremental learning and update strategy based on a sliding time window, the model can fine-tune its parameters online by absorbing the latest monitoring data without full retraining. Therefore, this invention overcomes the "model drift" defect of traditional static models, which is difficult to cope with seasonal changes or long-term climate change. While ensuring the long-term operational stability of the early warning system, it greatly reduces the computational cost and time overhead of system maintenance.
[0030] 4) Eliminates physical and logical gaps between different time-leading warnings: Because this invention employs multimodal data fusion technology, it dynamically integrates high-resolution measured data and medium- to long-term numerical weather prediction (NWP) products based on the forecast time-leading period. Therefore, by utilizing the atmospheric dynamics laws of NWP to physically constrain deep learning features, this invention effectively suppresses the trajectory drift and physical distortion phenomena that are prone to occur in 1-12 hour predictions by purely data-driven models, achieving a seamless and smooth transition from minute-level short-term extrapolation to hourly-level trend prediction.
[0031] To clearly describe the implementation details of the present invention, Figure 1 A schematic diagram of the structure and process of the early warning system is provided. It is divided into four parts: (1) Multimodal spatiotemporal data acquisition and alignment preprocessing, which shows the dual-path input logic of short-term (30min) monitoring data and medium-term (1-12h) NWP products; (2) Feature encoder based on GCN and sequence attention, which describes the internal structure of the shared backbone network; (3) Multi-task independent prediction head and collaborative optimization, which explains how the shared features are distributed to the three sub-task heads of location regression, probability classification and intensity evaluation; (4) Incremental learning update mechanism, which describes the life cycle of online model evolution.
[0032] The actual experiment will be conducted below: Step 1: Multimodal data preprocessing, corresponding to the attached... Figure 1 Module (1).
[0033] (1) Data Acquisition: This embodiment acquires some multi-source meteorological data. This mainly includes minute-level atmospheric electric field meter data. (Feature Dimension) LINET 3D lightning location information (latitude, longitude and peak current), and NWP forecast products including Total Precipitable Water (TPW).
[0034] (2) Parameter settings: Set the sampling frequency of the short-term channel to 6 minutes / time (corresponding to the radar scanning cycle), and the sampling frequency of the medium-term channel to 60 minutes / time.
[0035] (3) Dataset partitioning: To avoid feature distortion caused by geographic spatial differences, this embodiment adopts a pixel-level sampling strategy to uniformly map all input sources to The spatial grid is used. At the same time, the dataset is strictly divided into training set (2021.01-2023.08), validation set (2023.09-2024.08) and test set (2024.09-2025.09).
[0036] (4) Generation of 3D task labels: To drive multi-task learning, the system synchronously generates three types of labels: (a) Spatial location labels ( (a) Generate pixel-level binary masks on the grid based on the lightning location coordinates for location regression tasks; (b) Time occurrence labels (c) Intensity level label: Based on the lead time of future forecasts, count whether lightning occurs in the target area within each step, and generate a 0 / 1 time series label sequence; The frequency and peak current of lightning within the grid are statistically analyzed, and discrete intensity classification labels are generated according to the LAL (Lightning Activity Level) 1-6 standard. To ensure high recall and capture "burst burst" characteristics, the review window parameters during label generation are... Set it to 3.
[0037] Step 2: Construction of a multi-task spatiotemporal coding model, corresponding to the attached... Figure 1 Module (2).
[0038] (1) Architecture configuration: A shared backbone network is adopted, and the model configuration parameters are as follows: (a) Enable spatial GCN embedding to handle the topological associations between monitoring stations; (b) Set the hidden layer dimension. Intraday Time Embedded Dimension All are 64; (c) Set the number of sequence attention heads to 8. Simultaneously, the length of the model's historical input sequence... (Corresponding to short-term 30 minutes / medium-term 6 hours), future predicted sequence length (Corresponding to short-term 60-minute / medium-term 12-hour forecast lead time).
[0039] (2) Spatiotemporal fusion mechanism: The input sequence tensor is fed into a time-axis dynamically weighted layer after spatial features are extracted by GCN. This layer generates a linear transformation. It captures key features such as electric field abrupt changes and convective transitions, and outputs hidden states rich in global dependency information. .
[0040] (3) Decoupling of multi-head structure: Three independent prediction heads are fed in parallel: (a) Lightning location regression head (output probability map) (b) Lightning probability classification header (outputs the probability of timing occurrence) (c) Lightning intensity assessment head (output level classification) ).
[0041] Step 3: Training with ternary hybrid loss, corresponding to the attached... Figure 1 Module (3).
[0042] During the model training phase, a ternary mixture loss function based on homoscedastic uncertainty is used. Perform joint optimization: (1) (Location Loss): Calculates the MSE between the predicted probability map and the actual lightning location density map.
[0043] (2) (Probability Loss): Classification loss is calculated using FocalLoss. This addresses the problem of extreme imbalance between positive and negative samples.
[0044] (3) (Intensity Loss): MaskedMSE is used to calculate the loss between the predicted LAL and the actual grade label only for areas where lightning occurs, forcing the model to fit the intensity characteristics.
[0045] (4) Weight self-balancing: Introducing learnable parameters The model automatically adjusts the relative proportions of the three losses during training, avoiding mutual interference between tasks caused by manual parameter tuning.
[0046] The training parameters are shown in Table 1.
[0047] Table 1 Partial Training Parameters Step 4: Online incremental update mechanism. (See attached document.) Figure 1 Module (4).
[0048] (1) Incremental logic: As shown in Module 4 of the attached figure, after accumulating 24 hours of new observation data, the system automatically stores it in the buffer and constructs an incremental training set.
[0049] (2) Sliding window settings: Set the window length Oh no. The system is frozen during the update phase. The parameters of the shared encoder are only for the weights of the three independent task heads. Perform gradient fine-tuning over 20 epochs.
[0050] (3) Evaluation and feedback: The evaluation tolerance radius is set at 8km. The operational long-term accuracy of the early warning system is maintained by the spatial positioning Hit rate, the time occurrence CSI index and the intensity F1-Score.
[0051] Example 2: The present invention also provides a corresponding Figure 1 A schematic diagram of the device. At the hardware level, the device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for various operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then executes it to achieve the above-mentioned functions. Figure 1 The method described herein. Of course, in addition to software implementation, this invention does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0052] Improvements in a technology can be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many improvements to the methodology can now be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that an improvement in methodology cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compiler used when writing program development code. The original code before compilation must also be written in a specific programming language, which is called a Hardware Description Language (HDL). There is not just one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using the aforementioned hardware description languages and programming it into an integrated circuit, the hardware circuit that implements the logic method flow can be easily obtained.
[0053] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, ASICs, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0054] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0055] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, in implementing this invention, the functions of each unit can be implemented in one or more software and / or hardware components.
[0056] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0057] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0058] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0059] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0060] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0061] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0062] Computer-readable media include both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0063] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A multi-task lightning early warning method based on sequence attention mechanism, characterized in that, The method includes the following steps: S1. Acquire multi-source meteorological data and perform alignment preprocessing; S2. Construct a shared feature encoder based on graph convolution and sequence attention mechanisms; S3. A multi-task independent head structure is adopted to construct three parallel decoding heads, including a spatial location regression head, an occurrence probability prediction head, and an intensity level classification head. A ternary hybrid loss function is set based on the output of the classification head. S4. Train the shared feature encoder and decoder head based on the ternary hybrid loss function, align the preprocessed data as the input of the model to obtain the lightning warning model, apply the lightning warning model to the actual lightning warning to obtain the warning result. In the actual lightning warning process, when the update cycle is reached, construct the samples in the buffer as an incremental training set, freeze the weights of the shared feature encoder, and update the weights of the three parallel decoders.
2. The multi-task lightning early warning method based on sequence attention mechanism according to claim 1, characterized in that, The shared feature encoder outputs shared features, and the shared feature encoder includes a spatial feature extraction layer and a sequence attention mechanism layer.
3. The multi-task lightning early warning method based on sequence attention mechanism according to claim 1, characterized in that, The spatial location regression head consists of convolutional layers and fully connected layers, and outputs a probability map of the spatial location of lightning occurrences.
4. The multi-task lightning early warning method based on sequence attention mechanism according to claim 1, characterized in that, The probability prediction header includes Softmax, which outputs the probability distribution of lightning occurrence within each future step.
5. A multi-task lightning early warning method based on sequence attention mechanism according to claim 1, characterized in that, The intensity level classification head includes a feature mapping layer that outputs the log probability of each lightning activity level.
6. The multi-task lightning early warning method based on sequence attention mechanism according to claim 1, characterized in that, The ternary hybrid loss function is: ; in, Indicates positional loss. Indicates probability loss. Indicates strength loss. These are the learnable parameters for positional loss, probability loss, and intensity loss, respectively. This represents the ternary mixed loss function.
7. The multi-task lightning early warning method based on sequence attention mechanism according to claim 1, characterized in that, The updated weights of the three parallel decoders are: in For a smaller incremental learning rate, This represents the weights of the three parallel decoders. ∠ represents the ternary mixed loss function, and ▽ represents the change.
8. A multi-task lightning early warning method based on sequence attention mechanism according to claim 7, characterized in that, The method for updating the weights of the three parallel decoders is stochastic gradient descent.
9. A multi-task lightning early warning device based on a sequence attention mechanism, characterized in that, The method includes a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the multi-task lightning warning method based on the sequence attention mechanism as described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, It stores a program that, when executed by a processor, implements the multi-task lightning warning method based on the sequence attention mechanism as described in any one of claims 1-8.
