DeepDerma / README.md
Jasur05's picture
Update README.md
6aae550 verified
---
title: DeepDerma
emoji: 🧴
colorFrom: blue
colorTo: pink
sdk: gradio
sdk_version: 5.38.0
app_file: app.py
pinned: true
short_description: Detect skin cancer early with powerful AI
---
# 🩺 DeepDerma: Skin Lesion Classification App
Welcome to **DeepDerma**, a simple yet powerful AI tool that helps identify **7 common skin lesions (abnormal injury or disease)** from clinical dermatoscopic images. Upload a skin image, and DeepDerma will predict the most likely diagnosis β€” assisting in early detection and educational awareness.
---
## πŸ” How It Works
Just upload a skin lesion image, and our AI model will:
- Preprocess the image
- Classify it into one of 7 dermatological categories
- Return the top predicted class with confidence scores
The model is built using **EfficientNet-B2** and trained on the **DermMNIST** dataset from MedMNIST.
---
## πŸ§ͺ Performance Summary
| Metric | Value |
|--------------|-----------|
| Test Accuracy | 73.3% |
| AUC Score | 0.91 |
| Top Class F1 | 0.86 (Nevus - NV) |
| Minority Class F1 | 0.53 |
## Competitiveness
> our results outperforms benchmarks such as ResNet-18, ResNet-50 in terms of accuracy and is competitive in AUC scores
Despite class imbalance, the model performs well on high-priority categories like melanoma (MEL) and nevi (NV) thanks to AUC-based training.
---
## 🧠 Model Details
- **Architecture**: [EfficientNet-B2](https://arxiv.org/abs/1905.11946)
- **Fine-tuned** on: DermMNIST (medmnist v2)
- **Input size**: 224 Γ— 224
- **Optimizer**: Adam, LR = 1e-4
- **Scheduler**: ReduceLROnPlateau
- **Augmentations**: Random flip, rotation, color jitter
- **Class balancing**: Weighted loss + WeightedRandomSampler
- **Metric used**: AUC (Area Under ROC Curve) for better performance on imbalanced classes
---
## πŸ“Š Dataset: DermMNIST
- **Source**: [MedMNIST v2](https://medmnist.com/)
- **Images**: 10,015 dermatoscopic RGB images (28Γ—28, resized to 224Γ—224)
- **Classes**: 7 types of skin lesions
- **Split**:
- Train: 7,007 images
- Val: 1,003 images
- Test: 2,005 images
---
## 🧬 Target Classes (With Description)
| Label | Name (Short) | Description |
|-------|--------------|-------------|
| 0 | **AKIEC** | Actinic keratoses / Intraepithelial carcinoma – pre-cancerous skin lesions |
| 1 | **BCC** | Basal Cell Carcinoma – common and locally invasive skin cancer |
| 2 | **BKL** | Benign Keratosis-like lesions – non-cancerous growths (seborrheic, solar, etc.) |
| 3 | **DF** | Dermatofibroma – benign skin nodules caused by overgrowth of fibrous tissue |
| 4 | **MEL** | Melanoma – the most dangerous type of skin cancer; early detection critical |
| 5 | **NV** | Melanocytic Nevi – common moles, typically benign |
| 6 | **VASC** | Vascular Lesions – angiomas, hemorrhages, and similar blood vessel-related growths |
---
## πŸš€ How to Run
This Space runs using **Gradio**. No setup needed β€” just:
1. Click the upload button
2. Select or drag an image
3. View the predicted class and probabilities
---
## 🧾 Files Included
- `app.py` β€” Gradio interface
- `model.py` β€” Model architecture and prediction pipeline
- `requirements.txt` β€” Dependencies
- `fine_tuned_effnetb2_dermamnist.pth` β€” Trained model weights
---