We provide the official PyTorch implementation of our UniMatch in the scenario of semi-supervised medical image segmentation:
Revisiting Weak-to-Strong Consistency in Semi-Supervised Semantic Segmentation
Lihe Yang, Lei Qi, Litong Feng, Wayne Zhang, Yinghuan Shi
In Conference on Computer Vision and Pattern Recognition (CVPR), 2023
You can refer to our training logs for convenient comparisons during reproducing.
Method | 1 case | 3 cases | 7 cases |
---|---|---|---|
SupBaseline | 28.5 | 41.5 | 62.5 |
UA-MT | N/A | 61.0 | 81.5 |
CPS | N/A | 60.3 | 83.3 |
CNN & Transformer | N/A | 65.6 | 86.4 |
UniMatch (Ours) | 85.4 | 88.9 | 89.9 |
cd UniMatch
conda create -n unimatch python=3.10.4
conda activate unimatch
pip install -r requirements.txt
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 -f https://download.pytorch.org/whl/torch_stable.html
- ACDC: image and mask
Please modify your dataset path in configuration files.
├── [Your ACDC Path]
└── data
# use torch.distributed.launch
# switch to current folder
sh scripts/train.sh <num_gpu> <port>
To train on other datasets or splits, please modify
dataset
and split
in train.sh.
Modify the method
from 'unimatch'
to 'supervised'
in train.sh, and double the batch_size
in configuration file if you use the same number of GPUs as semi-supervised setting (no need to change lr
).
If you find this project useful, please consider citing:
@inproceedings{unimatch,
title={Revisiting Weak-to-Strong Consistency in Semi-Supervised Semantic Segmentation},
author={Yang, Lihe and Qi, Lei and Feng, Litong and Zhang, Wayne and Shi, Yinghuan},
booktitle={CVPR},
year={2023}
}
The processed ACDC dataset is borrowed from SSL4MIS.