Skip to Content
SensorsSensors
  • Article
  • Open Access

26 October 2026

21 Pages

Adaptive Temporal-Aware Feature Selection for Driver Fatigue Detection

,
,
and
1
School of Telecommunication and Information Engineering, Xi’an University of Posts and Telecommunications, Xi’an 710121, China
2
School of Electrical and Control Engineering, Shaanxi University of Science and Technology, Xi’an 710021, China
3
School of Artificial Intelligence, Optics and Electronics (iOPEN), Northwestern Polytechnical University, Xi’an 710072, China
*
Author to whom correspondence should be addressed.
This article belongs to the Section Intelligent Sensors

Abstract

Achieving favorable compatibility between detection performance and inference efficiency has long been a core bottleneck restricting the practical deployment of vision-based driver fatigue detection algorithms on vehicle-mounted embedded devices. In this work, we propose an adaptive temporal-aware feature selection paradigm for driver fatigue detection to address temporal isolation and computational redundancy problems. Specifically, we propose a temporal dual-stream fusion (TDF) module to generate unified embeddings of highly discriminative video features, laying a solid feature foundation for superior final performance. Additionally, we design an adaptive feature selection (AFS) mechanism that evaluates the necessity of executing each stream based on confidence estimation, eliminating redundant computations with acceptable slight accuracy loss. In addition, the experimental results on the challenging NTHU-DDD dataset demonstrate the superiority of our method, especially from the perspective of balancing performance and efficiency.

1. Introduction

Road traffic safety remains a critical social issue worldwide [1]. Statistics indicate that driver fatigue is responsible for roughly 12%–20% of all road accidents and over 40% of fatal crashes, with a mortality rate far exceeding ordinary traffic incidents. Long-duration driving, monotonous road conditions and insufficient sleep all trigger mental and physical fatigue, which impairs drivers’ reaction speed, visual perception and decision-making capacity, drastically raising collision risks. As intelligent driving and driver monitoring systems (DMSs) gain widespread deployment, non-contact vision-based fatigue detection has emerged as a research hotspot thanks to its low hardware cost, high user acceptance and convenient deployment without invasive sensors.
Existing vision-based fatigue detection paradigms can be divided into single-stream spatial models and naive spatio-temporal dual-stream architectures. Single-stream CNNs merely extract static facial cues such as eye openness, mouth yawns and head poses from isolated frames, ignoring the continuous dynamic evolution of fatigue symptoms over time, thus suffering severe performance degradation under complex interference including drastic day–night illumination shifts and partial occlusion by regular or reflective sunglasses. Conventional dual-stream networks separately process spatial appearance and temporal motion information to capture fatigue-related dynamic patterns, yet they adopt fixed parallel inference for all video frames without screening redundant feature branches. This rigid computation pattern generates massive useless feature calculations and restricts the model’s real-time inference speed, failing to strike a balance between detection accuracy and computational efficiency on embedded vehicle-end devices.
To address the two major challenges of temporal isolation and computational redundancy, as shown in Figure 1, we design a unified driver fatigue detection paradigm based on adaptive temporal-aware feature selection. This paradigm centers on two points, including temporal dual-stream fusion (TDF) and adaptive feature selection (AFS). The former focuses on temporal perception, while the latter takes efficient inference into consideration. Specifically, we introduce a Gated Recurrent Unit (GRU) to construct a temporal feature fusion network. By capturing long-term dependencies across consecutive frames and learning the evolution patterns of hidden states, the network generates dynamic frame-level weights, significantly enhancing the ability of the model to capture the evolutionary process of fatigue behaviors and its robustness against interference. In addition, we utilize a lightweight regression network to estimate the confidences of different branches to dynamically select the optimal inference path accordingly, thereby achieving on-demand allocation of computational resources.
Figure 1. Challenges of existing methods in driver fatigue detection: (a) temporal isolation in single-frame facial-image processing; (b) computational redundancy in fixed dual-stream processing.
Under the premise of maintaining high-precision detection for critical fatigue samples, this chapter eliminates unnecessary computation during prolonged wakeful states, achieving synergistic optimization of temporal feature mining and inference efficiency at the algorithm architecture level, providing a novel and reliable paradigm for energy-efficient fatigue detection in complex scenarios. The main contributions of this paper are summarized as follows:
  • We propose a temporal dual-stream fusion (TDF) module to generate unified embeddings of highly discriminative video features, laying a solid feature foundation for superior final performance.
  • We design an adaptive feature selection (AFS) mechanism that evaluates the necessity of executing each stream based on confidence estimation, eliminating redundant computations and performance degradation.
  • We integrate our proposed TDF and AFS modules into a unified framework for driver fatigue detection, which simultaneously maintains favorable detection accuracy and high inference speed.
  • We conduct extensive experiments on the NTHU-DDD dataset, and the results show significant advantages of our method, especially from the perspective of balancing performance and efficiency.
The rest of this paper is organized as follows. Section 2 reviews the existing methods for detecting driver fatigue and multi-source fusion in brief. Section 3 details the proposed driver fatigue detection algorithm based on adaptive temporal-aware feature fusion. Section 4 reports and analyzes the experiments. Section 5 concludes this paper.

3. Proposed Method

