FocusGuard is an AI-powered Windows desktop application designed to help students stay focused during study sessions.
It uses real-time computer vision to monitor the user's study activity through a webcam and can detect signs of drowsiness, phone usage, and absence from the study area. When distraction is detected, FocusGuard provides an alert to help the user regain focus.
The application also tracks study sessions, focused time, distracted time, and focus scores to provide useful insights into study habits.
FocusGuard analyzes facial and eye activity through the webcam to detect when the user appears drowsy or keeps their eyes closed for too long.
A YOLO-based object detection system continuously monitors the camera feed and detects mobile phones during active study sessions.
FocusGuard can detect when the user leaves the study area and track that period as distracted time.
Audio alerts notify the user when drowsiness, phone usage, or other configured distractions are detected.
Users can create custom-duration study sessions and monitor their progress directly from the application.
During a session, FocusGuard tracks:
- Focused time
- Distracted time
- Session progress
- Focus score
Completed sessions are stored locally so users can review previous study activity.
FocusGuard provides analytics to help users understand their study consistency and focus performance over time.
Users can configure monitoring behaviour and application preferences according to their requirements.
FocusGuard can continue operating from the Windows system tray without occupying the desktop unnecessarily.
FocusGuard combines computer vision, machine learning, and desktop application technologies.
During an active focus session:
- The webcam captures frames in real time.
- MediaPipe analyzes facial and eye information.
- Eye behaviour is evaluated for signs of drowsiness.
- YOLO analyzes frames for mobile-phone presence.
- User presence is monitored for away detection.
- FocusGuard classifies periods as focused or distracted.
- Alerts are triggered when configured distraction conditions occur.
- Session statistics are recorded locally.
- The dashboard and analytics provide feedback about the completed study session.
| Technology | Purpose |
|---|---|
| Python | Core application development |
| PySide6 | Desktop graphical user interface |
| OpenCV | Webcam capture and image processing |
| MediaPipe | Facial and eye landmark processing |
| YOLO11 / Ultralytics | Mobile phone object detection |
| PyTorch | Machine-learning inference |
| PyQtGraph | Data visualization |
| SQLite | Local study-session storage |
| Pygame | Audio alert handling |
| PyInstaller | Windows application packaging |
Webcam
|
v
Frame Capture
|
+-------------------+
| |
v v
Eye / Face YOLO Phone
Detection Detection
(MediaPipe) (Ultralytics)
| |
+---------+---------+
|
v
Monitor Worker
|
+-------+-------+
| |
v v
Focus Analysis Alerts
|
v
Session Tracking
|
v
SQLite Database
|
v
Dashboard / Analytics
The easiest way to use FocusGuard is through the packaged Windows release.
- Open the latest FocusGuard release.
- Download
FocusGuard-Windows-v1.0.0.zip. - Extract the ZIP file.
- Open the extracted
FocusGuardfolder. - Run
FocusGuard.exe. - Allow camera access when required.
Do not move
FocusGuard.exeoutside its extracted folder because the application requires the bundled_internalfiles.
Download the latest Windows version from:
FocusGuard v1.0.0
GitHub Releases → v1.0.0
- Windows 10/11
- Python 3.11 recommended
- Webcam
Clone the repository:
git clone https://github.com/Rakshith-028/focusguard.git
cd focusguardCreate a virtual environment:
python -m venv venvActivate it on Windows:
venv\Scripts\activateInstall the required dependencies:
pip install ultralytics opencv-python mediapipe==0.10.21 pygame PySide6 pyqtgraphRun FocusGuard:
python app_qt.pyFocusGuard is designed as a local desktop application.
Webcam frames are processed for real-time monitoring and are not intended to be uploaded to an external server by the core application.
Study-session information is stored locally using SQLite.
This makes FocusGuard suitable for users who want computer-vision-based focus monitoring without requiring continuous cloud processing.
FocusGuard/
│
├── app_qt.py
├── monitor_worker.py
├── detector.py
├── phone_detector.py
├── yolo11n.pt
│
├── focusguard_release.spec
│
├── assets/
│ └── focusguard-dashboard.png
│
└── ...
The exact development structure may evolve as FocusGuard continues to improve.
Digital distractions are one of the biggest challenges during long study sessions.
Traditional timers can measure how long a session lasts, but they cannot determine whether the student is actually attentive.
FocusGuard explores a different approach by combining:
Study Timer + Computer Vision + Distraction Detection + Analytics
The goal is to make study sessions more measurable and help users become more aware of their focus patterns.
The first public Windows release includes:
- Real-time webcam monitoring
- Drowsiness detection
- Phone detection
- Away detection
- Audio distraction alerts
- Custom focus sessions
- Focused and distracted time tracking
- Focus score
- Study history
- Analytics
- Settings
- System tray support
- Packaged Windows application
Potential future improvements include:
- Improved phone-detection accuracy
- Additional distraction categories
- Advanced productivity analytics
- Weekly and monthly study reports
- Goal and streak tracking
- Performance improvements
- Additional customization options
- Optional AI-generated study insights
FocusGuard is a productivity and study-assistance project.
Its computer-vision detections are probabilistic and may occasionally produce false positives or false negatives depending on lighting conditions, camera quality, viewing angle, and environment.
It should not be used as a medical drowsiness detection or safety-critical monitoring system.
Rakshith
B.Tech – Artificial Intelligence & Machine Learning
GitHub: Rakshith-028
If you find FocusGuard useful, consider giving the repository a ⭐.
Bug reports, suggestions, and feedback are welcome through GitHub Issues.
A license has not yet been specified for this project.
All rights are reserved unless a license is added to the repository.
