NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Instance-Aware Repeat Factor Sampling for Long-Tailed Object Detection

Burhaneddin Yaman, Tanvir Mahmud, Chun-Hao Liu

TL;DR

Standard Repeat Factor Sampling (RFS) tackles long-tailed object detection by oversampling images containing rare classes, but it completely ignores how many object instances actually appear per image. The authors propose Instance-Aware Repeat Factor Sampling (IRFS), an "embarrassingly simple" drop-in replacement that merges image and bounding-box frequencies into the sampling factor, yielding a +50% relative average precision (AP) boost on rare categories without degrading head-class performance.

What Problem Does This Paper Address?

Real-world visual data naturally follows a long-tailed distribution: a handful of common classes appear frequently, while a vast tail of rare classes appears sparingly. Without mitigation, object detectors become heavily biased toward majority categories.

To address this, practitioner-favorite heuristics like Repeat Factor Sampling (RFS) oversample training images that contain rare classes. However, RFS measures rarity solely by image frequency. In multi-object scenarios, two rare categories might appear in the exact same number of images (e.g., 10 images each), but one might contain only 11 total bounding boxes while the other contains over 300. Because RFS treats these categories identically, significant instance-level imbalance remains unaddressed.

Methods

IRFS reformulates the category-level repeat factor by accounting for both image presence and total instance count:

  1. Calculate Frequencies: For each category $c$, calculate:
  2. $f_{(i,c)}$: The fraction of training images containing at least one instance of $c$.
  3. $f_{(b,c)}$: The fraction of all bounding boxes in the training set belonging to $c$.
  4. Fuse Statistics: Combine the two frequencies using an average—primarily the geometric mean: $$f_c = \sqrt{f_{(i,c)} \times f_{(b,c)}}$$ (The authors also benchmark harmonic, arithmetic, and quadratic means).
  5. Compute Repeat Factors: The category repeat factor becomes: $$r_c = \max\left(1, \sqrt{\frac{t}{\sqrt{f_{(i,c)} \times f_{(b,c)}}}}\right)$$ where $t$ is an oversampling threshold (optimally set to $10^{-3}$, matching baseline RFS).

  6. Image-Level Factor: As in standard RFS, each image $i$ is repeated according to the maximum repeat factor among all categories present in it: $r_i = \max_{c \in i} r_c$.

IRFS requires no architectural changes, introduces virtually zero computational overhead during data loading, and is fully complementary to downstream loss re-weighting techniques.

Datasets

The authors evaluate their approach on LVIS v1.0, the standard large-vocabulary, long-tailed instance segmentation and detection benchmark:

  • Scale: 1.3 million object instances across 120k images (100k train, 20k val) spanning 1,203 categories.
  • Category Splits: Divided by image occurrence into rare (<10 images), common (10–100 images), and frequent (>100 images).

No new datasets were introduced.

Key Insights and Ideas

  • Image Count $\neq$ Instance Count: Disregarding bounding-box density leaves severe tail imbalance inside the data loader. Incorporating instances provides a much truer measure of supervisory signal per class.
  • Harmonic & Geometric Means Excel: When combining image and instance ratios, geometric and harmonic averages outperform arithmetic means. Because these means penalize extreme imbalances more heavily, they prevent classes with high image counts but very few total instances (or vice versa) from slipping through without adequate oversampling.
  • Complementary to Re-weighting: Re-sampling and loss re-weighting target different stages of the learning pipeline. Combining IRFS with Effective Class-Margin (ECM) loss outperforms either technique applied in isolation.

Key Results

Experiments across multiple backbones (ResNet-50, ResNet-101) and architectures (Mask R-CNN, Cascade Mask R-CNN, ATSS) consistently showed major gains:

  • Mask R-CNN (ResNet-50):
  • Detection: Rare class AP ($\text{AP}_r$) jumped from 9.2% (RFS) to 14.1% (IRFS)—a +53% relative improvement. Overall $\text{mAP}_{bbox}$ improved from 22.7% to 24.4%.
  • Segmentation: Rare mask AP improved from 10.4% to 14.9% (+43% relative), with overall mask mAP reaching 23.7% (+8% relative).
  • Cascade Mask R-CNN (ResNet-50): Detection $\text{AP}_r$ surged from 12.7% to 19.1% (+50% relative).
  • Single-Stage Detector (ATSS): On ResNet-50, ATSS trained with IRFS improved $\text{AP}_r$ from 7.5% to 9.5% (+26% relative).
  • Synergy with Loss Re-weighting (ECM Loss): Pairing ECM loss with IRFS pushed detection $\text{AP}_r$ to 19.4%, substantially outperforming ECM + RFS (16.5%) and standalone ECM (13.3%).

Limitations and Future Work

  • Heuristic Fusion: The choice of averaging methods (geometric or harmonic) is largely empirical; the authors note that learning or optimizing the fusion mechanism directly warrants future investigation.
  • Evaluation Scope: While evaluated extensively across multiple detector backbones and architectures, testing was confined to LVIS v1.0. Future work includes expanding IRFS into other vision domains with severe skew (such as 3D detection, video surveillance, or medical imaging).

Summary updated

BibTeX
@inproceedings{yaman2023instance,
  author = {Burhaneddin Yaman and Tanvir Mahmud and Chun-Hao Liu},
  title = {{Instance-Aware Repeat Factor Sampling for Long-Tailed Object Detection}},
  booktitle = {HeavyTails @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=tkYdr7qVlE},
}
Figure