Lightweight dynamic image enhancement enabling real-time fatigue driving detection method
The LDIE-FDNet fatigue driving detection network, which utilizes lightweight dynamic image enhancement, combined with a multi-channel Retinex model and feature fusion module, solves the problems of accuracy and real-time performance in fatigue driving detection under low-light conditions, and achieves efficient fatigue driving behavior recognition.
Patent Information
- Application Number
- CN202511020797.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-11-21
AI Technical Summary
Existing fatigue driving detection methods lack accuracy under low light conditions, and traditional deep learning networks consume a lot of computing resources, making it difficult to meet the requirements of real-time performance and accuracy.
The real-time fatigue driving detection network LDIE-FDNet, which is powered by lightweight dynamic image enhancement, includes the low-light image enhancement network MSR-LIENet with a multi-channel Retinex model, the feature extraction module Backbone, the dynamic multi-level feature fusion module Neck, and the regression detection module Head. Through multi-level feature fusion and lightweight design, it reduces the amount of computation and parameters, and improves detection accuracy and real-time performance.
It improves the accuracy of fatigue driving behavior recognition under low light conditions, reduces computing resource consumption, achieves efficient fatigue driving detection, and is suitable for real-time applications.
Smart Images

Figure CN120997808A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of behavior recognition, specifically relating to a lightweight dynamic image enhancement-enabled real-time fatigue driving detection method. Background Technology
[0002] In recent years, with the rapid growth of the global economy, the number of motor vehicles has increased rapidly. Convenient transportation has also led to an increase in various traffic accidents, resulting in significant property damage and personal injury, posing a huge safety hazard to society. Research has found that traffic accidents caused by abnormal driving behavior account for 14% to 33% of major accidents. For example, behaviors such as using a mobile phone while driving, smoking, not wearing a seatbelt, and driving while fatigued severely interfere with the driver's attention, making it impossible to focus on observing the road conditions ahead and around them. In the event of an emergency, the driver often cannot react correctly in time, leading to traffic accidents and causing loss of life and property. When people exhibit abnormal driving behavior, their cognitive abilities and ability to perform safety-related tasks are reduced, thus increasing the risk of traffic accidents. Therefore, researching and designing accurate and real-time algorithms and methods for detecting abnormal driver behavior, accurately judging the driver's abnormal driving state in real time, and issuing alarms when abnormal behavior is detected, is of great significance for improving driving safety, preventing traffic accidents caused by abnormal behavior in a timely manner, reducing the accident rate, and improving road safety levels. This research has high social benefits and practical value.
[0003] Currently, methods for detecting abnormal driving behavior are mainly divided into four categories: detection methods based on driver physiological characteristics, detection methods based on vehicle motion characteristics, detection methods based on driver facial features, and abnormal driving behavior detection methods based on multi-feature fusion.
[0004] (1) Detection methods based on physiological characteristics
[0005] Fatigue detection methods based on driver physiological characteristics refer to techniques and methods that utilize the driver's own physiological data and characteristics to detect whether the driver is in a state of fatigue. These methods indirectly detect the driver's fatigue state by monitoring physiological indicators such as heart rate, eye movement, and electroencephalogram (EEG).
[0006] (2) Detection method based on vehicle motion characteristics
[0007] Fatigue driving detection methods based on vehicle driving characteristics analyze feature data collected by relevant sensors on the vehicle to determine the driver's driving state. These characteristics mainly include steering wheel grip force, vehicle steering angle, and vehicle speed. Researchers indirectly detect driver fatigue by recording and analyzing changes in these data.
[0008] (3) Detection method based on driver's facial features
[0009] Fatigue driving detection methods based on driver facial features are techniques that detect fatigue driving by analyzing features such as driver facial expressions, eye movements, and head posture. This method typically utilizes computer vision and image processing techniques, combined with machine learning algorithms, to indirectly detect the driver's fatigue state.
[0010] (4) Fatigue driving detection method based on multi-feature fusion
[0011] The above-mentioned abnormal driving behavior detection methods are all based on a single modality. Single-modal methods typically rely on only one data source or sensor, such as images, sound, or physiological signals, which limits their applicability in different contexts. Fatigue states manifest in diverse ways, and a single modality cannot capture all relevant information. External environmental conditions, such as light, noise, and vibration, may interfere with single-modal detection methods, leading to performance degradation. Abnormal driving behavior detection methods based on multi-feature fusion can solve the above problems and improve the accuracy, stability, and generalization of the model.
[0012] Traditional feature-based detection methods often rely on feature extraction and shallow network training. While this approach offers fast detection speeds, its accuracy is inconsistent. Deep learning-based detection methods typically use deep networks as the training ground for features. The increased number of layers and parameters leads to higher accuracy but also reduces speed and increases computational and memory usage. Furthermore, variations in driver posture and position result in significant differences in the scale of target features and skewed angles of extracted features, further impacting accuracy. Since fatigue driving detection demands extremely high real-time performance and accuracy, using traditional deep learning networks for abnormal driving behavior detection lacks practicality. Summary of the Invention
[0013] The purpose of this invention is to provide a lightweight dynamic image enhancement-enabled real-time fatigue driving detection method, which can improve the recognition accuracy and reliability of fatigue driving behavior detection under low light conditions, minimize the amount of computation and parameters while ensuring prediction accuracy, and also improve real-time performance.
[0014] To achieve the above objectives, the present invention provides the following technical solution:
[0015] A lightweight dynamic image enhancement method for real-time fatigue driving detection includes the following steps:
[0016] Step 1: Construct a lightweight dynamic image enhancement-enabled real-time fatigue driving detection network LDIE-FDNet. The lightweight dynamic image enhancement-enabled real-time fatigue driving detection network LDIE-FDNet includes a low-light image enhancement network MSR-LIENet based on a multi-channel Retinex model, a feature extraction module Backbone, a dynamic multi-level feature fusion Neck, and a regression detection module Head.
[0017] The low-light image enhancement network MSR-LIENet based on the multi-channel Retinex model consists of a generator and a discriminator, wherein the generator includes an initialization module, a reflection denoising module, and an illumination enhancement module.
[0018] The feature extraction module is structured as a six-layer feature pyramid built by a CNN network. The first layer L1 extracts low-level feature information from the input image through convolution operations. The second to fifth layers L2 to L5 are composed of the Conv module and the GSConv_C3k2 module. The sixth layer L6 is composed of the SPPF module and the C2PSA module.
[0019] The dynamic multi-level feature fusion module includes the lightweight dynamic upsampling module DySample and the multi-level feature fusion SDI module;
[0020] Step 2: Divide the fatigue driving behavior sample dataset into training set, validation set and test set sample datasets. Use lightweight dynamic image enhancement to empower the real-time fatigue driving detection network to extract fatigue driving behavior features from the images in the training set and train the model.
[0021] Step 2.1: Collect classroom behavior images and input them into the low-light image enhancement network of the multi-channel Retinex model to enhance the low-light images;
[0022] Step 2.2: Input the enhanced fatigue driving behavior image into the feature extraction module to convert the original input image into a multi-layer feature map and extract the feature information of the image;
[0023] Step 2.3: Input the feature information output from the feature extraction module at different scales into the multi-scale feature fusion module for fusion to obtain the fused feature information;
[0024] Step 2.4: Input the fused feature information into the regression prediction module. The regression detection module maps the extracted features to the final output space to generate a prediction image, which is used to simulate the performance of the model in actual application, thereby evaluating the generalization performance of the trained model and completing the detection of fatigue driving behavior.
[0025] Step 2.5: Calculate the total loss;
[0026] Step 2.6: Update the parameters of the lightweight dynamic image enhancement-enabled real-time fatigue driving detection network;
[0027] Step 3: Use the validation set to evaluate the performance of the lightweight dynamic image enhancement-enabled real-time fatigue driving detection network and optimize the parameters;
[0028] Step 4: Obtain the optimal model parameters for the validation set, input photos from the test set to generate predicted images, and complete the detection of fatigue driving behavior.
[0029] Furthermore, the specific process of step 2.1 includes:
[0030] (1) The initialization module is used to process the input low-light image and accurately decompose it into illumination component and reflection component;
[0031] (2) Then, the separated reflection component is input into the reflection denoising module to reduce the noise in the reflection component. At the same time, the separated illumination component is input into the illumination enhancement module to improve the illumination effect and make the image look brighter and clearer.
[0032] (3) Multiply the denoised reflection component and the enhanced illumination component to obtain the final low-light image enhancement result.
[0033] (4) The enhanced image is compared with the high-quality image selected by the discriminator, and the adversarial loss is calculated to determine whether the enhanced image is perceptually close to the high-quality standard.
[0034] Furthermore, the specific process of step 2.2 includes:
[0035] (1) Use standard convolution to reduce the dimensionality of the input feature C1, reducing the number of channels to C2 / 2, which effectively captures the basic features while reducing computational complexity;
[0036] (2) Use depthwise convolution DWConv to process features independently per channel and introduce a sparsity strategy to enhance feature diversity and detail representation.
[0037] (3) The outputs of standard convolution and depthwise convolution are fused to generate a complete feature map with C2 channels, and the distribution of channel information is optimized by channel shuffling operation to improve the cross-channel feature interaction capability.
[0038] Furthermore, the specific process of step 2.3 includes:
[0039] Step 2.3.1: Capture subtle features in the image using the dynamic upsampler DySample;
[0040] First, the input feature map of a given size C×H×W is transformed into a sampling set S of size 2×sH×sW by a sampling point generator, where the first dimension 2 in S represents the x and y coordinates; then, the input features are resampled using the gridsample function to obtain an upsampled feature map of size C×sH×sW.
[0041] Step 2.3.2: The SDI module enhances the semantic and detail information in the image by integrating feature maps from multiple levels generated by the encoder;
[0042] (1) Feature extraction: First, the encoder generates feature maps of multiple levels for the input image. The feature maps contain information of different scales and levels, from low-level detail information to high-level semantic information.
[0043] (2) Attention mechanism: In the SDI module, spatial and channel attention mechanisms are applied to process the features at each level, enabling the features to integrate local spatial information and global channel information, thereby improving the representation ability of the features;
[0044] (3) Feature fusion: For each level of feature map, the SDI module will fuse high-level features that contain more semantic information and low-level features that capture more fine details;
[0045] (4) Feature transmission and decoding: The refined features are then passed to the decoder for parsing, reconstruction, image segmentation, or object detection.
[0046] Furthermore, the process of the regression detection module in step 2.4 is as follows:
[0047] (1) Receive features of different scales output by the feature extraction module, where high-resolution feature maps are used to preserve details in the image, while low-resolution feature maps help to extract higher-level semantic information.
[0048] (2) Channel unification processing is performed on the features at each scale output by the feature extraction module. The features with different numbers of channels are reduced to the same dimension through a 1×1 convolutional layer.
[0049] (3) Multi-scale feature fusion is carried out by constructing top-down and bottom-up fusion paths to achieve complementary enhancement between features at different levels, which not only supplements the semantic information of high-level features, but also restores the detailed information in low-level features.
[0050] (4) The fused features are further enhanced by using the SPPF module. The features are pooled by pooling kernels of different sizes to extract multi-scale contextual information and enhance the adaptability to targets of different sizes.
[0051] (5) Generate multiple detection feature maps of different scales to correspond to the detection requirements of large, medium and small targets respectively;
[0052] (6) Predict the offset of the preset anchor box at each grid point, including the center coordinate offset and width and height scaling, and convert the bounding box coordinates into absolute coordinates, and then perform target confidence prediction and class probability prediction.
[0053] (7) For each real target box, based on the preset intersection-union ratio (IoU) between the anchor box and the real box, the anchor box that best matches it is matched as a "positive sample" and is responsible for the bounding box regression and category classification learning task of the real target box; the anchor box that does not match any real box is used as a "negative sample" and only participates in the calculation of target confidence loss to suppress false detection of background areas.
[0054] (8) Summarize the prediction results of all detection feature maps to form an initial set of detection boxes; then, remove the duplicate detection bounding boxes by using the non-maximum suppression (NMS) algorithm, that is, retain the detection box with the highest confidence and remove redundant boxes with an intersection-union ratio (IoU) higher than a set threshold, and finally output concise and accurate detection results.
[0055] Furthermore, the total loss function in step 2.5 is constructed through the following process:
[0056] Define the PIOU loss function:
[0057]
[0058] PIou=Iou-f(P),-1≤PIOU≤1
[0059] L PIou =1-PIou=L Iou +f(P),0≤L PIoU ≤2
[0060] In the formula, P is a penalty factor adapted to the target size, where dw1, dw2, dh1, and dh1 are the absolute values of the distances between the corresponding edges of the predicted bounding box and the target bounding box, and w gt and h gt The width and height of the target bounding box are represented by f(x), and the function f(x) is designed to adaptively adjust the gradient magnitude based on the quality of the detection box.
[0061] By combining the focusing mechanism and introducing a non-monotonic attention function combined with PIOU, a new loss function PIOUv2 is obtained:
[0062] q = e -p ,q∈(0,1]
[0063]
[0064] In the formula, L PIoU v2 Let u(λq) represent the loss function based on PIOUv2, where P represents the penalty factor, q represents the parameter that measures the quality of the detection box, λ is the hyperparameter that controls the behavior of the attention function, u(x) represents the attention function, and u(λq) represents the non-monotonic attention function.
[0065] Furthermore, the process of generating the predicted image in step 4 includes:
[0066] (1) Image input: Input the image to be detected into the detection network LDIE-FDNet;
[0067] (2) Forward propagation: Perform forward propagation on the input image, extract features layer by layer using the multi-layer architecture of the neural network and fuse the multi-scale features of the Neck part to generate a feature map, and complete the initial generation of the prediction result for each position at the preset anchor point.
[0068] (3) Confidence filtering: For the multiple bounding box prediction results generated at each anchor point, the confidence scores are filtered to retain the bounding boxes with higher than the set threshold as the final prediction box output.
[0069] (4) Non-maximum suppression (NMS): Apply the non-maximum suppression algorithm to the filtered prediction boxes to remove redundant boxes that highly overlap with the highest confidence box and have low confidence.
[0070] (5) Output results: After NMS processing, the remaining bounding boxes are the final detection results. Each predicted box contains the bounding box coordinates (position information) of the target object and its corresponding category label.
[0071] Compared with the prior art, the present invention has the following beneficial effects:
[0072] This invention utilizes a lightweight dynamic image enhancement-enabled real-time fatigue driving detection network. It achieves lightweight and highly accurate fatigue driving behavior recognition through a low-light image enhancement network (MSR-LIENet) based on a multi-channel Retinex model, a Backbone feature extraction module, a dynamic multi-level feature fusion module (Neck), and a regression detection module (Head). By dividing the sample dataset into training, validation, and test sets, the model training process is ensured to be efficient and scientific, helping to avoid overfitting. The MSR-LIENet low-light image enhancement network, based on a multi-channel Retinex model, significantly improves the detection accuracy of low-light images. The GSConv_C3k2 module in the Backbone combines the C3k2 and GSConv modules, featuring a lightweight design that efficiently captures remote contextual information, reducing the number of parameters and computational load. It also employs a variable convolution kernel design and feature segmentation and concatenation to enhance feature extraction capabilities. The Neck section combines the Dynamic Upsampler (DySample) and Multi-Level Feature Fusion (SDI) to enhance semantic and detail information. Through SDI, the model can better capture information about various targets, reducing false negatives and false negatives, thereby improving overall detection performance. Furthermore, it does not require high-resolution guiding features as input, resulting in lower inference latency, memory usage, floating-point operations, and parameter count.
[0073] Furthermore, this invention introduces the PioUv2 loss function. The PioUv2 loss calculates the IoU pixel-by-pixel, which can better optimize the localization of rotated bounding boxes and handle targets with high aspect ratios, reduce background overlap, and improve detection performance. Moreover, the PioUv2 loss function is continuously differentiable, meaning that it can be effectively optimized during training using methods such as gradient descent, avoiding gradient vanishing or exploding problems, thus ensuring the stability and effectiveness of training. Attached Figure Description
[0074] Figure 1 Overall architecture diagram of the lightweight dynamic image enhancement network for real-time fatigue driving detection in this invention;
[0075] Figure 2 This is a schematic diagram of the low-light image enhancement network structure of the multi-channel Retinex model of the present invention;
[0076] Figure 3 This is a schematic diagram of the GSConv_C3k2 structure of the present invention;
[0077] Figure 4 This is a schematic diagram of the structure of the lightweight dynamic upsampling module DySample;
[0078] Figure 5 This is a schematic diagram of the structure of the multi-level feature fusion (SDI) module;
[0079] Figure 6 This is a schematic diagram of the structure of the PIOUv2 loss function. Detailed Implementation
[0080] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0081] like Figure 1 As shown in this embodiment, a lightweight dynamic image enhancement-enabled real-time fatigue driving detection method includes the following steps:
[0082] Step 1: Construct a lightweight dynamic image enhancement network for real-time fatigue driving detection, LDIE-FDNet.
[0083] The lightweight dynamic image enhancement network LDIE-FDNet, which enables real-time fatigue driving detection, includes the low-light image enhancement network MSR-LIENet based on the multi-channel Retinex model, the feature extraction module Backbone, the dynamic multi-level feature fusion Neck, and the regression detection module Head.
[0084] like Figure 2 As shown, the low-light image enhancement network MSR-LIENet, based on the multi-channel Retinex model, consists of a generator and a discriminator. The generator comprises three modules: an initialization module, a reflection denoising module, and an illumination enhancement module. The initialization module accurately decomposes the input low-light image into illumination and reflection components. The results are then fed into the reflection denoising and illumination enhancement modules for denoising and enhancement, respectively. The results are multiplied to obtain the final low-light image enhancement result. The discriminator compares the image with manually selected high-quality images, using adversarial loss to determine whether the image is perceptually of high quality. This achieves good results in terms of both signal fidelity and human perceptual quality.
[0085] like Figure 3 As shown, the feature extraction module is structured as a six-layer feature pyramid built using a CNN network. The first layer, L1, extracts low-level feature information from the input image through convolutional operations. Layers L2 to L5 consist of Conv and GSConv_C3k2 modules, while the sixth layer, L6, consists of SPPF and C2PSA modules. The core of BackBone is the introduction of the GSConv_C3k2 module. GSConv_C3k2 combines C3k2 and GSConv modules, offering lightweight and efficient capture of remote context information, reducing the number of parameters and computational load. Furthermore, it employs a variable convolutional kernel design and feature segmentation and concatenation to enhance feature extraction capabilities.
[0086] To improve efficiency without compromising detection accuracy, the GSConv_C3k2 module was designed by introducing GSConv into the C3K2 module to replace the original standard convolutional structure. During the feature extraction stage, GSConv_C3k2 effectively reduces computational costs and alleviates the computational burden on the model through dimensionality reduction, sparsity design, and channel optimization, thereby achieving a lightweight detection model.
[0087] The dynamic multi-level feature fusion module combines the lightweight dynamic upsampling module DySample and the multi-level feature fusion SDI module to enhance semantic and detailed information. Through multi-level feature fusion, the model can better capture information about various targets, reducing false negatives and false negatives, thereby improving the overall detection performance. Furthermore, it does not require high-resolution guiding features as input, resulting in lower inference latency, memory usage, floating-point operations, and parameter count. The introduction of this module significantly improves the network's detection efficiency, making it more suitable for real-time detection of abnormal driving behavior.
[0088] The main function of the regression detection module is to reduce or adjust the dimensionality of the features from the backbone, further extract and integrate features from multiple scales, and fuse features from different scales to enhance the model's ability to capture information at different scales in the image and effectively fuse features at different levels.
[0089] The Neck section combines the dynamic upsampler DySample and the multi-level feature fusion (SDI) module. The DySample structure is as follows: Figure 4 As shown, it captures subtle features in the image, better preserving image details. Furthermore, DySample employs a point sampling method for dynamic upsampling, avoiding the complex dynamic convolution and sub-network construction processes common in traditional kernel-based dynamic upsampling methods, significantly reducing the number of parameters. This module, by defining upsampling from a point sampling perspective, not only effectively enhances the model's robustness to interference but also has fewer parameters and saves computational resources compared to kernel-based dynamic upsampling modules, facilitating real-time detection of abnormal driving behavior. Introducing the DySample lightweight dynamic upsampling module concentrates sampling points in the target region while ignoring background color interference, enhancing the algorithm's robustness to interference. Compared to traditional dynamic upsampling modules, it has fewer parameters and saves computational resources. The structure diagram of the SDI module is shown below. Figure 5 As shown, Multi-Level Feature Fusion (SDI) is a module that replaces the Concat operation by integrating feature maps from multiple levels generated by the encoder to enhance semantic and detail information in an image.
[0090] The regression detection module (Head) maps the extracted features to the final output space, generating the network's final prediction result.
[0091] Step 2: Divide the fatigue driving behavior sample dataset into training, validation, and test datasets. Use lightweight dynamic image enhancement to empower the real-time fatigue driving detection network to extract fatigue driving behavior features from the images in the training set for model training.
[0092] Step 2.1: Collect classroom behavior images and input them into the low-light image enhancement network of the multi-channel Retinex model to enhance the low-light images.
[0093] Image I(x,y) consists of an illumination image and a reflectance image. The former contains information about the incident component of the object, denoted by L(x,y); the latter contains information about the reflected component of the object, denoted by R(x,y). Retinex theory can be expressed as:
[0094] I(x,y)=R(x,y)⊙L(x,y) (1)
[0095] Where ⊙ represents element-wise multiplication. In the study of low-light image enhancement, by comparing a large number of low-light images and normal-light images, it was found that there is a linear relationship between the RGB three channels of the two, but the slope of the pixel value enhancement between the three channels is different. This is because the illumination is different and the spectral energy distribution of the illumination is different. Even for low-light image datasets generated by different exposure times, such as the LOL dataset, after camera image signal processing such as camera built-in white balance and color correction, the enhancement ratio between the RGB three channels is different. Therefore, when enhancing low-light, formula (1) is changed to formula (2).
[0096] I(x,y)=R(x,y)⊙L c (x,y) (2)
[0097] Where L c (x,y) represents the illuminance components of the RGB three channels, c∈{R,G,B}. In the illumination enhancement module, the illumination of the three channels is enhanced separately to avoid color shift.
[0098] The specific process of image enhancement includes:
[0099] (1) The initialization module is used to process the input low-light image and accurately decompose it into illumination component and reflection component;
[0100] (2) Then, the separated reflection component is input into the reflection denoising module to reduce the noise in the reflection component. At the same time, the separated illumination component is input into the illumination enhancement module to improve the illumination effect and make the image look brighter and clearer.
[0101] (3) Multiply the denoised reflection component and the enhanced illumination component to obtain the final low-light image enhancement result.
[0102] (4) The enhanced image is compared with the high-quality image selected by the discriminator, and the adversarial loss is calculated to determine whether the enhanced image is perceptually close to the high-quality standard.
[0103] Step 2.2: Input the enhanced fatigue driving behavior image into the feature extraction module to convert the original input image into a multi-layer feature map and extract the image's feature information.
[0104] In real-world abnormal driving behavior detection, the background is complex and timeliness is critical, making it extremely challenging to extract abnormal behavior features from driving images with minimal computation. The C3k2 module, an optimized version of the CSPBottleneck (cross-stage residual bottleneck), is designed to improve computational efficiency. C3k2 reduces computation through several layers of compact convolutional structures while still maintaining the ability to extract deep features.
[0105] The C3k2 module, a faster implementation of CSPBottleneck, improves data processing efficiency by employing two parallel convolutional layers. Key parameter adjustments in C3k2 give it a speed advantage, ensuring controlled processing latency while maintaining accuracy, making it suitable for real-time applications such as handling abnormal driving behavior.
[0106] SC standard convolutional features are commonly used for feature extraction and have powerful global feature aggregation capabilities, but the number of features and computational complexity limit their real-time performance. Its computational complexity To is... SC for:
[0107] T SC =W·H·K 2 ·C1·C2 (3)
[0108] In the formula: W and H are the width and height of the feature map; K is the size of the convolution kernel; C1 and C2 are the number of channels of the input and output feature maps. As can be seen from Equation (1), the computational complexity increases linearly with the resolution (W·H) and proportionally with the product of the number of channels (C1·C2), resulting in high resource consumption in high-resolution or multi-channel scenarios and limiting real-time applications.
[0109] To reduce computational complexity, lightweight convolutional methods such as DWConv (depthwise separable convolutions) have gained increasing attention, with depthwise separable convolution being a common approach. DWConv significantly reduces computational complexity through a decomposition design involving channel-wise convolution and pointwise convolution. However, channel-wise convolution processes features independently, failing to adequately model inter-channel correlations, leading to incomplete feature integration. This limitation weakens the continuity of information representation and results in poor performance in tasks requiring the extraction of subtle features, such as driver fatigue detection.
[0110] To address this, this invention introduces Group Sparse Convolution (GSConv) and designs GSConv_C3k2, a lightweight convolution module that balances computational efficiency and feature integrity. Through structural optimization, GSConv enhances the extraction of subtle features and the modeling of inter-channel information while reducing computational costs, effectively compensating for the shortcomings of DWConv.
[0111] The process of feature extraction module extracting feature information is as follows:
[0112] (1) Use standard convolution to reduce the dimensionality of the input feature C1, reducing the number of channels to C2 / 2, which effectively captures the basic features while reducing computational complexity;
[0113] (2) Use depthwise convolution DWConv to process features independently per channel and introduce a sparsity strategy to enhance feature diversity and detail representation.
[0114] (3) The outputs of standard convolution and depthwise convolution are fused to generate a complete feature map with C2 channels, and the distribution of channel information is optimized by channel shuffling operation to improve the cross-channel feature interaction capability.
[0115] Step 2.3: Input the feature information output from the feature extraction module at different scales into the multi-scale feature fusion module for fusion to obtain the fused feature information;
[0116] Step 2.3.1: Capture subtle features in the image using the dynamic upsampler DySample.
[0117] The specific process is as follows:
[0118] DySample employs a point sampling method to achieve dynamic upsampling. The specific process is as follows: First, the input feature map of a given size C×H×W is transformed into a sampling set S of size 2×sH×sW using a sampling point generator, where the first dimension 2 in S represents the x and y coordinates. Then, the gridsample function is used to resample the input features, resulting in an upsampled feature map of size C×sH×sW.
[0119] In the design of DySample, the sampling point generator is a key component for achieving efficient upsampling. This part generates an offset S by combining a linear layer, a dynamic range factor O, and pixel shuffle sub-pixel convolutions. This offset S is then added to the original grid positions G to obtain the final sample set S. The introduction of the dynamic range factor O improves the flexibility of the offset and alleviates the overlap problem between offsets. This process can be represented as:
[0120] Ο=0.5sigmoid(linear1(X)·linear2(X)) (4)
[0121] Where X is the input tensor, linear1(X) is the first linear transformation, linear2(X) is the second linear transformation, · indicates that the two linear transformations are multiplied element by element, and sigmoid(.) is the activation function that maps the input values to the range [0,1] with a scaling factor of 0.5.
[0122] The advantages of DySample:
[0123] (1) DySample is a point-sampling-based design that divides a point into multiple points to achieve clearer edges.
[0124] (2) DySample does not require high-resolution guiding features as input, nor does it require additional CUDA packages.
[0125] (3) DySample implements the upsampling process through dynamic sampling to find the correct semantic clustering for each upsampling point.
[0126] (4) DySample is more lightweight in implementation, does not require a customized CUDA package, and has lower computational resource consumption.
[0127] Step 2.3.2: The SDI module enhances the semantic and detail information in the image by integrating feature maps from multiple levels generated by the encoder.
[0128] (1) Feature extraction: First, the encoder generates feature maps at multiple levels for the input image. These feature maps contain information at different scales and levels, from low-level detail information to high-level semantic information.
[0129] (2) Attention Mechanism: In the SDI module, spatial and channel attention mechanisms are applied to process the features at each level. This allows the features to integrate local spatial information and global channel information, thereby improving the representation capability of the features.
[0130] (3) Feature fusion: For each level of feature map, the SDI module fuses high-level features containing more semantic information with low-level features capturing finer details. This is usually achieved through a simple Hadamard product operation or other fusion strategies.
[0131] (4) Feature transmission and decoding: The refined features are then passed to the decoder for parsing, reconstruction, image segmentation, or object detection.
[0132] Replacing Concat with an SDI module offers the following advantages:
[0133] (1) Improve accuracy: Through multi-level feature fusion, the SDI module can effectively solve the problems of information loss and semantic bias, thereby improving the accuracy of segmentation or detection.
[0134] (2) Maintaining computational and memory efficiency: Despite the increased complexity of feature fusion, the SDI module still maintains computational and memory efficiency, making it feasible in practical applications.
[0135] Step 2.4: Input the fused feature information into the regression prediction module. The regression detection module maps the extracted features to the final output space to generate a predicted image, which is used to simulate the model's performance in real-world applications. This is used to evaluate the generalization performance of the trained model and complete the detection of fatigue driving behavior.
[0136] The regression detection module's workflow is as follows:
[0137] (1) Receive features of different scales output by the feature extraction module, where high-resolution feature maps are used to preserve details in the image, while low-resolution feature maps help to extract higher-level semantic information.
[0138] (2) Channel unification processing is performed on the features at each scale output by the feature extraction module. The features with different numbers of channels (such as 256, 512, 1024) are uniformly reduced to the same dimension (such as 256) through a 1×1 convolutional layer.
[0139] The purpose of this operation is to: reduce the amount of computation and avoid redundant computation caused by channel mismatch during subsequent fusion; and unify the feature dimensions to provide a foundation for the effective fusion of multi-scale features.
[0140] (3) Multi-scale feature fusion is carried out by constructing top-down and bottom-up fusion paths to achieve complementary enhancement between features at different levels, which not only supplements the semantic information of high-level features, but also restores the detailed information in low-level features.
[0141] (4) Further enhance the fused features through the SPPF module. Pool the features using different sizes of pooling kernels (such as 1×1, 5×5, 9×9) to extract multi-scale contextual information and enhance adaptability to targets of different sizes.
[0142] (5) Generate multiple detection feature maps of different scales to correspond to the detection requirements of large, medium and small targets respectively;
[0143] (6) Predict the offset of the preset anchor box at each grid point, including the center coordinate offset (the offset ratio relative to the top left corner of the grid) and the width and height scaling (the scaling ratio relative to the width and height of the anchor box), and convert the bounding box coordinates into absolute coordinates, and then perform target confidence prediction and class probability prediction.
[0144] (7) For each real target box, based on the Intersection over Union (IoU) between the preset anchor boxes (with different scales and aspect ratios) and the real boxes, the anchor box that best matches it is matched as a "positive sample" and is responsible for the bounding box regression and category classification learning task of the real target box; the anchor box that does not match any real box is used as a "negative sample" and only participates in the calculation of target confidence loss to suppress false detection of background areas.
[0145] (8) Summarize the prediction results (including bounding box coordinates, target confidence and class probability) of all detection feature maps to form an initial set of detection boxes; then, remove duplicate detection bounding boxes by non-maximum suppression (NMS) algorithm, that is, retain the detection box with the highest confidence and remove redundant boxes with an intersection-union ratio (IoU) higher than a set threshold, and finally output concise and accurate detection results.
[0146] Step 2.5: Calculate the total loss
[0147] To better measure the similarity between predicted and ground truth bounding boxes, this invention employs the PIOUv2 loss function. This loss function calculates the cross-union ratio (CURRR) by counting pixels within the image, and it is sensitive to the size and position of the bounding boxes. Figure 6 As shown, the PIoUv2 loss function combines an adaptive penalty factor for target size with a gradient adjustment function based on the quality of the detection box to guide the detection box to regress along an effective path, thus converging faster than existing IoU-based losses.
[0148] The PIoU loss function combines an adaptive penalty factor based on target size and a gradient adjustment function based on the quality of the detection box to guide the detection box to regress along an effective path, thus converging faster than existing IoU-based losses. PIoU is illustrated in Equation 5-8.
[0149]
[0150] PIou=Iou-f(P),-1≤PIou≤1 (7)
[0151] L PIou =1-PIou=L Iou +f(P),0≤L PIoU ≤2 (8)
[0152] In the formula, P is a penalty factor that adapts to the target size, demonstrating adaptability to the target size. Using this penalty factor in the loss function will not cause the detection box to be enlarged. dw1, dw2, dh1, and dh1 are the absolute values of the distances between the corresponding edges of the predicted box and the target box, respectively. gt and h gt The x and y values represent the width and height of the bounding box, and the f(x) function is designed to adaptively adjust the gradient magnitude based on the quality of the detection box; Iou represents the intersection-union ratio (IoU), and L... Iou L represents the loss function based on the intersection-to-union ratio (IoU); PIou This represents the loss function based on PIOU.
[0153] By combining a focusing mechanism and introducing a non-monotonic attention function integrated with PIoU, a new loss function, PIoUv2, is obtained. PIoUv2 enhances the ability to focus on medium-quality bounding boxes, as shown in Equation 9-11:
[0154] q = e -p ,q∈(0,1] (9)
[0155]
[0156] In the formula, L PIoUv2 Let u(λq) represent the loss function based on PIOUv2, where q represents the attention function, replacing the penalty factor P. q measures the quality of the detection boxes and ranges from (0,1]. λ is a hyperparameter that controls the behavior of the attention function. u(x) represents the attention function itself; the non-monotonic attention function u(λq) enhances PIOU's ability to focus on medium-quality detection boxes. PIOUv2 requires only one hyperparameter, simplifying the model tuning process.
[0157] The process of PIoUv2 is as follows:
[0158] (1) Analysis of anchor box expansion problem: Existing IoU-based loss functions have unreasonable penalty factors, which cause the anchor box area to expand during the regression process, which significantly slows down the convergence speed. Moreover, its penalty term cannot accurately reflect the difference between the anchor box and the target box, and does not fully consider the target size, which may lead to degradation in some cases;
[0159] (2) Introduction of an adaptive target size penalty factor: To address issues such as increased anchor box size, PIOUv2 introduces a penalty factor with adaptive size. This factor guides the anchor box to regress directly and efficiently, enabling it to approach the target box more quickly, avoiding the complex and slow regression method of first increasing the anchor box size and then achieving overlap;
[0160] (3) Combining the anchor box quality-based gradient adjustment function: PIoUv2 combines the above penalty factor with a function that adjusts the gradient based on the anchor box quality to form the PIOU loss function. This function directly minimizes the distance between the four edges of the anchor box and the corresponding edges of the target box, thus allowing the anchor box to regress along an efficient path. Compared with the traditional IoU-based loss function, it converges faster.
[0161] (4) Adding a non-monotonic attention layer: Based on the PIoU loss function, PIoUv2 introduces a non-monotonic attention layer controlled by a single hyperparameter. This operation enhances the ability to focus on medium-quality anchor boxes, enabling the model to pay better attention to these anchor boxes, thereby improving the performance of the object detector;
[0162] (5) Application in target detectors: Integrating PIoUv2 into target detectors can improve average accuracy (AP) and overall performance.
[0163] Step 2.6: Update the parameters of the lightweight dynamic image enhancement-enabled real-time fatigue driving detection network.
[0164] The model training process using the open-source YawDD facial fatigue driving detection dataset and the DMS (Driver Monitoring System) fatigue driving dataset is as follows:
[0165] (1) Set training parameters: set the training period to 500, the batch size to 4, and the number of data loading processes to 8.
[0166] (2) Optimizer and Regularization: The Stochastic Gradient Descent (SGD) optimizer was used for training. To mitigate overfitting, a weight decay strategy was adopted, with the decay coefficient set to 5 × 10⁻⁶. -4 The momentum is set to 0.937.
[0167] (3) Training strategy: Implement early stopping. When the loss no longer decreases significantly (tends to stabilize) after several consecutive rounds of verification, the training will automatically terminate to ensure that the model reaches a basic convergence state.
[0168] (4) Data preparation: Prepare a labeled training dataset, which includes the input image and its corresponding target bounding box coordinates and category labels.
[0169] (5) Forward propagation: Input the image into the model, perform forward propagation calculation, and obtain the model's predicted output.
[0170] (6) Loss calculation: Compare the model’s predicted output with the true label and calculate the loss function value.
[0171] (7) Backpropagation: Based on the calculated loss value, the backpropagation algorithm is executed to calculate the gradient of each parameter of the model.
[0172] (8) Parameter update: Use an optimizer (such as SGD) to update the model parameters based on gradient information in order to minimize the loss function.
[0173] Iterative training: Repeat steps 5 to 8 (forward propagation, loss calculation, back propagation, parameter update) until the model converges or reaches the preset number of training rounds.
[0174] Step 3: Evaluate the performance of the lightweight dynamic image enhancement-enabled real-time fatigue driving detection network using a validation set and optimize the parameters.
[0175] At the end of each training epoch, the model is evaluated on a validation set. This validation process aims to monitor model performance (such as detecting signs of overfitting or underfitting) and to inform subsequent hyperparameter tuning.
[0176] The verification process is as follows:
[0177] (1) Data preparation: Load the validation dataset.
[0178] (2) Model loading: Load the latest model trained in step two.
[0179] (3) Execute verification: Traverse each image in the verification set and use the model to perform object detection inference.
[0180] (4) Performance evaluation: The detection performance of the model is quantified by the mean average accuracy (mAP) index.
[0181] Step 4: Obtain the optimal model parameters for the validation set, input photos from the test set to generate predicted images, and complete the detection of fatigue driving behavior.
[0182] The process for generating the predicted image (object detection) is as follows:
[0183] (1) Image input: Input the image to be detected into the detection network LDIE-FDNet;
[0184] (2) Forward propagation: Perform forward propagation on the input image, extract features layer by layer using the multi-layer architecture of the neural network and fuse the multi-scale features of the Neck part to generate a feature map, and complete the initial generation of the prediction result for each position at the preset anchor point.
[0185] (3) Confidence filtering: For the multiple bounding box prediction results generated at each anchor point, the confidence scores are filtered to retain the bounding boxes with higher than the set threshold as the final prediction box output.
[0186] (4) Non-maximum suppression (NMS): Apply the non-maximum suppression algorithm to the filtered prediction boxes to remove redundant boxes that highly overlap with the highest confidence box and have low confidence.
[0187] (5) Output results: After NMS processing, the remaining bounding boxes are the final detection results. Each predicted box contains the bounding box coordinates (position information) of the target object and its corresponding class label.
[0188] Experimental section:
[0189] 1) Ablation experiments were conducted on the YawDD dataset to verify the effectiveness of each module. YOLOv11n was used as the baseline. The results on the YawDD dataset are shown in Table 1:
[0190] Table 1 Ablation experiments using the YawDD dataset.
[0191]
[0192]
[0193] The baseline mAP50 is 98.6%. This is because YOLOv11 uses the C3K2 block to handle feature extraction at different stages of the backbone. The smaller 3x3 kernel allows for more efficient computation while preserving the model's ability to capture essential features in the image. The core of the YOLOv11 backbone is the C3K2 module, an evolution of the CSP bottleneck introduced in earlier versions. The C3K2 module optimizes the information flow in the network by segmenting feature maps and applying a series of smaller kernel convolutions (3x3), which is faster and less computationally expensive than larger kernel convolutions. By processing smaller, independent feature maps and merging them after several convolutions, the C3K2 module uses fewer parameters to improve feature representation compared to YOLOv8's C2f module. It retains the SPFF module, which is designed to aggregate features from different regions of an image at different scales. This improves the network's ability to capture objects of different sizes, especially small objects. Another important innovation is the addition of the C2PSA module. This module introduces an attention mechanism that enhances the model's focus on important regions in the image, such as small or partially occluded objects, by emphasizing spatial correlations in the feature maps. These operations can achieve good results in natural scenes, but for fatigue driving detection, the light intensity is usually low and the real-time requirements are extremely high, which makes the application in this area still somewhat limited.
[0194] We first introduce MSR-LIENet to enhance low-light images, improving mAP by 1.1%. Although FPS decreased by 7, this was within the expected range. Adding the GSConv_C3k2 module to the baseline reduced params by 8% and GFLOPs by 4.2% while maintaining a relatively constant mAP. This is mainly because the GSConv_C3k2 module combines standard convolution (SC) and depthwise convolution (DSC), mixing features generated by SC and DSC through shuffling, thereby enhancing the connections between features and reducing redundant information and unnecessary computation. Adding the DySample module reduced params by 8% and GFLOPs by 1.6%. This is because DySample first interpolates the input feature map to a continuous feature map using bilinear interpolation, then generates content-aware sampling points to resample this continuous feature map. This method reduces the number of parameters and computation, significantly reducing inference latency and memory usage. After adding the SDI module, Params decreased by 8% and GFLOPs decreased by 4.2%, because feature fusion has always been a key step in improving model performance in deep learning segmentation tasks. SDI effectively solves the problem of information loss or insufficient fusion through multi-level feature interaction and fusion. SDI utilizes dense connections and a phased interaction mechanism, enabling features from different layers to exchange information more efficiently. After adding the PioUv2 loss function, mAP decreased by 0.5% and FPS increased by 12.8%, because the PioUv2 loss function, by combining a penalty factor adapted to target size and a gradient adjustment function based on anchor box quality, guides anchor boxes to regress along a more direct path, thereby fitting the data more accurately and further optimizing the bounding box regression process. Furthermore, PioU can better adapt to high aspect ratio targets (cigarettes, closed eyes, etc.).
[0195] Next, we arranged and combined five modules: MSR-LIENet, GSConv_C3k2, DySample, SDI, and PIOUv2. These modules do not interfere with each other; each leverages its own strengths, as detailed in Table 1. This demonstrates the good independence of each module, which plays a positive role in different stages of detection. Through their cooperation and optimization of various aspects of the network, they can better adapt to target detection tasks in complex scenarios, collectively improving the accuracy and performance of target detection in fatigue driving scenarios.
[0196] The final model, LDIE-FDNet, improved mAP by 0.6%, Params by 24%, GFLOPs by 14.3%, and FPS by 24.1% after introducing five modules simultaneously. There were no conflicts among the modules, and the model showed the best performance when all the proposed methods were used.
[0197] 2) Ablation experiments were performed on the DMS dataset. The results of the DMS dataset are shown in Table 2:
[0198] Table 2 Ablation Experiments on the DMS Dataset
[0199]
[0200]
[0201] Similar experimental results were obtained on the DMS dataset, where the network with stacked blocks achieved better performance compared to a single module. Furthermore, the experiments showed that the proposed modules were conflict-free, and the model exhibited the best performance when all proposed methods were employed.
[0202] 3) Comparative experiments were conducted on the YawDD dataset with other existing classic methods, as shown in Table 3:
[0203] Table 3 Comparative experiments based on YawDD
[0204]
[0205]
[0206] In real-world driving environments, fatigue driving requires high real-time performance, and the lighting in the confined space of the driver's cab is generally dim. This paper first introduces MSR-LIENet to enhance low-light images, improving image quality. GSConv_C3k2, DySample, SDI, and PIOUv2 fully leverage the lightweight advantages of their respective modules, minimizing computation and parameter count while ensuring prediction accuracy, further enhancing the network's real-time performance.
[0207] This is mainly due to the introduction of MSR-LIENet in this paper, which enhances low-light images and improves detection accuracy. The addition of the GSConv_C3k2 module on the baseline combines standard convolution (SC) and depthwise convolution (DSC), using shuffling to mix features generated by SC and DSC, thereby enhancing the connections between features and reducing redundant information and unnecessary computation. The addition of the DySample module first interpolates the input feature map to a continuous feature map using bilinear interpolation, and then generates content-aware sampling points to resample this continuous feature map. This method reduces the number of parameters and computation, significantly lowering inference latency and memory usage. The addition of the SDI module effectively solves the problem of information loss or insufficient fusion through multi-level feature interaction and fusion. SDI utilizes dense connections and a phased interaction mechanism, enabling features from different layers to exchange information more efficiently. The addition of the PIOUv2 loss function, by combining a penalty factor adapted to target size and a gradient adjustment function based on anchor box quality, guides anchor boxes to regress along a more direct path, thereby fitting the data more accurately and further optimizing the bounding box regression process.
[0208] Due to the high computational cost and poor real-time performance of BiFPN's multi-scale fusion, the high complexity of HGNetV2's heterogeneous convolutional combination, Slimneck's lack of dynamic feature adaptation ability, the high memory consumption of EfficientViT's attention mechanism, the insufficient robustness of YOLOv8n in low-light scenes, the lack of optimization for high aspect ratio object detection in FD-YOLOv8, and the static feature fusion of YOLOv11 without illumination enhancement, LDIE-FDNet comprehensively optimizes each aspect and achieves better results. Comparative experiments were conducted on the YawDD dataset, as shown in Table 3. LDIE-FDNet not only achieved an improvement in average accuracy, but also achieved significant improvements in parameter quantity, computational cost, and FPS. Compared to the BiFPN architecture, LDIE-FDNet reduces the number of parameters by 2.1M and the computational cost by 1.7 GLDOPs; compared to the HGNetV2 architecture, LDIE-FDNet reduces the number of parameters by 2.6M and the computational cost by 2.3 GLDOPs; compared to the Slimneck architecture, LDIE-FDNet reduces the number of parameters by 3.0M and the computational cost by 2.6 GLDOPs; compared to EfficientViT, LDIE-FDNet reduces the number of parameters by 2.1M and the computational cost by 4.0 GLDOPs; compared to YOLOv8n, LDIE-FDNet reduces the number of parameters by 1.0M and the computational cost by 1.3 GLDOPs; compared to FD-YOLOv8, LDIE-FDNet reduces the number of parameters by 0.7M and the computational cost by 1.2 GLDOPs; and compared to YOLOv11, LDIE-FDNet reduces the number of parameters by 0.6M and the computational cost by 0.9 GLDOPs.
[0209] 4) On the DMS dataset, the method of this invention was compared with mainstream state-of-the-art methods. It can be seen that the method of this invention also achieved improvements on this dataset, as shown in Table 4:
[0210] Table 4 Comparative experiments of different models in DMS
[0211]
Claims
1. A lightweight dynamic image enhancement-enabled real-time fatigue driving detection method, characterized in that, Includes the following steps: Step 1: Construct a lightweight dynamic image enhancement-enabled real-time fatigue driving detection network LDIE-FDNet. The lightweight dynamic image enhancement-enabled real-time fatigue driving detection network LDIE-FDNet includes a low-light image enhancement network MSR-LIENet based on a multi-channel Retinex model, a feature extraction module Backbone, a dynamic multi-level feature fusion Neck, and a regression detection module Head. The low-light image enhancement network MSR-LIENet based on the multi-channel Retinex model consists of a generator and a discriminator, wherein the generator includes an initialization module, a reflection denoising module, and an illumination enhancement module. The feature extraction module is structured as a six-layer feature pyramid built by a CNN network. The first layer L1 extracts low-level feature information from the input image through convolution operations. The second to fifth layers L2 to L5 are composed of the Conv module and the GSConv_C3k2 module. The sixth layer L6 is composed of the SPPF module and the C2PSA module. The dynamic multi-level feature fusion module includes the lightweight dynamic upsampling module DySample and the multi-level feature fusion SDI module; Step 2: Divide the fatigue driving behavior sample dataset into training set, validation set and test set sample datasets. Use lightweight dynamic image enhancement to empower the real-time fatigue driving detection network to extract fatigue driving behavior features from the images in the training set and train the model. Step 2.1: Collect classroom behavior images and input them into the low-light image enhancement network of the multi-channel Retinex model to enhance the low-light images; Step 2.2: Input the enhanced fatigue driving behavior image into the feature extraction module to convert the original input image into a multi-layer feature map and extract the feature information of the image; Step 2.3: Input the feature information output from the feature extraction module at different scales into the multi-scale feature fusion module for fusion to obtain the fused feature information; Step 2.4: Input the fused feature information into the regression prediction module. The regression detection module maps the extracted features to the final output space to generate a prediction image, which is used to simulate the performance of the model in actual application, thereby evaluating the generalization performance of the trained model and completing the detection of fatigue driving behavior. Step 2.5: Calculate the total loss; Step 2.6: Update the parameters of the lightweight dynamic image enhancement-enabled real-time fatigue driving detection network; Step 3: Use the validation set to evaluate the performance of the lightweight dynamic image enhancement-enabled real-time fatigue driving detection network and optimize the parameters; Step 4: Obtain the optimal model parameters for the validation set, input photos from the test set to generate predicted images, and complete the detection of fatigue driving behavior.
2. The lightweight dynamic image enhancement-enabled real-time fatigue driving detection method according to claim 1, characterized in that, The specific process of step 2.1 includes: (1) The initialization module is used to process the input low-light image and accurately decompose it into illumination component and reflection component; (2) Then, the separated reflection component is input into the reflection denoising module to reduce the noise in the reflection component. At the same time, the separated illumination component is input into the illumination enhancement module to improve the illumination effect and make the image look brighter and clearer. (3) Multiply the denoised reflection component and the enhanced illumination component to obtain the final low-light image enhancement result. (4) The enhanced image is compared with the high-quality image selected by the discriminator, and the adversarial loss is calculated to determine whether the enhanced image is perceptually close to the high-quality standard.
3. The lightweight dynamic image enhancement-enabled real-time fatigue driving detection method according to claim 2, characterized in that, The specific process of step 2.2 includes: (1) Use standard convolution to reduce the dimensionality of the input feature C1, reducing the number of channels to C2 / 2, which effectively captures the basic features while reducing computational complexity; (2) Use depthwise convolution DWConv to process features independently per channel and introduce a sparsity strategy to enhance feature diversity and detail representation. (3) The outputs of standard convolution and depthwise convolution are fused to generate a complete feature map with C2 channels, and the distribution of channel information is optimized by channel shuffling operation to improve the cross-channel feature interaction capability.
4. The lightweight dynamic image enhancement-enabled real-time fatigue driving detection method according to claim 3, characterized in that, The specific process of step 2.3 includes: Step 2.3.1: Capture subtle features in the image using the dynamic upsampler DySample; First, the input feature map of a given size C×H×W is transformed into a sampling set S of size 2×sH×sW by a sampling point generator, where the first dimension 2 in S represents the x and y coordinates; then, the input features are resampled using the gridsample function to obtain an upsampled feature map of size C×sH×sW. Step 2.3.2: The SDI module enhances the semantic and detail information in the image by integrating feature maps from multiple levels generated by the encoder; (1) Feature extraction: First, the encoder generates feature maps of multiple levels for the input image. The feature maps contain information of different scales and levels, from low-level detail information to high-level semantic information. (2) Attention mechanism: In the SDI module, spatial and channel attention mechanisms are applied to process the features at each level, enabling the features to integrate local spatial information and global channel information, thereby improving the representation ability of the features; (3) Feature fusion: For each level of feature map, the SDI module will fuse high-level features that contain more semantic information and low-level features that capture more fine details; (4) Feature transmission and decoding: The refined features are then passed to the decoder for parsing, reconstruction, image segmentation, or object detection.
5. The lightweight dynamic image enhancement-enabled real-time fatigue driving detection method according to claim 4, characterized in that, The process of the regression detection module in step 2.4 is as follows: (1) Receive features of different scales output by the feature extraction module, where high-resolution feature maps are used to preserve details in the image, while low-resolution feature maps help to extract higher-level semantic information. (2) Channel unification processing is performed on the features at each scale output by the feature extraction module. The features with different numbers of channels are reduced to the same dimension through a 1×1 convolutional layer. (3) Multi-scale feature fusion is carried out by constructing top-down and bottom-up fusion paths to achieve complementary enhancement between features at different levels, which not only supplements the semantic information of high-level features, but also restores the detailed information in low-level features. (4) The fused features are further enhanced by using the SPPF module. The features are pooled by pooling kernels of different sizes to extract multi-scale contextual information and enhance the adaptability to targets of different sizes. (5) Generate multiple detection feature maps of different scales to correspond to the detection requirements of large, medium and small targets respectively; (6) Predict the offset of the preset anchor box at each grid point, including the center coordinate offset and width and height scaling, and convert the bounding box coordinates into absolute coordinates, and then perform target confidence prediction and class probability prediction. (7) For each real target box, based on the preset intersection-union ratio (IoU) between the anchor box and the real box, the anchor box that best matches it is matched as a "positive sample" and is responsible for the bounding box regression and category classification learning task of the real target box; the anchor box that does not match any real box is used as a "negative sample" and only participates in the calculation of target confidence loss to suppress false detection of background areas. (8) Summarize the prediction results of all detection feature maps to form an initial set of detection boxes; Subsequently, the non-maximum suppression (NMS) algorithm is used to remove duplicate detection bounding boxes, that is, to retain the detection box with the highest confidence and remove redundant boxes with an intersection-union ratio (IoU) higher than a set threshold, and finally output concise and accurate detection results.
6. The lightweight dynamic image enhancement-enabled real-time fatigue driving detection method according to claim 5, characterized in that, The total loss function in step 2.5 is constructed through the following process: Define the PIOU loss function: PIou=Iou-f(P),-1≤PIOU≤1 L PIou <1-PIou=L Iou +f(P),0≤L PIoU ≤2 In the formula, P is a penalty factor adapted to the target size, where dw1, dw2, dh1, and dh1 are the absolute values of the distances between the corresponding edges of the predicted bounding box and the target bounding box, and w gt and h gt The width and height of the target bounding box are represented by f(x), and the function f(x) is designed to adaptively adjust the gradient magnitude based on the quality of the detection box. By combining the focusing mechanism and introducing a non-monotonic attention function combined with PIOU, a new loss function PIOUv2 is obtained: q=e -p ,q∈(0,1] In the formula, L PIoUv2 Let u(λq) represent the loss function based on PIOUv2, where P represents the penalty factor, q represents the parameter that measures the quality of the detection box, λ is the hyperparameter that controls the behavior of the attention function, u(x) represents the attention function, and u(λq) represents the non-monotonic attention function.
7. The lightweight dynamic image enhancement-enabled real-time fatigue driving detection method according to claim 6, characterized in that, The process of generating the predicted image in step 4 includes: (1) Image input: Input the image to be detected into the detection network LDIE-FDNet; (2) Forward propagation: Perform forward propagation on the input image, extract features layer by layer using the multi-layer architecture of the neural network and fuse the multi-scale features of the Neck part to generate a feature map, and complete the initial generation of the prediction result for each position at the preset anchor point. (3) Confidence filtering: For the multiple bounding box prediction results generated at each anchor point, the confidence scores are filtered to retain the bounding boxes with higher than the set threshold as the final prediction box output. (4) Non-maximum suppression (NMS): Apply the non-maximum suppression algorithm to the filtered prediction boxes to remove redundant boxes that highly overlap with the highest confidence box and have low confidence. (5) Output results: After NMS processing, the remaining bounding boxes are the final detection results. Each predicted box contains the bounding box coordinates (position information) of the target object and its corresponding category label.