portfolio
← PROJECTS
ML / Deep Learning · 2025

Skin Lesion Classification

A deep learning model and user-friendly interface to classify skin cancer types, achieving up to 72% accuracy with custom and fine-tuned neural networks.

PyTorchCNNHugging FacePython

Skin Lesion Classification is a deep learning project for classifying skin cancer types from dermoscopic images. The goal was to build something that was both technically solid and actually usable — not just a notebook with a confusion matrix, but a complete pipeline from raw image to prediction, with an interface a non-technical user could interact with.

The model

The classification task covers multiple skin lesion types — melanoma, basal cell carcinoma, and others — using the HAM10000 dataset, a standard benchmark in dermatological AI research.

I trained and evaluated two approaches:

  • Custom CNN — A convolutional network designed and trained from scratch. This gave me full control over the architecture and a baseline to compare against.
  • Fine-tuned pretrained network — A pretrained model adapted to the dermoscopy domain using transfer learning. Fine-tuning a pretrained backbone consistently outperformed the custom architecture, achieving up to 72% accuracy on the validation set.

The gap between the two highlighted something worth understanding: pretrained networks bring years of generalised visual feature learning that’s very hard to replicate from scratch on a domain-specific dataset of this size.

Key technical areas

Convolutional Neural Networks — Understanding how spatial feature hierarchies are built layer by layer, and how architectural choices (kernel size, depth, pooling strategy) affect what the model learns.

PyTorch and TorchVision — The full training loop: dataloaders, transforms, loss functions, optimisers, learning rate scheduling, and evaluation metrics.

Class imbalance — The HAM10000 dataset is heavily skewed toward certain lesion types. Handling this required weighted sampling and careful metric selection — accuracy alone is a misleading signal when one class dominates.

The interface

The frontend is a clean web app that takes a dermoscopic image as input, runs inference via the deployed model, and returns the predicted class with a confidence score.

The model is hosted on Hugging Face Spaces, which made deployment straightforward without having to manage GPU infrastructure. The frontend is deployed separately on Vercel, keeping the UI and model serving decoupled.

What I took away

This project shifted how I think about ML work. The modelling is only part of it — the data pipeline, the deployment story, and the interface all matter equally if you want something people can actually use. Building the end-to-end system myself made each of those tradeoffs concrete.