Source-linked AI summary

Generalized Intersection over Union: A Metric and A Loss for Bounding Box Regression

Hamid Rezatofighi, Nathan Tsoi, JunYoung Gwak, Amir Sadeghian, Ian Reid, Silvio Savarese

arXiv:1902.09630v2cs.CVcs.AIcs.LG

TL;DR

Bounding-box regression losses do not strongly correlate with IoU, and IoU cannot guide optimization for non-overlapping boxes. This paper introduces GIoU as a generalized metric and loss, consistently improving object-detection performance on PASCAL VOC and MS COCO under IoU- and GIoU-based measures.

  • Problem

    Common parametric losses do not strongly correlate with IoU, while IoU has an optimization plateau for non-overlapping bounding boxes.

  • Method

    The paper introduces GIoU as a generalized metric and derives an analytical rectangle formulation usable as a bounding-box regression loss.

  • Results

    GIoU loss consistently improved object-detection performance on PASCAL VOC and MS COCO using both IoU- and GIoU-based measures.

  • Takeaways & Limitations

    GIoU provides an alternative metric and regression loss for applications relying on IoU-based evaluation or 2D bounding-box regression.

  • Takeaways & Limitations

    GIoU lacks an analytical solution for intersections and smallest enclosing convex objects between arbitrary shapes.

Abstract

from arXiv · show

Intersection over Union (IoU) is the most popular evaluation metric used in the object detection benchmarks. However, there is a gap between optimizing the commonly used distance losses for regressing the parameters of a bounding box and maximizing this metric value. The optimal objective for a metric is the metric itself. In the case of axis-aligned 2D bounding boxes, it can be shown that $IoU$ can be directly used as a regression loss. However, $IoU$ has a plateau making it infeasible to optimize in the case of non-overlapping bounding boxes. In this paper, we address the weaknesses of $IoU$ by introducing a generalized version as both a new loss and a new metric. By incorporating this generalized $IoU$ ($GIoU$) as a loss into the state-of-the art object detection frameworks, we show a consistent improvement on their performance using both the standard, $IoU$ based, and new, $GIoU$ based, performance measures on popular object detection benchmarks such as PASCAL VOC and MS COCO.

1. Introduction

The paper identifies a mismatch between parameterized bounding-box losses and IoU optimization, while noting that IoU itself is differentiable for axis-aligned rectangles but fails for non-overlapping boxes. It introduces GIoU to extend IoU to non-overlapping cases while preserving scale invariance and correlation with IoU, and applies it as a loss in object detectors.

  • Motivation: Bounding box regression underpins object localization, detection, tracking, and instance-level segmentation.The introduction frames accurate bounding box regression as fundamental across these 2D/3D computer vision tasks.
  • Problem: Common ℓn-norm losses on box parameters do not strongly correlate with improving IoU.Figure 1 illustrates that equal parameter distances can correspond to very different IoU and GIoU values.
  • IoU limitation: IoU is directly backpropagatable for axis-aligned rectangles, making it preferable as a 2D object-detection objective.The paper states that IoU has a straightforward analytical solution for axis-aligned rectangles and n-orthotopes.
  • IoU limitation: For non-overlapping boxes, IoU is zero, provides no distance information, and has a zero gradient when used as a loss.This plateau prevents optimization in the non-overlapping case.
  • Contribution: GIoU generalizes IoU to non-overlapping shapes while preserving its region-based definition, scale invariance, and correlation with IoU for overlapping objects.The paper introduces GIoU as both a metric and a loss, with an analytical solution for axis-aligned rectangles or n-orthotopes.
  • Contribution: Integrating GIoU loss into Faster R-CNN, Mask R-CNN, and YOLO v3 improves performance on standard object-detection benchmarks.The stated contribution covers incorporation into popular object-detection algorithms and evaluation on standard benchmarks.

2. Related Work

Related work centers on IoU-based detection evaluation, diverse bounding-box representations and losses, and efforts to optimize IoU directly or indirectly. These approaches leave room for improvement because common regression losses do not directly represent IoU, while IoU optimization can plateau for non-overlapping boxes.

  • Object detection accuracy measures: IoU is the de facto object-detection evaluation metric, with PASCAL VOC mAP commonly computed at a fixed IoU threshold of 0.5.Using IoU requires selecting an accuracy threshold, and the passage characterizes this choice as arbitrary.
  • Bounding box representations and losses: Prior work proposes diverse bounding-box representations and regression losses, including YOLO v1’s direct parameter regression with a square-root size transformation.The transformation is intended to remedy scale sensitivity.
  • Bounding box representations and losses: Most popular object detectors combine these representations and losses, but their regression objectives are not directly representative of the core evaluation metric, IoU.The passage identifies GIoU as an opportunity for further localization improvement.
  • Optimizing IoU using an approximate or a surrogate function: Prior IoU-optimization methods use approximate functions or surrogate losses, but face approximation issues or an optimization plateau for non-overlapping boxes.The passage discusses such efforts in both semantic segmentation and object detection.

3. Generalized Intersection over Union

GIoU extends IoU by incorporating the empty region within the smallest enclosing convex shape, addressing IoU’s inability to distinguish non-overlapping shapes by proximity. It preserves key metric properties while providing a bounded, scale-invariant similarity measure suitable for 2D object-detection evaluation and loss design.

  • Definition: GIoU finds the smallest convex shape enclosing A and B, measures the normalized empty volume between them, and subtracts that ratio from IoU.For matching shape types, the enclosing shape can also be chosen from that same type.
  • Metric properties: LGIoU = 1 − GIoU is a metric distance satisfying non-negativity, identity of indiscernibles, symmetry, and triangle inequality.Thus, GIoU retains the metric-distance properties established for IoU.
  • Metric properties: GIoU is always a lower bound for IoU, with GIoU(A, B) ≤ IoU(A, B), and converges to IoU as the shapes become increasingly similar and proximate.The lower bound becomes tighter when A and B have stronger shape similarity and proximity.
  • Scope and use: Unlike IoU’s range 0 to 1, GIoU has the symmetric range −1 to 1 and can therefore serve as a substitute metric for 2D/3D computer-vision tasks.The paper focuses on 2D object detection, where an analytical GIoU solution supports use as both metric and loss; non-axis-aligned 3D extension remains future work.

4. Experimental Results

Experiments replace detector-specific bounding-box regression losses with LIoU or LGIoU in YOLO v3, Faster R-CNN, and Mask R-CNN across PASCAL VOC and MS COCO. LGIoU consistently improves detection accuracy under IoU- and GIoU-based measures, although gains are smaller for Faster R-CNN and Mask R-CNN and YOLO v3 classification scores may limit AP.

  • Experimental setup: LGIoU replaces smooth ℓ1 in Faster R-CNN and Mask R-CNN and MSE in YOLO v3, with LIoU included as a comparison loss.The experiments evaluate these losses within established 2D object detectors.
  • Datasets and evaluation: Experiments use PASCAL VOC 2007 and MS COCO, reporting standard IoU-based measures and, where available, the new GIoU-based measure.MS COCO test-set annotations permit reporting only the standard IoU-based measure.
  • YOLO v3: On PASCAL VOC 2007, YOLO v3 trained with LGIoU improves performance under both standard IoU-based and new GIoU-based measures.YOLO v3 is trained for up to 50K iterations and evaluated on the test set using the best model for each loss.
  • YOLO v3: On MS COCO, YOLO v3 results similarly support improved localization with LGIoU, while classification scores may remain below the baseline under naive loss-balancing regularization.The authors attribute possible AP underperformance to classification error and suggest better regularization-parameter search.
  • Faster R-CNN and Mask R-CNN: On PASCAL VOC 2007, Faster R-CNN with LGIoU consistently outperforms its smooth ℓ1 regression loss, while LIoU provides only a slight improvement.The comparison uses both standard IoU-based and new GIoU-based performance measures.
  • Faster R-CNN and Mask R-CNN: Across Faster R-CNN and Mask R-CNN, LGIoU improves detection accuracy over smooth ℓ1, but the gains are smaller than in earlier experiments, partly because denser anchors reduce non-overlapping-box cases.The passage identifies non-overlapping boxes as scenarios where LGIoU has an advantage over LIoU.

5. Conclusion

The paper introduces GIoU as a generalization of IoU that preserves its appealing properties while addressing its weakness, and demonstrates its use as a bounding box regression loss. Experiments show consistent improvements on PASCAL VOC and MS COCO, while future work targets rotating cuboids for 3D detection.

  • 5. Conclusion: GIoU generalizes IoU to compare arbitrary shapes while addressing IoU’s weakness and serving as an alternative for IoU-based 2D/3D vision measures.The authors state that GIoU retains IoU’s appealing properties.
  • 5. Conclusion: An analytical solution computes GIoU for two axis-aligned rectangles, whose derivative can serve as a bounding box regression loss.The loss was incorporated into state-of-the-art object detection algorithms.
  • 5. Conclusion: The authors plan to derive an analytic solution for GIoU between rotating rectangular cuboids and incorporate it as a loss for 3D object detection.They identify this extension as having potential to improve 3D object detection frameworks.
Loading 1902.09630v2…