EyeQAI is a real-time AI-based monitoring system that detects user alertness using computer vision and deep learning techniques.
It classifies user state into:
- Focused — eyes open, head forward
- Drowsy — prolonged eye closure
- Inattentive — head turned away
- Hybrid AI detection (CNN + EAR + Head Pose)
- Real-time webcam monitoring
- Frame smoothing to reduce false positives
- Attention score calculation
- REST API for metrics and logs
EyeQAI combines three signals for robust detection:
- CNN Model (ResNet50) → Eye state classification
- EAR (Eye Aspect Ratio) → Detects eye closure
- Head Pose (Yaw Angle) → Detects distraction
Final output is stabilized using frame smoothing (3 consecutive frames) to avoid sudden spikes.
EyeQAI/
└── app/
├── app.py
├── detection.py
├── train_model.py
├── utils.py
├── requirements.txt
├── templates/
├── static/models/,data/, andvenv/are excluded from GitHub due to size limitations.
cd app
python -m venv venv
venv\Scripts\activate # Mac/Linux: source venv/bin/activate
pip install -r requirements.txtpython train_model.pyThis will generate the trained model inside the models/ folder.
python app.pyOpen in browser: 👉 http://localhost:5000
- Root Directory →
app - Build Command
pip install -r requirements.txt- Start Command
python app.pyvenv.
| Endpoint | Description |
|---|---|
/video_feed |
Live webcam stream |
/metrics |
Real-time detection data |
/logs |
Event history |
/summary |
Session summary |
/health |
System health |
| Condition | Output |
|---|---|
| EAR < 0.22 | Drowsy |
| Yaw > 25° | Inattentive |
| Otherwise | Focused |
Frame smoothing ensures stable predictions across multiple frames.
- Large files (models, datasets) are excluded using
.gitignore - Model can be stored externally (Google Drive / cloud)
- System can run in EAR-only mode if model is not available
- Python
- OpenCV
- MediaPipe
- PyTorch / TensorFlow
- Flask
- Cloud-based model loading
- Multi-user analytics dashboard
- Mobile deployment