Coder Social home page Coder Social logo

grace-arina / skin-lesion-detection-using-neural-networks Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2.19 MB

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

Jupyter Notebook 100.00%
machine-learning computer-vision deep-learning image-classification kaggle convolutional-neural-networks keras tensorflow tensorboard tensorboard-visualization

skin-lesion-detection-using-neural-networks's Introduction

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

skin-lesion-detection-using-neural-networks's People

Contributors

grace-arina avatar

Stargazers

 avatar

Watchers

 avatar

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.