Spatial-Temporal Alignment Network for Action Recognition

Jinhui Ye, Junwei LiangarXiv 2023 · DOI

Abstract

Action recognition models often struggle with geometric variations such as camera motion, zooming, and viewpoint changes. This paper proposes the Spatial-Temporal Alignment Network (STAN), a lightweight "plug-and-play" module designed to explicitly correct these variations. STAN consists of a Deformation Network that predicts a 3D transformation matrix and a Warping Module that applies this transformation to feature maps via trilinear interpolation. When integrated into the Multiscale Vision Transformer (MViTv2), STAN achieves significant accuracy improvements on standard benchmarks—up to 6.4% on HMDB51—with a negligible increase in computational cost (approximately 1.6% FLOPs).

Introduction

Action recognition—identifying human activities in video—is a fundamental task in computer vision. While modern architectures like Convolutional Neural Networks (CNNs) and Vision Transformers (ViTs) have achieved high performance, they often possess a "blind spot" regarding geometric variations. If a camera moves or captures an action from an unusual angle, the raw pixel data changes drastically, even if the underlying action remains the same.

Humans naturally handle this by mentally aligning the scene to a standard coordinate frame. In contrast, most AI models attempt to learn these variations implicitly through massive datasets, which is computationally expensive and often inefficient for smaller datasets. This research introduces STAN to explicitly teach models to align their "view" of an action before classification.

The STAN Architecture

The STAN module is designed to mimic human visual normalization through two primary components:

  1. The Deformation Network: This sub-network utilizes R(2+1)D CNN layers followed by a Fully Connected (FC) layer to analyze input feature maps. It predicts a transformation matrix ($\theta \in \mathbb{R}^{4 \times 4}$), which serves as a set of instructions for geometric corrections such as cropping, rotating, or scaling in both spatial and temporal dimensions.
  2. The Warping Module: This module applies the predicted transformation matrix to the feature map ($J_{in}$) using 3D trilinear interpolation to produce an aligned output ($J_{out}$). This process is parameter-free and differentiable, allowing for end-to-end training.
Overview of the STAN plug-in architecture integrated within an action recognition pipeline.

To maintain architectural stability and prevent information loss, STAN employs a residual connection, adding the warped features back to the original input. This design allows it to be easily integrated into existing backbones like MViTv2 without disrupting the training flow.

Experimental Setup

The effectiveness of STAN was evaluated on two prominent action recognition benchmarks:

  • UCF101: Comprising 13,320 videos across 101 categories (e.g., playing guitar, diving).
  • HMDB51: A more challenging dataset with 6,766 clips across 51 categories, characterized by significant camera motion and varied lighting.

The models were tested in "trained-from-scratch" settings to evaluate how well STAN facilitates learning when data is not exhaustive.

Results and Analysis

The integration of STAN consistently outperformed the baseline MViTv2 model across both datasets. On UCF101, accuracy increased from 84.97% to 88.26%. On the more difficult HMDB51 dataset, the model saw a substantial relative improvement of 6.4%, reaching 73.40% accuracy.

Performance comparison of MViTv2 with and without the STAN module across UCF101 and HMDB51 datasets.

Beyond raw accuracy, the research highlighted several key insights:

  • Efficiency: STAN is remarkably efficient. The 12-degree-of-freedom affine transformation provides significant robustness for only a 1.57% increase in FLOPs and a 0.73% increase in parameters.
  • Strategic Placement: Ablation studies indicated that STAN performs best when inserted after the second stage of the backbone network. This placement provides enough abstraction for the deformation network to find the correct alignment without the model having already struggled through unaligned deep features.
  • Transferability: The alignment logic learned on HMDB51 could be frozen and successfully applied to UCF101, suggesting that STAN learns general geometric principles of video rather than dataset-specific shortcuts.

Conclusion

STAN demonstrates that incorporating explicit geometric alignment into modern Transformer architectures can yield significant performance gains. By providing a "geometric hint," STAN allows subsequent layers to focus on the mechanics of the action rather than the noise of camera perspective. Future work may extend this approach to handle optical flow streams or explore more complex, non-linear deformations for highly dynamic scenes.

Summary updated

BibTeX
@misc{ye2023spatial,
  author = {Jinhui Ye and Junwei Liang},
  title = {{Spatial-Temporal Alignment Network for Action Recognition}},
  year = {2023},
  eprint = {2308.09897},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.09897},
}
Figure