首页|基于多头自注意力机制和PANet的优化YOLOv5行人检测算法

基于多头自注意力机制和PANet的优化YOLOv5行人检测算法

扫码查看
针对行人检测任务中出现拥挤和目标尺寸小所导致的行人检测精度低和效果不佳问题,提出一种基于改进YOLOv5的检测算法.首先,将多头自注意力机制嵌入YOLOv5骨干网络末端,加强了网络对目标行人的全局信息感知,进一步增强了对行人目标可视化区域的特征提取.其次,改进了 PANet结构,使模型可以获取更细粒度的特征图.最后,采用更适合密集场景的Varifocal Loss损失函数代替Focal Loss损失函数,以提高模型的鲁棒性.实验结果表明,相比于YOLOv5模型,改进后的算法mAP@0.5与mAP0.5∶0.95分别提高到90.2%和63%,并且对小尺度行人以及密集行人都表现出更好的检测效果,同时比其他同类主流算法拥有更高的鲁棒性和准确性.
Optimized YOLOv5 pedestrian detection algorithm based on multi-head self-attention mechanism and PANet
Aiming at the problems of low pedestrian detection accuracy and poor performance in crowded scenarios and with small target sizes,a detection algorithm based on improved YOLOv5 is proposed.Firstly,a multi-head self-attention mechanism is embedded into the end of the YOLOv5 backbone network to strengthen the global information perception of the target pedestrian,further enhancing feature extraction in the visualized regions of pedestrian targets.Secondly,the PANet structure is improved to en-able the model to acquire more fine-grained feature maps.Finally,the Varifocal Loss function,more suitable for dense scenes,is em-ployed to replace the Focal Loss function,aiming to enhance the model's robustness.The experimental results show that compared with the YOLOv5 model,the improved algorithm achieves an increase in mAP@0.5 and mAP0.5∶0.95 to 90.2%and 63%,re-spectively.Moreover,it demonstrates better detection performance for small-scale and dense pedestrians.Simultaneously,it posses-ses higher robustness and accuracy than other similar mainstream algorithms.

Pedestrian detectionYOLOv5Multi-head self-attentionLoss function

宋子昂、刘惠临

展开 >

安徽理工大学计算机科学与工程学院,安徽淮南 232001

行人检测 YOLOv5 多头自注意力 损失函数

国家自然科学基金

62102003

2024

宁夏师范学院学报
宁夏师范学院

宁夏师范学院学报

影响因子:0.138
ISSN:1674-1331
年,卷(期):2024.45(1)
  • 1