Skip to content

gao-hongnan/siim-isic-melanoma-classification-deployment

Repository files navigation

SIIM-ISIC Melanoma Classification, 2020

by Hongnan Gao

Melanoma Classification with Grad-CAM

This repo is an extension of my team's top 4% (ranked 147/3308) solution to the SIIM-ISIC Melanoma Classification Challenge held in 2020. 1.5 years have gone by and I decided to deploy the model as a simple webapp with a simple UI consisting of both the predictions and the visualization of the grad-cam.

cover

Competition Description

Skin cancer is the most prevalent type of cancer. Melanoma, specifically, is responsible for 75% of skin cancer deaths, despite being the least common skin cancer. The American Cancer Society estimates over 100,000 new melanoma cases will be diagnosed in 2020. It's also expected that almost 7,000 people will die from the disease. As with other cancers, early and accurate detection—potentially aided by data science—can make treatment more effective.

Currently, dermatologists evaluate every one of a patient's moles to identify outlier lesions or “ugly ducklings” that are most likely to be melanoma. Existing AI approaches have not adequately considered this clinical frame of reference. Dermatologists could enhance their diagnostic accuracy if detection algorithms take into account “contextual” images within the same patient to determine which images represent a melanoma. If successful, classifiers would be more accurate and could better support dermatological clinic work.

As the leading healthcare organization for informatics in medical imaging, the Society for Imaging Informatics in Medicine (SIIM)'s mission is to advance medical imaging informatics through education, research, and innovation in a multi-disciplinary community. SIIM is joined by the International Skin Imaging Collaboration (ISIC), an international effort to improve melanoma diagnosis. The ISIC Archive contains the largest publicly available collection of quality-controlled dermoscopic images of skin lesions.

In this competition, you’ll identify melanoma in images of skin lesions. In particular, you’ll use images within the same patient and determine which are likely to represent a melanoma. Using patient-level contextual information may help the development of image analysis tools, which could better support clinical dermatologists.

Melanoma is a deadly disease, but if caught early, most melanomas can be cured with minor surgery. Image analysis tools that automate the diagnosis of melanoma will improve dermatologists' diagnostic accuracy. Better detection of melanoma has the opportunity to positively impact millions of people. - SIIM-ISIC Melanoma Classification Challenge

Directory Structure

Note that most of the scripts in this repo is used for training, for the purpose of deployment, we just need to concentrade on the below:

streamlit_app.py
app/

streamlit_app.py is the main entry point of the webapp and is almost self-contained, with some dependencies on my src/ codes. app/ is the main directory of the webapp with weights and images stored.


Workflow

requirements.txt is the list of dependencies for the webapp, both suitable for training and deployment.

To setup the environment, we can do the following:

# Assuming Windows
python -m venv venv_streamlit
venv_streamlit\Scripts\activate
python -m pip install --upgrade pip setuptools wheel # upgrade pip
pip install -e .  # installs required packages only    

A word of caution however, is that I removed all +cu from the requirements.txt file. This is because I have not yet figured out how to install the CUDA version of the pytorch package in Streamlit Cloud. I believe this is a known issue and should be on their future roadmap. Consequently, if one wants to train models using my scripts, it is best to go my main repo to do so.

Also, you may need to re-commit sometimes if the app goes to sleep.


Grad-CAM

I have been working on Grad-CAM for a while now, and I have a tutorial on it. The paper is the original paper and the implementation in python is here.

Demo App

This project features an interactive web app that uses traditional Convolutioons Neural Networks. Here is a short gif illustrating it.

web_app

References and Citations

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages