Towards Balanced Learning for Instance Recognition

Jiangmiao Pang, Kai Chen, Qi Li, Zhihai Xu, Huajun Feng, Jianping Shi, Wanli Ouyang, Dahua LinIJCV 2021 · DOI

Abstract

Training state-of-the-art object detectors is frequently limited by imbalances across different stages of the learning process. This paper identifies three critical areas of imbalance: sample-level, feature-level, and objective-level. We introduce Libra R-CNN, a simple yet effective framework that balances these components through IoU-balanced sampling, a balanced feature pyramid, and balanced $L_1$ loss. Experimental results on MS COCO and LVIS demonstrate significant performance gains across various architectures with negligible impact on inference speed.

Introduction

While recent advancements in object detection have largely focused on designing more complex network architectures, the training process itself remains a bottleneck. Standard training pipelines often suffer from three types of imbalance that prevent models from reaching their full potential:

  1. Sample-level Imbalance: The vast majority of candidate regions are "easy" background samples, which can overwhelm the "hard" informative samples during training.
  2. Feature-level Imbalance: Feature pyramids often fuse information sequentially, leading to a dilution of semantic information from non-adjacent levels.
  3. Objective-level Imbalance: Standard loss functions are often dominated by outliers with large errors, causing the model to neglect the fine-tuning of "inliers" that are crucial for high-precision localization.
The three types of imbalance addressed by Libra R-CNN: (a) sample-level, (b) feature-level, and (c) objective-level.

Methodology: The Libra R-CNN Framework

To mitigate these imbalances, Libra R-CNN incorporates three novel components into the standard R-CNN pipeline.

Overview of the Libra R-CNN framework, featuring (a) IoU-balanced sampling, (b) balanced feature pyramid, and (c) balanced L1 loss.

IoU-balanced Sampling

Traditional random sampling often fails to capture hard negatives, which are essential for robust classification. The authors observed that over 60% of hard negatives have an IoU greater than 0.05, yet random sampling only selects about 30% of them. IoU-balanced sampling addresses this by partitioning the IoU range into bins and sampling uniformly from each, ensuring that more informative regions are prioritized without the computational cost of online hard example mining (OHEM).

Balanced Feature Pyramid

Standard Feature Pyramid Networks (FPNs) use lateral connections to fuse features. However, this sequential approach can bias the integrated features toward adjacent levels. Libra R-CNN proposes a Balanced Feature Pyramid that rescales features from all levels to a common resolution, merges them into a single integrated feature map, refines them using non-local attention, and then redistributes them. This global integration ensures that every level of the pyramid benefits from multi-scale information equally.

Balanced $L_1$ Loss

Localization precision is often limited because standard losses, like Smooth $L_1$, focus heavily on reducing large errors from outliers. Libra R-CNN introduces Balanced $L_1$ Loss, which increases the gradient contribution of "inliers" (samples with small regression errors). By emphasizing these nearly-accurate samples, the model is encouraged to perform finer localization adjustments, leading to higher overall Average Precision (AP).

Experimental Evaluation

The effectiveness of Libra R-CNN was validated on several major benchmarks, including MS COCO, LVIS, and Pascal VOC.

Performance on MS COCO

Libra R-CNN consistently outperformed baseline models. For instance, it achieved a 3.0 point AP improvement over a standard FPN Faster R-CNN. When paired with a ResNext-101 backbone, the model reached 47.2 AP on the COCO test-dev set.

Long-tailed Distribution on LVIS

On the LVIS dataset, which features a long-tailed class distribution, Libra R-CNN improved the Mask R-CNN baseline by 3.0 AP overall. Notably, it achieved a 6.1 AP boost on rare classes, demonstrating its ability to handle extreme class imbalance effectively.

Efficiency

A key advantage of Libra R-CNN is its efficiency. Since the proposed modifications primarily affect the training phase, the inference speed remains high. On an NVIDIA Tesla V100, the model maintains a frame rate of approximately 19.5 FPS, making it suitable for real-time applications.

Conclusion

Libra R-CNN provides a comprehensive solution to the imbalance problems in object detection. By rethinking the training process through the lens of balance—across samples, features, and objectives—it achieves state-of-the-art performance with minimal architectural changes. Future work may explore extending these principles to 3D detection and video-based instance recognition.

Summary updated

BibTeX
@article{pang2021towards,
  author = {Jiangmiao Pang and Kai Chen and Qi Li and Zhihai Xu and Huajun Feng and Jianping Shi and Wanli Ouyang and Dahua Lin},
  title = {{Towards Balanced Learning for Instance Recognition}},
  journal = {Int. J. Comput. Vis.},
  year = {2021},
  doi = {10.1007/s11263-021-01434-2},
}
Figure