Machine Learning Prediction of SSRI Response Using fMRI Connectivity

CWSF · 2026 Disease & Illness Bronze Medal

Thumbnail supplied by the source for Machine Learning Prediction of SSRI Response Using fMRI Connectivity

Overview

When someone is depressed, doctors prescribe antidepressant medication, but it only works for about half of patients, meaning the other half can wait months on ineffective treatment. We developed a machine learning model that predicts whether a medication will be effective by analyzing brain connectivity patterns before treatment begins. Using a synthesized dataset of 138 virtual patients designed to reflect real clinical data, our model achieved 88% accuracy in predicting treatment success, compared to 54% accuracy using traditional clinical information such as age and symptom severity. We also built a web tool where this prediction model can be tested in real time. If validated on real patient data, this approach could help millions of people with depression get the right treatment faster, reducing unnecessary suffering and healthcare costs.

Video

Video

A 1-minute introduction to our research on predicting antidepressant response using brain imaging and machine learning.

Why?

Our project grew from a shared passion for biology and computer science, but it's also deeply personal. A close friend of Andy's lives with depression, and watching them navigate treatment made us want to do something meaningful. Currently, finding the right antidepressant is largely a matter of trial and error, and we wanted to help change that.

Major Depressive Disorder affects approximately 280 million people worldwide. SSRIs are the standard first-line treatment, yet they work for only about half of patients on the first attempt. That means millions of people wait eight weeks or more just to find out whether a medication is even helping, all while facing elevated suicide risk and an inability to live their normal lives.

We utilized machine learning to analyze fMRI brain scans and predict which patients would respond to specific medications before treatment commenced. Our model achieved 79–88% accuracy, a significant improvement over the roughly 54% accuracy of clinical data alone. We also built a web-based tool to demonstrate how this approach could be integrated into a real clinical workflow.

Getting patients the right treatment sooner isn't just a technical milestone; it means less suffering and meaningfully lower suicide rates.

How?

We began by reviewing peer-reviewed studies on depression, brain imaging, and machine learning to identify previous approaches and remaining gaps, focusing on established datasets like EMBARC to build a strong foundation.

Without access to real patient scans, we created a synthesized dataset of 138 virtual patients (67 responders, 71 non-responders) whose statistical properties were carefully matched to real clinical data from the EMBARC study. These are not real patients; the data were computationally generated to reflect known patterns in the literature, allowing us to build and test our pipeline without relying on private medical records.

We used resting-state fMRI, which measures communication between brain regions while a person is at rest. Each brain was divided into 400 regions, yielding nearly 80,000 measurements of connection strength per patient.

To isolate the most predictive signals, we applied a two-step filtering approach: narrowing down 80,000 connections to 1,000, then using LASSO to select the 30 that best predicted treatment response.

We trained six machine learning models, validating each with cross-validation and 1,000 random shuffle tests to confirm results weren't due to chance. Finally, we built a web-based tool in Python and Flask to demonstrate how the model could function in a clinical setting.

What?

Our central question was whether machine learning could predict which depression patients would respond to SSRIs before treatment began; the short answer is yes.

We trained and compared six models, from a simple clinical baseline (using only age, sex, and symptom severity) to advanced approaches analyzing brain connectivity patterns. The contrast in performance was striking. The clinical baseline, reflecting current medical decision-making, achieved just 53.7% accuracy, barely above chance. Our top brain-based model, CPM (Connectome-Based Predictive Modeling), reached 87.7% accuracy. The LASSO model, which we also deployed as a web tool, achieved 78.6% accuracy. Every brain-based model outperformed the clinical baseline by a wide margin.

To ensure these results weren’t due to chance, we ran 1,000 shuffle tests, randomly scrambling patient labels and re-running the analysis each time. Our true model consistently outperformed all shuffled versions, confirming the results were robust (p < 0.001).

A key insight emerged from feature selection: out of nearly 80,000 possible brain connections, our LASSO model identified just 30 carrying most of the predictive power. This suggests the SSRI response isn’t randomly distributed across the brain, but concentrated in a small set of neural connections. In future clinical practice, doctors might only need to target these key connections, rather than analyze the entire brain.

We built and deployed a web tool that takes a patient’s age, sex, and depression severity score, and returns a predicted probability of SSRI response with a confidence level. While this tool is a proof of concept trained on synthetic data and not for clinical use, it demonstrates how such models can be made accessible and practical.

It's important to clarify what these results do and do not mean. Because we used synthetic data, our models were recovering patterns we intentionally embedded, not discovering them in real patients. Real-world performance would likely be lower, probably in the 65% to 75% range, based on similar published studies. The true value of this work is demonstrating that the pipeline functions and is ready to be tested on real data.

Still, a jump from 54% to 88% accuracy, even on synthetic data, shows that brain connectivity offers a meaningful signal absent from clinical information alone. If this signal holds up in real patients, it could eventually help millions receive the right treatment months sooner.

So What?

Our results demonstrate that treating depression no longer has to begin with guesswork. Today, finding the right treatment involves an uncertain waiting period of at least eight weeks, during which patients continue to struggle with debilitating symptoms and a significantly elevated risk of suicide.

