Skip to content

Low-cost Fine-tuning of Data-efficient Image Transformers on X-ray Imaging for Osteoarthritis Detection

License

Notifications You must be signed in to change notification settings

shamilemir/DeiT-osteoarthritis-detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

You can find the corresponding journal articel at https://www.urncst.com/index.php/urncst/article/view/789

To generate a random selection of size 224x224 images:

  1. Download original dataset from https://data.mendeley.com/datasets/56rmx5bjcr/1 Complete the following steps within the prepareKneeOsteoarthritisXray folder
  2. Create folder named all_data
  3. Create a template_empty_folder with two subfolders train and test and each of those with two subfolders 0 and 1
  4. Copy and paste template_empty_folder twice and rename to selected_data and selected_processed_data
  5. Move contents of KneeOsteoarthritisRNN/ClsKLData/kneeKL224 into all_data (excluding "val" and auto_test folders)
  6. Run the python scripts in terminal
    • cd my/path/to/prepareKneeOsteoarthritisXray
    • python ./datasplitting.py
    • python ./preprocessing.py
  7. (Optional) manually delete images with artifacts like implants
  8. (Optional) color invert images that are randomly color inverted the wrong way

To generate a random selection of size 384x384 images:

  1. Follow the above steps, but in addition:
    • Uncomment line 35 under "RESIZING" in preprocessing.py
    • Move contents of KneeOsteoarthritisRNN/ClsKLData/kneeKL299 instead of kneeKL224 (again excluding "val" and "auto_test" folders)

To redo selection process:

  1. Replace selected_data and selected_processed_data with template_empty_folder and rename both again
  2. Repeat remaining steps

Note: ratios are off slightly due to "0" category being taken from two folders and "1" category from three folders

  • train/0: 500
  • train/1: 498
  • test/0: 100
  • test/1: 99

You are now ready to fine-tune using the fine-tune.py script

About

Low-cost Fine-tuning of Data-efficient Image Transformers on X-ray Imaging for Osteoarthritis Detection

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages