Abstract
Temporal Context Aggregation (TCA) addresses the limitations of existing video retrieval methods by leveraging self-attention to capture long-range semantic dependencies. By integrating a supervised contrastive learning framework with a large-scale memory bank, TCA achieves significant improvements in fine-grained retrieval accuracy while maintaining high inference efficiency. On the FIVR-200K dataset, TCA provides a 17% mAP boost over previous video-level methods while remaining 22x faster than traditional frame-level matching approaches.
Introduction
Content-Based Video Retrieval (CBVR) is evolving from simple near-duplicate detection toward the understanding of complex events and incidents. Traditional methods often struggle with two primary challenges: Context Blindness and Redundancy Overload. Context blindness occurs when models treat frames in isolation; for instance, a plane flying and a plane crashing may look identical at the frame level without temporal context. Redundancy overload refers to the "B-roll" or repetitive scenery that can drown out critical, informative moments when features are simply averaged.
Existing solutions typically force a trade-off between fast but low-detail video-level representations and accurate but computationally expensive frame-level matching. TCA aims to bridge this gap by creating a "smart" video-level descriptor that understands temporal context.
Proposed Method
The authors introduce two primary innovations to enhance video retrieval: Temporal Context Aggregation and a specialized training framework.
Temporal Context Aggregation (TCA)
Instead of simple global pooling, TCA employs a Transformer encoder's self-attention mechanism. This allows every frame's representation to be updated based on its relationship with every other frame in the video. By doing so, the model learns to "attend" to the most salient parts of the sequence—such as the moment of impact in a crash—while suppressing redundant background frames.
Supervised Contrastive Learning with a Memory Bank
Training retrieval models usually involves triplet loss, which requires tedious manual hard-negative mining. To overcome this, the authors propose a supervised contrastive learning approach supported by a memory bank.
As shown in the framework above, the model maintains a large "bank" of negative samples (distractors) across batches. This provides a massive pool of negatives for the model to learn from without requiring prohibitive GPU batch sizes. Through gradient analysis, the authors demonstrate that their contrastive loss (using InfoNCE or Circle Loss) naturally assigns higher gradients to "hard" negatives—samples that are similar to the query but incorrect—effectively automating the mining process.
Experimental Results
The TCA model was evaluated on several large-scale datasets, including VCDB for training and FIVR-200K for fine-grained incident retrieval.
Efficiency and Accuracy Trade-offs
A key finding of this research is the efficiency of video-level features when context is properly encoded. By using self-attention to "bake" temporal context into a single video-level vector, the model achieves accuracy close to frame-to-frame matching methods at a fraction of the computational cost.
As illustrated in the performance plot, TCA (ours) significantly outperforms existing video-level state-of-the-art methods like DML by roughly 17% mAP on the challenging FIVR-200K dataset. Furthermore, TCA is 22x faster during inference than ViSiL, a leading frame-level method, while delivering competitive retrieval performance. This positioning makes TCA a highly practical solution for real-world, large-scale video search engines.
Qualitative Insights
Visualization of attention weights confirms that the model successfully learns to ignore generic scenery, focusing instead on the core action. Additionally, t-SNE visualizations demonstrate that TCA creates much tighter, more distinct clusters for relevant videos compared to standard Deep Metric Learning (DML) approaches.
Conclusion
TCA represents a significant step forward in balancing speed and accuracy for video retrieval. By treating temporal context as a first-class citizen through self-attention and optimizing the training process with a memory-bank-based contrastive loss, the model effectively captures the nuances of complex events. Future work may explore more sophisticated temporal modeling and different loss functions to further close the gap between fast video-level descriptors and slower, more detailed frame-level matching methods.
Summary updated