All Projects
Machine Learning

Gastrointestinal Disease Classification

8-class deep learning classifier for gastrointestinal diseases from endoscopy images. Built with EfficientNetV2S transfer learning on 8,040 real endoscopy images, achieving 95% test accuracy. Final Year Project at University of Haripur.

Project Overview

Early and accurate detection of gastrointestinal conditions can significantly improve patient outcomes. This project builds an 8-class image classifier trained on real endoscopy images from the Kvasir Dataset, capable of automatically identifying conditions such as polyps, esophagitis, ulcerative colitis, dyed resection margins, and normal tissue types.

Developed as my Final Year Project at the University of Haripur (AI Engineering), the system uses EfficientNetV2S pretrained on ImageNet and fine-tuned on 8,040 medical images across 7 gastrointestinal classes. The model achieves 95% test accuracy with perfect classification on healthy tissue types.

The Challenge

Gastrointestinal diseases affect millions globally and require endoscopy for diagnosis, a procedure that generates large volumes of images requiring expert review. Manual classification is time-consuming, subjective, and dependent on specialist availability. Missed or delayed diagnoses of conditions like polyps (which can become cancerous) can have serious consequences for patient health.

The Solution

Built an 8-class CNN classifier using EfficientNetV2S architecture pretrained on ImageNet and fully fine-tuned on the Kvasir medical endoscopy dataset. Applied AdamW optimiser with learning rate scheduling, early stopping, and model checkpointing to achieve optimal generalisation. Trained on Google Colab with T4 GPU using 6,432 training images at 224×224 resolution.

Key Features

  • EfficientNetV2S transfer learning fully fine-tuned on medical imaging data
  • 8-class classification: polyps, esophagitis, ulcerative colitis, dyed resection margins, normal cecum, normal pylorus, normal Z-line
  • 95% test accuracy on 804 held-out test images
  • AdamW optimiser with ReduceLROnPlateau and EarlyStopping callbacks
  • Trained on 8,040 real endoscopy images from the Kvasir Dataset
  • Confusion matrix analysis showing perfect classification on normal tissue types
  • Google Colab T4 GPU training pipeline with reproducible Jupyter notebook

Results & Impact

Achieved 95% test accuracy across all 8 gastrointestinal disease classes. Perfect classification on normal-pylorus and normal-cecum tissue types. Minor confusion between polyps and esophagitis, expected given their visual similarity in endoscopy images. The model demonstrates strong potential as a clinical decision support tool for gastroenterologists, reducing review time and flagging high-risk conditions automatically.