TS2-Net: Token Shift and Selection Transformer for Text-Video Retrieval

Yuqi Liu, Pengfei Xiong, Luhui Xu, Shengming Cao, Qin Jin

Abstract

TS2-Net introduces two novel, plug-and-play modules for Vision Transformers (ViTs) to significantly boost text-video retrieval performance. By shifting entire tokens across time to capture subtle motion and dynamically selecting only the most "informative" spatial patches, it achieves state-of-the-art results on five major industry benchmarks including MSR-VTT and ActivityNet.

What Problem Does This Paper Address?

Text-video retrieval—finding the right video based on a text description—is a cornerstone of modern search engines. While current models are good at identifying "obvious" things (like a "dog running"), they often struggle with fine-grained details.

TS2-Net excels at capturing fine-grained details like a 'hat' or the act of 'talking' which baseline models often miss.

The authors identify two specific gaps:

  1. Subtle Movements: Standard models often miss tiny temporal cues, like the difference between someone just sitting and someone "talking."
  2. Small/Salient Objects: Videos contain a lot of "noise" (background pixels). Current models often aggregate the whole frame, causing small but crucial objects (like a "hat" or a "microphone") to get lost in the shuffle.

Most existing methods use fixed, pre-trained backbones (like CLIP) that weren't originally designed to handle the complex interplay of space and time in video.

Methods

The authors propose the Token Shift and Selection Network (TS2-Net), which modifies the standard Transformer architecture with two key components:

The TS2-Net architecture integrates Token Shift and Token Selection modules into the Transformer layers to enhance temporal and spatial modeling.

1. Token Shift Transformer (Temporal)

Inspired by the Temporal Shift Module (TSM) used in older CNNs, this module allows information to flow between adjacent video frames.

  • The Innovation: Unlike previous methods that shifted only parts of a feature channel (which can "break" the integrity of a Transformer token), TS2-Net shifts entire tokens (all channels of a spatial patch) back and forth between neighboring frames.
  • Why it works: This preserves the spatial meaning of the patch while allowing the model to "see" how that specific area changes over time, capturing subtle movements without requiring heavy 3D convolutions.

2. Token Selection Transformer (Spatial)

Videos are redundant; not every part of every frame is useful.

  • The Innovation: The authors designed a lightweight selection network that scores every patch in a frame based on its importance. It then keeps only the Top-K most informative tokens (e.g., the 4 patches most likely to contain the "action" or "subject").
  • Differentiable Selection: To make this trainable, they use a "perturbed maximum" method, allowing the model to learn which patches to pick through standard backpropagation.

Datasets

The model was evaluated on five diverse, large-scale text-video retrieval benchmarks: MSR-VTT, VATEX, LSMDC, ActivityNet-Caption, and DiDeMo.

Key Insights and Ideas

  • Token Integrity Matters: Shifting the whole token is much more effective than shifting partial channels, as it maintains the semantic "identity" of that patch across time.
  • Less is More: Surprisingly, using only a few selected tokens (e.g., $K=4$) often performed better than using all tokens (e.g., 50+). This proves that "background noise" in video frames is a major distractor for retrieval models.
  • Deep Shifting: Ablation studies showed that shifting tokens in the deeper layers of the Transformer is better. Shallow layers need to focus on building spatial structure; if you shift them too early, you "blur" the model's understanding of the scene.

Key Results

TS2-Net set new records across the board. On the MSR-VTT benchmark (1k-A split):

  • Recall@1 (R@1): Achieved 47.0%, a significant jump over the previous SOTA, CLIP4Clip (44.5%).
  • Stronger Backbones: When using a more powerful ViT-B/16 backbone, the R@1 climbed even higher to 49.4%.
  • Qualitative Success: The model successfully distinguished between "hand rubbing" and "playing guitar"—a subtle motion distinction that baseline models failed to make. It also successfully retrieved videos based on tiny objects like a "bag" that occupied only a small fraction of the screen.

Limitations and Future Work

  • Hyperparameter Tuning: The optimal number of tokens to select ($K$) varies by dataset. The authors suggest that finding a way to make $K$ dynamic or self-adaptive would be a valuable next step.
  • Computational Efficiency: While the selection module is "lightweight," the paper does not provide a detailed breakdown of the added latency during inference compared to a standard frozen backbone.
  • Domain Specificity: The model relies heavily on pre-trained CLIP weights. Its performance on highly specialized domains (like medical or industrial video) without significant fine-tuning remains an open question.

Summary updated

BibTeX
@inproceedings{liu2022ts,
  author = {Yuqi Liu and Pengfei Xiong and Luhui Xu and Shengming Cao and Qin Jin},
  title = {{TS2-Net: Token Shift and Selection Transformer for Text-Video Retrieval}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19781-9\_19},
}
Figure