Downloads · 30 days
25
31% of all-time downloads
Ankitdajhgf565/vit-large-skin-cancer-ham10000
vit-large-skin-cancer-ham10000 is a image classification model from Ankitdajhgf565. Use it when you need a label for an image. The card lists the license as mit.
Fine-tuned google/vit-large-patch16-224 on the HAM10000 dermoscopy dataset to classify 7 types of skin lesions. Trained on a free Google Colab T4 GPU in 37 minutes using HuggingFace Trainer with FP16 mixed precision.
Downloads · 30 days
25
31% of all-time downloads
All-time downloads
81
Public
Parameters
303M
1.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.2 GB · 100%
From the Hugging Face model README
Fine-tuned google/vit-large-patch16-224 on the HAM10000 dermoscopy dataset to classify 7 types of skin lesions. Trained on a free Google Colab T4 GPU in 37 minutes using HuggingFace Trainer with FP16 mixed precision.
This was a personal project to learn medical image fine-tuning — not a clinical tool.
from transformers import pipeline
classifier = pipeline(
"image-classification",
model="Kuldeepmishra3/vit-large-skin-cancer-ham10000",
)
results = classifier("skin_image.jpg", top_k=3)
for r in results:
print(f"{r['label']}: {r['score']:.2%}")
Or with manual preprocessing:
from transformers import ViTForImageClassification, ViTImageProcessor
from PIL import Image
import torch
model = ViTForImageClassification.from_pretrained("Kuldeepmishra3/vit-large-skin-cancer-ham10000")
processor = ViTImageProcessor.from_pretrained("Kuldeepmishra3/vit-large-skin-cancer-ham10000")
image = Image.open("skin_image.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_class = logits.argmax(-1).item()
print(model.config.id2label[predicted_class])
| Label | Full name |
|---|---|
| akiec | Actinic Keratoses |
| bcc | Basal Cell Carcinoma |
| bkl | Benign Keratosis |
| df | Dermatofibroma |
| mel | Melanoma |
| nv | Melanocytic Nevi |
| vasc | Vascular Lesions |
Evaluated on the HAM10000 validation split (2,492 images):
| Metric | Score |
|---|---|
| Accuracy | 92.74% |
| Weighted F1 | 92.60% |
Per-class F1:
| Class | F1 |
|---|---|
| vasc | 97.14% |
| nv | 96.54% |
| df | 92.86% |
| bcc | 92.24% |
| bkl | 84.37% |
| akiec | 82.50% |
| mel | 79.78% |
Melanoma was the hardest — it frequently gets confused with Melanocytic Nevi, which is a known challenge in dermoscopy even for trained dermatologists.
Augmentations used during training: random horizontal/vertical flip, rotation up to 30°, color jitter. No augmentation at validation time.
HAM10000 (Human Against Machine with 10000 training images) is a large collection of multi-source dermatoscopic images of common pigmented skin lesions. The dataset has significant class imbalance — Melanocytic Nevi makes up around 67% of all samples.