Depressonify: BERT a deep learning approach of detection of depression




Bidirectional Encoder Representations from Transformers, Deep learning, Transformers, Depression Detection


INTRODUCTION: Depression is one of the leading psychological problems in the modern tech era where every single person has a social media account that has wide space for the creation of depressed feelings. Since depression can escalate to the point of suicidal thoughts or behavior spotting it early can be vitally important. Traditionally, psychologists rely on patient interviews and questionnaires to gauge the severity of depression.

OBJECTIVES: The objective of this paper is earlier depression detection as well as treatment can greatly improve the probability of living a healthy and full life free of depression.

METHODS: This paper introduces the utilization of BERT, a novel deep-learning, transformers approach that can detect levels of depression using textual data as input.

RESULTS: The main result obtained in this paper is the extensive dataset consists of a total of 20,000 samples, which are categorized into 5 classes and further divided into training, testing, and validation sets, with respective sizes of 16,000, 2,000, and 2,000. This paper has achieved a remarkable result with a training accuracy of 95.5% and validation accuracy of 92.2% with just 5 epochs.

CONCLUSION: These are the conclusions of this paper, Deep learning has a lot of potential for use in mental health applications, as seen by the study's outstanding results, which included training accuracy of 95.5%. But the path towards comprehensive and morally sound AI-based mental health support continues into the future.


Download data is not yet available.


I. Tavchioski, M. Robnik-Šikonja, and S. Pollak, Detection of depression on social networks using transformers and ensembles. 2023. Accessed: Sep. 15, 2023. [Online]. Available:

A.-M. Bucur, A. Cosma, P. Rosso, and L. P. Dinu, “It’s Just a Matter of Time: Detecting Depression with Time-Enriched Multimodal Transformers,”, Feb. 06, 2023. DOI:

S. S. Viloria, D. P. del Río, R. B. Cabo, G. A. A. Fuentes, and I. Segura-Bedmar, “A Frame- work for Identifying Depression on Social Media: MentalRiskES@IberLEF 2023,”, Jun. 29, 2023.

S. Burris, E. Villatoro-Tello, S. Madikeri, and P. Motlicek, “Node-weighted Graph Convo- lutional Network for Depression Detection in Transcribed Clinical Interviews,”, Jul. 03, 2023.

Y. H. Shen, H. Yang, and L. Lin, “Automatic Depression Detection: An Emotional Audio- Textual Corpus and a GRU/BiLSTM-based Model,” arXiv (Cornell University), Feb. 2022, doi: DOI:

C. Li, C. Braud, and M. Amblard, “Multi-Task Learning for Depression Detection in Dia- logs,”, Jul. 21, 2022. DOI:

M. Z. Uddin, K. K. Dysthe, A. Følstad, and P. B. Brandtzaeg, “Deep learning for prediction of depressive symptoms in a large textual dataset,” Neural Computing and Applications, Aug. 2021, doi: DOI:

U. Naseem, A. G. Dunn, J. Kim, and M. Khushi, “Early Identification of Depression Sever- ity Levels on Reddit Using Ordinal Classification,” Proceedings of the ACM Web Conference 2022, Apr. 2022, doi: DOI:

M. Kilaskar, N. Saindane, N. Ansari, D. Doshi, and M. Kulkarni, “Machine Learning Algo- rithms for Analysis and Prediction of Depression,” SN Computer Science, vol. 3, no. 2, Dec. 2021, doi: DOI:

E. Aydemir, T. Tuncer, S. Dogan, R. Gururajan, and U. R. Acharya, “Automated major depressive disorder detection using melamine pattern with EEG signals,” Applied Intelli- gence, vol. 51, no. 9, pp. 6449–6466, Apr. 2021, doi: 02426-y DOI:

N. Aslam, F. Rustam, E. Lee, P. B. Washington and I. Ashraf, "Sentiment Analysis and Emotion Detection on Cryptocurrency Related Tweets Using Ensemble LSTM-GRU Model," in IEEE Access, vol. 10, pp. 39313-39324, 2022, doi: 10.1109/ACCESS.2022.3165621. DOI:

C. SH. Ho, Y. L. Chan, T. WK. Tan, G. WN. Tay, and T. B. Tang, “Improving the diagnostic accuracy for major depressive disorder using machine learning algorithms integrating clini- cal and near-infrared spectroscopy data,” Journal of Psychiatric Research, vol. 147, pp. 194– 202, Mar. 2022, doi: DOI:

E. Lee, F. Rustam, I. Ashraf, P. B. Washington, M. Narra and R. Shafique, "Inquest of Cur- rent Situation in Afghanistan Under Taliban Rule Using Sentiment Analysis and Volume Analysis," in IEEE Access, vol. 10, pp. 10333-10348, 2022, doi: 10.1109/ACCESS.2022.3144659. DOI:

A. Sarkar, A. Singh, and R. Chakraborty, “A deep learning-based comparative study to track mental depression from EEG data,” Neuroscience Informatics, vol. 2, no. 4, p. 100039, Dec. 2022, doi: DOI:




How to Cite

Kumari M, Singh G, Pande SD. Depressonify: BERT a deep learning approach of detection of depression. EAI Endorsed Trans Perv Health Tech [Internet]. 2024 Mar. 22 [cited 2024 Apr. 21];10. Available from: