打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
GIOU

https://blog.csdn.net/WalkingSoul/article/details/101450597

GIoU Loss
参考文献:Generalized Intersection over Union: A Metric and A Loss for Bounding Box Regression

GIoU是源自IoU的一种边框预测的损失计算方法,在目标检测等领域,需要对预测边框(pre BBox)与实际标注边框(ground truth BBox)进行对比,计算损失。在Yolo算法中,给定预测值与ground truth的 x\y\w\h 进行预测,采用回归损失。但实际上,回归损失并不是该问题的最好损失函数,因为其只关注 x\y\w\w 对应的“距离”,而本质上我们想要得到 IoU 值比较大的预测框,两者联系并不大。那么为什么不直接采用IoU值作为损失函数呢? 因为一旦预测框与真实框不相交,那么IoU都为0,也就是说,在很大的范围内(不相交的区域),损失函数是没有梯度的,因此才有了GIoU Loss(Generalized Intersection over Union)。

1 为什么基于距离的损失函数不行?

如上图所示,在基于L1和L2范数的度量下,距离相同的两个框框,实际IoU值可能相差很远,所以说,这类损失函数在预测边界框时并不是一个好的选择!

2 GIoU的定义

其中:C代表包围A、B的最小体积(或面积),A、B是啥形状,C就是啥形状,你懂的; |C(A U B)| 为 C - (A U B)

性质:
1) 当IoU值为1时,GIoU 为 1,即|A U B| = |A ∩ B|;
2) Iou为0时,GIoU<=0;
3) -1<= GIoU <=1;
4) GIou <= IoU;
英文原文:For two arbitrary convex shapes (volumes) A, B ⊆ S ∈Rn, we first find the smallest convex shapes C ⊆ S ∈ Rnenclosing both A and B. For comparing two specific types of geometric shapes, C can be from the same type. For
example, two arbitrary ellipsoids, C could be the smallest ellipsoids enclosing them. Then we calculate a ratio between the volume (area) occupied by C excluding A and B and divide by the total volume (area) occupied by C. This represents a normalized measure that focuses on the empty volume (area) between A and B. Finally GIoU is attained by subtracting this ratio from the IoU value.

Similar to IoU, GIoU as a distance, e.g. LGIoU = 1 − GIoU, holding all properties of a metric such as non-negativity, identity of indiscernibles, symmetry and triangle inequality.
Similar to IoU, GIoU is invariant to the scale of the problem.
GIoU is always a lower bound for IoU, i.e. ∀A, B ⊆ S GIoU(A, B) ≤ IoU(A, B), and this lower bound becomes tighter when A and B have a stronger shape
GIoU作为损失函数

可见计算GIoU损失的方式其实就是计算GIoU,只不过最终结果返回的时1-GIoU。这是因为1-GIoU的取值范围在[0,2]上,且有一定的“距离”性质,即两个框重叠区域越大,损失越小,反之越大。

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
AAAI 2020 | DIoU和CIoU:IoU在目标检测中的正确打开方式
YOLOv5全面解析教程(三):IoU深入解析
目标检测中的预测框回归优化之IOU、GIOU、DIOU、CIOU和EIOU
目标检测回归损失函数简介:SmoothL1/IoU/GIoU/DIoU/CIoU Loss
改进yolov5模型-损失函数
三万字硬核详解:yolov1、yolov2、yolov3、yolov4、yolov5、yolov7_yolo各版本区别
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服