Source-linked AI summary
Focal and Efficient IOU Loss for Accurate Bounding Box Regression
Yi-Fan Zhang, Weiqiang Ren, Zhang Zhang, Zhen Jia, Liang Wang, Tieniu Tan
TL;DR
BBR losses can converge slowly, localize inaccurately, and overemphasize low-quality anchors. The paper proposes EIOU and a regression focal loss, combining them as Focal-EIOU; experiments report consistent improvements across detectors and datasets.
Problem
Existing BBR losses inefficiently represent regression geometry, while low-overlap anchors contribute excessively to optimization.
Method
The paper proposes EIOU to measure overlap, center, and side-length discrepancies, then combines it with regression focal loss in Focal-EIOU.
Results
Focal-EIOU brings significant and consistent improvements with multiple state-of-the-art object detection models on synthetic and COCO datasets.
Takeaways & Limitations
The proposed loss functions improve the efficiency and accuracy of bounding-box regression across evaluated detection settings.
Takeaways & Limitations
CIOU can optimize aspect-ratio similarity while hindering reduction of the true width and height discrepancies.
Abstract
from arXiv · showhide
In object detection, bounding box regression (BBR) is a crucial step that determines the object localization performance. However, we find that most previous loss functions for BBR have two main drawbacks: (i) Both $\ell_n$-norm and IOU-based loss functions are inefficient to depict the objective of BBR, which leads to slow convergence and inaccurate regression results. (ii) Most of the loss functions ignore the imbalance problem in BBR that the large number of anchor boxes which have small overlaps with the target boxes contribute most to the optimization of BBR. To mitigate the adverse effects caused thereby, we perform thorough studies to exploit the potential of BBR losses in this paper. Firstly, an Efficient Intersection over Union (EIOU) loss is proposed, which explicitly measures the discrepancies of three geometric factors in BBR, i.e., the overlap area, the central point and the side length. After that, we state the Effective Example Mining (EEM) problem and propose a regression version of focal loss to make the regression process focus on high-quality anchor boxes. Finally, the above two parts are combined to obtain a new loss function, namely Focal-EIOU loss. Extensive experiments on both synthetic and real datasets are performed. Notable superiorities on both the convergence speed and the localization accuracy can be achieved over other BBR losses.
1. Introduction
The paper identifies inefficiencies in existing BBR losses and proposes EIOU, regression focal loss, and their combination Focal-EIOU to improve convergence and localization.
- Limitations of Existing Losses: Existing ℓ_n-norm losses ignore correlations among BBR variables and are biased toward large bounding boxes.Their unnormalized form creates scale sensitivity.
- Limitations of Existing Losses: Existing IOU-based losses jointly regress box variables and normalize scale, but often converge slowly, localize inaccurately, and neglect informative anchors.Low-quality anchors can therefore remain overly influential during optimization.
- Proposed Methods: EIOU explicitly measures discrepancies in overlap area, central point, and side length through an additional penalty term.This targets three geometric factors directly rather than treating the box only as a whole unit.
- Proposed Methods: A regression focal loss emphasizes high-quality anchors with large IOUs during BBR optimization.The method is motivated by the imbalance between high- and low-quality anchor boxes.
- Evaluation: Focal-EIOU combines the two proposed methods into a BBR loss evaluated on synthetic and real datasets.The paper reports faster convergence, superior regression results, and extensive ablation studies.
2. Related Work
Prior BBR research progressed from norm-based losses to IOU-based and focal-style approaches, while this paper targets remaining efficiency and example-imbalance problems.
- Background: BBR refines predicted boxes from initial proposals or anchor boxes and is used in most recent object detection methods.Loss design is therefore central to bounding-box localization.
- Norm-Based Losses: SmoothL1 and related ℓ_n-norm losses improve robustness but mostly treat box variables as independent despite their correlations.The related-work discussion identifies this independence assumption as inconsistent with reality.
- IOU-Based Losses: IOU-based losses address scale sensitivity by jointly regressing box variables as a normalized unit, but existing variants retain convergence and localization weaknesses.They also neglect the importance of informative anchor boxes.
- Effective Example Mining: BBR retains an imbalance problem because most anchor boxes have small overlaps with target boxes.This motivates effective example mining for regression.
- Effective Example Mining: Earlier revised losses increase gradients for high-quality examples but do not suppress outlier gradients.The paper instead designs a regression focal loss to exploit promising anchors more fully.
3. Efficient Intersection over Union Loss
The section identifies limitations in IOU, GIOU, and CIOU losses and proposes EIOU to explicitly regress overlap, center distance, and side lengths for faster, more accurate localization.
- Limitations of IOU Loss: IOU loss is zero for non-overlapping boxes and has slow convergence.
- Limitations of Generalized IOU Loss: GIOU handles non-overlap but can increase bounding-box area rather than reduce spatial discrepancy.
- Limitations of Generalized IOU Loss: When boxes overlap, GIOU can degrade to IOU, leaving convergence slow.
- Limitations of Complete IOU Loss: CIOU’s v term represents aspect-ratio discrepancy rather than the actual width and height differences, assigning v = 0 to proportionally scaled boxes.
- Limitations of Complete IOU Loss: CIOU’s aspect-ratio term can improve ratio similarity while hindering efficient reduction of width and height discrepancies.In the reported example, an anchor changed from w = 1, h = 2.4 to w = 1.64, h = 2.84 after 50 iterations, despite a target of wgt = 1, hgt = 1.
- The Proposed Method: EIOU revises CIOU by directly measuring overlap area, central-point distance, and width and height discrepancies.Its loss is divided into IOU, distance, and aspect components, with an additional penalty term for the geometric discrepancies.
4. Focal Loss For BBR
The regression focal loss is designed to emphasize high-quality anchor boxes while suppressing low-quality examples. Focal-EIOU combines this reweighting with EIOU, using IOU-based weights to avoid vanishing gradients and improve regression focus.
- Motivation: BBR contains far fewer high-quality anchors than low-quality outliers, whose excessively large gradients can harm training.The section motivates emphasizing examples with small regression errors during optimization.
- FocalL1 Loss: The desired gradient function vanishes at zero error, rises rapidly for small errors, and decreases gradually for large errors.The proposed −x ln x curve satisfies the first two properties, while α and β control normalization and curve shape.
- FocalL1 Loss: FocalL1 uses β-controlled gradient curves to increase inlier gradients and suppress outlier gradients.Increasing β further suppresses outlier gradients, while also reducing high-quality-example gradients before normalization.
- Focal-EIOU Loss: Directly replacing the FocalL1 offset with EIOU produces overly small gradients near zero EIOU, weakening reweighting of high-quality boxes.The problem arises because both the EIOU derivative and focal derivative become small near zero.
- Focal-EIOU Loss: Focal-EIOU instead reweights EIOU with IOU, using γ to control outlier inhibition; Eq. (10) achieves superior performance among tested reweighting forms.The section defines IOU as intersection area divided by union area.
5. Experiments
The experiments use synthetic and real datasets to evaluate convergence and localization-related performance. COCO 2017 evaluation uses COCO-style Average Precision as the principal metric.
- Datasets and Evaluation Metrics: Experiments evaluate the proposed losses on both synthetic and real datasets.Synthetic experiments study EIOU, Focal-EIOU, and the importance of effective example mining.
- Datasets and Evaluation Metrics: COCO 2017 experiments train on 115k train-2017 images, report ablations on 5k val-2017 images, and use COCO-style AP as the main metric.The reported evaluation concerns the bounding box detection track.
5.2. Implementation Details
The implementation uses standardized simulation and detector-training procedures, with specified backbones, optimization schedules, and loss normalization. Focal-EIOU is normalized by batch weight sums to mitigate early-training slow convergence from reweighting.
- Implementation Details: COCO experiments use publicly available backbones, with most experiments using ResNet-50 and 90k training iterations.Detector training uses four GPUs, four images per GPU, and SGD.
- Implementation Details: Focal-EIOU is normalized by the sum of per-pair weights in each batch to avoid slow convergence during early reweighted training.The normalization uses each pair’s EIOU loss and corresponding weight.
5.3. Simulation Experiments
Simulation experiments compare EIOU and Focal-EIOU with other losses under different anchor-quality distributions. EIOU improves convergence and regression accuracy, while Focal-EIOU produces more high-quality anchors despite tolerating some low-quality results.
- Simulation Results 1: EIOU converges faster and achieves better regression accuracy than IOU, GIOU, and CIOU when most anchors are low quality.Figure 7 compares regression-error sums and IOU distributions across loss functions.
- Simulation Results 1: Focal-EIOU has larger regression error than EIOU in the first simulation because it is less concerned with hard examples.Despite this, its number and quality of high-quality examples are much higher than those of the other losses.
- Simulation Results 2: Focal-EIOU shows the fastest convergence and lowest regression error in the second simulation while improving high-quality-example quality faster than other IOU-based losses.Its IOU mean is much higher than EIOU’s, although it has a longer tail of low-quality anchors.
- Simulation Results: The simulations indicate that both EIOU and Focal-EIOU converge faster, while Focal-EIOU achieves lower localization errors through high-quality-example reweighting.The conclusion attributes Focal-EIOU’s lower localization errors to reweighting high-quality examples.
5.4. Ablation Experiments
Ablation studies show that Focal-EIOU’s gains depend on both effective reweighting and appropriate hyperparameters, with γ = 0.5 providing the best trade-off.
- The FocalL1 loss improves box AP from 35.9% to 36.5%.
- 1.1% higher box AP than the ResNet-50 FPN RetinaNet baseline is achieved by EIOU.
- Directly applying the FocalL1 formulation to EIOU does not work well, whereas Focal-EIOU improves the baseline’s AP by 1.6%.
- 36.5% AP is obtained with FocalL1 at β = 0.8, 0.6% above the ResNet-50 FPN RetinaNet baseline.
- Focal-EIOU provides more stable improvement than focal reweighting, while larger γ increasingly suppresses hard-example gradients and can retard convergence.
5.5. Incorporations with State-of-the-Arts
Focal-EIOU consistently improves detection accuracy when incorporated into several state-of-the-art detectors, although gains are smaller for ATSS and PAA.
- Focal-EIOU consistently improves the performance of Faster R-CNN, Mask R-CNN, RetinaNet, PAA, ATSS, and DETR over their original regression losses.
- 1.6% AP improvement is reported for Focal-EIOU over the Faster R-CNN baseline, compared with 0.1% for LIOU and LGIOU and 0.72% for LCIOU.
- 0.6% AP improvement is achieved by Focal-EIOU for ATSS, compared with an improvement from 39.2% to 39.5% AP for DFL.
5.6. Discussion on Focal-EIOU loss and error set analysis
Visual error analysis indicates that Focal-EIOU is strongest on medium and large objects but can produce errors or lower-confidence predictions for small objects.
- Focal-EIOU more often finds accurate, higher-confidence boxes for medium and large objects.
- For small objects, Focal-EIOU can be inferior to the original IOU loss and assign blurry, lower-confidence boxes.
- Focal-EIOU occasionally assigns wrong boxes near large elements, despite generally better performance on medium and large objects.
6. Conclusion
The paper identifies underexploited BBR losses and neglected effective example mining as limitations of existing approaches. It proposes Focal-EIOU and reports significant, consistent improvements across synthetic and COCO experiments.
- Existing BBR losses have drawbacks that can hinder correct bounding-box regression guidance.
- Low-quality examples can contribute excessively large gradients because effective example mining is often neglected.
- Focal-EIOU combines improved loss design with balanced gradients from high- and low-quality examples.
- Extensive synthetic and COCO experiments show significant and consistent improvements with multiple state-of-the-art models.