Summary: | Abstract To reduce the chance of being infected by the COVID-19, wearing masks correctly when entering and leaving public places has become the most feasible and effective ways to prevent the spread of the virus. It is a concern to how to quickly and accurately detect whether a face is worn a mask correctly while reduce missed detection and false detection in practical applied scenarios. In this paper, an improved algorithm is proposed based on the YOLO-v4 algorithm. The attention mechanism module is added to the appropriate network level to enhance the key feature points of face wearing masks and suppress useless information. Apart from that, three attention mechanism modules are added to different layers of the YOLO-v4 network for ablation experiments, including CBAM (convolutional block attention module), SENet (squeeze-and-excitation networks) and CANet (coordinate attention networks). The path-aggregation network and feature pyramid are used to extract features from images. Two network models were compared and improved in the experiment, and it is found that adding the dual-channel attention mechanism CBAM before the three YOLO heads of YOLOv4 and in the neck network had better detection performance than the single channel attention mechanism SENet and the coordinated attention mechanism CANet. The experimental results show that when the attention module CBAM and the YOLO-v4 model are integrated, the accuracy of the selected MAFA + WIDER Face dataset reaches the highest value of 93.56%, which is 4.66% higher than that of the original YOLO-v4.
|