Computer Engineering and Applications ›› 2021, Vol. 57 ›› Issue (20): 97-103.DOI: 10.3778/j.issn.1002-8331.2009-0450

Previous Articles     Next Articles

Research on Loss Function of Box Regression in Object Detection

ZHANG Cuiwen, ZHANG Changlun, HE Qiang, WANG Hengyou   

  1. College of Science, Beijing University of Civil Engineering and Architecture, Beijing 102600, China
  • Online:2021-10-15 Published:2021-10-21

目标检测中框回归损失函数的研究

张翠文,张长伦,何强,王恒友   

  1. 北京建筑大学 理学院,北京 102600

Abstract:

In object detection, the setting of box regression loss function directly affects the location accuracy of prediction box. The Intersection over Union(IOU) of the prediction frame and the target frame is used to set the loss function of the optimized prediction box, but the gradient return cannot be carried out when the two frames have no overlapping area. Based on the IOU loss function, Generalized Intersection over Union(GIOU) adds a non-overlapping area part to the IOU loss function, and takes the two parts as optimization items to adjust the position of the prediction box, so as to avoid the situation of gradient return. However, when the two boxes are inclusive, the second optimization term of GIOU disappears, GIOU degenerates to IOU. In order to solve the above problems, Redefined Generalized Intersection over Union(RGIOU) loss function is proposed, which redefines the area of non-overlapping part as the sum of two frames minus the intersection of two frames, and then divided by the minimum closure area formed by the two frames as part one, divide by the square of the minimum closure area as the second part, and then a new loss function is formed by adding the weight threshold. It avoids the problem that the two frames are inclusion relations, and improves the accuracy of the object detection algorithm. The algorithm is validated on Pascal VOC 2007 and MS COCO 2014 data sets.

Key words: object detection, bounding box regression, Intersection over Union(IOU), Generalized Intersection over Union(GIOU)

摘要:

在目标检测中,框回归损失函数的设定直接影响预测框的定位准确性。预测框与目标框的交并比(IOU)被设定为优化预测框的损失函数,但是当两框无重叠面积时无法进行梯度回传。广义的交并比(GIOU)在IOU损失函数的基础上增加非重叠面积部分,将两部分优化项作为损失函数调整预测框位置,解决了无法梯度回传的情况。但当两框是包含关系时,GIOU的第二部分优化项消失,损失函数退化为IOU。为了解决以上问题,提出了一种重新定义的广义交并比损失函数(RGIOU),将非重叠部分面积定义为两框之并减去两框之交,再除以两框形成的最小闭包面积作为第一部分,除以最小闭包面积的平方作为第二部分,利用权重阈值进行加和形成新的损失函数。避免了两框是包含关系时存在的问题,提升了目标检测算法的精度。上述算法在PASCAL VOC 2007以及MS COCO 2014数据集上加以验证。

关键词: 目标检测, 框回归, 交并比(IOU), 广义的交并比(GIOU)