Please wait a minute...
Journal of ZheJiang University (Engineering Science)  2025, Vol. 59 Issue (3): 512-522    DOI: 10.3785/j.issn.1008-973X.2025.03.009
    
Steel surface defect detection algorithm based on improved YOLOv8s
Liming LIANG(),Pengwei LONG,Jiaxin JIN,Renjie LI,Lu ZENG*()
School of Electrical Engineering and Automation, Jiangxi University of Science and Technology, Ganzhou 341000, China
Download: HTML     PDF(1725KB) HTML
Export: BibTeX | EndNote (RIS)      

Abstract  

The surface defects of steel are diverse in form, complex in structure, and exhibit a high proportion of small targets, while general object detection algorithms have excessive computational complexity and are not suitable for the deployment on edge devices. To address these issues, a lightweight steel defect detection algorithm based on YOLOv8s, called SDB-YOLOv8s, was proposed. Firstly, a redesigned feature interaction module (S-C2f) was introduced to suppress spatial and channel redundant information, enhancing detection accuracy. Secondly, a dilated Transformer module was incorporated to enhance the network’s ability to capture global contextual information and sparse sampling characteristics, reducing fine-grained information loss and improving feature extraction capabilities for small targets. Finally, a lightweight network, BS-ShuffleNetV2, was designed as the backbone network to reduce model complexity while maintaining detection accuracy. Experimental validation on the NEU-DET and Severstal steel defect datasets showed that compared to baseline models, the SDB-YOLOv8 algorithm achieved an improvement in mAP of 6.4 and 7.0 percentage points, and detection frames per second of 146 and 121, with accuracy improvements of 4.6 and 6.5 percentage points respectively. The number of parameters and computational complexity were only 64.8% and 56.2% of the baseline model. The experimental results demonstrated that this algorithm achieved a better balance in terms of detection accuracy, speed, and lightweight characteristics, while providing a reference for high accuracy and real-time capabilities for edge terminal devices.



Key wordsdefect detection      lightweight YOLOv8s      deep learning      feature extraction      feature interaction     
Received: 30 January 2024      Published: 10 March 2025
CLC:  TP 391.4  
Fund:  国家自然科学基金资助项目(51365017,61463018);江西省自然科学基金资助项目(20192BAB205084);江西省教育厅科学技术研究资助项目(GJJ2200848).
Corresponding Authors: Lu ZENG     E-mail: 9119890012@jxust.edu.cn;zenglu@jxust.edu.cn
Cite this article:

Liming LIANG,Pengwei LONG,Jiaxin JIN,Renjie LI,Lu ZENG. Steel surface defect detection algorithm based on improved YOLOv8s. Journal of ZheJiang University (Engineering Science), 2025, 59(3): 512-522.

URL:

https://www.zjujournals.com/eng/10.3785/j.issn.1008-973X.2025.03.009     OR     https://www.zjujournals.com/eng/Y2025/V59/I3/512


基于改进YOLOv8s的钢材表面缺陷检测算法

钢材表面缺陷形态多样、结构复杂、小目标占比高,而通用目标检测算法计算量过大且不适合终端设备部署. 针对上述问题,提出基于YOLOv8s的轻量级的钢材缺陷检测算法(SDB-YOLOv8s). 重新设计特征交互模块(S-C2f),抑制空间和通道冗余信息,提高检测精度;引入空洞Transformer模块,增强网络对全局上下文信息的捕获能力和稀疏采样特性,以减少细粒度信息损失,并提升对小目标的特征提取能力;设计BS-ShuffleNetV2轻量化网络作为骨干网络,在降低模型复杂度的同时保证检测精度. 在NEU-DET和Severstal钢材缺陷数据集进行实验验证,结果表明,与基线模型相比,SDB-YOLOv8算法的mAP分别提升6.4和7.0个百分点、参数量和计算复杂度仅为基线模型的64.8%和56.2%. 每秒检测帧数分别达到146帧和121帧、精确度分别提升4.6和6.5个百分点. 实验结果表明,该算法在检测精度、速度和轻量化方面取得了较好的平衡,同时为边缘终端设备提供了较高精度和实时性的参考.


