Machine Learning Is Harnessed To Predict Risk of Opioid Use Disorder

Machine Learning Is Harnessed To Predict Risk of Opioid Use Disorder

Posted: April 13, 2023
Machine Learning Is Harnessed To Predict Risk of Opioid Use Disorder

Story highlights

Machine learning based on past health records was able to prospectively predict opioid use disorder (OUD) about 90% of the time in a large Canadian provincial population. It’s a step toward deploying OUD prediction and risk assessment programs at the population level in real time.


Opioid overdose has become a public health problem of the first magnitude, identified as the cause of death in over 80,000 cases in the U.S. in 2021—about three-fourths of total deaths attributed to drug overdoses, and a fourfold increase over the number of such deaths in 2009.

It has been estimated that at least 10 million Americans used opioids for non-medical purposes in 2018 and that about 2 million were living with opioid use disorder (OUD), a well-established risk-factor for opioid overdose and death. The National Institutes of Health defines OUD as an overpowering desire to use opioids, increased opioid tolerance, and withdrawal syndrome when discontinued.

Once established, OUD is chronic and disabling, associated with a high cost to the healthcare system. In an estimate from the province of Alberta, Canada—the opioid problem is similarly acute in Canada—the average annual cost to the healthcare system was $22,000 per OUD patient in 2018-19, compared with $2,000-$3,000 for the average patient.

“If patients at risk for OUD could be identified in a proper way and receive intervention at the earliest stages of the disease, aversive outcomes might be prevented,” says a team of researchers led by 2016 BBRF Young Investigator Bo Cao, Ph.D., of the University of Alberta. As Dr. Cao and colleagues report in a paper appearing in The Canadian Journal of Psychiatry, about one opioid user in four will develop OUD, including 8% to 12% of those who are prescribed opioids for chronic pain. “Therefore, predicting and preventing OUD in this population is pivotal to harm reduction,” they say.

One major problem, the scientists acknowledge, is that “recognizing problematic opioid use in the clinical setting is difficult, especially given that many patients are unwilling or unable to fully communicate their patterns of prescription and illicit drug use.”

For this reason, Dr. Cao and colleagues developed a machine-learning process using administrative health data (“de-identified” data, with individual identities removed). The object was to develop a way to identify which “cases” in the database (all with 5 years of prior opioid prescription data) may be at especially high risk of developing OUD. They took advantage of a difference in the way healthcare is organized and dispensed in Canada compared with the U.S. Canada has a centralized, universal, and publicly funded health care system. Within that system, data representative of activity in each Canadian province are routinely collected and nationally representative health administrative data are synthesized.

Broadly speaking, researchers have come to understand that healthcare databases can help identify patients at risk, leveraging data on prior health conditions, including substance-use disorders, as well as patterns of healthcare utilization, socioeconomic status, and history of medication use. Yet a centralized, all-inclusive healthcare system such as Canada’s provides a wealth of representative data for researchers that is not readily available in the U.S., where 34% of the population is covered by Medicare, while 9% are uninsured and the remainder are enrolled in a variety of commercial insurance plans.

Dr. Cao and colleagues used machine learning to crunch Canadian data from the province of Alberta. The data included the records of 699,164 individuals age 18 and older who filled an opioid prescription between 2014 and 2019 and who were enrolled in the provincial healthcare system.

Machine learning involves taking a data set like this one and training it to learn relationships between potential predictors and a specific outcome, in this case, opioid use disorder. The “predictors”, 62 in all, included data on individuals’ utilization of the healthcare system; demographics such as age, sex and socioeconomic status; a variety of opioid-specific indicators such as dosage and past history of opioid overdose; records of previous substance use and substance-use disorders; and other physical and mental health indicators.

Predictions made by the computers based on this procedure were then validated against actual outcomes from an additional 174,791 individuals in the same provincial database. The team reported that the computer correctly predicted OUD 88% of the time in that “validation” sample. Next, the computer algorithm was challenged with new data from 316,039 individuals in Alberta who were prescribed opioids in 2019. The algorithm’s “prospective” prediction of OUD in these individuals was later assessed to be correct 93% of the time

The algorithm was able to clearly show that those who filled opioid prescriptions were at greatest risk of developing OUD if they were long-term heavy users of prescription opioids, and/or if they had a history of other substance-use disorders. Although these are known risk factors, integrating them quantitatively to make individualized prospective predictions of OUD is an advancement, Dr. Cao suggests.

The machine-learning experiment demonstrated to the team that “a machine-learning-based model based on retrospective data can provide accurate predictions of individual OUD cases in a prospective sample.” Put another way: machine learning based on past health records may have the potential to provide accurate predictions for individuals’ future risk of being diagnosed with OUD.

Opioid overdoses are relatively infrequent in prescription opioid users and fortunately only a small portion of them are likely to develop OUD. But 67% of those with OUD in the study were long-term opioid users when enrolled in the study, compared with only 19% of those who were not classified as having OUD. This data shows that opioid prescriptions are indeed correlated strongly with risk for OUD.

As they and others continue to refine methods of using computer-based machine learning to predict adverse health outcomes, the team suggests that prospective prediction of OUD risk based on a comprehensive set of historical healthcare and demographic data “is a significant step towards deploying OUD prediction and risk assessment programs at the population level in real time,” and has the potential to become “a new gold standard for applied precision medicine.”