RISK FORMER: TOWARDS TRANSPARENT AI IN MENTAL HEALTH—AN EXPLAINABLE TRANSFORMER MODEL FOR SUICIDE RISK DETECTION FROM DIGITAL LANGUAGE

Authors

  • Muhammad Arman
  • Esha Sabir
  • Shafiq Hussain
  • Ayesha Naeem
  • Muhammad Usman Ahmad
  • Mariyam Khan
  • Adeen Amjad
  • Aleena Jami
  • Noshaba Parmal Imran
  • Mehwish Usman
  • Waqar Ahmad
  • Arslan Ali Mansab
  • Muhammad Hamza Akbar
  • Muhammad Waqas

Keywords:

Explainable AI (XAI), Transformer, Suicide Risk Detection, Mental Health

Abstract

The worldwide public health crisis of suicide remains critical; the ability to detect the risk of suicide early based on digital footprints, that is, the words and language used on social media, is one method of providing proactive intervention for suicide prevention. Deep Learning is the mechanism that has proven effective; however, they are typically viewed as "black boxes," which raises questions regarding their potential adoption in clinical settings, as we cannot determine how they have come to their conclusion. This study discusses the development of RiskFormer, a new and robust Transformer-based architecture that allows for the explainable prediction of suicide risk from digital text. RiskFormer combines a streamlined approach to Multi-Head Attention (MHA) with post-hoc approaches to explainability (i.e., gradient- weighted class activation mapping for transformers) to provide interpretable, clinically relevant results. The model was demonstrated to perform comparably to leading-edge baselines on a curated dataset of social media posts while providing visual and textual rationales for its predictions. Therefore, the study indicates that RiskFormer offers an opportunity for Explainable AI (XAI) to enhance the ability to create trustworthy digital mental health applications and bridge the gap between high-performing algorithms and clinical applicability.

Downloads

Published

2025-07-28

How to Cite

Muhammad Arman, Esha Sabir, Shafiq Hussain, Ayesha Naeem, Muhammad Usman Ahmad, Mariyam Khan, Adeen Amjad, Aleena Jami, Noshaba Parmal Imran, Mehwish Usman, Waqar Ahmad, Arslan Ali Mansab, Muhammad Hamza Akbar, & Muhammad Waqas. (2025). RISK FORMER: TOWARDS TRANSPARENT AI IN MENTAL HEALTH—AN EXPLAINABLE TRANSFORMER MODEL FOR SUICIDE RISK DETECTION FROM DIGITAL LANGUAGE. Spectrum of Engineering Sciences, 3(7), 1693–1700. Retrieved from https://thesesjournal.com/index.php/1/article/view/1668