Learning Implicit Temporal Alignment for Few-shot Video Classification

Songyang Zhang, Jiale Zhou, Xuming He

Introduction

Few-shot video classification aims to recognize novel action categories using only a handful of labeled examples. This task is particularly challenging due to significant intra-class variations and temporal misalignments between video sequences. Traditional methods often rely on computationally expensive explicit alignment algorithms like Dynamic Time Warping (DTW), which scale quadratically with video length. This paper introduces ITANet (Implicit Temporal Alignment Network), a novel framework that simplifies video comparison by "implicitly" aligning sequences through context-aware feature representation.

The ITANet Architecture

The proposed ITANet addresses the alignment challenge by factorizing context encoding and introducing an implicit alignment mechanism. Instead of searching for explicit frame correspondences, ITANet enriches frame-level features with spatial, channel, and temporal context, allowing for a simple yet effective similarity summation.

Overview of the ITANet architecture, showing the progression from raw video frames to meta and semantic predictions.

The architecture consists of three primary stages:

  1. Embedding Network: A ResNet-50 backbone extracts spatial feature maps for each frame in a video clip.
  2. Context Encoding Network: This module employs two types of attention to handle intra-class variation. The Spatial Context Module uses self-attention within frames to highlight discriminative regions, while the Channel Context Module captures global channel interdependencies across the entire video, similar to Squeeze-and-Excitation blocks.
  3. Implicit Temporal Alignment: This is the core innovation. By applying temporal self-attention, each frame's feature incorporates information from all other frames in the sequence. Consequently, each frame becomes a summary of its own content relative to the whole video. This allows for video comparison via a simple $1:1$ frame-wise cosine similarity summation, reducing computational complexity from the $O(N^2)$ required by explicit warping to $O(N)$.

Additionally, a Multi-task Learning strategy is employed, using both a meta-learning loss for episodic tasks and a semantic loss for global classification to improve feature generalization. The Semantic Linear Layer forces the model to classify videos against the entire training set, preventing overfitting to specific few-shot episodes.

Experimental Results

ITANet was evaluated on major benchmarks including Kinetics-100 and Something-Something-V2 (SthV2). SthV2 is particularly demanding as it requires understanding temporal order (e.g., "pushing something from left to right" vs. "right to left").

Performance comparison on the Something-Something-V2 dataset across different shot counts and data splits.

As shown in the results, ITANet achieves state-of-the-art performance. On the full SthV2 split, it reached 49.2% accuracy in the 1-shot setting and 62.3% in the 5-shot setting, outperforming the previous best method (OTAM) by margins of 6.4% and 10%, respectively. On Kinetics-100, the model achieved 73.6% (1-shot) and 84.3% (5-shot), demonstrating robustness even on datasets where temporal alignment is less critical.

Key Insights

  • Factorized Attention: Breaking down context into spatial, channel, and temporal components maintains efficiency while capturing complex 3D relationships.
  • Implicit vs. Explicit Alignment: Representing frames with global temporal context removes the need for expensive warping algorithms. Simple summation becomes a robust similarity metric when features are sufficiently enriched.
  • Semantic Regularization: Training on a global classification task alongside the few-shot task acts as a regularizer, ensuring the embedding network learns robust, class-agnostic features.

Limitations and Future Work

While ITANet is efficient, it currently operates on fixed-length sequences. Future research could explore handling variable-length videos or integrating more advanced backbones like Video Transformers. Additionally, while implicit alignment is robust, it may face challenges with extreme non-linear temporal variations or jitter compared to more flexible explicit warping methods.

Summary updated

BibTeX
@inproceedings{zhang2021learning,
  author = {Songyang Zhang and Jiale Zhou and Xuming He},
  title = {{Learning Implicit Temporal Alignment for Few-shot Video Classification}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.24963/ijcai.2021/181},
}
Figure