Introduction
Bounding box regression is a critical component of object detection. While $\ell_n$-norm losses were traditionally used, they do not align well with the Intersection over Union (IoU) evaluation metric. IoU-based losses were introduced to bridge this gap, but they suffer from vanishing gradients when boxes do not overlap. Generalized IoU (GIoU) addressed this by incorporating the area of the smallest enclosing box, yet it often exhibits slow convergence and inaccurate results. This paper proposes Distance-IoU (DIoU) and Complete IoU (CIoU) losses to overcome these limitations by incorporating geometric constraints like center distance and aspect ratio.
Methodology
The authors introduce three primary innovations to improve the training and inference of object detectors:
Distance-IoU (DIoU) Loss
DIoU loss adds a penalty term to the standard IoU loss that accounts for the Euclidean distance between the central points of the predicted and target boxes. This distance is normalized by the diagonal length of the smallest enclosing box. Unlike GIoU, which often expands the predicted box to create overlap before refining coordinates, DIoU directly "pulls" the centers together, leading to much faster convergence.
Complete IoU (CIoU) Loss
CIoU loss extends DIoU by considering three essential geometric factors: overlap area, central point distance, and aspect ratio. By ensuring the predicted box matches the shape of the target more precisely, CIoU achieves higher accuracy in complex detection scenarios.
DIoU-NMS
The authors also propose a refinement to Non-Maximum Suppression (NMS). Traditional NMS relies solely on overlap area (IoU) to suppress redundant boxes. DIoU-NMS incorporates the distance between box centers, making the suppression process more robust, particularly for occluded objects or objects in close proximity.
Experimental Evaluation
The proposed losses were evaluated on PASCAL VOC 2007 and MS COCO 2017 datasets across various architectures, including YOLOv3, SSD, and Faster R-CNN. Additionally, a large-scale simulation experiment involving 1,715,000 regression cases was conducted to analyze the behavior of different loss functions across various distances, scales, and aspect ratios.
Key Results
- YOLOv3 (PASCAL VOC): CIoU improved Average Precision (AP) by 5.67% and AP75 by 8.95% over the IoU baseline.
- SSD (PASCAL VOC): The combination of CIoU and DIoU-NMS yielded a 1.22% AP improvement.
- Faster R-CNN (MS COCO): CIoU improved AP by 1.90% and AP75 by 2.87%.
- Convergence Speed: Simulation results confirmed that DIoU and CIoU reach convergence in significantly fewer iterations than GIoU, which often struggles with horizontal and vertical boxes.
Discussion and Conclusion
The primary insight of this work is that direct center minimization is a more efficient optimization path than the area-based expansion used in GIoU. By accounting for the "geometry trifecta"—area, distance, and aspect ratio—CIoU provides a more complete and effective loss function for bounding box regression. While CIoU shows slightly less impact on very small objects in some frameworks, its overall performance gains and faster convergence make it a superior choice for modern object detection pipelines.
Summary updated