A YOLOv7-Based Defect Detection Method for Metal Surfaces
摘要
The target detection algorithm based on deep learning has the advantages of high precision and strong generalization, which is one of the research hotspots in the field of industrial product quality inspection. This paper proposes a detection model, DA-YOLOv7, based on the YOLOv7 network. The main works include: firstly, for better feature extraction, replacing the original convolutional modules with the ODConv modules in the backbone network. Secondly, proposing the SPPCBAMC structure in the feature enhancement network for feature fusion. This structure divides input features into two branches, with one branch using different scale max-pooling to obtain features with multiple receptive fields, while the other branch processes features using the CBAM attention mechanism, providing channel and spatial attention to the features, and then merging the output features of the two branches. Finally, replacing CIoU with the MPDIoU loss function, which can more accurately measure the overlap between the predicted box and the ground truth box, and enable the model to converge faster. The algorithm was evaluated using the NEU-DET dataset and actual data collected from metal pistons. To evaluate the performance of the propose DA-YOLOv7, we introduce a new metal piston dataset. The results show that it has impressive performance in detecting defects in metal pistons. Compression experiments demonstrate that it outperforms other algorithmic models in the analysis of most categories on the NEU-DET dataset.