LEIADAVE

DAVE

First place · SciencesExpoIngenierías · Tec de Monterrey, Querétaro

Driver Attention and
Vision Evaluator

DAVE studies how to recognize drowsiness and distraction in a driver. It observes the eyes, mouth, head and gaze, gathers how they evolve over 90 samples and classifies the sequence as Alert, Drowsiness or Distraction.

Explore the signals, the detected objects and the model’s response with your camera or an example recording.

ON-DEVICE PROCESSING

Choose a source to start the analysis: your camera or an example recording.

The image is analyzed in this browser and never sent to a server.
No active source0 / 90 samples

Experimental demo. Do not use while driving. How it works and its results

Team

  • Santiago 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

First place in the Sciences category at ExpoIngenierías, Tecnológico de Monterrey, Querétaro campus.

↑ Demo

· 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.

FIGURE 1 / FROM SHAPE TO MEASUREMENT
Diagram:
p1p2p3p4p5p6Geometric EAR = 0.33

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.

A geometric signal describes a shape. Distinguishing a brief blink from a sustained closure requires duration and temporal history.
The 18 inputs, grouped by what they represent. A temporal percentage is stored as a proportion from 0 to 1.
GroupSignalsUnit and history
Eyes · 7Left, right and mean EAR; ; blink rate and mean blink duration; EAR changeRatios; closure proportion over 60 s; blinks/min; seconds; change per frame
Mouth · 2 and mouth-open durationGeometric ratio and consecutive frames
Head · 5, pose variation and head-nod countAngles in degrees; of their magnitude over 1 s; count over 10 s
Gaze · 4, horizontal and vertical, gaze variation and averted proportionDegrees; 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 .

FIGURE 2 / THE TEMPORAL CLASSIFIER
  1. 90 × 18Extracted signals
  2. 90 × 18LayerNorm
    Scale and shift
  3. 90 × 128Bi-LSTM
    2 layers, both directions
  4. 128 valuesAttention: weights over
    the 90 time steps
  5. 3 scoresDense layers
    128 → 64 → 3
Purple blocks: parameters adjusted during training.

eₜ = vᵀ (W hₜ + b) · αₜ = (e)ₜ · c = Σₜ αₜ hₜ

hₜ is the recurrent state at one time step, αₜ its weight and c the joint representation. LayerNorm learns its scale and shift; the Bi-LSTM, the attention and the dense layers are also trained. The geometric measurements and their temporal rules were defined before training. The second direction only traverses frames already present in the window.

“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.

FIGURE 3 / MORE WINDOWS THAN INDEPENDENT TRIALSWindow A90 framesWindow B · +15 frames90 frames75 shared frames
Diagram of the evaluation sampling: the overlap is 75/90 = 83.3%. The number of windows quantifies decisions over closely related records; it does not count distinct people, trips or incidents.

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

  1. 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.

  2. 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.

  3. 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

63.60%
on the historical test · DriverStateNet35,349 windows · three classes · evaluation preserved from June 2026

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%.

Comparison over the same label counts. The constant control is computed analytically; it does not require a trained model.
Method
Always DrowsinessConstant control: the most frequent class55.53%23.80%39.65%
Bi-LSTM + attentionDriverStateNet · preserved model63.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

Unit: 90-record window. Precision, recall and F1 per class.
True classWindows
Alert15,18357.36%60.13%58.71%
Drowsiness19,62968.52%66.19%67.34%
Distraction53775.90%66.85%71.09%
· rows: true label; columns: prediction. Each cell shows the count and the proportion within its row.
True ↓ / Predicted →AlertDrowsinessDistraction
Alert9,12960.13%5,95239.20%1020.67%
Drowsiness6,62433.75%12,99366.19%120.06%
Distraction16230.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

Breakdown of the same test, without retraining the network for each dataset.
SourceWindows per evaluated class
AUC-V2274100.00%
Distraction: 100.00%
DMD-Distraction4,52687.85%
Alert: 93.58%
Distraction: 38.46%
DMD-Drowsiness1,13075.04%
Alert: 83.81%
Drowsiness: 46.27%
UTA-RLDD29,41959.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
Mean drop in macro-F1 when each signal is reordered. Unit: percentage points.
SignalDrop in
Head tilt · pitch4.000 pp
Sideways tilt · roll2.360 pp
Head turn · yaw2.342 pp
Eye-closure proportion · PERCLOS1.752 pp
Vertical gaze1.378 pp
Horizontal gaze1.171 pp
Pose variation1.145 pp
Blink duration1.125 pp
Blink rate1.037 pp
Head-nod count0.658 pp
Averted-gaze proportion0.587 pp
Right EAR0.405 pp
Mean EAR0.178 pp
Gaze variation0.164 pp
EAR change per frame0.123 pp
Mouth opening · MAR0.027 pp
Mouth-open duration0.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

Aggregate training and validation metrics · selected : 16.
Set
Training93.11%92.68%0.168
Validation63.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
Per-class F1 on training and validation during model selection.
SetAlertDrowsinessDistraction
Training91.89%94.05%92.10%
Validation54.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.