AI-based detection of suicidal ideation in text: model development and evaluation for a student mental health chatbot
Abstract
Background: Conversational digital mental health interventions (DMHIs) require mechanisms for recognizing expressions of suicidal ideation (SI) and initiating appropriate safety responses. Artificial intelligence (AI)-based detection approaches could provide a scalable safeguard; but systems designed for real world deployment must consider accuracy alongside computational efficiency, transparency, and appropriate response pathways.
Methods: We developed a lightweight SI-detection system for integration into Minder, a mental health chatbot intervention for students. The detection pipeline combined a fine-tuned Sentence-BERT (SBERT) encoder with a nonparametric, anchor-based decision layer. The encoder was trained on 220,833 sentence-level text samples from public social media datasets. Fine-tuning used partial unfreezing and Batch-All Triplet Loss, with three configurations (Light, Medium, Heavy) compared on a development set. Each text input was encoded as 768-dimensional embeddings, then compared, using cosine similarity, against an expert-curated reference set of statements spanning suicidal ideation, intent, planning, and method. Inputs exceeding a development-set threshold were flagged as containing SI. The selected model was evaluated on a held-out test set and benchmarked against four open-weight generative language models under zero-shot prompting.
Results: The Light fine-tuning configuration was selected for its strong performance and better preservation of the embedding space’s broader semantic structure. On the held-out test set, it achieved precision 0.91, recall 0.92, specificity 0.92, F1 0.91, and accuracy 0.92. A stricter threshold raised precision to 0.98 but lowered recall to 0.34. This trade-off informed a proposed workflow in which high-confidence detections trigger an immediate supportive response and crisis resources, while intermediate scores prompt clarification and re-evaluation. The system performed comparably to Phi-4 (accuracy 0.93, F1 0.92) while using roughly one-eighteenth of its storage and fewer than one-hundredth of its parameters.
Conclusion: These findings demonstrate the technical feasibility of a computationally efficient, domain-grounded approach for SI detection in informal text. Keeping the decision logic separate from the encoder makes the system auditable and allows the flagging criteria to be inspected and iteratively refined. Prospective evaluation using contextually representative chatbot conversations is required before deployment, including assessment of missed disclosures, user acceptability, and clinical governance.
Related
- A comparative analysis of machine learning, deep learning, and ensemble learning models for suicidal ideation detection on social media
- Timing Is Everything: Modeling the Temporal Dynamics of Suicidal Ideation
- Functional connectivity of anterior cingulate cortex subregions in suicidal ideation in major depression: circuit mechanisms, exploratory classification, and treatment-related changes.
- Association Between Suicidal Ideation and Negative Affect: 6-Month Ecological Momentary Assessment Study
- Development and evaluation of a multiplex PCR for simultaneous detection of Mycobacterium tuberculosis complex, Mycobacterium avium complex, and Burkholderia pseudomallei in clinical specimens
BibTeX
@misc{olisaeloka2026aibased,
title = {{AI-based detection of suicidal ideation in text: model development and evaluation for a student mental health chatbot}},
author = {Lotenna Olisaeloka and Leonard Ruocco and Richard Munthali and Melissa Vereschaagin and Yuqian Zhuang and Angel Wang and Tiana Mori and Chris Richardson and Kristen Hudec and Daniel Vigo},
howpublished = {PsyArXiv},
year = {2026},
month = sep,
doi = {10.31234/osf.io/kdf2z_v2},
url = {https://osf.io/preprints/psyarxiv/kdf2z_v2/},
note = {CC BY 4.0},
}
RIS
TY - UNPB
TI - AI-based detection of suicidal ideation in text: model development and evaluation for a student mental health chatbot
AU - Lotenna Olisaeloka
AU - Leonard Ruocco
AU - Richard Munthali
AU - Melissa Vereschaagin
AU - Yuqian Zhuang
AU - Angel Wang
AU - Tiana Mori
AU - Chris Richardson
AU - Kristen Hudec
AU - Daniel Vigo
PY - 2026
DA - 2026/09/18
PB - PsyArXiv
DO - 10.31234/osf.io/kdf2z_v2
UR - https://osf.io/preprints/psyarxiv/kdf2z_v2/
AB - Background: Conversational digital mental health interventions (DMHIs) require mechanisms for recognizing expressions of suicidal ideation (SI) and initiating appropriate safety responses. Artificial intelligence (AI)-based detection approaches could provide a scalable safeguard; but systems designed for real world deployment must consider accuracy alongside computational efficiency, transparency, and appropriate response pathways. Methods: We developed a lightweight SI-detection system for integration into Minder, a mental health chatbot intervention for students. The detection pipeline combined a fine-tuned Sentence-BERT (SBERT) encoder with a nonparametric, anchor-based decision layer. The encoder was trained on 220,833 sentence-level text samples from public social media datasets. Fine-tuning used partial unfreezing and Batch-All Triplet Loss, with three configurations (Light, Medium, Heavy) compared on a development set. Each text input was encoded as 768-dimensional embeddings, then compared, using cosine similarity, against an expert-curated reference set of statements spanning suicidal ideation, intent, planning, and method. Inputs exceeding a development-set threshold were flagged as containing SI. The selected model was evaluated on a held-out test set and benchmarked against four open-weight generative language models under zero-shot prompting. Results: The Light fine-tuning configuration was selected for its strong performance and better preservation of the embedding space’s broader semantic structure. On the held-out test set, it achieved precision 0.91, recall 0.92, specificity 0.92, F1 0.91, and accuracy 0.92. A stricter threshold raised precision to 0.98 but lowered recall to 0.34. This trade-off informed a proposed workflow in which high-confidence detections trigger an immediate supportive response and crisis resources, while intermediate scores prompt clarification and re-evaluation. The system performed comparably to Phi-4 (accuracy 0.93, F1 0.92) while using roughly one-eighteenth of its storage and fewer than one-hundredth of its parameters. Conclusion: These findings demonstrate the technical feasibility of a computationally efficient, domain-grounded approach for SI detection in informal text. Keeping the decision logic separate from the encoder makes the system auditable and allows the flagging criteria to be inspected and iteratively refined. Prospective evaluation using contextually representative chatbot conversations is required before deployment, including assessment of missed disclosures, user acceptability, and clinical governance.
ER -