Multi-Scale Temporal Difference Transformer for Video-Text Retrieval

Ni Wang, Dongliang Liao, Xing XuarXiv 2024 · DOI

Introduction

Video-text retrieval—the task of identifying specific video clips based on natural language descriptions—has seen significant progress with the advent of vision-language models like CLIP. However, standard adaptations of CLIP to video often rely on simply stacking frames and processing them through a global Transformer. This approach suffers from two primary limitations: a "global bias" that overlooks fine-grained local temporal information (e.g., the difference between "chopping" and "stirring"), and a lack of semantic clustering in the embedding space, where similar but non-identical video-text pairs are often treated as unrelated.

Methodology

To address these challenges, the Multi-Scale Temporal Difference Transformer (MSTDT) framework introduces a specialized architecture designed to capture both local motion and global context.

The MSTDT architecture (a) and its integration with CLIP (b).

Multi-Scale Temporal Difference Transformer

The core of the framework is the MSTDT module, which consists of two parallel components:

  1. Short-term Multi-Scale Temporal Difference Transformer: This module explicitly models motion by calculating the difference between consecutive frames ($v_{i+1} - v_i$). To account for actions occurring at varying speeds, it processes these differences across multiple temporal scales (e.g., windows of 3, 4, or 6 frames).
  2. Long-term Temporal Transformer: This component focuses on the global context and static visual information of the entire video sequence.

The final video representation is a weighted fusion of these short-term (motion-centric) and long-term (context-centric) features.

Binary Similarity Loss (BSL)

Beyond architectural changes, the authors introduce the Binary Similarity Loss (BSL) to refine the semantic embedding space. Unlike standard cross-entropy loss, which only optimizes for the ground-truth pair, BSL encourages the model to recognize semantic similarities between different samples.

Visualization of the embedding space before and after applying Binary Similarity Loss (BSL).

By using KL divergence to align the distribution of video-text similarities with video-video and text-text similarities, BSL ensures that semantically related content (e.g., different videos of dogs running) resides in close proximity within the feature space.

Evaluation and Results

The MSTDT model was evaluated on three major benchmarks: MSR-VTT, MSVD, and TGIF.

  • MSR-VTT (9K): The model achieved a Recall@1 (R@1) of 44.8% for text-to-video retrieval, outperforming the previous state-of-the-art CLIP4Clip (42.3%).
  • MSVD: MSTDT reached an R@1 of 46.1%, demonstrating robust performance even on smaller datasets.
  • Qualitative Performance: Qualitative analysis shows that MSTDT excels at identifying complex, temporally integrated actions, such as "playing guitar while driving," where previous models often failed to integrate the two distinct actions.

Discussion and Insights

The success of MSTDT highlights several key principles for video-language modeling:

  • Motion as an Inductive Bias: Explicitly feeding temporal differences into the model reduces the burden of learning motion from raw pixels, making the architecture more efficient at capturing dynamics.
  • Multi-Scale Receptive Fields: Just as spatial kernels in CNNs vary in size, temporal windows must vary to capture the diverse rhythms of human actions.
  • Semantic Neighborhoods: The embedding space should reflect conceptual similarity, not just one-to-one instance matching.

Limitations

While effective, the model's complexity can lead to overfitting on smaller datasets; the authors found that reducing the number of Transformer layers for MSVD actually improved results. Additionally, the balance between static and dynamic features (controlled by a hyperparameter $\alpha$) requires manual tuning, suggesting a need for more adaptive fusion mechanisms in future work.

Summary updated

BibTeX
@misc{wang2024multi,
  author = {Ni Wang and Dongliang Liao and Xing Xu},
  title = {{Multi-Scale Temporal Difference Transformer for Video-Text Retrieval}},
  year = {2024},
  eprint = {2406.16111},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.16111},
}
Figure