Source-linked AI summary
MetaAnchor: Learning to Detect Objects with Customized Anchors
Tong Yang, Xiangyu Zhang, Zeming Li, Wenqiang Zhang, Jian Sun
TL;DR
Object detectors commonly rely on predefined anchors, which restrict anchor choices and can be sensitive to anchor and box distributions. MetaAnchor dynamically generates anchor functions from customized priors using weight prediction, and experiments find greater robustness with consistent COCO improvements and transfer potential.
Problem
Predefined anchor strategies fix anchor choices and limit available anchors, creating sensitivity to anchor settings and bounding-box distributions.
Method
MetaAnchor uses weight prediction to dynamically generate anchor functions from arbitrary customized prior boxes and integrate them into anchor-based detectors.
Results
MetaAnchor consistently outperforms predefined-anchor counterparts across COCO scenarios and achieves 37.5% mmAP on COCO minival, 1.7% above the implemented RetinaNet baseline.
Takeaways & Limitations
MetaAnchor is more robust to anchor settings and bounding-box distributions and shows potential for transfer tasks.
Takeaways & Limitations
The study mainly evaluates single-stage detectors because improvements to two-stage proposal recalls did not improve their final predictions.
Abstract
from arXiv · showhide
We propose a novel and flexible anchor mechanism named MetaAnchor for object detection frameworks. Unlike many previous detectors model anchors via a predefined manner, in MetaAnchor anchor functions could be dynamically generated from the arbitrary customized prior boxes. Taking advantage of weight prediction, MetaAnchor is able to work with most of the anchor-based object detection systems such as RetinaNet. Compared with the predefined anchor scheme, we empirically find that MetaAnchor is more robust to anchor settings and bounding box distributions; in addition, it also shows the potential on transfer tasks. Our experiment on COCO detection task shows that MetaAnchor consistently outperforms the counterparts in various scenarios.
1 Introduction
MetaAnchor replaces fixed anchor enumeration with anchor functions dynamically generated from customized prior boxes. The approach is designed to improve robustness to anchor settings and box distributions while supporting adaptation across datasets.
- 1 Introduction: Traditional anchor detectors fix their anchor strategies during training and inference, limiting available anchors to the predefined set B.Different predefined anchors are commonly modeled with independent or partially shared weights.
- 1 Introduction: MetaAnchor dynamically generates anchor functions from arbitrary customized prior boxes instead of enumerating a fixed set.The generator maps each prior box to its corresponding anchor function, allowing users to specify anchors during inference.
- 1 Introduction: MetaAnchor consistently outperforms predefined-anchor counterparts across COCO detection scenarios and shows potential for transfer tasks.The conclusion summarizes robustness to anchor settings and bounding-box distributions as well as transfer potential.
- 1 Introduction: MetaAnchor improves robustness by sampling arbitrary anchor boxes while keeping parameter count constant and sharing generator weights across anchor functions.This lets training data contribute to all model parameters despite uneven ground-truth box distributions.
- 1 Introduction: MetaAnchor can customize inference anchors for a target dataset, helping bridge bounding-box distribution gaps without retraining the whole detector.The paper suggests methods such as grid search for adapting anchor configurations.
2 Related Work
Prior object detectors generally enumerate predefined anchors, while weight prediction has been used in related learning and transfer settings. MetaAnchor differs by using weight prediction to generate anchor functions rather than adapting one learned task's weights to another.
- 2 Related Work: Most object detectors enumerate predefined anchor boxes covering positions, sizes, and class labels.This design requires selecting anchor configurations in advance.
- 2 Related Work: Weight prediction generates neural-network weights through another structure and is used in learning to learn, few-shot learning, and transfer learning.The related-work discussion identifies weight prediction as the mechanism underlying MetaAnchor's generator.
- 2 Related Work: MetaAnchor uses weight prediction to generate anchor functions, whereas related work predicts mask weights from box weights for domain adaptation.MetaAnchor generates weights nearly from scratch rather than using learned box weights as the source.
3 Approach
MetaAnchor generates anchor-function parameters dynamically from customized box priors, then integrates these generators into RetinaNet detection heads. The implementation supports data-independent and data-dependent generators while adapting anchor encoding and feature-level scaling to RetinaNet.
- 3.1 Anchor Function Generator: MetaAnchor models each anchor function with shared parameters plus a prior-dependent residual generated from the customized box prior.The generator predicts parameters for a common anchor-function formulation rather than maintaining a separate fixed function for every predefined prior.
- 3.1 Anchor Function Generator: The residual generator is implemented as a two-layer network, whose low-dimensional hidden representation makes the predicted residual weights low-rank.The paper uses learnable W1 and W2 with ReLU activation and typically sets the hidden dimension below the anchor-function parameter dimension.
- 3.1 Anchor Function Generator: A data-dependent variant additionally conditions generated anchor-function parameters on the input feature through a dimension-reducing mapping.For convolutional features, the paper reports that global average pooling is usually effective for the feature mapping r(·).
- 3.2 Architecture Details: MetaAnchor can be embedded in existing anchor-based detectors, with RetinaNet using separate generators for classification and regression anchor functions.The paper focuses on RetinaNet because improvements in two-stage proposal generation did not necessarily translate to final detection results.
- 3.2 Architecture Details: In RetinaNet, customized priors encode anchor information while feature-map coordinates provide position, and anchor-function weights are generated separately for classification and regression.The implementation represents anchor size using normalized height and width, and accounts for changing anchor sizes across feature levels.
4 Experiment
Experiments evaluate MetaAnchor against predefined-anchor baselines across anchor configurations, inference settings, datasets, and training/test distribution shifts. MetaAnchor generally improves detection performance and is more robust to anchor scarcity, stricter assignment, and distribution differences.
- Comparison with RetinaNet baselines: 0.2–0.8% higher mmAP and 0.8–1.5% higher AP50 are reported for MetaAnchor across anchor configurations at the 0.5/0.4 training thresholds.The comparison uses COCO-mini with identical training and test anchor settings.
- Comparison with RetinaNet baselines: Under 0.6/0.5 thresholds, MetaAnchor is less affected in 3 of 4 configurations, including a 0.3% mmAP improvement with 9×9 anchors.The 3×3 exception is attributed to too few inference anchors rather than poor training.
- Inference anchor configurations: Inference performance usually increases with more anchors but saturates at ≥7×7, motivating greedy search to avoid densely overlapping predictions.The search results are reported in the final column of Table 3.
- Cross-dataset transfer: On VOC 2007 after COCO-full training, MetaAnchor reaches 83.3% mAP, improving 0.8% over RetinaNet and 0.2% over another MetaAnchor model.The evaluation excludes the sofa class because COCO has no sofa annotation.
- COCO detection results: 37.5% mmAP on COCO minival is 1.7% above the implemented RetinaNet and 0.6% above its best searched configuration; the data-dependent variant adds 0.4%.MetaAnchor also supports inference-time anchor configuration search without retraining.
- COCO detection results: MetaAnchor improves over RetinaNet by approximately 0.3% mAP on PASCAL VOC 2007, from 80.3% to 80.6% mAP@0.5.The reported gain is smaller than on COCO because VOC’s box distribution is described as simpler.
5 Conclusion
MetaAnchor dynamically generates anchor functions from arbitrary customized prior boxes and consistently outperforms predefined-anchor counterparts across COCO detection scenarios.
- MetaAnchor dynamically generates anchor functions from arbitrary customized prior boxes and consistently outperforms predefined-anchor counterparts across various COCO detection scenarios.It also shows potential for transfer tasks and can work with anchor-based systems such as RetinaNet.
- Figure 2 evaluates detection results across five customized anchor-box aspect ratios while aggregating predictions from all five detection-head levels.
- Table 8 reports the paper’s results on the COCO minival split.