The adaptive feature selection algorithm with temporal information mainly includes two core stages: temporal dual-stream fusion and adaptive feature selection, as shown in Figure 2. In the first stage of temporal dual-stream fusion, the model receives raw video frames and builds a sliding window of size L s w . Video frames are fed into the facial branch and the head branch separately. Each branch adopts a GRU to model temporal dependencies over continuously extracted spatial features and captures long-range correlations among adjacent frames. The two groups of features then enter a lightweight attention fusion module, which adaptively calculates fusion weights for each feature stream. Weight-fused joint features go to a classifier for fatigue-state prediction. Meanwhile, this stage extracts fusion weights from the facial branch. These weights act as supervision signals to train the lightweight regression network in the second stage.
Figure 2. Framework of the temporal-aware adaptive feature selection algorithm: (a) overall temporal dual-stream fusion network; (b) training process of the adaptive feature selection regressor; (c) adaptive branch selection during inference. The background colors distinguish the three components, black arrows indicate the processing flow, and red dotted arrows highlight feature aggregation and score-pool updates.
In the second stage of adaptive feature stream selection, the lightweight regression network takes pseudo-labels generated in the first stage as supervision signals for parameter optimization. The network updates its weights via loss calculation and back-propagation. It thereby learns to assess the importance of different feature branches from a single frame. During inference, the regression network accepts target frames sampled from the sliding window. It outputs the facial-branch prediction score ω ^ score f at low computational cost. The system applies dynamic branch selection by comparing this score with a predefined threshold τ . This architecture cuts redundant computation while preserving detection accuracy. It achieves a good trade-off between accuracy and real-time performance for embedded vehicle platforms.

3.1. Temporal Dual-Stream Fusion

This section analyzes the theoretical basis, network design and implementation details of each module in the first stage. It explains how the model produces discriminative unified embeddings of temporal dual-stream fatigue features from video sequences.

3.1.1. Temporal Sliding Window

Fatigue behaviors show strong temporal continuity. Blinking, yawning and head drooping develop across successive frames. Single-frame inputs miss important dynamic variations. Nevertheless, 3D-CNN or LSTM [25] bring heavy computation and memory burdens, which harm real-time inference in practical deployment. This work introduces a temporal sliding-window module. It gathers sufficient temporal context without sacrificing computational efficiency. The module constructs local temporal segments using historical frames plus the current frame during data loading. Only past frames serve as context; no future-frame data is involved. Consequently, the model infers purely from observed history and satisfies causality requirements for real-time systems.
(1)
Window Structure Constraints
The system imposes hard constraints for sliding-window initialization to guarantee valid sampling. Let s w denote the total window size and s f denote the number of preceding historical frames. Future frames are strictly excluded, so the count of subsequent frames equals zero. The window size must follow the causal constraint in Equation (1).
s w = s f + 1
Here, + 1 accounts for the target frame itself. This constraint guarantees complete temporal context. The temporal window slides over video frames with a fixed stride s = 1 . Every frame becomes a target frame with its own temporal context. This sampling strategy enables the model to capture dynamic changes among neighboring frames.
(2)
Boundary Constraint Addressing Strategy
Consider a video sequence with L total frames and index set I = { 0 , 1 , … , L − 1 } . For a target frame indexed by i ∈ I , the sliding-window theoretically yields the context index set in Equation (2).
T i = { t ∣ t = i + δ , δ ∈ [ − s f , 0 ] }
Indices t < 0 may appear when i lies near the video start. Conventional zero-padding introduces severe artificial abrupt noise at sequence boundaries and breaks the continuous temporal semantics of fatigue motions. To mitigate boundary artifacts, this module adopts a static-continuation strategy. The underlying assumption states that driver actions remain unchanged for a short period right before recording starts. A mapping function Φ ( t ) remaps all out-of-bound historical indices to the first valid frame, as given in Equation (3).
Φ ( t ) = 0 , t < 0 t , t ≥ 0
Applying Φ ( t ) produces the practical sampling index set P i = { Φ ( t ) ∣ t ∈ T i } . The sliding window repeatedly samples the initial-frame features at video beginnings. Besides avoiding leakage of future information, this setup suppresses artificial high-frequency noise. It generates well-behaved input streams that comply with physical priors for subsequent feature extraction networks.

3.1.2. Temporal Weight Generation

We build GRU-based temporal weight generators for both facial and head-pose branches. These generators measure frame-wise contributions within each sliding window, as illustrated in Figure 3. The module captures temporal dependencies across frames and produces dynamic per-frame weights from evolving hidden states. Each branch computes weighted sums over multi-frame window features using these temporal weights. Discrete temporal sequences aggregate into robust context-aware feature representations.
Figure 3. Gated recurrent unit weight generation module.
(1)
Spatial Dimensionality Reduction and Temporal Sequence Constructiony
We first merge batch and temporal dimensions of tensor X ∈ R B × T × C × H × W and reshape it into R ( B · T ) × C × H × W . Two-dimensional adaptive GAP compresses spatial resolution to 1 × 1 . Reduced features are reshaped back into temporal-sequence tensor V ∈ R B × T × C as input for the gating network.
(2)
Temporal Modeling Based on GRU
Tensor V feeds into the GRU unit. Its internal gating mechanism captures deep temporal correlations. For input v t at time t ∈ [ 1 , T ] , GRU updates its hidden state following Equation (4).
h t = ( 1 − z t ) ⊙ h t − 1 + z t ⊙ h ˜ t
where z t is the update gate, which is defined in Equation (5).
z t = σ W z · [ h t − 1 , v t ] + b z
Variable h ˜ t in Equation (4) corresponds to the candidate hidden state in Equation (6).
h ˜ t = tanh W h · [ r t ⊙ h t − 1 , v t ] + b h
where r t denotes the reset gate from Equation (7).
r t = σ W r · [ h t − 1 , v t ] + b r
The output hidden-state sequence H = { h 1 , h 2 , … , h T } encodes full contextual memory inside each sliding window.
(3)
Attention Mapping and Feature Modulation
Hidden states H project toward scalar space to produce per-frame weights. A linear layer extracts temporal features. A softmax operator in Equation (8) normalizes weights over temporal dimension T.
w t = exp ϕ ( h t ) ∑ k = 1 T exp ϕ ( h k ) , t = 1 , 2 , … , T
where ϕ ( · ) stands for fully connected linear mapping. Weight tensor w = { w 1 , w 2 , … , w T } ∈ R T × d modulates raw input X via broadcast element-wise multiplication from Equation (9) and yields weighted features X ˜ .
X ˜ = w ⊙ X

