Washing hands needlessly dozens of times of day. Spending so much time perfecting schoolwork that it never gets turned in.

These are typical behaviors for people with obsessive compulsive disorder, or OCD, a lifelong illness marked by repetitive thoughts and actions that can seriously impair work performance, relationships and quality of life. OCD is most commonly treated with medication and a form of psychotherapy called cognitive behavioral therapy. Unfortunately, cognitive behavioral therapy does not help everyone with OCD, and the treatment can be expensive and time-consuming.

Now, UCLA researchers have developed a way to use brain scans and machine learning — a form of artificial intelligence — to predict whether people with OCD will benefit from cognitive behavior therapy. The technique could help improve the overall success rate of cognitive behavioral therapy, and it could enable therapists to tailor treatment to each patient.

A paper describing the work appears in the Feb. 12 Proceedings of the National Academy of Sciences.

“If the results of this study are replicated in future studies, the methods we used could potentially give clinicians a new predictive tool,” said Nicco Reggente, a UCLA doctoral student and the study’s first author. “If a patient is predicted to be a non-responder to cognitive behavioral therapy, clinicians could pursue different options.”

Using a functional MRI machine, or fMRI, the researchers scanned the brains of 42 people with OCD, ages 18 to 60, before and after four weeks of intensive, daily cognitive behavioral therapy. Researchers specifically analyzed how different areas of the brain activate in sync with each other — a property called functional connectivity — during a period of rest. Functional MRI does this by measuring blood flow in the brain, which correlates with neurons’ activity levels.

In addition, the scientists assessed the severity of participants’ OCD symptoms before and after the treatment, using a scaled system in which a lower score indicates less severe or less frequent symptoms. The researchers fed the participants’ fMRI data and symptom scores into a computer and then used machine learning to determine which people would respond. In machine learning, computers are trained to recognize common patterns in mountains of data by exposing them to numerous variations of the same thing.

The machine-learning program predicted which patients would fail to respond to cognitive behavioral therapy with 70 percent accuracy, significantly better than chance, or 50 percent. The algorithm also correctly predicted the participants’ final scores on the symptoms assessment within a small margin of error, regardless of how they responded to the treatment.

“This method opens a window into OCD patients’ brains to help us see how responsive they will be to treatment,” said Dr. Jamie Feusner, a clinical neuroscientist at the Semel Institute for Neuroscience and Human Behavior and the study’s senior author. “The algorithm performed far better than our own predictions based on their symptoms and other clinical information.”

Feusner, who also is a professor of psychiatry at the David Geffen School of Medicine at UCLA, said if the study’s results are replicated, OCD treatment could someday start with a brain scan. The cost to perform and interpret a brief MRI is several hundred dollars, he said. But that expense could help people who are unlikely to be helped by intensive cognitive behavioral therapy to avoid the cost of that treatment, which can be $2,500 to $5,000 per week, and typically runs for four to eight weeks.

In addition to Feusner and Reggente, the study’s authors are Teena Moody, Francesca Morfini, Courtney Sheen, Jesse Rissman and Joseph O’Neil, all of UCLA.

The study was supported by a grant from the National Institute of Mental Health.

Learn more about the neuroscience research theme at UCLA.