journal article·2025-03-19Open access

An Encoder-Only Transformer Model for Depression Detection from Social Network Data: The DEENT Approach

Robinson Narvaez Burbano, Oscar Mauricio Caicedo Rendon, Carlos. A. Astudillo

Applied Sciences· Volume 15· Issue 6

Abstract

Depression is a common mental illness magnified by the COVID-19 pandemic. In this context, early depression detection is pivotal for public health systems. Various works have addressed depression detection in social network data. Nevertheless, they used data from before the pandemic and did not exploit Transformers’ architecture capabilities for realizing binary classification on extensive dimensional data. This paper aims to introduce a model based on encoder-only Transformer architecture to detect depression using a large Twitter dataset collected during the COVID-19 pandemic. In this regard, we present DEENT, an approach that includes a depression-oriented dataset built with BERT and K-means from a previous Twitter dataset labeled for sentiment analysis, and two models called DEENT-Generic and DEENT-Bert for classifying depressive and non-depressive tweets effectively. DEENT was evaluated extensively and compared to Random Forest, Support Vector Machine, XGBoost, Recurrent and Convolutional Neural Networks, and MentalBERT. Results revealed that DEENT-Bert outperforms baseline models regarding accuracy, balanced accuracy, precision, recall, and F1-Score for classifying non-depressive and depressive tweets. DEENT-Generic was better at detecting depressive tweets than baseline models. We argue that these results are due to the DEENT leveraging the encoder-only Transformer architecture and fine-tuning to detect depression in large Twitter data effectively. Therefore, we concluded that DEENT is a promising solution for detecting depressive and non-depressive tweets.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Mental Health via Writing · Sentiment Analysis and Opinion Mining · Complex Network Analysis Techniques

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Departamento de Telemática, Universidad del Cauca, Popayán 190001, Colombia

Instituto de Computação, Universidade Estadual de Campinas, Campinas 13083-872, Brazil

Funding

Universidad del Cauca

References (47)

