-
摘要:
工业机器人完成工件的拾取、分拣与装配等任务,需要获得准确的位置信息。而目标检测算法的回归损失函数的设定会直接影响预测框的定位准确性。针对SSD原始回归损失函数忽略4个边界信息的相关性及与评价指标IoU变化不匹配等问题,提出了一种基于改进SSD的工件定位算法。所提算法以高效交并比(EIoU)为SSD的回归损失函数,将4个边界信息作为一个整体,并添加了中心点损失和边长损失2个惩罚项分别表征预测框与真实框的中心点相对距离和边长差异,解决了边框回归不准确的问题。实验结果表明:所提算法能把定位平均误差控制在0.18 mm以内,误差峰值控制在0.76 mm以内。所提算法能有效提高工件的定位精度,适用于不同类型的工件或其他类似的定位任务,具有良好的工业应用前景。
Abstract:Accurate position information is essential for the robots to complete tasks such as picking, sorting, and assembling workpieces. However, the location accuracy of the prediction box is sensitive to the design of the loss function of the object detection algorithm. The four boundary information's correlation is disregarded in the SSD original regression loss function, which also does not account for changes in the evaluation index IoU. In response to the above problems, a workpiece location algorithm based on improved SSD is proposed. To address the problem of inaccurate bounding box regression, the suggested algorithm uses efficient intersection over union (EIoU) as the regression loss function of SSD. To represent the closeness of the center points and the difference in side length between the prediction box and the ground truth box, respectively, two penalty terms representing center point loss and aspect loss are added to the four boundary information as a whole. Experimental results demonstrate that the average location error is no more than 0.18 mm and the peak error is below 0.76 mm. The proposed algorithm not only can effectively improve the accuracy of the workpiece location but also work well in different kinds of workpieces or similar location tasks, which is promising for industrial applications.
-
Key words:
- workpiece /
- location /
- loss function /
- single shot multibox detector /
- efficient intersection over union
-
表 1 不同类型回归损失函数工件定位性能的比较
Table 1. Comparisons of performance of different regression loss functions on workpiece location
回归损失函数 平均误差/mm 最大误差/mm 推理速度/fps Smooth L1 0.29 1.19 17.74 GIoU 0.24 1.45 14.12 CIoU 0.21 0.98 14.51 EIoU 0.18 0.76 14.31 注:fps表示帧/s。 表 2 本文算法与原始SSD算法的定位误差比较
Table 2. Comparison of location errors with original SSD algorithm
% 类型 最大误差相对降低比例 平均误差相对降低比例 GIoU CIoU EIoU GIoU CIoU EIoU 类型-Ⅰ 40 38 43 61 58 61 类型-Ⅱ 20 24 36 25 31 34 类型-Ⅲ −5 25 26 0 18 32 类型-Ⅳ −67 −13 21 −30 −7 13 -
[1] 杨桂华, 刘志毅, 王晓文. 基于机器视觉多目标工件分类识别和定位研究[J]. 机床与液压, 2021, 49(11): 82-86.YANG G H, LIU Z Y, WANG X W. Research on classification, recognition and localization of multi-objectiveworkpiece based on machine vision[J]. Machine Tool & Hydraulics, 2021, 49(11): 82-86(in Chinese). [2] 闫磊, 王萌, 韩章. 基于Halcon的工件定位抓取系统设计与开发[J]. 制造业自动化, 2020, 42(10): 46-48. doi: 10.3969/j.issn.1009-0134.2020.10.011YAN L, WANG M, HAN Z. Design and development of workpiece positioning and grabbing system based on Halcon[J]. Manufacturing Automation, 2020, 42(10): 46-48(in Chinese). doi: 10.3969/j.issn.1009-0134.2020.10.011 [3] 李致金, 武鹏, 乔治, 等. 基于机器视觉的机器人工件定位系统[J]. 组合机床与自动化加工技术, 2019(12): 127-130. doi: 10.13462/j.cnki.mmtamt.2019.12.031LI Z J, WU P, QIAO Z, et al. Industrial robot positioning system based on machine vision[J]. Modular Machine Tool & Automatic Manufacturing Technique, 2019(12): 127-130(in Chinese). doi: 10.13462/j.cnki.mmtamt.2019.12.031 [4] 钟佩思, 刘敬华, 刘梅, 等. 基于改进的加速鲁棒特征算法的工件定位方法[J]. 科学技术与工程, 2019, 19(5): 197-202. doi: 10.3969/j.issn.1671-1815.2019.05.030ZHONG P S, LIU J H, LIU M, et al. Workpiece positioning method of local fitting of orthogonal function based on binocular vision[J]. Science Technology and Engineering, 2019, 19(5): 197-202(in Chinese). doi: 10.3969/j.issn.1671-1815.2019.05.030 [5] 陈岚萍, 刘寒寒, 马正华. 基于Halcon的普通工件目标检测方法[J]. 计算机工程与设计, 2018, 39(8): 2576-2581. doi: 10.16208/j.issn1000-7024.2018.08.031CHEN L P, LIU H H, MA Z H. Target detection method of common mechanical parts based on Halcon[J]. Computer Engineering and Design, 2018, 39(8): 2576-2581(in Chinese). doi: 10.16208/j.issn1000-7024.2018.08.031 [6] 胡明星, 王小兰. 模板匹配优化耦合图像校正的旋转工件目标定位算法[J]. 组合机床与自动化加工技术, 2016(6): 35-38. doi: 10.13462/j.cnki.mmtamt.2016.06.009HU M X, WANG X L. The research and application on the rotary workpiece recognition based on canny detect and SIFT features[J]. Modular Machine Tool & Automatic Manufacturing Technique, 2016(6): 35-38(in Chinese). doi: 10.13462/j.cnki.mmtamt.2016.06.009 [7] 罗辉, 崔亚飞. 基于机器视觉的工件识别与定位系统设计与实现[J]. 组合机床与自动化加工技术, 2021(1): 101-105. doi: 10.13462/j.cnki.mmtamt.2021.01.024LUO H, CUI Y F. Design and implementation of workpiece recognition and positioning system based on machine vision[J]. Modular Machine Tool & Automatic Manufacturing Technique, 2021(1): 101-105(in Chinese). doi: 10.13462/j.cnki.mmtamt.2021.01.024 [8] 卜琰, 朱世强, 王志, 等. 基于改进形状上下文特征的工件识别与定位[J]. 机械工程与自动化, 2016(6): 40-41. doi: 10.3969/j.issn.1672-6413.2016.06.016BU Y, ZHU S Q, WANG Z, et al. Workpiece recognition and localization based on improved shape context features[J]. Mechanical Engineering & Automation, 2016(6): 40-41(in Chinese). doi: 10.3969/j.issn.1672-6413.2016.06.016 [9] 刘信君, 林浒, 郑飂默, 等. 深度学习技术在工件自动检测中的应用[J]. 小型微型计算机系统, 2020, 41(4): 710-714. doi: 10.3969/j.issn.1000-1220.2020.04.007LIU X J, LIN H, ZHEN L M, et al. Application of deep learning in workpieces’ automatic detection[J]. Journal of Chinese Computer Systems, 2020, 41(4): 710-714(in Chinese). doi: 10.3969/j.issn.1000-1220.2020.04.007 [10] ZHANG Z K, QI L. Object detection of artifact threaded hole based on Faster R-CNN[J]. Journal of Measurement Science and Instrumentation, 2021, 12(1): 107-114. [11] REN S, HE K M, 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): 84-90. [12] 周伟亮, 王红军, 邹湘军. 基于视觉与激光结合的堆叠工件快速定位方法[J]. 组合机床与自动化加工技术, 2020(2): 101-104. doi: 10.13462/j.cnki.mmtamt.2020.02.024ZHOU W L, WANG H J, ZOU X J. Fast positioning method for stacked workpieces based on vision and laser[J]. Modular Machine Tool & Automatic Manufacturing Technique, 2020(2): 101-104(in Chinese). doi: 10.13462/j.cnki.mmtamt.2020.02.024 [13] LIU W, ANGUELOV D, ERHAN D, et al. SSD: Single shot multibox detector[C]//Proceedings of European Conference on Computer Vision. Berlin: Springer, 2016: 21-37. [14] LI L, FU M H, ZHANG T, et al. Research on workpiece location algorithm based on improved SSD[J]. Industrial Robot, 2022, 49(1): 108-119. doi: 10.1108/IR-01-2021-0005 [15] ZHANG Y F, REN W, ZHANG Z, et al. Focal and efficient IOU loss for accurate bounding box regression[C]//Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2021: 4321-4330. [16] YU J, JIANG Y, WANG Z, et al. UnitBox: An advanced object detection network[C]//Proceedings of the 24th ACM International Conference on Multimedia. New York: ACM, 2016: 516-520. [17] REZATOFIGHI H, TSOI N, GWAK J, et al. Generalized intersection over union: A metric and a loss for bounding box regression[C]//Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2019: 658-666. [18] ZHENG Z H, WANG P, LIU W, et al. Distance-IoU loss: Faster and better learning for bounding box regression[C]//AAAI Conference on Artificial Intelligence, 2020: 12993-13000. [19] 沈记全, 陈相均, 翟海霞. 改进交并比边界框回归损失的YOLOv3检测算法[J]. 计算机工程, 2022, 48(3): 236-243.SHEN J Q, CHEN X J, ZHAI H X. Improved bounding box regression loss of intersection over union for YOLOv3 detection algorithm[J]. Computer Engineering, 2022, 48(3): 236-243(in Chinese). [20] ZHENG T, ZHAO S, LIU Y, et al. SCALoss: Side and corner aligned loss for bounding box regression[C]//Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Piscataway: IEEE Press, 2021. [21] SUN D, YANG Y, LI M, et al. A scale balanced loss for bounding box regression[J]. IEEE Access, 2020, 8: 108438-108448. doi: 10.1109/ACCESS.2020.3001234 [22] GIRSHICK R. Fast R-CNN[C]//Proceedings of the IEEE International Conference on Computer Vision. Piscataway: IEEE Press, 2015: 1440-1448. -