3.1.3. Dual-Stream Attention Fusion

Features from two branches go through independent preprocessing. This paper proposes a dual-stream attention fusion module (DSAF), shown in Figure 4. It adopts a cascade pipeline including scale alignment, nonlinear purification and feature modulation. The module aggregates information efficiently within a unified feature space.
Figure 4. The inner architecture of the Dual-Stream Attention Fusion Module.
(1)
Spatial Scale Alignment and Joint Representation
Denote facial features from the YOLO branch as F f ∈ R B × C f × H f × W f and pose features from FSANet [26] as F p ∈ R B × C p × H p × W p . To resolve spatial-resolution mismatch, bilinear upsampling aligns F f to the spatial grid of pose features. The module concatenates features along the channel dimension and builds joint tensor F cat ∈ R B × ( C f + C p ) × H p × W p with complete semantic information.
(2)
Attention Purification
Simple concatenation introduces redundancy. DSAF builds a lightweight attention network to capture complex nonlinear correlations among features. First, 1 × 1 point-wise convolution reduces joint-feature dimensions. A ReLU activation enhances nonlinear representation capacity. A second point-wise convolution maps features onto 2D channel planes.
(3)
Deep Feature Modulation
Once spatial attention maps are obtained, DSAF refines weights for each feature-map coordinate using the Hadamard product. It completes deep feature modulation as formulated in Equation (10).
F out = F f up ⊙ A f ; F p ⊙ A p ∈ R B × ( C f + C p ) × H p × W p
This attention mechanism acts as a spatial filter. It strengthens high-confidence target regions and suppresses background noise caused by spatial alignment. It outputs robust temporal dual-stream fused features.

3.2. Adaptive Feature Stream Selection

The first-stage temporal dual-stream fusion model delivers competitive performance and generalization for fatigue-driving recognition. However, inference requires full activation of both feature branches plus the fusion module, which brings high computational cost. Different driving scenarios rely unequally on each branch. When discriminative cues concentrate heavily within one branch (for instance, obvious facial fatigue or abnormal head pose), running the other whole branch produces redundant computation and slows system responses. We therefore design a condition-triggered inference mechanism. The model selects computation paths adaptively according to sample-wise feature distributions and achieves on-demand computation.
Based on the Stage-I model, we propose an adaptive feature-selection strategy. A lightweight regression network fits branch-importance distributions learned by the backbone model. During inference, regression-network predictions determine the actual execution path. The original static full dual-stream network transforms into an adaptive inference architecture, and overall inference efficiency improves.

3.2.1. Label Construction

When the Stage-I backbone model converges, its internal dual-stream fusion module outputs branch-level fusion weights for each training sample: ω score f for the facial branch and ω score h for the head-pose branch. These weights satisfy normalization ω score f + ω score h = 1 . Predicting both values creates dimensional redundancy. We extract only facial-branch weight ω score f as pseudo-labels for regression-network supervision, as defined in Equation (11).
ω score f = GAP A f

3.2.2. Network Design

This subsection describes the lightweight regression network serving as the front-end decision module. To satisfy strict low-latency requirements for real-time inference, the network takes only the current-frame X t ∈ R 3 × 224 × 224 within the sliding window as input for both training and inference. This design removes computation overhead for sequential video processing. Figure 5 shows its overall structure. Input X t passes through convolution layers, max-pooling layers and adaptive average pooling for spatial downsampling. Features flatten and feed into fully connected layers. A final Sigmoid guarantees probability-like weight outputs. Forward propagation yields predicted one-dimensional branch weight ω ^ score f in Equation (12).
ω ^ score , t f = Sigmoid F θ ( X t )
where F θ denotes the regression network with parameters θ .
Figure 5. Architecture of the regression network model. Colored blocks distinguish different network operations, black arrows indicate the forward data flow, red dotted arrows indicate the dimensions of intermediate feature representations, and the black dash-dotted line represents the loss-related connection between the predicted and target scores.

3.2.3. Network Optimization

This module trains with MSE loss L reg . It drives predicted weights to approximate pseudo-labels dynamically generated by the primary model. Given a mini-batch with N samples, the loss function follows Equation (13).
L reg = 1 N ∑ i = 1 N ω score , i f − ω ^ score , i f 2
Back-propagation minimizes L reg and updates regression-network parameters θ . Complex decision knowledge transfers toward this lightweight network.

3.2.4. Branch Selection

