Abstract
Automatic depression detection on Twitter can help individuals privately and conveniently understand their mental health status in the early stages before seeing mental health professionals. Most existing black-box-like deep learning methods for depression detection largely focused on improving classification performance. However, explaining model decisions is imperative in health research because decision-making can often be high-stakes and life-and-death. Reliable automatic diagnosis of mental health problems including depression should be supported by credible explanations justifying models’ predictions. In this work, we propose a novel explainable model for depression detection on Twitter. It comprises a novel encoder combining hierarchical attention mechanisms and feed-forward neural networks. To support psycholinguistic studies, our model leverages metaphorical concept mappings as input. Thus, it not only detects depressed individuals, but also identifies features of such users’ tweets and associated metaphor concept mappings.
Introduction
Early intervention is critical in managing mental health, and social media platforms like Twitter provide a rich data source for automatic depression detection. However, two significant challenges persist in current NLP approaches: the "black box" nature of deep learning models and the neglect of implicit psychological cues. Clinicians require interpretable models to trust automated diagnoses, and psychological research suggests that depressed individuals often use metaphorical language (e.g., "feeling trapped in a dark hole") to express internal states.
This paper introduces a Hierarchical Attention Network (HAN) that addresses these gaps. By incorporating Metaphor Concept Mappings (MCMs), the model captures how users implicitly express emotions. Simultaneously, its architecture ensures that decision-making is transparent, allowing for the identification of specific tweets and metaphors that contribute to a diagnosis.
Methodology: The Hierarchical Attention Network
The proposed architecture utilizes a dual-encoder system to process two distinct data streams for each user: raw tweets and extracted Metaphor Concept Mappings (MCMs).
Metaphor Concept Mapping (MCM) Pipeline
The system identifies metaphors within tweets, paraphrases them into literal meanings, and abstracts them into conceptual mappings. For instance, a tweet about the "core of the matter" is mapped to the MCM IMPORTANCE IS INTERIORITY. This process transforms linguistic nuances into structured cognitive features.
Disentangled Attention Encoder
The core of the HAN is a novel encoder that combines scaled dot-product attention with Feed-Forward Neural Networks (FNNs). Unlike standard Transformers where information is mixed across all tokens, the HAN maintains feature disentanglement. This design prevents information leakage between different inputs (tweets vs. MCMs) during the encoding phase.
By keeping hidden states separate, the final attention weights directly map back to specific tweets and MCMs. This provides a quantitative ranking of the most influential inputs, offering a clear explanation for the model's output.
Experimental Setup
The model was evaluated on two primary datasets:
- MDL (Shen et al., 2017): A public dataset of Twitter users diagnosed with depression and a control group.
- IMDL (Implicit Twitter Depression Data): A new benchmark created by the authors. This dataset is a "scrubbed" version of MDL, where all explicit linguistic cues (e.g., "depressed", "anxiety") were removed to test the model's ability to detect depression through implicit signals alone.
Results and Discussion
The HAN model demonstrates that explainability does not have to come at the cost of performance. It achieved state-of-the-art results, significantly outperforming existing baselines.
Key Performance Metrics
- Accuracy and F1 Score: HAN achieved an average F1 score of 97.2% and an accuracy of 97.1% on the MDL dataset, representing a 6.0% improvement in F1 score over previous state-of-the-art models.
- The Value of Metaphors: The inclusion of the MCM encoder improved performance across the board, with a more pronounced impact on the IMDL dataset (1.9% F1 improvement). This confirms that metaphors are powerful predictive signals when explicit keywords are absent.
- Efficiency: Despite its high performance, the HAN encoder is lightweight, utilizing only 1.18M parameters—roughly a quarter of the size of standard LSTM or Transformer encoders.
Qualitative Explainability
Beyond metrics, the model provides clinical utility by highlighting relevant behaviors. High attention weights were observed on negative self-expressions and specific metaphors like LEVEL IS IMPORTANCE, which correlates with how depressed individuals perceive stress and risk.
Conclusion
The Hierarchical Attention Network offers a robust, efficient, and explainable solution for depression detection. By leveraging metaphorical language, it taps into deep psychological cues that traditional models overlook. Future work will focus on refining the MCM extraction pipeline and extending the model to categorize specific subtypes of depression based on cognitive expressions.
Summary updated