Source-linked AI summary

Wise-IoU: Bounding Box Regression Loss with Dynamic Focusing Mechanism

Zanjia Tong, Yuhang Chen, Zewei Xu, Rong Yu

arXiv:2301.10051v3cs.CV

TL;DR

Object-detection BBR losses must localize accurately despite low-quality training examples, which can generate harmful gradients. The paper proposes WIoU with dynamic non-monotonic focusing based on anchor-box outlier degree, and reports improved generalization and detector performance.

  • Problem

    Low-quality examples and static focusing mechanisms limit how BBR losses allocate gradients during object-detector training.

  • Method

    WIoU combines IoU-based loss with dynamic non-monotonic focusing that reduces gains for high-quality and low-quality outlier anchor boxes.

  • Results

    Dynamic non-monotonic focusing improves BBR performance and generalization in the reported ablation and comparison studies.

  • Takeaways & Limitations

    WIoU v3 improves overall detector performance by reallocating learning between low-quality and high-quality examples.

Abstract

from arXiv · show

The loss function for bounding box regression (BBR) is essential to object detection. Its good definition will bring significant performance improvement to the model. Most existing works assume that the examples in the training data are high-quality and focus on strengthening the fitting ability of BBR loss. If we blindly strengthen BBR on low-quality examples, it will jeopardize localization performance. Focal-EIoU v1 was proposed to solve this problem, but due to its static focusing mechanism (FM), the potential of non-monotonic FM was not fully exploited. Based on this idea, we propose an IoU-based loss with a dynamic non-monotonic FM named Wise-IoU (WIoU). The dynamic non-monotonic FM uses the outlier degree instead of IoU to evaluate the quality of anchor boxes and provides a wise gradient gain allocation strategy. This strategy reduces the competitiveness of high-quality anchor boxes while also reducing the harmful gradient generated by low-quality examples. This allows WIoU to focus on ordinary-quality anchor boxes and improve the detector's overall performance. When WIoU is applied to the state-of-the-art real-time detector YOLOv7, the AP-75 on the MS-COCO dataset is improved from 53.03% to 54.50%. Code is available at https://github.com/Instinct323/wiou.

I. INTRODUCTION

BBR loss directly determines localization performance, but existing formulations face scale-related limitations and vanishing gradients for nonoverlapping boxes. The section motivates IoU-based and geometric-penalty approaches while highlighting low-quality training examples as a concern.

  • BBR loss directly determines object-detection localization performance.
  • YOLOv2 and YOLOv3 loss formulations inadequately handle bounding-box size, limiting localization performance, especially for small objects.
  • IoU loss balances learning across large and small objects by expressing overlap as a proportion.
  • When boxes do not overlap, IoU loss produces zero width-overlap gradients, preventing the overlapping width from being updated.
  • Geometric penalty terms were introduced to address IoU-loss gradient vanishing, but low-quality examples can still distort training outcomes.

C. Focusing Mechanism

The paper replaces static focusing with a dynamic mechanism that evaluates anchor-box outlier degree. WIoU combines this mechanism with IoU-based loss to reduce harmful gradients and improve regression performance.

  • C. Focusing Mechanism: Low-quality examples can receive excessive gradient gains under monotonic focusing, jeopardizing model learning.
  • C. Focusing Mechanism: Focal-EIoU v1 uses a static non-monotonic mechanism that fixes the quality boundary instead of comparing anchor boxes dynamically.
  • C. Focusing Mechanism: WIoU evaluates anchor-box quality through outlier degree β and assigns small gains to both high-quality and low-quality outliers.
  • C. Focusing Mechanism: WIoU combines the dynamic focusing mechanism with IoU-based loss and is evaluated by integrating it into YOLOv7.
  • C. Focusing Mechanism: WIoU v1 lowers simulation regression error relative to SIoU, while WIoU v3 uses dynamic non-monotonic focusing for superior performance.

A. Loss Functions for BBR

