| In modern society,cars are an important part of the transportation industry and greatly facilitate people’s lives.However,the traffic accidents caused by them cannot be ignored.The main cause of these accidents is often fatigue driving.Therefore,it is important to accurately detect and warn against fatigue in real-time at this stage.This article builds a lightweight network for detecting fatigue based on facial expressions,which has certain social significance.There are currently two main problems with fatigue driving detection:low accuracy of model detection and high computational costs due to large model parameters when conducting detection,making it difficult to deploy in practice.Therefore,the design of the model needs to ensure accuracy while minimizing its weight as much as possible.Based on this idea,this article conducts the following work:(1)The selection and pre-processing of datasets is crucial.In this thesis,the public dataset Wider Face was used for face detection,while a self-built dataset was constructed using image annotation tools for fatigue feature state detection.Due to limited annotated data,Mosaic was utilized in this study to augment and expand the dataset,thereby improving model generalization performance.(2)The Y-GG network model was proposed for face detection in this thesis.The design idea of the model is as follows: during the process of detecting faces,the YOLOv5 model may miss small targets in object detection.Therefore,this thesis added a smaller detection head to the original network’s detection head to improve multi-scale detection performance of the algorithm.By adding high-resolution feature maps,more information is obtained and smaller targets can be detected effectively.In order to reduce the number of parameters in the model and make it easier for deployment on devices,Ghost Conv was used instead of Convolutional layers with fewer parameters generating more feature maps.C3 Ghost was used to replace C3 structure in backbone part which improved speed of detection;CBAM(Convolutional Block Attention Module)was added into C3 layer in backbone network to address noise and background factors that affect detection by establishing attention mechanisms independently on channel and space dimensions updating feature maps further ignoring irrelevant information while focusing on important regions within images improving anti-interference ability and recognition accuracy;Finally,a new loss function Sio U consisting 4 Cost functions with directional addition was adopted resulting faster convergence during training.Experimental results showed that compared with original models,parameter volume reduced by 29.8% while m AP(Mean Average Precision)increased by 0.4%.(3)The Y-GGA network model was proposed to perform fatigue feature state testing on a self-built dataset in this thesis.In order to enhance information interaction and alleviate the problem of insufficient feature information,this thesis introduced the GAM(Global Attention Mechanism)attention mechanism based on the previous Y-GG model,which improves the feature extraction ability of the backbone network by extending multidimensional information interaction.The experimental results show that compared with the original model,the m AP of Y-GGA model increased by 0.6%,while both parameter quantity and computational complexity were reduced.Overall,this thesis achieved lightweight modeling without compromising m AP performance,enabling timely detection of fatigue feature anomalies and issuing warnings. |