Skip to content

sareenv/Skin-Lesion-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

116 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Skin Lesion Classifier πŸ”¬

Python Keras TensorFlow License

A deep learning project using Convolutional Neural Networks (CNNs) to classify pigmented skin lesions. This repository contains experimental implementations exploring various CNN architectures and hyperparameters to develop an optimal intelligent model for detecting and classifying skin lesions in dermoscopic images.

πŸ“‹ Table of Contents

🎯 Overview

This project implements deep learning models for the automated classification of pigmented skin lesions. The system uses convolutional neural networks to analyze dermoscopic images and classify various types of skin lesions, which can aid in early detection of skin cancer and other dermatological conditions.

Key Objectives:

  • Develop and train CNN models for skin lesion classification
  • Implement image preprocessing and segmentation techniques
  • Compare different network architectures and hyperparameters
  • Achieve high accuracy in multi-class lesion classification

✨ Features

  • Multiple CNN Architectures: Experimentation with various deep learning architectures
  • Image Segmentation: Advanced preprocessing pipeline for lesion boundary detection
  • Data Preparation: Comprehensive data augmentation and preprocessing scripts
  • Visualization: Training metrics and results plotted using Matplotlib
  • Web Interface: Simple web system for model deployment (in webSystem/ folder)
  • Jupyter Notebooks: Interactive notebooks for research and experimentation

πŸ“ Project Structure

skin-lesion-classifier/
β”œβ”€β”€ Research/               # Main research notebooks and experiments
β”‚   β”œβ”€β”€ Data preparation.ipynb
β”‚   β”œβ”€β”€ Image Segmentation.ipynb
β”‚   β”œβ”€β”€ Research.ipynb
β”‚   └── ttest.png
β”œβ”€β”€ webSystem/             # Web application for model deployment
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ index.js
β”‚   β”œβ”€β”€ package.json
β”‚   └── readme.md
β”œβ”€β”€ Report/                # Project documentation and reports
└── README.md

πŸ”§ Requirements

Core Dependencies

  • Python: 3.6 or higher
  • Keras: 2.0+
  • TensorFlow: 2.x (with GPU support recommended)
  • NumPy: For numerical computations
  • Pandas: For data manipulation
  • Pillow (PIL): For image processing
  • Scikit-learn: For machine learning utilities
  • Matplotlib: For visualization

Full Requirements List

keras>=2.0.0
tensorflow>=2.0.0
numpy>=1.19.0
pandas>=1.1.0
pillow>=8.0.0
scikit-learn>=0.23.0
matplotlib>=3.3.0
jupyter>=1.0.0

πŸ“¦ Installation

Option 1: Using Anaconda (Recommended)

The easiest way to install all dependencies is using Anaconda, which includes Jupyter Notebook:

  1. Download and install Anaconda:

    # Visit: https://www.anaconda.com/distribution/
  2. Create a new environment:

    conda create -n skin-lesion python=3.8
    conda activate skin-lesion
  3. Install required packages:

    conda install keras tensorflow-gpu numpy pandas pillow scikit-learn matplotlib jupyter

Option 2: Using pip

# Clone the repository
git clone https://github.com/sareenv/FYP.git
cd FYP

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

πŸ“Š Dataset

This project requires a dataset of dermoscopic images of pigmented skin lesions.

Dataset Requirements:

  • High-resolution dermoscopic images
  • Multiple classes of skin lesions
  • Training and validation splits
  • Ground truth labels

Recommended Datasets:

Data Preparation:

Place your dataset in the appropriate directory and use the Data preparation.ipynb notebook to preprocess the images.

πŸš€ Usage

1. Data Preparation

Open and run the data preparation notebook:

jupyter notebook "Research/Data preparation.ipynb"

This will:

  • Load and organize your dataset
  • Apply data augmentation
  • Split data into training/validation/test sets
  • Normalize and preprocess images

2. Image Segmentation

Run the segmentation notebook to extract lesion boundaries:

jupyter notebook "Research/Image Segmentation.ipynb"

3. Model Training

Train the CNN models using the main research notebook:

jupyter notebook "Research/Research.ipynb"

The notebook includes:

  • Model architecture definitions
  • Training procedures
  • Hyperparameter tuning
  • Performance evaluation
  • Results visualization

πŸ—οΈ Model Architecture

The project experiments with various CNN architectures including:

  • Custom CNN: Built from scratch with multiple convolutional layers
  • Transfer Learning: Using pre-trained models (VGG, ResNet, etc.)
  • Ensemble Methods: Combining multiple models for better performance

Each architecture is evaluated based on:

  • Classification accuracy
  • Precision, Recall, F1-Score
  • Confusion matrices
  • ROC curves

πŸ“ˆ Results

Training results and visualizations are generated in the notebooks and include:

  • Training/validation accuracy curves
  • Loss curves
  • Confusion matrices
  • Classification reports
  • Statistical analysis (t-tests, etc.)

Results images are saved in the Research/ folder.

🌐 Web System

The webSystem/ folder contains a web application for deploying the trained model:

cd webSystem
npm install
npm start

See webSystem/readme.md for more details about the web interface.

πŸ–₯️ GPU Configuration

For faster training, GPU acceleration is highly recommended. Training on CPU will be extremely slow.

Installing CUDA Support

  1. Install CUDA Toolkit and cuDNN:

  2. Install TensorFlow with GPU support:

    pip install tensorflow-gpu
  3. Verify GPU availability:

    import tensorflow as tf
    print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))

For detailed instructions, refer to the TensorFlow GPU Installation Guide.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ‘¨β€πŸ’» Author

Vinayak Sareen

Final Year Project - Coventry University

For any questions or further information, please feel free to reach out.

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Coventry University for academic support
  • Keras and TensorFlow communities
  • ISIC Archive for providing dermoscopic image datasets
  • All contributors and researchers in the field of medical image analysis

⭐ If you find this project useful, please consider giving it a star!

Note: This is an academic research project. The models should not be used for clinical diagnosis without proper validation and regulatory approval.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors