Emotion and Cognition Based Mental Health Analysis from Social Media
PDF

How to Cite

P., Angelin Jeba, Jemima Jebaseeli T., Selvarathi M., Achal Shaji, Ivine Thomas, and Agilesh Vigram S. 2026. “Emotion and Cognition Based Mental Health Analysis from Social Media”. Journal of Trends in Computer Science and Smart Technology 8 (1): 155-75. https://doi.org/10.36548/jtcsst.2026.1.008.

Keywords

— Mental Health Disorders
— Social Media
— Emotion
— Cognitive
— Machine Learning
— Twitter
— Facebook
— Depression
— Anxiety
Published: 20-03-2026

Abstract

Social media websites are popular, and it is now possible to collect a significant amount of behavioral data in real time. This has made it possible to conduct research on mental health. This study proposes a machine learning framework to identify and predict mental health issues, such as emotion and cognition, related to social media with respect to depression, anxiety, and bipolar disorder. In this study, three social media datasets were used, each with more than 1.6 million posts: Sentiment140, Twitter Depression Dataset, and Facebook Sentiment. The data was tokenized and lemmatized, and stopwords were removed. We used BERT, a transformer model, to view the data using emotional traits. This was done using the sentimental polarity score and emotions such as grief, anger, joy, fear, and insignificance. We used Latent Dirichlet Allocation (LDA) and Linguistic Inquiry and Word Count (LIWC) to infer cognitive distortions and psychological indices. We used Recursive Feature Elimination (RFE) for feature selection and a Random Forest classifier to predict mental health across multiple classes. The proposed method is more effective than deep learning and machine learning techniques, achieving an accuracy of 95.0%, precision of 94.0%, recall of 93.7%, F1-score of 94.8%, and AUC-ROC of 98.9%. The sentiment polarity score improved the prediction by 28%, the emotional scores improved the prediction by 35%, the cognitive themes improved the prediction by 22%, and the LIWC features improved the prediction by 15%. The results indicate that the use of cognitive linguistics and emotional representation facilitates the identification of early symptoms of severe depression and bipolar disorder.

