Label Augmentation Method for Medical Landmark Detection

Label augmentation method for medical landmark detection in hip radiograph images
Yehyun Suh, Peter Chan, J. Ryan Martin, and Daniel Moyer.

Data Collection

Environment

  • Ubuntu 22.04
  • CUDA 11.7
  • PyTorch 1.13.0

Training

  • Environment Setup
conda create -n label_aug python=3.10 -y
conda activate label_aug

If you do not have conda downloaded in your setup, please refer to conda installation page.

  • Clone this repository and set up directories
git clone https://github.com/vine-lab-vu/Label-Augmentation.git
cd Label-Augmentation
mkdir data && cd data
mkdir -p image/all txt && cd ..
  • Put your data in the directories
Label-Augmentation
├─ data
│   ├─ image
│   │   ├─ all
│   │   │   ├─ 1.png
│   │   │   ├─ 2.png
│   │   │   ├─ ...
│   │   │   └─ < here goes all the images >
│   └─ txt
│       ├─ test.txt
│       └─ train.txt
├─ utility
│   ├─ dataset.py
│   ├─ log.py
│   ├─ main.py
│   ├─ model.py
│   ├─ preprocess.py
│   ├─ train.py
│   └─ visualization.py
├─ dataset.py
├─ main.py
├─ test.py
└─ train.py

train.txt and test.txt come from Landmark-Annotator

  • Download libraries
pip3 install -r requirements.txt
  • Start training
python3 main.py --dilate number_of_dilation --dilation_decrease number_of_decrease_in_dilation --dilation_epoch how_many_epochs_per_each_dilation --image_resize size_of_resized_image --batch_size size_of_each_batch --output_channel number_of_labels 

If it is your first time training or have added new data, add --preprocess at the end of the command

Test

python3 main.py --test --output_channel number_of_labels 

If you have changed any other arguments that is related to the model, you have to add it to the test command.

Results

Landmark Prediction

Acknowledgement

This repository is built using the segmentation-models-pytorch library.

Citation

Yehyun Suh, Peter Chan, J. Ryan Martin, and Daniel Moyer. Label augmentation method for medical landmark detection in hip radiograph images, 2023.

@misc{
suh2023label,
title={Label Augmentation Method for Medical Landmark Detection in Hip Radiograph Images}, 
author={Yehyun Suh and Peter Chan and J. Ryan Martin and Daniel Moyer},
year={2023},
eprint={2309.16066},
archivePrefix={arXiv},
primaryClass={cs.LG}
}