Goggle Wearing Detection Algorithm Based on Improved YOLOv5
Objective In response to the problems of low efficiency in manual inspection and the inability to effectively ensure the eye safety of personnel in hazardous environments such as chemical laboratories and factories,this study aims to address these issues in the detection of goggles wearing.Methods Firstly,a dataset for goggles wearing detection was constructed,including four real-scene images and a portion of data obtained by web crawling.By means of data augmentation,the original dataset of 3383 images was expanded to 5462 images to form the final dataset,ensuring the balance of sample quantities and effectively preventing the problem of low model accuracy caused by sample imbalance.Then,an improved YOLOv5 object detection algorithm was proposed to automatically detect the wearing status of goggles.In the YOLOv5 algorithm,an SPD small target detection module was added to completely eliminate the stride convolution and pooling operations that lead to information loss in traditional convolution modules,allowing the network to retain more information.Subsequently,a coordinate attention mechanism was introduced to address the problem of ineffective extraction of neighboring position relationships caused by the addition of SPD.Moreover,the original loss function was replaced with the SIoU loss function to effectively solve the IoU calculation problem when the real box and the target box contain each other,reducing the degrees of freedom in calculations,decreasing the model's computational complexity,and improving model accuracy.Results Experimental results on the goggles wearing detection dataset show that the improved YOLOv5 model has an average precision of 72.7%on the goggle wearing detection dataset,which is 5.6%higher than the average precision of the original YOLOv5 model on the same dataset.Conclusion This model realizes the basic detection of goggles wearing status in complex environments.