References

  1. Delanerolle, Gayathri, Yassine Bouchareb, Suchith Shetty, Heitor Cavalini, and Peter Phiri. "A Pilot Study Using Natural Language Processing yo Explore Textual Electronic Mental Healthcare Data." In Informatics, vol. 12, no. 1, MDPI, 2025, 28.
  2. Guntuku, Sharath Chandra, David B. Yaden, Margaret L. Kern, Lyle H. Ungar, and Johannes C. Eichstaedt. "Detecting Depression and Mental Illness on Social Media: An Integrative Review." Current Opinion in Behavioral Sciences 18 (2017): 43-49.
  3. Chancellor, Stevie, Zhiyuan Lin, Erica L. Goodman, Stephanie Zerwas, and Munmun De Choudhury. "Quantifying and Predicting Mental Illness Severity in Online Pro-Eating Disorder Communities." In Proceedings of the 19th ACM conference on computer-supported cooperative work & social computing, 2016, 1171-1184.
  4. Ozimek, Phillip, Julia Brailovskaia, and Hans-Werner Bierhoff. "Active and Passive Behavior in Social Media: Validating the Social Media Activity Questionnaire (SMAQ)." Telematics and Informatics Reports 10 (2023): 100048.
  5. Yao, Sumei, Fan Wang, Jing Chen, and Quan Lu. "Utilizing Health-Related Text on Social Media for Depression Research: Themes and Methods." Library Hi Tech 43, no. 1 (2025): 274-294.
  6. Baqir, Anees, Mubashir Ali, Shaista Jaffar, Hafiz Husnain Raza Sherazi, Mark Lee, Ali Kashif Bashir, and Maryam M. Al Dabel. "Identifying COVID-19 Survivors Living with Post-Traumatic Stress Disorder Through Machine Learning on Twitter." Scientific Reports 14, no. 1 (2024): 18902.
  7. World Health Organization. 2021. “Depression.” WHO Fact Sheets. Accessed 2021. https://www.who.int/news-room/fact-sheets/detail/depression.
  8. Statista. 2023. “Global Social Networks Ranked by Number of Users.” Accessed 2023. https://www.statista.com/statistics/272014/global-social-networks-ranked-by-number-of-users/.
  9. Angskun, Jitimon, Suda Tipprasert, and Thara Angskun. "Big Data Analytics on Social Networks for Real-Time Depression Detection." Journal of Big Data 9, no. 1 (2022): 69.
  10. Tahir, Waleed Bin, Shah Khalid, Sulaiman Almutairi, Mohammed Abohashrh, Sufyan Ali Memon, and Jawad Khan. "Depression Detection in Social Media: A Comprehensive Review of Machine Learning and Deep Learning Techniques." IEEE Access 13 (2025): 12789-12818.
  11. Villa-Pérez, Miryam Elizabeth, Luis A. Trejo, Maisha Binte Moin, and Eleni Stroulia. "Extracting Mental Health Indicators from English and Spanish Social Media: A Machine Learning Approach." IEEE Access 11 (2023): 128135-128152.
  12. Montag, Christian, Zsolt Demetrovics, Jon D. Elhai, Don Grant, Ina Koning, Hans-Jürgen Rumpf, Marcantonio M. Spada, Melina Throuvala, and Regina van den Eijnden. "Problematic Social Media Use in Childhood and Adolescence." Addictive behaviors 153 (2024): 107980.
  13. Verma, Ashutosh, Sherif Badran, Abu Bashar, and Irfanullah Khan. "Mental Health in the Metaverse: Well-Being Challenges and Strategies for Emerging Markets." In Marketing in the Metaverse: Opportunities, Challenges, and Future Trends in Emerging Economies, Cham: Springer Nature Switzerland, 2026, 343-370.
  14. Ngabo-Woods, Harold, Larisa Dunai, Isabel Seguí Verdú, and Sui Liang. "A Multimodal Framework for Prognostic Modelling of Mental Health Treatment and Recovery Trajectories." Applied Sciences 16, no. 2 (2026): 763.
  15. Fadda, Marta, Martin Sykora, Suzanne Elayan, Milo A. Puhan, John A. Naslund, Stephen J. Mooney, Emiliano Albanese, Rosalba Morese, and Oliver Gruebner. "Ethical Issues of Collecting, Storing, and Analyzing Geo-Referenced Tweets for Mental Health Research." Digital health 8 (2022): 20552076221092539.
  16. Sharma, Chandra Mani, Kyawt Yin Min Thein, and Vijayaraghavan M. Chariar. "Optimized Support Vector Machines for Detection of Mental Disorders." In Artificial Intelligence in Healthcare, CRC Press, 2024, 190-219.
  17. Bharadiya, Jasmin Praful. "A Tutorial on Principal Component Analysis for Dimensionality Reduction in Machine Learning." International journal of innovative science and research technology 8, no. 5 (2023): 2028-2032.
  18. Hassan, Sayar Ul, Jameel Ahamed, and Khaleel Ahmad. "Analytics of Machine Learning-Based Algorithms for Text Classification." Sustainable operations and computers 3 (2022): 238-248.
  19. Li, Wenshuo, Hanting Chen, Jianyuan Guo, Ziyang Zhang, and Yunhe Wang. "Brain-Inspired Multilayer Perceptron with Spiking Neurons." In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022, 783-793.
  20. Lorenzoni, Giuliano, Cristina Tavares, Nathalia Nascimento, Paulo Alencar, and Donald Cowan. "Assessing ML Classification Algorithms and NLP Techniques for Depression Detection: An Experimental Case Study." PloS one 20, no. 5 (2025): e0322299.
  21. Rodrigues, Myanca, Jordan Edwards, Tea Rosic, Yanchen Wang, Jhalok Ronjan Talukdar, Saifur R. Chowdhury, Sameer Parpia et al. "A tutorial on the What, Why, and How of Bayesian Analysis: Estimating Mood and Anxiety Disorder Prevalence Using a Canadian Data Linkage Study." PLOS Mental Health 2, no. 2 (2025): e0000253.
  22. Zhang, Xiang, and Yann LeCun. “Text Understanding from Scratch.” arXiv preprint arXiv:1502.01710 (2015).
  23. Devlin, Jacob, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. "Bert: Pre-Training of Deep Bidirectional Transformers for Language Understanding." In Proceedings of the 2019 conference of the North American chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), 2019, 4171-4186.
  24. Brown, Tom, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D. Kaplan, Prafulla Dhariwal, Arvind Neelakantan et al. "Language Models are Few-Shot Learners." Advances in neural information processing systems 33 (2020): 1877-1901.
  25. Feuerriegel, Stefan, Abdurahman Maarouf, Dominik Bär, Dominique Geissler, Jonas Schweisthal, Nicolas Pröllochs, Claire E. Robertson et al. "Using Natural Language Processing to Analyse Text Data in Behavioural Science." Nature Reviews Psychology 4, no. 2 (2025): 96-111.
  26. Sentiment140 Dataset with 1.6 Million Tweets, Available online at: https://www.kaggle.com/datasets/kazanova/sentiment140, Last accessed on 26th February 2026.
  27. Twitter Depression Dataset, Available online at: https://www.kaggle.com/datasets/hyunkic/twitter-depression-dataset, Last accessed on 26th February 2026.
  28. Facebook Dataset, Available online at: https://www.kaggle.com/datasets/mortena/fb-sentiment, Last accessed on 26th February 2026.