Update README.md
Browse files
README.md
CHANGED
|
@@ -1,14 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# π©Ί DeepDerma: Skin Lesion Classification App
|
| 2 |
+
|
| 3 |
+
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.
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
## π How It Works
|
| 10 |
+
|
| 11 |
+
Just upload a skin lesion image, and our AI model will:
|
| 12 |
+
- Preprocess the image
|
| 13 |
+
- Classify it into one of 7 dermatological categories
|
| 14 |
+
- Return the top predicted class with confidence scores
|
| 15 |
+
|
| 16 |
+
The model is built using **EfficientNet-B2** and trained on the **DermMNIST** dataset from MedMNIST.
|
| 17 |
+
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
## π§ͺ Performance Summary
|
| 21 |
+
|
| 22 |
+
| Metric | Value |
|
| 23 |
+
|--------------|-----------|
|
| 24 |
+
| Test Accuracy | 73.3% |
|
| 25 |
+
| AUC Score | 0.91 |
|
| 26 |
+
| Top Class F1 | 0.86 (Nevus - NV) |
|
| 27 |
+
| Minority Class F1 | 0.53 |
|
| 28 |
+
|
| 29 |
+
## Competitiveness
|
| 30 |
+
|
| 31 |
+
> our results outperforms benchmarks such as ResNet-18, ResNet-50 in terms of accuracy and is competitive in AUC scores
|
| 32 |
+
|
| 33 |
+
Despite class imbalance, the model performs well on high-priority categories like melanoma (MEL) and nevi (NV) thanks to AUC-based training.
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## π§ Model Details
|
| 38 |
+
|
| 39 |
+
- **Architecture**: [EfficientNet-B2](https://arxiv.org/abs/1905.11946)
|
| 40 |
+
- **Fine-tuned** on: DermMNIST (medmnist v2)
|
| 41 |
+
- **Input size**: 224 Γ 224
|
| 42 |
+
- **Optimizer**: Adam, LR = 1e-4
|
| 43 |
+
- **Scheduler**: ReduceLROnPlateau
|
| 44 |
+
- **Augmentations**: Random flip, rotation, color jitter
|
| 45 |
+
- **Class balancing**: Weighted loss + WeightedRandomSampler
|
| 46 |
+
- **Metric used**: AUC (Area Under ROC Curve) for better performance on imbalanced classes
|
| 47 |
+
|
| 48 |
---
|
| 49 |
+
|
| 50 |
+
## π Dataset: DermMNIST
|
| 51 |
+
|
| 52 |
+
- **Source**: [MedMNIST v2](https://medmnist.com/)
|
| 53 |
+
- **Images**: 10,015 dermatoscopic RGB images (28Γ28, resized to 224Γ224)
|
| 54 |
+
- **Classes**: 7 types of skin lesions
|
| 55 |
+
- **Split**:
|
| 56 |
+
- Train: 7,007 images
|
| 57 |
+
- Val: 1,003 images
|
| 58 |
+
- Test: 2,005 images
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## 𧬠Target Classes (With Description)
|
| 63 |
+
|
| 64 |
+
| Label | Name (Short) | Description |
|
| 65 |
+
|-------|--------------|-------------|
|
| 66 |
+
| 0 | **AKIEC** | Actinic keratoses / Intraepithelial carcinoma β pre-cancerous skin lesions |
|
| 67 |
+
| 1 | **BCC** | Basal Cell Carcinoma β common and locally invasive skin cancer |
|
| 68 |
+
| 2 | **BKL** | Benign Keratosis-like lesions β non-cancerous growths (seborrheic, solar, etc.) |
|
| 69 |
+
| 3 | **DF** | Dermatofibroma β benign skin nodules caused by overgrowth of fibrous tissue |
|
| 70 |
+
| 4 | **MEL** | Melanoma β the most dangerous type of skin cancer; early detection critical |
|
| 71 |
+
| 5 | **NV** | Melanocytic Nevi β common moles, typically benign |
|
| 72 |
+
| 6 | **VASC** | Vascular Lesions β angiomas, hemorrhages, and similar blood vessel-related growths |
|
| 73 |
+
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
+
## π How to Run
|
| 77 |
+
|
| 78 |
+
This Space runs using **Gradio**. No setup needed β just:
|
| 79 |
+
|
| 80 |
+
1. Click the upload button
|
| 81 |
+
2. Select or drag an image
|
| 82 |
+
3. View the predicted class and probabilities
|
| 83 |
+
|
| 84 |
+
---
|
| 85 |
+
|
| 86 |
+
## π§Ύ Files Included
|
| 87 |
+
|
| 88 |
+
- `app.py` β Gradio interface
|
| 89 |
+
- `model.py` β Model architecture and prediction pipeline
|
| 90 |
+
- `requirements.txt` β Dependencies
|
| 91 |
+
- `fine_tuned_effnetb2_dermamnist.pth` β Trained model weights
|
| 92 |
+
|
| 93 |
---
|
| 94 |
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
|