关键词: 缺陷检测,  轻量化YOLOv8s,  深度学习,  特征提取,  特征交互 
Fig.1 SDB-YOLOv8s network structure
Fig.2 S-C2f and ScConv network structure
Fig.3 SRU network structure
Fig.4 CRU network structure
Fig.5 DilateFormer network structure
Fig.6 BS-ShuffleNetV2 network structure
Fig.7 Images of various defects on steel surface
Fig.8 Examples of image before and after data enhancement
TmAP/%Params/106FLOPs/109FPS/帧
基线模型72.811.128.8109
0.174.410.326.9112
0.274.910.326.9117
0.377.210.326.9119
0.474.410.326.9119
0.575.210.326.9129
0.674.210.326.9119
0.773.310.326.9121
0.875.010.326.9123
0.975.210.326.9120
Tab.1 Comparison experiments of different weight thresholds for SRU
位置mAP/%Params/106FLOPs/109FPS/帧
基线模型72.811.128.8109
B74.810.326.5108
C77.210.326.9129
D73.69.324.5101
Tab.2 Experiments with different positions of S-C2f module
rmAP/%Params/106FLOPs/109FPS/帧
基线模型72.811.128.8109
175.812.328.7104
275.312.328.7101
374.712.328.799
Tab.3 DilateFormer coefficient adjustment experiment
模型mAP/%Params/106FLOPs/109FPS/帧
A72.811.128.8109
E73.06.416.4183
F72.56.215.6217
本研究74.06.416.5217
Tab.4 Improved BS-ShuffleNetV2 comparison experiments
数据集模型方法mAP/%Params/106FLOPs/109FPS/帧P/%R/%
NEU-DETYOLOv8s72.811.128.810972.870.9
YOLOv8s+M177.210.326.912977.170.4
YOLOv8s+M275.812.328.710476.770.2
YOLOv8s+M374.06.416.521771.576.0
YOLOv8s+M1+M2+M379.27.216.214677.472.1
SeverstalYOLOv8s69.911.128.810371.168.4
YOLOv8s+M174.210.326.911270.069.7
YOLOv8s+M271.112.328.78868.870.9
YOLOv8s+M372.16.416.519665.170.3
YOLOv8s+M1+M2+M376.97.216.212177.670.4
Tab.5 Ablation test results on NEU-DET and Severstal datasets
Fig.9 Comparison of AP values of proposed algorithm and original model for various types of defects
数据集模型方法mAP/%Params/106FLOPs/109FPS/帧
SeverstalAYOLOv8s74.311.128.8120
YOLOv8s+M1+M2+M377.97.216.2146
SeverstalBYOLOv8s69.911.128.8103
YOLOv8s+M1+M2+M376.97.216.2121
Tab.6 Comparison of experiments before and after enrichment of Severstal dataset
数据集模型方法mAP/%Params/106FLOPs/109FPS/帧
NEU-DETFaster R-CNN65.772.0167.317
SSD61.041.1145.341
YOLOv367.061.5155.031
YOLOv3-tiny46.58.612.9142
YOLOv451.052.5119.845
YOLOv4-tiny54.65.916.1128
YOLOv5s70.17.0716.4102
YOLOX-s71.88.021.646
YOLOv770.037.2104.836
YOLOv7-tiny68.76.0213.1108
YOLOv8s72.811.128.8120
文献[11]78.55.810.949
文献[18]74.123.975
SDB-YOLOv8s(本研究)79.27.216.2146
SeverstalSSD65.341.1145.312
YOLOv3-tiny56.48.612.9117
YOLOv4-tiny59.65.916.1103
YOLOv7-tiny68.76.0213.1108
YOLOv5s72.47.0716.459
YOLOv5m73.221.050.352.6
YOLOX-s73.88.021.642
YOLOv8s69.811.128.8103
SDB-YOLOv8s(本研究)76.97.216.2121
Tab.7 Comparative experimental results of different algorithms on NEU-DET and Severstal datasets
Fig.10 Visualization results comparison of SDB-YOLOv8s algorithm and YOLOv8s algorithm
[1]   王安静, 袁巨龙, 朱勇建, 等 基于改进YOLOv8s的鼓形滚子表面缺陷检测算法[J]. 浙江大学学报: 工学版, 2024, 58 (2): 370- 380
WANG Anjing, YUAN Julong, ZHU Yongjian, et al Drum roller surface defect detection algorithm based on improved YOLOv8s[J]. Journal of Zhejiang University: Engineering Science, 2024, 58 (2): 370- 380
[2]   袁天乐, 袁巨龙, 朱勇建, 等 基于改进YOLOv5的推力球轴承表面缺陷检测算法[J]. 浙江大学学报: 工学版, 2022, 56 (12): 2349- 2357
YUAN Tianle, YUAN Julong, ZHU Yongjian, et al Surface defect detection algorithm of thrust ball bearing based on improved YOLOv5[J]. Journal of Zhejiang University: Engineering Science, 2022, 56 (12): 2349- 2357
[3]   GIRSHICK R, DONAHUE J, DARRELL T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation [C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition . Columbus: IEEE, 2014: 580–587.
[4]   REN S, HE K, GIRSHICK R, et al Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39 (6): 1137- 1149
doi: 10.1109/TPAMI.2016.2577031
[5]   LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot multibox detector [C]// European Conference on Computer Vision . Heideberg: Springer, 2016: 21−37.
[6]   HUSSAIN M YOLO-v1 to YOLO-v8, the rise of YOLO and its complementary nature toward digital manufacturing and industrial defect detection[J]. Machines, 2023, 11 (7): 677
doi: 10.3390/machines11070677
[7]   CARION N, MASSA F, SYNNAEVE G, et al. End-to-end object detection with transformers [C]// European Conference on Computer Vision . Cham: Springer, 2020: 213–229.
[8]   ZHOU S, ZENG Y, LI S, et al Surface defect detection of rolled steel based on lightweight model[J]. Applied Sciences, 2022, 12 (17): 8905
doi: 10.3390/app12178905
[9]   QIN R, CHEN N, HUANG Y. EDDNet: An efficient and accurate defect detection network for the industrial edge environment [C]// IEEE 22nd International Conference on Software Quality, Reliability and Security . Guangzhou: IEEE, 2022: 854–863.
[10]   YANG L, HUANG X, REN Y, et al Steel plate surface defect detection based on dataset enhancement and lightweight convolution neural network[J]. Machines, 2022, 10 (7): 523
doi: 10.3390/machines10070523
[11]   张政超 改进YOLOv5的轻量级带钢表面缺陷检测[J]. 计算机系统应用, 2023, 32 (6): 278- 285
ZHANG Zhengchao Lightweight strip steel defect detection based on improved YOLOv5[J]. Computer System Applications, 2023, 32 (6): 278- 285
[12]   蔡剑锋, 柏俊杰, 张雪, 等 基于改进Mask R-CNN 的金属板材表面缺陷检测[J]. 重庆科技学院学报: 自然科学版, 2023, 25 (2): 110- 116
CAI Jianfeng, BAI Junjie, ZHANG Xue, et al Research on surface defect recognition of metal sheet based on improved Mask R-CNN[J]. Journal of Chongqing Institute of Science and Technology: Natural Science Edition, 2023, 25 (2): 110- 116
[13]   阎馨, 杨月川, 屠乃威 基于改进SSD的钢材表面缺陷检测[J]. 现代制造工程, 2023, (5): 112- 120
YAN Xin, YANG Yuechuan, TU Naiwei Steel surface defect detection based on improved SSD[J]. Modern Manufacturing Engineering, 2023, (5): 112- 120
[14]   LI J, WEN Y, HE L. Scconv: spatial and channel reconstruction convolution for feature redundancy [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition . Vancouver: IEEE, 2023: 6153–6162.
[15]   JIAO J, TANG Y M, LIN K Y, et al. Dilateformer: multi-scale dilated transformer for visual recognition [J]. IEEE Transactions on Multimedia , 2023, 25: 8906–8919.
[16]   MA N, ZHANG X, ZHENG H T, et al. Shufflenet v2: practical guidelines for efficient cnn architecture design [C]// Proceedings of the European Conference on Computer Vision . Cham: Springer, 2018: 116–131.
[17]   SANDLER M, HOWARD A, ZHU M, et al. Mobilenetv2: inverted residuals and linear bottlenecks [C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition . Salt Lake City: IEEE, 2018: 4510–4520.
[18]   曹义亲, 伍铭林, 徐露 基于改进YOLOv5算法的钢材表面缺陷检测[J]. 图学学报, 2023, 44 (2): 335- 345
CAO Yiqin, WU Minglin, XU Lu Steel surface defect detection based on improved YOLOv5 algorithm[J]. Journal of Graphics, 2023, 44 (2): 335- 345
[1] Minghui YAO,Yueyan WANG,Qiliang WU,Yan NIU,Cong WANG. Siamese networks algorithm based on small human motion behavior recognition[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(3): 504-511.
[2] Zhichao CHEN,Jie YANG,Fan LI,Zhicheng FENG. Review on deep learning-based key algorithm for train running environment perception[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(1): 1-17.
[3] Dengfeng LIU,Shihai CHEN,Wenjing GUO,Zhilei CHAI. Efficient halftone algorithm based on lightweight residual networks[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(1): 62-69.
[4] Yi ZHAO,Chun AN,Minghao LI,Jianxiao MA,Shuo HUAI. Selection of lane-changing distance for vehicles in urban expressway interchange weaving section[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(1): 205-212.
[5] Fan LI,Jie YANG,Zhicheng FENG,Zhichao CHEN,Yunxiao FU. Pantograph-catenary contact point detection method based on image recognition[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(9): 1801-1810.
[6] Li XIAO,Zhigang CAO,Haoran LU,Zhijian HUANG,Yuanqiang CAI. Elastic metamaterial design based on deep learning and gradient optimization[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(9): 1892-1901.
[7] Junjie LIN,Yaguang ZHU,Chunchao LIU,Haoyang LIU. Digital twin system of legged robot for mobile operation[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(9): 1956-1969.
[8] Haijun WANG,Tao WANG,Cijun YU. CFRP ultrasonic detection defect identification method based on recursive quantitative analysis[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(8): 1604-1617.
[9] Shuhan WU,Dan WANG,Yuanfang CHEN,Ziyu JIA,Yueqi ZHANG,Meng XU. Attention-fused filter bank dual-view graph convolution motor imagery EEG classification[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(7): 1326-1335.
[10] Linrui LI,Dongsheng WANG,Hongjie FAN. Fact-based similar case retrieval methods based on statutory knowledge[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(7): 1357-1365.
[11] Xianwei MA,Chaohui FAN,Weizhi NIE,Dong LI,Yiqun ZHU. Robust fault diagnosis method for failure sensors[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(7): 1488-1497.
[12] Juan SONG,Longxi HE,Huiping LONG. Deep learning-based algorithm for multi defect detection in tunnel lining[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(6): 1161-1173.
[13] Kang HAN,Hongfei ZHAN,Junhe YU,Rui WANG. Rolling bearing fault diagnosis based on dilated convolution and enhanced multi-scale feature adaptive fusion[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(6): 1285-1295.
[14] Bo ZHONG,Pengfei WANG,Yiqiao WANG,Xiaoling WANG. Survey of deep learning based EEG data analysis technology[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(5): 879-890.
[15] Cuiting WEI,Weijian ZHAO,Bochao SUN,Yunyi LIU. Intelligent rebar inspection based on improved Mask R-CNN and stereo vision[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(5): 1009-1019.