/work/focuslens
AmanShah
Brief
amanashishshah@gmail.com

© 2026 Aman Shah

Recruiter mode

Self-directed

Work/

FocusLens

FocusLens, at a glance

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.

Role

  • ML systems engineer
  • end-to-end pipeline design

Elsewhere

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.

FocusLens, image 2

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.

FocusLens, image 4
FocusLens, image 4

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.

Outcome

Real-time on-device monitor running MediaPipe face and body landmarks at ~104 FPS, driving a learned temporal classifier and a survival model that fires a pre-emptive nudge a median ~22 seconds before drift.