2.2. Light-DCN-Xception
To address the limitations of standard convolutional neural networks in modeling the complex spatial structures of cloud clusters, this study replaces part of the convolutional layers in the Xception network with DCNs to enhance feature extraction capability. However, the introduction of deformable convolutions may increase computational costs. To balance model accuracy and inference efficiency in resource-constrained environments, a lightweight improvement is applied to the Xception backbone network. The specific approach is as follows:
First, the Middle Flow section is structurally reduced by decreasing the number of repeated Block modules from 16 to 8, thereby lowering network depth and computational complexity. Second, in the Exit Flow, the kernel size of the depthwise separable convolution is adjusted from 3 × 3 to 5 × 5, aiming to expand the receptive field and enhance the model’s ability to capture global features. On this basis, the channel count across all convolutional layers in the network is systematically reduced to further control parameter size and improve inference speed. The choice of the channel reduction ratio follows the design principles of lightweight networks. Existing empirical studies have demonstrated that reducing the number of channels to 50–75% of the original can enhance efficiency while minimizing accuracy loss [
24,
25]. This range is widely recognized as a sweet spot because an over-aggressive reduction (e.g., 50%) may lead to underfitting due to insufficient model capacity, while a conservative reduction fails to achieve significant efficiency gains. Our choice of 75% is positioned at the more accurate end of this validated spectrum, aiming to preserve performance while ensuring lightweight design.
The structures of the Light-Xception backbone network before and after improvement are shown in
Table 1 and
Table 2, respectively, with the structure of the core Block module illustrated in
Figure 2.
Then, this paper replaces part of the standard convolutional networks with DCNs. The DCN was proposed by Dai et al. [
26], and its core idea is to allow the sampling points of the convolution kernel to no longer be confined to fixed grid positions but to dynamically adjust the sampling locations based on the content of the input image. This dynamic characteristic enables it to better adapt to various deformations, scales, and poses of target objects, making it particularly suitable for handling irregular shapes and complex scenes. The DCN used in this paper is DCNv4, which is specifically designed for a wide range of visual applications. Its structure is shown in
Figure 3.
DCNv4 removes the softmax normalization operation present in DCNv3, transforming the spatial aggregation weights from a bounded range of [0, 1] to unbounded dynamic weights. This grants it a weight range analogous to conventional convolutions, resulting in more flexible regulatory capability. This modification significantly enhances the operator’s dynamic characteristics and expressive power, thereby achieving faster convergence speed and stronger feature learning ability. The blue and red star symbols in the diagram symbolize the core dynamic mechanisms of the Deformable Convolution (DCN): the blue star represents the dynamically offset sampling locations based on the input content, and the red star represents the dynamically generated attention weights. Together, they enable the model to adaptively focus on key feature regions.Furthermore, DCNv4 allows a single thread to handle multiple consecutive channels within the same group and employs vectorized load instructions to read data from multiple channels at once, greatly reducing redundant memory access and bilinear interpolation calculations. For a DCNv4 operator with
G groups and
K sampling points, the output
y(
p) at a position
p can be represented by Equation (
1):
where
G represents the total number of aggregation groups, which divides the channel dimension into groups, with each group independently learning offsets,
K denotes the total number of sampling points in the convolution kernel,
wg is the static convolution weight for the
g-th group,
mgk indicates the unbounded dynamic aggregation weight for the
k-th sampling point in the
g-th group,
xg is the channel slice of the input feature map corresponding to the
g-th group,
p represents the spatial position on the current output feature map,
pk is the predefined fixed offset of the
k-th sampling point relative to the center point;
pgk denotes the learnable offset for the
k-th sampling point in the
g-th group.
The architecture of Xception network can be divided into three sequential data flows: the Entry Flow, the Middle Flow, and the Exit Flow. The Entry Flow is primarily responsible for extracting general and low-level features from the input image. At this stage, the feature maps have a limited receptive field and relatively simple spatial structures. Therefore, introducing complex deformable convolutions prematurely offers limited benefits for geometric adaptation capability. The Middle Flow captures higher-level semantic information and abstract features, while the Exit Flow represents the final stage of feature extraction, producing the most abstract features that are directly crucial for the classification and boundary determination of cloud clusters. In these two later stages, the complexity of cloud formations—including their varying shapes, scales, and boundaries—places higher demands on the model’s ability to handle geometric transformations. Deformable convolutions address this by introducing learnable offsets, allowing the convolution kernels to adaptively adjust their sampling locations based on the input content, thereby transforming the fixed receptive field into a flexible and variable structure. Consequently, this study adopts a systematic replacement strategy: DCNs are introduced starting from the final layers of each flow and moving toward earlier layers. Specifically, in the Middle Flow, replacements begin from the last block (block 11) and proceed to the previous block (block 10, then block 9, etc.); in the Exit Flow, replacements start from the last SepConv 5 × 5 layer and move to the preceding SepConv 5 × 5 layer. This strategy ensures the model is enhanced with geometric deformation perception precisely at the most critical stages, while avoiding unnecessary computational overhead in the shallower layers, thus achieving an effective balance between performance and efficiency.
To validate the effectiveness of the proposed scheme, a systematic comparative experiment was designed to investigate the impact of incorporating different numbers of DCNs on the segmentation performance of the model. The experimental results are summarized in
Table 3, where the MIoU serves as the core evaluation metric, measuring the spatial overlap accuracy between the predicted cloud masks and the actual cloud regions. The specific calculation formula for this metric and the detailed experimental settings are provided in
Section 4.1.
As shown in
Table 3, the lightweight modification reduces the training time by 33.6% without significantly compromising model performance. The introduction of DCNs into both the Middle Flow and the Exit Flow enhances model performance but also increases the training time. Since further additions beyond 2 DCNs in the Middle Flow and 1 DCN in the Exit Flow yield only marginal improvements in performance while still increasing the training duration, this paper adopts the configuration of 2 DCNs in the Middle Flow and 1 DCN in the Exit Flow to balance model performance and training efficiency.
Consequently, the structure of the final backbone feature extraction network, named Light-DCN-Xception, is compared with the original architecture in
Figure 4. A comparison of the Block module before and after integrating the DCNs is presented in
Figure 5.
2.3. DCM-ASPP
To address the limitations of the DeepLabV3+ model in fully leveraging global contextual information and preserving local details (such as thin cloud edges) when processing clouds with highly variable morphology, this study reconstructs the original Atrous Spatial Pyramid Pooling module by introducing a dual-branch interaction mechanism. The structure of this mechanism is illustrated in
Figure 6.
In the proposed ASPP module, the global context branch integrates a 1 × 1 convolution, an atrous convolution with the maximum atrous rate, and image pooling. Their functions are to provide basic contextual information, capture extremely large-scale contextual information, and supply image-level global features, respectively. The local detail branch consists of two atrous convolutions with medium atrous rates. These convolutions possess smaller receptive fields, making them more sensitive to high-frequency details. The two branches first achieve information complementarity through a collaborative mechanism, and then each incorporates a channel attention mechanism to enhance their respective feature representation capabilities. Subsequently, the features output by the two branches are concatenated, and a spatial attention module is introduced to further focus on key spatial regions, thereby improving spatial discrimination of the features. Finally, a residual fusion module is adopted to replace the original simple concatenation followed by 1 × 1 convolution fusion method in the ASPP. The residual connections in this module effectively alleviate the vanishing gradient problem in deep networks, leading to more stable training and more thorough feature fusion, while simultaneously enhancing the characterization of cloud texture features.
A channel attention module and a spatial attention module are added to the network to improve its ability to capture critical features. The structural diagrams of these modules are presented in
Figure 7.
Figure 7a illustrates the structure of the channel attention module. This module utilizes two pooling operations—Global Average Pooling (GAP) and Global Max Pooling (GMP)—to compress the two-dimensional features (
H ×
W) of each channel into a single scalar value. The GAP operation captures the overall contextual information of the feature map, while the GMP operation highlights the most salient features. Their complementary nature provides a more comprehensive channel descriptor. The corresponding formula is as follows:
where
F represents the input feature matrix,
Favg is the result of the Global Average Pooling operation,
H and
W are the height and width of the feature matrix,
Fmax is the result of the Global Max Pooling operation.
Subsequently, the results of these two pooling operations are passed through a shared two-layer neural network. The first layer is a bottleneck layer, which reduces the number of channels to C/r, where r is the reduction ratio, serving to decrease computational complexity and introduce non-linearity. The r is set to 16. This value, consistent with practices in SENet and CBAM, offers a balanced trade-off between model capacity (risking overfitting with small datasets at lower r) and parameter efficiency (risking underfitting with higher r). The second layer restores the number of channels to C. The outputs from the two Multilayer Perceptrons(MLPs) are summed and then passed through a Sigmoid function to obtain the channel attention weight vector
Mc. Finally, these weights are multiplied channel-wise with the original input feature map. The expression is as follows:
where
denotes the Sigmoid function, where
(
x) = 1/(1 +
e−x), represents element-wise multiplication,
Fc denotes the output feature matrix of the channel attention module.
Figure 7b illustrates the structure of the spatial attention module. The process begins by applying both average pooling and max pooling along the channel dimension of the input feature map, generating two feature maps of size
H ×
W × 1. The average pooling operation retains overall background information, while max pooling highlights the most salient features. These two resulting feature maps are then concatenated along the channel dimension, forming a combined feature map with two channels. This two-channel feature map is subsequently processed by a convolutional operation, which fuses the two channels into a single channel, thereby capturing the relationships between different spatial locations. The output of this convolution is passed through a Sigmoid function to produce the spatial attention weight map, denoted as Ms. Finally, this weight map is multiplied with the input feature map element-wise. The corresponding expression is as follows:
where
C denotes the number of channels,
Fs represents the output feature matrix of the channel attention module,
f 7×7 denotes a convolutional operation with a 7 × 7 kernel.
The Dual-Branch Collaborative Module is the core of this mechanism. Its structure is illustrated in
Figure 8. The global context branch serves as an attention blueprint, guiding the detail branch on which edges and textures of specific regions to focus on. This effectively suppresses interference from background noise, making detail extraction more purposeful. The local detail branch can, in turn, supplement or correct the global context. It provides a bottom-up signal that enhances the model’s sensitivity to small targets and anomalous areas. The expression is as follows:
where
Fg represents the feature matrix of the global context branch,
Fl−g representsthe guidance from the local detail branch to the global context branch,
Fg* represents the feature matrix of the global context branch after interaction,
Fl represents the feature matrix of the local detail branch,
Fg−l represents the guidance from the global context branch to the local detail branch,
Fl* represents the feature matrix of the local detail branch after interaction,
f1×1 denotes a convolutional operation with a 1 × 1 kernel.
Finally, the two branches are fused using a residual fusion module, the structure of which is illustrated in
Figure 9. This module primarily consists of three components. The main fusion path serves as the core computational part of the module, comprising two 3 × 3 convolutional layers, each followed by Batch Normalization. The purpose of this path is to learn complex, non-linear feature transformations from the input to the output. The shortcut connection path is the essence of residual learning. If the input and output have the same number of channels, an identity mapping is used directly. If the number of channels differs, a 1 × 1 convolution is employed to align the channel dimensions. This path ensures that the input features can be propagated forward without loss. The output of the main path and the output of the shortcut connection are combined using element-wise addition. Finally, the result is passed through a ReLU activation function. The expression is as follows:
where BN denotes the Batch Normalization layer of the convolutional neural network,
x is the input feature,
is the mean of the batch,
2 is the variance of the batch,
is a small constant to prevent division by zero,
is the learnable scaling parameter,
is the learnable shift parameter,
Fmain represents the output feature matrix of the main fusion path,
Fshortcut represents the output feature matrix of the shortcut connection path, and
Foutput is the final output feature matrix, ReLU stands for Rectified Linear Unit, expressed as ReLU(
x) = max(0,
x), and
f 3×3 denotes a convolutional operation with a 3 × 3 kernel.
2.4. SimAM-Decoder
Although the DeepLabV3+ model has achieved remarkable results in semantic segmentation tasks through its encoder–decoder architecture, its decoder treats all feature channels and spatial locations equally when integrating high-level and low-level features. This approach may fail to adequately emphasize texture and boundary details critical for cloud detection, leading to insufficient precision in segmenting edges of irregular targets such as thin clouds and fragmented clouds. To enhance the model’s ability to focus on key features while avoiding a significant increase in computational complexity and training time, this paper integrates a parameter-free attention module named SimAM into the decoder.
SimAM is an attention mechanism based on the spatial suppression theory in neuroscience [
27]. This mechanism employs an energy function to evaluate the importance of each neuron in the feature map: neurons with lower energy exhibit more distinct responses compared to their neighbors and are thus considered more critical in visual tasks. In remote sensing cloud detection, the edges of thin clouds, fragmented cloud areas, and their boundaries with the underlying surface represent such key regions with discriminative features, where pixels possess subtle yet crucial differences in spectral and texture characteristics from the surrounding background. SimAM can automatically identify and enhance these feature responses through the energy function, thereby effectively improving the model’s ability to capture fine details. Furthermore, the module requires no learnable parameters and computes 3D attention weights across both channel and spatial dimensions, achieving efficient feature enhancement and suppression of redundant information. Its structure is illustrated in
Figure 10.
The core of SimAM is a carefully designed energy function that evaluates the importance of each neuron. The attention weight for a neuron is then normalized using a Sigmoid function. Finally, the enhanced features are obtained through element-wise multiplication. The expression is as follows:
where
E represents the computed energy value,
X is the input feature, and
is a small constant to prevent division by zero.
This paper designs an improved decoder integrated with SimAM, whose structure is shown in
Figure 11. First, the low-level feature maps obtained from the backbone extraction network of the encoder undergo a 1 × 1 convolution for channel dimensionality reduction. This step aims to decrease computational load and balance the contribution from high-level features. The high-level features are then upsampled and concatenated with the low-level features. The SimAM attention mechanism is applied to both feature sets separately. This process enhances the decoder’s sensitivity to crucial spatial details and semantic information, particularly in edge regions where the contrast between clouds and the background is low. The reinforced features are subsequently smoothed and fused through two 3 × 3 convolutional layers. Following this, the SimAM module is applied again to the fused features for final refinement, further strengthening the feature expression in target regions and thereby improving the boundary clarity of the segmentation mask.