Inspiration
Coronary Artery Disease (CAD) is a leading cause of global mortality. While traditional statistical models yield numerical probabilities, static numbers often fail to give clinicians or patients an intuitive understanding of where and how pathology is developing inside the heart. Cardio Risk 3D was built to bridge predictive machine learning with 3D WebGL anatomical rendering, mapping multi-vessel stenosis predictions directly onto an interactive human heart alongside interpretable explanations.
What it does
- Multi-Target Stenosis Prediction: Predicts overall CAD status (50% or more vessel narrowing) and vessel-specific stenosis for the Left Anterior Descending (LAD), Left Circumflex (LCX), and Right Coronary Artery (RCA).
- Interactive 3D Heart Heatmap: Features an anatomical heart (LV, RV, LA, RA, Aorta, Pulmonary Trunk, Vena Cava) rendered with Three.js. Arterial paths and branches (LAD, LCX, RCA) are draped onto the epicardial surface using camera raycasting, smoothly transitioning from green (0% risk) to red (100% risk) based on calibrated predictions. Users can rotate, zoom, select vessels/chambers, and inspect illustrative arterial cross-sections.
- Clinical Interpretability Dashboard: Computes rescaled additive SHAP feature contributions, groups risk drivers by clinical category (Symptoms, ECG, Echo, Blood Tests), generates deterministic plain-language summaries, and evaluates counterfactual "what-if" input changes.
- Transparent Signal Badges: Displays cross-validated reliability badges ("strong", "moderate", or "modest signal") for each target so weaker predictions are never presented with false confidence.
- Clinical Safety First: Includes a visible disclaimer indicating that all predictions are for decision support and educational purposes only.
How we built it
Data & Leakage Prevention: Built using the UCI Extension of Z-Alizadeh Sani Dataset (303 patients, 55 clean features). Target variables (Cath, LAD, LCX, RCA) and non-informative features were strictly excluded from input features.
- Nested Cross-Validation: Machine learning models were selected and tuned using nested 5-fold cross-validation (inner 3-fold search) to prevent hyperparameter optimisation leakage. Extra Trees was deployed for CAD and RCA, while Random Forest was deployed for LAD and LCX.
- Probability Calibration: Applied Platt scaling fitted on out-of-fold predictions to correct tree compression and ensure output percentages match observed clinical rates.
- Backend API & Explanations: Built with Python 3.13 and FastAPI (
api.py), utilizingshap.TreeExplainerwith rescaled outputs so feature contributions sum exactly to calibrated prediction shifts. - 3D WebGL Frontend: Single-file client-side HTML5/Three.js application (
web/index.html) running smoothly at 60 FPS without requiring dedicated GPU hardware.
Challenges we ran into
- Target Leakage Strictness: Enforcing strict separation of diagnostic ground-truth labels across preprocessing, training, calibration, and serving pipelines.
- Calibrating Tree Probabilities: Ensembles initially produced compressed probability distributions. Fitting Platt scaling improved Brier scores across all four targets.
- Surface Raycasting: Accurately draping 3D tubular arterial geometry over procedural cardiac surfaces required custom raycasting normal projections.
- Additive SHAP Consistency: Rescaling raw SHAP values so visual attribution bars align with calibrated probability changes relative to calibrated model baselines.
Accomplishments that we're proud of
- Achieved strong cross-validated performance: 0.911 ROC-AUC for overall CAD and 0.855 ROC-AUC for LAD stenosis.
- Built an interactive, light-weight 3D heart visualisation that runs smoothly in modern web browsers.
- Implemented deterministic, template-driven plain-language explanations to eliminate generative hallucination risks in clinical contexts.
What we learned
- Honest Signal Reporting: LCX (0.723 AUC) and RCA (0.728 AUC) exhibit modest predictive signal due to clinical presentation variance. Reporting these limitations transparently builds clinical credibility.
- Calibration Matters: High ROC-AUC alone is insufficient; probability calibration is critical for meaningful medical risk estimation.
What's next for Cardio Risk 3D
- External validation across multi-center clinical cohorts.
- Integration with DICOM coronary CT angiography (CCTA) processing pipelines for patient-specific 3D anatomical meshing.
Built With
- claude
- css3
- fastapi
- html5
- javascript
- matplotlib
- numpy
- pandas
- python
- render
- scikit-learn
- shap
- three.js
- uvicorn
- webgl
Log in or sign up for Devpost to join the conversation.