NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Attend to Who You Are: Supervising Self-Attention for Keypoint Detection and Instance-Aware Association

Sen Yang, Zhicheng Wang, Ze Chen, Yanjie Li, Shoukui Zhang, Zhibin Quan, Shu-Tao Xia, Yiping Bao, Erjin Zhou, Wankou Yang

TL;DR

This paper introduces Supervised Self-Attention (SSA), a novel framework that uses Transformers to simultaneously handle keypoint detection and multi-person association in a bottom-up fashion. By explicitly supervising intermediate self-attention layers with instance masks during training, the model learns to naturally group keypoints belonging to the same person without relying on complex, hand-crafted CNN embedding fields or offset vectors.

What Problem Does This Paper Address?

Multi-person pose estimation typically follows one of two paradigms: top-down (detect individual people first, then locate their keypoints) or bottom-up (detect all keypoints in an image first, then group them into distinct individuals). While bottom-up approaches are inherently more elegant and scale better with crowd density, they face a difficult association problem: How do you know which left wrist belongs to which shoulder?

Traditional CNN-based bottom-up models solve this by learning heterogeneous targets—predicting keypoint heatmaps alongside hand-crafted associative signals like Part Affinity Fields (PAFs), associative embeddings, or offset vector fields. This adds significant architectural complexity and post-processing overhead. The authors of this paper ask a fundamental question: Can we exploit the intrinsic properties of Vision Transformers (ViTs) to handle both detection and grouping within a single, unified mechanism?

Methods

The authors propose a unified framework combining a standard ResNet backbone, a Transformer encoder, and transposed convolutions to output keypoint heatmaps.

The core innovation is Supervised Self-Attention (SSA). While naive self-attention layers in a Transformer naturally capture some object-level semantics, they are prone to "leakage"—where a keypoint on one person mistakenly attends to a nearby keypoint on another person. To fix this, the authors introduce an instance mask loss to explicitly constrain the attention behavior of a specific intermediate layer (the 4th layer out of 6).

Figure 2: Model overview. The model architecture consists of three parts: a regular ResNet, a regular Transformer encoder, and several transposed convolutional layers. Two types of loss function are leveraged to supervise the model training. The final output of the model is supervised by the groundtruth keypoint heatmaps. One of the immediate self-attention layers is sparsely supervised by the instance masks. In particular, we sample the rows of the attention matrix of the chosen attention layer according to the visible keypoint locations of each human instance, reshape them into 2D-like maps, and then use the mask of each instance to supervise the average map. In this figure, we only show a few keypoints of each instance for simplicity.

During training, the rows of the attention matrix corresponding to a person's visible keypoints are sampled and averaged to create a "person attention map." This map is then supervised via a Mean Squared Error (MSE) loss against the ground-truth instance segmentation mask of that person.

For inference, the paper introduces two attention-based parsing algorithms to group the detected keypoints into individual skeletons: a body-first view and a part-first view (the default, which uses the Hungarian algorithm to solve the bipartite matching problem based on mutual attention attraction scores). Furthermore, human instance segmentation masks can be extracted directly from these same supervised attention maps for free.

Datasets

The model was trained and evaluated on two major benchmarks within the Microsoft COCO ecosystem:

  • COCO multi-person keypoint detection challenge (using train2017, val2017, and test-dev2017 splits).
  • COCO person instance segmentation task (evaluating the person class only).

Key Insights and Ideas

  • Attention as a Geometric Constraint: Explicitly forcing a Transformer's attention matrix to match a binary instance mask acts as a powerful regularizer. Remarkably, this strict geometric constraint does not disrupt the standard forward propagation or degrade keypoint localization accuracy; instead, it cleanly separates human instances.
  • Eliminating Hand-Crafted Fields: By making self-attention instance-aware, the model bypasses the need for dense, human-engineered vector fields or tag embeddings common in CNN architectures. Grouping becomes a direct mathematical consequence of the attention scores.
Figure 1: We choose two examples to show differences between the naive and supervised self- attention patterns. The association reference for the naive self-attention is averaged from all attention layers in Transformer. The association reference for the supervised self-attention is directly taken from the fourth supervised attention layer.
  • Multi-Task Synergy: Keypoint detection, association, and instance segmentation are unified. The attention matrix serves as the bridge, allowing instance masks to be generated simply by sampling the attention areas of grouped keypoints.

Key Results

  • Competitive Accuracy: On the COCO test-dev2017 set, the pure bottom-up SSA model achieves 65.0 AP, outperforming classic bottom-up methods like OpenPose (61.8 AP) and performing comparably to Associative Embedding (65.5 AP).
  • Refinement Boost: When paired with a lightweight single-pose refiner to fill in missing joints, the performance jumps to 66.4 AP on the validation set.
  • High Efficiency: Compared to heavy CNN pipelines, the Transformer-based approach is highly efficient. For instance, the ResNet101+Transformer variant uses 45.0M parameters and 102.3G FLOPs, a massive reduction compared to PersonLab (68.7M parameters and 405.5G FLOPs).
  • Fewer Swap Errors: Diagnostic error analysis reveals that the attention-guided grouping strategy incurs significantly fewer "swap errors" (misassigning body parts between different people) than OpenPose, proving the robustness of the instance-aware attention maps.

Limitations and Future Work

  • Quadratic Complexity: Because standard self-attention scales quadratically ($O(N^2)$) with sequence length, the model struggles to scale up to ultra-high-resolution images or deeper Transformer capacities.
  • Annotation Dependency: The current supervision pipeline relies on having both keypoint annotations and instance masks during training. The authors suggest that future iterations could eliminate the mask requirement by enforcing high/low attention constraints purely between pairs of keypoint locations.
  • The SOTA Gap: While highly efficient and elegant, the pure bottom-up version still trails behind the absolute best, heavily optimized CNN-based bottom-up models (like HigherHRNet or DEKR) in raw AP before refinement.

Summary updated

BibTeX
@misc{yang2021attend,
  author = {Sen Yang and Zhicheng Wang and Ze Chen and Yanjie Li and Shoukui Zhang and Zhibin Quan and Shu-Tao Xia and Yiping Bao and Erjin Zhou and Wankou Yang},
  title = {{Attend to Who You Are: Supervising Self-Attention for Keypoint Detection and Instance-Aware Association}},
  year = {2021},
  eprint = {2111.12892},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.12892},
}
Figure