Please wait a minute...
Journal of ZheJiang University (Engineering Science)  2025, Vol. 59 Issue (7): 1514-1522    DOI: 10.3785/j.issn.1008-973X.2025.07.019
    
Surface defect detection method of precision pipe fittings based on improved YOLO-v8
Zihao LIU1,2(),Jiaxin ZHANG1,Feng XUE3,Jun ZHANG4,5,Weijie CHEN6,Yebo LU6
1. School of Artificial Intelligence, Jiaxing University, Jiaxing 314001, China
2. School of Mechanical Engineering, Tianjin University, Tianjin 300072, China
3. Zhejiang Master Hydraulic Fittings Co., Ltd, Jiaxing 314303, China
4. School of Mechanical and Electrical Engineering, Jiaxing Nanhu University, Jiaxing 314001, China
5. School of Electrical and Information Engineering, Tianjin University, Tianjin 300072, China
6. School of Mechanical Engineering, Jiaxing University, Jiaxing 314001, China
Download: HTML     PDF(1953KB) HTML
Export: BibTeX | EndNote (RIS)      

Abstract  

Random defects are characterized by micro-scale, various forms and rich types, and the defect detection accuracy and generalization performance of traditional machine learning models are ordinary. Based on the improved YOLO-v8, a multi-source pipe fitting surface defect detection method was proposed. In order to obtain global information on pipe fittings, a whole-surface image acquisition system based on the adjustable focal length of pipe fittings was constructed, and high-definition imaging of different types of pipe fittings was conducted quickly and efficiently. For the diverse sample sources, the asymptotic feature pyramid network (AFPN) architecture was added to the backbone feature extraction module of the YOLO-v8 model, and the squeeze-and-excitation (SE) attention mechanism was embedded in the bottleneck convolution feature layer to effectively improve the generalization of defect detection model. A training set and a test set were constructed by combining the video extraction of keyframes and static fixed-focus images, and the improved YOLO-v8 algorithm was used to automatically identify the surface defects of pipe fittings. Experimental results showed that the detection mAP50 of the proposed method in the inference stage was 82.2%, which was improved by 3.1 percentage points compared to the traditional YOLO-v8. The results provide a reference for the universal defect detection of metal targets.



Key wordsimproved YOLO-v8      defect detection      image processing      pipe fittings      machine vision system     
Received: 06 May 2024      Published: 25 July 2025
CLC:  TP 391.4  
Fund:  国家自然科学基金资助项目(62374074);浙江省“尖兵领雁”研发攻关计划(2024C04028);嘉兴市公益性研究计划项目(SQGY202400009);校企合作项目(00523144);海盐重点研发计划项目(2024ZD03);嘉兴大学人才项目(CD70623008);浙江省大学生科技创新训练计划项目(2023R417A030);嘉兴大学SRT科技创新训练计划项目(8517231497,8517231255,8517231256,8517231279,8517231493).
Cite this article:

Zihao LIU,Jiaxin ZHANG,Feng XUE,Jun ZHANG,Weijie CHEN,Yebo LU. Surface defect detection method of precision pipe fittings based on improved YOLO-v8. Journal of ZheJiang University (Engineering Science), 2025, 59(7): 1514-1522.

URL:

https://www.zjujournals.com/eng/10.3785/j.issn.1008-973X.2025.07.019     OR     https://www.zjujournals.com/eng/Y2025/V59/I7/1514


基于改进YOLO-v8的精密管件表面缺陷检测方法

随机缺陷具有微尺度、形态和类型多样的特点,传统机器学习模型的缺陷检测精度和泛化性能欠佳,为此提出基于改进YOLO-v8的多源管件表面缺陷检测方法. 为了获取管件全局信息,构建基于焦距可调的管件全表面图像采集系统,对不同类型管件样本进行快速、高效的高清成像. 针对样本来源多样性问题,在YOLO-v8模型的主干特征提取模块中嵌入渐进特征金字塔网络(AFPN)架构,在瓶颈卷积特征层中融合封装-激励(SE)注意力机制,有效提升缺陷检测模型的泛化性. 通过视频抽取关键帧及静态定焦拍摄相结合的方式,对标定后的图像构建训练集和测试集,采用改进YOLO-v8算法自动识别管件表面缺陷. 实验结果表明,所提方法在推理阶段的检测mAP50为82.2%,相比传统YOLO-v8提升了3.1个百分点. 该结果为金属目标的缺陷通用性检测提供了参考.


