Annotated Drowsiness Detection Dataset Captured Using Raspberry Pi 5
Description
Research Hypothesis: This study hypothesizes that drowsiness can be accurately detected in real-time through computer vision analysis of facial features, specifically eye closure patterns and yawning behavior, using affordable edge computing devices like the Raspberry Pi 5. Data Collection Methodology: The dataset was recorded using a Raspberry Pi 5 equipped with a Camera Module 3. All recordings were captured at a consistent frame rate of 30 frames per second (FPS) and a resolution of 640×480 pixels, utilizing H.264 compression for video encoding. The recordings cover various lighting conditions with differing lux levels to simulate real-world scenarios ranging from low-light conditions (e.g., nighttime environments) to bright daylight settings. Dataset Composition and Labeling: The dataset includes labeled categories essential for training and testing machine learning models. Labeling was performed using Edge Impulse, with the following categories: Open Eyes: 968 training samples, 225 testing samples (Total: 1,193) Closed Eyes: 158 training samples, 49 testing samples (Total: 207) No Yawning: 496 training samples, 124 testing samples (Total: 620) Yawning: 60 training samples, 12 testing samples (Total: 72) Video-wise Annotation Data: The dataset also contains detailed video-wise annotations for testing purposes: Open Eyes (mata_terbuka): 30,922 testing samples Closed Eyes (mata_tertutup): 4,662 testing samples No Yawning (tidak_menguap): 16,877 testing samples Yawning (menguap): 1,019 testing samples Notable Findings: The data reveals a significant class imbalance, with open eyes representing 85.4% of image samples and 86.9% of video samples, while yawning behavior accounts for only 5.2% of image samples and 5.7% of video samples. This distribution reflects natural human behavior patterns where drowsiness indicators occur less frequently than alert states. Data Interpretation and Usage: This dataset can be used to train machine learning models for drowsiness detection applications, particularly in automotive safety systems or workplace monitoring. The class imbalance should be addressed through appropriate sampling techniques or weighted loss functions during model training. The multi-modal nature of the data (both image-based and video-based annotations) allows for both static image classification and temporal sequence analysis approaches. Researchers should consider the lighting condition variations when evaluating model performance across different deployment scenarios.
Files
Steps to reproduce
1. Dataset Collection and Preparation Collect images of drivers using Raspberry Pi 5 camera module Capture images under varying lighting conditions (28, 45, 86, 615 lux, and 0 lux with IR) Include diverse subjects (male/female) with various accessories (hats, glasses, hijabs) Capture from two camera angles (Position A and B as shown in Figure 4) Label images into 4 categories: open eyes, closed eyes, yawning, not yawning 2. Data Preprocessing Resize images to three standard resolutions: 96×96, 140×140, and 200×200 pixels Convert images to grayscale format Apply fit-short resize mode for consistent aspect ratio 3. Model Training Setup Use Edge Impulse platform as TinyML framework Configure FOMO (Faster Objects, More Objects) algorithm Split dataset: 60% training, 20% validation, 20% testing Training parameters: Color depth: Grayscale (1:32 layers) Epochs: 40 Learning rate: 0.001 Batch size: 32 4. Model Optimization Apply full quantization techniques Generate both F32 (floating-point) and I8 (quantized) model versions Export optimized models for edge deployment 5. Deployment and Testing Deploy models on Raspberry Pi 5 (8GB RAM) with Camera Module 3 Test inference performance at 30 FPS, 640×480 resolution with H.264 compression Measure inference time and frames per second (FPS) for each model configuration Conduct real-world testing under different lighting conditions and camera positions 6. Performance Evaluation Calculate accuracy, precision, recall, and F1-score using standard formulas Compare F32 vs I8 model performance Test PERCLOS calculation for drowsiness detection validation Record inference times and FPS for real-time performance assessment 7. Hardware Requirements Raspberry Pi 5 (8GB RAM) Camera Module 3 IR LED (850nm) for low-light conditions Edge Impulse development environment 8. Data Analysis Analyze performance across different input resolutions Compare results with baseline methods (CNN, YOLOv5s) Evaluate impact of lighting conditions on detection accuracy Assess influence of accessories and camera angles on system performance
Institutions
Categories
Funding
Bina Nusantara University