Dynamic Graph Representation Learning for Depression Screening with Transformer

Ai-Te Kuo, Haiquan Chen, Yu-Hsuan Kuo, Wei-Shinn KuarXiv 2023

Abstract

Early detection of mental disorder is crucial as it enables prompt intervention and treatment, which can greatly improve outcomes for individuals suffering from debilitating mental affliction. The recent proliferation of mental health discussions on social media platforms presents research opportunities to investigate mental health and potentially detect instances of mental illness. However, existing depression detection methods are constrained due to two major limitations: (1) the reliance on feature engineering and (2) the lack of consideration for time-varying factors. Specifically, these methods require extensive feature engineering and domain knowledge, which heavily rely on the amount, quality, and type of user-generated content. Moreover, these methods ignore the important impact of time-varying factors on depression detection, such as the dynamics of linguistic patterns and interpersonal interactive behaviors over time on social media (e.g., replies, mentions, and quote-tweets). To tackle these limitations, we propose an early depression detection framework, ContrastEgo, which treats each user as a dynamic time-evolving attributed graph (ego-network) and leverages supervised contrastive learning to maximize the agreement of users' representations at different scales while minimizing the agreement of users' representations to differentiate between depressed and control groups. ContrastEgo embraces four modules: (1) constructing users' heterogeneous interactive graphs, (2) extracting the representations of users' interaction snapshots using graph neural networks, (3) modeling the sequences of snapshots using attention mechanism, and (4) depression detection using contrastive learning. Extensive experiments on Twitter data demonstrate that ContrastEgo significantly outperforms the state-of-the-art methods in terms of all the effectiveness metrics in various experimental settings.

Introduction

Detecting depression early is a major global health challenge, and social media offers a unique window into a person's mental state. However, existing automated detection methods suffer from three main gaps: reliance on manual feature engineering, ignoring temporal dynamics, and neglecting the social context of a user's "ego-network"—the web of replies, mentions, and quotes. ContrastEgo addresses these by treating users as dynamic social graphs rather than static text sources.

Methodology

The ContrastEgo framework consists of four primary modules designed to capture the multi-faceted nature of social media behavior over time.

The ContrastEgo architecture: from heterogeneous graph construction to contrastive learning.
  1. Heterogeneous Graph Construction: The model builds ego-networks for each user where edges represent different interaction types (replies, mentions, quote-tweets), providing a rich view of social behavior.
  2. Interpersonal Dynamics (GNN): Graph Neural Networks (GNNs) extract multi-scale representations at both the node-level (the user) and graph-level (the user’s social circle) for each time snapshot.
  3. Temporal Dynamics (Transformer): Snapshots are processed by a Transformer encoder using attention mechanisms to identify relevant time periods and capture behavioral shifts, such as sudden drops in social interaction.
  4. Supervised Contrastive Learning: The model maximizes agreement between a user's node-level and graph-level representations for the same group while pushing different groups apart in the embedding space.
Supervised contrastive learning mechanism maximizing agreement between node-level and graph-level representations.

Datasets and Experimental Setup

The study utilizes the PsycheNet-G dataset, comprising 242 users diagnosed with depression and 349 control group individuals. Node features were initialized using a pre-trained RoBERTa model fine-tuned on Twitter data to capture linguistic nuances. To optimize training, the authors developed a technique to aggregate time-step snapshots into a single graph, reducing training time from ~20 seconds to ~2 seconds per epoch.

Key Results

ContrastEgo consistently outperformed baselines such as GCN, GAT, and DySAT:

  • Effectiveness: Achieved up to a 5% improvement in F1 score and a 4% improvement in AUROC compared to the best baseline methods.
  • Early Detection: Remained robust even with limited data (e.g., 1 tweet per period) and long observation intervals (up to 12 months), making it suitable for real-world screening.
  • Ablation Studies: Removing either the temporal (Transformer) or social (Heterogeneous Graph) components led to significant performance drops, validating the importance of both dimensions.

Conclusion

ContrastEgo demonstrates that social circles and temporal evolution are diagnostic signatures for depression. By leveraging supervised contrastive learning and dynamic graphs, the framework offers a powerful tool for early mental health screening on social media. Future work will explore platform-specific dynamics and the ethical integration of such tools into clinical workflows.

Summary updated

BibTeX
@misc{kuo2023dynamic,
  author = {Ai-Te Kuo and Haiquan Chen and Yu-Hsuan Kuo and Wei-Shinn Ku},
  title = {{Dynamic Graph Representation Learning for Depression Screening with Transformer}},
  year = {2023},
  eprint = {2305.06447},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.06447},
}
Figure