Skip to content

felixkrones/BenchmarkTransferLearning_f

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Extended: A Systematic Benchmarking Analysis of Transfer Learning for Medical Image Analysis

Extended work

This is our extension of the Benchmark repository by Hosseinzadeh et al., as we used it in our Paper. Please cite both if you find it helpful. We thank the original authors! It mainly extends the original repository in the following ways:

  • Extended dataset support
  • Extended model support and combined repository with (Transformer extension)[https://github.com/jlianglab/BenchmarkTransformers]
  • Extended parameterisation
  • Extended device support
  • Our parameter settings
  • Updated requirements.txt file
  • New evaluation pipeline: pipeline_eval.ipynb

Getting started

  • You can just use the repository as decribed in the original README below
  • For Moco-v3 pre-training, use Moco-v3 extension
    • You need to use deit-converted checkpoints (use convert_to_deit.py for that)
    • For resnet, further prepare the resnet moco checkpoints first using prep_moco.py (provide the paths in the file)

Getting the additional data

  • General tips
    • Unzip files
      • unzip images.zip
      • find . -name '*.tar.gz' -exec tar -xf '{}' \;
    • Deleting files
      • find . -name '*.tar.gz' -exec rm '{}' \;
      • rm images/batch_download_zips.py
    • Think about where to save files and create folders
      • mkdir data/raw/name && cd "$_"
  • NIH ChestXray 14:
    • Download data from box
    • Download the images/ folder (there is a nice Python script provided)
    • Download the metadata file Data_Entry_2017_v2020.csv into the same folder where the images/ folder will be
  • ChestXpert
    1. Download data from CheXpert dataset
      • Either by directly downloading the zip file
      • Or by using AzCopy:
        • Install AzCopy sudo bash -c "cd /usr/local/bin; curl -L https://aka.ms/downloadazcopy-v10-linux | tar --strip-components=1 --exclude=*.txt -xzvf -; chmod +x azcopy"
        • Get Link
        • Download: azcopy copy "LINK" "." --recursive=true
    2. Create/Copy split file into this folder
    3. Unzip all files
      • cd chexpertchestxrays-u20210408 && unzip CheXpert-v1.0.zip
  • Padchest
  • VinDr-CXR
    • Download data from VinDr-CXR
      1. Only get the test data: wget -r -N -c -np --user felixkrones --ask-password https://physionet.org/files/vindr-cxr/1.0.0/test/
      2. Get the annotations: wget -r -N -c -np --user felixkrones --ask-password https://physionet.org/files/vindr-cxr/1.0.0/annotations/
      3. Unzip
  • OCT
    1. Download the (dataset)[https://data.mendeley.com/datasets/rscbjbr9sj/3]

Running code in parallel

Run from terminal torchrun --nproc_per_node=NUM_GPUS_YOU_HAVE ...

Running code in background using tmux

  1. SSH connect
  2. tmux
  3. Detach: tmux detach or Ctrl+b then d
  4. List sessions: tmux list-sessions
  5. Resume: tmux attach -t session_number

License

Released under the ASU GitHub Project License.

About

Forked PyTorch Implementation and Pre-trained Models for Benchmarking Transfer Learning for Medical Image Analysis

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 80.0%
  • Jupyter Notebook 19.4%
  • Shell 0.6%