TFPose: Direct Human Pose Estimation with Transformers

Weian Mao, Yongtao Ge, Chunhua Shen, Zhi Tian, Xinlong Wang, Zhibin WangarXiv 2021

Introduction

Human pose estimation involves identifying the spatial coordinates of keypoints such as elbows, knees, and shoulders within an image. Historically, this field has been dominated by two competing paradigms: heatmap-based methods and regression-based methods. While heatmap-based approaches have set the standard for accuracy, they introduce significant complexity. TFPose proposes a shift toward a direct sequence prediction problem using Transformers, aiming to combine the simplicity of regression with the precision of heatmaps.

The Heatmap vs. Regression Dilemma

The most accurate traditional models are heatmap-based. These models predict a probability map for each joint. However, this approach requires non-differentiable post-processing (e.g., finding the maximum pixel) and suffers from "quantization errors" because the output maps are often lower resolution than the input. Furthermore, they rely heavily on manually tuned ground-truth heatmaps.

In contrast, regression-based methods directly predict $(x, y)$ coordinates. While conceptually simpler and more direct, they have historically lagged in accuracy. This performance gap is often attributed to the loss of spatial structure during global pooling and "feature misalignment," where the extracted features do not precisely correspond to the keypoint locations.

Comparison of traditional heatmap-based pipelines (a) versus the simpler regression-based pipeline (b).

Methodology: The TFPose Framework

TFPose bridges the performance gap by formulating pose estimation as a sequence prediction task solved by a Transformer architecture. The pipeline consists of four primary stages:

  1. Backbone: A standard CNN (such as ResNet) extracts multi-level feature maps from the input image.
  2. Transformer Encoder: This component processes flattened features and incorporates positional embeddings to maintain spatial context across different feature levels and locations.
  3. Transformer Decoder: This is the core innovation. It utilizes a set of learnable "keypoint queries" to predict coordinates in parallel.
  4. Query-to-Query Attention: This allows the model to inherently learn the structural relationships of the human body (e.g., the dependency between an elbow and a shoulder).
  5. Pixel-to-Query Attention: This mechanism enables the model to adaptively attend to the most relevant image features for each specific keypoint, effectively mitigating the feature misalignment issue.
  6. Progressive Refinement: Coordinates are iteratively refined across multiple decoder layers rather than being predicted in a single step.
The overall TFPose pipeline, integrating a CNN backbone with a Transformer encoder-decoder architecture for direct coordinate regression.

Key Insights

  • Implicit Body Modeling: TFPose avoids hand-designed rules for body constraints. Instead, query-to-query attention learns these relationships directly from data. Visualizations indicate that symmetric and adjacent joints naturally "attend" to one another during the prediction process.
  • Dynamic Feature Selection: The attention mechanism acts as a dynamic selector. Rather than relying on a fixed grid, the model "looks" at the most informative pixels for each joint, regardless of their position in the feature map.
  • Auxiliary Heatmap Loss: To address the slow convergence typical of Transformers, the authors employed an auxiliary heatmap loss during training. This branch is discarded during inference, ensuring the final model remains a direct and efficient regression-based system.

Experimental Results

TFPose was evaluated on the MS COCO 2017 and MPII Human Pose benchmarks, yielding significant improvements:

  • State-of-the-Art Regression: On COCO, TFPose outperformed the previous best regression-based method by 4.4% AP.
  • Competitive Accuracy: Using a ResNet-50 backbone, it achieved 70.5% AP on the COCO validation set, surpassing established heatmap methods like the 8-stage Hourglass.
  • Efficiency: TFPose demonstrated superior performance compared to SimpleBaseline while maintaining lower computational complexity (7.7 vs. 8.9 GFLOPs).
  • Robustness: It achieved 90.4% PCKh on the MPII dataset, confirming its effectiveness across various metrics and datasets.

Conclusion

TFPose demonstrates that Transformers can effectively close the accuracy gap between regression-based and heatmap-based pose estimation. By modeling body structure through attention and refining coordinates directly, it offers a simpler, more efficient alternative to complex heatmap pipelines. Future work may involve extending this framework to "bottom-up" multi-person estimation, where the model detects all individuals and their poses simultaneously in a single pass.

Summary updated

BibTeX
@misc{mao2021tfpose,
  author = {Weian Mao and Yongtao Ge and Chunhua Shen and Zhi Tian and Xinlong Wang and Zhibin Wang},
  title = {{TFPose: Direct Human Pose Estimation with Transformers}},
  year = {2021},
  eprint = {2103.15320},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.15320},
}
Figure