Cognitive Monitoring System.
An ML platform that reads keystrokes, mouse drift, and idle patterns to predict stress in real time.
Most stress-detection tools need a wearable or a clinical setting. I wanted something that could read a developer or student's cognitive state from signals they already generate — typing rhythm, mouse micro-movements, idle windows — and surface it as a trend they can act on before burnout lands.
Built a lightweight event-collector that runs in the browser and timestamps keystrokes, mouse trajectories, scroll bursts, and idle gaps at ~30Hz.
Aggregated events into rolling features (flight time, dwell, jitter, idle ratio) and pushed them through a feature pipeline that normalises per-user baselines — so a fast typist isn't labelled 'stressed' just because they type fast.
Trained a gradient-boosted classifier on a labelled session dataset to predict a 0–100 stress score in 60s windows, with confidence bands the UI can display honestly.
Wrapped it in a React dashboard with trend lines, weekly heatmaps, and 'quiet hours' suggestions. Backend on Node + Express, persistence on PostgreSQL, model served as a small Python sidecar.
Per-user baselines, not absolute thresholds
Typing 120wpm calmly is not the same as typing 120wpm under pressure. We normalise each feature against a rolling 14-day baseline so the model reads change, not raw speed.
Confidence bands, not point estimates
A stress score without uncertainty is dangerous — people anchor to it. We surface 80% confidence intervals and the UI visibly shrinks when confidence is low.
Browser capture, not OS-level hooks
Anything that needs a native agent or accessibility permission kills adoption. Browser events get us 85% of the signal with zero install friction.
↳ TODO_1I'd add an opt-in 'focus mode' that doesn't just log — it actively mutes notifications when the stress trend crosses a threshold, and lets the user override with a reason.
↳ TODO_2The model is biased toward my own session patterns. Real product would need a small labelled corpus from diverse users and a periodic recalibration loop.