Healthcare AI Case Study
Educational demo · synthetic data only
TriageAI — Reviewed Clinical Intake
Clinical notes become editable intake fields and ESI routing suggestions. Clinicians review the inputs and make the final decision.
Offline test-set evaluation · LightGBM V2
70.4% macro F1 · 78.3% accuracy · 0.68% ESI 3→5 under-triage
The under-triage metric is the proportion of true ESI 3 cases predicted as ESI 5 (215 cases); it is not an overall clinical-safety rate. ESI 5 F1 is 54.70%. These are model metrics, not patient-care outcomes.
Try the workflow
Open the demo and choose Start a private demo session. Use synthetic information only. Extract a clinical note, correct the fields, confirm review, and run prediction. Accept or override the suggestion, then generate a PDF and inspect the audit trail. A new workspace starts empty. Sessions are temporary and the first API request can take longer during a cold start.
Problem and my contribution
Emergency intake needs reviewable information, rather than just a model label. I built data preparation and registry integration, deterministic clinical-note extraction, the React/FastAPI workflow, safety rules, clinician review, persistence, PDF reporting, cloud delivery, and validation. This is educational decision support; it does not diagnose patients or claim clinical validation.
Product walkthrough
From note to reviewed decision
Review the extracted intake
Deterministic NLP extracts supported fields, missing information, and source snippets. Prediction waits for explicit clinician confirmation.
Inspect and sign off
Class probabilities and safety escalation remain distinct. The clinician can accept, override with a reason, or request further review.
Retain the reviewed result
The backend stores review history and creates a PDF snapshot. Changed inputs or review state produce a fresh report without altering historical report bytes.
Model evaluation and calibration
The source dataset contains 366,890 emergency-department records; the ESI 3/4/5 modelling subset contains 257,306. The runtime uses the final 273-feature LightGBM V2 registry, a 0.60 threshold, and raw model probabilities. ESI 1/2 escalation uses explicit safety rules outside this classifier.
Macro F1 gives each class equal weight. The lower 54.70% ESI 5 F1 remains a limitation even with 78.32% overall accuracy. The registry reports 70.37% macro F1, 78.88% weighted F1, and 215 ESI 3-to-5 downgrades (0.68% of true ESI 3 cases).
The curve shows that raw probabilities should not be read as calibrated clinical confidence. Calibration was evaluated: Platt scaling improved test Brier score from 0.312 to 0.281, but the validation selection rejected it because macro F1 and ESI 5 F1 were not preserved. Isotonic calibration was also rejected because ESI 5 F1 was not preserved. This records a tradeoff; it does not establish that the deployed probabilities are calibrated.
Final test metrics · Calibration decision · Model-selection article
An archived model-comparison table contains a different LightGBM snapshot. I do not combine it with the final registry to claim a like-for-like baseline improvement.
Architecture, review, and safety
FastAPI and PostgreSQL own assessments, predictions, reviews, audit events, and official reports. The browser is not the source of truth. Reviewed extraction metadata preserves supported fields and evidence without storing raw note text in the NLP audit payload. The NLP layer does not infer diagnoses, treatments, or ESI decisions.
Database-backed sessions and owner-scoped APIs isolate demo workspaces. Backend tests check cross-workspace access and replace client-supplied reviewer identity with the authenticated principal. The Doctor demo role is a workflow permission, not verification of professional credentials.
Cloud delivery and reliability
Netlify serves React; a non-root Cloud Run container serves FastAPI and the real registry. Neon PostgreSQL stores application data, while a private GCS bucket stores reports. Secret Manager supplies secrets. Separate runtime, migration, and cleanup database identities limit privileges; migrations run separately from startup.
Release verification tested a private candidate before traffic promotion, with digest-pinned images and recorded rollback information. This was an operator-driven release, not automatic cloud CI/CD. Two uptime checks and five alert policies cover availability, API errors, and cleanup. A temporary alert verified opening and closure email delivery; not every failure condition was exercised.
Hourly cleanup targets eligible inactive workspaces older than 24 hours. Active-session exclusions and batch limits mean this is not an exact deletion deadline. Quotas and shared rate limits constrain demo usage.
Validation and evidence
The documented release snapshot records 160 Python tests passed, one PostgreSQL-only case skipped locally, and 60 React tests passed across 15 files. Production frontend build, Docker full-stack checks, health, and readiness passed. PostgreSQL migrations and API integration were checked separately in CI. These historical results are software verification, not a new test run or clinical validation.
Cloud release record · Operations and rollback
Limitations and next steps
No real-patient deployment, patient-outcome improvement, clinical validation, compliance certification, or uptime SLA is claimed. Staging and demo share database and report infrastructure. Independent staging, verified cloud database restoration, staff identity lifecycle, prospective clinical validation, and live drift monitoring remain future work. Offline subgroup reports exist; they do not replace clinical or prospective subgroup validation. Optional Azure Speech is not a verified live capability.
The next ML work is a reproducible baseline comparison against the final registry and broader evaluation of calibration, subgroup errors, and safety-rule behavior. The next operational work is isolated staging and a tested restore procedure.