Skip to content
/ TTL Public

[BMVC'23 Oral] Offical repository of "Rethinking Transfer Learning for Medical Image Classification"

License

Notifications You must be signed in to change notification settings

PL97/TTL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

115 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is the offical implemention of paper Rethinking Transfer Learning for Medical Image Classification [BMVC'23 oral]

Overview example of TTL on resent50

Usage

Setup

pip

Requires python>=3.10+

See the requirements.txt for environment configuration

pip install -r requirements.txt

Dataset

BIMCV

  • Please download our pre-processed datasets TBA, put under data/ directory and perform following commands:
    cd ./data
    unzip digit_dataset.zip

HAM10000

  • Please download the dataset here, put under data/HAM10000/

PENet Dataset

  • Please download the dataset here, put under data/PENet/ directory and perform following commands:

Train

2D experiment (BIMCV & HAM1000)

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

Test

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}
}

About

[BMVC'23 Oral] Offical repository of "Rethinking Transfer Learning for Medical Image Classification"

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •