Skip to content

SkinScan AI is an intelligent skin disease detection system that uses deep learning to analyze skin lesion images and provide quick, explainable predictions. It is built with Flask, PyTorch, and EfficientNet, offering a simple interface for users to upload images and receive diagnoses with visual heatmaps for transparency.

Notifications You must be signed in to change notification settings

IniBuilds-git/SkinScan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# 🧠 SkinScan AI

**SkinScan AI** is an intelligent skin disease detection system that uses deep learning to analyze skin lesion images and provide quick, explainable predictions. It is built with **Flask**, **PyTorch**, and **EfficientNet**, offering a simple interface for users to upload images and receive diagnoses with visual heatmaps for transparency.

---

## 📸 DEMO

![SkinScan Demo](https://drive.google.com/file/d/1VuKBQxwMBczVSUNL6xjwMhyMYcbUH43h/view?usp=sharing)

---

## 🚀 Features

- ✅ Upload skin lesion images
- 🔍 Predict dermatological conditions using an EfficientNet-B0 model
- 🧠 Explain predictions using Grad-CAM heatmaps
- 📄 Display clinical recommendations per disease
- 💻 Lightweight Flask application, easy to deploy

---

## 🛠️ Tech Stack

- **Language**: Python 3.8+
- **Web Framework**: Flask
- **Deep Learning**: PyTorch, TorchVision
- **Model**: EfficientNet-B0 (transfer learning)
- **Visualization**: Grad-CAM, Matplotlib
- **Frontend**: HTML/CSS with Jinja2 templates

---

## 📂 Project Structure
skin-disease-detection/
│
├── data/                         # Data directory
│   ├── raw/                      # Original Kaggle dataset 
│   ├── processed/                # Preprocessed data
│   └── models/                   # Saved model files
│
├── notebooks/                    # Jupyter notebooks
│   ├── 01_data_exploration.ipynb
│   ├── 02_data_preprocessing and model_training.ipynb
│   └── 03_model_evaluation.ipynb

│
├── app/                          # Flask web application
│   ├── static/                   # Static files (CSS, JS, images)
│   ├── templates/                # HTML templates
│   ├── __init__.py
│   ├── routes.py                 # Application routes
│   ├── forms.py                  # Form handling
│   └── prediction.py             # Prediction logic
│
├── requirements.txt              # Project dependencies
├── run.py                        # Application entry point
└── README.md                     # Project documentation
```

## Installation and Setup

### Prerequisites

- Python 3.8+
- pip
- Virtual environment (recommended)

### Installation Steps

1. Clone the repository:
```bash
git clone https://github.com/IniBuilds-git/SkinScan
cd SkinScan
```

2. Create and activate a virtual environment:
```bash
python -m venv venv
source venv/bin/activate 
```

3. Install dependencies:
```bash
pip install -r requirements.txt
```

4. Download the dataset:
   - Download the [Skin Disease Dataset from Kaggle](https://www.kaggle.com/datasets/pacificrm/skindiseasedataset)
   - Extract it to the `data/raw/` directory

5. Run the notebook files step by step from data exploration, to data preprocessing and training, to model evaluation


7. Run the Flask application:
```bash
python app.py
```

8. Open a web browser and go to `http://127.0.0.1:5000/`

## Usage

1. **Upload an image** of the affected skin area using the web interface
2. **Wait for analysis** as the AI processes the image
3. **View the results** showing the detected skin condition, confidence levels, and recommendations
4. **Read additional information** about the condition and next steps

## Model Training and Evaluation

### Training Process

The model was trained using a two-phase approach:

1. **Feature Extraction**: Initial training with a frozen EfficientNet-B0 base model and custom classification head
2. **Fine-tuning**: Additional training with unfrozen top layers of the base model

### Performance Metrics

- **Accuracy**: 92.3% on the test set
- **Precision**: 0.91 weighted average
- **Recall**: 0.89 weighted average
- **F1-Score**: 0.90 weighted average

## Ethical Considerations

SkinScan AI was developed with careful attention to ethical considerations:

- **Medical Disclaimer**: The system clearly states it is for educational purposes only and not a replacement for professional medical advice
- **Data Privacy**: Uploaded images are processed locally and not stored permanently without explicit consent
- **Bias Mitigation**: The training dataset includes diverse skin tones and conditions
- **Transparency**: The system provides confidence scores to indicate the reliability of predictions

## Future Improvements

- Expand the dataset with more diverse skin conditions and skin tones
- Implement more advanced model architectures and ensemble techniques
- Develop a mobile application for improved accessibility
- Add symptom tracking functionality for monitoring progress over time
- Integrate with telemedicine platforms for seamless doctor consultations



About

SkinScan AI is an intelligent skin disease detection system that uses deep learning to analyze skin lesion images and provide quick, explainable predictions. It is built with Flask, PyTorch, and EfficientNet, offering a simple interface for users to upload images and receive diagnoses with visual heatmaps for transparency.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published