Research Article

Safety Helmet-Wearing Detection System for Manufacturing Workshop Based on Improved YOLOv7

Table 2

Results of the ablation experiments on “helmet”.

No.MethodsmAP (%) (,)F1 (%) (,)

1YOLOv7 baseline85.1982.51
2+Add CBS_2 in backbone85.67 (+0.48,+0.48)82.63 (+0.12,+0.12)
3+Structure after pruning85.78 (+0.59,+0.11)82.93 (+0.42,+0.30)
4+Replace loss function with SIoU85.98 (+0.79,+0.20)83.82 (+1.31,+0.89)

1→2: the CBS_2 module is added between the backbone networks to replace the 3-channel RGB features of the original image with 16-channel features, so that the backbone network can learn deeper features. Compared with the baseline model, mAP and F1 are improved by 0.48% and 0.12%, respectively. 2→3: in order to reduce the depth of the network, we perform structured pruning on the head network. The depth of the head network is reduced by 2 layers, and at the same time, the width of the input features of the ELAN-W module is widened, which enables ELAN-W to learn more features. Compared with the baseline model, mAP and F1 are improved by 0.59% and 0.42%, respectively. 3→4: the loss function was replaced. In addition to IoU, the SIoU function also includes angle cost, distance cost, and shape cost. Compared with model 3, mAP and F1 increased by %0.2 and 0.89%, respectively. Compared with the baseline model, mAP and F1 are improved by %0.79 and 1.31%, respectively.