Popis: |
To address the current problems of the incomplete classification of mask-wearing detection data, small-target miss detection, and the insufficient feature extraction capabilities of lightweight networks dealing with complex faces, a lightweight method with an attention mechanism for detecting mask wearing is presented in this paper. This study incorporated an “incorrect_mask” category into the dataset to address incomplete classification. Additionally, the YOLOv4-tiny model was enhanced with a prediction feature layer and feature fusion execution, expanding the detection scale range and improving the performance on small targets. A CBAM attention module was then introduced into the feature enhancement network, which re-screened the feature information of the region of interest to retain important feature information and improve the feature extraction capabilities. Finally, a focal loss function and an improved mosaic data enhancement strategy were used to enhance the target classification performance. The experimental results of classifying three objects demonstrate that the lightweight model’s detection speed was not compromised while achieving a 2.08% increase in the average classification precision, which was only 0.69% lower than that of the YOLOv4 network. Therefore, this approach effectively improves the detection effect of the lightweight network for mask-wearing. |