For practical inference, the system introduces confidence threshold 0.5 < τ < 1.0 . It builds a three-way decision function s ( X ) purely from branch weight ω ^ score f , as given in Equation (14).
s ( X ) = ψ face , ω ^ score f ≥ τ ψ head , ω ^ score f ≤ 1 − τ ψ fuse , 1 − τ < ω ^ score f < τ
The decision rules work as follows. If one-branch prediction exceeds threshold τ , information from that single branch suffices. The system activates only the corresponding single-branch network ( ψ face or ψ head ). When neither branch meets the threshold, single-branch signals become insufficient. The system conservatively enables dual-branch fusion network ψ fuse . The mechanism adds negligible overhead at the front end and adaptively optimizes computational-resource allocation.

3.2.5. Supplementaries

The decision logic maps feature saliency to computational-resource assignment. It supports three execution modes.
  • Face-dominant mode ( ψ face ): When ω ^ score f ≥ τ , facial fatigue signs such as frequent yawning or eye closure dominate within the current frame. The decider enables only the facial perception branch and skips unnecessary head-pose processing.
  • Head-dominant mode ( ψ head ): When ω ^ score h ≥ τ ( ω ^ score f ≤ 1 − τ ), drowsiness induces strong head motions such as nodding. Head-pose features dominate. The decider considers single-branch information adequate and activates only the head-pose branch. Computation for the facial branch is skipped.
  • Dual-stream fusion mode ( ψ fuse ): When predictions fall within ( 1 − τ , τ ) , neither feature stream provides enough discriminative power. A typical case includes slightly closed eyes together with mild head tilting. The decider activates dual-branch fusion. Rich spatiotemporal features preserve recognition accuracy.

3.2.6. Hyperparameter τ

Threshold τ acts as a key hyperparameter balancing inference accuracy and computational efficiency. When τ approaches 1.0 , the criteria become strict. The system mostly falls back to full dual-branch fusion ψ fuse . This setting yields upper-bound classification accuracy yet brings maximum computation cost. When τ gets close to 0.5 , thresholds relax. Single-branch inference triggers frequently. Latency reduces at the risk of misclassification. We calibrate τ on validation sets. The model can adapt flexibly to different deployment hardware constraints.

4. Experiments

4.1. Dataset

To overcome the limitation that single static frames struggle to capture continuous fatigue variations, this paper focuses on temporal dynamic modeling instead of static spatial feature extraction. We adopt the NTHU Driver Drowsiness Detection video dataset (NTHU-DDD)  [20] as the primary evaluation benchmark, with sample illustrations visualized in Figure 6. The dataset contains 36 high-definition infrared and visible video sequences collected in simulated driving scenarios. It covers diverse challenging conditions, including drastic day--night light changes and partial occlusion by sunglasses, and it includes various fatigue behaviors such as yawning and frequent head lowering. The fine-grained frame-wise binary annotations and multi-dimensional facial/head pose attributes support reliable evaluation of dynamic fatigue detection.
Figure 6. Some examples from the NTHU-DDD dataset.
To avoid data leakage and ensure rigorous evaluation, we implement a strict subject-independent partition protocol.
All videos from a single subject are entirely assigned to one subset (training, validation, or test), with no cross-subset subject overlap. We abandon stride-1 overlapping sampling to prevent highly similar frames from spreading across different splits. The dataset is divided at an approximate ratio of 70%:15%:15% by subject identity. Specifically, among the total 36 subjects, 25 subjects are used for training, 5 for validation and 6 for testing. The validation set is used exclusively for hyperparameter tuning, while the test set is only utilized for final evaluation and never involved in parameter optimization.
Overall, the NTHU-DDD dataset provides comprehensive temporal and scene diversity to validate our temporal feature extraction framework, which complements static spatial modeling and forms a complete experimental pipeline for dynamic driver fatigue detection.

4.2. Evaluation Metrics

Following most existing works based on the NTHU-DDD benchmark, overall accuracy is adopted as the major evaluation metric for performance comparison.

4.3. Implementation Details

All experiments are implemented based on PyTorch 2.4.1. The input frame size is set to 224 × 224 . We use the SGD optimizer, with the initial learning rate set to 1 × 10 − 4 .
To obtain statistically stable results and reduce random initialization bias, all main experiments are repeated with five different random seeds. We report mean performance together with standard deviation ( m e a n ± σ ) for quantitative comparison. Hyper-parameters are determined solely based on the validation set, and no test-set feedback is used during parameter searching. In addition, The face backbone is pre-trained on WIDER-Face [27]. We expand detected face boxes by 15% for face region cropping, and we crop local regions via human keypoints. The model is trained end-to-end for 100 epochs with a cosine learning rate decay.

4.4. Experimental Setup

To ensure the fairness of model evaluation and the rigor of comparative experiments, this work adopted the same basic hardware and software experimental environment for different algorithms. The specific hardware configuration consisted of four NVIDIA TITAN XP graphics processing units (GPUs). The software runtime environment included Linux, CUDA 11.8, Python 3.8, and PyTorch 2.4.1.
Regarding the basic training parameters of the model, the core hyperparameters of the facial feature extraction, head pose estimation, and dual-stream feature fusion networks are shown in Table 1.
Table 1. The details of the experimental setup.
To evaluate the results of different methods, we utilized Accuracy (Acc.), Precision (P), Recall (R), F1-score (F1), Frames per Second (FPS), and Number of Parameters (Para.) as the core evaluation criteria to measure their performance. The definition of Acc. is formulated in Equation (15).
Acc . = TP + TN TP + TN + FP + FN × 100 %
where TP , TN , FP , and FN denote the numbers of true positives, true negatives, false positives, and false negatives, respectively. The definitions of precision (P) and recall (R) are given in Equation (16).
P = TP TP + FP × 100 % , R = TP TP + FN × 100 %
The F1-score is the harmonic mean of P and R and is defined in Equation (17).
F 1 = 2 · P · R P + R
FPS denotes the number of frames processed per second and is calculated using Equation (18).
FPS = N total T total
where N total is the total number of frames in the test samples, and T total is the total time required to process these samples. Para. denotes the number of parameters in the network and is defined in Equation (19).
Para . = numel ( Θ )
where Θ denotes the network parameters, and numel ( · ) denotes the function used to count the number of elements in PyTorch 2.4.1.

