NMS Strikes Back

Jeffrey Ouyang-Zhang, Jang Hyun Cho, Xingyi Zhou, Philipp KrähenbühlarXiv 2022 · DOI

Introduction

Since the introduction of DETR, the object detection community has pivoted toward "end-to-end" designs. The hallmark of these models is one-to-one bipartite matching: during training, each ground-truth object is matched to exactly one predicted box. This eliminates the need for Non-Maximum Suppression (NMS), a post-processing step used by traditional detectors (like Faster R-CNN) to remove duplicate predictions.

However, DETR-style models are notoriously slow to train and complex to tune. This research investigates whether the "old-school" approach of assigning multiple positive labels to a single object (one-to-many) might actually be more effective for training Transformers, challenging the belief that bipartite matching is the essential "secret sauce" for success.

Methods: The DETA Framework

The authors introduce DETA (DEtection Transformers with Assignment). Architecturally, DETA is identical to a two-stage Deformable-DETR, but it fundamentally changes the training objective and post-processing logic.

The DETA architecture integrates a two-stage refinement process with traditional NMS post-processing.

The core components of DETA include:

  1. One-to-Many Assignment: Instead of the Hungarian algorithm, DETA uses standard IoU-based assignment. If a predicted box has a high overlap (IoU) with a ground-truth object, it is assigned a positive label.
  2. Object Balancing: To prevent large objects from dominating the loss, the number of positive assignments per ground-truth object is limited to a fixed number ($K$).
  3. NMS Post-processing: Because the model is trained to produce multiple high-scoring boxes for a single object, NMS is re-introduced during inference to deduplicate results.
  4. Two-Stage Refinement: DETA follows a two-stage approach where the first stage proposes candidate regions and the second stage (the Transformer decoder) refines them.

Key Insights

The success of DETA stems from several critical observations regarding how Transformers learn detection tasks.

One-to-many assignment allows multiple queries to match a single ground-truth object, simplifying the learning task.
  • The "Easier Function" Hypothesis: One-to-one matching forces the Transformer decoder to perform a global deduplication task—it has to "decide" which single query gets to represent an object. By switching to one-to-many assignment, the decoder's job is simplified to local classification and box refinement, which is much easier to learn.
  • Rich Training Signals: One-to-many assignment provides significantly more positive gradients during training. This "denser" supervision helps the model converge much faster than standard DETR.
  • Bipartite Matching is Suboptimal for Small Objects: The authors observed that one-to-one matching often struggles with small objects. Their IoU-based assignment, combined with object balancing, significantly improved performance on small-scale detections.

Results and Performance

DETA was evaluated on the COCO 2017 and LVIS datasets, demonstrating state-of-the-art efficiency and accuracy.

  • State-of-the-Art Efficiency: On a standard 12-epoch (1×) schedule with a ResNet-50 backbone, DETA achieved 50.2 mAP on COCO, outperforming previous best end-to-end detectors like DINO by 0.8 points.
  • Fast Convergence: DETA reaches high accuracy levels in a fraction of the time required by original DETR models.
  • LVIS Performance: On the LVIS dataset, DETA improved AP by 2.4 points over the Deformable-DETR baseline, proving its robustness in long-tail scenarios.
  • Scaling: Using a larger Swin-L backbone, DETA achieved 63.5 mAP on COCO test-dev.

Conclusion and Limitations

While DETA re-introduces NMS and its associated hyperparameters, it proves that the Transformer architecture's power is not strictly tied to one-to-one matching. Future work may explore how to remove the two-stage dependency or adapt the framework for tasks like instance segmentation where unique query properties are traditionally more important.

Summary updated

BibTeX
@misc{ouyangzhang2022nms,
  author = {Jeffrey Ouyang-Zhang and Jang Hyun Cho and Xingyi Zhou and Philipp Krähenbühl},
  title = {{NMS Strikes Back}},
  year = {2022},
  eprint = {2212.06137},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.06137},
}
Figure