TSAA: A Two-Stage Anchor Assignment Method towards Anchor Drift in Crowded Object Detection

Xiang Li, Miao He, Haibo Luo, Huiyuan Yang, Jiajie XiaoarXiv 2022 · DOI

Abstract

Crowded object detection remains a significant challenge due to heavy object overlap, which leads to "anchor drift"—a phenomenon where fixed anchor assignments conflict with the network's internal feature representation. We propose Two-Stage Anchor Assignment (TSAA), an adaptive method that re-assigns anchors based on the network's own predictions during training. By aligning optimization targets with natural regression tendencies, TSAA reduces false positives and improves detection compactness. Evaluated on CrowdHuman and MS COCO, TSAA achieves significant performance gains across various detectors like RetinaNet and Faster R-CNN without increasing inference latency.

Introduction

In traditional anchor-based object detection frameworks such as YOLO or Faster R-CNN, "anchors"—predefined boxes of various shapes—are assigned to ground-truth objects based on spatial overlap, typically measured by Intersection over Union (IoU). This assignment is usually static and determined at the onset of training.

However, in crowded scenes where objects overlap heavily, this rigid matching strategy leads to a phenomenon termed anchor drift. An anchor might be geometrically closest to Object A, but the features extracted at that location may more accurately represent Object B. Forcing the network to regress toward Object A when its internal logic favors Object B creates ambiguous, "incompact" prediction boxes. These ambiguous boxes often fail to meet Non-Maximum Suppression (NMS) thresholds, resulting in high false-positive rates and missed detections.

Illustration of anchor drift in crowded scenes.

Methodology: Two-Stage Anchor Assignment (TSAA)

To address anchor drift, we propose the Two-Stage Anchor Assignment (TSAA) method. TSAA makes the matching process adaptive by allowing the network's predictions to influence target assignment.

The Two-Stage Anchor Assignment (TSAA) pipeline.

The TSAA process consists of four primary steps:

  1. First-Stage Assignment: Anchors are initially assigned to objects using traditional fixed IoU thresholds. These are designated as First-Stage Positive Anchors (FSPA).
  2. Prediction Restoration: The network generates coordinate offsets for these anchors. TSAA "restores" these offsets into actual prediction boxes within the image coordinate system.
  3. Second-Stage Adaptive Re-assignment: Instead of relying on the original anchor's static position, TSAA calculates the IoU between the predicted boxes and the ground-truth objects. Each anchor is then re-assigned to the object with which its prediction shares the highest overlap.
  4. Optimization: The network is trained using these updated targets. This ensures that the optimization direction aligns with the network's natural regression tendency, resolving conflicts between fixed labels and learned patterns.

To maintain high recall, a "low-quality-matching" mechanism is preserved from the first stage, ensuring every ground-truth object is assigned at least one anchor.

Experimental Results

The TSAA method was integrated into several classic detectors, including RetinaNet, Faster R-CNN (with FPN), and YOLOv3, and evaluated on the CrowdHuman and MS COCO datasets.

Performance on CrowdHuman

CrowdHuman is a challenging benchmark for dense scenes, averaging over 22 persons per image. TSAA showed substantial improvements:

  • RetinaNet: Reduced the log-average Miss Rate ($MR^{-2}$) by 4.45% and increased the Jaccard Index (JI) by 1.45%.
  • Faster R-CNN: Improved $MR^{-2}$ by 0.81%.
  • YOLOv3: Improved $MR^{-2}$ by 0.19%.

Performance on MS COCO

On the more general MS COCO dataset, TSAA demonstrated robustness by providing consistent, albeit smaller, gains (e.g., +0.4% AP on RetinaNet), confirming that the method does not degrade performance in sparse scenarios.

Discussion and Conclusion

TSAA effectively "unties" the rigid relationship between anchors and objects, providing the model a "second chance" to find the most suitable target during optimization. A key advantage of TSAA is that it requires no changes to the network architecture and introduces no additional computational overhead during inference, as the two-stage assignment occurs exclusively during training.

While TSAA relies on the initial fixed assignment to guide early convergence, it significantly improves detection compactness and accuracy in dense crowds as training progresses. Future work may explore extending this adaptive logic to anchor-free detectors or refining the NMS process itself.

Summary updated

BibTeX
@misc{li2022tsaa,
  author = {Xiang Li and Miao He and Haibo Luo and Huiyuan Yang and Jiajie Xiao},
  title = {{TSAA: A Two-Stage Anchor Assignment Method towards Anchor Drift in Crowded Object Detection}},
  year = {2022},
  eprint = {2211.00826},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.00826},
}
Figure