Skip to main content
Log in

YOLOv7-Rep: a re-parameterization method for surface defect detection in workpieces

  • Research
  • Published:
Journal of Real-Time Image Processing Aims and scope Submit manuscript

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.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+
from $39.99 /Month
  • Starting from 10 chapters or articles per month
  • Access and download chapters and articles from more than 300k books and 2,500 journals
  • Cancel anytime
View plans

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

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

  1. 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)

    Article  MATH  Google Scholar 

  2. 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)

    MATH  Google Scholar 

  3. 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)

    MATH  Google Scholar 

  4. 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)

    Google Scholar 

  5. 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)

    MATH  Google Scholar 

  6. Zhao, L., Wu, Y.: Research progress of surface defect detection methods based on machine vision. Chin. J. Sci. Instrum. 43(1), 198–219 (2023)

    MATH  Google Scholar 

  7. Qi, X., Dong, X.: Improved yolov7-tiny algorithm for steel surface defect detection. Comput. Eng. Appl. 59, 176–183 (2023)

    MATH  Google Scholar 

  8. 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)

    MATH  Google Scholar 

  9. Chen, Y., Alifu, K., Lin, W., Yuan, X.: Ca-yolov5 for crowded pedestrian detection. J. Comput. Eng. Appl. 58(9), 238–245 (2022)

    MATH  Google Scholar 

  10. Yang, P., Zhang, Y., Hu, Z.: A lane detection algorithm based on improved repvgg network. J. Transp. Inf. Saf. 40(2), 73–81 (2022)

    MATH  Google Scholar 

  11. 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

  12. 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)

  13. Tong, Z., Chen, Y., Xu, Z., Yu, R.: Wise-iou: bounding box regression loss with dynamic focusing mechanism. arXiv preprint arXiv:2301.10051 (2023)

  14. 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)

    Article  MATH  Google Scholar 

  15. Tianchi: Aluminum profile surface defect identification data set (2016). https://tianchi.aliyun.com/dataset/dataDetail?dataId=140666

  16. 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)

    Article  MATH  Google Scholar 

  17. 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)

  18. 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)

  19. 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)

  20. Wang, C.-Y., Liao, H.-Y.m., Yeh, I.-H.: Designing network design strategies through gradient path analysis. J. Inf. Sci. Eng. (2023)

  21. 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

  22. 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)

  23. Jocher, G.: Ultralytics YOLOv5 (2020). https://doi.org/10.5281/zenodo.3908559 . https://github.com/ultralytics/yolov5

  24. 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)

  25. Jocher, G., Chaurasia, A., Qiu, J.: Ultralytics YOLOv8 (2023). https://github.com/ultralytics/ultralytics

Download references

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

Authors

Corresponding author

Correspondence to Pengwei Fang.

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.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

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

Download citation

  • Received:

  • Accepted:

  • Published:

  • Version of record:

  • DOI: https://doi.org/10.1007/s11554-024-01583-w

Keywords

Profiles

  1. Pengwei Fang