Algorithm of Safety Helmet Detection Based on Improved YOLOv7
Addressing challenges such as difficulty in detecting small objects,false detection,and missed detection of overlapping targets in existing helmet detection algorithms,an improved helmet detection algorithm based on YOLOv7 is proposed.Firstly,the Normalized Wasserstein Distance(NWD)is used to improve the loss function,addressing the sensitivity of IoU to positional deviations in small objects,thereby enhancing detection accuracy.Secondly,the SimAM attention mechanism is integrated into the MPConv module of the YOLOv7 backbone network,creating MP-SAM.Additional-ly,the convolutional layers of the head-connected backbone network are replaced with Omni-direc-tional Dynamic Convolution(ODConv)to better capture contextual information from multiple dimen-sions,improving the feature extraction capability of the convolution.Finally,the original SiLU activa-tion function of the convolution module is replaced with the ELU activation function to accelerate net-work training convergence and enhance algorithm robustness.Experimental results demonstrate that,without changing the training conditions,the improved algorithm achieves an accuracy of 85.7%and mAP@0.5 of 82.6%,representing a 7.2%and 11.4%improvement compared to the original YOLOv7 model.The improved algorithm effectively boosts the detection accuracy of helmets,reducing the probabilities of missed and false detection.
safety helmet detectionYOLOv7NWDfull-dimensional dynamic convolutionattention mechanismactivation function