Machine learning · 2025
Skin Lesion Classification
A skin lesion classifier trained on HAM10000, with a small web app on top, reaching 72% accuracy.
PyTorchCNNHugging FacePython
Skin Lesion Classification is a deep learning model that sorts photos of skin lesions by type, such as melanoma and basal cell carcinoma. I trained it on HAM10000, a standard dataset of dermoscopic images, and put a small web app on top so anyone can upload a photo and get a prediction.
The model
I trained two models and compared them:
- A CNN from scratch. I designed and trained my own network as a baseline.
- A fine-tuned pretrained network. Transfer learning from a pretrained model beat my own network every time, and reached 72% accuracy on the validation set.
Most of HAM10000 is one type of lesion, so accuracy on its own is misleading. I used weighted sampling, and looked at more than accuracy when comparing the models.
How it’s built
- PyTorch and TorchVision for training: data loaders, transforms, learning rate scheduling and evaluation.
- I host the model on Hugging Face Spaces, so I don’t run any GPU servers.
- The web app is on Vercel. It sends the image to the model and shows the predicted type with a confidence score.