Context-Aware Machine Learning for Detecting Clinical Mental Health Indicators in Social Media
Context-Aware Machine Learning for Detecting Clinical Mental Health Indicators in Social Media
Zakariya Baidi Mabrouk,Syed Muhammad Raza,2 Authors,Syed Faheem Raza
Abstract
Mental health conditions affect nearly one billion individuals worldwide, yet access to timely professional care remains limited. Prior research has shown that users often express early linguistic indicators of psychological distress on social media platforms, presenting an opportunity for scalable early screening. However, existing automated detection systems frequently suffer from high false positive rates due to their inability to distinguish genuine clinical indicators from everyday or metaphorical expressions of negative affect, and from missed detections when posts are analysed in isolation.This paper proposes a context-aware machine learning framework for detecting clinical indicators of depression and anxiety in social media discourse while explicitly distinguishing them from general negative mood. A large-scale dataset of 899,647 Reddit posts is processed through a psychologically informed feature extraction pipeline, transforming raw text into 283 features encompassing TF-IDF representations, sentiment polarity, readability metrics, linguistic statistics, and domain-specific mental health lexicons. Five modelling paradigms are evaluated: Naive Bayes, Random Forest, XGBoost, deep neural networks, and finetuned pretrained transformer models. .Experimental results demonstrate classification accuracies ranging from 86% to 96%, while maintaining low false positive rates between 3.3% and 4.1%. Feature analysis identifies sentiment polarity, mental health terminology, and linguistic complexity as the most discriminative factors. The proposed framework is presented with deployment considerations, including data de-identification, compliance with GDPR, and ethical safeguards.
