All projects

RetinaReady

A fully offline retinal-imaging assistant that catches ungradable fundus photos before the patient leaves, and helps clinicians prioritize review.

Overview

RetinaReady is a fully offline, on-device retinal imaging assistant. It evaluates fundus photographs the moment they're captured, flagging unusable images for a retake while the patient is still in the room, and then helps clinicians prioritize which images to review first. Everything runs locally: no cloud APIs, no patient data ever leaving the machine. It's a research demonstration, not a clinically validated medical device.

The Problem

More than 37 million Americans with diabetes need annual diabetic retinopathy screening, yet roughly 10% of fundus photographs turn out ungradable — an estimated 4 million failed captures a year. Those failures are usually discovered hours or days later, after the patient has already left, forcing repeat appointments, delaying diagnosis, and wasting an estimated $480 million annually. Worse, patients with ungradable images are disproportionately likely to have underlying pathology, making the delays especially harmful.

My Role

Developer on a three-person research team, working across the capture workflow and the on-device inference pipeline.

Development Process

We deliberately split the system into two stages instead of building one unsafe 'AI diagnosis'. Stage one is a compact 33 MB Gemma-based vision model that checks technical quality — blur, illumination, glare, retinal coverage, framing — and returns READY, LIMITED, or RETAKE. Only READY images reach stage two, RetinaPriority: a Gemma model with a rank-16 LoRA adapter fine-tuned on the DeepDRiD dataset that routes images to routine or priority review, or abstains as uncertain. Everything runs locally through llama.cpp, and if any part of the pipeline can't be verified, the workflow fails closed instead of guessing.

Key Features

  • Immediate quality feedback at capture time — unusable photos get a retake recommendation while the patient is still present
  • Fully on-device inference: no cloud connectivity, no per-image costs, and no retinal images sent to third-party services
  • Two-stage workflow separating technical image quality (READY / LIMITED / RETAKE) from review prioritization (ROUTINE / PRIORITY / UNCERTAIN)
  • Live capture with a stability gate: five steady frames freeze a single JPEG, so only one still image is ever analyzed — video never leaves the browser
  • Fail-closed design: if the model, LoRA adapter, image, or output format can't be verified, the system returns UNCERTAIN and defers to a human

Challenges & Solutions

Finding high-quality, openly licensed retinal imaging datasets that were compliant for research use.

Built the prototype on the public DeepDRiD fundus dataset and scoped the system to retrospective conventional central-field color fundus photography.

Combining image quality and clinical judgment in one model would have produced an unsafe 'AI diagnosis'.

Separated the pipeline into a quality gate and a review-priority stage with structured, workflow-routing outputs — labels that route work to clinicians rather than diagnose disease, with every result requiring clinician review.

Running the full workflow offline without making it painfully slow.

Put a compact 33 MB quality model first so the larger review-priority model only ever runs on images worth reviewing, keeping the whole llama.cpp pipeline responsive on ordinary hardware.