RelationNet++: Bridging Visual Representations for Object Detection via Transformer Decoder

Cheng Chi, Fangyun Wei, Han Hu

Introduction

Object detection models typically rely on a single visual representation format, such as bounding boxes or center points. By restricting themselves to one format, these models miss out on the unique strengths offered by others. This paper introduces RelationNet++, which features a novel Transformer-like decoder module called Bridging Visual Representations (BVR). BVR is designed to fuse heterogeneous representations—like boxes, corners, and centers—end-to-end. By treating the main representation as a query and auxiliary representations as keys, BVR boosts the performance of prevalent detectors by up to 3.0 AP with minimal computational overhead.

The Challenge of Heterogeneous Representations

Modern object detectors are largely defined by the intermediate visual representations they utilize. For instance, Faster R-CNN and RetinaNet rely on bounding boxes, FCOS uses center points, and CornerNet leverages corner points.

Different visual representations used in object detection, including anchor boxes, proposal boxes, object centers, and corners.

Each of these formats excels at different tasks:

  • Bounding boxes are highly effective for classification and align perfectly with final output formats.
  • Center points are excellent for detecting small objects and simplify network architecture by removing the need for anchors.
  • Corner points provide highly accurate spatial localization cues.

However, combining these representations into a single framework is notoriously difficult. Because they extract features differently—such as grid-based pooling for boxes versus non-grid point extraction for corners—they are fundamentally heterogeneous. The authors tackle the challenge of bridging these disparate representations so a single detector can leverage the classification strength of boxes alongside the localization precision of corners.

Bridging Visual Representations (BVR)

The authors propose the BVR module, which is heavily inspired by the attention mechanism found in Transformer decoders.

The Bridging Visual Representations (BVR) module uses an attention mechanism where the primary anchor box acts as a query attending to center and corner points as keys.
  • Query-Key Mechanism: The detector's primary representation (e.g., anchor boxes in RetinaNet) acts as the query. Auxiliary representations (e.g., predicted center and corner points) act as keys. The attention mechanism updates the query features using both appearance similarity and geometric relationships to the keys.
  • Task-Specific Bridging: The authors use separate BVR modules for different heads. The classification head uses center points as keys to provide rich context, while the regression head uses corner points as keys to provide precise localization cues.
  • Top-$k$ Key Selection: To prevent the attention mechanism from becoming computationally intractable, a small point-head network predicts auxiliary points, and only the top-$k$ (e.g., $k=50$) highest-scoring candidates across all feature pyramid levels are selected as keys.
  • Shared Relative Location Embedding: Computing pairwise geometric relationships between all queries and keys is incredibly expensive. The authors introduce a shared 2D relative location map. By using bilinear sampling on this fixed map, they bypass direct computation, drastically reducing memory and FLOPs.

Key Insights and Efficiency

The paper demonstrates that heterogeneous attention works effectively: you can successfully mix 4D bounding box features with 2D point features using attention. The trick lies in aligning their geometric descriptions—for example, extracting a 2D center from the 4D box so the geometric subtraction works cleanly against 2D key points.

Task-representation alignment is also crucial. Center points are better auxiliary keys for classification, while corner points are better for bounding box regression. Separating these streams yields better performance than mixing them.

Furthermore, the efficiency hacks make this approach practical. Naive attention across all feature map points would destroy a detector's speed. The top-$k$ shared key selection and the shared location embedding map are the "secret sauce." The shared embedding alone cuts geometry computation FLOPs by approximately 100x and memory by 42x. Finally, BVR models relationships between different kinds of representations, making it highly complementary to prior works like Non-Local Networks or the original RelationNet, which model relationships within the same kind of representation.

Results and Performance

All experiments and evaluations were performed on the standard MS COCO dataset, utilizing an 80k train/35k val split for training, a 5k minival subset for ablation, and the test-dev set for state-of-the-art comparisons.

  • Broad Applicability: BVR acts as a plug-and-play module that improves a wide variety of baselines. On COCO, it boosts RetinaNet by +2.9 AP, Faster R-CNN by +1.5 AP, FCOS by +1.5 AP, and ATSS by +2.0 AP.
  • State-of-the-Art Performance: When applied to a strong ATSS baseline with a heavy ResNeXt-64x4d-101-DCN backbone, RelationNet++ achieves a massive 52.7 AP on COCO test-dev.
  • Low Overhead: The BVR module is highly efficient. On a standard RetinaNet (ResNet-50), it adds only ~3% more parameters and ~10% more FLOPs. On heavier backbones, the inference speed overhead drops to less than 3%.

Limitations and Future Work

Like all data-driven object detectors, the model is susceptible to biases present in the training data, which could lead to unpredictable failures in downstream applications.

Looking forward, the paper proves that BVR is complementary to intra-representation attention mechanisms (like Object Relation Modules). This strongly suggests that future architectures could combine box-to-box attention with box-to-corner/center attention for even richer, more robust feature learning.

Summary updated

BibTeX
@inproceedings{chi2020relationnet,
  author = {Cheng Chi and Fangyun Wei and Han Hu},
  title = {{RelationNet++: Bridging Visual Representations for Object Detection via Transformer Decoder}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
}
Figure