· vision and sequences
Participants · LEIASantiago Saldaña Subías · Diego Perea León · Felipe Pacheco Zamorano · Alondra Lizeth Landín Vega · Josué Martínez Avendaño · Diego Alberto Pasaye González
Driver Attention and Vision Evaluator
DAVE studies how to recognize visual signals related to a driver’s state. A camera provides images; an extractor converts them into measurements of the eyes, mouth, head and gaze. A network gathers their recent evolution and chooses among three classes. The goal is to investigate an accessible and explainable reading of those signals, with clear limits on what an image can reveal.
- Project date
- Model used
- with
What it observes and what it predicts
MediaPipe estimates and a facial transformation. Instead of passing the pixels directly to the classifier, DAVE computes 18 values per time step. Some signals describe the current image; others summarize up to one minute of previous observations. The final label applies to the window, not to each gesture or to the person’s intent.
Eye opening is expressed with . Over a nominal period of about 30 seconds, the extractor collects a reference opening and then divides EAR by its . The closure count uses geometric EAR and a fixed threshold: and the “eyes closed” decision are separate operations.
Two vertical separations are compared with the width of the eye. Closing the eyelids reduces the ratio without changing the horizontal size of the diagram.
EAR = (‖p₂ − p₆‖ + ‖p₃ − p₅‖) / (2 ‖p₁ − p₄‖)
The six points illustrate the calculation; they do not belong to a recorded face and do not represent a prediction. The extractor uses the estimated coordinates and calibrates its reference opening.
| Group | Signals | Unit and history |
|---|---|---|
| Eyes · 7 | Left, right and mean EAR; ; blink rate and mean blink duration; EAR change | Ratios; closure proportion over 60 s; blinks/min; seconds; change per frame |
| Mouth · 2 | and mouth-open duration | Geometric ratio and consecutive frames |
| Head · 5 | , pose variation and head-nod count | Angles in degrees; of their magnitude over 1 s; count over 10 s |
| Gaze · 4 | , horizontal and vertical, gaze variation and averted proportion | Degrees; standard deviation of the magnitude over 1 s; proportion over 5 s |
Gaze is approximated from the position of the iris. “Averted gaze” means exceeding an angular threshold set in the extractor; it does not identify the road or the object being looked at. When the face is lost, the extractor generates preset values of averted pose and gaze: these can favor Distraction even though a missing face may also result from an occlusion or a detection failure.
How it aggregates the sequence
form a 90 × 18 matrix, about three seconds at 29.76 frames/s. normalizes the values of each time step inside the network. A two-layer traverses the window forward and backward, with 64 units per direction. Each time step is represented by 128 values.
learns to weight those 90 states. Their weighted sum yields a vector of 128 values; three of sizes 128, 64 and 3 produce the . The evaluator selects the highest score. According to these dimensions, the network has 183,975 .
- 90 × 18Extracted signals
- 90 × 18LayerNorm
Scale and shift - 90 × 128Bi-LSTM
2 layers, both directions - 128 valuesAttention: weights over
the 90 time steps - 3 scoresDense layers
128 → 64 → 3
eₜ = vᵀ (W hₜ + b) · αₜ = (e)ₜ · c = Σₜ αₜ hₜ
“Attention” has two meanings here: the state being classified and an aggregation mechanism of the network. The weights of that mechanism are not a measurement of human attention or a causal explanation of the label.
What it learns and from which data
Training combines , and . Phone use, drinking and other tasks from DMD and AUC are grouped into Distraction. The DMD-Drowsiness mapping assigns eye closures, yawns and microsleeps to Drowsiness. In UTA-RLDD, both “low vigilance” and “drowsy” are assigned to Drowsiness; the label comes from the state declared for the entire video. This simplification merges different signals and annotation criteria.
Windows advance by 15 frames and receive the majority label of their 90 records. Short clips are padded by repeating their last record. The procedure proposes sets in 70/15/15 proportions, by dataset and dominant class.
The loss is with weights inversely proportional to class frequency in training. updates the network; a schedule varies the , and the . reduces co-adaptation during training. The model with the best validation macro-F1 is kept, and is applied if it stops improving. The face-detector weights and the extractor formulas remain fixed.
AUC-V2 contains isolated images. The pipeline groups them by person and builds windows over that image order, with artificial timestamps; these sequences do not represent the natural evolution of a gesture. UTA-RLDD, for its part, was recorded with phones or webcams at home or at the university, under conditions that approximate an in-car framing. Neither fact turns the aggregate test into an evaluation of real driving.
How the approach evolved
- April 2026 · geometry and duration
A first rule-based detector
The team’s first prototype uses , EAR and the relative displacement of the nose: it distinguishes eye closures, head turns and absence of a face with thresholds and timers. It learns no weights. The research proposes moving from these isolated signals to temporal patterns and studying the limits of data and representation.
- June 2026 · learned classification
A bi-LSTM over 18 signals
The Face Landmarker extractor, windowing, and the training and evaluation of DriverStateNet are introduced. Combining drowsiness and activity data makes it possible to learn three labels. The preserved evidence belongs to this temporal network.
- June 2026 · object context and rules
From a label to an alert
Monitoring with object detection is added; the system combines , the classifier and persistence or recovery rules. The team’s reviews reveal a relevant tension: keeping temporal history can delay recovery, while instantaneous rules can override the learned decision. Their thresholds change the behavior of the combined system and require their own evaluation.
Results and their conditions
The network correctly classifies 22,481 of 35,349 windows. is 65.71% and is 63.69%. All three values describe the same test with different aggregations. The sample has and is dominated by Alert and Drowsiness: Distraction accounts for only 1.52%.
| Method | |||
|---|---|---|---|
| Always DrowsinessConstant control: the most frequent class | 55.53% | 23.80% | 39.65% |
| Bi-LSTM + attentionDriverStateNet · preserved model | 63.60% | 65.71% | 63.69% |
The improvement over the constant control is 8.07 of accuracy. gives each class the same weight and shows that the classifier does more than choose the majority label. This comparison evaluates the complete classifier; it does not allow the improvement to be attributed separately to attention, bidirectionality or each family of signals.
Which classes it detects and which it confuses
| True class | Windows | |||
|---|---|---|---|---|
| Alert | 15,183 | 57.36% | 60.13% | 58.71% |
| Drowsiness | 19,629 | 68.52% | 66.19% | 67.34% |
| Distraction | 537 | 75.90% | 66.85% | 71.09% |
| True ↓ / Predicted → | Alert | Drowsiness | Distraction |
|---|---|---|---|
| Alert | 9,12960.13% | 5,95239.20% | 1020.67% |
| Drowsiness | 6,62433.75% | 12,99366.19% | 120.06% |
| Distraction | 16230.17% | 162.98% | 35966.85% |
The error between Alert and Drowsiness dominates
6,624 windows labeled Drowsiness are predicted as Alert: 33.75% of that class. In the opposite direction, 5,952 Alert windows are predicted as Drowsiness (39.20%). These two errors prevent interpreting the average as a guarantee for alerting a driver. The sensitivity for Distraction rests on only 537 windows and does not support concluding uniform performance across each activity.
Performance varies across data sources
| Source | Windows | per evaluated class | |
|---|---|---|---|
| AUC-V2 | 274 | 100.00% | Distraction: 100.00% |
| DMD-Distraction | 4,526 | 87.85% | Alert: 93.58% Distraction: 38.46% |
| DMD-Drowsiness | 1,130 | 75.04% | Alert: 83.81% Drowsiness: 46.27% |
| UTA-RLDD | 29,419 | 59.09% | Alert: 42.85% Drowsiness: 68.15% |
UTA-RLDD contributes 83.22% of the windows and has the lowest accuracy in the breakdown. AUC-V2 reaches 100%, but its 274 test windows belong to a single class: Distraction. That value does not evaluate three states or validate natural sequences.
How to interpret macro-F1 by source
The report records AUC-V2: 100%; DMD-Distraction: 44.01%; DMD-Drowsiness: 43.36%; UTA-RLDD: 37.00%. Its calculation uses the classes present in the labels or predictions of each subset, instead of fixing all three. AUC averages one class and the other three datasets average three, including classes with no true examples when they appear in the predictions. As a result, the AUC 100% does not share its class denominator with the others.
Which temporal order the network relies on
The test reorders one signal within each window, keeping the other 17 intact. Altering pitch lowers macro-F1 by 4.00 percentage points; roll lowers it by 2.36 and yaw by 2.34. The measured dependence is greater for head pose than for instantaneous mouth opening. It is an intervention on the inputs, without retraining, and does not establish causality.
The 18 macro-F1 changes
| Signal | Drop in |
|---|---|
| Head tilt · pitch | 4.000 pp |
| Sideways tilt · roll | 2.360 pp |
| Head turn · yaw | 2.342 pp |
| Eye-closure proportion · PERCLOS | 1.752 pp |
| Vertical gaze | 1.378 pp |
| Horizontal gaze | 1.171 pp |
| Pose variation | 1.145 pp |
| Blink duration | 1.125 pp |
| Blink rate | 1.037 pp |
| Head-nod count | 0.658 pp |
| Averted-gaze proportion | 0.587 pp |
| Right EAR | 0.405 pp |
| Mean EAR | 0.178 pp |
| Gaze variation | 0.164 pp |
| EAR change per frame | 0.123 pp |
| Mouth opening · MAR | 0.027 pp |
| Mouth-open duration | 0.014 pp |
| Left EAR | -0.009 pp |
The slightly negative value for left EAR means that permuting it marginally improves this average. That marginal change does not establish a detrimental effect of the signal.
Learning the labels and generalizing are different measures
| Set | |||
|---|---|---|---|
| Training | 93.11% | 92.68% | 0.168 |
| Validation | 63.39% | 65.23% | 1.972 |
Training macro-F1 is higher than validation macro-F1. The gap indicates that recognizing the labels seen during learning does not imply the same . Training measurements accumulate while the weights change and dropout is active; validation uses the fixed network. This comparison does not isolate the cause of the difference.
Per-class F1 during selection
| Set | Alert | Drowsiness | Distraction |
|---|---|---|---|
| Training | 91.89% | 94.05% | 92.10% |
| Validation | 54.07% | 69.48% | 72.14% |
The loss is class-weighted cross-entropy; its scale is not an error percentage. Selection uses validation macro-F1, not minimization of the reported loss.
Validation was used to select the weights; it is not another independent test. The windows overlap and share subjects and model: treating them as independent trials would underestimate the uncertainty.
What this evidence supports
The evaluation makes it possible to study a three-label classifier on signals extracted from these datasets. It does not measure accident prevention, detection of complete incidents, intoxication or driving safety. The aggregate average should not be extrapolated to other cameras, lighting conditions or demographic groups. Geometric calibration and lighting preprocessing modify the representation without guaranteeing the removal of .
The example videos use the frozen weights and the extractor’s 18 signals; on start they automatically take a single-frame facial reference. The network receives raw signals and applies its internal . In the historical representation, the averted-gaze threshold is 45° and eye opening is calibrated with 894 samples containing a face. The computed geometry depends on the image: resolution, lighting, face detection and framing can change its inputs. The percentages above correspond to the historical test, not to the visitor’s camera.
The live camera adds a personal zero point: it takes a stable reference with the eyes open and the person’s usual posture. It divides eye opening by that reference and expresses head and gaze relative to it; it treats an opening below 70% of the reference as a closure. This relative rule replaces the fixed closure threshold only in this mode. After calibrating, it collects 90 new samples with a face before classifying; losing the face or recalibrating discards that window. The weights do not change, but the input representation does. This experimental adaptation does not show that false detections disappear, nor does it allow the historical test percentages to be attributed to the camera.
The examples set that zero point automatically on start: the video is paused, a single-frame reference with a face is taken, and playback resumes. The Recalibrate control allows another reference to be chosen. That frame does not count as a sequence of observations and does not demonstrate postural stability. The subsequent classification uses 90 new samples; once this adaptation is active, the historical results do not describe its performance either.
The cadence depends on the video and the device: 90 samples may span more than three seconds. Reducing the resolution or the reading frequency can change the signals and the prediction. Some count-based durations in the extractor retain a nominal rate of 29.76 samples/s; at a different cadence, their temporal interpretation also changes. The load adaptation allows the demo to be explored on different devices, but each condition must be evaluated before its performance is compared with the historical test.
The demo shows Detected, the Bi-LSTM’s class and immediate scores, and Normalized, the system state after decision rules are applied. A assigns Distraction when a cell phone is detected with a YOLO score above 0.45; it takes priority over the facial class and does not change its scores. Detecting a phone in the image does not show that the person is using it. When the phone is no longer detected, the filtered facial state is shown. The figures above correspond to the Bi-LSTM with attention, without these rules or the object detector.
By default, the Normalized layer requires three continuous seconds of Drowsiness to activate it and one second of the same alternative class to exit it. Both durations can be adjusted under Parameters; zero removes the wait. A contrary prediction restarts the confirmation. Only new predictions during active reading count: pauses do not add time, and losing the face restarts the facial reading. This temporal filter is a configurable system rule, distinct from the LayerNorm inside the network. It changes the duration needed to emit the state and requires its own evaluation; it does not modify the scores or demonstrate an improvement in accuracy.