Abstract:In road traffic motorcycle accidents, failure to wear a helmet is the leading cause of fatal injuries to riders. Aiming at the problems of false detection and missed detection in the current helmet detection due to the similarity in color and shape of black hair, hat and helmet, a motorcycle helmet detection algorithm with triplet attention mechanism and bidirectional cross-scale feature fusion is proposed. First, a triplet attention mechanism is introduced into the backbone network of YOLOV5s, which extracts semantic dependencies between different dimensions, eliminates the indirect correspondence between channels and weights, and improves detection accuracy by paying attention to the differences between similar samples. Second, the EIOU bounding loss function is used to optimize the detection effect of occluded and overlapping objects. Finally, the weighted bidirectional feature pyramid network structure is adopted in the feature pyramid to achieve efficient bidirectional cross-scale connection and weighted feature fusion, which enhances the network feature extraction capability. The experimental results show that the improved algorithm achieves 98.7% mAP@0.5 and 94.0% mAP@0.5:0.95. Compared with the original algorithm, the improved algorithm′s mAP@0.5 increases by 3.9% and mAP@0.5:0.95 increases by 7.6%, with higher accuracy and stronger generalization ability.