4.5. Comparative Experiments and Analysis

To verify the effectiveness and comprehensive performance of the proposed model in the driver fatigue detection task, comparative experiments were conducted using a unified experimental environment and on the same dataset. Ten representative network models were selected as baselines, which could be divided into three categories. The first category comprised mainstream convolutional classification networks, including ShuffleNetV2 [28], MobileNetV2 [29], MobileNetV3 [30], EfficientNetV2 [31], and the improved MobileNetV3 [32]. The second category consisted of vision Transformer architectures, including MobileViT [33] and Swin Transformer [34]. The third category included architectures incorporating temporal or multi-feature fusion, such as the multi-stream network EMSRNet [35], the classic spatiotemporal cascade architecture InceptionV3+LSTM [36], and the spatiotemporal hybrid model CNN+LSTM [37]. The detailed experimental comparison results are shown in Table 2.
Table 2. Comparison with state-of-the-art methods on the NTHU-DDD dataset. Values are reported as percentages (%) for Acc., P, R, and F1, in millions (M) for Para., and in hertz (Hz) for FPS.
Table 2 shows that the proposed model achieved the best performance across core accuracy metrics, including accuracy (96.07%), and attained the highest inference speed (56.96 FPS), achieving an optimal balance between detection accuracy and inference efficiency. Among mainstream CNN architectures, the lightweight ShuffleNetV2 demonstrated excellent feature extraction capability (accuracy of 95.28%). Although EfficientNetV2 met accuracy requirements, its large parameter count (20.18M) led to a low frame rate (18.48 FPS), making it difficult to satisfy real-time requirements. Compared to the best-performing Improved-MobileNetV3 in this category, the proposed model achieved a 5.01% accuracy improvement with fewer parameters and more efficient inference, validating its superior network architecture. Additionally, both MobileViT and Swin-T demonstrated strong feature representation capabilities due to their self-attention mechanisms, achieving accuracies exceeding 94%. However, the self-attention mechanism inevitably introduced significant computational overhead, causing their inference speeds to hover around only 33 to 36 FPS. While maintaining extremely high accuracy (96.07%), the proposed model had less than half the parameter count of MobileViT and achieved an inference speed more than 1.6 times faster, effectively overcoming the bottleneck of Transformer architectures that struggled with high-speed inference on edge devices.
In addition, regarding architectures incorporating temporal or multi-feature fusion, it should be noted that since the original authors of EMSRNet and the classic spatiotemporal models (InceptionV3+LSTM/CNN+LSTM) did make their code open-source, rigorous code reproduction was conducted based on the original literature to ensure experimental fairness. Experiments showed that the large parameter count of the multi-stream network EMSRNet limited its operational efficiency (30.15 FPS). For spatiotemporal models incorporating LSTMs, even though the parameter count of CNN+LSTM was compressed to 1.44M, its inference speed remained only 20.78 FPS, fully exposing the serial bottleneck of traditional LSTMs in temporal computation. Moreover, the accuracy of such models only hovered around 70%, indicating that simply introducing temporal modules easily led to feature alignment difficulties and overfitting risks. In contrast, the proposed model, with a low parameter count of 2.18M and an excellent performance of 56.96 FPS, fully validated its potential for real-time fatigue detection in complex in-vehicle environments.

4.6. Ablation Experiments and Analysis

4.6.1. Investigation of Sliding Window Size L s w

The length of the sliding window L s w directly determined the temporal span of the model’s receptive field. This section tests the performance variation with window sizes L s w ranging from 2 to 8. The experimental results are shown in Table 3. As L s w increased, accuracy first rose and then fell. When L s w = 3, the model captured the most appropriate local temporal dependencies, achieving peak accuracy. If L s w continued to increase (e.g., L = 8 , accuracy dropped to 94.02%), this introduced excessive redundant historical information and instead interfered with the judgment of the current frame while increasing computational overhead. Therefore, we ultimately selected L s w = 3 as the default configuration.
Table 3. Hyperparameter study of length of sliding window L s w .

4.6.2. Investigation of Adaptive Feature Stream Selection Threshold τ

