Abstract
Steel is a fundamental material in the manufacturing process, and the quality of the steel used directly affects the quality of the final product. During the manufacturing process, a variety of complex and irregular defects may form on the surface of the steel. In order to detect these defects, this paper proposes the DF-YOLOv7 model. The model employs the K-means + + algorithm to adjust the anchor box sizes across datasets, thereby enhancing the extraction of features for different defects. Furthermore, the D-SPPCSPC module is employed to enhance defect detection and reduce model parameters. Additionally, the CIoU Loss with Focal module addresses positive–negative sample imbalance by focusing on high-quality anchor boxes. Experimental results demonstrate that the proposed model achieves an mAP of 0.771 on the NEU-DET dataset, representing a 3.6% improvement over the original model. It outperforms some state-of-the-art detectors and meets the real-time industrial detection requirements.
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs11760-024-03679-z/MediaObjects/11760_2024_3679_Fig1_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs11760-024-03679-z/MediaObjects/11760_2024_3679_Fig2_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs11760-024-03679-z/MediaObjects/11760_2024_3679_Fig3_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs11760-024-03679-z/MediaObjects/11760_2024_3679_Fig4_HTML.jpg)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs11760-024-03679-z/MediaObjects/11760_2024_3679_Fig5_HTML.png)
![](http://media.springernature.com/m312/springer-static/image/art%3A10.1007%2Fs11760-024-03679-z/MediaObjects/11760_2024_3679_Fig6_HTML.png)
Similar content being viewed by others
Data availability
We conducted experiments on NEU-DET dataset. The dataset can be found in http://faculty.neu.edu.cn/songkechen/zh_CN/zhym/263-269/list/index.htm.
References
Tsai, D.M., Chen, M.C., Li, W.C., Chiu, W.Y.: A fast regularity measure for surface defect detection. Mach. Vis. Appl. 23, 869–886 (2012)
Liang, Y., Xu, K., Zhou, P.: Mask gradient response-based threshold segmentation for surface defect detection of milled aluminum ingot. Sensors 20, 4519 (2020)
Girshick, R., Donahue, J., Darrell, T., Malik, J.: Rich feature hierarchies for accurate object detection and semantic segmentation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp 580–587 (2014)
Girshick, R.: Fast r-cnn. In: Proceedings of the IEEE International Conference on Computer Vision. pp 1440–1448 (2015)
Ren, S., He, K., Girshick, R., & Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. Advances in neural information processing systems, 28 (2015)
Redmon, J., Divvala, S., Girshick, R., Farhadi, A.: You only look once: unified, real-time object detection. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp 779–788 (2016)
Redmon, J., Farhadi, A.: YOLO9000: better, faster, stronger. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp 7263–7271 (2017)
Redmon, J., Farhadi, A.: Yolov3: An incremental improvement. arXiv preprint arXiv:1804.02767 (2018)
Bochkovskiy, A., Wang, C. Y., Liao, H.Y.M.: Yolov4: Optimal speed and accuracy of object detection. arXiv preprint arXiv:2004.10934 (2020)
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)
Liu, S., Qi, L., Qin, H., Shi, J., Jia, J.: Path aggregation network for instance segmentation. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp 8759–8768 (2018)
Cortes, C., Vapnik, V.: Support-vector networks. Mach. Learn. 20, 273–297 (1995)
Abeywickrama, T., Cheema, M.A., Taniar, D.: K-nearest neighbors on road networks: a journey in experimentation and in-memory implementation. arXiv preprint arXiv:1601.01549 (2016)
Cai, Z., & Vasconcelos, N.: Cascade r-cnn: Delving into high quality object detection. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp 6154–6162 (2018)
He, Y., Song, K., Meng, Q., Yan, Y.: An end-to-end steel surface defect detection approach via fusing multiple hierarchical features. IEEE Trans. Instrum. Meas. 69(4), 1493–1504 (2019)
Hao, R., Lu, B., Cheng, Y., Li, X., Huang, B.: A steel surface defect inspection approach towards smart industrial monitoring. J. Intell. Manuf. 32, 1833–1843 (2021)
Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.-F., Berg. A.C.: Ssd: Single shot multibox detector. In: ECCV (2016)
Zhao, Q., Sheng, T., Wang, Y., Tang, Z., Chen, Y., Cai, L., Ling, H.: M2det: a single-shot object detector based on multi-level feature pyramid network. Proc. AAAI Conf. Artif. Intel. 33(01), 9259–9266 (2019)
Lin, T.Y., Goyal, P., Girshick, R., He, K., & Dollár, P.: Focal loss for dense object detection. In: Proceedings of the IEEE International Conference on Computer Vision. pp 2980–2988 (2017)
Cheng, X., Yu, J.: RetinaNet with difference channel attention and adaptively spatial feature fusion for steel surface defect detection. IEEE Trans. Instrum. Meas. 70, 1–11 (2020)
Zhang, J., Kang, X., Ni, H., Ren, F.: Surface defect detection of steel strips based on classification priority YOLOv3-dense network. Ironmak. Steelmak. 48(5), 547–558 (2021)
Ge, Z., Liu, S., Wang, F., Li, Z., Sun, J.: Yolox: Exceeding yolo series in 2021. arXiv preprint arXiv:2107.08430 (2021)
Zhu, C., He, Y., Savvides, M.: Feature selective anchor-free module for single-shot object detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp 840–849 (2019)
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. arXiv preprint arXiv:2207.02696 (2022)
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)
Arthur, D., Vassilvitskii, S.: k-means++: the advantages of careful seeding. Stanford (2006)
Dai, J., Qi, H., Xiong, Y., Li, Y., Zhang, G., Hu, H., Wei, Y.: Deformable convolutional networks. In: Proceedings of the IEEE International Conference on Computer Vision. pp 764–773 (2017)
Zheng, Z., Wang, P., Liu, W., Li, J., Ye, R., Ren, D.: Distance-IoU loss: faster and better learning for bounding box regression. Proc. AAAI Conf. Artif. Intel. 34(07), 12993–13000 (2020)
Kou, X., Liu, S., Cheng, K., Qian, Y.: Development of a YOLO-V3-based model for detecting defects on steel strip surface. Measurement 182, 109454 (2021)
Liu, X., Gao, J.: Surface defect detection method of hot-rolled steel strip based on improved SSD model. EasyChair 4681, 1–11 (2020)
Guo, Z., Wang, C., Yang, G., Huang, Z., Li, G.: Msft-yolo: improved yolov5 based on transformer for detecting defects of steel surface. Sensors 22(9), 3467 (2022)
Yu, J., Cheng, X., Li, Q.: Surface defect detection of steel strips based on anchor-free network with channel attention and bidirectional feature fusion. IEEE Trans. Instrum. Meas. 71, 1–10 (2021)
Funding
This work was supported by the Natural Science Foundation of Chongqing, China (Grant No. cstc2021jcyj-msxmX0605), and Science and Technology Foundation of Chongqing Education Commission (Grant No. KJQN202001137).
Author information
Authors and Affiliations
Contributions
Conceptualization, T.H. and W.Z.; methodology, W.Z.; software, Q.Y. and Y.H.; validation, W.Z. and S.L.; formal analysis, T.H.; investigation, W.Z. and J.X.; resources, T.H.; data curation, S.L. and Y.H.; writing—original draft preparation, W.Z. and J.X.; writing—review and editing, T.H. and Y.X.; visualization, W.Z. and J.X.; supervision, T.H. and Y.X.; project administration, T.H.; funding acquisition, T.H. All authors reviewed the manuscript.
Corresponding author
Ethics declarations
Conflict of interest
The authors declare no competing interests.
Ethical approval
NEU-DET dataset belong to public datasets. User can download relevant data for free for research and publish relevant articles. Our study is based on open-source data, so there are no ethical issues.
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
Zhang, W., Huang, T., Xu, J. et al. DF-YOLOv7: steel surface defect detection based on focal module and deformable convolution. SIViP 19, 97 (2025). https://doi.org/10.1007/s11760-024-03679-z
Received:
Revised:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11760-024-03679-z