Swin-UMamba: Mamba-Based UNet with ImageNet-Based Pretraining

Jiarun Liu, Hao Yang, Hong-Yu Zhou, Yan Xi, Lequan Yu, Cheng Li, Yong Liang, Guangming Shi, Yizhou Yu, Shaoting Zhang, Hairong Zheng, Shanshan Wang

Abstract

Swin-UMamba is a novel U-Net architecture designed for medical image segmentation that leverages the linear-scaling efficiency of Mamba (State Space Models) alongside the benefits of ImageNet-based pretraining. By aligning the encoder architecture with general-purpose vision models like VMamba, Swin-UMamba successfully integrates large-scale pretraining to overcome the data scarcity common in medical imaging. Experimental results across diverse datasets demonstrate that Swin-UMamba significantly outperforms existing CNNs, Vision Transformers, and previous Mamba-based models, particularly when training data is limited.

Introduction

Accurate medical image segmentation requires capturing both fine-grained local details and broad global context. While Convolutional Neural Networks (CNNs) excel at local feature extraction, they often lack the receptive field necessary for global context. Vision Transformers (ViTs) address this but suffer from quadratic computational complexity relative to image resolution, making them expensive for high-resolution medical scans.

Recently, Mamba-based models (structured State Space Models) have emerged as a promising alternative, offering long-range dependency modeling with linear complexity. However, existing Mamba models for medical imaging are typically trained from scratch on small datasets, leading to overfitting. Swin-UMamba addresses this by designing an architecture compatible with ImageNet-pretrained weights, providing a robust foundation for medical tasks.

Methods

The Swin-UMamba architecture follows a U-shaped encoder-decoder structure designed for high efficiency and accuracy.

The Encoder

The core innovation lies in the encoder, which is designed to mirror the VMamba-Tiny architecture. This design choice allows the model to initialize its Visual State Space (VSS) blocks with weights pretrained on ImageNet. The VSS blocks utilize a 2D-selective-scan (SS2D) mechanism, processing images as 1D sequences in four directions to capture spatial context efficiently without the overhead of self-attention.

The architecture of Swin-UMamba featuring the VSS-based encoder and CNN-based decoder.

The Decoder and Variants

The standard Swin-UMamba employs a CNN-based decoder with residual blocks and deep supervision. To enhance efficiency, the authors also introduced Swin-UMamba†, which replaces the CNN decoder with a Mamba-based decoder using patch expanding and VSS blocks. This variant significantly reduces parameter count and computational complexity while maintaining high performance.

Results

The models were evaluated on three datasets: AbdomenMRI (13 organs), Endoscopy (surgical instruments), and Microscopy (cell instances).

Performance and Efficiency

Swin-UMamba consistently outperformed state-of-the-art baselines, including nnU-Net, SwinUNETR, and U-Mamba. On the AbdomenMRI dataset, Swin-UMamba achieved a Dice Similarity Coefficient (DSC) of 0.7760.

The impact of pretraining was most evident on the smaller Endoscopy and Microscopy datasets, where it provided DSC and F1 score boosts of over 12%. Furthermore, the Swin-UMamba† variant reduced parameters from 60M to 28M and FLOPs from 68.0G to 18.9G compared to the standard version, yet still outperformed larger models when utilizing pretraining.

Qualitative comparison of segmentation results across different models on AbdomenMRI (a), Endoscopy (b), and Microscopy (c) datasets.

Discussion and Conclusion

The success of Swin-UMamba highlights that large-scale pretraining is a critical factor for the effective deployment of Mamba-based models in medical imaging. The architecture effectively bridges the gap between the efficiency of SSMs and the representational power of pretrained vision models. While the CNN-based decoder currently offers a slight edge in accuracy, the Mamba-based decoder variant (Swin-UMamba†) presents a highly efficient alternative for resource-constrained environments. Future work will focus on hyperparameter optimization and further narrowing the performance gap between the standard and efficient variants.

Summary updated

BibTeX
@inproceedings{liu2024swin,
  author = {Jiarun Liu and Hao Yang and Hong-Yu Zhou and Yan Xi and Lequan Yu and Cheng Li and Yong Liang and Guangming Shi and Yizhou Yu and Shaoting Zhang and Hairong Zheng and Shanshan Wang},
  title = {{Swin-UMamba: Mamba-Based UNet with ImageNet-Based Pretraining}},
  booktitle = {International Conference on Medical Image Computing and Computer-Assisted Intervention},
  year = {2024},
  doi = {10.1007/978-3-031-72114-4\_59},
}
Figure