The client is an ed-tech platform offering digital learning content and online assessments. With the shift to remote learning, the platform faced challenges in ensuring student engagement and preventing cheating during online exams. The client sought a real-time attention-tracking solution to improve academic integrity and optimize content delivery.

What Client Needed
-
Monitoring and quantifying student attention during digital content consumption and assessments.
-
Preventing cheating by detecting suspicious behaviors in real time.
-
Providing actionable insights for content creators to optimize educational materials.
-
Ensuring scalability, user privacy, and minimal system resource usage for seamless integration into the existing platform.
Tools & Technologies
OpenCV
MediaPipe
Dlib
TensorFlow Lite
Scikit-learn
Python (Flask)
FastAPI
PostgreSQL
Firebase
WebRTC
Key Business Challenges
The client faced several challenges that impacted the efficacy of their online learning platform
Lack of Student Focus:
Students struggled to maintain attention during prolonged exposure to digital learning content, such as video lectures and interactive modules, leading to reduced knowledge retention and poor academic performance.
Academic Dishonesty in Online Exams:
Students struggled to maintain attention during prolonged exposure to digital learning content, such as video lectures and interactive modules, leading to reduced knowledge retention and poor academic performance.
Ineffective Content Delivery:
Without insights into student engagement, content creators struggled to optimize videos and training materials, resulting in lower course completion rates.
Scalability and Real-Time Monitoring:
The platform required a solution that could scale to monitor thousands of users simultaneously while providing real-time feedback without significant latency.
What We Built?
The implemented solution uses computer vision and machine learning to track student engagement via their webcam.
Head Pose Estimation
- MediaPipe Face Mesh (by Google) is used to detect 468 facial landmarks, enabling precise head pose estimation.
- OpenCV processes the video feed and applies geometric transformations to compute: Pitch (nodding up/down), Yaw (turning left/right), Roll (tilting head sideways)
- A 3D head model is fitted to the detected landmarks, and Perspective-n-Point (PnP) algorithm calculates the head’s orientation relative to the camera.
Eye Gaze Tracking
- dlib’s facial landmark detector identifies 68 key facial points, with specific points around the eyes (e.g., eyelids, pupils).
- Eye Aspect Ratio (EAR) is calculated to detect blinks: If EAR < threshold for a few consecutive frames → Blink detected.
- Gaze direction is estimated by tracking the iris position relative to eye corners. Using a pre-trained CNN (Convolutional Neural Network) to predict gaze vectors.
Real-Time Monitoring (30 FPS Processing)
- TensorFlow Lite (TFLite) is used for optimized ML inference on edge devices (e.g., student laptops).
- Multi-threading in Python ensures one thread captures webcam frames and another thread processes them via OpenCV + MediaPipe/dlib.
- Frame skipping (if processing is slow) ensures real-time performance.
Attention Scoring
- A time-weighted scoring algorithm computes Focus % = (Time looking at screen) / (Total session time).
- Distraction events are logged when Head yaw/pitch exceeds a threshold (e.g., >30° away from screen). Eyes are detected looking off-screen for >2 seconds.
- Session summary includes average attention span and distraction frequency.
Cheating Detection
- Multiple faces (indicating impersonation).
- Frequent head turns (suggesting looking at notes).
- Unusual eye movements (e.g., rapid shifts, prolonged off-screen gaze).
- Keyboard/mouse inactivity (possible use of another device).
People choose us because we serve the best for everyone
The client faced several challenges that impacted the efficacy of their online learning platform:
Lack of Student Focus
Students struggled to maintain attention during prolonged exposure to digital learning content, such as video lectures and interactive modules, leading to reduced knowledge retention and poor academic performance.
Academic Dishonesty in Online Exams
The rise of remote learning increased instances of cheating, such as looking at unauthorized materials or collaborating with others during assessments, compromising academic integrity.
Ineffective Content Delivery
Without insights into student engagement, content creators struggled to optimize videos and training materials, resulting in lower course completion rates.
Scalability and Real-Time Monitoring
The platform required a solution that could scale to monitor thousands of users simultaneously while providing real-time feedback without significant latency.
Business Impact
-
Reduced Cheating Incidents
40% decrease in suspicious activities during online exams.
-
Improved Engagement Metrics
25% increase in average attention span per session.
-
Automated Proctoring
Eliminated the need for manual invigilation, saving costs.
-
Data-Driven Content Optimization
Instructors refined videos based on attention heatmaps.

Conclusion
The implementation of a webcam-based attention and motion tracking system significantly improved student engagement and academic integrity on the EdTech platform. By providing real-time monitoring and actionable analytics, the solution empowered educators to identify disengaged students, deter cheating, and refine digital content for maximum impact. The privacy-first, browser-based design ensured user trust while delivering robust, scalable monitoring capabilities for a modern digital learning environment.
Turning Tech Challenges into Solutions!
Contact Us Now