← All work

Machine Learning Projects

HemoGuard: offline thalassemia screening on a phone

NUST, final-year project · Lead developer · 2025

A Flutter app that photographs a CBC blood report, reads the values with on-device OCR and screens for thalassemia with an XGBoost model re-implemented in Dart. No server, no internet, under 50 ms per prediction.

The problem

Screening needed to work in clinics without internet, so the model had to run on the phone itself with no server and no heavy runtime.

What was done

  • ✓Trained an XGBoost classifier on a CBC dataset (~500 samples, 7 features: Hb, RBC, HCT, MCV, MCH, MCHC, RDW) reaching 92% diagnostic accuracy
  • ✓Wrote a pure-Dart inference engine that walks the 300-tree XGBoost JSON model on the phone (no TFLite, no server)
  • ✓Camera capture, image preprocessing and Google ML Kit text recognition, then a parser that rebuilds table rows from OCR bounding boxes
  • ✓Manual-entry fallback with normal ranges per value, clear screening result, CSV export; 59 unit tests cover the parser, predictor and settings
  • ✓Earlier version took readings from an STM32 acquisition device over TCP/IP

Evidence

Real app screens, rendered from the source (own project)

  • 92% accuracy on held-out data
  • ≤50 ms on-device inference, 300 trees
  • 59 unit tests passing
  • Works fully offline
Home: scan a report or enter values1 / 3

Outcome

A working app: photograph a CBC report or type the values and get a screening result on the phone, with no internet.

More work