FocusLock

Inspiration

Every student knows the struggle — you sit down to study, and within minutes, focus drifts. Every teacher knows the frustration — running fair online exams feels impossible.

We wanted to fix both. FocusLock was inspired by the idea that awareness > control. Instead of building another strict proctoring tool, we wanted an AI that understands attention — one that helps students build discipline and helps teachers uphold fairness, calmly and transparently.


What It Does

FocusLock uses your webcam to track subtle behavioral cues — eye movement, head direction, and phone presence — to calculate a real-time focus score.

For students: It’s a digital mirror that shows when your mind drifts, helping you build concentration over time. For teachers: It detects cheating cues and phone use during online exams, ensuring fairness for everyone.

It’s not surveillance — it’s awareness.

How We Built It

We built the backend with FastAPI, integrating:

  • MediaPipe FaceMesh for real-time facial landmarks and head-pose estimation
  • YOLOv5 for phone and object detection
  • WebSockets for live video frame streaming from the browser to the backend

Each frame is analyzed and scored in real time using a custom smoothing algorithm:

[ \text{FocusScore}_t = \alpha \cdot \text{FocusRaw}t + (1 - \alpha) \cdot \text{FocusScore}{t-1} ]


Challenges We Ran Into

  • Running heavy CV models like MediaPipe and YOLO in real time without crashing the browser.
  • Streaming video frames via WebSockets efficiently enough to handle real-time inference.
  • Maintaining smooth focus score transitions that feel natural, not robotic.

Balancing all this in a single web app — with minimal lag and high reliability — was a huge engineering challenge.


Accomplishments We’re Proud Of

  • Built a fully working prototype that runs computer vision models and live feedback in the browser.
  • Created a real-time focus scoring system that feels intuitive and stable.
  • Designed a dual-purpose system that helps both students and teachers — bridging personal growth and educational integrity.

What We Learned

We learned how to simplify complex AI systems for real-time web use. We learned that building focus isn’t about restriction — it’s about reflection. And that smooth user experience is just as hard — and important — as model accuracy.


What’s Next for FocusLock

  • Turning it into a browser extension and mobile SDK for schools and learners.
  • Adding LLM integration to give personalized focus insights (“You lose focus after 8 minutes — try shorter sprints”).
  • Expanding detection to posture, emotion, and engagement — creating a true AI study companion.

Built With

  • elevenlabs
  • fastapi
  • mediapipe
  • react
  • yolov
Share this project:

Updates