CD-Mamba: Cloud detection with long-range spatial dependency modeling

Tianxiang Xue, Jiayi Zhao, Jingsheng Li, Changlu Chen, Kun ZhanarXiv 2025 · DOI

Abstract

Accurate cloud detection is critical for satellite imagery analysis, yet it remains challenging due to boundary ambiguity and terrain confusion. While CNNs excel at local feature extraction and Vision Transformers capture global context at high computational costs, this paper introduces CD-Mamba. CD-Mamba is a lightweight hybrid architecture that leverages State Space Models (SSMs) to achieve long-range spatial dependency modeling with linear complexity. By employing a multi-directional scanning strategy and dual-attention blocks, CD-Mamba achieves state-of-the-art performance with significantly fewer parameters and lower computational requirements than existing models.

Introduction

Cloud cover obscures approximately 66% of the Earth's surface, significantly impacting the utility of remote sensing data. Effective cloud detection faces two primary challenges: boundary ambiguity, where cloud edges blend into the background, and terrain confusion, where bright surfaces like snow or ice are misidentified as clouds.

Traditional Convolutional Neural Networks (CNNs) are proficient at capturing local textures but lack a global receptive field. Conversely, Vision Transformers (ViTs) provide global context but suffer from quadratic computational complexity, making them inefficient for high-resolution satellite imagery. CD-Mamba addresses these limitations by combining the strengths of CNNs and Mamba-based State Space Models.

Methodology

The CD-Mamba architecture is based on a U-Net-style encoder-decoder framework, enhanced by two key components:

Cloud Spatial-Mamba Block (Cloud-SMB)

To capture global spatial dependencies without the overhead of self-attention, CD-Mamba utilizes Mamba’s State Space Modeling. Given the fragmented and non-linear nature of clouds, the authors implemented a four-directional scanning strategy (forward, backward, for-backward, and back-forward). This approach allows the model to process spatial relationships from multiple perspectives, effectively linking distant cloud patches.

Dual Attention Block (DA-Block)

Integrated into the skip connections, DA-Blocks employ both spatial and channel-wise attention. This ensures that critical fine-grained details from the encoder are preserved and highlighted during the upsampling process, reducing redundancy and improving edge delineation.

The model is optimized using a composite loss function—combining Binary Cross-Entropy (BCE) and Dice Loss—to address class imbalance between cloudy and clear pixels.

Experimental Results

The model was evaluated on the Biome dataset (Landsat-8) for primary performance and the GF1-WHU dataset (GaoFen-1) to test generalization across different sensors.

Quantitative Performance

CD-Mamba demonstrated superior performance compared to established models like CDNet, Swin-Unet, and RS-Mamba. On the Biome dataset, it achieved a mean Intersection over Union (mIoU) of 87.03% and an Accuracy of 94.27%.

Computational Efficiency

The most striking advantage of CD-Mamba is its efficiency. It contains only 0.05 million parameters and requires 2.12 GFLOPs, a massive reduction compared to CDNet's 46.48 million parameters and 145.26 GFLOPs. This linear scaling makes it highly suitable for large-scale remote sensing tasks, with an inference time of approximately 38.97 ms.

Qualitative Analysis

Visual comparisons highlight CD-Mamba's ability to mitigate common errors. It significantly reduces false positives in snow-covered regions and more accurately identifies thin, wispy cloud boundaries that traditional models often miss.

Qualitative comparison of cloud detection results. CD-Mamba shows superior performance in handling boundary ambiguity (top row) and terrain confusion (bottom row) compared to CDNet.

Conclusion

CD-Mamba represents a significant step forward in efficient cloud detection, offering global context modeling with minimal computational overhead. While the results are promising, future work will focus on validating the model in more diverse atmospheric conditions and optimizing it for real-time deployment on satellite hardware.

Summary updated

BibTeX
@misc{xue2025cd,
  author = {Tianxiang Xue and Jiayi Zhao and Jingsheng Li and Changlu Chen and Kun Zhan},
  title = {{CD-Mamba: Cloud detection with long-range spatial dependency modeling}},
  year = {2025},
  eprint = {2509.04729},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.04729},
}
Figure