Model Card: Vigilance AI - Driver Eye State Classifier
Model Summary
This model is a high-performance Ocular State Classifier developed as part of the Vigilance AI suite. It is designed to distinguish between "Open" and "Closed" eyes in real-time to detect driver drowsiness and microsleep events. By leveraging the MobileNetV2 architecture, the model achieves industrial-grade accuracy while maintaining the ultra-low latency required for automotive safety applications.
Developer: Abdullah, Salman Shah, Sheheryar Ilyas
Task: Binary Image Classification (Ocular State)
Base Architecture: MobileNetV2 (Transfer Learning)
Classes: Closed, Open
Validation Accuracy: ~90%+
Technical Specifications
Architecture & Modification
The model utilizes a MobileNetV2 backbone, chosen for its Depth-wise Separable Convolutions which significantly reduce computational load without sacrificing depth.
Input Shape: 224 x 224 x 3 (RGB)
Freezing Strategy: The first 100 layers were frozen to utilize pre-trained ImageNet weights for general feature extraction.
Custom Head:
Global Average Pooling: Redimensionalization of spatial features.
Dense Layer: 128 neurons with ReLU activation.
Dropout: 0.5 (50%) to ensure robustness against overfitting.
Output Layer: Softmax/Dense layer for binary probability distribution.
Training Logic
Dataset: Merged high-variance dataset including the MRL Eye Dataset, consisting of thousands of samples featuring various ethnicities, lighting conditions, and ocular occlusions (e.g., glasses).
Optimization: Adam Optimizer with a phased learning rate approach (starting at 1e^−4 and fine-tuning at 1e^−5).
Data Augmentation: To simulate real-world driving shifts, images were randomly rotated, zoomed, and horizontally flipped during training.
Performance Metrics
Metric Value
Accuracy 90.27%
Inference Time < 10ms (CPU)
Framework TensorFlow / Keras
Intended Use
Drowsiness Detection Systems: The core component for triggering "Wake Up" alarms.
Human-Computer Interaction (HCI): Gaze tracking and eye-state triggers.
Fatigue Research: Analyzing blink duration and ocular patterns in high-stress environments.
How to Use
You can implement this model in Python using TensorFlow:
import tensorflow as tf
import numpy as np
model = tf.keras.models.load_model("eye_classifier.h5")
def check_eye(image_crop):
# Preprocess to match training specs
img = cv2.resize(image_crop, (224, 224))
img = img.astype("float32") / 255.0
img = np.expand_dims(img, axis=0)
prediction = model.predict(img)
state = "Closed" if np.argmax(prediction) == 0 else "Open"
return state
Limitations
Occlusions: Very dark or reflective sunglasses may hinder the accuracy of the underlying landmark detector used to crop the eye region.
Extreme Darkness: Standard RGB cameras may struggle in pitch-black cabins; performance is optimal when paired with an IR-sensitive camera or cabin lighting.
About the Project
This model is a pillar of the Vigilance AI project, which combines deep learning classification with geometric EAR (Eye Aspect Ratio) math to provide a redundant, fail-safe safety shield for modern drivers.