• Stars
    star
    232
  • Rank 172,847 (Top 4 %)
  • Language
    Python
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

C2L_MICCAI2020

This is a repository for paper "Comparing to Learn: Surpassing ImageNet Pretraining on Radiographs By Comparing Image Representations" early accepted by MICCAI 2020

Introduction

The goal of C2L is to provide an effective pretraining method by using 2D radiographs only. It is designed to be flexible in order to support rapid implementation. Specifically, you can run these experiments by simply configuring the dataset path.

Citation

@inproceedings{zhou2020C2L,
  title={Comparing to Learn: Surpassing ImageNet Pretraining on Radiographs By Comparing Image Representations},
  author={Zhou, Hong-Yu and Yu, Shuang and Bian, Cheng and Hu, Yifan and Ma, Kai and Zheng, Yefeng},
  booktitle={International Conference on Medical Image Computing and Computer-Assisted Intervention},
  year={2020},
  organization={Springer}
}

Installation

We will demonstrate how to use C2L to train ResNet-18 and DenseNet-121.

Dependency

Please install PyTorch (1.1 or 1.4) before you run the code. We strongly recommend you to install Anaconda3 where we use Python 3.6.

Step 0

git clone https://github.com/funnyzhou/C2L_MICCAI2020.git
cd C2L_MICCAI2020

Step 1

Please configure opt.data_folder, opt.model_path, opt.tb_path and data_folder in train_C2L_res18.py and train_C2L_densenet121.py, respectively.

Step 2

Replace pretrained_datasets/file_names.txt with your own data paths.

Step 3

The proposed C2L method mainly lies in train_C2L function. You can find it in both train_C2L_res18.py and train_C2L_dense121.py.

To train ResNet18:

CUDA_VISIBLE_DEVICES=0,1,2,3 python train_C2L_res18.py --model resnet18 --batch_size 128 --num_workers 24 --c2l

To train DenseNet121:

CUDA_VISIBLE_DEVICES=0,1,2,3 python train_C2L_dense121.py --model densenet121 --batch_size 128 --num_workers 24 --c2l

Model Weight

We also provide pretrained weights of ResNet-18 using C2L.

Acknowledgements

Part of this code is based on CMC.