Aug 18, 2025DemoResearch

Predicting Treatment Success in Opioid Use Disorder with AI: An Interactive Demo

Fateme Nateghi, Vishnu Ravi, Jonathan H Chen
Predicting Treatment Success in Opioid Use Disorder with AI: An Interactive Demo

The opioid crisis continues to devastate communities across the United States. While effective treatments like buprenorphine-naloxone exist, a staggering reality persists: 60% of patients discontinue treatment within just 6 months.

When patients stop medication-assisted treatment, they face significantly higher risks of overdose and death. But what if we could predict which patients are most likely to discontinue treatment and intervene early?

We built an interactive demo to show how machine learning can predict which patients might discontinue opioid use disorder treatment. 

Demo: Opioid treatment retention predictor

Link to interactive demo: https://bupnal-attrition-predictor-elfr.onrender.com/

Select patient details on the left — like age, diagnosis, or medications — and click Generate Prediction. The chart will show how likely they are to stay in treatment and compare them with higher- and lower-risk patients. Use these insights to explore how individual factors influence the likelihood of continuing medication-assisted treatment.

How it works 

The model uses real-world health record data to estimate treatment retention over time. It shows three curves:

  1. Your patient’s prediction – based on the details you select.
  2. High-risk group – patients more likely to drop out early.
  3. Low-risk group – patients more likely to stay in care.

Building Models that Can Match Clinical Expertise

Our study published in Addiction demonstrated that machine learning models can predict treatment retention with remarkable accuracy, matching the performance of expert addiction medicine physicians. Researchers from Stanford University and Holmusk Technologies analyzed nearly 10,000 treatment encounters across diverse healthcare settings to develop predictive models using electronic health record data.

We found that machine learning models achieved ROC-AUC scores up to 75.8%, demonstrating strong predictive capability comparable to clinical experts. Even more impressively, when tested across different healthcare systems, the models maintained their predictive power, suggesting broad applicability.

What makes our approach different?

Unlike previous approaches that relied on limited datasets or single healthcare systems, this research was:

  • Validated across multiple sites
    • Models trained on one healthcare system successfully predicted outcomes in completely different systems
  • Used readily available data
    • The models work with standard electronic health record information that most healthcare providers already collect
  • Matched expert performance
    • Addiction medicine specialists achieved 67.8% accuracy, while the machine learning models performed comparably using fully automated methods

What we learned about treatment patterns

Our research revealed several important patterns. Patients with formally coded opioid dependence diagnoses were more likely to continue treatment, while factors associated with hospital-based treatment initiation (such as IV fluid administration) were linked to higher dropout risk.

Interestingly, patients prescribed extended-release oxycodone showed better retention rates, likely indicating those transitioning from prescription opioid dependence rather than illicit drug use have different retention patterns.

The bigger picture

Developing this predictive capability opens possibilities for early intervention that weren’t feasible before. Instead of waiting to see which patients stop showing up for appointments, healthcare teams could identify at-risk patients from their first visit and provide additional support. Clinicians can focus their limited time and resources on patients most likely to benefit from intensive retention efforts.

Study Authors: Fateme Nateghi Haredasht, Sajjad Fouladvand, Steven Tate, Min Min Chan, Joannas Jie Lin Yeow, Kira Griffiths, Ivan Lopez, Jeremiah W. Bertz, Adam S. Miner, Tina Hernandez-Boussard, Chwen-Yuen Angie Chen, Huiqiong Deng, Keith Humphreys, Anna Lembke, L. Alexander Vance, Jonathan H. Chen

Acknowledgements: The research described here is joint work across many teams at Stanford HealthRex Lab and Stanford Hospital Medicine. Vishnu Ravi and Fateme Nateghi developed the interactive demo prototype. The project was supported by Grant Number UG1DA015815 from the National Institute on Drug Abuse (NIDA). Its contents are solely the responsibility of the authors and do not necessarily represent the official views of the National Institute on Drug Abuse (NIDA) or NIH.