YOLOv5s-AAEA: An Effective Approach for Accurate Face Mask Wearing Detection in Complex Scenes
Guohui Cai, Ying Cai, Xiaoling Yang, Yong Xu, Weilin Luo, Shengbo Tan · 2023
In numerous scenarios, particularly amid the on-going global health crisis, the proper wearing of masks is crucial for public health and safety. As a result, the accurate detection of mask usage has become an essential surveillance measure for public space security. Addressing the challenges of missed detections and false alarms in face mask wearing detection, especially in complex backgrounds and densely packed small target scenes, this paper proposes the YOLOv5s-AAEA algorithm for accurate face mask wearing detection. Firstly, we redefine the sizes of prior boxes using the K-means method on annotated dataset target boxes, matching them to their respective feature layers to enhance the accuracy of feature extraction. Subsequently, the ASFF module is incorporated into the Neck layer of the YOLOv5s model, facilitating better fusion of features at different scales, thereby addressing the issue of low accuracy in complex background detection. Attention mechanisms are introduced separately into the backbone network of the YOLOv5s model, suppressing irrelevant information and enhancing the information representation capability of feature maps, thereby addressing the challenge of detecting densely packed small targets. Finally, considering the issues of slow convergence and poor performance in handling incomplete target objects exhibited by the CIOU loss function, the EIOU_Loss is employed to ensure faster convergence of predicted boxes during training. Experimental results demonstrate that the proposed algorithm achieves an average accuracy increase of 3.3 percentage points over the original algorithm while maintaining a rapid detection rate. Moreover, compared to existing mainstream detection algorithms, the proposed method exhibits significantly improved accuracy, making it well-suited for real-time monitoring of mask-wearing status among individuals.