With the rise of social media, there has been a swell in depression leading to increasing numbers in teenage suicide. This has led to scientists looking for more expedient ways of treating cases of depression. In a research, published in February by Nature Biotechnology, scientists are making progress with the help of artificial intelligence. The research discovers that with a simple brain test combined with insights from artificial intelligence, scientists can now predict which antidepressants can work for a given patient.

“Right now, treatment selection is purely based on trial and error,” Dr. Madhukar Trivedi, a professor of psychiatry at the University of Texas Southwestern Medical Center told Time magazine this year.

From the research, carried out on data from a previous study in which more than 200 people with depression had an electroencephalogram (EEG)—a non-invasive test that records a person’s brain waves through electrodes placed on their scalp, Trivedi and a team of researchers gave the patience either sertraline (a widely prescribed antidepressant marketed as Zoloft) or a placebo for a period of eight weeks. By so doing, it made it easier to discover whether or not patience who responded well to sertraline shared a common bran-wave which is vital to knowing if they will respond to the drug.

The researchers built a machine learning algorithm that can analyze the EEG data. They deduced from the study that  65% of the participants with a particular brainwave signature also showed a strong response to sertraline.

Dr. Amit Etkin, one of the paper’s authors and a professor of psychiatry and behavioral sciences at Stanford University, said that this is “far better” than using clinical factors, like whether patients have certain kinds of symptoms, to try to guess whether they will respond well to a drug. The researchers also applied their AI algorithm on a separate study in which people had EEG testing before undergoing transcranial magnetic stimulation (TMS), a brain-stimulation technique to treat depression. They deduced that people who did not respond well to sertraline, based on their brain waves, tended to have positive responses to TMS.

Computer analysis of EEG data is very speedily getting mainstream. Very recently, researchers used algorithms to mine EEG data on infants and were able to predict autism diagnoses in children just a few months old.

With the increase in need for a more personalized approach to treating depression and the advancements that AI brings, Trivedi hopes that people will be more inclined to seek treatment and stick with it. “It gives patients a lot more confidence in the treatments that they are being provided,” he says. “That improves their ability to stay with that treatment until they get better. We are not shooting in the dark.”