Code Monkey home page Code Monkey logo

melanoma-detection's Introduction

Melanoma Detection Using CNN

Melanoma is a type of cancer that can be deadly if not detected early. It accounts for 75% of skin cancer deaths. A solution which can evaluate images and alert the dermatologists about the presence of melanoma has the potential to reduce a lot of manual effort needed in diagnosis.The purpose is to build a CNN based model which can accurately detect melanoma.

Table of Contents

General Information

Melanoma is a type of cancer that can be deadly if not detected early. It accounts for 75% of skin cancer deaths. A solution which can evaluate images and alert the dermatologists about the presence of melanoma has the potential to reduce a lot of manual effort needed in diagnosis.The purpose is to build a CNN based model which can accurately detect melanoma. The model being built is a multiclass classification model using a custom convolutional neural network in TensorFlow.

The dataset consists of 2357 images of malignant and benign oncological diseases, which were formed from the International Skin Imaging Collaboration (ISIC). All images were sorted according to the classification taken with ISIC, and all subsets were divided into the same number of images, with the exception of melanomas and moles, whose images are slightly dominant. The data set contains the following diseases:

  1. Actinic keratosis
  2. Basal cell carcinoma
  3. Dermatofibroma
  4. Melanoma
  5. Nevus
  6. Pigmented benign keratosis
  7. Seborrheic keratosis
  8. Squamous cell carcinoma
  9. Vascular lesion

Business Goals

The purpose is to build a CNN based model which can accurately detect melanoma. The model being built is a multiclass classification model using a custom convolutional neural network in TensorFlow.

Model Building

  1. Data Reading/Data Understanding → Defining the path for train and test images
  2. Dataset Creation→ Create train & validation dataset from the train directory with a batch size of 32. Also, make sure you resize your images to 180*180.
  3. Dataset visualisation → Create a code to visualize one instance of all the nine classes present in the dataset
  4. Model Building & training :
    • Create a CNN model, which can accurately detect 9 classes present in the dataset.
    • While building the model, rescale images to normalize pixel values between (0,1).
    • Choose an appropriate optimiser and loss function for model training
    • Train the model for ~20 epochs
    • Check if there is any evidence of model overfit or underfit.
  5. Chose an appropriate data augmentation strategy to resolve underfitting/overfitting
  6. Model Building & training on the augmented data :
    • Choose data augmentation technique to address issues of underfit\overfit in previous model.
    • Train the model for ~20 epochs
    • Check if the earlier issue is resolved or not.
  7. Class distribution: Examine the current class distribution in the training dataset
    • Which class has the least number of samples?
    • Which classes dominate the data in terms of the proportionate number of samples?
  8. Handling class imbalances: Rectify class imbalances present in the training dataset with Augmentor library.
  9. Model Building & training on the rectified class imbalance data :
    • Check for Class Imbalance and apply Class Rebalancing technique to address Class imbalance
    • Train the model for ~30 epochs
    • Check if the earlier issue is resolved or not and impact on model performance.

Dataset

The dataset is available in the google drive. The dataset consists of 2357 images of malignant and benign oncological diseases, which were formed from the International Skin Imaging Collaboration (ISIC). All images were sorted according to the classification taken with ISIC, and all subsets were divided into the same number of images, with the exception of melanomas and moles, whose images are slightly dominant. The data set contains the following diseases:

  1. Actinic keratosis
  2. Basal cell carcinoma
  3. Dermatofibroma
  4. Melanoma
  5. Nevus
  6. Pigmented benign keratosis
  7. Seborrheic keratosis
  8. Squamous cell carcinoma
  9. Vascular lesion

Conclusions

  • The class rebalance in the final model helped in reducing overfititng of the data and thus the loss is reduced. It also enhanced the overall accuracy of the model.
  • Initially we tried building model without the ImageDataGenerator which created data to highly overfit.
  • Then we introduced dropout to address overfitting and ImageDataGenerator for data augmentation which reduced the over fit, but significantly reduced the overall accuracy as well.
  • At last we tried Batch Normalization and Augumentation which really helped in carry forward

Technologies Used

  • pandas
  • numpy
  • matplotlib
  • tensorflow
  • keras
  • augmentor

Acknowledgements

Pratik Patil

Contact

https://github.com/patil-pratik-87

melanoma-detection's People

Contributors

patil-pratik-87 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.