针对分心驾驶检测方法存在实时性差、精度低、可部署性差的问题,提出了一种基于上下文语义增强联合YOLOv7的分心驾驶检测算法.首先将模型backbone和head部分的ELAN模块替换成语义上下文增强模块(contextual transformer,CoT),提高上下文语义信息的捕获能力.其次,将语义关联增强机制(triplet attention)融入卷积块中,插入backbone和head的连接头之间以及融合 MP2模块,强化目标间的关联关系以及提升目标特征提取能力.最后,将自注意力双向Transformer模块(Biformer)模块融合SPPCSPC模块,提升模型对分心驾驶中的复杂场景和遮挡目标的处理能力.改进的YOLOv7算法在分心驾驶数据集下平均精度均值(mean average precision,mAP)达到了87.3%,比原算法提高了4.3%,模型参数量减少了4.7%,每秒传输帧数达到了90 fps,具有较好的检测精度与速度.
Distracted driving detection algorithm based on contextual semantics combined with YOLOv7
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.