Inspiration

Most AI systems stop at “the model predicts X% risk.” We wanted to build something that asks what happens after the prediction: Why did the model say this? How robust is it? What changes its prediction? And when should the output be treated cautiously?

That idea became RIFT — Robust Intervention & Future Testing: a decision-intelligence framework built around counterfactual reasoning, adversarial stress testing, and an independent safety layer.

For the cardiovascular track, we applied that philosophy to CAD and coronary-vessel stenosis prediction. Instead of treating AI as a black-box classifier, we wanted to connect prediction, explanation, counterfactual analysis, safety checks, and vessel-level visualization into one workflow.

What it does

RIFT takes structured cardiovascular patient data — including demographic, clinical, ECG, laboratory, and echocardiographic features — and predicts:

  • Overall Coronary Artery Disease (CAD)
  • LAD stenosis
  • LCX stenosis
  • RCA stenosis

The system then goes beyond prediction.

It calibrates the probabilities, evaluates them on held-out data, identifies influential features, generates model-behavior counterfactuals, detects out-of-distribution inputs, and flags weak models before displaying results.

The final outputs are connected to an interactive 3D coronary visualization, where LAD, LCX, and RCA probabilities are represented on their corresponding vessel branches.

The visualization is intentionally schematic: it communicates vessel-level prediction rather than pretending the tabular dataset contains exact lesion coordinates.

How we built it

We built RIFT as a modular Python-based decision-intelligence platform with a cardiovascular domain layer on top of the core engine.

The cardiovascular pipeline is:

Clinical Data
      ↓
Schema Validation
      ↓
Leakage Firewall
      ↓
Feature Encoding + Scaling
      ↓
CAD / LAD / LCX / RCA Models
      ↓
Probability Calibration
      ↓
Explainability
      ↓
Counterfactual Analysis
      ↓
Safety / Guardian Checks
      ↓
3D Coronary Visualization
      ↓
Clinical Evaluation Dashboard

We used the UCI Z-Alizadeh Sani Extension dataset and created a reproducible train/validation/test pipeline with target leakage protection.

Four target-specific models are registered independently:

CAD  → Logistic Regression
LAD  → Random Forest
LCX  → Random Forest
RCA  → Logistic Regression

We added out-of-fold calibration, held-out evaluation, permutation importance, logistic coefficients where applicable, and observed-value counterfactual analysis.

The platform also includes a model registry with versioned artifacts and hashes, reproducibility metadata, model cards, and a Guardian-style safety layer.

For the interface, we built an interactive browser-based coronary viewer using Three.js/WebGL, connected directly to the prediction outputs and evaluation artifacts.

Challenges we ran into

The biggest challenge was not training the models — it was making the entire system honest and robust.

The dataset contains vessel-level target information, so preventing leakage required a dedicated firewall rather than simply dropping a few columns once during preprocessing.

Another challenge was probability calibration. A classifier can produce a number that looks precise without that number actually being well calibrated, so we had to build calibration and reliability evaluation into the pipeline.

We also discovered that not every target model performs equally well. Instead of hiding weaker results, we built the system to expose them through model cards and safety warnings.

The 3D visualization created another important challenge: the dataset is tabular and does not contain exact anatomical lesion coordinates. We therefore designed the viewer as a vessel-level schematic rather than making unsupported imaging claims.

Finally, integrating prediction, explainability, counterfactuals, safety, evaluation, APIs, and visualization into a single reproducible workflow required much more engineering than building a standalone ML notebook.

Accomplishments that we're proud of

We are proud that RIFT is more than a model demo.

We built an end-to-end system that combines:

  • Leakage-safe multi-target cardiovascular prediction
  • Held-out evaluation and cross-validation
  • Probability calibration
  • Feature-level explainability
  • Counterfactual model analysis
  • Out-of-distribution detection
  • Weak-model awareness
  • Safety-gated output
  • Versioned model artifacts
  • Reproducible evaluation evidence
  • Interactive 3D coronary visualization
  • Clinical evaluation and model-card interfaces

We are especially proud of the fact that the system does not hide bad news.

For example, when a vessel-specific model performs poorly, RIFT surfaces that limitation instead of presenting the prediction with false confidence. We believe this is an important part of building responsible AI systems.

What we learned

We learned that building useful AI is not just about improving a model's metric.

A reliable system also needs to answer:

What data produced this result?
Was leakage prevented?
How well does the model perform?
Are the probabilities calibrated?
Why did the model predict this?
What happens under a counterfactual?
Is the input unusual?
How should limitations affect interpretation?

We also learned that visualization must respect the limits of the underlying data. A beautiful 3D interface is not useful if it implies information the dataset never contained.

Most importantly, we learned to treat uncertainty, failure cases, and model limitations as first-class outputs rather than edge cases.

What's next for RIFT — Robust Intervention & Future Testing

The cardiovascular implementation is one domain of a broader RIFT architecture.

Next, we want RIFT to evolve into a general counterfactual decision laboratory that can work across healthcare, infrastructure, traffic, energy, and other high-stakes domains.

Future work includes:

  • Richer longitudinal cardiovascular state modeling
  • Larger and externally validated clinical datasets
  • More advanced uncertainty and distribution-shift analysis
  • Deeper causal and counterfactual modeling
  • More realistic anatomical visualization when imaging data is available
  • Human-in-the-loop decision workflows
  • Expanded adversarial stress testing through the CHAOS layer
  • More optimization backends, including experimental quantum workflows
  • Stronger evidence, governance, and deployment controls

The long-term vision is simple:

RIFT should not just tell you what an AI predicts. It should help you understand possible futures, challenge the prediction, expose its weaknesses, and present the evidence needed to make a better-informed decision.

Share this project:

Updates

Submission history