Downloads · 30 days
0
rachitgoyell/dermora-dinov2-vit-b-skin
dermora-dinov2-vit-b-skin is a image classification model from rachitgoyell. Use it when you need a label for an image. The card lists the license as mit.
A DINOv2 ViT-B model fine-tuned for skin condition classification with stress-correlation awareness. This model is the AI core of Dermora, a psychodermatology-focused health monitoring system that studies the relation…
Downloads · 30 days
0
Access
Public
Updated Apr 2, 2026
Repo size
697 MB
Likes
1
Public
Click a slice to open those files.
.pth697 MB · 100%
From the Hugging Face model README
A DINOv2 ViT-B model fine-tuned for skin condition classification with stress-correlation awareness. This model is the AI core of Dermora, a psychodermatology-focused health monitoring system that studies the relationship between psychological stress and visible skin conditions.
The model takes a skin image as input and classifies it into condition categories, capturing both the nature of the condition and patterns that may correlate with stress-triggered onset or severity.
| Property | Details |
|---|---|
| Model Type | Image Classification |
| Architecture | Vision Transformer Base (ViT-B/14) |
| Base Model | facebook/dinov2-base |
| Fine-tuned On | rachitgoyell/dermoraSkinStressDataset |
| Input | RGB skin images (facial or body regions) |
| Output | Class logits → predicted skin condition label |
| Framework | PyTorch + Hugging Face Transformers |
| Patch Size | 14x14 |
| Embedding Dimension | 768 |
DINOv2, developed by Meta AI, is a self-supervised vision foundation model trained on approximately 142 million images without labels. It learns highly generalizable visual representations that transfer well across downstream tasks — including medical and dermatological imaging.
Key reasons for choosing DINOv2 as the backbone:
pip install transformers torch pillow
from transformers import AutoImageProcessor, AutoModelForImageClassification
from PIL import Image
import torch
# Load model and processor
model = AutoModelForImageClassification.from_pretrained(
"rachitgoyell/dermora-dinov2-vit-b-skin"
)
processor = AutoImageProcessor.from_pretrained(
"rachitgoyell/dermora-dinov2-vit-b-skin"
)
# Load and preprocess image
image = Image.open("sample_skin.jpg").convert("RGB")
inputs = processor(images=image, return_tensors="pt")
# Run inference
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class_idx = logits.argmax(-1).item()
predicted_label = model.config.id2label[predicted_class_idx]
print(f"Predicted condition: {predicted_label}")
print(f"Confidence scores: {torch.softmax(logits, dim=-1)}")
from PIL import Image
images = [
Image.open("sample1.jpg").convert("RGB"),
Image.open("sample2.jpg").convert("RGB"),
Image.open("sample3.jpg").convert("RGB"),
]
inputs = processor(images=images, return_tensors="pt")
with torch.no_grad():
outputs = model(**inputs)
predicted_classes = outputs.logits.argmax(-1).tolist()
for idx, pred in enumerate(predicted_classes):
print(f"Image {idx + 1}: {model.config.id2label[pred]}")
from transformers import AutoModel
feature_extractor = AutoModel.from_pretrained(
"rachitgoyell/dermora-dinov2-vit-b-skin"
)
with torch.no_grad():
features = feature_extractor(**inputs)
cls_embedding = features.last_hidden_state[:, 0, :] # CLS token
print("Feature shape:", cls_embedding.shape) # (batch, 768)
facebook/dinov2-base pretrained weights| Parameter | Value |
|---|---|
| Base Model | facebook/dinov2-base |
| Loss Function | Cross-Entropy |
| Input Resolution | 224x224 |
| Patch Size | 14x14 |
| CLS Token | Yes |
| Optimizer | AdamW |
| Fine-tuning Strategy | Full model fine-tune |
Metrics reported on the held-out test split of the dermoraSkinStressDataset. External validation is ongoing.
| Metric | Value |
|---|---|
| Top-1 Accuracy | 0.81 |
| Macro F1 Score | 0.78 |
| Precision (macro) | 0.80 |
| Recall (macro) | 0.77 |
These figures reflect internal evaluation and should not be interpreted as clinically validated performance. Independent external validation has not yet been completed.
Released under the MIT License.
This model is intended for research and educational use only. Clinical deployment requires independent validation, institutional review, and applicable regulatory approvals. The authors make no warranties regarding the clinical accuracy or safety of this model.