Abstract
The main goal of workpiece surface defect detection is to improve accuracy and real-time performance. Generally, the practice of using a network model with stronger representation ability and performing lightweight design at the same time cannot solve the problem of better performance balance between model training and inference phases. To address this, this paper optimizes and proposes a structural re-parameterization defect detection method: YOLOv7-Rep. First, we proposed a re-parameterization convolutional module: RepC2, which is a new block with cross-stage partial (CSP) connection and efficient gradient flow branch structure. Second, this article integrates the RepC2 module based on YOLOv7 and incorporates the coordinate attention (CA) mechanism in the backbone. Finally, we introduce the WIoUv1 bounding-box regression loss function. Experimental analysis demonstrates that YOLOv7-Rep outperforms object detectors with the same parameter count in terms of both detection accuracy and speed. It achieves detection accuracies of 78.3%, 87.3%, and 83.5% on three industrial component datasets (NEU-DET, TCAP-DET, and GC10-DET), respectively. Compared to YOLOv7, it significantly improves detection frame rates by 4.9% (an increase of 11.3 FPS), while achieving a better performance balance between training and inference phases in surface defect detection tasks.










Similar content being viewed by others
Data availability
The datasets generated during and/or analyzed during the current study are available from the corresponding author on reasonable request.
References
Luo, D., Cai, Y., Yang, Z., Zhang, Z., Zhou, Y., Bai, X.: Survey on industrial defect detection with deep learning. Sci. Sin. Inf. 52(6), 1002–1039 (2022)
Li, S., Yang, J., Wang, Z., Zhu, S., Yang, G.: Review of development and application of defect detection technology. Acta Autom. Sin. 46(11), 2319–2336 (2020)
Su, H., Zhang, J., Zhang, B., Zou, W.: Review of surface defect inspection based on visual perception. Comput. Integr. Manuf. Syst. 29(1), 169 (2023)
Chai, L., Ren, L., Gu, K., Chen, J., Huang, B., Ye, Q., Cao, W.: Vision sensing based intelligent detection of surface defect and its industrial applications. Comput. Integr. Manuf. Syst. 28(7), 1996–2004 (2022)
Tao, X., Hou, W., Xu, D.: A survey of surface defect detection methods based on deep learning. Acta Autom. Sin. 47(5), 1017–1034 (2021)
Zhao, L., Wu, Y.: Research progress of surface defect detection methods based on machine vision. Chin. J. Sci. Instrum. 43(1), 198–219 (2023)
Qi, X., Dong, X.: Improved yolov7-tiny algorithm for steel surface defect detection. Comput. Eng. Appl. 59, 176–183 (2023)
Wang, Y., Gong, X.-J., Cheng, J., Su, H.: Surface defect detection of metal workpiece based on improved yolov5. Pack. Eng. 43(15), 54–60 (2022)
Chen, Y., Alifu, K., Lin, W., Yuan, X.: Ca-yolov5 for crowded pedestrian detection. J. Comput. Eng. Appl. 58(9), 238–245 (2022)
Yang, P., Zhang, Y., Hu, Z.: A lane detection algorithm based on improved repvgg network. J. Transp. Inf. Saf. 40(2), 73–81 (2022)
Liu, M., Li, Z., Li, Y., Liu, Y., Jiang, X.: A method for transmission line defect edge intelligent inspection based on re-parameterized yolov5. High Voltage Engineering
Hou, Q., Zhou, D., Feng, J.: Coordinate attention for efficient mobile network design. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13713–13722 (2021)
Tong, Z., Chen, Y., Xu, Z., Yu, R.: Wise-iou: bounding box regression loss with dynamic focusing mechanism. arXiv preprint arXiv:2301.10051 (2023)
Song, K., Yan, Y.: A noise robust method based on completed local binary patterns for hot-rolled steel strip surface defects. Appl. Surf. Sci. 285, 858–864 (2013)
Tianchi: Aluminum profile surface defect identification data set (2016). https://tianchi.aliyun.com/dataset/dataDetail?dataId=140666
Lv, X., Duan, F., Jiang, J.-J., Fu, X., Gan, L.: Deep metallic surface defect detection: the new benchmark and detection network. Sensors 20(6), 1562 (2020)
Wang, C.-Y., Bochkovskiy, A., Liao, H.-Y.M.: Yolov7: trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7464–7475 (2023)
Ding, X., Zhang, X., Ma, N., Han, J., Ding, G., Sun, J.: Repvgg: making vgg-style convnets great again. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13733–13742 (2021)
Wang, C.-Y., Liao, H.-Y.M., Wu, Y.-H., Chen, P.-Y., Hsieh, J.-W., Yeh, I.-H.: Cspnet: a new backbone that can enhance learning capability of cnn. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 390–391 (2020)
Wang, C.-Y., Liao, H.-Y.m., Yeh, I.-H.: Designing network design strategies through gradient path analysis. J. Inf. Sci. Eng. (2023)
Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.-Y., Berg, A.C.: Ssd: Single shot multibox detector. In: Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11–14, 2016, Proceedings, Part I 14, pp. 21–37 (2016). Springer
Ren, S., He, K., Girshick, R., Sun, J.: Faster r-cnn: Towards real-time object detection with region proposal networks. Adv. Neural Inf. Process. Syst. 28 (2015)
Jocher, G.: Ultralytics YOLOv5 (2020). https://doi.org/10.5281/zenodo.3908559 . https://github.com/ultralytics/yolov5
Li, C., Li, L., Jiang, H., Weng, K., Geng, Y., Li, L., Ke, Z., Li, Q., Cheng, M., Nie, W., et al.: Yolov6: a single-stage object detection framework for industrial applications. arXiv preprint arXiv:2209.02976 (2022)
Jocher, G., Chaurasia, A., Qiu, J.: Ultralytics YOLOv8 (2023). https://github.com/ultralytics/ultralytics
Acknowledgements
This work was financially supported by the National Nature Science Foundation of China (No. 62161020).
Funding
This work was supported by a grant from the National Nature Science Foundation of China (No. 62161020).
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Ethical approval
Not applicable.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Xu, Z., Fang, P., Yang, X. et al. YOLOv7-Rep: a re-parameterization method for surface defect detection in workpieces. J Real-Time Image Proc 22, 7 (2025). https://doi.org/10.1007/s11554-024-01583-w
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1007/s11554-024-01583-w

