← Back to projects

Mental health

Mental health crisis triage

Seven-class Bi-LSTM early-warning system for online mental health crises: Suicidal, Depression, Anxiety, Bipolar, Stress, Personality Disorder, and Normal.

NLP Safety-first 7-class risk

Kat Zhang

Why this project

This project is deeply personal. Having navigated my own mental health journey from a young age, I understand the isolation of struggling without resources or a support system. My personal experiences with mental health have shown me that timely intervention is everything. This motivated me to ask: Can we teach machines to recognize distress before a crisis occurs? This project represents the convergence of my technical expertise and my passion for mental health advocacy. By engineering a deep learning solution (Bi-LSTM) that accounts for clinical nuance, this model doesn't just process text; it recognizes the nuanced cry for help hidden in everyday language. With this project, I aimed to create a tool that empowers platforms to protect their most vulnerable users. This project proves that AI can be more than just a business tool: it can be a lifeline for those who need it most.

Bi-LSTM Class weighting Safety review

Project summary

Deep learning NLP triage that classifies text into seven clinical risk profiles: Suicidal, Depression, Anxiety, Bipolar, Stress, Personality Disorder, or Normal. Trained on anonymized social media posts, forum threads, and diary entries. Built for early warning to enable targeted interventions in real time.

Bi-LSTM architecture with 100-d embeddings and 128 hidden units (50-token max length), trained 15 epochs with inverse-frequency loss to counter data imbalance. Achieved 74% test accuracy (vs 14% random), recalling Suicidal at 0.62 and Depression at 0.66.

Highlights

  • Seven-class, safety-first triage with granular diagnostic context beyond simple sentiment.
  • Bi-LSTM learns semantic order (e.g., “I am not happy” vs “I am happy”) for accurate risk labeling.
  • Inverse-frequency loss combats imbalance (e.g., 16k Normal vs 1.2k Personality Disorder).
  • Performance: 74% test accuracy; Recall — Suicidal 0.62, Depression 0.66.
  • Supports proactive interventions: hotline alerts for high risk, mindfulness tips for lower risk.

Business problem

Provide scalable, proactive mental health triage so platforms and telehealth teams can flag at-risk users early and route human review where it matters most.

Results

Findings: Achieved 74% test accuracy and strong recall on high-risk classes (Suicidal 0.62, Depression 0.66). Live test on “I feel like there is no point in going on...” correctly ranked Suicidal (72.8%) with Depression (22.8%) as secondary, reflecting learned comorbidity.

Tech stack

  • Python
  • PyTorch
  • pandas
  • NumPy

Analytics & methods

  • Bi-LSTM
  • 100-d embeddings
  • Class-weighted loss
  • Confusion matrix
  • Data imbalance analysis

Download a PDF with all references used for this project.

Download references