A light-weight short-time precipitation prediction method based on context attention fusion
By introducing deformable convolution, context-dilation awareness, and neighboring layer feature fusion modules, combined with the SMamba module, a lightweight short-term precipitation prediction model is constructed, which solves the problems of structural complexity and deployment adaptability of existing models and achieves high-precision and low-cost prediction results.
Patent Information
- Application Number
- CN202511358042.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-09-23
AI Technical Summary
Existing short-term precipitation prediction models are complex in structure, lack spatiotemporal modeling capabilities, have limited contextual information fusion, and poor deployment adaptability, making them difficult to effectively deploy on resource-constrained small and medium-sized meteorological stations and mobile terminals.
A lightweight short-term precipitation prediction method based on contextual attention fusion is adopted, which introduces a deformable convolutional module DC, a contextual expansion perception module C, a neighboring layer feature fusion module F, and an SMamba module to enhance the perception of nonlinear complex precipitation image features and model long-range temporal dependencies, thereby reducing model parameters.
It improves prediction accuracy and boundary clarity, reduces computational costs, has good real-time prediction performance and engineering availability, and is suitable for resource-constrained equipment deployments.
Smart Images

Figure CN120871304B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a lightweight short-term precipitation prediction method based on contextual attention fusion, belonging to the field of short-term precipitation prediction technology. Background Technology
[0002] Short-term precipitation forecasting typically refers to predicting the evolution of precipitation within the next 0-2 hours. This task requires high temporal and spatial resolution for early warning response and is widely used in areas such as traffic management, agricultural production, urban flood control, and meteorological disaster early warning. Therefore, developing accurate and efficient short-term precipitation forecasting models is of great significance for improving public safety and ensuring the smooth operation of society.
[0003] Traditional forecasting methods mainly include numerical weather prediction (NWP) and image extrapolation. NWP uses atmospheric physical models combined with initial field data for numerical integration calculations, making it suitable for medium- and long-term weather forecasts. However, this method is highly dependent on computational resources, has limited forecast update frequency, requires a supercomputing platform, and faces accuracy bottlenecks at short timescales of 0-2 hours due to rapid error growth. Image extrapolation methods (such as optical flow) infer future trends based on the spatial displacement of cloud clusters in radar image sequences, offering advantages in real-time performance and speed. However, it has weak modeling capabilities for changes in precipitation intensity and struggles to accurately address the highly nonlinear and locally sudden evolution characteristics.
[0004] With the accumulation of meteorological data and the development of artificial intelligence technology, data-driven deep learning forecasting models are becoming increasingly mature. Among them, Convolutional Neural Networks (CNNs), with their advantages in image recognition and spatial structure modeling, are widely used in precipitation prediction tasks for radar image sequences. In particular, as one of the most commonly used CNN architectures, UNet, due to its symmetrical structure, controllable parameters, and strong adaptability, is widely used in image segmentation and reconstruction tasks, and also provides an effective basic structure for meteorological image sequence prediction.
[0005] However, traditional UNet models also have certain limitations in precipitation forecasting tasks. On the one hand, their spatial feature modeling capabilities are limited; traditional convolutional kernels struggle to adaptively handle the nonlinear deformation of complex boundaries, affecting the edge sharpness of predicted images, and they lack explicit temporal modeling mechanisms, failing to fully utilize time-dependent information. On the other hand, the UNet structure is not sufficiently robust in its mechanisms for complex feature extraction and cross-scale, cross-level feature interaction, limiting its ability to characterize complex image structures and details. Furthermore, most current deep learning models, while pursuing prediction accuracy, often involve a large number of parameters and high computational resource consumption, making them difficult to deploy on small and medium-sized weather stations, edge devices, or mobile terminals with limited computing power, thus restricting their rapid integration and promotion in resource-constrained scenarios. Therefore, designing a lightweight short-term precipitation forecasting model that combines high-precision prediction performance with good deployment capabilities has become a critical issue that urgently needs to be addressed. Summary of the Invention
[0006] The technical problem to be solved by this invention is to provide a lightweight short-term precipitation prediction method based on contextual attention fusion, which solves the problems of complex model structure, insufficient spatiotemporal modeling capability, limited contextual information fusion and poor deployment adaptability in the existing technology.
[0007] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0008] A lightweight short-term precipitation prediction method based on contextual attention fusion includes the following steps:
[0009] Step 1: Acquire a continuous sequence of weather radar images. Using a sliding window strategy, slice the acquired continuous weather radar image sequence according to a preset step size. The window contains slices from the previous slice to the next slice. The input image sequence and the subsequent frames The output image sequence consists of frames, and the window length is [missing information]. and The sum of these samples, controlled by a preset step size, generates several samples from a continuous sequence of weather radar images. All samples together constitute a weather radar image dataset.
[0010] Step 2: Preprocess the meteorological radar image dataset by dividing the preprocessed dataset into a training set, a validation set, and a test set.
[0011] Step 3: Construct a lightweight short-term precipitation prediction model based on contextual attention fusion, which is used to predict the precipitation in the future preset second time period using the historical preset first time period of the current moment. The historical preset first time period and the future preset second time period are continuous. The model takes the input image sequence as input and the generated prediction image sequence as output.
[0012] The lightweight short-term precipitation prediction model based on contextual attention fusion includes an encoder, a decoder, and a bottleneck layer connecting the encoder and decoder.
[0013] Step 4: Use the training set and validation set to train and validate the lightweight short-term precipitation prediction model based on contextual attention fusion constructed in Step 3, and obtain the trained lightweight short-term precipitation prediction model.
[0014] Step 5: Input the input image sequence from the test set into the trained lightweight short-term precipitation prediction model to obtain the short-term precipitation prediction results.
[0015] Compared with the prior art, the present invention, employing the above technical solution, has the following technical effects:
[0016] 1. This invention introduces a deformable convolution module (DC) to enhance the ability to perceive and extract features from nonlinear and complex precipitation images.
[0017] 2. The present invention designs a context expansion perception module C, which uses parallel dilated convolution to capture rich contextual information and improve the model’s sensitivity to complex spatial structures and irregular boundary features.
[0018] 3. The present invention designs a neighboring layer feature fusion module F, which combines channel attention and spatial attention mechanisms to fuse features from different levels in skip connections, thereby enhancing the model’s attention to important image feature regions and suppressing the transmission of redundant features.
[0019] 4. This invention introduces the SMamba module for modeling long-range time dependencies, enhancing the modeling of long-term time-series dependency features.
[0020] 5. The lightweight short-term precipitation prediction model designed in this invention significantly reduces model parameters (approximately 1 / 3 of the original UNet), improving prediction accuracy while reducing computational costs, and possessing excellent real-time prediction performance and engineering usability. Attached Figure Description
[0021] Figure 1 This is a flowchart of the lightweight short-term precipitation prediction method based on contextual attention fusion of the present invention;
[0022] Figure 2 This is an architecture diagram of the lightweight short-term precipitation prediction model based on contextual attention fusion constructed in this invention;
[0023] Figure 3 This is a schematic diagram of the deformable convolution module DC in this invention;
[0024] Figure 4 This is a schematic diagram of the structure of the context extension sensing module C in this invention;
[0025] Figure 5 This is a schematic diagram of the structure of the adjacent layer feature fusion module F in this invention;
[0026] Figure 6 This is a schematic diagram of the SMamba module introduced in the bottleneck layer in this invention. Detailed Implementation
[0027] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0028] like Figure 1 As shown, this invention proposes a lightweight short-term precipitation prediction method based on contextual attention fusion, applicable to image sequence prediction and spatiotemporal dynamic modeling tasks. This method integrates deformable convolution, context-dilated perception mechanism, cross-layer feature fusion mechanism, and SMamba module to achieve multi-scale, strongly nonlinear, and long-term dependent information perception capabilities, constructing an efficient and deployable image temporal prediction model. The proposed improved network not only effectively improves the prediction accuracy and boundary clarity of radar image sequences but also reduces the number of model parameters, exhibiting good real-time prediction performance and engineering usability. The specific steps are as follows:
[0029] S1: Data input, acquiring a continuous sequence of weather radar images as raw input data, image size is... A sliding window strategy is adopted, based on the step size. A meteorological radar image dataset is constructed from the original sequence slices. Each sample consists of the input sequence. and predicted output sequence Composition. By setting a time dimension index, any... and The combined input-output sequence partitioning method adapts to different prediction duration requirements. Furthermore, to adapt to the model input format, a unified tensor layout transformation strategy is adopted to transform the original image dimensions from NHWT (N is the number of samples, H is the image height, W is the image width, and T is the time step) to NTHW format, i.e. This allows it to be directly used in time series convolution processing within the model.
[0030] In this embodiment, the acquired continuous weather radar image sequence is the VIL sequence from the SEVIR dataset, containing more than 10,000 samples, and the original image size is [size missing]. The time interval is 10 minutes.
[0031] S2: Data preprocessing involves normalizing and cropping the radar images in the dataset to improve the efficiency and accuracy of model training and inference. The specific processing is as follows:
[0032] The input radar image sequence is normalized, and the pixel values of each radar image are scaled to [value missing]. The interval, the formula is as follows:
[0033] ,
[0034] in, These are the original pixel values. and These represent the minimum and maximum values of pixels in the image, respectively.
[0035] To adapt to the model input, the original size of the input is set to... Radar images cropped to Pixel size.
[0036] S3: Model Building. Construct a lightweight short-term precipitation prediction model based on contextual attention fusion, containing a four-layer encoder-decoder structure, such as... Figure 2 As shown, different layers are entered through downsampling or upsampling. The preprocessed precipitation sequence... The input model passes through a deformable convolutional module (DC), a context-dilated perceptual module (C), a neighboring layer feature fusion module (F), and a bottleneck layer SMamba module. It combines depthwise separable convolution (DSC) with a skip connection mechanism to extract, fuse, and reconstruct image features, and finally outputs the prediction results for future frames.
[0037] First, a deformable convolutional module (DC) is used at the initial input to extract nonlinear spatial features of the input image sequence, by learning spatial offsets. To achieve spatial adaptive sampling, the module's process is as follows: Figure 3 As shown, its expression is:
[0038] ,
[0039] in, The coordinates of the current convolution kernel center. For feature map at location The response value at that position, i.e., the output at that position after deformable convolution; For the routine K × K In convolution, the first The relative coordinates of each core point with respect to the core. For the corresponding convolution weights, For the number of core points, This indicates bilinear interpolation sampling.
[0040] Afterwards, the feature map undergoes a 2x downsampling and depthwise separable convolution (DSC) before entering the second layer of the encoder. At this point, the feature map size is halved, and the number of feature channels doubles. The resulting feature map is then input into the context-expanded perceptual module C, whose structure is as follows: Figure 4 As shown, by using a dual-branch dilated convolutional structure to retain multiple receptive fields and dynamically expanding the receptive fields using dilated convolutions with different dilation rates, multi-scale contextual information of image features can be captured, thereby integrating local and global features while maintaining spatial resolution. Subsequently, through feature fusion and residual connections, the image feature representation capability and model training stability are effectively improved. The specific process is as follows:
[0041] For input features Using expansion rate respectively of Dilated convolution yields two branch features:
[0042] Branch 1: ,
[0043] Branch 2: ,
[0044] Dual-branch feature splicing and fusion: , ,
[0045] The output after residual connection is enhanced feature: , ,
[0046] in, and These represent expansion rates of 4 and 6, respectively. Hollow convolution.
[0047] Similarly, after another 2x downsampling and depthwise separable convolution (DSC), the image enters the next layer of the encoder, where the context-dilation perceptual module C captures multi-scale contextual information of the image features. After the fourth layer, following the 2x downsampling and depthwise separable convolution (DSC), the image enters the bottleneck layer. In this layer, the SMamba module is used to process deeper, more abstract features. The workflow of this module is as follows: Figure 6 As shown. A lightweight sequence modeling structure, SMamba, is introduced into the bottleneck layer between the encoder and decoder to model long-range temporal dependencies in image sequences, enhancing the model's global perception and nonlinear modeling capabilities in the deep feature extraction stage. The processing flow is as follows:
[0048] Input batch normalization: ,
[0049] Will Flattened into a sequence: ,
[0050] Sequence modeling: ,
[0051] Restored to 2D feature map: ,
[0052] Generate the final output: ,
[0053] in, This indicates the batch size, which is the number of samples input into the model at one time. Indicates the number of image channels. These represent the image height and width, respectively. This indicates the input to the SMamba module. Perform batch normalization. Indicates shape reshaping. Indicates dimension permutation. This indicates the input 2D feature map. Flattened according to spatial location, the length is... sequence, For the real number field, Indicates adaptation to 2D feature maps Sequence modeler, Indicates the sequence The 2D feature map obtained after dimensional displacement and shape reshaping. This indicates the GELU activation operation. This indicates the output of the SMamba module.
[0054] Subsequently, the features obtained from adjacent layers of the encoder are input into the adjacent layer feature fusion module F, the structure of which is as follows: Figure 5 As shown in the diagram, this module integrates channel attention and spatial attention mechanisms. Through progressive processing including scale alignment, feature stitching, channel attention, spatial attention, and feature compression, it effectively fuses image features from adjacent layers at different scales, thereby enhancing the perception of local image details and global image information across different levels and scales. The specific process is as follows:
[0055] Scale alignment (based on whether the number of channels is the same): ;
[0056] Two feature maps concatenated: .
[0057] First, perform channel attention-weighted fusion: For Perform global average pooling separately Similar to global max pooling (MaxPool). The two vectors obtained as channel indices, describing the global distribution of the channels, are then input into a two-layer MLP network with shared parameters for processing. , This is the channel vector obtained after pooling. These are the weight matrices for the first and second fully connected layers, respectively. The outputs of the two layers are summed element-wise, and then activated by a sigmoid function. Generate channel attention weights Afterwards, Channel-by-channel weighted output .
[0058] Then perform spatial attention weighted fusion: on the channel dimension, the output of the channel attention module is... respectively through average pooling and max pooling , for The number of channels is used to obtain two spatial attention maps, which are then stacked. The splicing characteristics, after Spatial weight map is obtained after convolution, batch normalization (BN), and sigmoid activation. Then, the output is weighted element by element. Finally, after Convolution, BN, and ReLU compress the channels to restore them to their original channel dimensions, resulting in the output being... .
[0059] in, For the current layer features, For upper-level features, the + sign indicates element-wise addition by channel. This indicates channel-dimensional concat. This indicates element-wise multiplication. This represents the sigmoid activation function. This represents a multilayer perceptron consisting of two fully connected layers and ReLU. For channel attention fusion output, The spatial attention fusion output, the final module fusion result is .
[0060] Next, in the decoder stage, the output of the bottleneck layer SMamba module is upsampled (Up) and concatenated with the output of the neighboring layer feature fusion module F. This concatenation is then processed by depthwise separable convolution (DSC) to obtain the fourth layer decoder features. Subsequently, the fourth layer decoder features are upsampled (Up) again and concatenated with the output of the neighboring layer feature fusion module F. This process is repeated until the first layer is decoded, at which point the image size is restored to the input size. Finally, the image is processed... The convolution outputs the prediction result, and the model construction is complete.
[0061] S4: Model output. After model training is complete, the preprocessed radar image sequence to be predicted will be output. Input the constructed network model, output the radar predicted image sequence for several future time steps. .
[0062] Based on the error between the real image sequence and the predicted result, the model performance is evaluated using multiple metrics, including mean squared error (MSE), precision, accuracy, F1 score, critical success index (CSI), Heidegger skill score (HSS), and false alarm rate (FAR). The calculation methods are as follows:
[0063] ,
[0064] ,
[0065] ,
[0066] ,
[0067] ,
[0068] ,
[0069] ,
[0070] in, Indicates the number of samples. Represents the actual ground value. Recall represents the model's predicted value. By binarizing the predicted and real images, the number of true positives (TP, true value = 1, predicted value = 1), false positives (FP, true value = 0, predicted value = 1), true negatives (TN, true value = 0, predicted value = 0), and false negatives (FN, true value = 1, predicted value = 0) in the confusion matrix is calculated.
[0071] To further verify the effectiveness and advancement of the method described in this invention, the following experiments were conducted:
[0072] The experiment used the publicly available meteorological radar image dataset SEVIR, and adopted the VIL (Vertical Cumulative Liquid Water Content) image sequence as input data. Using the radar image sequence from the previous 60 minutes (6 frames in total, with a 10-minute time interval) as input, a lightweight short-term precipitation forecasting model based on image sequence modeling constructed in this invention was used to predict the image sequence for the next 60 minutes (6 frames).
[0073] To evaluate the computational efficiency of the model, this embodiment was compared with several existing advanced models in terms of the number of parameters, and the statistical results are shown in Table 1.
[0074] Table 1 Comparison of Model Sizes
[0075]
[0076] As shown in Table 1, the lightweight structure proposed in this invention exhibits significant advantages in both model size and computational overhead. Regarding the number of parameters, the model contains only approximately 5.86M learnable parameters, representing reductions of 66.1%, 57.5%, and 57.0% compared to UNet, SAR-UNet, and SimVP, respectively, significantly lowering storage and deployment costs. In terms of computational complexity, the model's floating-point operations (FLOPs) are 29.48 GFLOPs, a reduction of 67.1% and 51.3% compared to SimVP and UNet, respectively, demonstrating good inference efficiency and resource adaptability. Although slightly higher than SAR-UNet in FLOPs, subsequent experiments verified that this invention performs better in prediction stability and spatiotemporal awareness, balancing performance and efficiency, and demonstrating its potential in practical deployment scenarios.
[0077] To further evaluate the predictive performance of the model, MSE, Precision, Accuracy, F1, CSI, HSS, and FAR were assessed with a threshold of 0. The results were compared with those of several state-of-the-art models, and the statistical results are shown in Table 2.
[0078] Table 2 Performance comparison of each model on the SEVIR dataset (threshold 0)
[0079]
[0080] in, This indicates that a higher index means better performance. The smaller the indicator, the better the performance; the best result is shown in bold. As shown in Table 2, under the condition of a threshold of 0, the model described in this invention achieves at least a 4% performance improvement on most evaluation indicators except MSE, demonstrating better predictive stability and judgment accuracy. In particular, the improvement is especially significant on practically meaningful indicators such as HSS, Accuracy, and CSI, effectively verifying the effectiveness and practical value of the method described in this invention. Combining the model size comparison data in Table 1, although the FLOPs of this invention are not the lowest among the compared models, it achieves a good trade-off between performance and computational efficiency with a relatively low number of parameters (approximately 5.86M). Especially noteworthy is its effective control of model complexity while maintaining prediction accuracy, balancing computational efficiency and expressive power, giving it good resource adaptability and inference efficiency, demonstrating its potential value in practical application deployment.
[0081] Based on the same inventive concept, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the aforementioned lightweight short-term precipitation prediction method based on contextual attention fusion.
[0082] Based on the same inventive concept, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the aforementioned lightweight short-term precipitation prediction method based on contextual attention fusion.
[0083] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0084] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.
[0085] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0086] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0087] The above embodiments are merely illustrative of the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solutions based on the technical concept proposed in this invention shall fall within the scope of protection of this invention.
Claims
1. A light-weight short-term precipitation prediction method based on context attention fusion, characterized in that, The method comprises the following steps: Step 1, acquire a continuous weather radar image sequence, adopt a sliding window strategy, slice the acquired continuous weather radar image sequence according to a preset step length, the inside of the window is composed of the input image sequence of the front frame and the output image sequence of the rear frame, the length of the window is the sum of and , the sliding interval of adjacent windows is controlled through the preset step length, generate a plurality of samples from the continuous weather radar image sequence, all the samples together constitute a weather radar image dataset; Step 2, preprocessing the meteorological radar image data set, and dividing the preprocessed meteorological radar image data set into a training set, a validation set and a test set; Step 3, constructing a lightweight short-time precipitation prediction model based on context attention fusion, which is used for predicting the future preset second time period precipitation of the current time period by using the meteorological radar image sequence of the historical preset first time period of the current time period, and the historical preset first time period and the future preset second time period are continuous, that is, the input image sequence is input into the model, and the generated predicted image sequence is output; The lightweight short-time precipitation prediction model based on context attention fusion is a four-layer encoder-decoder structure, which enters different layers through downsampling or upsampling; the input of the model is processed by a deformable convolution module, a context dilation perception module, a neighboring layer feature fusion module and an SMamba module, and the image features are extracted, fused and reconstructed by combining a depth separable convolution and a skip connection mechanism, and finally the predicted image sequence is output; wherein, The deformable convolution module is used for extracting the nonlinear spatial features of the input image sequence, and realizing spatial adaptive sampling; The context dilation perception module is used for retaining different receptive fields through a double-branch hole convolution structure to capture multi-scale context information of the image features, and integrating local and global features while maintaining spatial resolution; The neighboring layer feature fusion module is used for integrating channel attention and spatial attention mechanisms, and realizing fusion of image features of different scales in adjacent layers of the encoder through step-by-step processing of scale alignment, feature splicing, channel attention, spatial attention and feature compression; The SMamba module is a bottleneck layer connecting the encoder and the decoder, which is used for modeling long-range temporal dependence in the image sequence, realizing global information interaction and nonlinear modeling of deep features; Step 4, training and verifying the lightweight short-time precipitation prediction model based on context attention fusion constructed in step 3 by using the training set and the validation set, to obtain the trained lightweight short-time precipitation prediction model; Step 5, inputting the input image sequence in the test set into the trained lightweight short-time precipitation prediction model to obtain the short-time precipitation prediction result.
2. The method according to claim 1, wherein, The specific process of step 2 is as follows: Each weather radar image in each sample is normalized, i.e. the pixel values of each weather radar image are scaled to interval; The normalized meteorological radar image is cropped to a preset size, thereby obtaining the preprocessed meteorological radar image data set, and the preprocessed meteorological radar image data set is divided into a training set, a validation set and a test set.
3. The method of claim 1, wherein the method is characterized by, In step 3, in the encoder, the input of the model is subjected to a deformable convolution module to obtain the output of the deformable convolution module; the output of the deformable convolution module is subjected to 2 times down-sampling, and then is subjected to a first depth separable convolution module and a first context dilated perception module in sequence to obtain the output of the first context dilated perception module; the output of the first context dilated perception module and the output of the deformable convolution module are fused by a first neighboring layer feature fusion module to obtain a first fused feature ; the output of the first depth separable convolution module is subjected to 2 times down-sampling, and then is subjected to a second depth separable convolution module and a second context dilated perception module in sequence to obtain the output of the second context dilated perception module; the output of the second context dilated perception module and the output of the first context dilated perception module are fused by a second neighboring layer feature fusion module to obtain a second fused feature ; the output of the second depth separable convolution module is subjected to 2 times down-sampling, and then is subjected to a third depth separable convolution module to obtain the output of the third depth separable convolution module; the output of the third depth separable convolution module and the output of the second context dilated perception module are fused by a third neighboring layer feature fusion module to obtain a third fused feature ; The bottleneck layer comprises an SMamba module, and the output of the third depth separable convolution module is subjected to 2 times downsampling, and then sequentially subjected to a fourth depth separable convolution module and an SMamba module to obtain the output of the SMamba module; In the decoder, the output of the SMamba module is up-sampled by 2, and then combined with the third fusion feature The skip connection obtains a third skip connection result, and the third skip connection result is input into a fifth depth separable convolution module to obtain an output of the fifth depth separable convolution module. The output of the fifth depth separable convolution module is 2x up-sampled and then combined with the second fusion feature The second skip connection result is input into the sixth depth separable convolution module to obtain an output of the sixth depth separable convolution module. The output of the sixth depth separable convolution module is 2 times up-sampled, and then combined with the first fusion feature The first skip connection result is input into the seventh depth separable convolution module to obtain an output of the seventh depth separable convolution module. The output of the seventh depth separable convolution module is 2x up-sampled and then spliced with the output of the deformable convolution module. The spliced result is sequentially input into the eighth depth separable convolution module and the ninth depth separable convolution module. convolutional layer to obtain the output of the model.
4. The method according to claim 3, wherein, The first and second context expansion perception modules have the same structure, each including two branches, the first branch including a dilated convolution with a dilation rate of 4, a batch normalization, and a ReLU activation function, and the second branch including a dilated convolution with a dilation rate of 6, a batch normalization, and a ReLU activation function; and the expression of each context expansion perception module is as follows: , wherein, denotes the input of each context expansion perception module, and denote dilated convolution with dilation rate of 4 and 6 respectively, denotes the input of each context expansion perception module, denotes batch normalization, denotes ReLU activation function, denotes concatenation of the first branch feature and the second branch feature denotes convolution, denotes the result of convolution, batch normalization and ReLU activation operation on the concatenation result, denotes the result of convolution, batch normalization and ReLU activation operation on the concatenation result, denotes the enhanced feature obtained by residual connection of and . 5. The method according to claim 3, wherein, The first neighboring layer feature fusion module, the second neighboring layer feature fusion module and the third neighboring layer feature fusion module have the same structure, and each comprises a channel attention module and a spatial attention module, and fuses image features of different scales in adjacent layers; the specific process of each neighboring layer feature fusion module is as follows: , wherein, denotes a lower layer feature of the two adjacent layers, denotes an upper layer feature of the two adjacent layers a feature obtained by subsampling, denotes a max-pooling operation, denotes a convolution operation, denotes batch normalization, denotes a ReLU activation function, denotes a feature obtained by channel dimension concatenation, are respectively a channel number of, denotes channel dimension concatenation; right Perform channel attention-weighted fusion, specifically: Perform adaptive max pooling separately and adaptive average pooling Using multilayer perceptron The results of max pooling and average pooling are processed separately. The processed results are then summed element-wise and activated by a sigmoid function to obtain the channel weights. , ,use right Perform channel-by-channel weighting to obtain the output of the channel attention module. , The plus sign indicates that the elements are added one by one along the channel. This indicates the sigmoid activation operation. This indicates element-wise multiplication; right Perform spatial attention-weighted fusion, specifically: Average pooling and max pooling are performed separately to obtain two spatial attention maps. These two spatial attention maps are then concatenated, and then... The spatial weight map is obtained after convolution, batch normalization, and sigmoid activation. , ,use right Features are obtained by element-wise weighting. , ,right conduct Convolution, batch normalization, and ReLU activation operations yield the outputs of the feature fusion modules for each neighboring layer. , ,in, This represents the result of concatenating two spatial attention maps. express convolution, express convolution.
6. The method according to claim 3, wherein, The expression of the SMamba module is as follows: The expression of the SMamba module is as follows: Input batch normalization: , Will Flattened into a sequence: , Sequence modeling: , Resuming to 2D feature map: , Generate final output: , wherein, denotes batch size, denotes image channel number, denotes image height, width, respectively, denotes input to SMamba module performs batch normalization, denotes shape reshaping, denotes dimension permutation, denotes 2D feature map input flattened into a sequence of length according to spatial position, is a real number field, denotes a sequence modeler adapted to 2D feature map , denotes 2D feature map obtained after dimension permutation and shape reshaping of sequence , denotes GELU activation operation, denotes output of SMamba module.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, The computer program is executed by the processor to implement the steps of the context attention fusion-based lightweight short-time precipitation prediction method according to any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, the computer-readable storage medium comprising: The computer program is executed by the processor to implement the steps of the context attention fusion-based lightweight short-time precipitation prediction method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Short temporary rainfall prediction method and device
CN114139690A
Short-time heavy rainfall forecasting method fusing self-attention module and Unet model
CN117008217A