Abstract
TempCLR is a contrastive learning framework that shifts video-text pre-training from matching individual clips to aligning entire sequences. By leveraging Dynamic Time Warping (DTW) and a novel temporal shuffling strategy, it teaches models to respect the global order of events, significantly boosting performance in video retrieval and action localization.
Introduction
Current state-of-the-art video-text models, such as VideoCLIP or MIL-NCE, primarily operate at a "unit level." These models attempt to maximize similarity between a single sentence embedding and a corresponding short video clip embedding. While effective for localized actions, this approach often fails to capture the global temporal context inherent in long-form videos. For instance, in a cooking tutorial, the action "add oil" might occur multiple times for different purposes. A unit-level model might treat these instances as interchangeable, ignoring their specific chronological roles within a larger task. TempCLR addresses this by aligning sequences of sentences (paragraphs) with sequences of clips (videos) while strictly respecting their temporal order.
Methodology
The core of TempCLR lies in two primary innovations designed to enforce temporal consistency:
Sequence-Level Alignment via Dynamic Time Warping (DTW)
Instead of simple pair-wise matching, TempCLR employs Dynamic Time Warping (DTW) to calculate sequence-level distances. DTW identifies the optimal alignment between a sequence of text descriptions and a sequence of video clips by minimizing the cumulative cost of "warping" one sequence onto the other. This process enforces a monotonic temporal constraint, ensuring the model finds a path through the video that matches the narrative order of the paragraph.
Temporal Granularity Negative Sampling
Contrastive learning requires effective negative samples. While standard approaches use different videos as negatives, TempCLR introduces "temporal negatives" by shuffling the clips of the correct video at various granularities (e.g., shuffling segments or clips within segments). This forces the model to learn that correct visual content in the wrong order constitutes a poor match, thereby isolating temporal succession as a key feature.
Experimental Evaluation
TempCLR was pre-trained on a 90k subset of the HowTo100M dataset and evaluated across several benchmarks:
- Video Retrieval: Evaluated on YouCookII and DiDeMo.
- Action Step Localization: Evaluated on CrossTask to determine the precise timing of specific task steps.
- Few-shot Action Recognition: Tested on Something-Something V2, which requires fine-grained temporal reasoning.
Results and Discussion
TempCLR demonstrated substantial improvements over baseline models, even with limited training data:
- Retrieval Performance: On YouCookII, TempCLR achieved an 83.5% R@1, a significant jump from the 56.0% achieved by the VideoCLIP baseline.
- Zero-Shot Localization: In action step localization on CrossTask, TempCLR improved recall from 33.9% to 36.9% without task-specific training.
- Temporal Reasoning: On sth-sth V2, the model reached 47.8% 1-shot accuracy, outperforming specialized models like OTAM.
The success of TempCLR highlights the importance of using order as a supervised signal. By shuffling positive videos, the model is prevented from relying on static background cues and is forced to focus on temporal dynamics. Furthermore, the "soft" alignment provided by DTW proves more robust to the noisy timing typically found in narrated web videos compared to rigid "hard" labels.
Conclusion
TempCLR effectively bridges the gap between local clip matching and global video understanding. While the computational complexity of DTW and the assumption of synchronized start/end points present ongoing challenges, the framework's ability to learn powerful temporal representations from a fraction of available data is promising. Future work will explore scaling to larger datasets and refining boundary-agnostic alignment techniques.
Summary updated