Figure 7 shows the attention weight density distribution of each branch in the training stage fusion module. Due to the SigMoid normalization constraint, the sum of the weights of the facial branch (blue) and the head pose branch (red) was always 1. The distribution in the figure shows a clear polarization phenomenon, demonstrating that the model highly relied on facial features for downstream discrimination, while its dependence on head pose features was extremely low. This weight imbalance was mainly attributed to the sparsity of specific pose samples such as head lowering in the training set. This distribution pattern not only revealed the redundancy in computational resource allocation of the current dual-branch architecture but also laid an experimental foundation for the subsequent design of an adaptive inference acceleration scheme.
Figure 7. Weight density distribution of each branch in the fusion module.
Table 4 records the impact of different adaptive feature stream selection thresholds τ on overall model performance. Based on the distribution pattern in Figure 7, where facial feature weights are highly concentrated above 0.82, this experiment reasonably set the threshold interval to [ 0.82 , 1.00 ] . The experimental results showed a trade-off between model inference speed and detection accuracy. As τ gradually increased from 0.82 to 1.00, the proportion of samples sent to the fusion branch increased from 6.7% to 100%. Although the F1-score of the model steadily increased from 93.67% to 95.75%, the inference speed dropped sharply from 65.13 FPS to 50.55 FPS due to the increased computational load.
Table 4. Ablation study on the adaptive feature stream selection threshold τ (% except for FPS).
In practical fatigued driving detection scenarios, the optimal threshold setting was not fixed but should be flexibly determined based on the computational resources of the specific deployment device to seek the best balance. In terms of the comprehensive performance of this experiment, it could be observed that when τ exceeded 0.96, the improvement in model accuracy and F1-score tended to slow down. In this case, we set τ = 0.96 as the default hyperparameter for adaptive inference.

4.6.3. Core Component Ablation Experiments

To verify the contribution of each core module to model performance, the ablation experiment results are shown in Table 5. Although the base dual-stream fusion model achieves an extremely high inference speed (66.30 FPS), its accuracy still has room for improvement (95.77%). After introducing the Temporal Module, the model can effectively capture dynamic fatigue features among video frames and achieves the highest accuracy (96.34%). However, it brings considerable computational overhead, and the frame rate drops sharply to 50.55 FPS. To alleviate this speed bottleneck, we further equip the model with the Adaptive Feature Stream Selection mechanism. This component filters redundant spatiotemporal features and recovers the inference frame rate to 56.96 FPS at the expense of a minor accuracy reduction from 96.34% to 96.07%. The overall accuracy remains obviously higher than that of the base network. These observations demonstrate that our complete architecture compensates for the speed loss introduced by temporal computation via acceptable accuracy degradation, and it obtains a favorable trade-off between detection accuracy and real-time inference.
Table 5. Ablation study of the core components using five different random seeds.
Table 6 presents ablation studies to analyze the effects of TDF and AFS on the target dataset. The non-temporal baseline reaches an accuracy of 95.77% with an FPS of 66.30. The face-only temporal model introduces face temporal information, yielding a slight accuracy improvement (95.84%) but reducing inference speed to 61.49 FPS. Incorporating the TDF module to exploit face and local temporal features further improves accuracy to 95.96%, yet the FPS declines to 53.21 due to increased computation. To verify the advantage of the adaptive routing strategy in AFS, we construct a random routing variant. The results show that the TDF model with random routing achieves 96.07% accuracy and recovers FPS to 56.96. This observation confirms that TDF captures complementary temporal cues, and AFS adaptively distributes computation to mitigate the efficiency drop, jointly optimizing the performance–efficiency trade-off.
Table 6. Ablation study of TDF and AFS on the target dataset.

4.7. Visualization Results Analysis

4.7.1. t-SNE Visualization Analysis

To intuitively verify the effectiveness of different algorithms in feature extraction and classification, we employed t-SNE [38] technology to perform dimensionality reduction visualization analysis on the features of the dual-stream network, temporal dual-stream network, and temporal feature stream selection network.
In Figure 8, observing the left subfigure, we saw that although the dual-stream network initially achieved separation of fatigue and alert features, the feature distribution was relatively dispersed. After introducing temporal information in the middle subfigure, the intra-class compactness of the two feature clusters was improved, forming clustering results with the highest visual separation and clarity. After further introducing the adaptive feature stream selection mechanism, the distribution of feature clusters (the right subfigure) showed a slight loosening trend compared to the middle subfigure but overall maintained good inter-class discrimination. This visual evolution process intuitively and faithfully reflected that the complete architecture proposed in this paper recovered inference speed at the cost of slightly sacrificing representation purity.
Figure 8. Comparison of t-SNE feature visualizations for different networks.

4.7.2. Grad-CAM Visualization Analysis

To further investigate the focus areas of different models during feature extraction and verify the effectiveness of the proposed algorithm, we employed Grad-CAM [39] technology to perform class activation map visualization analysis on the feature extraction processes of the facial temporal network, head temporal network, and the proposed algorithm. The visualization results were superimposed on the original images in the form of heatmaps, where warmer colors indicated higher model attention to that region and greater contribution to the final prediction.
As shown in Figure 9, by comparing four sets of samples covering complex driving scenarios such as large poses and partial occlusion, we clearly observed significant differences in feature focus areas among different networks. Compared to single-stream feature networks, the proposed network with fused dual-stream features demonstrated outstanding anti-interference capability. Specifically, facing challenging samples such as tilting, wearing glasses, and occlusion by sunglasses, the proposed network accurately and compactly anchored the high-response regions to the head area containing facial features. It not only successfully suppressed interference from irrelevant noise such as arms, torso, and background but also compensated for the limitations of single-branch networks in feature extraction. This intuitive visualization result strongly demonstrated that the proposed algorithm could fully leverage the complementary advantages of facial details and head global features, guiding the model to learn more robust and accurate fatigue discrimination features.
Figure 9. Comparison of Grad-CAM feature heatmaps for different networks.

5. Conclusions

