Detecting colorectal polyps with precision is critical for early cancer detection, yet challenges like blurry boundaries and variable polyp shapes make this task complex. SAM-MaGuP is a groundbreaking framework that supercharges the Segment Anything Model (SAM) with advanced boundary-focused innovations.
- β¨ Boundary Distillation Component (BDC): Refines weak boundaries for superior accuracy.
- π 1D-2D Mamba Adapter: Bridges spatial and channel dependencies at multiple scales.
- π State-of-the-Art Performance: Excels across five benchmark datasets.
- π§ Boundary Refinement: Tackles low-contrast regions with precision.
- π Multi-Scale Context: Captures long-range dependencies for robust segmentation.
- β‘ Generalization Power: Handles unseen datasets with unmatched accuracy.
- π― Clinical Relevance: Designed for real-world medical applications.
SAM-MaGuP combines:
- MaGuP Module:
- Multi-scale Spatial Decomposition (MSD): Extracts coarse-to-fine polyp features.
- Boundary Distillation Component (BDC): Enhances polyp boundary recognition with cross-attention.
- SAM Backbone: Enhanced with domain-specific knowledge for medical imaging.
SAM-MaGuP sets new benchmarks across diverse datasets:
- mDice: 94.7% on seen datasets.
- mIoU: 89.0% on Kvasir-SEG.
- Boundary Precision: 85.4% on challenging ETIS dataset.
- Accurate polyp segmentation, even in ambiguous regions.
- Strong performance on unseen datasets.
- Python: >= 3.8
- PyTorch: >= 2.0
- CUDA: Enabled GPU (e.g., NVIDIA A100)
- Clone the repository:
git clone https://github.com/username/SAM-MaGuP.git cd SAM-MaGuP - Install dependencies:
pip install -r requirements.txt
- Download the datasets: Kvasir-SEG, CVC-ClinicDB, ETIS, CVC-ColonDB, CVC-300. and organize the data structure as follows:
data/ βββ Kvasir-SEG/ β βββ train/ β β βββ images/ β β βββ masks/ β βββ test/ β βββ images/ β βββ masks/ βββ CVC-ClinicDB/ β ...
- Start training by running:
python train.py --config configs/train_config.yaml
- Run the inference script:
python test.py --input data/test_images --output results/
If you use this code or framework, please cite:
@inproceedings{SAM-MaGuP,
title={Mamba Guided Boundary Prior Matters: A New Perspective for Generalized Polyp Segmentation},
author={Dutta, Tapas K. and Majhi, Snehashis and Nayak, Deepak Ranjan and Jha, Debesh},
booktitle={MICCAI 2025},
year={2025}
}
