Home

Awesome

CLD-Semi

Yiqun Lin, Huifeng Yao, Zezhong Li, Guoyan Zheng, Xiaomeng Li, "Calibrating Label Distribution for Class-Imbalanced Barely-Supervised Knee Segmentation", MICCAI 2022 (Provisionally Accepted). [paper]

0. Citation

@inproceedings{lin2022calibrating,
  title={Calibrating label distribution for class-imbalanced barely-supervised knee segmentation},
  author={Lin, Yiqun and Yao, Huifeng and Li, Zezhong and Zheng, Guoyan and Li, Xiaomeng},
  booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
  pages={109--118},
  year={2022},
  organization={Springer}
}

1. Environment

This code has been tested with Python 3.6, PyTorch 1.8, torchvision 0.9.0, and CUDA 11.1 on Ubuntu 20.04.

2. Data Preparation

The MR imaging scans are available at https://oai.nih.gov/. For issues related to the dataset, please contact our co-author (email: im.lzz@sjtu.edu.cn).

Run the function process_npy in ./code/data/preprocess.py to convert .nii.gz files into .npy for faster loading. To generate the labeled/unlabeled splits, run the function process_split_semi or use our pre-split files in ./knee_data/splits/*.txt. After preprocessing, the ./knee_data/ folder should be organized as follows:

./knee_data/
├── imagesTr
│   ├── <id>_0000.nii.gz
├── labelsTr
│   ├── <id>.nii.gz
├── imagesTs
│   ├── <id>_0000.nii.gz
├── labelsTs
│   ├── <id>.nii.gz
├── npy
│   ├── <id>_image.npy
│   ├── <id>_label.npy
├── splits
│   ├── labeled.txt
│   ├── unlabeled.txt
│   ├── train.txt
│   ├── eval.txt
│   ├── test.txt

3. Training

Run the following commands for training.

mkdir -p ./logs/__nohup

bash py_run.sh code/train_cld.py --exp cld -g 0

4. Testing

Run the following commands for testing.

bash py_run.sh code/test.py --exp cld -ep 280 --cps A -g 0
python code/evaluate.py -p ./logs/cld/predictions/ep_280/
ModelAvg.DFFCTiTCLink
CLD-Semi87.293.883.792.878.6ep_280.pth

License

This repository is released under MIT License (see LICENSE file for details).