<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: hossein ahmadi</title>
    <description>The latest articles on DEV Community by hossein ahmadi (@hossein_ahmadi).</description>
    <link>https://dev.to/hossein_ahmadi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4090222%2Fe15228f5-d1de-449d-a4fb-2ebc07d42dd3.png</url>
      <title>DEV Community: hossein ahmadi</title>
      <link>https://dev.to/hossein_ahmadi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hossein_ahmadi"/>
    <language>en</language>
    <item>
      <title>Why Your ML Model Should Sometimes Say 'I Don't Know': Building Uncertainty-Aware Clinical AI</title>
      <dc:creator>hossein ahmadi</dc:creator>
      <pubDate>Sat, 22 Aug 2026 22:29:30 +0000</pubDate>
      <link>https://dev.to/hossein_ahmadi/why-your-ml-model-should-sometimes-say-i-dont-know-building-uncertainty-aware-clinical-ai-36g8</link>
      <guid>https://dev.to/hossein_ahmadi/why-your-ml-model-should-sometimes-say-i-dont-know-building-uncertainty-aware-clinical-ai-36g8</guid>
      <description>&lt;p&gt;🚨 Predictive models tell us &lt;em&gt;what&lt;/em&gt; will happen.&lt;br&gt;
🧠 Causal models tell us &lt;em&gt;what happens IF we intervene&lt;/em&gt;.&lt;br&gt;
❓ But neither tells us &lt;em&gt;what we should DO&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;In healthcare, this gap is dangerous.&lt;/p&gt;




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

&lt;p&gt;🏥 &lt;strong&gt;The Clinical Question:&lt;/strong&gt;&lt;br&gt;
Should we administer early antibiotics to this ICU patient to reduce length of stay?&lt;/p&gt;

&lt;p&gt;Traditional ML answers: "Predicted ICU stay: 8.5 days"&lt;br&gt;
❌ This doesn't help clinicians make decisions.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 The Core Innovation: A Three-Class Decision Policy
&lt;/h2&gt;

&lt;p&gt;Instead of forcing binary &lt;code&gt;treat / don't treat&lt;/code&gt; decisions (which can be dangerous when uncertainty is high), the system outputs &lt;strong&gt;three&lt;/strong&gt; actions:&lt;/p&gt;

&lt;p&gt;✅ &lt;strong&gt;TREAT&lt;/strong&gt; — High-confidence benefit (even worst-case CI is beneficial)&lt;br&gt;
🛑 &lt;strong&gt;STANDARD CARE&lt;/strong&gt; — High-confidence no benefit/harm (even best-case is harmful)&lt;br&gt;
🩺 &lt;strong&gt;DEFER TO CLINICIAN&lt;/strong&gt; — Uncertainty zone (safest choice)&lt;/p&gt;

&lt;p&gt;This is not a limitation — it's a feature. A trustworthy clinical AI &lt;strong&gt;knows when it doesn't know&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Technical Stack
&lt;/h2&gt;

&lt;p&gt;🧠 &lt;strong&gt;Causal Inference:&lt;/strong&gt; LinearDML (EconML) with cross-fitting for valid CATE + confidence intervals&lt;br&gt;
📊 &lt;strong&gt;Propensity Diagnostics:&lt;/strong&gt; Positivity/overlap checks before estimation&lt;br&gt;
⚖️ &lt;strong&gt;Decision Policy:&lt;/strong&gt; Cost-sensitive, utility-based, uncertainty-aware&lt;br&gt;
🔬 &lt;strong&gt;Policy Evaluation:&lt;/strong&gt; Inverse Propensity Weighting (IPW) with bootstrap CIs for counterfactual estimation&lt;br&gt;
📚 &lt;strong&gt;RAG Layer:&lt;/strong&gt; Guideline-grounded explanations (TF-IDF retrieval + template generation → no LLM hallucinations)&lt;br&gt;
⚙️ &lt;strong&gt;MLOps:&lt;/strong&gt; FastAPI service with Pydantic validation, model cards, health checks, and unit tests&lt;/p&gt;




&lt;h2&gt;
  
  
  📈 Key Results
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;62.1%&lt;/strong&gt; of patients → Recommend early antibiotics&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;33.8%&lt;/strong&gt; → Recommend standard care
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;4.1%&lt;/strong&gt; → Defer to clinician (uncertainty zone)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Policy evaluation (IPW):&lt;/strong&gt; Estimated &lt;strong&gt;3.70 days reduction&lt;/strong&gt; in mean ICU length of stay vs. observed practice.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎓 Why Synthetic Data?
&lt;/h2&gt;

&lt;p&gt;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:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Known ground-truth CATE (for validation)&lt;/li&gt;
&lt;li&gt;Heterogeneous treatment effects (emergency vs elective patients)&lt;/li&gt;
&lt;li&gt;Realistic propensity distributions&lt;/li&gt;
&lt;/ul&gt;

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




&lt;h2&gt;
  
  
  📂 Check it out
&lt;/h2&gt;

&lt;p&gt;🔗 Full interactive notebook + architecture: &lt;a href="https://www.kaggle.com/code/ahmadihossein/sepsisdecision-di" rel="noopener noreferrer"&gt;https://www.kaggle.com/code/ahmadihossein/sepsisdecision-di&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Would love feedback from:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clinicians working with decision support systems&lt;/li&gt;
&lt;li&gt;Causal inference practitioners&lt;/li&gt;
&lt;li&gt;MLOps engineers building production ML&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What's the biggest challenge you've seen in deploying clinical ML? 👇&lt;/p&gt;

&lt;h1&gt;
  
  
  CausalInference #DecisionIntelligence #HealthcareAI #MachineLearning #MLOps #RAG #EconML #DataScience #ResponsibleAI #ClinicalML #PrecisionMedicine
&lt;/h1&gt;

</description>
      <category>ai</category>
      <category>datascience</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
