Improving Video Retrieval by Adaptive Margin

Feng He, Qi Wang, Zhifan Feng, Wenbin Jiang, Yajuan Lv, Yong Zhu, Xiao Tan

Abstract

Standard video retrieval models often use a fixed margin to separate positive and negative pairs, which can be overly restrictive for semantically similar samples. This paper proposes an adaptive margin approach that adjusts based on semantic similarity. By implementing a Cross-Modal Generalized Self-Distillation (CMGSD) framework, the model learns more nuanced representations without adding any computational overhead during inference.

Introduction

In cross-modal video retrieval, such as searching for a video using a text query, models are typically trained using a triplet ranking loss. This loss ensures that the similarity between a positive pair (a video and its ground-truth caption) is higher than the similarity of a negative pair (the video and a random caption) by at least a fixed "hard margin."

However, negative samples are often chosen randomly. If a query is "A red car racing," a negative caption like "A blue vehicle on a track" is semantically similar. Forcing the model to push these similar representations far apart using a large, fixed margin provides inaccurate supervision, confusing the model and hindering its ability to learn nuanced relationships.

Conceptual comparison between a fixed hard margin and the proposed adaptive margin.

The Adaptive Margin Framework

The authors propose making the margin adaptive—assigning a large margin to highly dissimilar pairs and a small margin to similar ones. Since ground-truth similarity scores for every possible video-text pair are unavailable, the framework assumes that if a video and text are a positive pair, their semantic distance can be approximated by observing distances within a single modality (video-to-video or text-to-text).

Cross-Modal Generalized Self-Distillation (CMGSD)

To implement this, the researchers introduced two types of "Supervision Experts" that act as teachers during training:

  • Dynamic Supervision Experts (DSEs): These utilize the model’s own encoders as they are being trained. As the model improves, its internal distances become better proxies for semantic similarity.
  • Static Supervision Experts (SSEs): These are powerful, frozen, pre-trained models (such as Sentence-BERT for text or S3D for video) that provide a stable, high-quality anchor for similarity measurements from the start of training.
The CMGSD framework architecture, showing the interaction between the retrieval model and the supervision experts.

The Rescale Function

To prevent the adaptive margin from fluctuating wildly, a Gaussian-based rescale function is employed. This ensures the margin stays centered around the original hard margin while allowing for sample-specific adjustments based on the experts' feedback.

Key Results and Insights

The researchers evaluated their method on three benchmark datasets: MSRVTT, ActivityNet, and LSMDC. The CMGSD method consistently outperformed state-of-the-art (SOTA) models:

  • MSRVTT: On the standard 1K-A split, the model improved the Recall at rank 1 (R@1) from 24.6% to 26.1%.
  • ActivityNet: The "Rsum" (sum of recalls) saw a significant jump of +9.0 points over the backbone model.
  • Versatility: CMGSD was successfully integrated into other popular architectures like Dual Encoding and Collaborative Experts, consistently improving their performance.

One of the most significant advantages of this approach is zero inference overhead. Because the experts and adaptive margin calculations only occur during the loss calculation at training time, the final deployed model remains the same size and speed as a standard retrieval model.

Conclusion

The core innovation of this work is the realization that cross-modal similarity can be effectively supervised by single-modal experts. By treating self-distillation as a loss refiner rather than a model compression technique, the authors provide a flexible toolkit for improving video retrieval performance. Future work may involve applying this adaptive margin concept to other cross-modal tasks like image-text retrieval or video question answering.

Summary updated

BibTeX
@inproceedings{he2021improving,
  author = {Feng He and Qi Wang and Zhifan Feng and Wenbin Jiang and Yajuan Lv and Yong Zhu and Xiao Tan},
  title = {{Improving Video Retrieval by Adaptive Margin}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2021},
}
Figure