
With the rapid proliferation of digital environments—including online learning, remote work, and virtual collaboration—sustaining human attention has become a growing challenge. This paper presents an AIpowered real-time attention monitoring system that employs computer vision techniques for non-intrusive assessment of user focus levels. The system utilises MediaPipe Face Mesh for facial landmark detection and OpenCV for video processing, computing the Eye Aspect Ratio (EAR) to detect blinks and employing gazetracking algorithms to determine gaze direction. An adaptive attention score, ranging from 0 to 100, is dynamically computed based on blink frequency, gaze deviation, and prolonged eye closure. When the score falls below a configurable threshold, the system activates audio-visual alerts to prompt the user to refocus. A Flask-based web interface with SQLite-backed session management facilitates user authentication and session analytics. Experimental results indicate blink detection accuracy of approximately 95%, gaze detection accuracy of approximately 92%, and sub-100 ms per-frame processing latency. The proposed system demonstrates that open-source, webcam-based tools can deliver practical, cost-effective attention monitoring applicable across educational, corporate, healthcare, and automotive safety domains.
