Abstract:Metal surface defect detection is a critical aspect of quality control in industrial manufacturing. Traditional manual inspection methods are costly and inefficient, making them unsuitable for the demands of modern manufacturing, which requires high accuracy and efficiency. To address these issues, this paper proposes a metal defect recognition model based on ResNet50 and an improved deformable convolution. The model incorporates a residual connection structure with deformable convolution, enhancing the network"s adaptability to complex shapes and positions of surface defects. Additionally, an attention module is introduced before the residual connection to capture more prominent defect features. This structure is inserted before the global average pooling layer in the ResNet50 network, forming a new architecture named ResNet50_DCAB. Experimental validation on a metal defect dataset demonstrates the superior classification performance of ResNet50_DCAB. Results show that the model achieves a maximum accuracy of 98.6% on the validation set, with an initial accuracy of 97.2%, significantly outperforming other commonly used [ ]deep learning models. Specifically, compared to AlexNet, GoogleNet, DenseNet, ResNet34, and the original ResNet50, the optimal validation accuracy of ResNet50_DCAB is improved by 8.9, 8.6, 6.7, 7.5, and 0.3 percentage points, respectively, while the initial accuracy is improved by 38.3, 54.4, 21.1, 31.6, and 1.9 percentage points, respectively. These results demonstrate that ResNet50_DCAB achieves high recognition accuracy and robustness in metal defect detection, validating its effectiveness and potential application value.