Scientists have developed a new artificial intelligence tool that can predict whether an adult has attention-deficit hyperactivity disorder by looking at their past medical records. The predictive model suggests that subtle patterns in everyday healthcare visits can identify undiagnosed individuals months before a doctor formally spots the condition. This research was recently published in the journal European Psychiatry.
Attention-deficit hyperactivity disorder is a common neurodevelopmental condition that affects roughly 5 to 7.2 percent of children and about 2.5 percent of adults globally. People with this condition experience varying degrees of inattention, hyperactivity, and impulsivity that interfere with daily life. Getting a proper diagnosis as an adult tends to be quite difficult.
Doctors often struggle to identify the condition in older patients because the symptoms frequently overlap with other mental health challenges. When a diagnosis is delayed, individuals often experience academic or work impairments, increased accident rates, and a lower overall quality of life. An earlier diagnosis provides evidence-based opportunities for pharmacological treatment and therapy, which helps prevent many of these negative outcomes.
Artificial intelligence has recently shown promise in helping doctors spot hidden patterns in patient data. Many previous attempts to use machine learning to detect attention-deficit hyperactivity disorder have mostly relied on brain scans, structured behavioral assessments, or specialized physiological tests. These types of medical data are expensive and not routinely collected for the average patient.
To create a more practical tool, the researchers decided to focus on electronic health records. These records are the standard digital files that clinics and hospitals already maintain for every patient. By training a computer program to read standard medical histories, the authors hoped to create a cost-effective screening method that relies purely on information doctors already have on hand.
The scientists analyzed historical medical data from a regional healthcare system in southwestern Sweden. The database included information from primary care clinics, specialist visits, and hospital admissions between 2011 and 2022. They gathered detailed data on patient demographics, specific medical diagnoses, clinical procedures, and prescribed medications.
To build their model, the researchers started with a group of 3,570 adults who had been formally diagnosed with attention-deficit hyperactivity disorder or prescribed related medications. They also selected a control group of adults who had visited psychiatric outpatient clinics but did not have the disorder. During the design phase, the predictive model struggled to tell the two groups apart when the control group included patients with depression or anxiety.
To fix this issue, the researchers removed individuals with depression and anxiety from the control group. Because the cognitive and behavioral symptoms of depression and anxiety overlap heavily with attention issues, removing them allowed the computer to focus on the unique signatures of attention-deficit hyperactivity disorder. This adjustment left a final control group of 5,126 adults, which still provided plenty of data for the program.
The authors then fed this data into a machine learning system based on a “transformer” architecture. A transformer is a sophisticated type of artificial intelligence technology that excels at understanding sequences of information. Instead of reading words in a sentence, this specific transformer was trained to read the sequence of a patient’s medical visits and prescription codes over time.
These models use a mathematical technique called positional encoding to understand the exact chronological order of events. This allows the system to grasp how a patient’s health trajectory changes over the course of several months or years. The researchers tested whether the model could predict a diagnosis six, twelve, and eighteen months before the actual diagnosis date.
They evaluated the final model on an entirely separate set of 800 patients, splitting this test group evenly with 400 diagnosed individuals and 400 individuals without the condition. Testing the model on a separate group ensures that the artificial intelligence is evaluated on fresh information it has never seen before. The findings suggest that the model can successfully predict adult attention-deficit hyperactivity disorder using routine clinical data.
The artificial intelligence performed best when predicting a diagnosis six months in advance. At this six-month mark, the model correctly identified 80 percent of the patients who actually had the disorder. It also correctly ruled out the condition in 77 percent of the patients who did not have it.
The model achieved a score of 0.79 on a mathematical metric called the Area Under the Curve. This metric evaluates how well a predictive model distinguishes between two groups, with a score of 1.0 being perfect and 0.5 being no better than a random guess. The results remained fairly stable even when predicting diagnoses eighteen months into the past.
The scientists also examined which specific medical codes the computer used to make its predictions. To do this, they used an analytical technique called Shapley Additive Explanations. This method helps open the “black box” of artificial intelligence by showing exactly which demographic factors or clinical codes increase or reduce the predicted risk.
The analysis revealed that previous diagnoses related to substance use were strong indicators of a future attention-deficit hyperactivity disorder diagnosis. For example, medical codes indicating the use of stimulants, including heavy caffeine use, were highly predictive. The model also flagged codes related to specific blood alcohol levels ranging from 0.60 to 0.79 milligrams per 100 milliliters.
These findings align with previous research, which indicates that adults with undiagnosed attention-related issues sometimes try to self-medicate with caffeine, alcohol, or other substances. The computer program also picked up on medical codes related to childbirth complications. The data suggests that mothers who experience issues such as obstructed labor or abnormal fetal positions have a slightly higher chance of a later attention-deficit hyperactivity disorder diagnosis.
Researchers suspect this reflects broader physical and psychosocial challenges rather than a direct physical cause. Additionally, the scientists noticed distinct demographic and healthcare utilization patterns between the two groups. The diagnosed individuals tended to be younger, averaging around 31 years old compared to 52 years old in the control group.
They also had significantly more primary care and psychiatrist visits than the control group, but fewer hospital admissions and shorter hospital stays. While these findings are promising, the authors caution against viewing this artificial intelligence as a replacement for human doctors. The tool is not designed to formally diagnose anyone on its own.
Instead, it is meant to act as an early warning system that operates quietly in the background of a hospital’s computer network. By flagging patients who exhibit suspicious patterns of healthcare use, the system can simply notify doctors that a specific person might benefit from a comprehensive psychological evaluation. A trained healthcare professional must still sit down with the patient to conduct structured interviews and confirm the diagnosis.
One limitation of the study is the exclusion of patients with depression and anxiety from the control group. In a real clinical setting, doctors frequently need to distinguish between attention-deficit hyperactivity disorder and depression. Because the model was not trained on patients with these specific overlapping conditions, it might face challenges when deployed in a general psychiatric population.
The researchers also noted a slight discrepancy in how the model treated men and women. The artificial intelligence successfully identified the condition in 75.2 percent of the female patients, but only caught 66.7 percent of the male cases. The false positive rate remained consistent across genders, but the disparity in successful identification highlights the need for further evaluation to ensure equitable performance.
Moving forward, scientists hope to test this model in different healthcare systems outside of Sweden. Medical coding practices can vary significantly from one country to another, so the algorithm must prove its adaptability. The authors also suggest exploring how this data-driven approach might align with newer, more flexible ways of classifying mental health conditions in the future.
The study, “Early detection of adults ADHD using electronic health records: A machine learning study“, was authored by Omar Hamed, Farzaneh Etminani, Peter Jacobsson, and Thomas Davidsson.
Leave a comment
You must be logged in to post a comment.