Downloads · 30 days
0
conan17970/efficientnet-b1-skin-cancer-isic2019
efficientnet-b1-skin-cancer-isic2019 is a image classification model from conan17970. Use it when you need a label for an image. It is set up for timm. The card lists the license as apache-2.0.
Fine-tuned on ISIC 2019 for 6-class skin lesion classification F1: 0.688 | Accuracy: 68.2%
Downloads · 30 days
0
Access
Public
Updated Mar 26, 2026
Repo size
26.5 MB
Likes
0
Public
Click a slice to open those files.
.pth26.5 MB · 100%
From the Hugging Face model README
Fine-tuned on ISIC 2019 for 6-class skin lesion classification
F1: 0.688 | Accuracy: 68.2%
| 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| ACK | BCC | MEL | NEV | SCC | SEK |
import torch, timm
from PIL import Image
from torchvision import transforms
from huggingface_hub import hf_hub_download
weights = hf_hub_download(repo_id="conan17970/efficientnet-b1-skin-cancer-isic2019", filename="best_weights.pth")
model = timm.create_model("efficientnet_b1", pretrained=False, num_classes=6)
model.load_state_dict(torch.load(weights, map_location="cpu"))
model.eval()
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize([0.485,0.456,0.406],[0.229,0.224,0.225])
])
classes = ['ACK','BCC','MEL','NEV','SCC','SEK']
img = Image.open("skin.jpg").convert("RGB")
with torch.no_grad():
logits = model(transform(img).unsqueeze(0))
print(classes[logits.argmax().item()])