Quantifying Mental Health from Social Media with Neural User Embeddings

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

Introduction

Public health officials traditionally rely on surveys to track the prevalence of mental illness, but these methods are often slow, expensive, and outdated by the time they are published. Social media offers a "near real-time" alternative, yet distilling thousands of messy, informal posts into a reliable clinical signal remains a significant technical challenge. This research introduces a method to "fingerprint" users by converting their entire posting history into a single mathematical vector, or user embedding. By projecting these embeddings into task-specific subspaces, the authors identify conditions like depression and PTSD more accurately than traditional text-analysis methods.

Methodology

The core innovation lies in the combination of User2Vec embeddings and Non-Linear Subspace Embedding (NLSE).

User2Vec

Inspired by "Doc2Vec," the authors treat a user’s entire history as a single document. A $d$-dimensional vector is learned for each user by training a model to predict the words they are likely to post. This approach captures latent characteristics of expression—the who—rather than just the what of individual tweets.

NLSE (Non-Linear Subspace Embedding)

Labeled clinical data is often scarce. To address this, the authors use NLSE to learn a linear projection that "squashes" general user embeddings into a smaller, task-specific subspace. This process reduces noise and prevents the model from overfitting on small datasets.

Dataset

The study utilized the CLPsych 2015 shared task dataset, consisting of Twitter users who publicly disclosed a diagnosis: 327 with depression, 246 with PTSD, and an equal number of demographically matched controls. Each user had up to 3,000 tweets available for analysis.

Key Insights and Results

The researchers found that mental health leaves a distinct, measurable signature on language use. Even without explicit labels, the unsupervised model naturally clustered similar users together, suggesting a high degree of linguistic homophily among those with similar conditions.

t-SNE visualization of raw user embeddings showing significant overlap between groups before adaptation.

The transition from raw embeddings to the NLSE-adapted subspace provided the most significant performance jump. As shown in the visualizations, the adapted subspace creates much cleaner, more distinct clusters for the "Depression," "PTSD," and "Control" groups compared to the raw, unadapted data.

t-SNE visualization of the NLSE-adapted subspace showing distinct clustering of depression (blue), PTSD (red), and control (grey) groups.

Quantitatively, the NLSE model using User2Vec (u2v) achieved a Macro F1 of 0.717, significantly outperforming the standard Bag-of-Words (BOW) baseline of 0.686. This proves that general-purpose AI representations can be successfully tuned for sensitive clinical tasks even with limited data.

Discussion and Limitations

While promising, the study acknowledges several limitations. The dataset relies on self-disclosure bias, as users who publicly state a diagnosis may not represent the broader population. Furthermore, the authors emphasize that "digital phenotyping" must be handled with extreme care regarding privacy and stigmatization. Future work aims to bridge the gap between monitoring a patient's immediate state and their long-term mental health trajectory using these robust user embeddings.

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