关键词: 改进YOLO-v8,  缺陷检测,  图像处理,  管件,  机器视觉系统 
Fig.1 Schematic diagram of surface defect of pipe fittings
Fig.2 Schematic diagram of image acquisition device of pipe fittings
Fig.3 Machine vision system for image acquisition of pipe fittings
Fig.4 Calculation diagram for central angle of pipe fittings
Fig.5 Structure flowchart of asymptotic feature pyramid network
Fig.6 Schematic diagram of efficient multi-scale convolution module
Fig.7 Structure schematic diagram of improved YOLO-v8 detection model
Fig.8 Heatmap display results for different pipe fittings
模型名称Inner-CIoUAFPNSEPmAP50/%NP/106GFlops
YOLO-v8------0.73180.574.293.1
++----0.78581.267.799.4
--++--0.75882.881.287.6
----++0.76481.184.994.8
++++--0.81283.176.392.2
++--++0.77982.368.796.9
--++++0.78282.184.189.3
本研究++++++0.79583.578.995.5
Tab.1 Ablation experiment results of improved YOLO-v8 detection model
Fig.9 Plot of improved YOLO-v8 detection model’s loss function and accuracy curve
方法mAP50/%NP/106t/ms
训练阶段验证阶段
多层感知器[19]67.365.417.15.2
YOLO-v4[20]76.471.186.721.8
YOLO-v5[21]77.175.682.927.3
YOLO-v7[22]80.175.7103.432.8
YOLOX[23]79.378.687.731.6
YOLO-v8[12]80.579.174.227.2
本研究83.582.278.929.7
Tab.2 Performance comparison results of different detection methods
缺陷类型mAP50/%t/ms
训练阶段推理阶段
磕碰(bruise)83.578.225.5
裂纹-1(crack)97.326.8
裂纹-3(crack)90.829.7
锈迹(rust)81.633.9
毛刺(burr)77.828.2
平均值83.585.128.8
Tab.3 Experimental results of pipe fitting defect detection with improved YOLO-v8 detection model
Fig.10 Detection results of five surface defects on metal pipe fittings with improved YOLO-v8 detection model
[1]   WEN S, CHEN Z, LI C Vision-based surface inspection system for bearing rollers using convolutional neural networks[J]. Applied Sciences, 2018, 8 (12): 2565
doi: 10.3390/app8122565
[2]   TAO J, ZHU Y, JIANG F, et al Rolling surface defect inspection for drum-shaped rollers based on deep learning[J]. IEEE Sensors Journal, 2022, 22 (9): 8693- 8700
doi: 10.1109/JSEN.2022.3159743
[3]   XU L M, YANG Z Q, JIANG Z H, et al Light source optimization for automatic visual inspection of piston surface defects[J]. The International Journal of Advanced Manufacturing Technology, 2017, 91 (5): 2245- 2256
[4]   FEYZA C, SERAP K, ALI O M, et al Online metallic surface defect detection using deep learning[J]. Emerging Materials Research, 2020, 9 (4): 1- 8
[5]   姜乐兵, 宋飞虎, 裴永胜, 等 基于粒子群优化Gabor滤波器的钢板表面缺陷检测[J]. 传感器与微系统, 2023, 42 (11): 135- 138
JIANG Lebing, SONG Feihu, PEI Yongsheng, et al Surface defect detection of steel plate based on PSO-Gabor filter[J]. Transducer and Microsystem Technologies, 2023, 42 (11): 135- 138
[6]   郭浩然, 郭继昌, 汪昱东 面向水下场景的轻量级图像语义分割网络[J]. 浙江大学学报: 工学版, 2023, 57 (7): 1278- 1286
GUO Haoran, GUO Jichang, WANG Yudong Lightweight semantic segmentation network for underwater image[J]. Journal of Zhejiang University: Engineering Science, 2023, 57 (7): 1278- 1286
[7]   崔克彬, 焦静颐 基于MCB-FAH-YOLOv8的钢材表面缺陷检测算法[J]. 图学学报, 2024, 45 (1): 112- 125
CUI Kebin, JIAO Jingyi Steel surface defect detection algorithm based on MCB-FAH-YOLOv8[J]. Journal of Graphics, 2024, 45 (1): 112- 125
[8]   王春梅, 刘欢 YOLOv8-VSC: 一种轻量级的带钢表面缺陷检测算法[J]. 计算机科学与探索, 2024, 18 (1): 151- 160
WANG Chunmei, LIU Huan YOLOv8-VSC: lightweight algorithm for strip surface defect detection[J]. Journal of Frontiers of Computer Science and Technology, 2024, 18 (1): 151- 160
doi: 10.3778/j.issn.1673-9418.2308060
[9]   ZHENG H, KONG L X, NAHAVANDI S Automatic inspection of metallic surface defects using genetic algorithms[J]. Journal of Materials Processing Technology, 2002, 125: 427- 433
[10]   STIVANELLO M E, MARCELLINO K J A machine vision system for online metal can-end rivet inspection[J]. Journal of Physics: Conference Series, 2019, 1335 (1): 012002
doi: 10.1088/1742-6596/1335/1/012002
[11]   SUN J, LI C, WU X J, et al An effective method of weld defect detection and classification based on machine vision[J]. IEEE Transactions on Industrial Informatics, 2019, 15 (12): 6322- 6333
doi: 10.1109/TII.2019.2896357
[12]   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
[13]   刘莫尘, 褚镇源, 崔明诗, 等. 基于改进YOLO v8-Pose的红熟期草莓识别和果柄关键点检测 [EB/OL]. (2023–09–12)[2024–05–21]. https://link.cnki.net/urlid/11.1964.S.20230911.2034.046.
[14]   谢碧森. 基于卷积神经网络的牛脸识别技术研究[D]. 昆明: 云南大学, 2021: 1–58.
XIE Bisen. Research on cow face recognitiontechnology based on convolutional neural network [D]. Kunming: Yunnan University, 2021: 1–58.
[15]   张求星. 基于ByteTrack的自动驾驶多目标行人跟踪技术研究[D]. 北京: 军事科学院, 2023: 1–73.
ZHANG Qiuxing. Research on ByteTrack based autonomous driving multi object pedestrian tracking technology [D]. Beijing: Academy of Military Science, 2023: 1–73.
[16]   杨观赐, 杨静, 苏志东, 等 改进的YOLO特征提取算法及其在服务机器人隐私情境检测中的应用[J]. 自动化学报, 2018, 44 (12): 2238- 2249
YANG Guanci, YANG Jing, SU Zhidong, et al An improved YOLO feature extraction algorithm and its application to privacy situation detection of social robots[J]. Acta Automatica Sinica, 2018, 44 (12): 2238- 2249
[17]   DUAN D Y, XIA Y J Pseudo color ghost coding imaging with pseudo thermal light[J]. Optics Communications, 2018, 413: 295- 298
doi: 10.1016/j.optcom.2017.12.064
[18]   HU J, SHEN L, SUN G. Squeeze-and-excitation networks [C]// Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. Salt Lake City: IEEE, 2018: 7132–7141.
[19]   ZHOU Y, XU J IoT perception layer scheduling deadlock relieving optimization method[J]. Journal of Intelligent and Fuzzy Systems, 2020, 38 (6): 7521- 7529
[20]   BOCHKOVSKIY A, WANG C Y, LIAO H Y M. YOLOv4: optimal speed and accuracy of object detection [EB/OL]. (2020–04–23)[2024–05–21]. https://arxiv.org/pdf/2004.10934.
[21]   XING B, WANG W, QIAN J, et al A lightweight model for real-time monitoring of ships[J]. Electronics, 2023, 12 (18): 3804- 3821
doi: 10.3390/electronics12183804
[22]   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 [C]// 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Vancouver: IEEE, 2023: 7464–7475.
[1] Wenbo JU,Huajun DONG. Motherboard defect detection method based on context information fusion and dynamic sampling[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(6): 1159-1168.
[2] Gengliang LIANG,Shuguang HAN. Denim fabric defect detection algorithm based on improved RT-DETR[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(6): 1169-1178.
[3] Liming LIANG,Pengwei LONG,Jiaxin JIN,Renjie LI,Lu ZENG. Steel surface defect detection algorithm based on improved YOLOv8s[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(3): 512-522.
[4] Minhang YANG,Haisong XU,Yiming HUANG,Zhengnan YE,Yuntao ZHANG,Bin HU. Illumination-aware color consistency algorithm for cross-camera applications[J]. Journal of ZheJiang University (Engineering Science), 2025, 59(3): 557-565.
[5] 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.
[6] Shancheng TANG,Jianhui LU,Ying ZHANG,Zicheng JIN,Anxin ZHAO. Unsupervised surface defect detection of magnetic tile for repair of suspected area defects[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(4): 718-728.
[7] Kun LIU,Ding WANG,Jingkai WANG,Haiyong CHEN,Weipeng LIU. Feature filtering and feature decoupling based domain generalization model[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(3): 459-467.
[8] Anjing WANG,Julong YUAN,Yongjian ZHU,Cong CHEN,Jinjin WU. Drum roller surface defect detection algorithm based on improved YOLOv8s[J]. Journal of ZheJiang University (Engineering Science), 2024, 58(2): 370-380.
[9] Xiao-qiang ZHAO,Ze WANG,Zhao-yang SONG,Hong-mei JIANG. Image super-resolution reconstruction based on dynamic attention network[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(8): 1487-1494.
[10] Hao-ran GUO,Ji-chang GUO,Yu-dong WANG. Lightweight semantic segmentation network for underwater image[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(7): 1278-1286.
[11] Fan XIONG,Tian CHEN,Bai-cheng BIAN,Jun LIU. Chip surface character recognition based on convolutional recurrent neural network[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(5): 948-956.
[12] Qing-lin AI,Jing-rui CUI,Bing-hai LV,Tong TONG. Surface defect detection method for bearing drum-shaped rollers based on fusion transformation of defective area[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(5): 1009-1020.
[13] Bai-cheng BIAN,Tian CHEN,Ru-jun WU,Jun LIU. Improved YOLOv3-based defect detection algorithm for printed circuit board[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(4): 735-743.
[14] Huan LAN,Jian-bo YU. Steel surface defect detection based on deep learning 3D reconstruction[J]. Journal of ZheJiang University (Engineering Science), 2023, 57(3): 466-476.
[15] Pei-zhi WEN,Jun-mou CHEN,Yan-nan XIAO,Ya-yuan WEN,Wen-ming HUANG. Underwater image enhancement algorithm based on GAN and multi-level wavelet CNN[J]. Journal of ZheJiang University (Engineering Science), 2022, 56(2): 213-224.