You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We will take the Hippocampus dataset
as the example to illustrate how
to do the preprocessing. Put the images .nii.gz files in ./data/Hippocampus/imgs folder and labels files in
./data/Hippocampus/labels.
cd dataset/prepare_dataset
python preprcocessing.py
python create_splits.py
After which,the images and labels will be restored together in .npy file with shape normalized to target size.
To run the supervised pixel-wise contrastive learning,
bash run_coseg.sh
To combine the above two pretraining, run run_simclr.sh first and the pretrained model will be saved at
save/simclr/Hippocampus/ and set --pretrained_model_path ${the saved model path} in run_coseg.sh.
As for the segmentation finetuning, remember to load the saved model, and
bash run_seg.sh
Notice that in all the above three files, there is a parameter named train_sample, which means the percentage of labeled
data to use.
If you use our codes or find our codes useful, please cite
@inproceedings{hu2021semi,
title={Semi-supervised Contrastive Learning for Label-Efficient Medical Image Segmentation},
author={Hu, Xinrong and Zeng, Dewen and Xu, Xiaowei and Shi, Yiyu},
booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
pages={481--490},
year={2021},
organization={Springer}
}