Inspiration

Coronary artery disease is normally confirmed by angiography, which is invasive. Long before that step, a patient already has a file full of routine numbers: history, examination findings, lab results, ECG and echocardiography. I wanted to ask a narrow, honest question: how well can the angiography findings be predicted from those non-invasive measurements alone, and can the answer be shown in a way that is understandable and not overstated?

Most risk tools stop at a single score. I wanted the prediction to land where a clinician or student already thinks: on the heart itself, vessel by vessel.

What it does

CardioScope AI takes 54 routine inputs across five modalities (demographics and history, examination and symptoms, laboratory values, ECG findings and echocardiography) and produces four predictions:

  • coronary artery disease (CAD) overall
  • stenosis of the LAD, LCX and RCA coronary arteries

Each prediction is explained with SHAP and mapped onto an interactive 3D heart. The three vessels are coloured by their model's predicted probability, and selecting a vessel shows which measurements pushed that prediction up or down. A what-if panel shows how the models respond when an input is changed, and a model page shows the real performance of every model, including the weak ones.

How I built it

  • ML pipeline (pandas, scikit-learn, XGBoost, SHAP). Four independent binary classifiers trained on the Z-Alizadeh Sani dataset (303 patients). For each target, 22 candidates were compared (logistic regression, SVM, random forest, XGBoost) using repeated stratified 5-fold cross-validation, with a selection rule fixed in advance.
  • API (FastAPI). A strict input schema feeds four saved pipelines and returns predictions, SHAP explanations and model metadata. Each model is one scikit-learn pipeline, so the API runs exactly the preprocessing fitted in training.
  • Dashboard (Next.js, React, TypeScript, React Three Fiber). Patient form, risk summary, 3D anatomy with optional layers, explanations, what-if simulation and model performance, in light and dark themes.
  • Anatomy. The 3D models are built from openly licensed reference anatomy.

Results

Holdout set of 61 patients, evaluated once after every decision was fixed:

Target Model Accuracy ROC-AUC (95% interval)
CAD XGBoost 0.869 0.904 (0.81–0.98)
LAD Random forest 0.787 0.834 (0.72–0.93)
LCX Random forest 0.672 0.764 (0.64–0.87)
RCA Logistic regression 0.656 0.670 (0.52–0.81)

The CAD and LAD models are useful. The LCX and RCA models are weak, and the app says so plainly.

Challenges

  • Small data. With about 240 training records, deep learning was the wrong tool. Simpler models, careful validation and bootstrap intervals mattered more than architecture.
  • Target leakage. The per-vessel outcomes sit in the same table as the inputs. Leakage prevention is enforced in code: a hard-coded blacklist, a feature whitelist, API rejection of outcome columns, and tests that fail if any guard is removed.
  • Not overstating. A coloured vessel on a 3D heart looks like imaging. It is not. The anatomy is generic, the colour is a model output, and the interface wording, risk bands and disclaimers were written to keep that distinction clear.
  • Explanations people can read. One-hot columns are summed back onto the original input, so every SHAP contribution refers to a measurement the user actually entered.

What I learned

  • Honest evaluation is a feature. Showing no-information accuracy next to each model changes how the numbers are read.
  • Fixing the selection rule before looking at results removes a lot of temptation.
  • Explainability and visualisation need as much care as the model, because that is where users form their beliefs.

What's next

  • External validation on data from other centres
  • Uncertainty shown directly on each prediction
  • A hosted demo with synthetic profiles only

Disclaimer

CardioScope AI is a research and education prototype. It is not a medical device and does not replace professional clinical evaluation, diagnostic imaging or physician judgment.

Built With

Share this project:

Updates

Submission history