Abstract:Aiming at the problems of poor real-time,low precision and poor deployable in distracted driving detection methods,a distracted driving detection algorithm based on contextual semantic enhancement combined with YOLOv7 was proposed.Firstly,ELAN modules in backbone and head of the model are replaced with contextual transformer (CoT)block to improve the ability to capture contextual semantic information.Secondly,the Triplet Attention mechanism is integrated into the convolutional block,inserted between the connectors of backbone and head,and the MP2 module is fused to strengthen the correlation between targets and improve the capability of target feature extraction.Finally,the self-attention bidirectional transformer(Biformer)module is integrated with the SPPCSPC module to improve the model's processing ability for complex scenes and occlusive targets in distracted driving.The mean average precision(mAP)of the improved YOLOv7 algorithm in the distracted driving data set reaches 87.3%, which is 4.3%higher than that of the original algorithm,and the number of model parameters is reduced by 4.7%.The number of frames per second reached 90 fps,with good detection accuracy and speed.