Rainfall prediction method and system, storage medium and electronic equipment
Feature fusion of satellite infrared data and ERA5 reanalysis data is performed through the global and local joint spatio-temporal attention mechanism of 3D convolutional coding and deep learning models, which solves the problems of low precipitation prediction efficiency and insufficient feature capture in the existing technology, and achieves a better Efficient and accurate precipitation forecasting.
Patent Information
- Application Number
- CN202410827725.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-17
AI Technical Summary
Existing precipitation prediction methods based on recurrent neural networks and convolutional neural networks have problems with vanishing gradients and exploding gradients. Their training and inference efficiency are low, they cannot fully capture the long-term dependencies and spatial characteristics in precipitation spatiotemporal sequence data, and they rely solely on radar echoes. The data leads to inaccurate forecast results.
3D convolutional encoding and decoding technology is used to perform spatiotemporal alignment and serialization of satellite infrared data and ERA5 reanalysis data, combined with the global and local joint spatiotemporal attention mechanism and cross-modal fusion of the deep learning model to achieve feature fusion and multi-source data predict.
It improves the accuracy and efficiency of precipitation prediction, can more accurately capture the spatiotemporal characteristics of the precipitation process, reduces information loss, and enhances the parallel processing capabilities of training and inference.
Smart Images

Figure CN118656783A
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of information technology and meteorological technology, and in particular to a precipitation prediction method, system, storage medium and electronic equipment. Background Art
[0002] Most precipitation prediction methods based on deep learning are based on recurrent neural networks or convolutional neural networks. Among them, spatiotemporal prediction models based on recurrent neural networks (RNNs) include ConvLSTM, PredRNN-V2 and other models and their variants. Spatiotemporal prediction models based on convolutional neural networks (CNNs) include SimVP, TAU and others.
[0003] The precipitation process is a complex physical process involving multiple meteorological variables and has a certain degree of mutation. The RNN-based model may be easily affected by long-term dependencies in precipitation prediction tasks, resulting in gradient vanishing and gradient explosion problems, and the characteristics of serial calculation make its training and reasoning efficiency low. When processing precipitation spatiotemporal series data, the CNN-based model may not be able to fully capture the dependencies in the time dimension, especially for time series data with strong long-term dependencies, there may be information loss problems. In addition, the precipitation process not only involves the spatial movement of clouds, but also includes the condensation and dissipation of clouds and the influence of terrain on them. How to design effective convolution operations to capture spatial features is also a difficulty.
[0004] Most of the above methods are based on radar echo data for precipitation prediction tasks. Radar echo data is the reflectivity of clouds and indirectly reflects the water vapor content in clouds. Relying solely on radar echo data for precipitation prediction may not fully capture the complex dynamic process of precipitation. In addition, radar echo data is affected by occlusion factors such as terrain and buildings, which may cause partial occlusion of precipitation scenes and lead to inaccurate prediction results. Therefore, the above methods have deficiencies in data quality, spatiotemporal feature modeling, training and prediction inference efficiency. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a precipitation prediction method, system, storage medium and electronic device in view of the problems existing in the prior art.
[0006] In a first aspect, an embodiment of the present invention provides a precipitation prediction method, comprising:
[0007] The satellite infrared data and ERA5 reanalysis data are temporally and spatially aligned and serialized through 3D convolution coding to obtain satellite infrared data sequences and ERA5 reanalysis data sequences.
[0008] Based on the global-local joint spatiotemporal attention mechanism and cross-modal fusion of the deep learning model, the satellite infrared data series and the ERA5 reanalysis data series are subjected to feature fusion and feature prediction to obtain the spatiotemporal feature sequence of predicted precipitation.
[0009] The predicted precipitation spatiotemporal feature sequence is restored to a precipitation grid image through 3D deconvolution decoding.
[0010] In a second aspect, an embodiment of the present invention provides a precipitation prediction system, which is used to implement the precipitation prediction method provided by the above technical solution, and the system includes:
[0011] A 3D convolutional coding module is used to perform spatiotemporal alignment and data serialization on the acquired satellite infrared data and ERA5 reanalysis data through 3D convolutional coding to obtain satellite infrared data sequences and ERA5 reanalysis data sequences;
[0012] The deep learning module is used to perform feature fusion and feature prediction on the satellite infrared data sequence and the ERA5 reanalysis data sequence based on the global-local joint spatiotemporal attention mechanism and cross-modal fusion of the deep learning model to obtain the spatiotemporal feature sequence of predicted precipitation;
[0013] The 3D deconvolution decoding module is used to restore the predicted precipitation spatiotemporal feature sequence into a precipitation grid image through 3D deconvolution decoding.
[0014] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute the precipitation prediction method provided by the above technical solution.
[0015] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the precipitation prediction method provided by the above technical solution is implemented.
[0016] In a fifth aspect, the present application further provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the precipitation prediction method provided in the above-mentioned various optional embodiments.
[0017] The beneficial effects of the present invention are: spatiotemporal alignment and data serialization of multi-source precipitation data are achieved through 3D convolutional coding, and effective fusion of multi-source data is achieved through the global-local joint spatiotemporal attention mechanism and cross-modal fusion of the deep learning model, and the attention mechanism processes the sequence data in parallel, which can improve the training and prediction efficiency while establishing strong sequence dependencies, thereby improving the precipitation prediction accuracy and prediction efficiency.
[0018] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A flowchart of a precipitation prediction method shown as an exemplary embodiment of the present application;
[0020] Figure 2 for Figure 1 A flowchart of step S101 in the illustrated embodiment in an exemplary embodiment;
[0021] Figure 3 for Figure 1 A flowchart of step S102 in the illustrated embodiment in an exemplary embodiment;
[0022] Figure 4 for Figure 3 A flowchart of step S301 in the illustrated embodiment in an exemplary embodiment;
[0023] Figure 5 for Figure 3 A flowchart of step S302 in the illustrated embodiment in an exemplary embodiment;
[0024] Figure 6 for Figure 3 A flowchart of step S303 in the illustrated embodiment in an exemplary embodiment;
[0025] Figure 7 A block diagram of a precipitation prediction system is shown as an exemplary embodiment of the present application;
[0026] Figure 8 A block diagram of a precipitation prediction system is shown as another exemplary embodiment of the present application;
[0027] Fig. 9 A structural block diagram of a global-local joint spatiotemporal attention mechanism provided for an exemplary embodiment of the present application;
[0028] Fig.10 A schematic diagram of a cross-modal fusion layer of a shared token provided for an exemplary embodiment of the present application;
[0029] Fig.11 It is a comparison chart between the precipitation prediction results provided by an exemplary embodiment of the present application and the prediction results of the prior art model. DETAILED DESCRIPTION
[0030] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0031] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0032] Most precipitation prediction methods based on deep learning are based on recurrent neural networks or convolutional neural networks. Among them, spatiotemporal prediction models based on recurrent neural networks (RNNs) include ConvLSTM, PredRNN-V2 and other models and their variants. RNN models are mainly used to capture temporal dependencies in time series data or spatial series data. They mostly use encoder-decoder structures, in which the encoder part is responsible for converting the input sequence into a hidden state of fixed length, and the decoder part is responsible for converting the hidden state into an output sequence. The long-term dependencies in the sequence data are captured by the hidden state in the model, which can be regarded as a kind of encoding of the sequence data, containing historical information of the past moments and providing information for prediction. Such models are all based on autoregression for prediction, that is, the predicted results can be used as model input to predict the results of the next moment. The prediction method based on autoregression makes this type of method only able to perform serial calculations during the inference process, and the calculation efficiency is low. In addition, the gradient of RNN is easy to disappear or explode when processing long sequences, making it difficult to train or unable to learn long-term dependency information. The hidden state in the model contains limited information, and information may also be lost when processing long sequences.
[0033] The spatiotemporal prediction models based on convolutional neural networks (CNN) include SimVP and TAU. CNN is a neural network mainly for image processing. High-dimensional convolution operations or by transforming the data dimension can also capture the spatiotemporal features in the data sequence. The appropriate convolution kernel size, step size, and depth of the convolution layer can effectively capture the local spatiotemporal features in the input data and improve the model's ability to perceive the data. Due to the parallelism of the convolution operation, CNN can use parallel computing hardware accelerators such as GPUs for efficient calculations, speeding up the training and prediction of the model. However, the ability to focus on local perception may make the model unable to effectively capture the global spatiotemporal relationship, especially when processing complex spatiotemporal data, and may not be able to fully express the nonlinear and high-order features in the data.
[0034] The precipitation process is a complex physical process involving multiple meteorological variables and has a certain degree of mutation. The RNN-based model may be easily affected by long-term dependencies in precipitation prediction tasks, resulting in gradient vanishing and gradient explosion problems, and the characteristics of serial calculation make its training and reasoning efficiency low. When processing precipitation spatiotemporal series data, the CNN-based model may not be able to fully capture the dependencies in the time dimension, especially for time series data with strong long-term dependencies, there may be information loss problems. In addition, the precipitation process not only involves the spatial movement of clouds, but also includes the condensation and dissipation of clouds and the influence of terrain on them. How to design effective convolution operations to capture spatial features is also a difficulty.
[0035] Most of the above methods are based on radar echo data for precipitation prediction tasks. Radar echo data is the reflectivity of clouds and indirectly reflects the water vapor content in clouds. Relying solely on radar echo data for precipitation prediction may not fully capture the complex dynamic process of precipitation. In addition, radar echo data is affected by occlusion factors such as terrain and buildings, which may cause partial occlusion of precipitation scenes and lead to inaccurate prediction results. Therefore, the above methods have deficiencies in data quality, spatiotemporal feature modeling, training and prediction inference efficiency.
[0036] First see Figure 1 , Figure 1 This is a flowchart of a precipitation prediction method shown in an exemplary embodiment of the present application. The method can be specifically executed by a server, which can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, etc., and is not limited here.
[0037] like Figure 1 As shown, in an exemplary embodiment, the precipitation prediction method may include steps S101 to S103, which are described in detail as follows:
[0038] S101, aligning the acquired satellite infrared data and ERA5 reanalysis data in time and space and serializing the data through 3D convolution coding to obtain satellite infrared data sequence and ERA5 reanalysis data sequence.
[0039] In the embodiment of the present invention, the satellite infrared data can select the satellite infrared data of 10 μm band, which can reflect the cloud top and surface temperature and has a high correlation with precipitation. ERA5 (ECMWF Reanalysis v5, the fifth generation of atmospheric reanalysis global climate data produced by the European Center for Medium-Range Weather Forecasts) reanalysis data can select hourly cumulative precipitation variables. The two data inputs provide the model with more information on precipitation processes to improve the accuracy of precipitation prediction.
[0040] In the embodiment of the present invention, 3D convolutional coding can realize spatiotemporal alignment and data serialization of satellite infrared data and ERA5 reanalysis data through two independent 3D convolutional encoders.
[0041] S102, based on the global-local joint spatiotemporal attention mechanism and cross-modal fusion of the deep learning model, feature fusion and feature prediction are performed on the satellite infrared data sequence and the ERA5 reanalysis data sequence to obtain the predicted precipitation spatiotemporal feature sequence.
[0042] S103, restoring the predicted precipitation spatiotemporal feature sequence into a precipitation grid image through 3D deconvolution decoding.
[0043] In an embodiment of the present invention, 3D deconvolution decoding may be implemented by a 3D deconvolution decoder. The 3D deconvolution decoder may be composed of upsampling layers composed of deconvolution operations with multiple convolution kernel sizes. The predicted precipitation feature sequence is restored to a precipitation grid image through multiple upsampling layers.
[0044] The 3D convolution encoder and the 3D deconvolution decoder can form a simple generator, so a simple discriminator can be set to help the 3D deconvolution decoder restore a more detailed and accurate precipitation image.
[0045] The embodiment of the present invention realizes the spatiotemporal alignment and data serialization of multi-source precipitation data through 3D convolutional coding, realizes the effective fusion of multi-source data through the global-local joint spatiotemporal attention mechanism and cross-modal fusion of the deep learning model, and the attention mechanism processes the sequence data in parallel, which can improve the training and prediction efficiency while establishing strong sequence dependency, thereby improving the precipitation prediction accuracy and prediction efficiency.
[0046] See also Figure 2 , Figure 2 for Figure 1 The step S101 in the embodiment shown is a flow chart in an exemplary embodiment. Figure 2 As shown, step S101 may specifically include steps S201 to S202. The satellite infrared data sequence and the ERA5 reanalysis data sequence are obtained through the above steps, which are described in detail as follows:
[0047] S201, input the satellite infrared data and ERA5 reanalysis data into two independent 3D convolution encoders respectively.
[0048] It should be noted that the input data is the sequence data of the sunflower 8 satellite infrared data and the ERA5 reanalysis data. Due to the different spatiotemporal resolutions of the two types of data, the two types of data are input into independent 3D convolution encoders. The 3D convolution encoder is composed of a stack of 3D convolutional ResNetBlocks (Residual Network Blocks), which are mainly used as an automatic encoder for precipitation data and realize spatiotemporal alignment of multi-source data. The embodiment of the present invention replaces all the original 2D convolution operations with 3D convolution operations, and adds a convolution downsampling layer to realize the spatiotemporal alignment of multi-source precipitation data.
[0049] S202, the 3D convolution encoder downsamples and serializes the input data sequence through a high-dimensional convolution operation to obtain a satellite infrared data sequence and an ERA5 reanalysis data sequence of the same scale.
[0050] In the embodiment of the present invention, firstly, multiple downsampling layers are formed by high-dimensional convolution operations, in which the convolution kernel sizes are set to different sizes to achieve different downsampling sizes, so as to achieve the purpose of spatiotemporal alignment of multi-source data. Then, the precipitation data serialization encoder composed of 3DResNetBlock stacking is entered to realize precipitation data serialization. The most important function realized by the encoder is to realize spatiotemporal alignment and precipitation data serialization of precipitation data of different sources and scales, so as to obtain sequence data of the same scale of multi-source data.
[0051] See also Figure 3 , Figure 3 for Figure 1 The step S102 in the illustrated embodiment is a flow chart in an exemplary embodiment. Figure 3 As shown, step S102 may specifically include steps S301 to S303. The predicted precipitation spatiotemporal feature sequence is obtained through the above steps, which is described in detail as follows:
[0052] S301, based on the global attention mechanism, the spatiotemporal information of the satellite infrared data sequence and the ERA5 reanalysis data sequence are extracted and encoded respectively to obtain the satellite infrared spatiotemporal feature sequence and the ERA5 reanalysis spatiotemporal feature sequence.
[0053] It should be noted that when the satellite infrared data and ERA5 reanalysis data are passed through the 3D convolution encoder for spatiotemporal information extraction and encoding, the two types of data are still processed in independent data streams.
[0054] The spatiotemporal information extraction encoding focuses on the spatiotemporal characteristics of historical precipitation data. Compared with ordinary spatial attention, the global 3D convolutional attention can simultaneously focus on the dependencies and changes in the three dimensions of time and space (space includes length and width).
[0055] S302, based on the shared token, cross-modal fusion is performed on the satellite infrared spatiotemporal feature sequence and the ERA5 reanalysis spatiotemporal feature sequence to obtain a fused precipitation spatiotemporal feature sequence.
[0056] In the embodiment of the present invention, a cross-modal fusion layer based on shared tokens realizes the fusion of spatiotemporal feature levels of multi-source data, and provides a deeply fused precipitation feature sequence for the subsequent prediction, inference and coding part.
[0057] S303, predicting, inferring and decoding the fused precipitation spatiotemporal feature sequence based on the local attention mechanism to obtain a predicted precipitation spatiotemporal feature sequence.
[0058] Since the movement of clouds during precipitation includes spatial movement, dissipation and aggregation, the changes such as dissipation and aggregation have stronger uncertainty and nonlinearity than spatial movement. In addition, the suddenness of precipitation requires the model to be provided with higher-dimensional and global information to learn the underlying laws and make predictive inferences based on these abstract characteristics.
[0059] Prediction, inference and decoding focus on the spatiotemporal features of precipitation data at future moments. The local attention is achieved by slicing the feature sequence input at this moment to limit the receptive field of the local attention calculation, perform attention calculation on the slices, and infer local details.
[0060] The prediction inference decoding based on the local attention mechanism predicts the hourly cumulative precipitation grid data for a preset time period in the future (such as the next 24 frames) according to the input fused precipitation spatiotemporal feature sequence data, and finally outputs the predicted precipitation sequence information.
[0061] In the embodiment of the present invention, the global 3D convolutional attention mechanism during spatiotemporal information extraction encoding and the local attention mechanism during prediction inference decoding together constitute a global-local joint spatiotemporal attention mechanism. Combining global and local information can improve the prediction accuracy of the model, because the model can consider global spatiotemporal changes while the model can more comprehensively consider information of different scales during the prediction process, and perform more refined processing on local details. And when predictive inference decoding is performed based on the local attention mechanism, the complexity of one attention calculation is reduced through sharding calculation, which accelerates the precipitation prediction inference process; cross-modal fusion based on shared tokens realizes effective deep fusion of multi-source data, thereby improving precipitation prediction accuracy and prediction efficiency.
[0062] See also Figure 4 , Figure 4 for Figure 3 The step S301 in the embodiment shown is a flow chart in an exemplary embodiment. Figure 4 As shown, step S301 may specifically include steps S401 to S403. The satellite infrared spatiotemporal characteristic sequence and the ERA5 reanalysis spatiotemporal characteristic sequence are obtained through the above steps, which are described in detail as follows:
[0063] S401, performs global spatiotemporal attention calculation on the satellite infrared data sequence / ERA5 reanalysis data sequence through the global 3D convolutional attention mechanism to obtain the spatiotemporal global importance weight of each feature position;
[0064] S402, performing weighted summation according to the spatiotemporal global importance weights to obtain the satellite infrared historical spatiotemporal characteristic sequence / ERA5 reanalysis historical spatiotemporal characteristic sequence;
[0065] S403, enhancing the characteristics of the satellite infrared historical spatiotemporal characteristic sequence / ERA5 reanalysis historical spatiotemporal characteristic sequence to obtain the satellite infrared spatiotemporal characteristic sequence / ERA5 reanalysis spatiotemporal characteristic sequence.
[0066] It should be noted that when the satellite infrared data and the ERA5 reanalysis data are subjected to spatiotemporal information extraction encoding after passing through the 3D convolution encoder, the two types of data are still processed in mutually independent data streams. That is, in the embodiment of the present invention, spatiotemporal information extraction encoding is performed on the satellite infrared data sequence and the ERA5 reanalysis data sequence respectively.
[0067] In an embodiment of the present invention, spatiotemporal information extraction encoding can be performed based on a spatiotemporal information extraction encoder. The spatiotemporal information extraction encoder performs deep spatiotemporal feature extraction on infrared data and ERA5 reanalysis precipitation data with separate data streams. Specifically, the spatiotemporal information extraction encoder includes a global 3D convolutional attention mechanism, a convolutional feedforward network, a temporal attention mechanism, and a linear feedforward network. When performing spatiotemporal information extraction encoding, the global spatiotemporal attention calculation is performed on the satellite infrared data sequence and the ERA5 reanalysis data sequence respectively through the global 3D convolutional attention mechanism to obtain the spatiotemporal global importance weight of each feature position, and then weighted summation is performed to obtain a weighted historical spatiotemporal feature sequence; the spatiotemporal feature enhancement is performed on the weighted historical spatiotemporal feature sequence through the convolutional feedforward network; the temporal attention calculation is performed on the enhanced weighted historical spatiotemporal feature sequence through the temporal attention mechanism to obtain the importance weight at each time step, and then weighted summation is performed to enhance the historical temporal features on the basis of the spatiotemporal feature sequence to obtain a spatiotemporal feature sequence with enhanced temporal features; the feature enhancement is performed on the spatiotemporal feature sequence with enhanced temporal features through the linear feedforward network.
[0068] See also Figure 5 , Figure 5 for Figure 3 The step S302 in the illustrated embodiment is a flow chart in an exemplary embodiment. Figure 5 As shown, step S302 may specifically include steps S501 to S503. The fused precipitation spatiotemporal feature sequence is obtained through the above steps, including:
[0069] S501, initializing a shared token, the shared token includes multiple tokens, and taking the ERA5 reanalysis spatiotemporal characteristic sequence and the satellite infrared spatiotemporal characteristic sequence as the primary mode and the secondary mode respectively;
[0070] S502, splicing the shared token after the satellite infrared spatiotemporal feature sequence corresponding to the secondary modality, and performing multi-head self-attention calculation, and the result is split to obtain a fused shared token;
[0071] S503, splicing the fused shared token after the ERA5 reanalysis spatiotemporal feature sequence corresponding to the main modality, and performing multi-head self-attention calculation based on the main modality to obtain the fused precipitation spatiotemporal feature sequence.
[0072] In the embodiment of the present invention, there is a cross-modal fusion layer of shared tokens between the spatiotemporal information extraction encoder part and the prediction inference decoder. At this time, the feature sequences of the two modalities flow from the independent spatiotemporal feature extraction encoders into the common cross-modal fusion layer. The fusion layer first needs to initialize the shared tokens including multiple tokens as a bridge for information transfer between the two modalities.
[0073] The embodiment of the present invention divides the two modes into a primary mode and a secondary mode. In this precipitation prediction task, the satellite infrared data needs to be inverted to obtain the precipitation, while the precipitation data in the ERA5 reanalysis data directly represents the precipitation. Therefore, the ERA5 hourly precipitation data is selected as the primary mode here.
[0074] The shared token is first spliced into the secondary modality for multi-head self-attention calculation. At this time, the important feature information of the secondary modality has flowed into the shared token. Then the shared token and the main modality are spliced for multi-head self-attention calculation. At this time, the important feature information of the secondary modality in the shared token will be correlated with the feature sequence of the main modality to extract cross-modal information with high correlation with the main modality. In the process of the shared token carrying the secondary modality information to participate in the main modality self-attention calculation, the main modality information is kept dominant, the useful information of the secondary modality is efficiently absorbed, and the deep fusion of features is realized.
[0075] Due to the focus and dynamic weight characteristics of the attention mechanism, the fused information is cross-modal information with greater relevance to the current modality, and as the number of layers increases, the cross-modal information in the shared token will be further abstracted to obtain higher-dimensional cross-modal information with greater weight, so that the feature information of the two modalities can be more deeply integrated. The ordinary cross-attention mechanism focuses more on matching the features of modality B with the information of modality A, rather than a fusion process. Therefore, the cross-modal fusion layer of the shared token is composed of self-attention. Based on the characteristics of the multi-head self-attention mechanism, it still focuses on the content of each modality itself, and selects cross-modal information that is more effective with the current modality through shared tokens.
[0076] See also Figure 6 , Figure 6 for Figure 3 The step S303 in the embodiment shown is a flow chart in an exemplary embodiment. Figure 6 As shown, step S303 may specifically include steps S601 to S605. The predicted precipitation spatiotemporal feature sequence is obtained through the above steps, including:
[0077] S601, performing local attention calculation on the randomly initialized future precipitation feature sequence through a local attention mechanism to obtain a spatial local importance weight of each feature position;
[0078] S602, performing weighted summation according to the spatial local importance weights to obtain a future spatial feature sequence;
[0079] S603, performing spatial feature enhancement and temporal attention calculation on the future spatial feature sequence to obtain a first future spatiotemporal feature sequence;
[0080] S604, performing temporal attention calculation on the first future spatiotemporal feature sequence and the fused precipitation spatiotemporal feature sequence to obtain a second future spatiotemporal feature sequence related to the historical sequence;
[0081] Specifically, temporal attention calculation is performed on the first future spatiotemporal feature sequence and the fused precipitation spatiotemporal feature sequence to obtain the time importance weight of the first future spatiotemporal feature sequence at each time step; weighted summation is performed according to the time importance weight to obtain the second future spatiotemporal feature sequence related to the historical time series.
[0082] S605, performing global spatial feature enhancement on the second future spatiotemporal feature sequence to obtain a predicted precipitation spatiotemporal feature sequence.
[0083] In the embodiment of the present invention, predictive inference decoding can be performed based on a predictive inference decoder. The predictive inference decoder limits the receptive field of local attention calculation by slicing the input feature sequence, performs attention calculation on the slices, and infers local details.
[0084] Specifically, the prediction inference decoder includes a local attention mechanism, a convolutional feedforward network, a temporal attention mechanism, and a linear feedforward network. First, the data is sliced into future precipitation feature sequences by dimensional transformation. The size of each slice is k×k, so the original H×W dimension becomes The local spatial attention mechanism is used to calculate the local spatial attention of the future precipitation feature sequence respectively, and the spatial local importance weight of each feature position is obtained, and then the weighted sum is performed to obtain the weighted future spatial feature sequence; the spatial feature of the weighted future spatial feature sequence is strengthened through the convolutional feedforward network; the temporal attention mechanism is used to calculate the temporal attention of the strengthened spatial feature sequence to obtain the importance weight at each time step, and then the weighted sum is performed to strengthen the future temporal features on the basis of the spatial feature sequence to obtain the first future spatiotemporal feature sequence; the important parameter matrix Q is calculated based on the first future spatiotemporal feature sequence, and the important parameter matrices K and V are calculated based on the fused spatiotemporal feature sequence, and then the temporal attention calculation is performed to obtain the importance weight at each time step of the first future spatiotemporal feature sequence, and then the weighted sum is performed to obtain the second future spatiotemporal feature sequence related to the historical time series; the global spatial feature of the second future spatiotemporal feature sequence is strengthened through the convolutional feedforward network to obtain the predicted precipitation spatiotemporal feature sequence.
[0085] Figure 7 FIG. 1 is a block diagram of a precipitation prediction system shown in an exemplary embodiment of the present application. Figure 7 As shown, in an exemplary embodiment, the precipitation prediction system is used to implement the precipitation prediction method provided by any of the above embodiments, and the system may include a 3D convolution encoding module 701, a deep learning module 702 and a 3D deconvolution decoding module 703.
[0086] The 3D convolutional coding module 701 is used to perform spatiotemporal alignment and data serialization on the acquired satellite infrared data and ERA5 reanalysis data through 3D convolutional coding to obtain a satellite infrared data sequence and an ERA5 reanalysis data sequence;
[0087] A deep learning module 702 is used to perform feature fusion and feature prediction on the satellite infrared data sequence and the ERA5 reanalysis data sequence based on the global-local joint spatiotemporal attention mechanism and cross-modal fusion of the deep learning model to obtain a predicted precipitation spatiotemporal feature sequence;
[0088] The 3D deconvolution decoding module 703 is used to restore the predicted precipitation spatiotemporal feature sequence into a precipitation grid image through 3D deconvolution decoding.
[0089] An embodiment of the present invention further provides a computer-readable storage medium, comprising instructions, which, when executed on a computer, enable the computer to execute a precipitation prediction method as provided in any of the above embodiments.
[0090] An embodiment of the present invention further provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a precipitation prediction method as provided in any of the above embodiments is implemented.
[0091] Figure 8 FIG. 1 is a block diagram of a precipitation prediction system shown in another exemplary embodiment of the present application. Figure 8 As shown, the rainfall prediction method provided by any of the above embodiments can be implemented based on the system. The system adopts a precipitation prediction model based on multi-source data fusion of the Transformer architecture deep learning model on the basis of the VPTR (Video Prediction Transformer) model.
[0092] The satellite infrared data (such as the Sunflower 8 satellite infrared data) and the ERA5 (ECMWF Reanalysis v5, the fifth generation of atmospheric reanalysis global climate data produced by the European Centre for Medium-Range Weather Forecasts) reanalysis data hourly precipitation data are integrated to predict precipitation, improve the accuracy of precipitation prediction and improve the prediction efficiency.
[0093] The core of the Transformer framework is the attention mechanism, which can process sequences in parallel and improve training and prediction efficiency while establishing strong sequence dependencies. The embodiment of the present invention proposes a new global-local joint spatiotemporal attention mechanism and a cross-modal fusion layer of shared tokens to achieve effective fusion of multi-source data and improve precipitation prediction accuracy.
[0094] The overall precipitation prediction model is a 3D convolutional encoder-3D deconvolutional decoder structure, with a transformer structure module Multimodal-VidHRFormer (Multimodal Video High-resolution transformer) in the middle. This module proposes a global-local joint spatiotemporal attention mechanism and a cross-modal fusion layer of shared tokens based on the original VidHRFormer.
[0095] The 3D convolution encoder is composed of a stack of 3D convolution ResNetBlock (Residual Network Block) to realize the automatic encoder of precipitation data and realize the spatiotemporal alignment of multi-source data. The embodiment of the present invention replaces all the original 2D convolution operations with 3D convolution operations, and adds a convolution downsampling layer to realize the spatiotemporal alignment of multi-source precipitation data. The input data is the sequence data of the sunflower 8 satellite infrared data and the ERA5 reanalysis data. Since the spatiotemporal resolution of the two data is different, the two data are input into independent encoders respectively. First, multiple downsampling layers are formed by high-dimensional convolution operations, in which the convolution kernel sizes are set to different sizes to achieve different downsampling sizes, so as to achieve the purpose of spatiotemporal alignment of multi-source data. Then enter the self-encoder of precipitation data composed of 3D ResNetBlock stacking to realize precipitation data serialization. The most important function realized by the encoder is to realize spatiotemporal alignment and precipitation data serialization of precipitation data of different sources and scales, so as to obtain sequence data of the same scale of multi-source data.
[0096] The 3D deconvolution decoder consists of multiple upsampling layers implemented by deconvolution operations with different convolution kernel sizes, which is used to restore the precipitation sequence information inferred and predicted by the Multimodal-VidHRFormer module to the precipitation grid image output through multiple upsampling layers.
[0097] The 3D convolution encoder and the 3D deconvolution decoder can form a simple generator, so a simple discriminator can be set to help the decoder restore a more detailed and accurate precipitation image.
[0098] The Multimodal-VidHRFormer module consists of three parts: the spatiotemporal information extraction encoder, the cross-modal fusion layer of shared tokens, and the predictive inference decoder. The spatiotemporal information extraction encoder extracts deep spatiotemporal features from infrared data and ERA5 reanalysis precipitation data in separate data streams; the cross-modal fusion layer of shared tokens realizes the fusion of spatiotemporal features of multi-source data, and provides a deep fused precipitation feature sequence for the subsequent predictive inference encoder; the predictive inference decoder predicts the future 24 frames of precipitation grid data based on the input fused historical precipitation spatiotemporal feature sequence data, and finally outputs the sequence information of the predicted precipitation.
[0099] Satellite infrared data and ERA5 reanalysis data are input into the spatiotemporal information extraction encoder after passing through the 3D convolution encoder. At this time, the two types of data are still processed in independent data streams.
[0100] The spatiotemporal information extraction encoder is mainly composed of the global 3D convolutional attention mechanism Global 3D attn, the convolutional feedforward network Conv FFN, the temporal attention mechanism Temporal attn, and the linear feedforward network FFN. The prediction inference decoder is composed of the local attention mechanism Local attn, the convolutional feedforward network Conv FFN, the temporal attention mechanism Temporalattn, and the linear feedforward network FFN. The front and back global 3D convolutional attention and local window attention simultaneously constitute the global local joint spatiotemporal attention mechanism.
[0101] Fig. 9 A block diagram of the global-local joint spatiotemporal attention mechanism structure provided by an exemplary embodiment of the present application. Fig. 9 The structure on the left can be used to abstractly study the spatial and temporal characteristics of precipitation in the region. Fig. 9 The structure in the right figure can abstract the spatiotemporal characteristics of precipitation in the local research area. By mastering the global characteristics of precipitation, the precipitation characteristics of the local area can be inferred in depth. By combining global and local features, the model can more accurately predict specific areas. In the figure, Global 3D Conv Attention represents the global 3D convolutional spatiotemporal attention mechanism, and Local SpatialAttention represents the local spatial attention mechanism. Among them, X is the input, and Patch indicates that the input needs to be sliced. Q, K, and V are the weight matrices that need to be calculated. Conv3D represents a three-dimensional convolution operation, and Linear represents a linear operation. Out represents the output. H, T, and W represent the data dimensions in the calculation of the global 3D convolutional spatiotemporal attention mechanism, indicating the original time sequence and length and width of the data. K and n represent the data dimensions in the calculation of the local spatial attention mechanism, K represents the size of the slice, and n represents the number of slices.
[0102] The spatiotemporal information extraction encoder focuses on the spatiotemporal characteristics of historical precipitation data. Compared with ordinary spatial attention, the global 3D convolutional attention can simultaneously focus on the dependencies and changes in the three dimensions of time and space through high-dimensional attention calculation; the necessary weight parameter QKV of the attention mechanism is obtained based on the 3D convolution method, and the invariant absolute spatiotemporal position encoding is added to further enhance its global information perception of time and space. The weight matrix QKV performs global spatiotemporal attention calculation according to the multi-head attention formula. The result contains the spatiotemporal characteristics and relationships most relevant to the input precipitation characteristics and the current task objectives. The result is input into the convolutional feedforward network to further enhance the spatiotemporal characteristics. Then, the temporal attention mechanism is entered. This attention mechanism is implemented by ordinary multi-head attention. It is necessary to change the dimension of the input sequence to realize the attention calculation of the temporal dimension, further extract the time change characteristics, and then input the linear feedforward network composed of linear operations to enhance the temporal characteristics.
[0103] Since the movement of clouds during precipitation includes spatial movement, dissipation and aggregation, the changes such as dissipation and aggregation have stronger uncertainty and nonlinearity than spatial movement. In addition, the suddenness of precipitation requires the model to be provided with higher-dimensional and global information to learn the underlying laws and make predictive inferences based on these abstract characteristics.
[0104] The prediction and inference decoder focuses on the spatiotemporal features of precipitation data at future moments. The local attention is calculated by slicing the feature sequence input at this time to limit the receptive field of the local attention calculation, and the attention is calculated on the slices to infer the local details. First, the data is sliced by dimensional transformation. The size of each slice is k×k, so the original H×W dimension becomes Then, multi-head attention calculation is performed, and the calculation range is focused on the range of k×k. Then, the temporal attention mechanism is entered. This attention mechanism is implemented by ordinary multi-head attention. It is necessary to change the dimension of the input sequence to realize the attention calculation of the temporal dimension, further calculate the time variation characteristics of precipitation at future moments, and then input the linear feedforward network composed of linear operations to strengthen the temporal characteristics.
[0105] Combining global and local information can improve the prediction accuracy of the model, because the model can consider global spatiotemporal changes while taking into account information of different scales more comprehensively during the prediction process, and process local details more finely. At the same time, due to the sharding calculation, the complexity of the attention calculation is reduced, which speeds up the precipitation prediction inference process.
[0106] Fig.10 is a schematic diagram of a cross-modal fusion layer of a shared token provided by an exemplary embodiment of the present application. Fig.10 As shown in the figure, multi-head self-attention calculation is performed through shared tokens, cross-modal information is exchanged, and multi-source data spatiotemporal information is deeply integrated to provide the model with more comprehensive spatiotemporal features to improve the model prediction accuracy. Shared token represents shared tokens, Multi-head Self-Attn represents multi-head self-attention calculation, and FN represents feedforward network. ×N means that the layer is stacked with N layers.
[0107] Between the spatiotemporal information extraction encoder part and the prediction inference decoder is a cross-modal fusion layer that shares tokens. At this time, the feature sequences of the two modalities flow from the independent spatiotemporal feature extraction encoders into the common cross-modal fusion layer.
[0108] The fusion layer first needs to initialize a shared token including multiple tokens as a bridge for information transmission between the two modalities. The embodiment of the present invention divides the two modalities into a primary modality and a secondary modality. In this precipitation prediction task, the satellite infrared data needs to be inverted to obtain precipitation, and the precipitation data in the ERA5 reanalysis data directly represents the precipitation. Therefore, the ERA5 hourly precipitation data is selected as the primary modality here. The shared token is first spliced in the secondary modality for multi-head self-attention calculation. At this time, the important feature information of the secondary modality has flowed into the shared token. Then the shared token and the primary modality are spliced for multi-head self-attention calculation. At this time, the important feature information of the secondary modality in the shared token will be correlated with the feature sequence of the primary modality to extract cross-modal information with high correlation with the primary modality.
[0109] In the process of the shared token carrying the secondary modal information to participate in the self-attention calculation of the main modality, the main modal information is kept dominant, and the useful information of the secondary modality is efficiently absorbed to achieve deep fusion. Due to the focus and dynamic weight characteristics of the attention mechanism, the fused information is cross-modal information with greater relevance to the current modality, and as the number of layers increases, the cross-modal information in the shared token will be further abstracted to obtain higher-dimensional cross-modal information with greater weight, so that the feature information of the two modalities can be more deeply integrated. The ordinary cross-attention mechanism focuses more on matching the features of modality B with the information of modality A, rather than a fusion process. Therefore, the cross-modal fusion layer of the shared token is composed of self-attention. Based on the characteristics of the multi-head self-attention mechanism, it still focuses on the content of each modality itself, and selects cross-modal information that is more effective with the current modality through the shared token.
[0110] The operation process of the rainfall prediction model of the present application is described in detail below with reference to a specific example.
[0111] The running environment of this model is: a GPU model: NVIDIA A100 80GB PCIe; programming language: python3.8.19; deep learning framework version: PyTorch:1.13.1+cu116.
[0112] The meteorological data that need to be input into this model include satellite infrared data in the 10μm band and ERA5 reanalysis data hourly cumulative precipitation data. The means of data preprocessing can include deletion, filling, slicing and normalization. Among them, there are certain omissions in the satellite data, and it is generally chosen to delete the data at that moment. After ensuring the data quality, the data is cut according to the study area. At this time, the cutting needs to unify the boundary range of the two data. After the data is processed, all the data are sliced by sliding window; the data of the sliding window uses the data of the past 5 hours and the next 24 hours as the historical input data and the true value of the future prediction data, respectively, and the length of each sliding step is 1. In this way, all the experimental data are sliced. Finally, the training data and test data are normalized using a linear function.
[0113] For the precipitation prediction in the Sanjiangyuan area, the data was preprocessed and clipped for the first time to obtain the input satellite infrared spatiotemporal series data. and ERA5 reanalysis precipitation data T 1 、T 2 X 1 and X 2 The data time step, C 1 , C 2 X 1 and X 2 The number of channels, H 1 , H 2 X 1 and X 2 Corresponding to the length of the sliding window, W 1 , W 2 X 1 and X 2 The width of the corresponding sliding window. After the two data are input in batch size, they first enter the 3D convolution operation in the Encoder to achieve downsampling, which consists of multiple convolution blocks with different convolution kernel sizes. Each convolution block can be expressed as:
[0114] X′ i =ReLU(3DConv(X i )) (1)
[0115] Where, X i Indicates the input satellite infrared data / ERA5 reanalysis data, X' i It represents the satellite infrared data / ERA5 reanalysis data after 3D convolution downsampling and spatial alignment. At this time, the spatial and temporal resolution of the satellite infrared spatial and temporal data and the ERA5 reanalysis data are unified. After that, the data flows into the Encoder composed of 3D ResNet Block stacks for 3D convolution operation, ReLU function activation and residual connection operation:
[0116] X″ i =X′ i +ReLU(3DConv(X′ i )) (2)
[0117] In the formula, X″ i It means the serialized data of satellite infrared data / ERA5 reanalysis data obtained after multiple layers of 3D ResNet Block. The feature sequence obtained by stacking 3D ResNet Block contains highly abstract spatiotemporal feature information. At this time, the satellite infrared data feature sequence data and the ERA5 reanalysis precipitation feature sequence data Their dimensions are consistent. model It is the vector dimension size in the model calculation, B is a Batchsize, that is, the number of all samples input to the model at one time, T is the data time step, H is the length of the data space range, and W is the width of the data space atmosphere.
[0118] After that, the feature sequence flows into the spatiotemporal information extraction encoder part of the Multimodal-VidHRFormer module, which consists of global 3D convolutional spatiotemporal attention, convolutional feedforward network, temporal attention and linear feedforward network. The feature data sequences of the two data enter separate spatiotemporal information extraction encoders. The actual operation of the data in the global 3D convolutional spatiotemporal attention can be formulated as:
[0119] MHSA global (Z) = Concat[head(Z) 1 ,head(Z) 2 ,…,head(Z) i ] (3)
[0120]
[0121] Formula (3)MHSA global is the global 3D convolutional spatiotemporal multi-head attention calculation, Z is the input feature sequence, head represents each calculation head, and concat represents the concatenation of the structures obtained by each calculation head. The details of the attention calculation of each head are described in formula (4), and softmax is an activation function. Q , W K , W V is the weight matrix obtained by the 3D convolution operation, ZW Q , ZW K , ZW V The key variables Q, K, and V for attention calculation are calculated, and on this basis, the absolute spatiotemporal position encoding that remains unchanged is added to Q and K.model is the length of the feature sequence vector, and h is the number of calculation heads.
[0122] After the global 3D convolutional spatiotemporal multi-head attention calculation, a residual connection is performed, and then the convolutional feedforward network is entered, which consists of three layers of convolutions with convolution kernel sizes of 1×1, 3×3, and 1×1 respectively. The spatiotemporal data feature sequence is obtained Perform dimension conversion to obtain The time series multi-head attention calculation is implemented with the help of the nn.MultiheadAttention() basic function in the torch library. Its formula content is shown in formula (3) and formula (4). Then the linear feedforward network calculation is directly performed, which consists of two linear layers and activation functions. The feature data obtained at this time Convert the dimension again to Enter this module for multi-layer calculations.
[0123] The data is calculated after the spatiotemporal information extraction encoder to obtain the high-order feature sequence Z 1 ,Z 2 The cross-modal fusion layer flows into the shared token. First, a normally distributed shared token is initialized In this embodiment, N=4. The feature data dimension also needs to be changed accordingly: The cross-modal fusion layer is calculated based on the multi-head self-attention mechanism, and its process is formulated as:
[0124] MHSA fusion (Z 1 ′)=nn.MultiheadAttention(Concat[Z 1 ,K]) (5)
[0125] K′=Z 1 ′[:,:-N,:] (6)
[0126] MHSA fusion (Z 2 ′)=nn.MultiheadAttention(Concat[Z 2 ,K′]) (7)
[0127] MHSA is achieved by concatenating the shared tokens on the second dimension of the feature sequence and then performing multi-head self-attention calculations. fusion represents the multi-head self-attention calculation of the fusion layer, where K represents the shared token. Formula (6) represents the shared token from the first self-attention calculation result Z′ 1 After splitting, the N tokens are obtained to obtain the shared token K' with fusion information, which is then merged into the second modal data feature sequence Z2 Calculate the result Z' 2 In the calculation of stacked shared token cross-modal fusion layers, it is only necessary to initialize the shared tokens in the first layer, and then the shared tokens are transferred between different layers. Finally, one of the fused features is taken In this embodiment, the feature sequence after the fusion of ERA5 reanalysis precipitation data is selected to input into the prediction and inference decoder.
[0128] The structure of the prediction inference decoder is similar to that of the spatiotemporal information extraction encoder, in which the global 3D convolutional spatiotemporal multi-head attention is replaced by the local window spatial attention. Therefore, it is necessary to divide the feature sequence dimension to achieve sharding, thereby limiting the attention calculation receptive field. In this embodiment, the shard size k = 4, and the future precipitation feature sequence is sharded to obtain {Z 1 ,Z 2 ,…,Z P}at this time is the number of shards, and T' is the time step of future precipitation data. Input the local window spatial attention to calculate the local spatial details. At this time, the model starts to calculate and predict the local spatial information based on the global high-order spatiotemporal information features. The global high-order spatiotemporal information features provide key information of the entire range to a certain extent, and adaptively adjust the allocation of attention according to the task requirements to focus on the reasoning of the features of local details. The calculation formula of the local spatial attention after sharding is as follows:
[0129]
[0130] In the formula, MHSA lcoal represents the local spatial multi-head attention calculation, Z p is the sequence feature after sharding. In the calculation of local spatial attention, fixed absolute spatial position encoding is added to the two key variables Q and K. The calculated feature is then restored to the dimension The input is fed into the subsequent convolutional feedforward network, temporal attention and linear feedforward network, as well as the temporal attention and convolutional feedforward network in which the historical precipitation spatiotemporal feature sequence participates. The final feature sequence is fed into the decoder of the model.
[0131] The decoder is composed entirely of deconvolution operations, and its main purpose is to restore the final prediction feature sequence obtained by the prediction inference decoder to the precipitation grid data output. The decoder is symmetrical with the convolution downsampling process of the encoder, including 2D deconvolution operations, normalization layers, and activation functions, which can be expressed as:
[0132] Y=ReLU(norm(ConvTranspose2d(Z))) (10)
[0133] In the above formula, Z is the input predicted future precipitation feature sequence, ReLU is an activation function, norm is the normalization layer, and ConvTranspose2d is a 2D deconvolution operation. Finally, the predicted precipitation grid data Y∈R B×T'×C×H×W , C is the number of precipitation grid data channels, and C is actually 1. In this embodiment, the hourly cumulative precipitation grid data of the Sanjiangyuan area in the next 24 hours is predicted, so the prediction time T'=24. The precipitation grid data can be visualized through library functions such as matplotlib.
[0134] Fig.11 : is a comparison chart of the precipitation prediction results provided by an exemplary embodiment of the present application and the prediction results of the prior art model. Fig.11 As shown, the first row Ground Truth is the visualization result of the real hourly precipitation grid data of ERA5. The vertical axis is the name of the spatiotemporal prediction method, including the above-mentioned RNN-based spatiotemporal prediction methods ConvLSTM and PredRNN-V2, and the CNN-based spatiotemporal prediction models SimVP and TAU. It also includes a basic model VPTR of an embodiment of the present invention. Ours represents the precipitation prediction result of the model of the present invention. In the last two rows, Ours-GT represents the absolute difference between the prediction result of this model and the true value, and VPTR-GT represents the visualization of the absolute difference between the prediction result of the VPTR model and the true value. The lighter the color, the higher the prediction accuracy.
[0135] The precipitation prediction method based on multi-source data fusion of the Transformer framework proposed in the embodiment of the present invention has improved mean square error (MSE) and root mean square error (MAE) indicators compared to the prediction results of the prior art models. Compared with the spatiotemporal prediction models ConvLSTM and PredRNN-V2 based on RNN, the average MSE per frame is reduced by about 100, and compared with the spatiotemporal prediction models SimVP and TAU based on CNN, the average MSE per frame is reduced by about 30. This method is better than the RNN-based ConvLSTM and PredRNN-V2 models in training and prediction efficiency, and is comparable to the CNN-based SimVP and TAU models. It is better than the above-mentioned models in terms of prediction detail accuracy, the precipitation prediction focus is more accurate, and the problem of low prediction intensity is also reduced.
[0136] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0137] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0138] 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 embodiments of the present invention.
[0139] 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.
[0140] 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 is essentially 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. The computer software product is stored in a storage medium, including several 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 methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0141] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A precipitation prediction method, It is characterized in that include: The satellite infrared data and ERA5 reanalysis data are temporally and spatially aligned and serialized through 3D convolution coding to obtain satellite infrared data sequences and ERA5 reanalysis data sequences. Based on the global-local joint spatiotemporal attention mechanism and cross-modal fusion of the deep learning model, feature fusion and feature prediction are performed on the satellite infrared data sequence and the ERA5 reanalysis data sequence to obtain the predicted precipitation spatiotemporal feature sequence; The predicted precipitation spatiotemporal feature sequence is restored to a precipitation grid image through 3D deconvolution decoding.
2. The method according to claim 1, It is characterized in that The satellite infrared data and ERA5 reanalysis data are temporally and spatially aligned and serialized by 3D convolution coding to obtain satellite infrared data sequences and ERA5 reanalysis data sequences, including: The satellite infrared data and ERA5 reanalysis data are input into two independent 3D convolution encoders respectively; The 3D convolution encoder downsamples and serializes the input data sequence through a high-dimensional convolution operation to obtain a satellite infrared data sequence and an ERA5 reanalysis data sequence of the same scale.
3. The method according to claim 1, It is characterized in that The global-local joint spatiotemporal attention mechanism and cross-modal fusion based on the deep learning model perform feature fusion and feature prediction on the satellite infrared data sequence and the ERA5 reanalysis data sequence to obtain a predicted precipitation spatiotemporal feature sequence, including: Based on the global attention mechanism, the satellite infrared data sequence and the ERA5 reanalysis data sequence are respectively subjected to spatiotemporal information extraction and encoding to obtain the satellite infrared spatiotemporal feature sequence and the ERA5 reanalysis spatiotemporal feature sequence; Based on the shared token, the satellite infrared spatiotemporal feature sequence and the ERA5 reanalysis spatiotemporal feature sequence are cross-modally fused to obtain a fused precipitation spatiotemporal feature sequence; The fused precipitation spatiotemporal feature sequence is predicted, inferred and decoded based on the local attention mechanism to obtain a predicted precipitation spatiotemporal feature sequence.
4. The method according to claim 3, It is characterized in that The method of extracting and encoding the spatiotemporal information of the satellite infrared data sequence and the ERA5 reanalysis data sequence based on the global attention mechanism to obtain the satellite infrared spatiotemporal feature sequence and the ERA5 reanalysis spatiotemporal feature sequence includes: The global spatiotemporal attention is calculated on the satellite infrared data sequence / ERA5 reanalysis data sequence through a global 3D convolutional attention mechanism to obtain the spatiotemporal global importance weight of each feature position; Perform weighted summation according to the spatiotemporal global importance weights to obtain the satellite infrared historical spatiotemporal characteristic sequence / ERA5 reanalysis historical spatiotemporal characteristic sequence; The satellite infrared historical spatiotemporal characteristic sequence / ERA5 reanalysis historical spatiotemporal characteristic sequence is enhanced to obtain a satellite infrared spatiotemporal characteristic sequence / ERA5 reanalysis spatiotemporal characteristic sequence.
5. The method according to claim 3, It is characterized in that The cross-modal fusion of the satellite infrared spatiotemporal feature sequence and the ERA5 reanalysis spatiotemporal feature sequence based on the shared token to obtain a fused precipitation spatiotemporal feature sequence includes: Initializing a shared token, the shared token comprising a plurality of tokens, and taking the ERA5 reanalysis spatiotemporal characteristic sequence and the satellite infrared spatiotemporal characteristic sequence as the primary mode and the secondary mode respectively; The shared token is spliced after the satellite infrared spatiotemporal feature sequence corresponding to the secondary modality, and multi-head self-attention calculation is performed, and the result is split to obtain a fused shared token; The fused shared token is spliced after the ERA5 reanalysis spatiotemporal feature sequence corresponding to the main modality, and a multi-head self-attention calculation based on the main modality is performed to obtain a fused precipitation spatiotemporal feature sequence.
6. The method according to claim 3, It is characterized in that The predicting, inferring and decoding the fused precipitation spatiotemporal feature sequence based on the local attention mechanism to obtain the predicted precipitation spatiotemporal feature sequence includes: The local attention mechanism is used to calculate the local spatial attention of the randomly initialized future precipitation feature sequence to obtain the spatial local importance weight of each feature position; Performing weighted summation according to the spatial local importance weights to obtain a future spatial feature sequence; Performing spatial feature enhancement and temporal attention calculation on the future spatial feature sequence to obtain a first future spatiotemporal feature sequence; Performing temporal attention calculation on the first future spatiotemporal feature sequence and the fused precipitation spatiotemporal feature sequence to obtain a second future spatiotemporal feature sequence related to the historical sequence; The global spatial characteristics of the second future spatiotemporal characteristic sequence are enhanced to obtain a predicted precipitation spatiotemporal characteristic sequence.
7. The method according to claim 6, It is characterized in that The performing temporal attention calculation on the first future spatiotemporal feature sequence and the fused precipitation spatiotemporal feature sequence to obtain a second future spatiotemporal feature sequence related to the historical sequence includes: Performing temporal attention calculation on the first future spatiotemporal feature sequence and the fused precipitation spatiotemporal feature sequence to obtain a time importance weight at each time step of the first future spatiotemporal feature sequence; A weighted sum is performed according to the time importance weights to obtain a second future spatiotemporal feature sequence related to the historical time series.
8. A precipitation prediction system, It is characterized in that For implementing the precipitation prediction method according to any one of claims 1 to 7, the system comprises: A 3D convolutional coding module is used to perform spatiotemporal alignment and data serialization on the acquired satellite infrared data and ERA5 reanalysis data through 3D convolutional coding to obtain satellite infrared data sequences and ERA5 reanalysis data sequences; A deep learning module, for performing feature fusion and feature prediction on the satellite infrared data sequence and the ERA5 reanalysis data sequence based on a global-local joint spatiotemporal attention mechanism and cross-modal fusion of a deep learning model, to obtain a predicted precipitation spatiotemporal feature sequence; The 3D deconvolution decoding module is used to restore the predicted precipitation spatiotemporal feature sequence into a precipitation grid image through 3D deconvolution decoding.
9. A computer-readable storage medium comprising instructions, It is characterized in that When the instructions are executed on a computer, the computer is enabled to execute the precipitation prediction method according to any one of claims 1 to 7.
10. An electronic device, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the precipitation prediction method according to any one of claims 1 to 7 when executing the program.
Citation Information
Patent Citations
Short temporary rainfall prediction method based on space-time attention and data fusion
CN114764602A
Video behavior recognition method based on cross-modal fusion
CN116311525A
Remote sensing image change detection method based on local-global Transform network
CN116434069A
Mode rainfall forecast correction method based on deep learning and wind cloud satellite
CN116840941A
Multi-source data fused long-sequence radar image prediction method and system
CN117368881A
Cited By
Rainfall inversion method based on satellite data multi-branch fusion and geographic information correction
CN119150146A
Infrared rainfall prediction and model training method and device, and electronic equipment
CN121033686A
