A Lightweight Attention Cloud Detection Method Based on Deep Learning
By introducing a lightweight attention mechanism and a spatial-channel reconstruction convolutional module, this deep learning method solves the accuracy and computational complexity problems of traditional cloud detection methods under complex cloud shapes and diverse weather conditions, achieving efficient and accurate cloud detection.
Patent Information
- Application Number
- CN202411721472.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-11-28
AI Technical Summary
Traditional cloud detection methods cannot provide high-precision detection results when dealing with complex cloud shapes, varying thicknesses, and diverse weather conditions. They also have high computational costs and insufficient robustness, making it difficult to meet real-time detection requirements.
A lightweight attention-based cloud detection method based on deep learning is adopted. By introducing a lightweight attention mechanism and a spatial-channel reconstruction convolution module, important features are dynamically focused, reducing computational complexity and improving cloud detection accuracy.
It improves the feature representation capability of cloud detection in remote sensing images, reduces computational complexity, is suitable for real-time remote sensing image analysis, and enhances the detection accuracy of cloud features.
Smart Images

Figure CN119888471B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of remote sensing image processing and computer vision technology, and in particular to a lightweight attention cloud detection method based on deep learning. Background Technology
[0002] Remote sensing imagery has wide applications in meteorological monitoring, environmental protection, and land use. With the development of remote sensing technology, the demand for high-quality imagery is constantly increasing. However, the presence of clouds can obscure surface information, affecting the integrity and clarity of image data. This makes cloud detection and removal an important task in remote sensing image processing.
[0003] Traditional cloud detection methods typically rely on spectral, texture, and temperature features, employing rule-based approaches for cloud segmentation. These methods often fail to provide high-precision results when dealing with complex cloud shapes, varying thicknesses, and diverse weather conditions. Furthermore, traditional methods lack robustness and cannot adapt to changes in various remote sensing images.
[0004] In recent years, deep learning-based semantic segmentation methods have gradually become the mainstream technology for cloud detection. The U-Net architecture, in particular, performs exceptionally well in cloud detection due to its symmetrical encoder-decoder design, which can simultaneously preserve detailed information and global context. However, the traditional U-Net architecture has some drawbacks, such as high computational cost, feature redundancy, and a lack of dynamic attention to important features, making it difficult to meet the demands of real-time detection. Summary of the Invention
[0005] The present invention aims to solve at least one of the technical problems mentioned above, and provides a lightweight attention cloud detection method based on deep learning, which can reduce the computational complexity of the model and improve the detection accuracy and computational efficiency of clouds in remote sensing images.
[0006] To achieve the above objectives, the technical solution adopted by this invention is: a lightweight attention cloud detection method based on deep learning, comprising the following steps:
[0007] Step 1. Acquire remote sensing image data. Construct a deep learning model with multiple convolutional layers using the remote sensing image data, and extract features from each convolutional layer to obtain the feature map of each convolutional layer. The feature map output by each convolutional layer is represented as: F out =σ(Conv(F) in ,W)+b), where, F in is the input feature map, Conv is the convolution operation, W is the convolution kernel weight, b is the bias, and σ is the activation function;
[0008] Step 2. Introduce a lightweight attention mechanism during feature extraction. Weight the features according to their importance and feed them into three different convolutional branches to generate three different feature representations. Use different weights to extract different features. Then, obtain the final attention feature representation by weighted summation of the three different feature representations.
[0009] Step 3. Perform spatial dimensionality reduction and channel dimension compression on the input feature map using the spatial-channel reconstruction convolution module;
[0010] Step 4. Output the final cloud detection results and perform post-processing on the results.
[0011] Preferably, in step 1, the deep learning model includes an encoder and a decoder. The encoder downsamples layer by layer, extracts multi-scale features through convolution and pooling operations, and in each convolutional layer, an activation function is used to introduce nonlinearity, defined as: f(x) = x·tanh(softplus(x)), where the softplus function is defined as: softplus(x) = ln(1+e x The decoder upsamples layer by layer to restore spatial resolution and fuse detailed features in skip connections; the downsampling formula is: F down =MaxPool(σ(Conv(F)) in The upsampling formula is: F(W)+b)). up =Conv(UpSample(F in ),W)+b.
[0012] Preferably, in step 2, the three different feature representations are as follows:
[0013] The formula for weighted summation is:
[0014] Preferably, in step 3, the spatial-channel reconstruction convolutional module includes a spatial reconstruction unit and a channel reconstruction unit. The spatial reconstruction unit is used to reduce the dimensionality of the input feature map to compress spatially redundant features, and its operation formula is: F sru =f SRU (F in )+F in , where f SRU (·) represents the dimensionality reduction function implemented through convolution. It extracts the spatial information of features using parameterized convolution kernels. The channel reconstruction unit is used to compress the channel dimension of the feature map to suppress redundant features and emphasize key features. Its operating formula is: F cru =f CRU (F in )+F in .
[0015] Preferably, after compressing the feature map by the channel dimension, a lightweight channel attention mechanism is applied to dynamically adjust the importance of different channels. This is done by calculating the weight of each channel, using the formula: α i =σ(FC(F) cru ), where α i For each channel, σ(·) is the sigmoid activation function, and FC(·) is a channel-weighted learning process performed through a small fully connected layer. The reconstructed feature map is then added to the original input feature map, preserving key information to form a new feature representation: F final =F cru ·α i +F in .
[0016] Preferably, in step 4, the post-processing includes noise removal, boundary smoothing, and thresholding. Noise removal uses morphological operations to remove small noise points in the segmentation results, boundary smoothing uses image smoothing techniques to enhance the coherence of cloud boundaries, and thresholding thresholds the probability map output by the model to generate the final binary cloud mask.
[0017] Compared with existing technologies, the lightweight attention cloud detection method based on deep learning of the present invention has the following advantages:
[0018] (1) Improved the feature representation capability of cloud detection in remote sensing images;
[0019] (2) Reduces computational complexity and is suitable for real-time remote sensing image analysis;
[0020] (3) By dynamically focusing on important features, the detection accuracy of cloud features is enhanced. Attached Figure Description
[0021] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, wherein:
[0022] Figure 1 This is a flowchart illustrating a lightweight attention cloud detection method based on deep learning according to the present invention.
[0023] Figure 2 This is a network architecture diagram of a lightweight attention cloud detection method based on deep learning according to the present invention. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0025] It should be noted that when a component is described as "fixed to" another component, it can be directly on the other component or may have a central component. When a component is described as "connected to" another component, it can be directly connected to the other component or may have a central component. When a component is described as "set on" another component, it can be directly set on the other component or may have a central component. When a component is described as "set in the middle," it is not simply set in the exact center, as long as it is not set within the area defined by both ends being in the middle. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0027] like Figures 1 to 2 As shown, this invention discloses a lightweight attention cloud detection method based on deep learning, comprising the following steps:
[0028] Step 1. Acquire remote sensing image data. Construct a deep learning model with multiple convolutional layers using this data, and extract features from each convolutional layer to build a feature extraction network. Specifically, this involves constructing a deep learning model with multiple convolutional layers and processing the input image layer by layer. Each convolutional layer extracts features at different levels from the original input image. These features can be categorized as follows:
[0029] Low-level features, such as edges, textures, and colors, are usually extracted in the first few layers of the network.
[0030] Intermediate features, such as shape and patterns in local regions, are typically extracted from the intermediate layers of the network.
[0031] High-level features, such as objects and semantic information, are usually extracted in later layers of the network.
[0032] These features are obtained by convolving the input image with convolution kernels (filters) in the convolutional layers. The feature map output by each convolutional layer represents the features of different spatial regions and scales. The feature map output by each convolutional layer is represented as follows:
[0033] F out =σ(Conv(F) in ,W)+b)
[0034] Among them, F in is the input feature map, Conv is the convolution operation, W is the convolution kernel weight, b is the bias, and σ is the activation function.
[0035] Furthermore, the deep learning model in this application includes an encoder and a decoder. The encoder downsamples layer by layer, extracting multi-scale features through convolution and pooling operations. In each convolutional layer, an activation function is used to introduce non-linearity, where softplus(x) is a smooth approximate ReLU function, defined as: f(x) = x·tanh(softplus(x)), and the softplus function is defined as: softplus(x) = ln(1+e^(-x / x)). x This smooth curve allows Mish to exhibit more gradual changes as the input approaches negative and positive infinity, rather than having hard inflection points like ReLU. This smooth nonlinearity is particularly well-suited for capturing details in images, helping to preserve subtle information about cloud edges in cloud detection tasks.
[0036] The decoder upsamples layer by layer to restore spatial resolution and fuse detailed features from skip connections, ensuring high-resolution cloud boundary recovery.
[0037] In the above operation, downsampling reduces the spatial resolution of the feature map by using convolution and max pooling layers, and its formula is: F down =MaxPool(σ(Conv(F)) in ,W)+b));
[0038] Upsampling gradually restores the spatial resolution of the feature map by employing deconvolution or upsampling operations. The formula is: F up =Conv(UpSample(F in ),W)+b.
[0039] Step 2. Introduce a lightweight attention mechanism during feature extraction. Weight the features according to their importance and feed them into three different convolutional branches to generate three different feature representations. Use different weights to extract different features. Then, obtain the final attention feature representation by weighted summation of the three different feature representations.
[0040] Specifically, a lightweight attention mechanism is introduced during feature extraction to dynamically focus on important features. The key to this lightweight attention mechanism is weighting features according to their importance. The input feature tensor is fed into three different convolutional branches (called feature branches), generating three different feature tables respectively.
[0041] T x =Conv(F in W x ),
[0042] T y =Conv(F in W y ),
[0043] As shown, the three different feature representations are: T z =Conv(F in W z These branches capture different dimensions of information from the input features. Specifically, the convolutional branches obtain multi-scale information of the features by using different convolutional kernel sizes and strides, and extract different features by employing different weights through convolution operations.
[0044] Simultaneously, the final attention feature representation is obtained by weighted summation of the three feature representations. When evaluating the importance of features extracted from each convolutional layer, methods such as self-attention or channel attention can be used. Based on the evaluation results, the features are processed separately through three different convolutional branches, each producing a different feature representation. Typically, each convolutional branch uses a different kernel size or convolution method to capture features at different scales or levels.
[0045] For example:
[0046] The first branch is used to extract local details (small-scale features).
[0047] The second branch is used to capture regional features at a medium scale.
[0048] The third branch is used to capture global features, taking into account a wider range of contextual information.
[0049] The outputs of each branch are weighted and summed according to their importance. These weights are typically learned during training, and the model automatically optimizes them through backpropagation to fully emphasize the relevant features of the clouds. The formula for the weighted summation is: Where, α i The weighting coefficients, T, are obtained through learning. iIt is the feature after being processed by different convolutional branches, W i is the convolutional kernel of each branch, and T is the final merged feature representation. This weighting method allows the model to focus on more important features during forward propagation, thereby enhancing the overall feature representation capability.
[0050] During network training, the contribution of the lightweight attention mechanism to cloud detection accuracy can be verified by comparing the performance with and without the attention mechanism. Experiments show that this mechanism significantly improves the model's adaptability to complex cloud shapes and changes during the feature extraction stage.
[0051] Step 3. The input feature map is spatially reduced and the channel dimension compressed using the Spatial-Channel Reconstruction Convolutional Module (SCConv). Specifically, the Spatial-Channel Reconstruction Convolutional Module (SCConv) is designed to improve computational efficiency and model performance by effectively reducing redundant features. Finally, the spatially and channel-reconstructed feature map F out The SCConv module is obtained by adding the output features of the Spatial Reconstruction Unit (SRU) and the Channel Reconstruction Unit (CRU). It mainly consists of a Spatial Reconstruction Unit (SRU) and a Channel Reconstruction Unit (CRU). The core idea of the SCConv module is to reduce the redundancy of the feature map by processing the spatial and channel dimensions separately. This design allows the model to retain important information while reducing computational resource consumption, thus adapting to the needs of real-time detection. The Spatial Reconstruction Unit (SRU) is used to reduce the dimensionality of the input feature map to compress spatially redundant features. Its operation formula is as follows:
[0052] F sru =f SRU (F in )+F in
[0053] Among them, f SRU (·) is a dimensionality reduction function implemented through convolution, which extracts spatial information of features through parameterized convolution kernels.
[0054] The dimensionality-reduced feature map is added to the original input feature map to retain important information from the low-dimensional representation. This skip connection helps prevent information loss and enhances the model's expressive power. After feature reconstruction, a nonlinear activation function (Mish) is used to introduce a nonlinear transformation, further enhancing the feature representation.
[0055] The primary purpose of the Channel Reconstruction Unit (CRU) is to compress the channel dimension of the feature map, suppressing redundant features and highlighting key features. Its operational formula is as follows:
[0056] F cru =f CRU (Fin )+F in
[0057] Here, f CRU (·) can be compressed using 1x1 convolution, which aims to reduce the complexity of the feature map.
[0058] Furthermore, after channel dimensionality reduction, a lightweight channel attention mechanism can be applied to dynamically adjust the importance of different channels. After compressing the channel dimension of the feature map, a lightweight channel attention mechanism is applied to dynamically adjust the importance of different channels by calculating the weight of each channel. The weight calculation formula is: α i =σ(FC(F) cru ))
[0059] Where, α i For each channel, σ(·) is the sigmoid activation function, and FC(·) is a channel-weighted learning process performed through a small fully connected layer. This mechanism learns the importance of each channel and dynamically adjusts the contribution of each channel in the feature map, thereby improving the accuracy of cloud feature recognition. By calculating the channel weights, the model can focus on important channel features and suppress irrelevant redundant features. This allows the model to focus on more important channel features and add the reconstructed feature map to the original input feature map, retaining key information to form a new feature representation: F final =F cru ·α i +F in This process also leverages skip connections to improve feature fluidity.
[0060] By comparing model performance before and after adding the SCConv module during the training and validation phases, experimental results show that the module significantly reduces computational complexity in cloud detection tasks while maintaining high detection accuracy. Evaluation metrics such as accuracy and intersection-over-union (IoU) all indicate that the SCConv module effectively improves cloud detection performance.
[0061] Step 4. By combining feature extraction from the encoder and decoder, a lightweight attention mechanism, and the SCConv module, the final cloud detection result is output, and post-processing is performed on the result. Specifically, post-processing includes noise removal, boundary smoothing, and thresholding. Noise removal uses morphological operations (opening and closing operations) to remove small noise points in the segmentation result, effectively eliminating isolated noise regions and enhancing the overall structure of the cloud layer. Boundary smoothing utilizes image smoothing techniques to enhance the coherence of cloud boundaries, which helps eliminate jagged edges in the detection result, making the final output cloud mask more natural and realistic. Thresholding generates the final binary cloud mask by thresholding the probability map output by the model. According to experimental results, selecting an appropriate threshold (such as 0.5) can effectively distinguish between cloud and non-cloud regions, ensuring the accuracy of the detection result.
[0062] A lightweight attention-based cloud detection method based on deep learning has been tested on typical remote sensing image datasets, including ImageNet-1k and PASCALVOC, and compared with the classic U-Net model. Experimental results show that after adding the lightweight attention mechanism and the SCConv module, the model's cloud detection accuracy is significantly improved, while the computational complexity is significantly reduced. Visualization analysis shows that the lightweight attention mechanism can effectively capture the spatial features of clouds, and the SCConv module suppresses redundant features, making the cloud detection results more accurate.
[0063] The above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of the technical solutions of the present invention.
Claims
1. A lightweight attention cloud detection method based on deep learning, characterized in that, Includes the following steps: Step 1. Acquire remote sensing image data. Construct a deep learning model with multiple convolutional layers using the remote sensing image data, and extract features from each convolutional layer to obtain the feature map of each convolutional layer. The feature map output by each convolutional layer is represented as: F out =σ(Conv(F) in ,W)+b), where Fin is the input feature map, Conv is the convolution operation, W is the convolution kernel weight, b is the bias, and σ is the activation function; Step 2. A lightweight attention mechanism is introduced during feature extraction. Features are weighted according to their importance and fed into three different convolutional branches, generating three different feature representations. Different weights are used to extract different features. Then, the three different feature representations are weighted and summed to obtain the final attention feature representation. The three different feature representations are as follows: The formula for weighted summation is: Step 3. Perform spatial dimensionality reduction and channel dimension compression on the input feature map using the spatial-channel reconstruction convolutional module. The spatial-channel reconstruction convolutional module includes spatial reconstruction units and channel reconstruction units. The spatial reconstruction unit is used to reduce the dimensionality of the input feature map to compress spatially redundant features. Its operation formula is: F sru =f SRU (F in )+F in , where f SRU (·) represents the dimensionality reduction function implemented through convolution. It extracts the spatial information of features using parameterized convolution kernels. The channel reconstruction unit is used to compress the channel dimension of the feature map to suppress redundant features and emphasize key features. Its operating formula is: F cru =f CRU (F in )+F in After compressing the feature map by channel dimension, a lightweight channel attention mechanism is applied to dynamically adjust the importance of different channels. This is done by calculating the weight of each channel using the formula: α i =σ(FC(F) cru )), where α i For each channel, σ(·) is the sigmoid activation function, and FC(·) is a channel-weighted learning process performed through a small fully connected layer. The reconstructed feature map is then added to the original input feature map, preserving key information to form a new feature representation: F final =F cru ·α i +F in ; Step 4. Output the final cloud detection results and perform post-processing on the results.
2. The lightweight attention cloud detection method based on deep learning according to claim 1, characterized in that, In step 1, the deep learning model includes an encoder and a decoder. The encoder downsamples layer by layer, extracts multi-scale features through convolution and pooling operations, and in each convolutional layer, an activation function is used to introduce nonlinearity, defined as: f(x) = x·tanh(softplus(x)), where the softplus function is defined as: softplus(x) = ln(1+e x The decoder upsamples layer by layer to restore spatial resolution and fuse detailed features in skip connections; the downsampling formula is: F down =MaxPool(σ(Conv(F)) in The upsampling formula is: F(W)+b)). up =Conv(UpSample(F in ),W)+b.
3. The lightweight attention cloud detection method based on deep learning according to claim 1, characterized in that, In step 4, post-processing includes noise removal, boundary smoothing, and thresholding. Noise removal uses morphological operations to remove small noise points in the segmentation results. Boundary smoothing uses image smoothing techniques to enhance the coherence of cloud boundaries. Thresholding thresholds the probability map output by the model to generate the final binary cloud mask.
Citation Information
Patent Citations
Lightweight remote sensing image cloud detection method
CN114120036A
Marine product detection method based on feature enhancement and sampling offset
CN117237796A