Using XAI and Visualization for Clinical Decision-Making: Targeting Mental Health Assessment Using Social Media Data - Chiume, Chekani; Lengwe, Maybins; Silwizya, Calvin Swatulani (Proceedings of International Conference for ICT (ICICT) - Zambia, 2025)
Depression is a major global mental health challenge, often going underdiagnosed due to stigma, delayed recognition, and limited monitoring, reducing opportunities for timely intervention. This study applied Explainable Artificial Intelligence (XAI) and visualization techniques to detect signs of depression from social media data, aiming to improve both predictive accuracy and interpretability. A dataset of 27,977 anonymized public posts was collected from X (formerly Twitter) between 2023 and 2024, cleaned and preprocessed to yield 26,925 posts. Two models were developed: a TF-IDF + Random Forest baseline and a fine-tuned DistilBERT transformer model, trained and evaluated using an 80/10/10 train–validation–test split. DistilBERT outperformed the baseline, achieving 92% accuracy, 89% precision, 91% recall, and a 0.94 ROC-AUC score. Error analysis revealed that false positives often involved sarcasm, while false negatives reflected subtle or metaphorical distress. To enhance interpretability, SHAP (Shapley Additive Explanations) was used for global feature importance, while LIME (Local Interpretable Model-Agnostic Explanations) provided local, case-level insights. Validation by mental health professionals confirmed that 86% of explanations aligned with clinical indicators. Visualization tools, including SHAP plots and saliency maps, further improved accessibility of results. Ethical safeguards such as data anonymization and compliance with platform policies were enforced. This work demonstrates that combining transformer-based models with XAI can produce accurate, interpretable frameworks that bridge the gap between AI prediction and clinical reasoning, supporting responsible and trustworthy mental health assessment.