Downloads · 30 days
0
sabrinahartung1010/skin-lesion-resnet18
skin-lesion-resnet18 is a image classification model from sabrinahartung1010. 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 torchvision ResNet18, pretrained on ImageNet and fine-tuned to sort dermatoscopic images into the seven HAM10000 lesion classes. It was trained as a learning exercise and is the first model evaluated by VERIFAI Medi…
Downloads · 30 days
0
Access
Public
Updated Sep 30, 2026
Repo size
44.8 MB
Likes
0
Public
Click a slice to open those files.
.pt44.8 MB · 100%
From the Hugging Face model README
A torchvision ResNet18, pretrained on ImageNet and fine-tuned to sort dermatoscopic images into the seven HAM10000 lesion classes. It was trained as a learning exercise and is the first model evaluated by VERIFAI Medical.
Not a medical device. This is an educational proof of concept. It has not been validated clinically and must not be used to diagnose, triage or reassure anyone about a skin lesion.
| Architecture | torchvision resnet18, ImageNet weights (ResNet18_Weights.DEFAULT), final layer replaced by Linear(512, 7) |
| File | resnet18_ham10000_classweights.pt — a PyTorch state_dict, not a pickled model |
| Framework | PyTorch / torchvision |
| Trained with | SkinLesions.ipynb |
| Author | Sabrina Hartung |
| Licence | CC BY-NC 4.0, following the training data's licence (see below) |
A state_dict stores numbers only. It does not record the architecture, the order of the
output classes or the preprocessing, so all three are stated here, and a different choice for
any of them silently gives a different model.
| Index | Class |
|---|---|
| 0 | actinic_keratoses |
| 1 | basal_cell_carcinoma |
| 2 | benign_keratosis-like_lesions |
| 3 | dermatofibroma |
| 4 | melanocytic_Nevi |
| 5 | melanoma |
| 6 | vascular_lesions |
The order is the sorted list of the dataset's dx labels.
transforms.Resize((224, 224)), no crop).ToTensor(), which scales pixels to [0, 1].[0.485, 0.456, 0.406] and std [0.229, 0.224, 0.225].import torch
import torchvision
from huggingface_hub import hf_hub_download
path = hf_hub_download("sabrinahartung1010/skin-lesion-resnet18",
"resnet18_ham10000_classweights.pt")
model = torchvision.models.resnet18(weights=None)
model.fc = torch.nn.Linear(model.fc.in_features, 7)
model.load_state_dict(torch.load(path, map_location="cpu", weights_only=True))
model.eval()
The train split of marmal88/skin_cancer,
a repackaging of HAM10000 (Tschandl et al., 2018, doi:10.1038/sdata.2018.161). The validation
split was used to watch the training, not to pick a checkpoint: the file is the state after the
last epoch.
That dataset's splits share lesions. An audit by image and lesion id found that 80% of
the images in its test split also appear in train, and that train and validation
together cover 9,964 of HAM10000's 10,015 images. Two consequences:
marmal88/skin_cancer's own validation or test split, including
the one in the training notebook, mostly measures memory, not generalisation;The audit and its method are in the VERIFAI Medical roadmap.
| Epochs | 5 |
| Optimiser | Adam, learning rate 1e-4 |
| Batch size | 32 |
| Loss | cross-entropy with class weights total / (n_classes × count), because about two thirds of the images are benign nevi |
| Augmentation (train only) | random horizontal and vertical flips, colour jitter (brightness 0.1, contrast 0.1) |
| Frozen layers | none; the whole network was fine-tuned |
| Hardware | Apple Silicon (MPS) |
Because of the leakage above, a trustworthy number needs images from outside HAM10000. The independent evaluation, with intervals, sample sizes and what each number cannot tell you, is the VERIFAI Medical showcase and its current results. The Derm7pt run there is the one no leakage can inflate. The numbers are not copied into this card so that they cannot go out of date here.
HAM10000 is published under CC BY-NC 4.0 (Harvard Dataverse, doi:10.7910/DVN/DBW86T). These weights are released under the same licence: attribution required, no commercial use.