A newer version of the Gradio SDK is available:
5.41.0
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
- 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
- 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:
- Click the upload button
- Select or drag an image
- View the predicted class and probabilities
π§Ύ Files Included
app.py
β Gradio interfacemodel.py
β Model architecture and prediction pipelinerequirements.txt
β Dependenciesfine_tuned_effnetb2_dermamnist.pth
β Trained model weights