MIDS Capstone Project Summer 2023

Bridges: Diagnosing Postpartum Depression

Problem & Motivation

Pregnancy can be an exciting time in a woman’s life, but it can also bring challenges. Many women experience the baby blues after giving birth, and some women develop symptoms of depression that are more intense, long lasting, and can interfere with daily activities. Mothers with depression feel sad, hopeless, guilty and have little interest in doing things they once enjoyed. This also puts the newborn at risk because the mother is the primary caregiver for a new born baby.

  • Depression is not discussed openly in our society so a new mother is hesitant to bring it to others attention. Even if she dares to discuss it with her family or friends, it is often dismissed as a temporary phase that they will soon overcome on their own. 
  • According to the CDC, nearly 10-15% of new mothers experience Postpartum Depression (PPD). In a recent study published, according to  JAMA Psychiatry, researchers observed that, during the time period extending from one year before to one year after childbirth, the prevalence of suicidality (defined as suicidal ideation or intentional self-harm) has increased from 0.2% in 2006 to 0.6% in 2017 (difference, 0.4%; P < .001). 

Currently there is no easy, quick and scientific way to diagnose PPD. The problem is growing exponentially but very few qualified medical professionals are available to examine, diagnose and treat them.

Solution: Bridges — A two part solution using ML and Data Science

The solution from Team Velvaere is called Bridges, because it bridges the gap between Postpartum Depression patients and the doctors.

Bridges is a two part web-based solution to diagnose Depression. It uses Classification and regression models to quickly identify if a new mother is suffering from depression.

Part 1 is Gradient Boosted Tree based ensemble model 

  • It is a survey based model.
  • It is to help a new mother who might want to confirm if they were suffering from PPD. 
  • With the result, they can take next appropriate step, such as contacting their Primary Healthcare Provider
  • This survey can also be administered by the Primary Healthcare Provider to all new mothers for PPD screening.

Part 2 is Deep Learning Computer Vision Image Model using CNN 

  • It uses brain fMRI to diagnose PPD
  • It is meant for Healthcare providers and hospitals who can upload a brain fMRI
  • Entire fMRI can be scanned and predicted within 30 seconds
  • Doctors can cure more PPD patients in a shorter time.


We focused on making sure the classes were balanced as much as possible. In order to evaluate our models we used Accuracy, F1-score, Precision, Recall, Macro and weighted Average. Paying extra attention to Learning Loss for the part2-image model helped us achieve our goal of above 90% accuracy.


Prediction done on some of the images from a depressive subject
Prediction done on some of the fMRI images from a depressive subject

Data Source

Part 1: National Health and Nutrition Examination Survey (NHANES) 2017-2020 (13 different surveys) conducted annually by the CDC.

Part 2: Brain fMRI for Control and Depress class by Brainlife  and additional brain fMRI for control class collected by National Institute of Mental Health OpenNeuro.  147,400+ images in training set


  • Techniques for handling class imbalances can drastically improve model performance
  • Optimizing for validation loss is important, in addition to other metrics like F1-score, recall, precision, and accuracy
  • Domain knowledge and analyzing feature themes is important for feature selection
  • Error analysis can help uncover patterns in data to focus your modeling efforts


We are very grateful to our Capstone professors Puya Vahabi and Alberto Todeschini for their guidance and feedback. Without their support we would not have been able to achieve success in our endeavor. We would also like to thank Dr. Karen Wong of CDC, Dr. N Dave (Radiology expert) and Dr. S. Dixit (Psychology Professor CSU, SJSU) for their subject matter guidance.

A very special thanks to Prof. Jared Francis Maslin and our partners in 231 Claudia Durkin and Tatianna Martinez for keeping ethics and human interest front and center while building this solution.

We are also grateful to our classmates of 2023-0508 DATASCI 210 Capstone-section 4  for always asking meaningful questions and their encouragement.

Velvaere - Bridging the gap between Postpartum Depression Patients and Doctors
Velvaere - Bridging the gap between Postpartum Depression Patients and Doctors


BRIDGES: Predicting Postpartum Depression Using Machine Learning

BRIDGES: Predicting Postpartum Depression Using Machine Learning

If you require video captions for accessibility and this video does not have captions, click here to request video captioning.

Last updated:

August 8, 2023