The following dependecies should be installed:
- Python 3.7.3
- CUDA 10.1
- cuddn 7.5.1
- nvidia drivers v.430.40
- Download and unzip competition data
To get iamge data, run a script below:
python download_images.py
Alternatively, you can download from cloud.
Instruction is here
- To convert to png images, run a script below:
python convert_to_png.py
-
train models from scratch
a) trains all models from scratch using 5 folds cross validation.
b) expect this to run for about 17.5 hours(if epoch size is 40) on a single RTX2080Ti
-
make prediction
a) uses weights from the final stage models to make prediction.
b) uses 5 different weights to create 5 csv files and ensemble them.
Commands to run each build are presented below:
- creates model weights in ../weights
- creates ../output/v{version}/Unet_{encoder_name}_v{version}_fold{fold}.csv for each fold.
- creates ../output/v{version}/ensemble/Unet_{encoder_name}_v{version}_average.csv
./stage_1.sh
- creates model weights in ../weights
./train.sh
- predict using weights which is generated by specified version.
- creates ../output/v{version}/Unet_{encoder_name}_v{version}_fold{fold}.csv for each fold.
- creates ../output/v{version}/ensemble/Unet_{encoder_name}_v{version}_average.csv
./predict.sh
You can visualize your training process by:
tensorboard --logdir="{work_dir}/logs/v{version}/{fold}"
- combine stage 1 train and test set for retraining
- place stage 2 test set
- run script to covert dcm to png images(define the input path and output path like below)
python3 convert_to_png.py \
--test_path /home/rick/siim_data/siim-original/dicom-images-test/ \
--test_out_path /home/rick/siim_data/stage2/test_png/ \
--test_only True
- set stage 2 train image path Argument is "train_image_path'
- set stage 2 test set path in ./predict.py. Argument is "stage2_path".
The path should be same as what you defined in 'convert_to_png.py'
./stage_2.sh