Inspiration

Cardiovascular disease kills 17.9 million people every year, yet most clinical risk tools give a single static score with no explanation of why a patient is at risk or how that risk will change over time. I wanted to build something that treats cardiovascular risk as what it truly is - a trajectory, not a snapshot.

What I Built

CardioTrace is a cardiovascular risk trajectory forecasting system powered by LightGBM and SHAP interpretability. It takes 13 clinical parameters as input and produces:

  • A risk probability and level (Low / Moderate / High)
  • A 5-step simulated risk trajectory showing progression over time
  • A SHAP explanation of which features drove that specific patient's risk
  • A downloadable PDF clinical report

How I Built It

  1. Data: UCI Cleveland Heart Disease Dataset (303 patients, 13 features)
  2. Feature Engineering: Composite clinical risk score from age, blood pressure, cholesterol, ST depression, and max heart rate
  3. Temporal Simulation: 5 time-step trajectories per patient with physiologically realistic noise, expanding the dataset to 1,515 records
  4. Model: LightGBM with conservative hyperparameters to prevent overfitting
  5. Interpretability: SHAP TreeExplainer for per-patient feature attribution
  6. Deployment: Gradio app on Hugging Face Spaces with account login, risk dashboard, and PDF report generation

Results

Metric Value
Test AUC-ROC 0.963
5-Fold CV AUC 0.870 ± 0.028
Test Accuracy 87%
Test Recall (Disease) 0.93

Challenges

  • Simulating realistic temporal trajectories on cross-sectional data required careful calibration of noise parameters to stay clinically plausible
  • Balancing model complexity vs. overfitting on a small 303-patient dataset
  • Building a clean, professional clinical UI that feels like a real tool

What I Learned

That interpretability is not optional in clinical AI - a prediction without an explanation is clinically useless. SHAP makes the difference between a black box and a tool a doctor would actually trust.

Next Steps

  • Validate on MIMIC-III real longitudinal EHR data
  • Replace simulated trajectories with real multi-timepoint records
  • Extend to multi-class severity staging
  • Submit as a preprint to medRxiv

Built With

Share this project:

Updates