The proposed framework includes two core modules: the TDF temporal-fusion module and the AFS adaptive inference module. The TDF temporal-fusion module exploits inter-frame temporal correlations to aggregate multi-frame features, suppresses frame noise and improves fatigue detection accuracy. By contrast, the AFS adaptive inference module optimizes computational cost for embedded vehicle-side deployment. It dynamically selects inference branches to reduce redundant computation and achieves a good balance between detection accuracy and real-time performance.
Nevertheless, this method still has practical limitations for real-world scenarios. Extreme lighting degrades image quality and harms feature extraction. Heavy occlusions from hats, masks or sunglasses interfere with fatigue feature capture. Additionally, variations in camera hardware may cause domain gaps and reduce generalization performance. These problems will be explored in future work.

Author Contributions

Conceptualization, R.Z.; Writing—original draft, R.Z.; Software, R.Z.; Investigation and Methodology, G.Z.; Supervision, X.C.; Funding acquisition, J.F.; Writing—review and editing, J.F. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

This study uses a publicly available, de-identified dataset (NTHU-DDD). The original authors of the public dataset completed ethical review and informed consent procedures. No new experiments involving human subjects or video recordings were conducted in this work.

Data Availability Statement

The NTHU Driver Drowsiness Detection (NTHU-DDD) dataset used in this study is publicly available at: http://cv.cs.nthu.edu.tw/php/callforpaper/datasets/DDD/, (accessed on 1 September 2026).

Acknowledgments

The authors sincerely appreciate Juan Du of Xi’an Children’s Hospital for her helpful comments and significant contributions throughout the revision of this manuscript.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
AFSAdaptive feature selection
DMSDriver Monitoring System
DSAFDual-Stream Attention Fusion
FPSFrames Per Second
GAPGlobal Average Pooling
GRUGated Recurrent Unit
NTHU-DDDNTHU Driver Drowsiness Detection
TDFTemporal Dual-Stream Fusion

