Abstract
Text-video retrieval is a task of significant practical value, particularly for modern search engines. A key challenge in this field is learning effective spatial-temporal video representations. While state-of-the-art models often utilize pre-trained vision backbones with fixed structures, these models frequently fail to capture fine-grained spatial-temporal details. We propose the Token Shift and Selection Network (TS2-Net), a novel architecture that dynamically adjusts token sequences and selects informative tokens across both temporal and spatial dimensions. By shifting entire token features across adjacent frames and selecting tokens that contribute most to local spatial semantics, TS2-Net achieves state-of-the-art performance on major benchmarks, including MSRVTT, VATEX, LSMDC, ActivityNet, and DiDeMo.
Introduction
Finding a specific video based on a text query requires a model to understand both global context and fine-grained details. While current models excel at recognizing general scenes—such as "a person playing guitar"—they often struggle with the nuances of motion and small, salient objects.
The authors of TS2-Net identify two primary gaps in existing architectures:
- Subtle Movements: Standard models often miss tiny temporal cues, such as the difference between a person holding a phone and a person actively talking into one.
- Spatial Redundancy: In many video frames, background pixels (like sky or walls) dominate the data, causing small but crucial objects (like a specific hat or bag) to be lost during information aggregation.
TS2-Net addresses these issues by modifying the internal token flow of Vision Transformers (ViTs) through two plug-and-play modules: Token Shift and Token Selection.
Methodology
1. Token Shift Module (Temporal)
In traditional Convolutional Neural Networks (CNNs), temporal shift modules often move a fraction of feature channels to neighboring frames. However, in a Transformer architecture, a token represents a discrete spatial patch. The authors argue that a "partial shift" breaks the integrity of these tokens.
The Innovation: TS2-Net shifts the entire token (all channels) back and forth across adjacent frames. This parameter-free approach allows the model to exchange information between frames without scrambling the individual spatial meanings of the patches, effectively helping the model "see" motion while preserving the "visual word" represented by each token.
2. Token Selection Module (Spatial)
A typical video frame is divided into dozens of tokens, many of which are non-informative background noise.
The Innovation: This module utilizes a lightweight Multi-Layer Perceptron (MLP) to score tokens based on their correlation with the global [CLS] token. It then selects only the Top-K most informative tokens. To ensure this process is trainable via backpropagation, the researchers employ a "perturbed maximum" method, allowing the model to learn which specific parts of a frame are most relevant to the video's semantic content.
Experimental Results
TS2-Net was evaluated across five diverse benchmarks to demonstrate its robustness and generalization capabilities:
- MSR-VTT: The primary benchmark for general video retrieval.
- VATEX: A large-scale multilingual dataset.
- LSMDC: Movie clips featuring challenging lighting and cinematic editing.
- ActivityNet-Caption & DiDeMo: Focused on long-form videos and paragraph-style descriptions.
Quantitative Performance
TS2-Net established new records across all tested datasets. On the MSR-VTT dataset, the model achieved a Recall@1 (R@1) of 47.0% using a ViT-B/32 backbone, outperforming previous leaders like CLIP4Clip (44.5%). When upgraded to a ViT-B/16 backbone, the R@1 reached 49.4%.
Qualitative Insights
Qualitatively, the model demonstrates a superior ability to distinguish between similar actions. For instance, in a video of a guitar performance, TS2-Net could correctly identify the specific action of "hand rubbing," whereas baseline models often defaulted to a generic "guitar playing" classification.
Discussion and Key Insights
- Token Integrity: The research highlights that in Transformers, the token is the fundamental unit of meaning. Shifting the whole token is essential for maintaining semantic clarity across time.
- Efficiency through Selection: A surprising finding was that selecting as few as 4 informative tokens per frame often outperformed using the full set of 50+ tokens. By forcing the model to be selective, it ignores redundant background data and focuses on salient objects.
- Strategic Placement: The authors discovered that temporal shifting is most effective in the "deeper" layers of the Transformer. Early layers are better suited for capturing raw spatial features, while deeper layers benefit from the temporal exchange required to form complex semantic concepts.
Conclusion and Future Work
TS2-Net provides a significant advancement in spatial-temporal video representation by making Vision Transformers more sensitive to motion and salient spatial details. While the model is highly effective, the authors note that performance is still limited by noise in existing datasets, where roughly 1-2% of queries are poorly annotated.
Future research directions include applying these token-shifting concepts to larger-scale pre-training and exploring how token selection can improve the computational efficiency of processing long-form video content.
Summary updated