A advanced and general medical segmentation toolkit developed by the SLab team, led by Prof. Shuang Song and Kangneng Zhou.
- (2025.11.20): What a beautiful day! The first version of the SLab Medical Segmentation (SMS) repository has been released.
Follow steps 1-3 to run our toolkit.
- Introduction
- Installation
- Prepare the Dataset
- Run the Training
- Run the Inference
- Visualization
- Results
- To Do List
- By The Way
- Acknowledgements
-
Segformer3D (CVPR-W 2024, code)
-
Slim-UNETR (TMI 2023, code)
-
AttentionUnet (MIDL 2018, code)
-
EfficientMedNext (MICCAI 2025, code)
- UNet (MICCAI 2015, code)
- UNet++ (TMI 2019, code)
- DeepLabV3 (arXiv 2017, code)
- FCN (CVPR 2015, code)
- SegNet (TPAMI 2017, code)
- PSPNet (CVPR 2017)
- HighResNet (IPMI 2017, code)
- MiniSeg (TNNLS 2022, code)
- AttentionUnet (MIDL 2018, code)
- DANet (CVPR 2019, code)
- MedFormer (arXiv 2022, code)
- TransUnet (MIA 2024, code)
- SwinUNet (ECCV-W 2024, code)
- Brain Tumor Segmentation Dataset (BraTS) - 3D
- DSA (Digital Subtraction Angiography) - 2D
conda create -n slab_med_seg python=3.10
conda activate slab_med_seg
pip install torch torchvision
pip install -r requirements.txt
design your dataloader in dataset
python train.py --dataset_name your_dataset_name \
--dataset_path your_dataset_path \
--batch 4 \
--num_workers 4 \
--queue_length 5 \
--samples_per_volume 5 \
--patch_size 96 96 96 \
--expname your_exp_name \
--model_name your_model_name \
--in_channels 1 \
--out_channels 3 \
--loss_type combinepython train.py --dataset_name dsa \
--dataset_path data/data_2d/DSA \
--model_name unet \
--dimension 2d \
--in_channels 1 \
--out_channels 1 \
--batch 4 \
--num_epochs 100 \
--expname dsa_unet_2d \
--loss_type combinepython inference.py \
--checkpoint_path logs/exp/best_model.pth \
--input_path data/test/img/ \
--output_dir results/ \
--config logs/exp/config.yaml \
--use_sliding_window \
--calculate_metrics \
--save_probabilityWe benchmark SLab Medical Segmentation (SMS) both qualitatively and quantitatively against the current state-of-the-art models such as MedNeXt and several other models on three widely used medical datasets: BRaTs2017.
Stay tuned!
- More datasets
If you're using this project and have feedback, feel free to contact Kangneng Zhou via WeChat (kangkangellis666) or email (elliszkn@163.com).
This repository offers advanced and general medical segmentation in 3D and 2D. The project was completed under the supervision of Prof. Shuang Song and Kangneng Zhou. Special thanks to Haoyu Yuan, Dian Song, Jingdan Zhang, Yihang Xu and Sibo Zhao for their invaluable support.