This repo contains my code for training classification model for kaggle recently held competition SIIM-ISIC Melanoma Classification.This code reproduce one of my best single model.
./
├── config.yaml
├── data
├── logs
├── README.md
├── requirements.txt
├── src
│ ├── classifier.py
│ ├── create_folds.py
│ ├── dataset.py
│ ├── early_stopping.py
│ ├── logger.py
│ ├── models.py
│ ├── resize_data.py
│ ├── train.py
│ └── utils.py
├── subs
└── weights
-
Setup virtual environment(using conda or virtualenv).
conda create -n kaggle python=3.7 conda activate kaggle pip install -r requirements.txt
NOTE : I am using pytorch 1.6 in this code, earlier version of pytorch wont work without making changes to the code.
-
Download the dataset(jpeg folder) and zip it in data folder from kaggle. After downloading data folder should look like this
data/ ├── jpeg │ ├── test │ └── train ├── sample_submission.csv ├── test.csv └── train.csv
-
Create folds.
python create_folds.py
-
Resize images. Original images are quite large so loading large images while training will slow training. So resize dataset to smaller size (384,512,1024 etc.) by changing shape in resize_data.py and then run
python resize_data.py
This will create two folders train_image and test_images in the data folder containing training image and testing images respectively.
-
Start training
python train.py
weights, logs and submission file will be saved in weights, logs, subs folder respectively.