Depression Detection on Social Media Using Multi-Task Learning with BERT and Hierarchical Attention: A DSM-5-Guided Approach
Open Access
- 29 January 2026
- journal article
- research article
- Published by MDPI AG in Electronics
- Vol. 15 (3) , 598
Abstract
Depression represents a major global health challenge, yet traditional clinical diagnosis faces limitations, including high costs, limited coverage, and low patient willingness. Social media platforms provide new opportunities for early depression screening through user-generated content. However, existing methods often lack systematic integration of clinical knowledge and fail to leverage multi-modal information comprehensively. We propose a DSM-5-guided methodology that systematically maps clinical diagnostic criteria to computable social media features across three modalities: textual semantics (BERT-based deep semantic extraction), behavioral patterns (temporal activity analysis), and topic distributions (LDA-based cognitive bias identification). We design a hierarchical architecture integrating BERT, Bi-LSTM, hierarchical attention, and multi-task learning to capture both character-level and post-level importance while jointly optimizing depression classification, symptom recognition, and severity assessment. Experiments on the WU3D dataset (32,570 users, 2.19 million posts) demonstrate that our model achieves 91.8% F1-score, significantly outperforming baseline methods (BERT: 85.6%, TextCNN: 78.6%, and SVM: 72.1%) and large language models (GPT-4 few-shot: 86.9%). Ablation studies confirm that each component contributes meaningfully with synergistic effects. The model provides interpretable predictions through attention visualization and outputs fine-grained symptom assessments aligned with DSM-5 criteria. With low computational cost (~50 ms inference time), local deployability, and superior privacy protection, our approach offers significant practical value for large-scale mental health screening applications. This work demonstrates that domain-specialized methods with explicit clinical knowledge integration remain highly competitive in the era of general-purpose large language models.Keywords
Funding Information
- National Natural Science Foundation of China (62402309)
This publication has 20 references indexed in Scilit:
- Mental-LLMProceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies, 2024
- A comprehensive survey on sentiment analysis: Approaches, challenges and trendsKnowledge-Based Systems, 2021
- Text Preprocessing for Text Mining in Organizational Research: Review and RecommendationsOrganizational Research Methods, 2020
- Sentiment Analysis Using Gated Recurrent Neural NetworksSN Computer Science, 2020
- Economic LSTM Approach for Recurrent Neural NetworksIEEE Transactions on Circuits and Systems II: Express Briefs, 2019
- Detection of Depression-Related Posts in Reddit Social Media ForumIEEE Access, 2019
- Utilizing Neural Networks and Linguistic Metadata for Early Detection of Depression Indications in Text SequencesIEEE Transactions on Knowledge and Data Engineering, 2018
- Epidemiology of Adult DSM-5 Major Depressive Disorder and Its Specifiers in the United StatesJAMA Psychiatry, 2018
- The PHQ-9Journal of General Internal Medicine, 2001
- Support-Vector NetworksMachine Learning, 1995