This is the offical implemention of paper Rethinking Transfer Learning for Medical Image Classification [BMVC'23 oral]
Overview | example of TTL on resent50 |
---|---|
Requires python>=3.10+
See the requirements.txt
for environment configuration
pip install -r requirements.txt
- Please download our pre-processed datasets TBA, put under
data/
directory and perform following commands:cd ./data unzip digit_dataset.zip
- Please download the dataset here, put under
data/HAM10000/
- Please download the dataset here, put under
data/PENet/
directory and perform following commands:
block-wise TTL
Please using following commands to train a model with federated learning strategy.
- --model specify model archicture: resnet50 | densenet201
- --pretrained specify source domain: imagenet | chexpert
- --dataset specify target dataset: BIMCV | HAM10000
- --trunc specify truncation point: {-1, 1, 2, 3}
python main.py --model resnet50 --bs 64 --data_parallel --num_workers 12 --max_epoch 200 --pretrained imagenet --dataset BIMCV --trunc -1 --exp 1 --sub 100
layer-wise TTL
--trunc specify truncation point: {-1, 1, 2, ..., 16}
python main.py --model layerttl_resnet50 --bs 64 --data_parallel --num_workers 12 --max_epoch 200 --pretrained imagenet --dataset BIMCV --trunc -1 --exp 1 --sub 100
block-wise TTL
python main.py --model resnet50 --bs 64 --data_parallel --num_workers 12 --max_epoch 200 --pretrained imagenet --dataset BIMCV --trunc -1 --exp 1 --sub 100
layer-wise TTL
python main.py --model layerttl_resnet50 --bs 64 --data_parallel --num_workers 12 --max_epoch 200 --pretrained imagenet --dataset BIMCV --trunc -1 --exp 1 --sub 100
If you use this code or dataset in you research, please consider citing our paper with the following Bibtex code:
@article{peng2022rethinking,
title={Rethinking Transfer Learning for Medical Image Classification},
author={Peng, Le and Liang, Hengyue and Luo, Gaoxiang and Li, Taihui and Sun, Ju},
journal={medRxiv},
pages={2022--11},
year={2022},
publisher={Cold Spring Harbor Laboratory Press}
}