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