Unleashing the power of AI in detecting metal surface defects: an optimized YOLOv7-tiny model approach

PeerJ Comput Sci. 2024 Jan 22:10:e1727. doi: 10.7717/peerj-cs.1727. eCollection 2024.

Abstract

The detection of surface defects on metal products during the production process is crucial for ensuring high-quality products. These defects also lead to significant losses in the high-tech industry. To address the issues of slow detection speed and low accuracy in traditional metal surface defect detection, an improved algorithm based on the YOLOv7-tiny model is proposed. Firstly, to enhance the feature extraction and fusion capabilities of the model, the depth aware convolution module (DAC) is introduced to replace all ELAN-T modules in the network. Secondly, the AWFP-Add module is added after the Concat module in the network's Head section to strengthen the network's ability to adaptively distinguish the importance of different features. Finally, in order to expedite model convergence and alleviate the problem of imbalanced positive and negative samples in the study, a new loss function called Focal-SIoU is used to replace the original model's CIoU loss function. To validate the effectiveness of the proposed model, two industrial metal surface defect datasets, GC10-DET and NEU-DET, were employed in our experiments. Experimental results demonstrate that the improved algorithm achieved detection frame rates exceeding 100 fps on both datasets. Furthermore, the enhanced model achieved an mAP of 81% on the GC10-DET dataset and 80.1% on the NEU-DET dataset. Compared to the original YOLOv7-tiny algorithm, this represents an increase in mAP of nearly 11% and 9.2%, respectively. Moreover, when compared to other novel algorithms, our improved model demonstrated enhanced detection accuracy and significantly improved detection speed. These results collectively indicate that our proposed enhanced model effectively fulfills the industry's demand for rapid and efficient detection and recognition of metal surface defects.

Keywords: Deep learning; Defect detection; Feature fusion; Metal surface; YOLOv7-tiny.

Grants and funding

This work was supported by the Jiangsu Graduate Practical Innovation Project under grant numbers (No. SJCX23_1873), the major Project of Natural Science Research of Jiangsu Province Colleges and Universities under grant number (No. 19KJA110002), the Natural Science Foundation of China under grant number (No. 61673108), the Natural Science Research Project of Jiangsu Province Universities under grant number (No. 18KJD510010) and (No. 19KJB510061), the Jiangsu Province Natural Science Foundation Project under grant number (No. BK20181050). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.