Our model achieved a 34% improvement in accuracy over current clinical approaches. One of the most important findings was that predictive power doesn't require analyzing the entire brain. We identified a subset of just 30 specific neural connections that carry most of the information needed to forecast treatment response, suggesting that the brain holds structured, readable signals that current clinical methods are missing entirely.

This means doctors could eventually use these patterns to match patients with the right treatment from the start, rather than waiting months to find out if something works. To make this tangible, we built a web-based tool demonstrating how the approach could function in a real clinical setting. The goal is straightforward: fewer months of unnecessary suffering and more patients reaching recovery quickly.

What's Next?

Since our pipeline was developed using synthetic data, our top priority is to validate the model on real patient scans from established datasets such as EMBARC or iSPOT-D. We also aim to expand beyond SSRIs by creating a system that recommends the most effective treatment type for each patient, not just the best drug within a single class.

Integrating genetic or structural brain data could further improve the model’s accuracy. Ultimately, our goal is to conduct clinical trials to rigorously test whether brain-based treatment recommendations yield better outcomes than the standard trial-and-error approach.

Thanks

This project was largely self-directed, from the research to the modeling, without formal guidance from mentors or a lab. We would like to thank our school's BASEF club for opening this door and making the opportunity possible.

References

Research Sources:

Crane, N. A., Jenkins, L. M., Bhaumik, R., et al. (2017). Multidimensional prediction of treatment response to antidepressants with cognitive control and functional MRI. Journal of Affective Disorders, 216, 143-150.

Drysdale, A. T., Grosenick, L., Downar, J., et al. (2017). Resting-state connectivity biomarkers define neurophysiological subtypes of depression. Nature Medicine, 23(1), 28-38.

Ju, Y., Horien, C., Chen, W., et al. (2020). Connectome-based models can predict early symptom improvement in major depressive disorder. Journal of Affective Disorders, 273, 442-452.

Ktena, S. I., Parisot, S., Ferrante, E., et al. (2017). Distance metric learning using graph convolutional networks: Application to functional brain networks. MICCAI 2017, 469-477.

Poldrack, R. A., Huckins, G., & Varoquaux, G. (2020). Establishment of best practices for evidence for prediction: A review. JAMA Psychiatry, 77(5), 534-540.

Power, J. D., Schlaggar, B. L., & Petersen, S. E. (2015). Recent progress and outstanding issues in motion correction in resting state fMRI. NeuroImage, 105, 536-551.

Shen, X., Finn, E. S., Scheinost, D., et al. (2017). Using connectome-based predictive modeling to predict individual behavior from brain connectivity. Nature Protocols, 12(3), 506-518.

Trivedi, M. H., McGrath, P. J., Fava, M., et al. (2016). Establishing moderators and biosignatures of antidepressant response in clinical care (EMBARC): Rationale and design. Journal of Psychiatric Research, 78, 11-23.

Williams, L. M., Debattista, C., Duchemin, A. M., et al. (2021). Childhood trauma predicts antidepressant response in adults with major depression: Data from the randomized international study to predict optimized treatment for depression. Translational Psychiatry, 11, 374.

Williams, L. M., Patel, P., Goldstein-Piekarski, A., et al. (2015). Amygdala reactivity to emotional faces predicts improvement in major depression. Biological Psychiatry, 78(7), 503-511.

World Health Organization. (2023). Depressive Disorder (Depression)

Media Sources:

Wikipedia contributors. (2016). Temporal non-local means filtering reveals real-time whole-brain cortical interactions in resting state fMRI [Illustration]. Wikimedia Commons. https://commons.wikimedia.org/wiki/File:Temporal-Non-Local-Means-Filtering-Reveals-Real-Time-Whole-Brain-Cortical-Interactions-in-Resting-pone.0158504.s002.ogv

Anthropic. (2026). Two-step feature selection flowchart for fMRI connectivity analysis [AI-generated diagram]. Claude (claude-sonnet-4-6). https://claude.ai

Anthropic. (2026). Accuracy comparison: 54% clinical baseline vs 88% brain connectivity model [AI-generated diagram]. Claude (claude-sonnet-4-6). https://claude.ai

OpenAI. (2026). Schaefer 400-parcel brain atlas showing 7 functional networks [AI-generated image]. ChatGPT. https://chat.openai.com

OpenAI. (2026). Brain connectivity visualization showing functional network connections [AI-generated image]. ChatGPT. https://chat.openai.com

All graphs were created based on our modeling data using Matplotlib and Seaborn, with Pandas used for some bar plots.

Images (17)

Awards (2)

  • Bronze Medal
  • Selected for CWSF 2026

Competition history

  • CWSF 2026 Disease & Illness Qualified through Bay Area, ON

Related projects

Closest projects by meaning, across every fair and year in the corpus.

Browse more like this

Source: ProjectBoard / Youth Science Canada

Save projects to your library

Sign in with Google to keep track of projects you find interesting, organized into folders. An account also raises your daily allowance for “Has this been done?”, and lets you create a key for the MCP server with a much higher limit than anonymous use. Browsing stays public.

Continue with Google