A method and system for three-dimensional lightning nowcasting
By constructing a three-dimensional grid and a three-dimensional convolutional neural network combined with a generative adversarial network, the shortcomings of existing two-dimensional planar lightning prediction technologies are overcome, achieving more accurate three-dimensional lightning prediction and improving prediction accuracy and spatial resolution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANJING UNIV OF INFORMATION SCI & TECH
- Filing Date
- 2024-10-31
- Publication Date
- 2026-04-17
AI Technical Summary
Existing research on lightning prediction based on deep learning mostly focuses on two-dimensional planes and fails to effectively utilize the three-dimensional spatial distribution information of lightning activity, resulting in insufficient prediction accuracy and spatial resolution, especially in situations with varying cloud heights and complex environments where accurate analysis is difficult to achieve.
A 3D grid of the target region is constructed. A 3D convolutional neural network 3DAttUnet-GAN is combined with a generative adversarial network and trained using historical 3D lightning localization data to capture the dynamic changes of lightning in 3D space. Data augmentation operations are used to improve the diversity of the dataset, and temporal, channel and spatial attention mechanisms are introduced to improve the model's prediction accuracy.
It significantly improves the accuracy and spatial resolution of 3D lightning prediction, enabling a more comprehensive capture of the distribution and diffusion effects of lightning in 3D space, enhancing the model's ability to capture dynamic changes, and achieving more accurate lightning location analysis.
Smart Images

