Inspiration

Coronary risk models usually output a row of numbers. We wanted a student, judge or clinician-in-training to point at an artery and ask three questions in one place: what did the model predict, why, and how much should I trust it?

What it does

CardioScope runs four frozen classifiers on 55 structured inputs from the public UCI Z-Alizadeh Sani dataset: overall CAD and stenosis in the LAD, LCX and RCA.

  • Click an artery on a real 3D heart (83 verified BodyParts3D meshes). Its output card and its explanation follow, the selected vessel glows, and the others fade. Selection also works from the card to the heart.
  • Probability on the vessel: each whole artery is colored on one continuous scale, with gold at the 0.5 threshold.
  • Why: verified SHAP factors with readable feature names and a "reconstruction verified" badge. Every explanation must add back up exactly to the model's actual output.
  • Live what-if: two labeled hypothetical edits to the public example (Typical Chest Pain 0→1, Atypical Y→N) move CAD from 17.1% to 64.5% and LAD from 24.3% to 56.1%. The LAD turns gold on the heart. LCX and RCA barely move, which matches their weak holdout sensitivity.
  • Evidence: the saved holdout metrics, 95% intervals, confusion matrices and limitations, shown next to the predictions.

How we built it

  • Frontend: React and TypeScript with Vite, plus Three.js through React Three Fiber.
  • Backend: FastAPI validates every profile against the exact source schema, then runs frozen scikit-learn pipelines (balanced L2 logistic regression for CAD and LAD, shallow random forests for LCX and RCA) and SHAP (Linear and Tree).
  • Integrity: model, schema and profile fingerprints link every prediction to its explanation. 256 scientific files are hash-locked, and a guard allows the holdout to be evaluated only once.
  • Delivery: Docker, plus GitHub Actions running 134 Python and 75 frontend tests.

Evaluation

The 303 records were split once into 242 development and 61 prespecified holdout records. We selected models with nested cross-validation, froze them, then evaluated once on the same-source holdout:

Target ROC-AUC Recall at 0.5
CAD 0.913 0.907
LAD 0.847 0.848
LCX 0.672 0.208
RCA 0.698 0.286

LCX and RCA are a real weakness, and we show it rather than hide it. Two preregistered follow-up studies (threshold tuning and a multi-task network) failed their gates, so neither shipped.

Challenges

  • Verifying the artery mappings in shared anatomical coordinates.
  • Keeping TreeSHAP consistent with the saved forests despite float32 threshold rounding.
  • Reproducing the exact environment on Linux.
  • Preserving an honest once-only test while still building a compelling product.

What we learned

Rigor and good UX reinforce each other. A frozen, once-only evaluation makes every number on screen trustworthy, and showing the weak LCX/RCA results builds more credibility than hiding them.

What's next

An independent external cohort, calibration assessment, and patient-specific imaging-based anatomy, each requiring its own validation.

Educational and decision-support prototype, not a diagnostic tool. Data: UCI Z-Alizadeh Sani (CC BY 4.0). Anatomy: BodyParts3D © The Database Center for Life Science (CC BY 4.0).

Built With

Share this project:

Updates

Submission history