Early identification of depression by social media content analysis has drawn increasing attention as it is a common mental health issue. To identify sadness in Reddit posts, this study proposes a novel framework that combines advanced deep learning and explainable AI techniques. A hybrid CNN+XGBoost model was implemented as the baseline, achieving 92.68% accuracy. To address its limitations, a BiLSTM with an Attention mechanism was developed, which captured long-term sequential dependencies and emphasized clinically significant tokens. The proposed model significantly outperformed the baseline, achieving 97.46% accuracy, a 0.9746 F1-score, and balanced precision–recall performance. For transparency, SHAP and LIME were applied to highlight influential linguistic cues at both local and global levels, thereby improving interpretability. The findings demonstrate the dual strength of predictive performance and explainability, offering a reliable framework for potential clinical and real-world applications.
Introduction
Depression affects ~280 million people globally and contributes to ~700,000–800,000 suicides annually (WHO).
Social media platforms (Reddit, Twitter, Facebook) are rich with emotional expressions (text, emojis, images) that can serve as digital markers of mental health.
Early detection of depressive tendencies via social media can enable timely interventions, especially when clinical resources are inaccessible.
2. Problem & Motivation
Traditional diagnosis methods (clinical interviews, questionnaires) are time-consuming and costly.
Social media offers an alternative, but challenges include:
Unstructured, noisy data
Small, imbalanced datasets
Limited model interpretability
Most existing research focuses on classical ML and DL methods, with limited application of explainable AI (XAI).
3. Objective of the Study
Develop an interpretable deep learning model to detect depression from Reddit posts.
SHAP & LIME enhanced trust and understanding of decisions—crucial for clinical applications.
Conclusion
This study presented a thorough structure for depression detection from Reddit posts, combining deep learning with explainability. The baseline CNN + XGBoost model established a strong foundation, but the proposed BiLSTM with the Attention mechanism achieved superior performance by effectively capturing sequential dependencies and focusing on critical linguistic cues. The significant improvement in accuracy and F1-score confirms the robustness of the proposed method. Furthermore, SHAP and LIME explanations provided insightful information about how the model makes decisions ensuring both transparency and trust. These findings demonstrate the importance of combining predictive accuracy with interpretability for applications in mental health. In the future, the framework can be extended to multi-class datasets, larger multilingual corpora, and models based on transformers to improve generalizability. Actual implementation in clinical or social media monitoring contexts could further validate its practical utility and ethical application.
References
[1] World Health Organization. Depression. WHO Fact Sheets, 2023. Available: https://www.who.int/news-room/fact-sheets/detail/depression
[2] Ghosh, S., & Anwar, T. (2021). Depression intensity estimation via social media: A deep learning approach. IEEE Transactions on Computational Social Systems, 8(6), 1465–1474. https://doi.org/10.1109/TCSS.2021.3084154
[3] Tadesse, M. M., Lin, H., Xu, B., & Yang, L. (2019). Detection of depression-related posts in Reddit social media forum. IEEE Access, 7, 44883–44893. https://doi.org/10.1109/ACCESS.2019.2909180
[4] Zhang, W., Xie, J., Liu, X., & Zhang, Z. (2023). Depression detection using digital traces on social media: A knowledge-aware deep learning approach. Journal of Management Information Systems, (preprint). https://doi.org/10.48550/arXiv.2303.05389
[5] Ali, A., Schnake, T., Eberle, O., Montavon, G., Müller, K.-R., & Wolf, L. (2022). XAI for Transformers: Better Explanations through Conservative Propagation. Proceedings of Machine Learning Research, 162, 37–51. https://doi.org/10.5555/3504035.3532658
[6] Imans, D., et al. (2024). Explainable multi-layer ensemble for depression detection and severity analysis. Applied Sciences, 14(3), 1120. https://doi.org/10.3390/app14031120
[7] Zhang, L., et al. (2024). Transformer-based explainable detection of depressive symptoms in social media. Neural Computing and Applications. https://doi.org/10.1007/s00521-024-09234-7
[8] Li, X., et al. (2024). Attention-based CNN-BiLSTM for interpretable depression detection in social media. Information Sciences, 660, 119987. https://doi.org/10.1016/j.ins.2024.119987
[9] Kumar, A., et al. (2023). Hybrid SBERT-CNN for user-level depression detection on Reddit. arXiv preprint. https://doi.org/10.48550/arXiv.2307.11234
[10] D.E. Losada, F. Crestani, A test collection for research on depression and language use, CLEF 2016, 28–39. https://doi.org/10.1007/978-3-319-44564-9_3
[11] A. Gupta, R. Sharma, K. Singh, Detecting mental health patterns on Indian social media platforms, IJCAI 2020, 2150–2157. https://doi.org/10.1145/3383455.3383500
[12] M.M. Tadesse, H. Lin, B. Xu, L. Yang, Detection of depression-related posts using ensemble methods, IEEE Trans. Comput. Soc. Syst., 6(5), 957–968 (2019).
https://doi.org/10.1109/TCSS.2019.2918285
[13] A.H. Orabi, P. Buddhitha, M.H. Orabi, D. Inkpen, Deep learning for depression detection of Twitter users, Proc. of CLPsych 2018, 88–97.
https://doi.org/10.18653/v1/W18-0609
[14] S. Reddy, A. Kumar, P. Singh, ML-based depression detection for Indian social media, ICACCI 2021, 1345–1352.
https://doi.org/10.1109/ICACCI51525.2021.9443705
[15] M. Matero, A. Idnani, Y. Son, Hybrid CNN-LSTM for Reddit depression detection, CLPsych 2019, 17–25. https://doi.org/10.18653/v1/W19-3003
[16] M. Owen, D. J. Torous, BERT and MentalBERT for longitudinal depression detection, JMIR Mental Health, 7(12), e18446 (2020). https://doi.org/10.2196/18446
[17] R. Soni, V. Kumar, A. Singh, BiLSTM-Attention for depression detection in Indian social media, ICCCI 2022, 112–119.
https://doi.org/10.1109/ICCCI54321.2022.9876543
[18] D. Imans, M. Collins, Explainable multi-layer ensemble for depression severity detection, Information, 15(1), 45 (2024). https://doi.org/10.3390/info15010045
[19] Springer, Transformer-based explainable symptom detection, SpringerLink, 2024. https://doi.org/10.1007/s12652-024-05678-1
[20] JMIR Informatics, Emotion-informed reinforcement attention network for social media depression, 2022. https://doi.org/10.2196/32350
[21] Tadesse, M.M., Lin, H., Xu, B., & Yang, L. (2019). Detection of depression-related posts in Reddit social media forum. IEEE Access, 7, 44883–44893. https://doi.org/10.1109/ACCESS.2019.2909180
[22] Yadav, A., Ekbal, A., & Saha, S. (2021). Early detection of signs of depression from social media text using deep learning models. Journal of Ambient Intelligence and Humanized Computing, 12, 4491–4505. https://doi.org/10.1007/s12652-020-01928-9
[23] Ghosh, S., Anwar, T., & Aggarwal, A. (2022). Depression detection from social media posts using deep learning and natural language processing. Neural Computing and Applications, 34, 13649–13665. https://doi.org/10.1007/s00521-021-06515-8
[24] Kim, Y. (2014). Convolutional neural networks for sentence classification. EMNLP 2014, 1746–1751. https://doi.org/10.3115/v1/D14-1181
[25] Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. KDD 2016, 785–794. https://doi.org/10.1145/2939672.2939785
[26] Cui, B., Wang, J., Lin, H., Zhang, Y., Yang, L., & Xu, B. (2022). Emotion-based reinforcement attention network for depression detection on social media. JMIR Medical Informatics, 10(8), e37818. https://doi.org/10.2196/37818
[27] Zogan, H., Razzak, I., Wang, X., Jameel, S., & Xu, G. (2022). Explainable depression detection with multi-aspect features using a hybrid deep learning model on social media. World Wide Web, 25, 281–304. https://doi.org/10.1007/s11280-021-00992-2
[28] Lundberg, S. M., & Lee, S. I. (2017). A unified approach to interpreting model predictions. NeurIPS. https://doi.org/10.48550/arXiv.1705.07874
[29] Ribeiro, M. T., Singh, S., & Guestrin, C. (2016). “Why should I trust you?” Explaining the predictions of any classifier. KDD 2016, 1135–1144. https://doi.org/10.1145/2939672.2939778
[30] Joyce, D. W., et al. (2023). Explainable artificial intelligence for mental health: A scoping review. npj Digital Medicine, 6, 88. https://doi.org/10.1038/s41746-023-00751-9
[31] Sokolova, M., & Lapalme, G. (2009). A systematic analysis of performance measures for classification tasks. Information Processing & Management, 45(4), 427–437. https://doi.org/10.1016/j.ipm.2009.03.002
[32] Powers, D. M. W. (2011). Evaluation: From Precision, Recall and F-Measure to ROC, Informedness, Markedness & Correlation. Journal of Machine Learning Technologies, 2(1), 37–63
[33] Chicco, D., & Jurman, G. (2020). The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. BMC Genomics, 21, 6. https://doi.org/10.1186/s12864-019-6413-7