STAR: Sparse Transformer-based Action Recognition

Feng Shi, Chonghan Lee, Liang Qiu, Yizhou Zhao, Tianyi Shen, Shivran Muralidhar, Tian Han, Song-Chun Zhu, Vijaykrishnan NarayananarXiv 2021

Introduction

Skeleton-based action recognition—identifying human activities from the 2D or 3D coordinates of joints—is a critical component for applications in surveillance, gaming, and human-computer interaction. Traditionally, this field has been dominated by Spatio-Temporal Graph Convolutional Networks (ST-GCNs). However, GCNs face significant hurdles: they are often computationally inefficient due to over-parameterization, struggle with fixed-size video constraints that lead to wasted memory (the "padding tax"), and suffer from quadratic scaling issues when using standard Transformer architectures.

The STAR (Sparse Transformer-based Action Recognition) model introduces a highly efficient alternative. By combining sparse spatial attention with segmented linear temporal attention, STAR achieves competitive accuracy while being up to 18x faster and 15x smaller than standard baselines, making it a prime candidate for real-time deployment on edge devices.

Methodology

The STAR framework reimagines spatio-temporal modeling through two specialized attention mechanisms designed to exploit the inherent sparsity of skeleton data.

Spatial Domain: Sparse MHSA

Instead of performing dense matrix operations where the vast majority of entries are zero, STAR utilizes Sparse Multi-Head Self-Attention (MHSA). As illustrated in the spatial domain topology, the model restricts attention to a predefined set of connections. This includes "Real Attention" for joints physically connected by bones and "Artificial Attention" for logical links, such as the relationship between the left and right hands.

Spatial Sparse MHSA: The model attends to physically connected joints (real attention) and logically linked joints (artificial attention).

By restricting attention to these specific links, the model effectively ignores noise from distant, unrelated joints. This structural inductive bias not only reduces computation but actually improves accuracy compared to full-attention models.

Temporal Domain: Segmented Linear MHSA

To address the $O(N^2)$ bottleneck of standard Transformers, STAR employs a kernel-based approximation of the softmax function, reducing temporal complexity to $O(N)$. Furthermore, STAR introduces a novel data format to handle variable-length video clips natively.

Variable-Length Processing: STAR concatenates clips and removes zero-padding to optimize memory and computation.

As shown above, variable-length clips are concatenated into a single batch, and zero-valued frames or persons are removed. A "segmented" attention mechanism ensures that the model only attends to frames within the same video clip, eliminating the need for padding and significantly reducing the computational footprint.

Experimental Results

STAR was evaluated on the NTU RGB+D 60 and NTU RGB+D 120 benchmarks, processing videos in their original, variable lengths. The results highlight the model's extreme efficiency:

  • Massive Speedup: STAR achieves a 4–18× speedup in execution time compared to ST-GCN baselines.
  • Compact Footprint: The model size is reduced by a factor of 7 to 15. For instance, the STAR-64 variant uses only 0.42M parameters, compared to 3.1M in ST-GCN.
  • Competitive Performance: STAR outperformed standard ST-GCNs on both datasets. While it trailed slightly behind the most complex hybrid models (like ST-TR), it achieved its results at a fraction of the computational cost.

Discussion and Future Work

While STAR demonstrates that pure Transformer architectures can effectively replace GCNs in non-Euclidean domains, the authors noted a performance gap between training and testing. This suggests that Transformers may lack certain inductive biases, such as translation equivariance, that are inherent to CNNs and GCNs.

Future research may focus on pre-training STAR on even larger skeleton datasets to close the accuracy gap with hybrid models. Additionally, while tree-based positional encodings were explored to represent the body's hierarchy, further refinement of structural positional encoding remains a promising area for improvement.

Summary updated

BibTeX
@misc{shi2021star,
  author = {Feng Shi and Chonghan Lee and Liang Qiu and Yizhou Zhao and Tianyi Shen and Shivran Muralidhar and Tian Han and Song-Chun Zhu and Vijaykrishnan Narayanan},
  title = {{STAR: Sparse Transformer-based Action Recognition}},
  year = {2021},
  eprint = {2107.07089},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.07089},
}
Figure