Skip to content
Back to Projects
Hackathon2023

MindWave

Real-Time AI Mental Health App

Can a hybrid ML model detect stress states accurately enough for clinical-grade mobile deployment?

94%

Stress Prediction Accuracy

<500ms

API Response Time

+35%

User Engagement Boost

1000+

Teams Defeated

01. The Problem

Mental health remains severely underserved globally — most people experiencing stress never access professional support. Existing mental health apps rely on self-reporting, which is subject to recall bias and social desirability effects. We asked: can passive physiological and behavioral signals predict stress states with clinical-grade accuracy on a consumer mobile device?

02.Why It's Hard

Stress is a multi-dimensional construct — physiological (heart rate, galvanic skin response), cognitive (self-report), and behavioral (app usage patterns). Models trained on any single modality generalize poorly. On mobile, you're constrained to accelerometer, camera-derived heart rate (rPPG), and interaction logs — indirect proxies that require careful feature engineering to be predictive.

03.Our Approach: Hybrid TensorFlow + scikit-learn Pipeline

A two-model ensemble: a TensorFlow deep learning model processes time-series physiological signals (accelerometer, rPPG-derived heart rate) via a 1D CNN + LSTM; a scikit-learn gradient-boosted model handles tabular behavioral features (session frequency, response latency, self-report scores). Both models output probability distributions over stress levels which are combined via a calibrated ensemble. TensorFlow Serving handles async REST inference; the Flutter client caches predictions locally for offline access.

Architecture — Mobile sensor collection → TF Serving inference → ensemble scoring → Flutter UI with Firebase Analytics.

  1. 1.Flutter app collects accelerometer data + camera-derived rPPG at 30Hz
  2. 2.Behavioral features extracted: session frequency, tap latency, self-report inputs
  3. 3.Physiological time-series processed by TF 1D CNN + LSTM model (TensorFlow Serving)
  4. 4.Behavioral features scored by scikit-learn gradient-boosted classifier
  5. 5.Calibrated ensemble combines both model outputs → stress level prediction
  6. 6.Results logged to Firebase Analytics; Flutter UI displays personalized stress trend dashboard

04. Key Results

  • 94% accuracy in stress prediction validated via 5-fold cross-validation (TensorFlow + scikit-learn hybrid model)
  • TensorFlow Serving deployment with async processing: <500ms response time
  • Flutter mobile app (Android/iOS) with Firebase Analytics: 35% higher user engagement
  • Overall Winner — The Ultimate Hackathon 2023, CII Yi YUVA (1000+ teams, ₹25,000)
MethodAccuracy
Self-report only (baseline)71%
Physiological signals only (TF model)87%
Hybrid ensemble (ours)← ours94%

05.What I Learned & Open Questions

  • rPPG (camera-derived heart rate) quality degrades sharply under poor lighting — the model needed lighting condition detection to selectively trust or drop these signals.

  • Calibrated probabilities (Platt scaling) matter more than raw accuracy in mental health contexts — a model that is 94% accurate but overconfident at the extremes can cause harm.

  • Open question: How does the model generalize across cultural contexts where stress expression patterns differ significantly?

06. Tech Stack

TensorFlowFlutterFirebaseREST APIMobile AIscikit-learn

07. Artifacts