Self-directed
FocusLens

ML systems
on-device
Project overview
On-device webcam attention-theft detector
Watches you through your laptop camera, learns your personal signature of losing focus, and nudges you ~20 seconds before you consciously notice you've drifted. Everything runs locally, no frame ever leaves the machine.
Date
2026
Field
AI / ML
Stack
Python, PyTorch, MediaPipe, OpenCV, NumPy
~104 FPS on-device
C-index 0.83 timing model
~135 tests
FocusLens
Context
Built as a walking-skeleton ML system: a full heuristic pipeline first, then each box independently swapped for a real ML model behind the same interface.

Knowing you're distracted isn't enough, you want a nudge before you drift.
The hard part
FocusLens treats focus loss as something it can learn per-user and predict ahead of time, fully on-device.


What it took
- Replaced a heuristic classifier with PersonalFocusNet, a Conv1d plus temporal-attention model with a heteroscedastic uncertainty head, trained on self-supervised labels that back-date distraction onset 20s before the user's keypress.
- Cut catastrophic forgetting from 69% to 0.7% across 10 sessions using EWC plus reservoir experience replay.
- Built a per-user gaze calibration that drops a shifted user's error from 24.6° to 0.9°, and a Cox proportional-hazards model that times interventions before drift.



