Heterogeneous subgraph network with prompt learning for interpretable depression detection on social media

Chen Chen, Fenghuan Li, Yuankun LinKnowledge-Based Systems 2024

Abstract

Early detection of depression via social media remains a significant challenge due to the implicit nature of psychological signals and the lack of interpretability in many "black box" AI models. This paper introduces the Heterogeneous Subgraph Network with Prompt Learning (HSNPL), a novel framework that bridges the gap between unstructured social media data and clinical diagnostic criteria. By utilizing large language model (LLM) prompt learning to map user posts to the Self-rating Depression Scale (SDS) and modeling social interactions through heterogeneous information networks, HSNPL achieves state-of-the-art performance (94.9% accuracy) while providing psychologically grounded explanations for its predictions.

Introduction

Depression is a critical public health issue, and social media platforms provide a unique, longitudinal view into users' authentic mental states. However, automated detection faces three primary hurdles. First, interpretability is paramount in clinical settings; models must provide reasons for their classifications to be trusted by practitioners. Second, users often communicate distress through implicit signals (e.g., "It has been rainy and wet for days") rather than direct declarations. Third, social media data is inherently heterogeneous, comprising not just text but also behavioral patterns, posting frequencies, and complex social interactions. Existing models often fail to integrate these diverse signals effectively, leading to missed cues or untrustworthy results.

Methodology

The HSNPL framework addresses these challenges through a three-module architecture: Heterogeneous Graph Construction, a Heterogeneous Graph Attention Network, and Subgraph Contrastive Learning.

The HSNPL framework architecture, illustrating graph construction, attention mechanisms, and subgraph contrastive learning.

1. Heterogeneous Information Network (HIN) Construction

The model integrates diverse data types into a global graph. This includes summarized tweet text (processed via BART), extracted semantic features (topics and entities), and behavioral features such as emoticon ratios, first-person pronoun usage, and temporal posting patterns. A dual attention mechanism (node-level and type-level) then learns which specific features are most indicative of a user's mental state.

2. Prompt Learning for Psychological Mapping

To enhance interpretability and capture implicit signals, HSNPL employs an LLM-based prompt learning module. This module maps raw tweets to the 20 symptoms of the Self-rating Depression Scale (SDS)—a standard clinical tool. By using cloze-style templates (e.g., "I [mask] feel down hearted and blue"), the model predicts the frequency of symptoms (e.g., "often," "rarely") based on the user's historical posts. This transforms unstructured text into structured, clinically relevant features that align with how human psychiatrists evaluate patients.

Mapping of clinical symptoms to frequency degrees using the Self-rating Depression Scale (SDS) template.

3. Subgraph Contrastive Learning

Each user is represented as a "subgraph" within the global network. The model utilizes contrastive learning to compare a user's actual subgraph against "perturbed" versions. This process helps the network identify deep, user-level interaction patterns and social structures that distinguish depressed individuals from the general population, such as differing influence patterns and interaction weights.

Data and Evaluation

The framework was evaluated using a large-scale Twitter dataset. The "Depressed" group consisted of 2,558 users with self-reported diagnoses, while the "Non-depressed" group included 5,304 users. To ensure the model learned from general behavior rather than explicit keywords, "anchor tweets" containing diagnostic terms were removed. The final balanced dataset used for evaluation comprised 5,285 users.

Results and Key Insights

HSNPL significantly outperformed baseline models, including specialized architectures like MentalBERT and HAN-MCM:

  • Accuracy: Achieved 94.9% (without anchor tweets), notably higher than standard BERT (83.2%) or RoBERTa (85.1%).
  • F1-Score: Reached 0.950, compared to 0.906 for MentalBERT.
  • Interpretability: The model successfully visualized "attention weights," showing that it correctly prioritized clinically significant terms like "suicidal," "chronic," and "clinical" when making positive predictions.

Ablation studies confirmed that while text features are foundational, the inclusion of behavioral features (like the ratio of "I/me" vs. "we/us") and the prompt-based psychological mapping provided substantial performance gains.

Limitations and Future Work

Despite its success, the model faces limitations with "quiet" users who post infrequently. Future work may involve analyzing "propagation chains" to better understand information flow for these individuals. Additionally, addressing topic-based biases—where the model might accidentally associate a specific hobby with a mental health status—remains a priority for real-world deployment. The authors note that practical application would require close cooperation with psychological counseling centers.

Conclusion

HSNPL represents a significant step forward in interpretable mental health monitoring. By aligning AI reasoning with clinical psychology through prompt learning and modeling complex social data as heterogeneous subgraphs, the framework provides a robust and transparent tool for early depression detection on social media.

Summary updated

BibTeX
@article{chen2024heterogeneous,
  author = {Chen Chen and Fenghuan Li and Haopeng Chen and Yuankun Lin},
  title = {{Heterogeneous subgraph network with prompt learning for interpretable depression detection on social media}},
  journal = {Knowledge-Based Systems},
  year = {2024},
}
Figure