Show source-provided references
1. (2024, December 10). Depression. Available online: https://www.who.int/es/news-room/fact-sheets/detail/depression.
2. (2024, December 10). Mental Disorders. Available online: https://www.who.int/news-room/fact-sheets/detail/mental-disorders.
3. (2024, December 10). Depression, Available online: https://www.nimh.nih.gov/health/topics/depression.
4. Deshpande, M., and Rao, V. (2017, January 7–8). Depression detection using emotion artificial intelligence. Proceedings of the International Conference on Intelligent Sustainable Systems, ICISS 2017, Palladam, India.10.1109/ISS1.2017.8389299 ↗
5. Early detection of depression: Social network analysis and random forest techniques
6. Post-COVID syndrome and suicide risk10.1093/qjmed/hcab007 ↗
7. The COVID-19 pandemic: An opportunity to make mental health a higher public health priority10.1192/bjo.2021.1002 ↗
8. Li, S., Wang, Y., Xue, J., Zhao, N., and Zhu, T. (2020). The impact of COVID-19 epidemic declaration on psychological consequences: A study on active weibo users. Int. J. Environ. Res. Public Health, 17.10.3390/ijerph17062032 ↗
9. Emotions of COVID-19: Content analysis of self-reported information using artificial intelligence10.2196/27341 ↗
10. Lifestyle predictors of depression and anxiety during COVID-19: A machine learning approach
11. Learning the mental health impact of COVID-19 in the United States with explainable artificial intelligence: Observational study10.2196/25097 ↗
12. Huma, Sohail, M.K., Akhtar, N., Muhammad, D., Afzal, H., Mufti, M.R., Hussain, S., and Ahmed, M. (2021). Analyzing COVID-2019 Impact on Mental Health through Social Media Forum. Comput. Mater. Contin., 67, 3737–3748.10.32604/cmc.2021.014398 ↗
13. Fair and Explainable Depression Detection in Social Media10.1016/j.ipm.2022.103168 ↗
14. Explainable depression detection with multi-aspect features using a hybrid deep learning model on social media10.1007/s11280-021-00992-2 ↗
15. Random Forests10.1023/A:1010933404324 ↗
16. Support-vector networks10.1007/BF00994018 ↗
17. Chen, T., and Guestrin, C. (2016, January 13–17). XGBoost: A scalable tree boosting system. Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, New York, NY, USA.10.1145/2939672.2939785 ↗
18. Long Short-Term Memory10.1162/neco.1997.9.8.1735 ↗
19. Gradient-based learning applied to document recognition10.1109/5.726791 ↗
20. Yang, Z., Yang, D., Dyer, C., He, X., Smola, A., and Hovy, E. (2016, January 12–17). Hierarchical Attention Networks for Document Classification. Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego, CA, USA.10.18653/v1/N16-1174 ↗
21. Identifying discernible indications of psychological well-being using ML: Explainable AI in reddit social media interactions10.1007/s13278-023-01145-1 ↗
22. Devlin, J., Chang, M.W., Lee, K., and Toutanova, K. (2019, January 2–7). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapolis, MN, USA.
23. Using Social Media to Explore the Consequences of Domestic Violence on Mental Health10.1177/0886260518757756 ↗
24. Kalt, T. (1998). A New Probabilistic Model of Text Classification and Retrieval, University of Massachusetts. Technical Report.
25. Estimation in linear regression models with disparate data points10.2307/1912810 ↗
26. Latent Dirichlet allocation
27. Enhanced Sentiment Analysis and Topic Modeling During the Pandemic Using Automated Latent Dirichlet Allocation10.1109/ACCESS.2024.3411717 ↗
28. Artificial emotional model based on finite state machine10.1007/s11771-008-0129-1 ↗
29. Harnessing the Power of Hugging Face Transformers for Predicting Mental Health Disorders in Social Networks10.1109/ACCESS.2024.3366653 ↗
30. Automatic detection of procedural knowledge in robotic-assisted surgical texts10.1007/s11548-021-02370-9 ↗
31. A transformer-based architecture for fake news classification10.1007/s13278-021-00738-y ↗
32. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., and Polosukhin, I. (2017, January 4–9). Attention is all you need. Proceedings of the 31st International Conference on Neural Information Processing Systems, Long Beach, CA, USA.
33. Lan, Z., Chen, M., Goodman, S., Gimpel, K., Sharma, P., and Soricut, R. (2020, January 26–30). ALBERT: A Lite BERT for Self-supervised Learning of Language Representations. Proceedings of the International Conference on Learning Representations, Addis Ababa, Ethiopia.
34. Attention Mechanisms in Clinical Text Classification: A Comparative Evaluation10.1109/JBHI.2024.3355951 ↗
35. Towards CRISP-ML(Q): A Machine Learning Process Model with Quality Assurance Methodology10.3390/make3020020 ↗
36. Mann, S. (2024, December 10). Depressive/non-Depressive Tweets Between Dec’19 to Dec’20. Available online: https://ieee-dataport.org/open-access/depressivenon-depressive-tweets-between-dec19-dec20.
37. Loper, E., and Bird, S. (2002). NLTK: The Natural Language Toolkit. arXiv.10.3115/1118108.1118117 ↗
38. Müller, M., Salathé, M., and Kummervold, P.E. (2020). COVID-Twitter-BERT: A Natural Language Processing Model to Analyse COVID-19 Content on Twitter. arXiv.
39. (2024, December 10). Huggingface. Available online: https://huggingface.co/digitalepidemiologylab/covid-twitter-bert-v2-mnli.
40. SMOTE: Synthetic minority over-sampling technique
41. (2024, December 10). Huggingface BERT Model. Available online: https://huggingface.co/tiya1012/swmh4_bert.
42. Sokolova, M., Japkowicz, N., and Szpakowicz, S. (2006, January 4–8). Beyond Accuracy, F-Score and ROC: A Family of Discriminant Measures for Performance Evaluation. Proceedings of the AI 2006: Advances in Artificial Intelligence, Hobart, Australia.10.1007/11941439_114 ↗
43. Index of balanced accuracy: A performance measure for skewed class distributions10.1007/978-3-642-02172-5_57 ↗
44. A comprehensive survey on machine learning for networking: Evolution, applications and research opportunities10.1186/s13174-018-0087-2 ↗
45. Kingma, D.P., and Ba, J. (2017). Adam: A Method for Stochastic Optimization. arXiv.
46. Binary cross entropy with deep learning technique for Image classification10.30534/ijatcse/2020/175942020 ↗
47. Ji, S., Zhang, T., Ansari, L., Fu, J., Tiwari, P., and Cambria, E. (2022, January 20–25). MentalBERT: Publicly Available Pretrained Language Models for Mental Healthcare. Proceedings of the Thirteenth Language Resources and Evaluation Conference, Marseille, France.