VITRA
Turn reagent colours into measurable data.
- Year
- 2026
- Status
- Live
- Category
- Full-Stack

01 / Overview
VITRA is a computer-vision research platform for use case KJS-HC-03, Urine Test Strip Reader using Colorimetry as a Point-of-Care Technology, at K J Somaiya School of Engineering. Urine dipsticks screen for diabetes, urinary tract infections, and kidney and liver disorders, but they are read by eye against a printed chart: subjective, lighting-dependent and categorical.
VITRA is the software for a sealed, LED-lit Raspberry Pi 5 reader. After a 120 s timed reaction it checks the photo, finds the ten reagent pads, measures their colour, turns colour into numbers only when a compatible calibration exists, and routes every result to a clinician, who signs off every run.
It is a research prototype: not a medical device and not clinically validated. All bundled data, images and models are synthetic, and nothing in it is a real patient sample. The hosted demo runs on a temporary database that resets on its own, with one-click demo accounts for the admin, clinician, operator and researcher roles.
02 / Problem
Urine dipsticks screen for diabetes, urinary tract infections, and kidney and liver disorders, but they are read by eye against a printed chart.
Reading by eye is subjective, depends on the lighting and gives only categories, not measurable values.
03 / Solution
- 01A sealed, LED-lit Raspberry Pi 5 enclosure photographs the strip after a fixed 120 s reaction, so every strip is captured at the same moment and under the same light.
- 02Nine whole-image quality checks run first; a failure stores the run as an invalid image and nothing is inferred.
- 03OpenCV localises and rectifies the strip, segments the ten pads, and measures RGB, CIELAB and HSV features per pad, giving a 30-D RGB vector.
- 04Colour becomes a value only when a compatible calibration exists; otherwise the analyte reports calibration required. An explicit result-state policy labels every result measured, experimental, synthetic, out of range, indeterminate, invalid image, unavailable or calibration required.
- 05Every result is routed to a clinician for review, and every state change is audited.
04 / Features
- 01Analysis from an upload or browser-camera capture, with a reaction timer and strip product and batch selection
- 02A result inspector with the original image, overlay, pad inspector and subject trend
- 03A clinician review queue with accept, reject, needs-repeat and note decisions, audited
- 04PDF and JSON reports with a SHA-256 hash, linked to the run and a pseudonymous sample
- 05Calibration studio: CSV dataset import, linear, poly2/poly3 ridge, kNN and random-forest models with a group-aware split, 5-fold CV and empirical 95% intervals, and a model lifecycle in which the database forbids validating a synthetic-trained model
- 06Model lab with per-model evaluation and side-by-side comparison
- 07Device registry with rotating API keys and an ingest API; a clearly labelled simulated device is included
- 08Honesty rules: synthetic data is labelled SYNTHETIC everywhere, there are no green "normal" or red "abnormal" indicators, and red is reserved for image and system faults
05 / Architecture
- 01Next.js 15 App Router, React 19, TypeScript strict, Tailwind CSS v4, Drizzle ORM, zod and pdf-lib
- 02PostgreSQL 15+ through DATABASE_URL; embedded PGlite for local development and the temporary demo fallback; 23 tables from hand-written SQL migrations
- 03Python CV and calibration service (Starlette, OpenCV, scikit-learn): quality, localise, segment, features and overlay, plus calibration training and inference with a joblib model store
- 04The web app owns all state; the browser and devices never call the CV service directly
- 05scrypt passwords, HttpOnly cookie sessions, RBAC across 5 roles, zod-validated server actions, protected file serving and an audit trail for every state change
- 06Tests: Vitest, Python unittest and a Playwright smoke suite
06 / Screens


