DETECTING ANXIETY AND DEPRESSION FROM SOCIAL MEDIA TEXT BY APPLYING MACHINE LEARNING METHODS

Authors: Serek A.G., Berlikozha B.A., Amirgaliyev B.Ye., Yedilkhan D., Shapay N.A.
IRSTI 28.23.35

Abstract. The detection of anxiety and depression through social media texts has emerged as a critical research focus, driven by the growing prevalence of mental health challenges and the widespread sharing of personal and emotional experiences on online platforms. The availability of large-scale, user-generated content provides an opportunity to develop automated systems for early detection and intervention. In this study, the effectiveness of three widely used machine learning models—Logistic Regression, Support Vector Machine (SVM), and Random Forest—is assessed using key evaluation metrics such as precision, recall, F1-score, and overall accuracy. Among the tested models, Random Forest demonstrates superior performance, consistently achieving a recall of 0.91 and an F1-score of 0.93 when identifying individuals likely experiencing anxiety and depression. These results suggest its robustness and reliability in real-world applications. SVM also performs well, with a strong balance between precision and recall, and reaches a high overall accuracy of 98%. On the other hand, Logistic Regression, although computationally efficient and simple to implement, shows limitations in detecting positive cases, with a relatively low recall of 0.59. The results of this comparative analysis highlight the potential of advanced machine learning algorithms in supporting mental health screening and emphasize the importance of model selection in building effective and scalable detection tools.

Keywords: detecting anxiety, machine learning in psychology, artificial intelligence in psychology, detecting depression, machine learning.