Paper commentary
Focal and Efficient IOU Loss for Accurate Bounding Box Regression
Focal-EIOU loss speeds up and sharpens bounding box regression in object detection
- Problem Box regression losses converge slowly. IOU-based losses stay at zero when boxes don't intersect, and most anchor boxes overlap their targets poorly, with large gradients that hurt training.
- Method Focal-EIOU splits the loss into IOU, distance and aspect terms, each measured against the smallest enclosing box. It then weights the loss by IOU raised to a power, so high-overlap anchors count more.
- Results On COCO val-2017 with RetinaNet and ResNet-50-FPN, Focal-EIOU scored 37.5 AP, compared to 35.9 for the baseline.
Where box regression losses get stuck
Object detectors such as Cascade R-CNN, Mask R-CNN and DETR depend on a box regression module to pull predicted boxes onto objects. So the loss that drives that module sets how precisely each object gets localized. The paper sorts prior losses into two families, ln-norm losses and IOU-based losses.
Ln-norm losses treat x, y, w and h as separate variables, which ignores how they correlate. They also favour large boxes, because the unnormalized form lets big errors dominate. IOU-based losses are normalized and insensitive to box scale, which avoids that bias. But the plain IOU loss stays at zero whenever two boxes don't intersect, so it can't tell how far apart they are.
It also converges slowly.
GIOU adds an enclosing-box area term to handle boxes that don't overlap. Once two boxes overlap, though, that term is nearly zero or zero, so GIOU falls back to the IOU loss and stays slow. CIOU adds a center-distance term and an aspect-ratio term, which helps, but its aspect term only measures a width-to-height ratio. Any box scaled by a fixed factor k gets the same aspect term, so the term ignores how far width and height are from the target's.
The authors illustrate this with a target of 1 by 1 and an anchor starting at 1 by 2.4. After 50 iterations the anchor reaches 1.64 by 2.84, so CIOU raises aspect-ratio similarity while the real width and height gaps close less efficiently. A second problem is that most anchors overlap their targets poorly, and the authors argue their large gradients hurt training.
Separating the penalties in EIOU
The EIOU loss keeps the IOU term and replaces CIOU's single aspect penalty with two direct penalties. Each penalty targets one geometric factor: overlap area, center location, or side lengths. The loss is split into an IOU loss, a distance loss and an aspect loss.
The distance term compares the centers of the predicted and target boxes, scaled by the width and height of the smallest box that encloses both. The aspect parts compare width with width and height with height, each divided by the matching side of that enclosing box. Because every penalty is measured against the enclosing box, the loss stays normalized like other IOU-based losses.
The authors expect this direct comparison of sides to speed convergence and improve localization. They test that expectation on synthetic data, which the next section covers.
Pushing weight toward high-quality anchors
The idea is to let high-overlap anchor boxes contribute more gradient, while damping the low-overlap ones. The authors first build a FocalL1 loss on the SmoothL1 form, borrowing the reweighting spirit of focal loss. Its target gradient shape is minus x ln x, which rises quickly near zero error and falls at large errors.
A parameter β shapes the curve, and a parameter α normalizes the gradient into the range from 0 to 1. The allowed range is 1/e ≤ β ≤ 1, and α is set to eβ so that the maximum gradient equals 1. A larger β suppresses outliers more, but it also lowers the gradient of good anchors, which the authors don't want.
The authors then tried placing EIOU in the role of the offset x in this FocalL1 form. That fails because EIOU's own gradient isn't constant, and as EIOU nears zero both factors shrink, so the product gets even smaller. The fix is to scale EIOU by IOU raised to a power, so the weight tracks overlap rather than the vanishing loss value. The resulting loss is \(L_{\text{Focal-EIOU}} = \text{IOU}^{\gamma} L_{\text{EIOU}}\), where γ controls how strongly outliers are suppressed.
To avoid slow early training caused by the reweighting, the batch loss is divided by the sum of the weights in each batch.
What the synthetic simulations test
The first setup drops 1000 points into a 20 by 20 box, each with a 7 by 7 grid of anchors. Seven target boxes sit at (10,10) with a fixed scale of 100 and aspect ratios from 1:4 to 4:1. A second setup samples 100 points in a small square around the target, with 3 by 3 anchors, to stress example mining.
The regression is scored with the L1 error and the IOU metric.
Under this setup EIOU converges faster and regresses more accurately than IOU, GIOU and CIOU. Focal-EIOU ends with a larger summed regression error than EIOU, yet it yields many more high-quality regressed anchors. So the reweighting trades some early error for a larger share of well-regressed anchors.
Ablation on COCO val-2017
On COCO val-2017 with RetinaNet and ResNet-50-FPN, Focal-EIOU scored 37.5 AP, compared to 35.9 for the baseline. That is 1.6% above the baseline. Focal-EIOU is the full method, so this number reflects the EIOU penalty and the reweighting together.
EIOU alone reached 37.0 AP, above IOU at 36.5, GIOU at 36.5 and CIOU at 36.7. EIOU alone already accounts for a sizable share of the gain, since it sits 1.1% above the RetinaNet baseline. The reweighting then adds more on top of that.
Focal-EIOU (v1), which applies the FocalL1 form directly to EIOU, reached 36.8 AP. That is below the 37.5 of Focal-EIOU, so the IOU-power weighting is the version the authors keep. FocalL1 on its own reached 36.5 AP, the same as IOU and GIOU.
How sensitive the gains are to weights and shapes
The BBR weight sets the balance between the classification loss and the regression loss. Tuning that weight for EIOU gave gains of 1.1% AP, and performance dropped once the weight passed 2.5. The default weight is 2.5 for IOU-based losses and 1.0 for ln-norm losses.
For FocalL1 the authors tested several β values and kept β = 0.8 as the best trade-off. At β = 0.8, RetinaNet reached 36.5% AP, 0.6% above the baseline.
The default γ is 0.5, which the authors chose as the best trade-off. With γ = 2.0 the performance was poorer than the baseline. The authors explain that heavier suppression of hard examples can slow convergence. Focal-EIOU*, which reweights with the standard focal form, gained at first but fell quickly as γ grew.
Pairing Focal-EIOU with other detectors
The authors replaced the regression loss of several detectors with Focal-EIOU and report gains across them. Faster R-CNN with ResNet-50-FPN went from 37.3 to 38.9 AP.
ATSS with ResNet-50-FPN improved from 39.1 to 39.7 AP, and PAA from 40.3 to 40.8. The authors attribute the smaller ATSS and PAA gains to two things: both use GIOU with tuned parameters, and both reweight their own localization losses. Those reweightings, they argue, limit the improvement but confirm that example mining matters.
For context, the earlier papers report about 0.1% AP for IOU and GIOU and 0.72% for CIOU on Faster R-CNN. Those are the earlier papers' own numbers, not runs under this study's setup. The authors put their own gain at 1.6% AP against that same Faster R-CNN baseline. Using DFL alone moved ATSS from 39.2% to 39.5% AP, while Focal-EIOU added 0.6% AP in this study.
Limitations
The main ablation covers one setting: RetinaNet with ResNet-50-FPN on COCO val-2017. The simulations are synthetic and built around one 20 by 20 box with fixed anchor grids.
In the simulation the summed regression error of Focal-EIOU stays above that of EIOU. The γ sweep stops at 2.0, and at 2.0 the performance already falls below the baseline.
The authors report that Focal-EIOU is more sensitive to large elements and a little weaker than IOU on small elements. They note it occasionally assigns wrong boxes near large elements. The incorporation gains are smallest for ATSS and PAA, which already reweight their own losses.
Paper info
- Authors
- Yi-Fan Zhang, Weiqiang Ren, Zhang Zhang, Zhen Jia, Liang Wang, Tieniu Tan
- Venue
- arXiv · Preprint
- First published
- 2021-1-20
- Added
- 2026-11-12
- Updated
- 2022-7-16
- Version
- v2
- arXiv
- 2101.08158
- Category
- cs.CV
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Yi-Fan Zhang, Weiqiang Ren, Zhang Zhang, Zhen Jia, Liang Wang, Tieniu Tan (2021). Focal and Efficient IOU Loss for Accurate Bounding Box Regression. arXiv:2101.08158v2. https://arxiv.org/abs/2101.08158v2
BibTeX
@misc{zhang2021focal,
title = {{Focal and Efficient IOU Loss for Accurate Bounding Box Regression}},
author = {Yi-Fan Zhang and Weiqiang Ren and Zhang Zhang and Zhen Jia and Liang Wang and Tieniu Tan},
year = {2021},
eprint = {2101.08158},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2101.08158v2}
}