Downloads · 30 days
0
iamhmh/derm-cnn-ham10000
derm-cnn-ham10000 is a image classification model from iamhmh. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as cc-by-nc-4.0.
A convolutional neural network trained on the HAM10000 dataset for multi-class skin lesion classification.
Downloads · 30 days
0
Access
Public
Updated Nov 13, 2025
Repo size
5.1 MB
Likes
0
Public
Click a slice to open those files.
.pth5.1 MB · 72%
From the Hugging Face model README
A convolutional neural network trained on the HAM10000 dataset for multi-class skin lesion classification.
This model predicts 7 skin lesion categories from dermatoscopic images.
It is lightweight, easy to deploy, and comes with an inference script for quick testing.
Architecture: Custom CNN (4 conv blocks + 5 fully-connected layers)
Input: RGB image resized to 28×28
Output: 7-class logits
Framework: PyTorch
Weights: model.pth
| Index | Label |
|---|---|
| 0 | Actinic keratoses (akiec) |
| 1 | Basal cell carcinoma (bcc) |
| 2 | Benign keratosis (bkl) |
| 3 | Dermatofibroma (df) |
| 4 | Melanocytic nevi (nv) |
| 5 | Vascular lesions (vasc) |
| 6 | Melanoma (mel) |
labels.json contains this mapping.
Metrics computed on the official HAM10000 split:
Class-level summary:
| Class | Precision | Recall | F1-score |
|---|---|---|---|
| akiec | 1.00 | 1.00 | 1.00 |
| bcc | 0.99 | 1.00 | 0.99 |
| bkl | 0.98 | 1.00 | 0.99 |
| df | 1.00 | 1.00 | 1.00 |
| mel | 0.99 | 0.93 | 0.96 |
| nv | 1.00 | 1.00 | 1.00 |
| vasc | 0.96 | 0.99 | 0.98 |
Full report available in classification_report.txt.
pip install torch torchvision numpy pillow
import torch
from model import load_model
from inference import predict
pred_idx, label, probs = predict("example.jpg", "model.pth")
print(label)
python inference.py path/to/image.jpg --weights model.pth
model.py # CNN architecture + load_model()
inference.py # Run prediction on an input image
model.pth # Trained weights
labels.json # Class index → label
classification_report.txt
assets/ # Confusion matrix, training curves (optional)
Dataset: HAM10000
License: CC BY-NC 4.0
Preprocessing:
Model weights: CC BY-NC 4.0 (non-commercial use only)
Code: MIT License
This restriction comes from the HAM10000 dataset license.
If you use this model, please cite the HAM10000 dataset:
Tschandl, P., Rosendahl, C., & Kittler, H. (2018).
The HAM10000 dataset, a large collection of multi-source dermatoscopic images of common pigmented skin lesions.
Scientific Data, 5, 180161.