arXiv:2210.05039Computer ScienceOct 2022

Manuscript Offprint

arXiv:2210.05039

Contrastive Video-Language Learning with Fine-grained Frame Sampling

Zixu Wang, Yujie Zhong, Yishu Miao, Lin Ma, Lucia Specia

Abstract

Despite recent progress in video and language representation learning, the weak or sparse correspondence between the two modalities remains a bottleneck in the area. Most video-language models are trained via pair-level loss to predict whether a pair of video and text is aligned. However, even in paired video-text segments, only a subset of the frames are semantically relevant to the corresponding text, with the remainder representing noise; where the ratio of noisy frames is higher for longer videos. We propose FineCo (Fine-grained Contrastive Loss for Frame Sampling), an approach to better learn video and language representations with a fine-grained contrastive objective operating on video frames. It helps distil a video by selecting the frames that are semantically equivalent to the text, improving cross-modal correspondence. Building on the well established VideoCLIP model as a starting point, FineCo achieves state-of-the-art performance on YouCookII, a text-video retrieval benchmark with long videos. FineCo also achieves competitive results on text-video retrieval (MSR-VTT), and video question answering datasets (MSR-VTT QA and MSR-VTT MC) with shorter videos.

1 Introduction

Human perception is multimodal, including visual, textual, and audial information. To achieve human-level perceptional ability, intelligent systems need to understand and interpret these multimodal signals and summarise the relevant information in them. Learning from video and language data has received significant attention in recent multimodal machine learning work for downstream tasks that require joint understanding of video and textual information, including text-video retrieval (Lin et al., 2014; Liu et al., 2019; Miech et al., 2018; Wang et al., 2016; Bain et al., 2021), video question answering (Fan et al., 2019; Yang et al., 2021; Huang et al., 2020; Jiang et al., 2020; Le et al., 2020; Lei et al., 2021), and video captioning (Ging et al., 2020; Luo et al., 2020; Zhang et al., 2020b). In most of this work, contrastive learning (Gutmann and Hyvärinen, 2010) is used as training objective.

The aim of a cross-modal contrastive loss is to maximise the similarity between an aligned video-text pair while minimising the similarity for all other pairs. One issue with standard cross-modal contrastive loss is that it focuses on pair-level alignment but ignores the negative effects of irrelevant frames that are present in a single video clip, even in a pair of aligned video and text. We define irrelevant frames as those with no or little shared semantics with the text. These irrelevant frames may negatively affect the contribution of frames that are semantically similar to the text, which further results in less informative video representation. Therefore, we posit that frame-level learning is a better strategy for video-language tasks.

Figure

Figure 1: Illustration of the weak correspondence problem in video-language learning. Given a pair of video and its text (e.g. caption, instruction, or transcription), only a subset of the frames (here indicated by coloured bounding boxes) is semantically aligned to the textual content. The remaining frames represent irrelevant visual information and will not contribute to language grounding on videos.

In this paper, we propose FineCo, an approach that has a frame selector to sample relevant frames in a video and is trained with a fine-grained contrastive loss on frame-text pairs, in order to mitigate the problem of weak correspondence in video-language representation learning. Existing video-language learning approaches (Miech et al., 2020; Xu et al., 2021) only optimise pair-level alignment but do not explicitly learn which part of a video contributes to its alignment with the text. FineCo focuses on aligning relevant frames with the text. It is inspired by the text-based temporal localisation task (Zhang et al., 2020a), however, the motivation of FineCo is different: to learn better video-level representation by adding a frame-level contrastive learning signal to the pair-level objective, with no need for temporal annotation within a video-text pair.

We hypothesise that FineCo is particularly beneficial for long videos, where each video provides more information and only a small proportion of frames will be relevant to its text counterpart, as shown in Figure 1. FineCo is able to model frame-text similarity through fine-grained contrastive learning, where the most informative frames are paired with the text as positive pairs and the remaining frames, as negatives. It then explicitly contrasts the selected informative frames against the noisy frames, without the need for frame-text annotations. This frame-level distillation provides a strong learning signal, which encourages the alignment of semantically equivalent video-text pairs. The fine-grained contrastive loss abstracts the learning signal from pair-level annotations and is trained in an end-to-end manner. This combination of pair-level learning signal and frame-level contrastive loss is novel and effective, and boosts the performance on two important video-language benchmark tasks, especially in text-video retrieval with longer videos. We devised FineCo by building on the recently proposed and well performing VideoCLIP (Xu et al., 2021), in which a video clip is represented as sequence of frame features.

Our contributions are summarised as follows: (1) We propose FineCo, an approach trained with fine-grained contrastive loss to mitigate the weak correspondence problem in video-text pairs; (2) We use FineCo to distil a video clip by sampling frames that are relevant to its text counterpart according to frame-text similarities; (3) On text-video retrieval and video question answering benchmarks, we show that FineCo achieves state-of-the-art performance on YouCookII and MSR-VTT MC (multiple choice).

References (10)