Page 99 - 无损检测2024年第七期
P. 99

试验研究
              试验研究

              DOI:10.11973/wsjc202407011



                  基于改进 YOLOv8 的针灸用针缺陷检测算法




                                                   罗 顺,王衍宁,欧阳八生
                                            (南华大学 机械工程学院,衡阳 421001)

                       摘  要:一次性针灸用针由于尺寸小,生产过程中易漏检微小缺陷。针对该问题,基于
                   YOLOv8提出一种改进算法。首先,在Neck部分添加提取小目标的特征层,将更丰富的浅层特征
                   传递到新增的小目标检测头;其次,在主干网络和特征融合网络之间嵌入SimAM注意力机制,提高
                   检测的准确性和鲁棒性;最后,使用MPDIoU边界损失函数代替CIoU损失函数,提升网络的边界
                   框回归性能。试验结果表明,改进模型对实际生产收集的数据集的平均精度为95. 6%,检测速度为
                   30. 8 FPS,对于针灸用针缺陷检测具有实际应用价值。
                       关键词:缺陷检测;YOLOv8;微小缺陷;SimAM注意力机制;MPDIoU

                       中图分类号:TP391;TG115.28      文献标志码:A    文章编号:1000-6656(2024)07-0061-07

                         Defect detection algorithm of acupuncture and moxibustion needles based
                                                   on improved YOLOv8


                                            LUO Shun, WANG Yanning, OUYANG Basheng
                            (College of Mechanical Engineer, University of South China, Hengyang 421001, China)

                      Abstract: Disposable needles for acupuncture are small in size, which leads to the missing detection of tiny defects in
                   the production process. In view of this problem, this paper proposed an improved algorithm based on YOLOv8. Firstly,
                   the feature layer for extracting small targets was added to the Neck part to transfer richer shallow features to the added
                   small target detection head; secondly, the SimAM attention mechanism was embedded between the backbone network and
                   the feature fusion network to improve the accuracy and robustness of the detection; at last, the MPDIoU boundary loss
                   function was used instead of the CIoU loss function to improve the bounding box regression performance of the network.
                   The experimental results showed that the improved model had an average accuracy of 95.6% and a detection speed of
                   30.8 FPS on the dataset collected from the actual production, which was valuable for the practical application of the defect
                   detection of needles used in acupuncture and moxibustion.
                      Key words: defect detection; YOLOv8; small defect; SimAM attention mechanism; MPDIoU


                  一次性针灸用针在生产过程中需要对其外观缺                          且速度慢,难以满足实际生产检测需求。
              陷(如钝头、毛刺、弯尖等)进行检测。由于针体细                                现有针灸用针的传统视觉检测方法,通常是先
              小(直径约 0. 25 mm),其毛刺、钝头等缺陷在图像                      进行图像预处理,接着进行特征提取、匹配,然后根
              中像素少(15~30个像素)且缺陷位置变化大、同类                         据特征匹配的结果计算图像之间的差异,最后得到
              型缺陷存在较大差异,所以传统视觉检测的精度低                            检测结果。在整个检测过程中,检测效果极大程度
                                                                上受成像效果的影响,故传统检测方法难以处理缺
                 收稿日期:2023-12-06                                陷形状和尺寸的变化,无法区分较小的内缺陷,也就
                 作者简介:罗 顺(1999—),男,硕士研究生,研究方向为机器视觉,
                                                                是说,针灸用针的检测难点在于微小缺陷的识别。
              Luoshu_hy@163.com
                                                                     针对微小缺陷,国内外学者做了许多相关工作。
                 通信作者:欧阳八生(1963—),男,教授,硕士,研究方向为激光
                                                                                              [1]
              加工与应用、材料表面改性、精密塑性成形、机电智能自动化设备的                    在传统机器视觉方面,周李洪等 提出了一种通过
              设计与开发等,bsouyang@163.com                           Gabor小波去噪、Otsu阈值分割法和加权马氏距离
                                                                                                          61
                                                                                         2024 年 第 46 卷 第 7 期
                                                                                                  无损检测
   94   95   96   97   98   99   100   101   102   103   104