Skip to content

Training pipeline for image classification in PyTorch.

Notifications You must be signed in to change notification settings

rajatdv/Kaggle-siim-melanoma

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SIIM-ISIC Melanoma Classification

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.

Table of contents

Project Structure

(top)

./
├── 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

Installation

(top)

  1. 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.

  2. 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
    

Training

(top)

  1. Create folds.

    python create_folds.py

  2. 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.

  3. Start training

    python train.py

    weights, logs and submission file will be saved in weights, logs, subs folder respectively.

Reference

About

Training pipeline for image classification in PyTorch.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages