TransPose: Keypoint Localization via Transformer

Sen Yang, Zhibin Quan, Mu Nie, Wankou Yang · DOI

Abstract While CNN-based models have made remarkable progress on human pose estimation, what spatial dependencies they capture to localize keypoints remains unclear. In this work, we propose a model called TransPose, which introduces Transformer for human pose estimation. The attention layers built in Transformer enable our model to capture long-range relationships efficiently and also can reveal what dependencies the predicted keypoints rely on. To predict keypoint heatmaps, the last attention layer acts as an aggregator, which collects contributions from image clues and forms maximum positions of keypoints. Such a heatmap-based localization approach via Transformer conforms to the principle of Activation Maximization. And the revealed dependencies are image-specific and fine-grained, which also can provide evidence of how the model handles special cases, e.g., occlusion. The experiments show that TransPose achieves 75.8 AP and 75.0 AP on COCO validation and test-dev sets, while being more lightweight and faster than mainstream CNN architectures. The TransPose model also transfers very well on MPII benchmark, achieving superior performance on the test set when fine-tuned with small training costs.

Introduction

Mainstream human pose estimation relies heavily on Convolutional Neural Networks (CNNs). While effective, CNNs have two major drawbacks. First, convolutions are inherently local. To understand the relationship between distant joints (global context), many layers must be stacked to increase the "receptive field," which is computationally inefficient. Second, deep CNNs are often "black boxes," making it difficult to see why a model predicts a joint is at a specific coordinate, especially when that joint is occluded.

The TransPose Architecture

TransPose uses a hybrid architecture consisting of three main parts:

  1. CNN Backbone: A shallow CNN extracts low-level, local features from the input image.
  2. Transformer Encoder: The core of the model treats the flattened feature map as a sequence of tokens. Because of the self-attention mechanism, every location in the image can "attend" to every other location in a single layer.
  3. Head: A simple linear layer predicts keypoint heatmaps from the Transformer's output.
The Transformer's self-attention mechanism allows any location in the image to attend to any other location in a single layer, capturing global dependencies much more efficiently than deep CNN stacks.

Crucially, the authors use 2D Sine Position Embeddings to help the Transformer understand the spatial structure of the flattened image tokens. This allows the model to capture global spatial relationships—such as the symmetry of shoulders or the typical distance between a hip and a knee—much more efficiently than a deep CNN.

Interpretability through Attention

The most striking insight of TransPose is the visualization of "dependency areas." The last attention layer acts as an aggregator, collecting evidence from across the image to form the final prediction.

TransPose architecture and attention maps. The attention layers reveal exactly which image clues the model uses to predict each joint, providing evidence of how the model handles special cases like occlusion.

For an occluded joint, the attention maps show the model looking at other visible joints and the torso to infer the hidden joint's position. This provides "fine-grained evidence beyond intuition" and links Transformer attention to the principle of Activation Maximization, proving that the model's internal attention is a mathematically sound proxy for explaining its predictions.

Key Results and Efficiency

By using Transformers to handle global relationships, the model doesn't need to be nearly as deep as pure CNN counterparts. Key results include:

  • Accuracy: Achieved 75.8 AP on the COCO validation set.
  • Efficiency: TransPose-H-A6 achieves better results than HRNet-W48 while using 73% fewer parameters and running 1.4x faster.
  • Lightweight: The TransPose-H-S model uses only 8.0M parameters while maintaining competitive accuracy.
  • Transferability: The model transfers exceptionally well to the MPII benchmark with minimal fine-tuning costs.

Conclusion and Future Work

TransPose demonstrates that Transformers can replace deep convolutional stacks for keypoint localization, offering both superior efficiency and rare interpretability. While the self-attention mechanism has a quadratic complexity that makes high-resolution training expensive, the explicit dependency patterns captured here could be highly beneficial for future work in 3D pose estimation and action recognition.

Summary updated

BibTeX
@inproceedings{yang2021transpose,
  author = {Sen Yang and Zhibin Quan and Mu Nie and Wankou Yang},
  title = {{TransPose: Keypoint Localization via Transformer}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.01159},
}
Figure