Self-supervised and Weakly Supervised Contrastive Learning for Frame-wise Action Representations

Minghao ChenarXiv 2022 · DOI

TL;DR

This paper introduces CARL, a novel framework for learning frame-level action representations in videos using self-supervised and weakly-supervised contrastive learning. By focusing on fine-grained temporal understanding and leveraging a Transformer-based encoder, CARL achieves state-of-the-art performance on challenging video analysis tasks, even outperforming supervised methods.

What Problem Does This Paper Address?

Traditional action recognition models often focus on global representations of short video clips. However, many real-world applications, such as video alignment and phase classification in long videos, require understanding actions at a much finer, frame-by-frame level. Manually annotating each frame for such detailed analysis is prohibitively time-consuming and expensive. Existing weakly-supervised methods often rely on paired videos, which are also difficult to obtain. This paper aims to bridge this gap by developing a method that can learn effective frame-wise action representations from long videos using self-supervision or readily available video-level labels, without requiring paired video data.

Methods

The core of the proposed framework, CARL, involves a Frame-level Video Encoder (FVE) and a novel Sequence Contrastive Loss (SCL).

  • FVE: This encoder combines a 2D convolutional network (ResNet-50) for spatial feature extraction with a Transformer encoder for modeling temporal context. This hybrid approach is designed to efficiently process long video sequences and capture spatio-temporal relationships. For weakly-supervised learning, an additional class token and video-level classifier are added.
  • Sequence Contrastive Loss (SCL):
    • Self-supervised SCL: This loss leverages the idea that adjacent frames in a video are highly correlated. It optimizes frame-wise representations by minimizing the cross-entropy between the similarity distribution of two augmented views of a video and a prior Gaussian distribution of timestamp distances. This approach avoids treating semantically similar frames as negatives, which can harm learning.
  • Weakly-supervised SCL (Paired Contrastive Loss - PCL): When video-level labels are available, SCL is extended to PCL. This method uses dynamic time warping (DTW) to find corresponding frames between videos of the same action class, creating more positive and negative pairs. It also incorporates a "weak contrastive loss" to treat frames from videos with different labels as distant negatives. The DTW alignment is enhanced by ensembling views and using a cost matrix derived from multiple views.

Datasets

The framework is evaluated on three publicly available datasets:

  • PennAction: Contains videos of human sports and exercises, with 13 action categories.
  • FineGym: A large-scale dataset for fine-grained action recognition, focusing on parsing and recognizing different phases of an action. It includes datasets with 99 and 288 sub-action classes.
  • Pouring: Focuses on human hand interactions with objects, specifically pouring water.

Key Insights and Ideas

  • Frame-wise representations are crucial for long video understanding: The paper strongly advocates for moving beyond global video representations to capture fine-grained temporal dynamics.
  • Transformer excels at temporal context in videos: Integrating Transformer layers into the video encoder significantly improves the ability to model long-range temporal dependencies.
  • SCL is more robust than instance discrimination for videos: Directly applying instance discrimination (like SimCLR) to video frames can be detrimental due to the high correlation of adjacent frames. The proposed SCL addresses this by considering temporal distance.
  • Weak supervision significantly boosts performance: Leveraging readily available video-level labels with PCL leads to substantial improvements, demonstrating the practical utility of the approach.
  • Efficiency matters: The proposed FVE is shown to be more efficient in terms of speed and memory compared to previous methods that rely on complex 3D convolutions or DTW backpropagation.

Key Results

  • State-of-the-art performance: CARL (both self-supervised and weakly-supervised versions) significantly outperforms existing methods on PennAction, FineGym, and Pouring datasets across various metrics, including fine-grained action classification, phase classification, and frame retrieval.
  • FineGym improvement: The self-supervised version of CARL achieves 41.75% accuracy on FineGym99, a +13.94% improvement over the previous best method (GTA).
  • PennAction performance: On PennAction, CARL achieves 93.07% for fine-grained classification and 99.1% for Kendall's Tau in the self-supervised setting.
  • Efficiency gains: CARL's FVE is significantly faster and uses less memory than previous approaches, enabling processing of longer videos.
  • Robustness: Visualizations show that CARL's representations are invariant to appearance, viewpoint, and background, leading to robust video alignment and frame retrieval.

Limitations and Future Work

  • Hyperparameter sensitivity: The paper explores hyperparameter tuning for SCL and PCL, indicating that performance can be sensitive to choices like variance ($\sigma^2$), temperature ($\tau$), cost threshold ($\epsilon_1$), and trade-off parameter ($\lambda$).
  • Temporal data augmentation impact: While temporal augmentations are crucial, the paper notes that extreme settings (e.g., very short crop lengths or no overlap) can degrade performance.
  • Future work: The paper suggests exploring large-scale pre-training on datasets like Kinetics-400, which shows promising results for transferability and further boosts performance when fine-tuned. The authors also implicitly suggest that further research into more sophisticated temporal augmentations and loss functions could yield even better results.

Summary updated

BibTeX
@misc{chen2022self,
  author = {Minghao Chen},
  title = {{Self-supervised and Weakly Supervised Contrastive Learning for Frame-wise Action Representations}},
  year = {2022},
  eprint = {2212.03125},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.03125},
}

Loading related content...

Figure