TOOD: Task-aligned One-stage Object Detection

Chengjian Feng, Yujie Zhong, Yu Gao, Matthew R. Scott, Weilin Huang

Abstract

One-stage object detection has traditionally relied on parallel branches to handle classification and localization independently. However, these tasks often have divergent spatial preferences, leading to a fundamental misalignment that limits detection performance. This paper introduces TOOD (Task-aligned One-stage Object Detection), which unifies these tasks through a novel Task-aligned Head (T-Head) and a Task Alignment Learning (TAL) strategy. By explicitly aligning classification and localization, TOOD achieves a state-of-the-art 51.1 AP on MS-COCO, outperforming existing one-stage detectors with greater efficiency.

Introduction: The Alignment Problem

In the realm of object detection, models must simultaneously determine what an object is (classification) and where its boundaries lie (localization). Most contemporary one-stage detectors employ two parallel branches to solve these sub-tasks. While computationally efficient, this architecture creates a "spatial misalignment" problem. Classification features typically focus on the most discriminative parts of an object, whereas localization features must attend to the boundaries.

Consequently, the anchor point with the highest classification confidence may not be the one that produces the most accurate bounding box. Traditional heuristics like "centerness" or IoU-based weighting attempt to bridge this gap but are often task-agnostic and fail to fully resolve the divergence.

Methodology

TOOD proposes a two-pronged approach to force classification and localization into harmony.

Task-aligned Head (T-Head)

Instead of the standard parallel branch design, T-Head utilizes a stack of convolutional layers to learn task-interactive features.

  • Layer Attention: A dynamic mechanism decomposes interactive features into task-specific representations at each layer, allowing for flexible feature sharing.
  • Task-Aligned Predictor (TAP): This component serves as the alignment engine. It predicts a spatial probability map to adjust classification scores and a spatial offset map for localization. The offset map allows the model to "shift" its focus to the most aligned anchor point for each object boundary, effectively learning the optimal spatial relationship between the two tasks.

Task Alignment Learning (TAL)

To complement the T-Head, the authors introduce TAL, a training strategy that replaces static anchor assignment with a dynamic, alignment-aware process.

  • Anchor Alignment Metric: TAL uses a unified metric $t = s^\alpha \times u^\beta$, where $s$ is the classification score and $u$ is the IoU. This metric identifies anchors that excel at both tasks simultaneously.
  • Dynamic Sample Assignment: The top $m$ anchors based on the alignment metric $t$ are selected as positive samples.
  • Task-aligned Loss: The classification loss is weighted by $t$, incentivizing the model to prioritize anchors that demonstrate high localization accuracy.

Key Insights and Ideas

The core philosophy of TOOD is that interaction is superior to independence. By starting with shared features and performing "soft" decomposition via attention, the model maintains a better internal representation of task relationships.

Qualitative comparison of task alignment between a baseline (top) and TOOD (bottom).

As shown in the visualization above, standard detectors (top row) often exhibit a gap between the highest classification score (red arrow) and the highest IoU (white arrow). TOOD (bottom row) successfully aligns these "hotspots," ensuring that the most confident predictions are also the most accurate.

Results and Discussion

TOOD demonstrates significant improvements over previous state-of-the-art one-stage detectors. Evaluated on the MS-COCO 2017 benchmark, TOOD achieved 51.1 AP using a ResNeXt-101-DCN backbone. This represents a substantial leap over models like ATSS (47.7 AP) and GFL (48.2 AP).

Beyond accuracy, TOOD is remarkably efficient. The streamlined T-Head architecture requires fewer parameters and FLOPs than traditional parallel heads, making it a practical choice for real-world applications. While the model relies on specific hyperparameters for the alignment metric ($\alpha=1, \beta=6$), the overall framework provides a robust foundation for multi-task vision problems.

Conclusion

TOOD successfully addresses the long-standing issue of task misalignment in one-stage object detection. By unifying classification and localization through interactive feature learning and a joint alignment metric, it sets a new standard for performance and efficiency on the MS-COCO benchmark. Future work may extend this task-alignment philosophy to two-stage detectors and broader multi-task domains such as instance segmentation.

Summary updated

BibTeX
@misc{feng2021tood,
  author = {Chengjian Feng and Yujie Zhong and Yu Gao and Matthew R. Scott and Weilin Huang},
  title = {{TOOD: Task-aligned One-stage Object Detection}},
  year = {2021},
  eprint = {2108.07755},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.07755},
}
Figure