BBR losses evolved from scale-sensitive l2-norm formulations toward IoU and geometric penalties. Focusing mechanisms then modify gradient allocation, with static and non-monotonic designs showing different effects.

  • l2-norm-based BBR losses weaken large-box influence but ignore correlations among box properties.
  • GIoU, DIoU, CIoU, and SIoU add enclosing-box, distance, aspect-ratio, angle, or shape penalties to address IoU-loss limitations.
  • Focal loss reduces the competitiveness of easy examples through a monotonic focusing mechanism.
  • Regression results in Fig. 3 compare different BBR losses, with the caption identifying WIoU as optimal.
  • Focal-EIoU v1 introduced non-monotonic focusing, although experiments reported monotonic focusing as the better choice.
  • Focal-EIoU v1’s static mechanism fixes a quality boundary and does not exploit intercomparison among anchor boxes.

A. Simulation Experiment

The simulation evaluates BBR losses by fitting varied anchor boxes to target boxes across controlled spatial, scale, and aspect-ratio settings. It distinguishes all cases from the major overlapping cases.

  • A. Simulation Experiment: The simulation places target boxes at (0.5, 0.5) with area 1/32 across 7 target aspect ratios.
  • A. Simulation Experiment: For each anchor point, the experiment uses 49 anchor boxes spanning 7 scales and 7 aspect ratios.
  • A. Simulation Experiment: The experiment generates 20000r^2 anchor points uniformly within a circular region of radius r.
  • A. Simulation Experiment: r = 0.5 represents all cases, while r = 0.1 represents major cases with anchor boxes generated within target-box coverage.
  • A. Simulation Experiment: Fig. 4 depicts anchor points in blue and target boxes in purple for all and major simulation cases.
  • A. Simulation Experiment: The simulation optimizes the overall regression loss using gradient descent with learning rate 0.01.

B. The Solutions of Gradient Vanishing Problem

IoU-based regression losses address gradient vanishing and improve box optimization by adding geometric penalties for distance, aspect ratio, angle, or shape. These designs can accelerate convergence, but distance-based penalties may also hinder overlap optimization in some cases.

  • Distance and aspect-ratio penalties: RDIoU adds a normalized center-distance penalty to IoU loss, while RCIoU further incorporates aspect-ratio consistency.RCIoU is defined as RDIoU plus an aspect-ratio term αv.
  • Distance and aspect-ratio penalties: RDIoU provides a geometric preference between anchor boxes with identical LIoU and addresses LIoU's gradient-vanishing problem.The distance metric supplies an additional optimization signal beyond overlap.
  • Distance and aspect-ratio penalties: RDIoU can enlarge the smallest enclosing box through a negative size gradient, hindering overlap, although distance remains an effective and necessary BBR metric.This limitation motivated increasing the distance penalty in EIoU.
  • Aspect-ratio consistency: CIoU's aspect-ratio term may resolve a deadlock when its gradients counteract the negative gradient generated by RDIoU.The cited analysis notes that CIoU cannot provide same-sign gradients for anchor width and height through v.
  • SIoU geometric costs: SIoU combines angle, distance, and shape costs; its angle cost guides anchors toward a target-aligned axis, reducing BBR degrees of freedom.Its distance penalty is positively correlated with angle cost, while shape cost represents box-size differences.
  • SIoU geometric costs: Because RSIoU increases distance punishment with shape cost, SIoU-trained models achieve faster convergence and lower regression error.RSIoU consists of distance and shape costs, similarly to RCIoU.

C. The Proposed Methods

The proposed WIoU methods use distance attention and a dynamic non-monotonic focusing mechanism to allocate gradients according to anchor-box quality. WIoU v3 suppresses harmful gradients from low-quality examples while emphasizing ordinary-quality anchors.

  • WIoU v1: WIoU v1 uses attention-based distance modeling, with detached enclosing-box dimensions to avoid convergence-hindering gradients.The method therefore does not introduce a separate aspect-ratio metric.
  • Simulation experiments: SIoU has the fastest convergence among the compared BBR losses, while WIoU v1 performs best mainly for nonoverlapping boxes.For the main BBR cases, convergence rates are extremely similar.
  • WIoU v2: WIoU v2 dynamically normalizes LIoU so the gradient gain remains high overall and avoids slow late-stage convergence.LIoU is maintained through an exponential running average with momentum m.
  • WIoU v3: WIoU v3 estimates anchor quality with outlier degree β, assigning small gains to both high-quality and low-quality anchors.Its non-monotonic gain peaks at an intermediate outlier degree, while the quality boundary changes dynamically with LIoU.
  • WIoU v3: WIoU v3 focuses on ordinary-quality anchors and reduces harmful gradients from low-quality examples during middle and late training stages.The method initializes LIoU = 1 to prevent low-quality anchors from being left behind early in training.

