Giter VIP home page Giter VIP logo

melonama's Introduction

SIIM-ISIC Melanoma Classification - top 5% solution

Public Leaderboard: 773/3314 | Private Leaderboard: 153/3314

This repository contains the codebase for my approach on recent SIIM-ISIC Melanoma Classification kaggle competition.

A complete summary and walkthrough can be find in my blog post here.

Data

To be able to replicate the experiments and re run the code, you will need to download the data from here.

Training Folds

To create folds, simply run, python folds.py or use the triple stratified training folds file that is part of this repo. This will split the training data into 5 folds.

Image Preprocessing

To preprocess and resize images, simply run: python resize_images.py --input_folder <path_to_input_folder> --output_folder <path_to_output_folder> --mantain_aspect_ratio --sz 224

This will resize all images such that the shorter side of the image is of size 224px while mantaining the aspect ratio of the image. This kind of preprocessing was also used by ISIC 2019 winners as in the research paper here.

To also add color constancy, simply add -- cc flag to the command.

For a complete list of parameters, run python resize_images.py -h in the src directory of this GitHub repo.

Model Training

To train the model, run the following command:

python train.py --model_name efficient_net \
--arch_name efficientnet-b3 --device cuda --metric 'auc' \
--training_folds_csv <path_to_training_folds_csv> \
--train_data_dir <path_to_preprocessed_data> \
--kfold 0,1,2,3,4 --pretrained imagenet --train_batch_size 64 \
--valid_batch_size 64 --learning_rate  5e-4 \
--epochs 100 --sz 384 --accumulation_steps 8 \
--loss 'weighted_focal_loss'  

Inference

To run inference,

python predict.py --model_name efficient_net --arch_name efficientnet-b3 \
--model_path <path_to_trained_model_output_from_training_script> \
--test_data_dir <path_to_preprocessed_test_data> --sz 256 --test_batch_size 64 

To predict using TTA, just add --tta flag to the above command.

melonama's People

Stargazers

 avatar  avatar 20-100 avatar Kurian Benoy avatar Uday Lunawat avatar  avatar  avatar nandhu avatar  avatar Alex Wille avatar Krishna Kalyan avatar

Watchers

James Cloos avatar Igor Zubarev avatar Aman Arora avatar

Forkers

ravigv

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.