AI-Based Skin Cancer Classification

MEng Dissertation Group Project


Project Overview

This project investigated the use of artificial intelligence and dermoscopic imaging to support early skin cancer detection. The aim was to develop a smartphone application, intended as a tool for general practitioners (GPs), to classify skin lesions to a high accuracy and reduce unnecessary secondary referrals. This project was divided into six key responsibilities – curating a high-quality image dataset, developing a machine learning classification model, continuous bias and performance tracking, explainable AI (XAI) integration, image processing and segmentation model development, and user interface (UI) and user experience (UX) design.

gradcam crop


The Challenge

Existing skin cancer applications are promising with a relatively high level of accuracy in identifying skin lesions. However, these results are typically received from controlled image datasets rather than random cases, which raises concerns about the validity of these systems. Additionally, these applications function as “black box AI” models, meaning that an outcome is generated without clear reasoning, decreasing user trust. Therefore, this project implemented explainable AI (XAI) to improve transparency through justified results.

In terms of image datasets, there is significant bias towards lighter skin tones, meaning that machine learning models may struggle to perform at a high accuracy on images with darker skin due to a lack of training data. Therefore, training data was carefully curated, ensuring as much of an even distribution of skin tones as possible.

fst scale


My Contribution

Literature Review

  • Conducted a literature review on the current human assessment for skin cancer screening.
  • Explored the existing applications used for skin lesion classification, highlighting the limitations and areas of improvement.
  • Highlighted the inconsistency of training data for machine learning models in the current literature.
  • Considered the UK and international regulations associated with AI as a medical device.
  • Studied three deep learning algorithms used in medical image classification and compared results.
  • Reviewed model parameters such as batch size, epoch, and convolutional blocks for optimal performance.
screenshot 2026 07 14 123558
literature review.drawio

Dataset Curation

  • Used official dermatology databases (DermNet, ISIC Archive, etc) to obtain high-quality skin lesion images.
  • Curated a large dataset of 6000 images, equal parts benign and malignant, split into training data, validation data, and testing data.
  • Aimed for minimal bias by selecting images evenly across all skin tones.
  • Carefully located lesions with minimal obstructions to improve the quality of training data.
  • Formed an equally large unclean dataset for comparison of model performance.
  • Reported on the challenges encountered during dataset curation and how they were mitigated.
cnn model flow diagram.drawio
Schematic of CNN Model Architecture

Model Development

  • Used PyCharm, an Integrated Development Environment (IDE) to organise model code.
  • Developed a sequential convolutional neural network (CNN) to extract features from skin lesion images.
  • Adjusted model parameters to balance accuracy with computational efficiency.
  • Tested the model on curated and uncurated datasets, performing many iterations to optimise model performance.
  • Reported the results of uncurated vs. curated datasets and the effect of various model parameters on accuracy.


Results

Performance

roc curve
ROC Curve indicating performance across strict and lenient criteria
  • Achieved an Area Under Curve (AUC) of 0.9091 for unclean dataset, indicating strong performance at all classification thresholds.
  • Maintained a high true positive rate while limiting false positives.
  • Performance metrics demonstrate feasibility of model on random and unclean data.

Model Evaluation

confusion matrices
Confusion Matrices for comparison of both datasets
  • Unclean dataset resulted in more true positives but clean dataset showed more true negatives.
  • More false negatives seen in the clean dataset, suggesting a strict criteria formed for malignancy.
  • Overall, the model performed at a higher accuracy on the unclean dataset, potentially due to representing real-world variability more closely.

Final Application

app 1 photoroom
app 2 (1) photoroom
app 3 1 removebg preview


Technical Skills

Programming

Python

PyCharm

TensorFlow

Google Colab

OpenCV

Machine Learning

CNNs

Image Classification

Model Evaluation

Data

Preprocessing

Augmentation

Data Curation

Data Analysis

Research

Literature Review

Scientific Writing

Overleaf

Schematics


Key Takeaways

  • Improved my understanding of deep learning algorithm development and medical image classification.
  • Gained practical experience in CNN architecture development and training a machine learning classification model.
  • Learned how to curate an image dataset, ensuring minimal obstructions and even skin tone distribution to maintain accuracy across results.
  • Strengthened scientific writing skills by presenting data clearly, explaining key findings in detail, and using appropriate metrics.
  • Presented my work to a panel of examiners, demonstrating strong communication skills and defending technical decisions.


Further Reading

If you are interested in the project and would like to read more, you can download the complete dissertation below for a detailed description of the methodology, results, and evaluation.