A. Experimental Setup

Experiments use a controlled subset of MS-COCO with YOLOv7-w6 and standardized training settings. The anchor-quality statistics include outputs from both lead and auxiliary detection heads.

  • Dataset and model: Experiments use 28,474 training images and 1,219 validation images from 20 MS-COCO categories.YOLOv7-w6 with a 0.75 channel multiple is trained for 120 epochs with batch size 32.
  • Training protocol: The experiments compare different BBR losses under the PyTorch framework using fixed momentum settings for LIoU.The LIoU momentum is set according to n = 890 and t = 34.
  • Anchor statistics: Mean anchor-quality statistics combine lead-head and auxiliary-head anchor boxes so auxiliary-head information is not gradually ignored.Lead-head boxes tend to fit better but contain less information, whereas auxiliary-head boxes show the opposite pattern.

B. Ablation Study

The ablation study compares original BBR losses with monotonic and dynamic non-monotonic focusing mechanisms. Monotonic focusing can hurt some distance-sensitive losses, whereas WIoU v3 consistently benefits from dynamic non-monotonic focusing.

  • Ablation design: Version 2 applies a monotonic focusing mechanism with γ = 0.5, while version 3 applies the proposed dynamic non-monotonic mechanism.The γ setting aligns version 2 with Focal-EIoU.
  • Monotonic focusing: Monotonic focusing negatively affects SIoU and EIoU because their stronger distance penalties produce larger harmful gradients.CIoU and WIoU v1 are less penalized for distance and better weaken this amplification.
  • Non-monotonic focusing: Dynamic non-monotonic focusing improves the performance of each compared BBR loss, with unique parameters maximizing each gain.This result is reported from comparisons with the original versions in Table I.
  • Regression results: WIoU v3 shields regression from low-quality examples and achieves better predictions than WIoU v2 with monotonic focusing.The comparison is shown in the anchor-box regression results of Fig. 5.

C. Comparison Study

WIoU v3 achieved the best performance among the evaluated BBR losses and increased precision faster by shielding negative training effects. Its category-level gains were uneven because some low-quality annotations and difficult examples were discarded or mishandled.

  • WIoU v3 achieved the best performance among the evaluated BBR losses.With focusing mechanisms applied, the performance gains reversed the ranking of the original BBR losses.
  • WIoU v3 increased YOLOv7 precision faster by shielding many negative effects during training.
  • WIoU v3 greatly improved precision for some categories by identifying low-quality examples.
  • Precision decreased for airplanes and benches because difficult or incorrectly annotated examples were discarded or unfairly represented.Airplane labels were controversial, while bench annotations included errors and many missing labels.

V. CONCLUSION

The paper identifies low-quality training examples and static focusing mechanisms as barriers to generalization, then proposes dynamic non-monotonic focusing for WIoU. Ablation and comparison studies report improved generalization and category-level precision, while overall detector performance is attributed to balancing low- and high-quality examples.

  • Low-quality training examples hinder object-detection generalization, while existing static focusing mechanisms do not fully exploit non-monotonic focusing.
  • Dynamic non-monotonic focusing reduces high-quality anchors’ competitiveness and masks low-quality examples’ influence.
  • Ablation results show that dynamic non-monotonic focusing leads to better model generalization performance.The interaction between WIoU v1’s attention-based penalty adjustment and dynamic focusing produces significant performance improvement.
  • WIoU v3 significantly improved precision for some categories, while low-quality annotations reduced precision for others.
  • WIoU v3 improves overall detector performance by weighting learning from low-quality and high-quality examples.
Loading 2301.10051v3…