Skip to content

Supervised binary classification of skin lesions from dermascopic images using an ensemble of diverse CNN architectures (EfficientNet-B4, ResNet-50).

Notifications You must be signed in to change notification settings

grace-arina/Skin-Lesion-Detection-Using-Neural-Networks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

Skin Lesion Detection Using Neural Networks

logo

There are over 200 different forms. Out of 200, melanoma is the deadliest form of skin cancer. Among all the skin cancer type, melanoma is the least common skin cancer, but it is responsible for 75% of death. Melanoma skin cancer is highly curable if it gets identified at the early stages. The first step of Melanoma skin cancer diagnosis is to conduct a visual examination of the skin's affected area. This project aims to build an automated classification system based on image processing techniques to classify skin cancer using skin lesions images. The approach uses Convolutional Neural Network (CNN) to perform a binary classification from outlier lesions images. This reduction of a gap has the opportunity to impact millions of people positively.

Dataset

The project dataset is openly available on Kaggle(https://www.kaggle.com/drscarlat/melanoma).

Sample Images from the Dataset:

  • The images below are labelled as Melanoma in the dataset.

Screen Shot 2022-03-09 at 09 32 15 Screen Shot 2022-03-09 at 09 31 59 Screen Shot 2022-03-09 at 09 31 28

  • The images below are labelled as NotMelanoma in the dataset.

Screen Shot 2022-03-10 at 17 01 14 Screen Shot 2022-03-10 at 17 01 05 Screen Shot 2022-03-10 at 17 00 56

Preprocessing

In any machine learning project, it is critical to set up a trustworthy validation scheme, in order to properly evaluate and compare models. This is especially true if the dataset is small which is the case of this project.

For a typical image classification problem, the standard approach is to take a deep CNN model (such as the most popular EffcientNet) trained on ImageNet, replace the last layer so that the output dimension equals the target's dimension, and fine tune it on the specific dataset.

The target to predict is binary-melanoma i.e. Melanoma and Not Melanoma.

Data Augmentation

In a small size dataset, image augmentation is required to avoid overfitting the training dataset. The augmentation that helps to improve the prediction accuracy of the model are as follows:

  • Rotation: rotates the image by a specified degree.
  • Shearing: shifts one part of the image like a parallelogram
  • Horizontal flip: randomly flipps half the images horizontally—relevant when there are no assumptions of horizontal asymmetry

Network Configurations

I used ensemble terminology to train diverse models. The model configuration is as follows:

  1. Pretrained CNN Models: I chose to use Efficent Net B4 and ResNet 50 as they achieved higher accuracy on ImageNet competition
  2. Targets: The models are trained 10682 images belonging to two classes
  3. Resized input image sizes to 224x224 pixels to lower resolution due to GPU memory constraints
  4. Optimizer: Adam. As we have sparse data, Adam is used because of the adaptive learning rate.

Results & Evaluation

Models Test Accuracy # Trainable Params Epochs
Baseline 82.83% 1,625,026 30
EfficientNetB4 (augmented) 89.53% 5,619,906 29
EfficientNetB4 (1 trainable layer) 90.96% 5,619,906 15
EfficientNetB4 (3 trainable layer) 92.59% 6,426,306 10
ResNet 50 (augmented) 93.23% 6,422,722 30
ResNet 50 (3 trainable layers) 93.91% 6,426,818 37
ResNet 50 (5 trainable layers) 93.29% 7,477,442 18

The ResNet ensemble mechanism significantly improves the average prediction performance and is able to generalise well as the models are getting higher accuracy on the validation set compared to the training set.

Screen Shot 2022-03-10 at 18 16 39

Screen Shot 2022-03-10 at 18 10 09

Tensorboard

TensorBoard provides the visualization and tooling needed for machine learning experimentation:

  • Tracking and visualizing metrics such as loss and accuracy
  • Visualizing the model graph (ops and layers)
  • Viewing histograms of weights, biases, or other tensors as they change over time

To view my interactive Tensorboard scan the QR code below or Click here

qr-code

Demo

tb.demo.mov

About

Supervised binary classification of skin lesions from dermascopic images using an ensemble of diverse CNN architectures (EfficientNet-B4, ResNet-50).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published