Segment Anything Model Based Context Guided Mamba Unet for Medical Image Segmentation
Organizations: School of Computer Science and Informatics, Cardiff University, Cardiff, UK · Department of Infection and Immunity, School of Medicine, Cardiff University, Cardiff, UK
Abstract
Medical image segmentation is crucial for clinical diagnosis and treatment planning, requiring both global contextual understanding and fine-grained structural precision. While the Segment Anything Model (SAM) demonstrates strong generalization capabilities, its direct application to medical images often lacks domain-specific adaptability. Meanwhile, State Space Models (SSMs)-based methods, such as Mamba, efficiently capture long-range dependencies but may struggle with preserving fine anatomical details. To address these challenges, we propose a segment anything model based context guided mamba unet, SAMBA-UNet, a novel framework that integrates SAM's context knowledge with Mamba's hierarchical feature learning to enhance both global representation and local detail refinement. Specifically, we introduce the Hierarchical Context Enhancement Module (HCEM), an attention-based fusion module that deeply incorporates the multi-level features of SAM and Mamba to improve detail perception and segmentation precision. Additionally, we employ LoRA and Adapter-based fine-tuning to adapt SAM to medical imaging tasks, further enhancing its domain-specific segmentation capability and robustness. We conducted a comprehensive study on several medical segmentation datasets, including Synapse, ISIC17, and ISIC18, evaluating our method across multiple metrics. Experimental results demonstrate that SAMBA-UNet achieves state-of-the-art performance, effectively balancing generalization, segmentation accuracy, and computational efficiency. Our code will be released upon acceptance.
Figures & tables
| Dataset | Model | mIoU(%) | DSC(%) | ACC(%) | Spe(%) | Sen(%) |
|---|---|---|---|---|---|---|
| MedSAM [ 41 ] | 75.48 | 84.15 | 93.34 | 98.04 | 80.20 | |
| IMedSAM [ 28 ] | 75.40 | 85.98 | 95.52 | 98.23 | 82.01 | |
| Unet [ 12 ] | 76.98 | 86.99 | 95.65 | 97.43 | 86.82 | |
| UTNetV2 [ 32 ] | 77.35 | 87.23 | 95.84 | 98.05 | 84.85 | |
| HC-Mamba [ 33 ] | 79.27 | 88.18 | 95.01 | 97.47 | 86.62 | |
| TransFuse [ 34 ] | 79.21 | 88.40 | 96.17 | 97.98 | 97.14 |
| Model | DSC | HD95 | Aorta | Gallbladder | Kidney(L) | Kidney(R) | Liver | Pancreas | Spleen | Stomach |
|---|---|---|---|---|---|---|---|---|---|---|
| MedSAM [ 41 ] | 73.99 | 23.68 | 67.15 | 60.99 | 67.68 | 66.79 | 88.92 | 70.72 | 87.20 | 82.48 |
| U-Net [ 12 ] | 76.85 | 39.70 | 89.07 | 69.72 | 77.77 | 68.60 | 93.43 | 53.98 | 86.67 | 75.58 |
| Att-UNet [ 10 ] | 77.77 | 36.02 | 89.55 | 68.88 | 77.98 | 71.11 | 93.57 | 58.04 | 87.30 | 75.75 |
| TransUNet [ 13 ] | 77.48 | 31.69 | 87.23 | 63.13 | 81.87 | 77.02 | 94.08 | 55.86 | 85.08 | 75.62 |
| TransDeepLab [ 38 ] | 80.16 | 21.25 | 86.04 | 69.16 | 84.08 | 79.88 | 93.53 | 61.19 | 89.00 | 78.40 |
| UCTransNet [ 46 ] | 78.23 | 26.75 | - | - | - | - | - | - | - | - |
| CoSE (Lora) | CoSE (Adapter) | HCEM | DSC | HD95 | |
|---|---|---|---|---|---|
| (a) | 79.05 | 29.89 | |||
| (b) | ✓ | 80.33 | 23.69 | ||
| (c) | ✓ | 80.58 | 24.92 | ||
| (d) | ✓ | ✓ | 81.06 | 23.18 | |
| (e) | ✓ | ✓ | ✓ | 81.94 | 17.34 |
Medical Image Segmentation
Medical image segmentation delineates organs, lesions, and other structures in scans to support measurement, diagnosis, treatment planning, and research.
See all 792 papers