Case study · AI / Medical imaging
Leukemia Detection
A deep-learning system that detects Acute Lymphoblastic Leukemia in Peripheral Blood Smear images, served through a web interface for real-time predictions. Built for education and research — not a substitute for professional medical diagnosis.
- PyTorch
- FastAPI
- Next.js
- Python
- React
- Tailwind CSS

$ cat problem.md
The problem
Leukemia screening from blood smears relies on manual microscopic analysis. The goal was to automate it: take a Peripheral Blood Smear image, classify it as healthy or leukemia, and return the result with a confidence score through a simple web interface.
$ ls ./features
What I built
Model
- A hybrid CNN + GRU model in PyTorch with a sigmoid output for binary classification.
- Trained with binary cross-entropy, the Adam optimiser, a ReduceLROnPlateau scheduler, gradient clipping and checkpointing.
Data
- About 4,000 Peripheral Blood Smear images from a Kaggle dataset (Benign, Early Pre-B, Pre-B, Pro-B).
- Resizing, normalisation and augmentation (flips, rotations); the three malignant subtypes grouped into one class.
Application
- A FastAPI backend serving the trained model.
- A Next.js, React and Tailwind CSS interface for uploading an image and reading the prediction with its confidence score.
- An end-to-end pipeline: UI → API → model.
$ git log --decisions
Decisions
- 01
CNN for spatial features, GRU for the dependencies between them.
The CNN learns cell shape, nucleus structure and texture; the GRU reads the resulting feature vectors as a sequence before a fully connected layer makes the prediction.
- 02
Binary classification: healthy vs leukemia.
The malignant subtypes are grouped into one class; multi-class subtype prediction is listed as future work.
- 03
Model served behind an API, separate from the interface.
The Next.js front end sends the uploaded image to the FastAPI backend and displays the class and confidence it returns.