Why Your ML Model Should Sometimes Say 'I Don't Know': Building Uncertainty-Aware Clinical AI

μž‘μ„±μž

μΉ΄ν…Œκ³ λ¦¬:

← ν”Όλ“œλ‘œ
DEV Community · hossein ahmadi · 2026-08-23 개발(SW)

hossein ahmadi

🚨 Predictive models tell us what will happen.
🧠 Causal models tell us what happens IF we intervene.
❓ But neither tells us what we should DO.

In healthcare, this gap is dangerous.

I just finished building CausalSepsis-DI v2, an end-to-end Healthcare Decision Intelligence system that bridges the gap between causal estimation and safe clinical action.

πŸ₯ The Clinical Question:
Should we administer early antibiotics to this ICU patient to reduce length of stay?

Traditional ML answers: “Predicted ICU stay: 8.5 days”
❌ This doesn’t help clinicians make decisions.

πŸ’‘ The Core Innovation: A Three-Class Decision Policy

Instead of forcing binary treat / don't treat decisions (which can be dangerous when uncertainty is high), the system outputs three actions:

βœ… TREAT β€” High-confidence benefit (even worst-case CI is beneficial)
πŸ›‘ STANDARD CARE β€” High-confidence no benefit/harm (even best-case is harmful)
🩺 DEFER TO CLINICIAN β€” Uncertainty zone (safest choice)

This is not a limitation β€” it’s a feature. A trustworthy clinical AI knows when it doesn’t know.

πŸ› οΈ Technical Stack

🧠 Causal Inference: LinearDML (EconML) with cross-fitting for valid CATE + confidence intervals
πŸ“Š Propensity Diagnostics: Positivity/overlap checks before estimation
βš–οΈ Decision Policy: Cost-sensitive, utility-based, uncertainty-aware
πŸ”¬ Policy Evaluation: Inverse Propensity Weighting (IPW) with bootstrap CIs for counterfactual estimation
πŸ“š RAG Layer: Guideline-grounded explanations (TF-IDF retrieval + template generation β†’ no LLM hallucinations)
βš™οΈ MLOps: FastAPI service with Pydantic validation, model cards, health checks, and unit tests

πŸ“ˆ Key Results

  • 62.1% of patients β†’ Recommend early antibiotics
  • 33.8% β†’ Recommend standard care
  • 4.1% β†’ Defer to clinician (uncertainty zone)

Policy evaluation (IPW): Estimated 3.70 days reduction in mean ICU length of stay vs. observed practice.

πŸŽ“ Why Synthetic Data?

The MIMIC-IV demo dataset has only 117 patients β€” insufficient for Double ML, which requires thousands of observations. I generated a realistic synthetic cohort (N=1500) with:

  • Known ground-truth CATE (for validation)
  • Heterogeneous treatment effects (emergency vs elective patients)
  • Realistic propensity distributions

The pipeline is fully modular and can be directly plugged into real EHR data (MIMIC-IV full, eICU, hospital systems).

πŸ“‚ Check it out

πŸ”— Full interactive notebook + architecture: https://www.kaggle.com/code/ahmadihossein/sepsisdecision-di

Would love feedback from:

  • Clinicians working with decision support systems
  • Causal inference practitioners
  • MLOps engineers building production ML

What’s the biggest challenge you’ve seen in deploying clinical ML? πŸ‘‡

CausalInference #DecisionIntelligence #HealthcareAI #MachineLearning #MLOps #RAG #EconML #DataScience #ResponsibleAI #ClinicalML #PrecisionMedicine

μ›λ¬Έμ—μ„œ 계속 β†—