Inspiration

Most clinical AI tools give you one number and ask you to trust it. But a cardiologist needs more: which vessels are at risk, how stable the explanation is, and when the model should not be trusted. We wanted to build a tool that shows its work, and makes coronary risk something you can see on an interactive 3D heart.

What it does

TrustHeart 3D predicts overall coronary artery disease (CAD) and stenosis in the three main vessels (LAD, LCX, RCA) from clinical data.

  • Two modes: Quick uses 7 bedside inputs (age, sex, chest pain type, diabetes, hypertension). Full multimodal uses up to 54 variables, including labs, ECG and echocardiography.
  • Interactive 3D heart: select a target and the heart shows that vessel's calibrated probability. These are per-vessel probabilities, not lesion locations.
  • Trust Layer (our differentiator):
    • Coherence: CAD is true if any vessel is blocked, so we enforce $$\max(P_{LAD}, P_{LCX}, P_{RCA}) \le P_{CAD} \le \min(1, P_{LAD}+P_{LCX}+P_{RCA})$$ and flag any adjustment.
    • Similar patients: nearest real cases from out-of-fold data, showing only outcomes, age band and sex.
    • Explanation stability: 30 bootstrap refits tag each feature as stable, moderate or unstable.
    • Imputed-value flags: any blank input is clearly marked.
  • Persistent disclaimer: decision support and education only, not a diagnosis.

How we built it

  • Data: Extension of Z-Alizadeh Sani (UCI #411), 303 angiography-referred patients. Vessel labels are never used as inputs (zero leakage).
  • Modelling: regularised logistic regression chosen by 10×5 nested cross-validation with a 1-standard-error simplicity rule, plus Platt calibration.
  • Results (nested CV ROC-AUC): CAD 0.92 (full) / 0.90 (quick), LAD 0.84, LCX ≈ 0.73, RCA ≈ 0.74.
  • Backend: FastAPI with strict input validation, CSP headers, rate limiting, SHA-256 model integrity checks (fails closed), and no storage or logging of patient inputs.
  • Frontend: React, TypeScript, Three.js, Tailwind, served from a single port or Docker.
  • Verification: pytest suite and independent scripts check leakage, calibration and API contracts.

Challenges we ran into

  • Tiny dataset: with 303 patients, complex models overfit, so we favoured simpler ones. For LCX and RCA the 7-feature model won even in full mode.
  • Incoherent predictions: separately trained targets sometimes contradicted each other (about 23% in full mode), which led to our coherence constraint.
  • Misleading stability: our first rule made 5-of-7 features look "stable" by default, so we revised it and documented the change.
  • Overclaiming risk: calibrated models were still mildly overconfident on held-out data, so we reported that openly.

What we learned

Honest uncertainty is a feature. Showing limits, similar cases and stability made the model more useful than a higher score alone.

What's next

External validation on other centres and populations, better LCX/RCA performance, and clinician feedback on the Trust Layer.

AI disclosure

We used AI tools (Claude, Gemini) for planning and code assistance. Metrics come from reproducible scripts, and details are in docs/AI_DISCLOSURE.md.

Code: [www.github.com/kcfl/trustheart]

Built With

Share this project:

Updates

Submission history