Inspiration
India loses 13 students to suicide every single day. That number stopped us cold.
What made it worse was learning that 80% of those students showed clear behavioral warning signs 7–10 days before their crisis peaked — disrupted sleep, social withdrawal, reduced mobility, changes in phone usage. The signals were there. Nobody was watching.
Every existing solution requires the student to recognize their own crisis and reach out — therapy apps, counselor appointments, crisis lines. But when someone is spiraling into depression, self-awareness is exactly what disappears first. We needed something that watches for them, not with them.
The phone in every student's pocket is an untapped sensor network. We decided to build the AI that turns it into a silent guardian.
What it does
CrisisSignal is a passive, on-device AI early-warning system that detects student mental health crises 5–7 days before they peak — with zero active effort from the student.
It silently monitors 5 behavioral signals already present on any Android phone:
- Sleep pattern disruption (91% correlation with depression)
- Social withdrawal (78%)
- Typing error rate spikes (71%)
- GPS mobility reduction (65%)
- Call/SMS frequency drops (58%)
A personalized LSTM Autoencoder trains on each student's own 30-day behavioral baseline. Anomaly = deviation from their normal, not a population average. When the reconstruction error crosses a learned threshold, the risk scorer activates a tiered intervention:
| Risk Score | Action |
|---|---|
| > 40 | Compassionate mood check-in pushed to device |
| > 65 | Counselor dashboard alert sent automatically |
| > 80 | iCall / Vandrevala helpline connection initiated |
Zero cost. Zero hardware. Zero data leaves the device. The model runs entirely on-device via TorchScript — 139 KB, int8 quantized, works on any Android phone.
How we built it
We built a full 4-phase ML pipeline from scratch:
Phase A — Data Preprocessing (preprocess.py)
Loaded the Dartmouth StudentLife dataset (49 students, 10 weeks, 5 sensor modalities). Parsed sleep EMA JSONs, conversation CSVs, GPS traces, accelerometer data, and phonelock logs. Resampled to daily intervals, forward-filled missing values, fitted a MinMaxScaler, and built 30-day sliding windows → X_train.npy (1,455 × 30 × 5).
Phase B — LSTM Autoencoder Training (train_lstm.py)
Built a sequence-to-sequence LSTM Autoencoder in PyTorch 2.6 (switched from TensorFlow due to a confirmed DLL crash on Python 3.13 Windows). Architecture: LSTM(64) → LSTM(32) → latent bottleneck → LSTM(32) → LSTM(64) → Linear(5). Trained exclusively on healthy samples (label=0) — the autoencoder learns normal behavior, so high reconstruction error = anomaly. Used early stopping + ReduceLROnPlateau. Found the optimal MSE threshold via F1-max sweep across the full dataset.
Phase C — Model Export (export_tflite.py)
Applied dynamic int8 quantization via torch.quantization.quantize_dynamic, then traced with torch.jit.trace to produce a portable TorchScript .ptl file (139.7 KB — 61% smaller than the float32 checkpoint). Verified inference with test tensors.
Phase D — Streamlit Dashboard (app.py)
Built a live risk visualization dashboard with a 7-day behavioral drift chart, tiered intervention engine, SHAP-style feature contribution bars, and real-time risk scoring. Deployed to Streamlit Cloud: crisissignal.streamlit.app
Tech stack: Python 3.13, PyTorch 2.6, TorchScript, Scikit-learn, Pandas, NumPy, Streamlit, Plotly.
Challenges we ran into
TensorFlow on Python 3.13 — Our original plan used TensorFlow/Keras. Two hours into Phase B, we hit a confirmed DLL initialization crash with TF on Python 3.13 Windows. We pivoted the entire ML backend to PyTorch mid-build without changing the architecture or losing any training logic. The output quality actually improved.
StudentLife dataset quirks — The real dataset has non-obvious column names (activity inference with a leading space), GPS stored as index-column epoch timestamps, and Sleep EMA answers stored under a JSON key literally called "null". Every sensor needed custom parsing logic.
Autoencoder threshold calibration — Training only on healthy samples means the threshold separating "normal reconstruction error" from "anomaly" isn't obvious. We swept every percentile from P5 to P95 and selected the threshold that maximized F1 across the full labeled dataset — landing at MSE = 0.01152.
Streamlit HTML rendering — The custom PPT-matched UI used complex CSS (flexbox, CSS grid, letter-spacing, nested containers) that Streamlit's HTML sanitizer stripped completely. Solved by routing all complex components through st.components.v1.html() which renders in a true sandboxed iframe the sanitizer cannot touch.
Accomplishments that we're proud of
- 86% healthy precision and 77% overall accuracy on the real Dartmouth StudentLife dataset — not synthetic data, not cherry-picked splits.
- A 139 KB deployment model that runs entirely on-device with no internet connection, no cloud server, and no ongoing infrastructure cost.
- The complete pipeline — from raw sensor CSVs to a deployed live demo — built end-to-end and fully reproducible with four
pythoncommands. - A privacy architecture where no personal data ever leaves the student's phone. Risk scores are ephemeral. No profiling. No surveillance. Federated learning ready.
- A working live prototype at crisissignal.streamlit.app that judges can interact with right now.
What we learned
The hardest part of building mental health AI isn't the model — it's the ethics. Every design decision forced a tradeoff between utility and safety. We learned to ask "who could this harm?" before "how accurate is this?"
We learned that anomaly detection is often the right framing for sensitive healthcare AI — training only on healthy behavior means we never had to label or model "what depression looks like," which avoids encoding clinical bias into the model.
We learned that the Dartmouth StudentLife dataset, while small (49 students), is remarkably rich — and that with the right feature engineering and personalized baselines, even a lightweight LSTM can surface meaningful behavioral signals.
And we learned that shipping matters. A 77% accurate model that is actually deployed and usable saves more lives than a 95% accurate model that never leaves a Jupyter notebook.
What's next for CrisisSignal
3 months: IRB-approved pilot with 2–3 colleges in India. Integrate iCall API for real counselor routing. Add federated learning so the global model improves anonymously across devices without any raw data sharing.
12 months: Android app on Play Store. Ministry of Education and NAAC partnership for institutional deployment. B2B college subscription model (₹5,000/month per institution) funds infrastructure while keeping the student-facing app permanently free.
Long term: 750 million Android smartphones in India. Zero marginal cost per new user. Every student who installs it gets a silent guardian — the phone they already carry, watching for the signs they can't see themselves.
Log in or sign up for Devpost to join the conversation.