References

  1. Wang, S.; Wang, Z.; Hong, S.; Wang, P.; Zhang, S. Ensuring SOTIF: Enhanced object detection techniques for autonomous driving. Accid. Anal. Prev. 2025, 218, 108094. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  2. Al-Quraishi, M.S.; Ali, S.S.A.; Al-Qurishi, M.; Tang, T.B.; Elferik, S. Technologies for detecting and monitoring drivers’ states: A systematic review. Heliyon 2024, 10, e39592. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  3. Hassan, O.F.; Ibrahim, A.F.; Makhlouf, M.A.; Hafiz, B.; Gomaa, A. Intelligent driver monitoring systems: A survey of drowsiness detection technologies for road safety. Artif. Intell. Rev. 2026, 59, 137. [Google Scholar] [CrossRef] [Scilit]
  4. Suprihatiningsih, W.; Romahadi, D.; Feleke, A.G. Electroencephalogram-based multi-class driver fatigue detection using power spectral density and lightweight convolutional neural networks. J. Eng. Technol. Sci. 2025, 57, 445–457. [Google Scholar] [CrossRef] [Scilit]
  5. Li, W.; Gan, L.Z.; Luan, S.Y.; Xu, B. EEG-based brain fatigue detection method. Autom. Technol. Appl. 2026, 45, 77–82. [Google Scholar]
  6. Xu, F.; Liu, Y.M.; Ning, L.X. Cross-subject fatigue driving detection based on single-channel EEG using ensemble deep learning. J. Anhui Norm. Univ. Nat. Sci. 2026, 49, 117–123. [Google Scholar]
  7. Zhu, H.Y.; Zhen, Q.K.; Chen, Q.; Zhang, N.Y.; Yu, T. Single-channel EEG mental fatigue detection based on CNN-Transformer fusion structure. In Proceedings of the 14th National Sports Science Conference, Wuhan, China, 7–9 November 2025; pp. 20–21. [Google Scholar]
  8. Guo, H.Y.; Wang, S.L.; Liu, S.Q.; Dong, W.A.; Zhuo, X.J.; Wang, X.J.; Tang, L.; Qiao, S.J. Research on driving fatigue recognition based on concatenated fusion of EEG and facial features. Radio Eng. 2024, 54, 2820–2830. [Google Scholar]
  9. Wang, F.; Cui, T.; Qu, H. Early warning of heavy-haul railway vehicle operation monitoring data anomalies based on Bayesian networks. Microcomput. Appl. 2025, 41, 16–19. [Google Scholar]
  10. Gao, C. Vehicle operation situation analysis based on ETC gantry data. Transp. Sci. Technol. 2025, 51, 100–104. [Google Scholar] [CrossRef]
  11. Zhang, J.; Han, S.Q.; Liu, J.D. Hierarchical multi-scale fatigue driving detection based on deep learning. J. Tongji Univ. Nat. Sci. 2026, 54, 150–159. [Google Scholar]
  12. Pan, Q.; Jiao, Y.B.; Jiang, M.M. Fatigue recognition of high-speed railway drivers based on facial features. Compr. Transp. 2026, 48, 69–75. [Google Scholar]
  13. Wang, H.W.; Xu, E.Z.; Cai, G.J.; Zhang, Z.R.; Zhang, S.Y.; You, F. Nighttime fatigue detection method integrating temporal and state accumulation. Transp. Sci. Econ. 2026, 28, 48–55. [Google Scholar]
  14. Wu, J.Y.; Teng, W. Research on real-time detection system for driver dangerous behavior based on deep learning. Automot. Electr. Appl. 2026, 115–117. [Google Scholar]
  15. Zhang, J.H.; Du, F.; Wu, J.Q.; Huang, B.; Yang, C. Lightweight and real-time improvement of YOLOv8n for driver fatigue detection. Opto-Electron. Eng. 2025, 52, 16–28. [Google Scholar]
  16. Fa, S.X. Driving Risk Recognition Algorithm Based on Body Movements and Facial Features. Master’s Thesis, University of Jinan, Jinan, China, 2024. [Google Scholar]
  17. Tang, K.; Jin, W.Y.; Lu, N.C.; Wu, B.D. Research on cloud-based fatigue driving detection algorithm based on comprehensive facial features and gated recurrent unit. Radio Commun. Technol. 2026, 52, 725–734. [Google Scholar]
  18. Wang, Y.; Huang, C.; Han, K.; Wang, Y. Dynamic neural networks: A survey. arXiv 2020, arXiv:2102.04906. [Google Scholar] [CrossRef] [Scilit]
  19. Wu, Z.; Nagarajan, T.; Kumar, A.; Rennie, S.; Davis, L.S.; Grauman, K.; Feris, R. BlockDrop: Dynamic inference paths in residual networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; pp. 8817–8826. [Google Scholar] [CrossRef] [Scilit]
  20. Weng, C.H.; Lai, Y.H.; Lai, S.H. Driver drowsiness detection via a hierarchical temporal deep belief network. In Proceedings of the Asian Conference on Computer Vision (ACCV), Taipei, Taiwan, 20–24 November 2016; pp. 117–133. [Google Scholar]
  21. Hu, Y.M.; Wang, X.H.; Deng, B. Research progress on multimodal information fusion. J. Image Graph. 2026, 1–11. [Google Scholar] [CrossRef] [Scilit]
  22. Fonseca, T.; Ferreira, S. Drowsiness detection in drivers: A systematic review of deep learning-based models. Appl. Sci. 2025, 15, 9018. [Google Scholar] [CrossRef] [Scilit]
  23. Zhang, G.; Yang, F.; Fang, X.; Wang, L.; Zhao, L.; Yu, C. Adaptive detection method for driver fatigue using facial multisource dynamic behavior fusion. Eng. Appl. Artif. Intell. 2025, 162, 112482. [Google Scholar] [CrossRef] [Scilit]
  24. Zhang, Y.; Xu, X.; Du, Y.; Zhang, N. TMU-Net: A transformer-based multimodal framework with uncertainty quantification for driver fatigue detection. Sensors 2025, 25, 5364. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  25. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  26. Yang, T.-Y.; Chen, Y.-T.; Lin, Y.-Y.; Chuang, Y.-Y. FSA-Net: Learning fine-grained structure aggregation for head pose estimation from a single image. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, 15–20 June 2019; pp. 1087–1096. [Google Scholar] [CrossRef] [Scilit]
  27. Yang, S.; Luo, P.; Loy, C.-C.; Tang, X. WIDER FACE: A face detection benchmark. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 5525–5533. [Google Scholar] [CrossRef] [Scilit]
  28. Ma, N.; Zhang, X.; Zheng, H.T.; Sun, J. ShuffleNet V2: Practical guidelines for efficient CNN architecture design. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 116–131. [Google Scholar]
  29. Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.C. MobileNetV2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; pp. 4510–4520. [Google Scholar]
  30. Howard, A.; Sandler, M.; Chu, G.; Chen, L.C.; Chen, B.; Tan, M.; Wang, W.; Zhu, Y.; Pang, R.; Vasudevan, V.; et al. Searching for MobileNetV3. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Republic of Korea, 27 October–2 November 2019; pp. 1314–1324. [Google Scholar]
  31. Tan, M.; Le, Q. EfficientNetV2: Smaller models and faster training. In Proceedings of the International Conference on Machine Learning (ICML), Online, 18–24 July 2021; pp. 10096–10106. [Google Scholar]
  32. Liang, X.; Liang, J.; Yin, T.; Tang, X. A lightweight method for face expression recognition based on improved MobileNetV3. IET Image Process. 2023, 17, 2375–2384. [Google Scholar] [CrossRef] [Scilit]
  33. Mehta, S.; Rastegari, M. MobileViT: Light-weight, general-purpose, and mobile-friendly vision transformer. arXiv 2021, arXiv:2110.02178. [Google Scholar]
  34. Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), Montreal, QC, Canada, 11–17 October 2021; pp. 10012–10022. [Google Scholar]
  35. Jia, H.; Xiao, Z.; Ji, P. Fatigue driving detection based on deep learning and multi-index fusion. IEEE Access 2021, 9, 147054–147062. [Google Scholar] [CrossRef] [Scilit]
  36. Phan, A.C.; Trieu, T.N.; Phan, T.C. Driver drowsiness detection and smart alerting using deep learning and IoT. Internet Things 2023, 22, 100705. [Google Scholar] [CrossRef] [Scilit]
  37. Desai, M.M.; Kathad, K.; Modi, N. Real-time driver drowsiness detection using hybrid CNN-LSTM model with facial feature and behavioral analysis. In Proceedings of the 2024 4th International Conference on Ubiquitous Computing and Intelligent Information Systems (ICUIS), Gobichettipalayam, Erode, India, 12–13 December 2024; pp. 197–202. [Google Scholar] [CrossRef] [Scilit]
  38. Van der Maaten, L.; Hinton, G. Visualizing data using t-SNE. J. Mach. Learn. Res. 2008, 9, 2579–2605. [Google Scholar]
  39. Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), Venice, Italy, 22–29 October 2017; pp. 618–626. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.