SMAFormer: Synergistic Multi-Attention Transformer for Medical Image Segmentation
This repository contains the weights and official implementation for SMAFormer, presented at BIBM 2024.
[Paper] [Code] [Video Introduction]
π Citation
If you find our work helpful for your research, please cite:
@inproceedings{zheng2024smaformer,
title={Smaformer: Synergistic multi-attention transformer for medical image segmentation},
author={Zheng, Fuchen and Chen, Xuhang and Liu, Weihuang and Li, Haolun and Lei, Yingtie and He, Jiahui and Pun, Chi-Man and Zhou, Shoujun},
booktitle={2024 IEEE International Conference on Bioinformatics and Biomedicine (BIBM)},
pages={4048--4053},
year={2024},
organization={IEEE}
}
@article{zheng2025hbformer,
title={HBFormer: A Hybrid-Bridge Transformer for Microtumor and Miniature Organ Segmentation},
author={Zheng, Fuchen and Chen, Xinyi and Li, Weixuan and Li, Quanjun and Zhou, Junhua and Guo, Xiaojiao and Chen, Xuhang and Pun, Chi-Man and Zhou, Shoujun},
journal={arXiv preprint arXiv:2512.03597},
year={2025}
}
π Overview
SMAFormer V2.3 is a medical image segmentation architecture based on the Swin Transformer. Compared to the initial version (ViT-Base, 138M parameters), V2.3 uses a Swin Transformer backbone to achieve superior performance (89% Dice on Synapse) with only 41.4M parameters. It features an innovative mirror Encoder-Decoder design, which allows the decoder to load pre-trained weights via reverse mapping, reaching a total pre-training coverage of 94.84%.
π³ Version Evolution
SMAFormer
β
βββββββββββββββββββββ΄ββββββββββββββββββββ
β β
[Branch: ViT-Base] [Branch: Swin-Tiny]
β β
ββββββββ΄βββββββ ββββββββ΄βββββββ
β SMAFormer β β SMAFormerV2 β
β (ViT-Base) β β (Swin-Tiny) β
ββββββββ¬βββββββ ββββββββ¬βββββββ
β β
v1.1 Dice: 74% v2.1 Dice: 78%
β β
v1.2 Dice: 80% v2.2 Dice: 80%
βΌ β
v2.3 β
Mirror Architecture
ββ Dice: 89%
π Performance (Synapse Dataset)
| Model | Backbone | 3D Dice | HD95 | Status |
|---|---|---|---|---|
| HBFormer | Swin-Tiny | 87.82% | 6.92 | Benchmark |
| SMAFormerV2 v2.3 | Swin-Tiny | 89.41% | 6.64 | Latest |
π Quick Start
Dependencies
torch>=1.10.0
timm>=0.6.0
numpy>=1.21.0
scipy>=1.7.0
h5py>=3.1.0
Training
python train_synapse.py --max_epochs 300 --batch_size 40 --model SMAFormerV2 --config configs/config_setting_synapse.py
Evaluation
python test_synapse.py --model_path checkpoints/best.pth
π§§ Acknowledgement
This work was supported in part by the National Key R&D Project of China, the Natural Science Foundation of Guangdong Province, the Shenzhen Technology Innovation Commission, the Shenzhen Development and Reform Commission, and the Science and Technology Development Fund, Macau SAR.
Model tree for lzeeorno666/SMAFormer-Medical-Image-Segmentation
Base model
microsoft/swin-tiny-patch4-window7-224