Figure CN119444990B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of atmospheric science and technology, and in particular relates to a three-dimensional lightning proximity prediction method and system. Background Technology
[0002] Lightning is a long-distance, instantaneous discharge phenomenon generated by the collision of a large number of positive and negative electrons, typically occurring within clouds, between clouds, and between clouds and the ground. It is characterized by high frequency, strong current, and high energy. Cloud-to-ground lightning poses the most serious threat to human society, economy, and personal safety, often causing damage to ground buildings, electronic equipment malfunctions, and thousands of casualties annually. Because lightning often occurs frequently and in concentrated areas, its recurring patterns make the prediction of lightning strike areas crucial. Currently, traditional methods for lightning prediction mainly include numerical analysis and machine learning methods, but both have limitations in complex natural environments. In recent years, deep learning has made significant progress in time series prediction tasks. Transforming the lightning strike area prediction problem into a time series prediction problem and using deep learning technology for prediction has become a new research direction. However, most existing deep learning-based lightning prediction research remains confined to the two-dimensional plane. Some researchers have conducted research on three-dimensional lightning, such as the prior art published under publication number CN115453479A. This prior art identifies lightning strike areas, but it still uses two-dimensional radar product data to create three-dimensional data. The resulting three-dimensional data still differs from the actual three-dimensional data. Compared to traditional two-dimensional planar research, three-dimensional lightning prediction methods can better utilize the spatial distribution information of lightning activity, especially in complex environments such as changes in cloud height and winding lightning paths, which helps to achieve more accurate analysis of lightning locations. However, research on three-dimensional lightning prediction using deep learning models based on three-dimensional lightning location data is currently lacking. Summary of the Invention:
[0003] To address the problems existing in the prior art, this invention proposes a three-dimensional lightning proximity prediction method and system.
[0004] The technical solution of the present invention is as follows:
[0005] A three-dimensional lightning proximity prediction method includes:
[0006] Construct a three-dimensional grid covering the spatial extent of lightning activity in the target area;
[0007] Historical three-dimensional lightning location data is mapped onto the three-dimensional grid to obtain historical three-dimensional lightning grid data;
[0008] Based on the historical three-dimensional lightning grid data, a three-dimensional lightning proximity prediction model that takes into account spatial feature changes is trained.
[0009] Three-dimensional lightning proximity prediction is performed using a trained three-dimensional lightning proximity prediction model.
[0010] Furthermore, the specific steps for constructing a three-dimensional grid covering the spatial range of lightning activity in the target area include:
[0011] The grid extent of the 3D raster in the latitude-longitude plane is determined based on the longitude and latitude range of the target area. The distribution of the 3D raster in the latitude-longitude plane is then defined based on the length and width of the raster cells. The total number of raster cells along the longitude is denoted as N. lon The row index in longitude is denoted as col_index, and the total number of raster cells in latitude is denoted as N. lat The column index on the dimension is denoted as row_index;
[0012] Based on the height range of the target area and the height of the grid cells, the distribution of the 3D grid in the height direction is determined, and the total number of height layers of the grid is denoted as N. lay The height index is denoted as height_index;
[0013] This forms a three-dimensional grid N. lon ×N lat ×N lay .
[0014] Furthermore, the specific steps for mapping historical three-dimensional lightning location data onto the three-dimensional grid to obtain historical three-dimensional lightning grid data include:
[0015] Historical 3D lightning location data is divided into several temporally continuous historical 3D lightning location data sequences with a certain time step;
[0016] By using the height, longitude, and latitude data from each historical 3D lightning location data sequence, the height layer index, row index, and column index of the 3D raster are mapped. Data mapping operations representing lightning occurrences and data augmentation operations representing the impact of lightning on the surrounding area are performed on the raster cells in the 3D raster where lightning occurs. This results in historical 3D lightning raster data that records the lightning occurrence height layer index, row index, column index, and raster cell value.
[0017] Furthermore, the specific steps of the data mapping operation used to represent lightning occurrence include:
[0018] For each historical 3D lightning location data sequence, the grid cell value of the mapped position (height_index, row_index, col_index) in the 3D grid corresponding to the location of each lightning occurrence is increased by 1.
[0019] Furthermore, the specific steps of the data augmentation operation used to represent the impact of lightning on the surrounding area include:
[0020] For each historical 3D lightning location data sequence, center point processing and neighbor point processing are performed on the grid cell corresponding to the mapped position in the 3D grid and the surrounding grid cells.
[0021] The specific method for processing the center point is as follows: the grid cell where the lightning occurred is taken as the center grid cell and its value is increased by 1 on the original basis to mark the occurrence of lightning at that location;
[0022] The specific method for processing neighboring points is as follows: the grid cells surrounding the central grid cell are treated as neighboring grid cells and their values are increased by 1 based on the original values.
[0023] Furthermore, the 3D lightning proximity prediction model that takes into account spatial feature changes employs a 3D convolutional neural network 3DAttUnet-GAN. This 3D convolutional neural network is based on the Unet neural network model, extending its two-dimensional convolutional operations to three-dimensional convolutional operations and introducing an attention mechanism, combined with a generative adversarial network (GAN). The 3D lightning proximity prediction model includes a 3DAttUnet encoder-decoder structure and a GAN. The generator of the GAN is a 3DAttUnet encoder-decoder structure, and the discriminator is a binary classification network. The generator performs feature encoding and decoding on the input data and generates prediction results. The GAN, based on the prediction results generated by the generator and combined with real data, inputs the data into the discriminator, and the discriminator's output of the realism evaluation results trains the generator.
[0024] Furthermore, the 3DAttUnet encoder-decoder architecture includes an encoder, a decoder, and an attention mechanism module;
[0025] The encoder consists of 5 layers of 3D convolutional modules. Each layer uses depthwise separable 3D convolution, ReLU activation function, and integrates attention mechanism module and max pooling layer.
[0026] The decoder uses trilinear interpolation or deconvolution for upsampling, recovers the spatial and temporal resolution of the input features layer by layer, and further enhances the features by using depthwise separable 3D convolution combined with an attention module.
[0027] The attention mechanism module includes temporal attention, channel attention, and spatial attention. Temporal attention is applied to time series to capture dynamic changes in the time series; channel attention is applied to the height layer to dynamically adjust the importance of the height layer; and spatial attention is applied to the planar space of each height layer to adaptively adjust the spatial position weight of each height layer.
[0028] Furthermore, the specific steps for training the three-dimensional lightning proximity prediction model, which takes into account spatial feature variations, based on the aforementioned historical three-dimensional lightning grid data include:
[0029] Historical 3D lightning grid data were divided into training and test sets in an 8:2 ratio, and the training set was further divided into training subset and validation subset in an 8:2 ratio.
[0030] During model training, timestamp files are set to form a continuous sliding time array with a length of 20 time steps from the 3D lightning grid data. That is, the data of the first 10 time steps is used to predict the data of the next 10 time steps. The model’s attention to lightning clustering areas is improved by optimizing the learning rate, data batch size and loss function. At the same time, a validation set is used for validation.
[0031] Inference prediction is performed using a test set, and the prediction accuracy of the trained model is evaluated using multiple evaluation metrics.
[0032] Furthermore, it also includes visualizing the three-dimensional lightning proximity prediction results, generating a three-dimensional stereoscopic image with lightning occurrence frequency markers and spatial feature markers, and a three-view image composed of a top view, a front view, and a side view of the three-dimensional lightning proximity prediction results.
[0033] A three-dimensional lightning proximity prediction system includes: a three-dimensional grid construction module, a three-dimensional lightning grid data construction module, a model training module, and a prediction module;
[0034] The three-dimensional grid construction module is used to construct a three-dimensional grid covering the spatial range of lightning activity in the target area;
[0035] The three-dimensional lightning data construction module is used to map historical three-dimensional lightning location data onto the three-dimensional grid to obtain historical three-dimensional lightning grid data;
[0036] The model training module is used to train a three-dimensional lightning proximity prediction model that takes into account spatial feature changes based on the historical three-dimensional lightning grid data.
[0037] The prediction module is used to perform three-dimensional lightning proximity prediction using a trained three-dimensional lightning proximity prediction model.
[0038] An electronic device includes a memory and a processor, the memory storing a computer program, the processor being configured to invoke and run the computer program stored in the memory to perform the method as described in any of the preceding methods.
[0039] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in any of the preceding claims.
[0040] Compared with the prior art, the present invention has the following beneficial effects:
[0041] This invention proposes a three-dimensional lightning proximity prediction method. This method constructs a three-dimensional grid covering the spatial range of lightning activity in the target area. Compared with existing lightning prediction models that only consider two-dimensional planes or single heights, this method can capture the dynamic changes of lightning in three-dimensional space, significantly improving the prediction accuracy and spatial resolution.
[0042] This invention improves the diversity of the dataset and the model's feature capture ability by performing data augmentation on historical 3D lightning data to represent the impact of lightning on surrounding areas. Furthermore, the 3D lightning proximity prediction model in this invention, which takes into account spatial feature variations, combines 3D convolution, attention mechanisms, and generative adversarial networks, significantly enhancing the model's prediction accuracy.
[0043] This invention, through processing historical 3D lightning location data and adding data augmentation operations, can more comprehensively capture the distribution and diffusion effects of lightning in 3D space, not limited to a single plane or local area, but reflecting the impact of lightning activity in three dimensions: longitude, latitude, and altitude. This processing significantly improves the diversity of the dataset and enables the model to fully understand the dynamic changes of lightning in 3D space. Simultaneously, the 3D lightning proximity prediction model used in this invention combines 3D convolution, an integrated temporal, channel, and spatial attention mechanism, and a generative adversarial network, enabling it to comprehensively capture the changing patterns of 3D spatial features. This 3D analysis approach significantly improves the model's accuracy and spatial resolution compared to 2D prediction. The integrated temporal, channel, and spatial triple attention mechanism further enhances the model's ability to capture the spatial and temporal characteristics of dynamically changing lightning, significantly improving the model's prediction accuracy. Attached Figure Description
[0044] Figure 1 This is a flowchart of the three-dimensional lightning proximity prediction method in the embodiment;
[0045] Figure 2 This is a schematic diagram of the three-dimensional grid construction in the embodiment;
[0046] Figure 3This is a schematic diagram illustrating the data mapping and data augmentation operations in the embodiment;
[0047] Figure 4 This is a schematic diagram of the three-dimensional lightning proximity prediction model structure in the embodiment;
[0048] Figure 5 This is a schematic diagram of the prediction results in the example. Detailed Implementation
[0049] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0050] Example 1:
[0051] The present invention provides a three-dimensional lightning proximity prediction method, such as... Figure 1 As shown, the specific steps include the following:
[0052] S1. Construct a three-dimensional grid of the target area that covers the spatial range of lightning activity;
[0053] S2. Map the historical three-dimensional lightning location data onto the three-dimensional grid to obtain historical three-dimensional lightning grid data;
[0054] S3. Based on the historical three-dimensional lightning grid data, train a three-dimensional lightning proximity prediction model that takes into account spatial feature changes;
[0055] S4. Use the trained 3D lightning proximity prediction model to perform 3D lightning proximity prediction.
[0056] Example 2:
[0057] This embodiment, based on Embodiment 1, further designs the following specific steps for constructing a three-dimensional grid covering the spatial range of lightning activity in the target area:
[0058] The grid extent of the 3D raster in the latitude-longitude plane is determined based on the longitude and latitude range of the target area. The distribution of the 3D raster in the latitude-longitude plane is then defined based on the length and width of the raster cells. The total number of raster cells along the longitude is denoted as N. lon The row index in longitude is denoted as col_index, and the total number of raster cells in latitude is denoted as N. lat The column index on the dimension is denoted as row_index;
[0059] Based on the height range of the target area and the height of the grid cells, the distribution of the 3D grid in the height direction is determined, and the total number of height layers of the grid is denoted as N.lay The height index is denoted as height_index;
[0060] This forms a three-dimensional grid N. lon ×N lat ×N lay ,like Figure 2 As shown.
[0061] Example 3:
[0062] This embodiment, based on Embodiment 2, further designs the following steps to map historical three-dimensional lightning location data onto the three-dimensional grid to obtain historical three-dimensional lightning grid data:
[0063] Historical 3D lightning location data is divided into several temporally continuous historical 3D lightning location data sequences with a certain time step;
[0064] Using the altitude, longitude, and latitude data from each historical 3D lightning location data sequence, a mapping is performed on the altitude layer index of the 3D raster, the row index on the latitude and longitude plane, and the column index, such as... Figure 3 As shown, data mapping operations to represent lightning occurrences and data augmentation operations to represent the impact of lightning on surrounding areas are performed on the grid cells in the three-dimensional grid where lightning occurs, thereby obtaining historical three-dimensional lightning grid data that records the lightning occurrence height layer index, row index, column index, and grid cell value.
[0065] Example 4:
[0066] This embodiment is further designed based on embodiment three, as follows: Figure 3 As shown, the specific steps of the data mapping operation used to represent lightning occurrence in this example include:
[0067] For each historical 3D lightning location data sequence, the value of the raster cell at the corresponding mapping position (height_index, row_index, col_index) in the 3D raster is incremented by 1 for each lightning occurrence. After incrementing, the value of the raster cell in the 3D raster represents the number of times lightning occurred at that location.
[0068] Example 5:
[0069] This embodiment is further designed based on embodiment three, as follows: Figure 3 As shown, the specific steps of the data augmentation operation used in this example to represent the impact of lightning on the surrounding area include:
[0070] For each historical 3D lightning location data sequence, center point processing and neighbor point processing are performed on the grid cell corresponding to the mapping position in the 3D grid and the surrounding grid cells for each lightning occurrence.
[0071] The specific method for processing the center point is as follows: the grid cell where the lightning occurred is taken as the center grid cell and its value is increased by 1 on the original basis to mark the occurrence of lightning at that location;
[0072] The specific method for processing neighboring points is as follows: the grid cells around the central grid cell are treated as neighboring grid cells and their values are increased by 1 to reflect the potential impact of lightning on the area.
[0073] The neighboring grid is selected based on the size of the height layer. If the size of the height layer is greater than or equal to the set threshold, the neighboring grid is the 8 adjacent grid cells at the same height layer as the central grid cell; otherwise, the neighboring grid is the 26 grid cells that are spatially adjacent to the central grid cell.
[0074] Example 6:
[0075] This embodiment is further designed based on embodiment three. In this example, the three-dimensional lightning proximity prediction model that takes into account the changes in spatial features adopts a three-dimensional convolutional neural network 3DAttUnet-GAN. The three-dimensional convolutional neural network 3DAttUnet-GAN is based on the Unet neural network model, which extends the two-dimensional convolution operation to a three-dimensional convolution operation and introduces an attention mechanism, combined with a generative adversarial network (GAN) to form it.
[0076] The three-dimensional lightning proximity prediction model includes a 3DAttUnet encoder-decoder structure and a generative adversarial network (GAN).
[0077] The generator of the Generative Adversarial Network (GAN) is a 3DAttUnet encoder-decoder structure, and the discriminator is a binary classification network.
[0078] The generator performs feature encoding and decoding on the input data and generates prediction results;
[0079] The generative adversarial network inputs the prediction results generated by the generator into the discriminator along with real data (real images), and trains the generator with the realism evaluation results output by the discriminator.
[0080] Example 7:
[0081] This embodiment is further designed based on embodiment six, as follows: Figure 4As shown, the 3DAttUnet encoder-decoder structure in this example mainly includes an encoder, a decoder, and an attention mechanism module. The encoder consists of five 3D convolutional layers. Each layer uses depthwise separable 3D convolutions, ReLU activation functions, and integrates an attention mechanism module and a max-pooling layer. Specifically, it includes one 3D convolutional layer with 64 input channels, using 64 3×3×3 convolutional kernels, followed by a ReLU activation function and an attention mechanism module, and finally using a max-pooling layer for downsampling; another 3D convolutional layer with 128 input channels, using 128 3×3×3 convolutional kernels, followed by a ReLU activation function and an attention mechanism module, and finally using a max-pooling layer for downsampling; and ... a third 3D convolutional layer with 128 input channels, using 128 3×3×3 convolutional kernels, followed by a ReLU activation function and an attention mechanism module, and finally using a max-pooling layer for downsampling. A 3D convolutional layer with 256 input channels, using 256 3×3×3 convolutional kernels, followed by a ReLU activation function and attention mechanism module, and finally a max pooling layer for downsampling; a 3D convolutional layer with 512 input channels, using 512 3×3×3 convolutional kernels, followed by a ReLU activation function and attention mechanism module, and finally a max pooling layer for downsampling; a 3D convolutional layer with 1024 input channels, using 1024 3×3×3 convolutional kernels, followed by a ReLU activation function and attention mechanism module, and finally a max pooling layer for downsampling.
[0082] The decoder uses trilinear interpolation or deconvolution for upsampling, restoring the spatial and temporal resolution of the input features layer by layer. It further enhances the features by using depthwise separable 3D convolution and combining it with an attention module. Specifically, it includes 4 3D upsampling convolutional layers corresponding to the encoder and one output layer. The output layer converts the number of channels of the feature map into the number of target categories through 1×1×1 3D convolution, and restricts the output result to between 0 and 1 through the Sigmoid activation function to adapt to specific task requirements.
[0083] The attention mechanism module includes temporal attention, channel attention, and spatial attention. Temporal attention is applied to time series to capture dynamic changes in the time series. Channel attention is applied to the height layer to dynamically adjust the importance of the height layer and help the model enhance its ability to model the spatial-height relationship between height layers. Spatial attention is applied to the planar space of each height layer to adaptively adjust the spatial position weight of each height layer, allowing the model to focus more on key regions in the planar space.
[0084] The 3DAttUnet-GAN three-dimensional convolutional neural network refers to a network that uses the 3DAttUnet encoder-decoder structure as the core structure of its generator, a generative adversarial network. The discriminator is mainly divided into feature extraction and classification. The feature extraction part consists of four three-dimensional convolutional layers (kernel size 3×3×3) and a ReLU activation function, extracting features from the predicted image or label data. The classification part consists of three fully connected layers, used to map the extracted features to a binary classification output. It accepts the output of the feature extraction part as input, and the final output is a scalar value representing the authenticity or category of the input data.
[0085] Overall architecture process:
[0086] Generation stage: Input data is encoded and decoded using the 3DAttUnet network to generate prediction results.
[0087] Adversarial phase: The generated predictions are input into the discriminator along with the real images, and the discriminator outputs its authenticity assessment (real / fake).
[0088] Optimization process: Through adversarial learning, the generator and discriminator engage in a game of mutual competition. Guided by feedback from the discriminator, the generator continuously improves its generation performance, ultimately producing high-precision results.
[0089] Upper part: 3DAttUnet encoding-decoding structure
[0090] Input (left cube): The model receives input 3D volume data, which in this case is 3D lightning raster data.
[0091] Encoding path (yellow and blue cubes): The encoding part of the network extracts high-level features layer by layer through multi-layer 3D convolution and downsampling. In this process, the spatial dimension of the feature map gradually decreases, but the number of channels increases, forming more expressive abstract features.
[0092] Skip connections (horizontal arrows): The model uses skip connections to directly pass shallow features from the encoding path to the decoding path. These skip connections are the core of the U-Net architecture, enabling the fusion of multi-scale features during the decoding stage and ensuring that high-resolution details are preserved during reconstruction.
[0093] Decoding Path (Yellow and Blue Cubes): The decoding part uses upsampling operations to progressively restore the spatial resolution of the feature maps, while simultaneously integrating features from the encoding stage using skip connections. The goal of this process is to generate an output that matches the dimension of the input data, progressively recovering fine-grained information to achieve accurate segmentation or reconstruction.
[0094] Attention Mechanism Module: The model introduces a specific attention mechanism module, which includes temporal attention, channel attention, and spatial attention. These are applied to the time series, the height layer, and the planar space at each height, respectively. Through adaptive weighting, the model enhances its attention to key regions and suppresses the influence of irrelevant features, thereby improving prediction accuracy.
[0095] Output (right cube): The model finally generates the prediction result, and the output 3D feature map will be consistent with the original input in spatial dimension.
[0096] Second half: Generative Adversarial Networks (GANs)
[0097] The generator (3DAttUnet-GAN): The 3DAttUnet structure acts as the generator in the GAN framework, responsible for generating predicted 3D images from the input data. The generator encodes and decodes the input data layer by layer, outputting prediction results that conform to the target distribution.
[0098] Discriminator: In the GAN framework, the discriminator is a binary classification network. Its input includes the generator's predictions and real image data (the "Truth" part). The discriminator is responsible for determining whether the input image is real or fake. Feedback from the discriminator guides the generator's optimization, enabling it to produce higher-quality outputs that more closely approximate real data.
[0099] Example 8:
[0100] This embodiment, based on Embodiment 1, further designs the following specific steps for training the three-dimensional lightning proximity prediction model that takes into account spatial feature changes based on the historical three-dimensional lightning grid data:
[0101] Historical 3D lightning grid data were divided into training and test sets in an 8:2 ratio, and the training set was further divided into training subset and validation subset in an 8:2 ratio.
[0102] During model training, timestamp files are set to form a continuous sliding time array with a length of 20 time steps from the 3D lightning grid data. That is, the data of the first 10 time steps is used to predict the data of the next 10 time steps. The model’s attention to lightning clustering areas is improved by optimizing the learning rate, data batch size and loss function. At the same time, a validation set is used for validation.
[0103] Inference predictions were performed using the test set, and the prediction accuracy of the trained model was evaluated using multiple evaluation metrics (POP, FAR, TS, and HSS).
[0104] Example 9:
[0105] This embodiment, building upon Embodiment 1, further includes visualization processing of the 3D lightning proximity prediction results. This visualization generates a 3D stereoscopic image with lightning frequency and spatial feature markers, and three views consisting of a top view, a front view, and a side view of the 3D lightning proximity prediction results. Specifically: The 3D stereoscopic image displays the overall three-dimensional distribution of lightning. It visually shows the distribution and frequency of lightning at different altitudes and geographical locations. Changes in color and transparency indicate the number of lightning occurrences at different locations, allowing users to clearly identify high-frequency areas and spatial distribution characteristics. The top view shows the distribution of lightning on a geographical plane, clearly displaying the density of lightning at different latitudes and longitudes. The front view shows the vertical distribution of lightning from a frontal perspective, reflecting frequency variations at different altitudes. This view helps in understanding the occurrence patterns of lightning at different altitudes. The side view shows the cross-sectional distribution of lightning from a side perspective, providing another viewpoint to observe the height distribution and trends of lightning.
[0106] Example 10:
[0107] The present invention provides a three-dimensional lightning proximity prediction system, comprising: a three-dimensional grid construction module, a three-dimensional lightning grid data construction module, a model training module, and a prediction module;
[0108] The three-dimensional grid construction module is used to construct a three-dimensional grid covering the spatial range of lightning activity in the target area;
[0109] The three-dimensional lightning data construction module is used to map historical three-dimensional lightning location data onto the three-dimensional grid to obtain historical three-dimensional lightning grid data;
[0110] The model training module is used to train a three-dimensional lightning proximity prediction model that takes into account spatial feature changes based on the historical three-dimensional lightning grid data.
[0111] The prediction module is used to perform three-dimensional lightning proximity prediction using a trained three-dimensional lightning proximity prediction model.
[0112] Example 11:
[0113] An electronic device includes a memory and a processor, the memory storing a computer program, and the processor being configured to invoke and run the computer program stored in the memory to perform the method described in any of the preceding methods.
[0114] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method as described in any of the preceding claims.
[0115] Application Examples:
[0116] This example simulates the implementation of the three-dimensional lightning proximity prediction method of the present invention. The research area of the simulation is Ningbo City, Zhejiang Province. The historical three-dimensional lightning location data used are real lightning that occurred within the geographical area of Ningbo City, Zhejiang Province from February to September 2024.
[0117] In constructing the 3D grid, this example uses the lower left corner of the study area as the reference point. Setting the reference point ensures that the location of lightning strikes can be correctly mapped to the corresponding cells in the 3D grid. In this example, the grid cells are set to a size of 0.04° on the latitude and longitude plane, with an altitude layer of 2 kilometers, and five altitude layer intervals: 0-2 km, 2-4 km, 4-6 km, 6-8 km, and 8 km and above.
[0118] An N can be formed using the following formula. lon ×N lat Horizontal grid:
[0119]
[0120] During the mapping process of the 3D raster, the height at which lightning occurs is determined by comparing it with a preset height range. This height level is represented by an index value and is used to map it to the height dimension of the 3D raster.
[0121]
[0122] Where height_index is the height index, and Δh is the set height layer interval unit of 2KM.
[0123] Calculation of horizontal grid position: The row and column position where lightning occurs in the grid is calculated using the following formula:
[0124]
[0125] Where row_index is the row index, latitude is the latitude of the lightning occurrence, base_lat is the latitude of the base point, and grid_size is the grid cell size of 0.04°.
[0126]
[0127] Where col_index is the column index, longitude is the longitude of the lightning strike, base_lon is the longitude of the reference point, and grid_size is the grid cell size of 0.04°.
[0128] During model training, model parameters are continuously optimized and adjusted, including the learning rate, batch size, and loss function. This invention employs a weighted comprehensive loss function, composed of mean squared error (MSE) and mean absolute error (MAE). MSE reflects the squared error between the predicted and actual values, used to check short-term prediction performance; MAE measures the absolute error, focusing on the long-term consistency of prediction trends. Combining both allows for evaluation of model performance from multiple perspectives, and assigns higher weight to areas where lightning frequently occurs, making the model more attentive to the characteristic changes in these areas. The training process continues until a high-accuracy 3D lightning proximity prediction model is constructed and saved.
[0129] The trained 3D lightning proximity prediction model is used to predict the proximity of lightning in 3D. The prediction results are visualized as follows: Figure 5 As shown. Figure 5 The system includes a 3D view and three projection views from different directions. The 3D view shows the model's predicted 3D lightning distribution, with predicted lightning points exhibiting a clear clustering phenomenon in 3D space, concentrated in certain areas, indicating that the model successfully captured the main locations of lightning occurrences. The XY projection view (top view) clearly shows the distribution of lightning in the XY plane (i.e., the Earth's surface), showing that lightning is mainly concentrated in certain geographical locations, while being relatively sparse in other areas. This is consistent with the characteristic that actual lightning occurrences usually exhibit localized concentrated distribution. The XZ projection view (front view) shows the distribution of lightning along the X-axis (horizontal distance) and Z-axis (altitude). It can be observed that most lightning occurs in the lower altitude range (closer to the ground along the Z-axis), which is consistent with the altitude at which lightning frequently occurs in the troposphere. The YZ projection view (side view) further verifies the distribution trend of lightning along the Y-axis (latitude) and Z-axis (altitude). The figure also shows that lightning is mainly concentrated in the lower altitude region, indicating that the model successfully captured the range of lightning occurrences in the altitude dimension.
[0130] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A three-dimensional lightning proximity prediction method, characterized in that, include: Construct a three-dimensional grid covering the spatial extent of lightning activity in the target area; Historical three-dimensional lightning location data is mapped onto the three-dimensional grid to obtain historical three-dimensional lightning grid data; Based on the historical three-dimensional lightning grid data, a three-dimensional lightning proximity prediction model that takes into account spatial feature changes is trained. Three-dimensional lightning proximity prediction is performed using a trained three-dimensional lightning proximity prediction model; The 3D lightning proximity prediction model, which takes into account spatial feature variations, employs a 3D convolutional neural network, 3DAttUnet-GAN. This 3D convolutional neural network is based on the Unet neural network model, extending its 2D convolutional operations to 3D convolutional operations and introducing an attention mechanism, combined with a generative adversarial network (GAN). The 3D lightning proximity prediction model includes a 3DAttUnet encoder-decoder structure and a GAN. The generator in the GAN uses the 3DAttUnet encoder-decoder structure, and the discriminator is a binary classification network. The generator encodes and decodes the input data to generate prediction results. The GAN combines the prediction results generated by the generator with real data input to the discriminator, and the discriminator's output of the realism evaluation results trains the generator. The 3DAttUnet encoder-decoder structure includes an encoder, a decoder, and an attention mechanism module. The encoder consists of five 3D convolutional layers, each using depthwise separable 3D convolution, ReLU activation function, and integrating an attention mechanism module and a max pooling layer. The decoder uses trilinear interpolation or deconvolution for upsampling, recovers the spatial and temporal resolution of the input features layer by layer, and further enhances the features by using depthwise separable 3D convolution combined with an attention module. The attention mechanism module includes temporal attention, channel attention, and spatial attention. Temporal attention is applied to time series to capture dynamic changes in the time series; channel attention is applied to the height layer to dynamically adjust the importance of the height layer; and spatial attention is applied to the planar space of each height layer to adaptively adjust the spatial position weight of each height layer.
2. The three-dimensional lightning proximity prediction method according to claim 1, characterized in that, The specific steps for constructing a three-dimensional grid covering the spatial extent of lightning activity in the target region include: The grid extent of the 3D raster in the latitude-longitude plane is determined based on the longitude and latitude range of the target area. The distribution of the 3D raster in the latitude-longitude plane is then defined based on the length and width of the raster cells. The total number of raster cells along the longitude is denoted as... The row index in longitude is denoted as col_index, and the total number of raster cells in latitude is denoted as col_index. The column index on the dimension is denoted as row_index; Based on the height range of the target area and the height of the raster cells, the distribution of the 3D raster in the height direction is determined, and the total number of height layers of the raster is denoted as . The height index is denoted as height_index; This forms a three-dimensional grid. .
3. The three-dimensional lightning proximity prediction method according to claim 2, characterized in that, The specific steps for mapping historical three-dimensional lightning location data onto the three-dimensional grid to obtain historical three-dimensional lightning grid data include: Historical 3D lightning location data is divided into several temporally continuous historical 3D lightning location data sequences with a certain time step; By using the height, longitude, and latitude data from each historical 3D lightning location data sequence, the height layer index, row index, and column index of the 3D raster are mapped. Data mapping operations representing lightning occurrences and data augmentation operations representing the impact of lightning on the surrounding area are performed on the raster cells in the 3D raster where lightning occurs. This results in historical 3D lightning raster data that records the lightning occurrence height layer index, row index, column index, and raster cell value.
4. The three-dimensional lightning proximity prediction method according to claim 3, characterized in that, The specific steps of the data mapping operation used to represent lightning occurrence include: For each historical 3D lightning location data sequence, the grid cell value of the mapped position (height_index, row_index, col_index) in the 3D grid corresponding to the location of each lightning occurrence is increased by 1.
5. The three-dimensional lightning proximity prediction method according to claim 3, characterized in that, The specific steps of the data augmentation operation used to represent the impact of lightning on the surrounding area include: For each historical 3D lightning location data sequence, center point processing and neighbor point processing are performed on the grid cell corresponding to the mapped position in the 3D grid and the surrounding grid cells. The specific method for processing the center point is as follows: the grid cell where the lightning occurred is taken as the center grid cell and its value is increased by 1 on the original basis to mark the lightning occurrence at that location; The specific method for processing neighboring points is as follows: the grid cells surrounding the central grid cell are treated as neighboring grid cells and their values are increased by 1 based on the original values.
6. The three-dimensional lightning proximity prediction method according to claim 1, characterized in that, The specific steps for training the three-dimensional lightning proximity prediction model that takes into account spatial feature changes based on the historical three-dimensional lightning grid data include: Historical 3D lightning grid data were divided into training and test sets in an 8:2 ratio, and the training set was further divided into training subset and validation subset in an 8:2 ratio. During model training, timestamp files are set to form a continuous sliding time array with a length of 20 time steps from the 3D lightning grid data. That is, the data of the first 10 time steps is used to predict the data of the next 10 time steps. The model’s attention to lightning clustering areas is improved by optimizing the learning rate, data batch size and loss function. At the same time, a validation set is used for validation. Inference prediction is performed using a test set, and the prediction accuracy of the trained model is evaluated using multiple evaluation metrics.
7. The three-dimensional lightning proximity prediction method according to claim 1, characterized in that, It also includes visualization processing of the three-dimensional lightning proximity prediction results, which generates a three-dimensional stereoscopic image with lightning occurrence frequency markers and spatial feature markers, as well as a three-view image composed of a top view, a front view, and a side view of the three-dimensional lightning proximity prediction results.
8. A three-dimensional lightning proximity prediction system, characterized in that, include: The module includes a 3D raster construction module, a 3D lightning raster data construction module, a model training module, and a prediction module. The three-dimensional grid construction module is used to construct a three-dimensional grid covering the spatial range of lightning activity in the target area; The three-dimensional lightning data construction module is used to map historical three-dimensional lightning location data onto the three-dimensional grid to obtain historical three-dimensional lightning grid data; The model training module is used to train a three-dimensional lightning proximity prediction model that takes into account spatial feature changes based on the historical three-dimensional lightning grid data. The prediction module is used to perform three-dimensional lightning proximity prediction using a trained three-dimensional lightning proximity prediction model. The 3D lightning proximity prediction model, which takes into account spatial feature variations, employs a 3D convolutional neural network, 3DAttUnet-GAN. This 3D convolutional neural network is based on the Unet neural network model, extending its 2D convolutional operations to 3D convolutional operations and introducing an attention mechanism, combined with a generative adversarial network (GAN). The 3D lightning proximity prediction model includes a 3DAttUnet encoder-decoder structure and a GAN. The generator in the GAN uses the 3DAttUnet encoder-decoder structure, and the discriminator is a binary classification network. The generator encodes and decodes the input data to generate prediction results. The GAN combines the prediction results generated by the generator with real data input to the discriminator, and the discriminator's output of the realism evaluation results trains the generator. The 3DAttUnet encoder-decoder structure includes an encoder, a decoder, and an attention mechanism module. The encoder consists of five 3D convolutional layers, each using depthwise separable 3D convolution, ReLU activation function, and integrating an attention mechanism module and a max pooling layer. The decoder uses trilinear interpolation or deconvolution for upsampling, recovers the spatial and temporal resolution of the input features layer by layer, and further enhances the features by using depthwise separable 3D convolution combined with an attention module. The attention mechanism module includes temporal attention, channel attention, and spatial attention. Temporal attention is applied to time series to capture dynamic changes in the time series; channel attention is applied to the height layer to dynamically adjust the importance of the height layer; and spatial attention is applied to the planar space of each height layer to adaptively adjust the spatial position weight of each height layer.
Citation Information
Patent Citations
Lightning falling area identification method based on radar data
CN115453479A