Quantifying Mental Health from Social Media with Neural User Embeddings

Silvio Amir, Glen Coppersmith, Paula Carvalho, Mário J. Silva, Byron C. Wallace

TL;DR

This paper introduces a method to quantify mental health status by learning "neural user embeddings"—dense vector representations of social media users based on their posting history. By combining these unsupervised embeddings with a task-specific adaptation layer (NLSE), the researchers successfully identified users with depression and PTSD, outperforming traditional text-based models.

What Problem Does This Paper Address?

Traditional methods for tracking the prevalence of mental health conditions rely on clinical surveys, which are expensive, time-consuming, and often result in data that is years out of date. Social media offers a massive, real-time alternative, but extracting reliable clinical signals from noisy tweets is difficult.

Most prior work focused on analyzing individual posts. However, mental health is a long-term state, not a single moment. This paper shifts the focus to user-centric modeling. The authors tackle the challenge of how to represent an entire user’s history in a way that captures latent psychological signals—like "homophily," the tendency for individuals with similar conditions to exhibit similar linguistic patterns—without requiring massive amounts of labeled clinical data.

Methods

The authors propose a two-step pipeline:

  1. User2Vec (Representation Learning): Building on the logic of Word2Vec and Paragraph2Vec, the authors develop User2Vec. This model learns a unique vector (embedding) for every user by training the model to predict the words a user is likely to use. Unlike standard models that learn word and document vectors simultaneously, User2Vec leverages pre-trained word embeddings to focus specifically on capturing the "latent characteristics" of the user.
  2. NLSE (Task Adaptation): Generic embeddings are often "sub-optimal" for specific medical tasks. To fix this, the authors use Non-Linear Subspace Embedding (NLSE). This model learns a linear projection that maps the high-dimensional user embeddings into a lower-dimensional "subspace" optimized for detecting mental illness. This approach is particularly effective for small datasets because it reduces the number of parameters the model needs to learn, preventing overfitting.

Datasets

The study utilizes the CLPsych 2015 Shared Task dataset, which consists of Twitter users who publicly stated a diagnosis of:

  • Depression: 327 users.
  • PTSD: 246 users.
  • Controls: An equal number of demographically matched users (age and gender) with no such diagnosis.

The history for each user included up to 3,000 of their most recent tweets.

Key Insights and Ideas

  • Linguistic Homophily exists in Mental Health: Even without being told who was depressed, the unsupervised embeddings naturally clustered similar users together. As shown in Figure 1, users from the same cohort (e.g., PTSD) tend to be "surrounded" by others in the same cohort in the vector space. t-SNE projection showing unsupervised clustering (left) and improved clustering after NLSE adaptation (right).

  • The "User" is more than the sum of their tweets: By modeling the user as a single vector derived from their entire history, the system captures subtle stylistic and thematic regularities that a simple "Bag-of-Words" (BOW) model might miss.

  • Subspace Projection is the "Secret Sauce": The authors found that while generic embeddings are useful, projecting them into a task-specific subspace (NLSE) significantly improved the model's ability to discriminate between mental health conditions and controls.
t-SNE projection showing unsupervised clustering (left) and improved clustering after NLSE adaptation (right).

Key Results

The researchers evaluated their models using the Macro F1 score (a balance of precision and recall).

  • State-of-the-Art Performance: The NLSE model using User2Vec embeddings achieved the highest performance (0.717 F1), outperforming strong baselines like Bag-of-Words (0.686) and LDA topic models (0.483). Comparison of F1 and binary F1 scores across different models.

  • Visualizing Activations: By looking at the feature activations in the subspace (Figure 6), the authors demonstrated that specific groups of "neural features" are consistently activated for specific conditions, providing a path toward more interpretable AI in digital phenotyping. Heatmap showing feature activations across different classes (Control, Depression, PTSD).

Comparison of F1 and binary F1 scores across different models.
Heatmap showing feature activations across different classes (Control, Depression, PTSD).

Limitations and Future Work

  • Dataset Size: The CLPsych dataset is relatively small (approx. 1,100 users). While NLSE helps mitigate this, larger datasets would allow for more complex deep learning architectures.
  • Self-Reported Labels: The "ground truth" relies on users publicly stating their diagnosis on Twitter, which may introduce bias or noise compared to clinical gold standards.
  • Ethics and Privacy: The authors acknowledge the sensitive nature of this work. Future research must balance the public health benefits of "real-time population monitoring" with the necessity of protecting individual user privacy and preventing the misuse of mental health predictions.

Summary updated

BibTeX
@inproceedings{amir2017quantifying,
  author = {Silvio Amir and Glen Coppersmith and Paula Carvalho and Mário J. Silva and Byron C. Wallace},
  title = {{Quantifying Mental Health from Social Media with Neural User Embeddings}},
  booktitle = {MLHC},
  year = {2017},
}
Figure