Inspiration

I've spent a lot of time thinking about how hospitals in India actually work. Before this, I was building Ek Parchi, a tool that turns paper OP slips into digital lab orders. One thing kept bothering me: when a model says "72% risk of heart disease", what is a doctor supposed to do with that? Where is the problem? How sure is the model? And what if the patient never got an echo, because the health centre doesn't have one?

So when I saw Track A, I wanted to build something that answers those questions honestly instead of just showing a number.

What it does

HeartRisk 3D looks at routine patient data (history, symptoms, ECG, blood tests and echo) and estimates two things: the chance of coronary artery disease, and the chance of narrowing in each of the three main arteries (LAD, LCX and RCA).

Then it shows all of it on a 3D heart you can rotate and click. Each artery lights up from teal to red depending on its risk, and blood flow visibly slows down where the risk is higher.

A few things I care about a lot:

  • It tells you when it's unsure. Every prediction comes with a range and a 90% conformal prediction set. So instead of a bare number you get one of three answers: "CAD likely", "CAD unlikely", or "Uncertain: please refer".
  • It works with missing tests. Untick "Echo" or "Labs" and the app switches to a model trained without them. You can actually watch the confidence drop.
  • It explains itself. For every patient you can see which factors pushed the risk up or down, and whether the decision came from symptoms, the ECG, the labs or the echo.
  • It's careful. There's a what-if view, but it clearly says this is how the model reacts, not medical advice. It also warns you about unusual inputs, can print a one-page report, and never sends patient data anywhere.

How I built it

I used the public Z-Alizadeh Sani dataset (303 patients) and kept 61 of them aside, untouched, for final testing.

On the ML side, I compared four model types with repeated cross-validation and, for each target, picked the simplest one that was about as good as the best. That turned out to be logistic regression for most targets, and gradient boosting for the LCX. I calibrated the probabilities, added conformal prediction for uncertainty, and trained separate models for every combination of available tests (8 per target).

The heart is built in Three.js. Instead of downloading a mesh, I generated it in code and placed the coronary arteries along their real anatomical paths. A Flask backend serves the models with SHAP explanations, and the same model also runs fully inside the browser. That's what powers the live demo, and a test checks that both give exactly the same answers.

Challenges I ran into

  • The dataset is small. With only 61 test patients the numbers are noisy, so I show 95% confidence intervals instead of pretending to be precise.
  • Not drawing things the data doesn't know. The data says whether an artery is narrowed, not where. One field, Region RWMA, looks like a location but is really just a 0–4 score. So I colour the whole artery and never invent a lesion.
  • A result that surprised me. In this data, bringing BMI down to a healthy value actually raises the model's risk estimate (the "obesity paradox"). I decided to show it and explain it, rather than hide it.
  • A bug I'm glad I caught. A patient with 59% risk was being labelled "CAD unlikely". I changed the logic so the most likely answer is always included.
  • An idea that didn't work. I tried chaining the artery models together, hoping it would help the weaker LCX and RCA predictions. It didn't, so I left it out.

Accomplishments that I'm proud of

  • Predictions that are honest about uncertainty and know when to say "refer"
  • Being able to show how much each type of test (ECG, labs, echo) actually helps
  • A live demo where the patient's data never leaves their own browser
  • Getting the Python and JavaScript versions to agree down to the 10th decimal place

What I learned

In healthcare, a model that knows when it doesn't know is far more useful than one with a slightly higher accuracy. I also learned to be careful with observational data: a model can find patterns that look causal but aren't, and the interface has to make that clear.

What's next for HeartRisk 3D

  • Test it on data from another hospital
  • Use real patient anatomy from CT scans instead of a generic heart
  • Get feedback from doctors and try a small pilot
  • Add patient summaries in Hindi and other regional languages

Results on the 61 held-out patients: CAD 0.85 AUC, LAD 0.79, LCX 0.76, RCA 0.68 (95% confidence intervals are in the app).

Try it: https://mg782469.github.io/heartrisk3d/ Code: https://github.com/MG782469/heartrisk3d

This is a decision-support and education tool, not a diagnosis.

Built With

Share this project:

Updates

Submission history