Reading + AI

LiteVL: Efficient Video-Language Learning with Enhanced Spatial-Temporal Modeling

Dongsheng Chen, Chaofan Tao, Lu Hou, Lifeng Shang, Xin Jiang, Qun Liu

arXiv:2210.11929v1 · This workspace stays on this version. Check arXiv for newer versions

Affiliations and author notes
  • Peking University
  • chends@stu.pku.edu.cn
  • The University of Hong Kong
  • cftao@connect.hku.hk
  • Huawei Noah’s Ark Lab
  • houlu3@huawei.com
  • shang.lifeng@huawei.com
  • jiang.xin@huawei.com
  • qun.liu@huawei.com
Source comparison finished

Original formulas, table values and figures are preserved. Comparison can miss differences; use the original PDF to check details.

Reading view checked: 217 math expressions, 0 rendering failures; 17 of 17 images available.

Compared 93 of 93 source passages against 13 of 13 PDF pages.

17 of 17 figure, table and graphic images captured. Open original PDF

Abstract

Recent large-scale video-language pre-trained models have shown appealing performance on various downstream tasks. However, the pre-training process is computationally expensive due to the requirement of millions of video-text pairs and the redundant data structure of each video. To mitigate these problems, we propose LiteVL, which adapts a pre-trained image-language model BLIP into a video-text model directly on downstream tasks, without heavy pre-training. To enhance the temporal modeling lacking in the image-language model, we propose to add temporal attention modules in the image encoder of BLIP with dynamic temporal scaling. Besides the model-wise adaptation, we also propose a non-parametric pooling mechanism to adaptively reweight the fine-grained video embedding conditioned on the text. Experimental results on text-video retrieval and video question answering show that the proposed LiteVL even outperforms previous video-language pre-trained models by a clear margin, though without any video-language pre-training.

The increasing popularity of videos in various social media has aroused the interest in efficient modeling of videos and their connections with other modalities like texts. Video-language modeling targets at learning a shared multimodal semantic space for videos and texts to facilitate downstream tasks like text-video retrieval and video question answering (VideoQA). Previous video-language modeling usually relies on pre-training on a large-scale video-text pair, via video-text contrastive learning (Luo et al., 2021; Li et al., 2022a; Gorti et al., 2022), video-text matching (Fan et al., 2019; Luo et al., 2020; Li et al., 2022a), masked language modeling (Devlin et al., 2019) and masked frame modeling (Sun et al., 2019); or extra object detectors to extract fine-grained visual features (Zhu and Yang, 2020; Chen et al., 2020). However, both pre-training on video-text pairs and using an off-the-shelf detector are computationally expensive and inefficient. Inaccurate detection results on limited categories may also lead to inferior performance.

In the unimodal video domain, TimeSformer (Bertasius et al., 2021) fails to pre-train video encoder directly on large-scale video datasets, but obtains good performance by initializing from a pre-trained Transformer-based ViT (Dosovitskiy et al., 2021) image encoder and training additional temporal attention modules directly on downstream video tasks. Similarly, ViViT (Arnab et al., 2021) also takes advantage of the already well-learned spatial visual representation in a pre-trained ViT model, and effectively adapts it for video tasks by directly fine-tuning on comparatively small downstream video datasets.

Inspired by TimeSformer and ViViT, in this paper, we also consider extending an image-language pre-trained model for video-text tasks without pre-training on video-text pairs. This requires us to not only leverage the already-learned alignment between spatial visual information and text in the image-language models, but also capture the additional temporal dependency efficiently. Thus we propose a simple yet efficient video-language model LiteVL, initialized from a recent pre-trained image-language model BLIP, but with both model-wise and feature-wise enhancement of temporal information. For model-wise enhancement, we propose to explicitly insert temporal attention layers with learnable scalings into the original image backbone, which can be adjusted for each downstream task. For feature-wise enhancement, we design a non-parametric pooling method to learn fine-grained spatial-temporal video features conditioned on the text description.

Empirical results on various tasks demonstrate that the proposed model, LiteVL, outperforms previous state-of-the-art methods by a clear margin, even without any video-language pre-training or the usage of object detectors. In particular, LiteVL achieves 50.8% R1 score on MSRVTT-9k dataset in the task of text-video retrieval, and 42.9% accuracy on MSRVTT-QA dataset in the task of video question answering. Visualizations also demonstrate that our LiteVL captures important spatial-temporal information with fine-grained video-text alignment.

Figure 1
Figure 1: (a) The architecture of LiteVL. The model is initialized from the pre-trained image-language model BLIP, but is equipped with additional temporal attention modules and text-dependent pooling, to quickly adapt to video-language downstream tasks without pre-training. (b) The proposed dynamic temporal scaling, which adjusts the scale of the newly-added temporal attention according to each downstream task.

Transformers (Vaswani et al., 2017), originally designed for natural language tasks, have recently been applied to the computer vision domain to model images and videos (Dosovitskiy et al., 2021; Liu et al., 2021; Touvron et al., 2021; Wang et al., 2021; Han et al., 2021). ViT (Dosovitskiy et al., 2021) is one of the most representative vision transformers, which processes each image as a sequence of image patches, and achieves remarkable performances on various image tasks.

Compared with image tasks, video understanding is more challenging because the additional temporal dimension brings a more complicated spatial-temporal information. To model the intertwined dependency of the spatial and temporal dimensions efficiently, video Transformers TimeSformer (Bertasius et al., 2021) and ViViT (Arnab et al., 2021) use the parameters of a well-trained image Transformer for initialization, and further design different variants of spatial-temporal attention mechanisms to capture the spatial-temporal dependencies.

The core of video-language models lies in modeling the interaction between the two modalities. Depending on whether using video-text pairs for pre-training, existing video-language models can be divided into two categories.

The main branch of works explicitly designs the spatial-temporal structure in video encoders, and pre-train with abundant video-text pairs to directly align videos and texts. Among these works, ALPRO (Li et al., 2022a), Frozen (Bain et al., 2021), and BridgeFormer (Ge et al., 2022) use WebVid2M (Bain et al., 2021) which contains 2.5M video-text pairs collected from the web for pre-training. Image-text pairs like CC3M (Sharma et al., 2018) and VG (Krishna et al., 2016) are also often used to enhance the spatial information in this alignment. NoiseEST (Amrani et al., 2021), VideoCLIP (Xu et al., 2021), and CLIP4Clip (Luo et al., 2021) pretrain the model with a large-scale dataset HowTo100M (Fan et al., 2019) which contains 136M video-text pairs. The other branch of works does not rely on video-text pre-training. Instead, they extend a pre-trained image-text model to extract video features, and directly fine-tune on downstream tasks. In ClipBERT (Lei et al., 2021), BLIP (Li et al., 2022b), and X-Pool (Gorti et al., 2022), each video is viewed as a collection of images, whose representations obtained from an image encoder are then used to represent the video for later interaction with the text.

In this section, we propose a method to efficiently extend an image-language pre-trained model to a video-language model, without pre-training on video-text pairs or the use of object detectors.

In Section 3.1, we first introduce the model architecture. Then we propose to enhance the temporal information in both model-wise and feature-wise manners. For model-wise enhancement, we propose to insert temporal attention layers with learnable scalings into the original image backbone (Section 3.2). For feature-wise enhancement, we design a non-parametric pooling method to learn fine-grained spatial-temporal video features conditioned on the text description (Section 3.3).

As is shown in the Figure 1, our framework contains three parts: a video encoder, a text encoder, and a video-grounded text encoder. We initialize our framework based on the recently proposed image-language model BLIP (Li et al., 2022b) trained over massive image-text pairs.

To enhance the temporal dependency of the video encoder, following TimeSformer (Bertasius et al., 2021), we insert additional temporal attention modules into the original BLIP image encoder, whose weights are initialized with the original spatial attention modules (Figure 1(a)). We use the Divided Space-Time Attention proposed in TimeSformer. We first compute the temporal attention by comparing each patch with the patches at the same spatial location in different frames, and then compute the spatial attention in each frame separately.

The text encoder is a BERT model, initialized with the original text encoder in BLIP. A [CLS] token is appended to the beginning of the text sequence. This unimodal text encoder uses bi-directional self-attention and uses the output embedding of the [CLS] token to summarize the text sequence.

This encoder shares the parameters with the unimodal text encoder. Moreover, to fuse the video features from the video encoder, one additional cross-attention layer is added between the self-attention layer and the feed-forward network for each transformer layer. Following BLIP (Li et al., 2022b), we also use a special [Encode] token before the text sequence, and its output embedding is used as the multimodal representation of the video-text pair.

We wish to preserve the spatial representation and its alignment with the text encoder learned by the image-language pre-trained model, as well as learn temporal expressivity for video-language tasks. As will be shown in Table 6, directly using TimeSformer yields better results than the original ViT. To provide more sufficient temporal expressiveness of the video encoder, we propose to learn a set of scalings that dynamically adjust the newly inserted temporal attention modules according to each specific task, as shown in Figure 1(b).

Specifically, denote the output feature after the temporal attention at the ll-th Transformer layer as VlTAttn∈RS×T×D{\bf V}_{l}^{\text{TAttn}}\in\mathbb{R}^{S\times T\times D}. For tt-th frame [VlTAttn]t∈RS×D[{\bf V}_{l}^{\text{TAttn}}]_{t}\in\mathbb{R}^{S\times D}, we add a learnable scaling factor αl,t∈R\alpha_{l,t}\in\mathbb{R} with a tanh-gating mechanism as:

αl,t=tanh(γl,t)+1,\alpha_{l,t}=\text{tanh}(\gamma_{l,t})+1,
(1)

where γl,t\gamma_{l,t} is a learnable scalar initialized at 00. Then the scaled output of temporal attention VlTAttn{\bf V}_{l}^{\text{TAttn}} is calculated as:

[VlTAttn]t=αl,t⋅[VlTAttn]t,[{\bf V}_{l}^{\text{TAttn}}]_{t}=\alpha_{l,t}\cdot[{\bf V}_{l}^{\text{TAttn}}]_{t},
(2)

before the residual connection. Note the [CLS] token is kept but not involved in the computation of scaling. The choice of tanh-gating ensures that αl,t\alpha_{l,t} ranges from 0 to 2. Initially, our model is equivalent to TimeSformer (i.e., αl,t\alpha_{l,t}=1, treat each frame equally), and then explicitly reweight the frames in each transformer block during the fine-tuning stage. When αl,t\alpha_{l,t} reduces to 0, the video encoder degenerates to the ViT used in the original BLIP model, which does not consider any temporal dependency in extracting the video features.

Before interacting with the textual modality via cross-attention or self-attention, previous methods directly concatenate the features from all frames with equal importance (Li et al., 2022b; Ge et al., 2022), or aggregate the video features with heuristic mean/max pooling methods spatially or temporally (Luo et al., 2021; Li et al., 2022a). However, not all frames or spatial positions are equally representative for the whole video, and different frames or positions have different semantic similarities to the textual query (e.g., textual description in text-video retrieval tasks or textual question in video question answering tasks. For example, given a video description “a golf player is trying to hit the ball into the pit”, the video encoder is expected to focus on the object of interest (i.e., ball) and the motion of hitting across the frames.

As illustrated in Figure 2, we design a non-parametric text-dependent pooling to reweight the video features spatially and temporally depending on the corresponding textual query, enabling fine-grained video-text alignment.

Figure 2
Figure 2: Illustration of text-dependent pooling. We reweight the pooled spatial and temporal video features based on the similarities between the normalized text feature tclsnorm{\bf t}_{cls}^{\text{norm}} and visual features Vft{\bf V}_{f_{t}} and Vfs{\bf V}_{f_{s}}.

Specifically, given a video with TT frames, each frame is pachified into SS patches, and a [CLS] token is inserted before the STST patches. Denote the original output embedding of the video encoder as VL∈R(1+ST)×D{\bf V}_{L}\in\mathbb{R}^{(1+ST)\times D}. Vft∈RT×D{\bf V}_{f_{t}}\in\mathbb{R}^{T\times D} and Vfs∈RS×D{\bf V}_{f_{s}}\in\mathbb{R}^{S\times D} are the video features pooled by averaging VL{\bf V}_{L} along the spatial and temporal dimension, respectively. Note that the feature of [CLS] token is not involved in averaging. Denote tcls∈RD{\bf t}_{cls}\in\mathbb{R}^{D} as the output embedding of the [CLS] token obtained from the text encoder.

Intuitively, the more similar a visual feature is to the text description, the more representative it is for understanding the content of the whole video. Thus we compute the similarity between the ℓ2\ell_{2} normalized features of each frame in Vftnorm{\bf V}_{f_{t}}^{\text{norm}} and the text feature tclsnorm{\bf t}_{cls}^{\text{norm}}, and reweight the features in Vft{\bf V}_{f_{t}} as:

gt=softmax(Vftnormtclsnorm/τ),\begin{aligned}\displaystyle{\bf g}_{t} & \displaystyle= & \displaystyle\text{softmax}({\bf V}_{f_{t}}^{\text{norm}}{\bf t}_{cls}^{\text{norm}}/\tau),\end{aligned}
(3)
V~ft=T⋅gt⊙Vft,\begin{aligned}\displaystyle\tilde{{\bf V}}_{f_{t}} & \displaystyle= & \displaystyle T\cdot{\bf g}_{t}\odot{\bf V}_{f_{t}},\end{aligned}

where ⊙\odot means element-wise multiplication, and τ\tau is the temperature which controls the sharpness of the weight distribution. We multiply the weights from the softmax function by the number of frames TT, such that the sum of total weights keeps the same as direct concatenation. Similarly, we compute the similarity between the ℓ2\ell_{2} normalized features of each spatial position in Vfsnorm{\bf V}_{f_{s}}^{\text{norm}} and the text feature tclsnorm{\bf t}_{cls}^{\text{norm}}, and reweight the features in Vfs{\bf V}_{f_{s}} as:

V~fs=S⋅softmax(Vfsnormtclsnorm/τ)⊙Vfs.\tilde{{\bf V}}_{f_{s}}=S\cdot\text{softmax}({\bf V}_{f_{s}}^{\text{norm}}{\bf t}_{cls}^{\text{norm}}/\tau)\odot{\bf V}_{f_{s}}.
(4)

The final aggregated video feature to be fed to the video-grounded text encoder is a concatenation of V~ft,V~fs\tilde{{\bf V}}_{f_{t}},\tilde{{\bf V}}_{f_{s}}, and the original video feature VL{\bf V}_{L}:

Vf=[V~ft,V~fs,VL].{\bf V}_{f}=[\tilde{{\bf V}}_{f_{t}},\tilde{{\bf V}}_{f_{s}},{\bf V}_{L}].
(5)
Remark 1.

Besides using the text to reweight the aggregated features after spatial pooling (i.e., Vft{\bf V}_{f_{t}}) and temporal pooling (i.e., Vfs{\bf V}_{f_{s}}), one simple baseline is to directly concatenate them with the original features VL{\bf V}_{L} to compose Vf{\bf V}_{f} as: Vf=[Vft,Vfs,VL]∈R(1+T+S+ST)×D.{\bf V}_{f}=[{\bf V}_{f_{t}},{\bf V}_{f_{s}},{\bf V}_{L}]\in\mathbb{R}^{(1+T+S+ST)\times D}. We dub it as vanilla pooling. Despite its simplicity, this pooling achieves competitive performance (Table 6).

Table 1
MethodsPre-Training DataMSRVTT-7kMSRVTT-9kDiDeMo
R1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrowR1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrowR1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrow
BLIP†14M33.655.564.8433.655.564.8435.658.466.43
BLIP384†14M30.852.262.2530.852.262.2531.658.265.83
BLIP14M42.568.279.3244.170.980.1251.378.184.61
LiteVLS_{S}-44.570.380.2246.771.881.7253.779.687.01
BLIP†129M41.463.372.8241.463.372.8240.063.172.42
BLIP384†129M40.562.871.4240.562.871.4237.361.769.43
BLIPcoco†{}_{\mathrm{coco}}^{\dagger}129M40.363.672.1240.363.672.1240.064.673.12
BLIPcoco384†{}_{\mathrm{coco}}^{\mathrm{384\dagger}}129M43.365.674.7243.365.674.7243.269.375.92
BLIP129M48.274.382.9249.774.783.8251.679.886.81
LiteVLL_{L}-48.974.583.6250.876.384.4153.480.787.01
LiteVLLcoco384{}_{L\mathrm{coco}}^{\mathrm{384}}-49.775.583.3251.575.985.7153.279.687.51
Table 1: Comparison of LiteVL and BLIP on text-video retrieval tasks. The default resolution is 224×\times224 per video frame, and the superscript “384” means increasing it to 384×\times384. The subscript “coco\mathrm{coco}” means training with an extra COCO retrieval dataset. †\dagger means zero-shot inference used in BLIP by default.
View original tableOriginal Table 1

After obtaining the aggregated video features Vf{\bf V}_{f}, we feed them to each cross-attention layer of the video-grounded text encoder. Consider a training batch with BB video-text pairs. For the kk-th video-text pair, denote the ℓ2\ell_{2} normalized output embeddings of the [CLS] tokens from the video encoder and the text encoder as vclsk{\bf v}^{k}_{cls} and tclsk{\bf t}^{k}_{cls} 1^{1}, respectively. The output embedding of the [Encode] token of the video-grounded text encoder is denoted as tenck{\bf t}^{k}_{enc}.

Contrastive learning alone has recently been found to learn better representations than its predictive counterpart in multi-modal pre-training (Radford et al., 2021). When used together with the predictive counterpart (Li et al., 2022a), it also boosts the performance. To align the video encoder and text encoder, we also utilize both the contrastive and predictive learning objectives. We apply contrastive learning over the output representations of the video encoder and the text encoder by optimizing a symmetric InfoNCE loss. The video-to-text contrastive loss Lv2t\mathcal{L}_{v2t} is:

Lv2t=−1B∑k=1Blog⁡exp⁡(vclsk⊤tclsk/τc)∑jexp⁡(vclsk⊤tclsj/τc),{\mathcal{L}}_{v2t}=-\frac{1}{B}\sum^{B}_{k=1}\log\frac{\exp({\bf v}^{k\top}_{cls}{\bf t}^{k}_{cls}/\tau_{c})}{\sum_{j}\exp({\bf v}^{k\top}_{cls}{\bf t}^{j}_{cls}/\tau_{c})},

where τc\tau_{c} is a learnable temperature parameter initialized as 0.07. Similarly, the text-to-video contrastive loss Lt2v\mathcal{L}_{t2v} is:

Lt2v=−1B∑k=1Blog⁡exp⁡(vclsk⊤tclsk/τc)∑jexp⁡(vclsj⊤tclsk/τc).{\mathcal{L}}_{t2v}=-\frac{1}{B}\sum^{B}_{k=1}\log\frac{\exp({\bf v}^{k\top}_{cls}{\bf t}^{k}_{cls}/\tau_{c})}{\sum_{j}\exp({\bf v}^{j\top}_{cls}{\bf t}^{k}_{cls}/\tau_{c})}.

The video-text contrastive loss is defined as:

Lvtc=12(Lv2t+Lt2v).{\mathcal{L}}_{\mathrm{vtc}}=\frac{1}{2}({\mathcal{L}}_{v2t}+{\mathcal{L}}_{t2v}).
(6)

Following Li et al. (2022a), besides the contrastive loss, we also use a video-text matching loss Lvtm{\mathcal{L}}_{\mathrm{vtm}}, which predicts whether a pair of video and text is matched or not. For the kk-th video-text pair, we map the joint video-text embedding tenck{\bf t}_{enc}^{k} to a two-class probability pvtmk{\bf p}_{vtm}^{k}, and calculate Lvtm{\mathcal{L}}_{\mathrm{vtm}} as:

Lvtm=1B∑k=1BCE(yvtmk,pvtmk),{\mathcal{L}}_{\mathrm{vtm}}=\frac{1}{B}\sum^{B}_{k=1}\mathrm{CE}({\bf y}_{vtm}^{k},{\bf p}_{vtm}^{k}),
(7)

where yvtmk{\bf y}_{vtm}^{k} is a 2-dimensional one-hot vector representing the ground-truth label, and CE(⋅,⋅)\mathrm{CE}(\cdot,\cdot) is cross-entropy loss. The in-batch negatives used for Lvtm{\mathcal{L}}_{\mathrm{vtm}} are mined based on the contrastive similarity following Li et al. (2021). The overall training objective is:

Lretrieval=Lvtc+Lvtm.{\mathcal{L}}_{\mathrm{retrieval}}={\mathcal{L}}_{\mathrm{vtc}}+{\mathcal{L}}_{\mathrm{vtm}}.
(8)

Following Fan et al. (2019), we view video question answering as a multimodal classification task and add a two-layer MLP classification head on the multimodal [Encode] token. Assume the number of answers is KK, for the kk-th video-text pair, we map the joint video-text embedding tenck{\bf t}_{enc}^{k} to a KK-class probability pansk{\bf p}_{ans}^{k}, the training objective for video question answering is:

LVideoQA=1B∑k=1BCE(yansk,pansk),{\mathcal{L}}_{\mathrm{VideoQA}}=\frac{1}{B}\sum^{B}_{k=1}\mathrm{CE}({\bf y}_{ans}^{k},{\bf p}_{ans}^{k}),
(9)

where yansk{\bf y}_{ans}^{k} is a KK-dimensional one-hot classification label.

In this section, we evaluate the efficacy of the proposed LiteVL on the text-video retrieval and video question answering (VideoQA) tasks. We initialize the weights of LiteVL from BLIP  (Li et al., 2022b), which uses a ViT-B/16 as the image encoder, a BERTbase_{base} as the text encoder with additional cross-attention layers for the image-grounded text encoder. We use both BLIP variants pre-trained on 14M and 129M image-text pairs, respectively, and the corresponding LiteVL initialized from them are dubbed as LiteVLS_{S} and LiteVLL_{L}, respectively.

During fine-tuning, we randomly sample 8 and 16 frames per video for retrieval and VideoQA tasks, respectively. While in the inference stage, the frames are uniformly sampled. Following previous works (Ge et al., 2022; Gorti et al., 2022) and BLIP’s pre-training setting, we resize each of the raw frames to 224×\times224 before feeding them into the model. For the text-dependent pooling, the temperature τ\tau in Eq.(3) is set to 1.0 by default. More detailed training details and hyperparameters are in Appendix A.

We finetune on two text-video retrieval datasets: (i) MSRVTT (Xu et al., 2016) consists of 10k videos and 200k text captions. Each video is paired with about 20 manually-labeled captions, and lasts about 10 to 32 seconds. There are two widely used ways to split the dataset, i.e., MSRVTT-7k (Miech et al., 2019) and MSRVTT-9k (Gabeur et al., 2020), which have 7k videos and 9k videos for training, respectively. For a comprehensive comparison with previous works, we use both splits that share the same 1k testing videos (Bain et al., 2021). (ii) DiDeMo (Hendricks et al., 2017) consists of 10k Flickr videos annotated with 40k text captions. We evaluate text-video retrieval following Lei et al. (2021), where all captions for the same video are concatenated into a single query.

We evaluate text-video retrieval by R@k and MdR following Bain et al. (2021). R@k means the recall (%) through k retrieval efforts. MdR represents the median rank of the retrieved video.

Previous BLIP concatenates the image features of all frames as the aggregated video feature and feeds it to the image-grounded text encoder. In Table 1, we show the comparison between our proposed LiteVL and the original BLIP as well as its variants with increased resolution (i.e., 384×\times384), pre-training on COCO (Lin et al., 2014) and fine-tuning setting. As can be seen, though inherited from the BLIP model, our proposed LiteVL clearly outperforms the original BLIP due to the explicit temporal modeling in both model-wise and feature-wise manners. In particular, LiteVLS_{S} improves the R1 of the best-performed BLIP (14M) variant by 2.0, 2.6, and 2.4 points on MSRVTT-7k, MSRVTT-9k, and DiDeMo, respectively.

Table 2
MethodsR1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrow
NoiseEST (Amrani et al., 2021)17.441.653.68
ClipBERT (Lei et al., 2021)22.046.859.96
VideoClip (Xu et al., 2021)30.955.466.8-
ALPRO (Li et al., 2022a)33.960.773.23
CLIP4Clip (Luo et al., 2021)42.171.981.42
BLIP† (Li et al., 2022b)43.365.674.72
X-Pool (Gorti et al., 2022)43.972.582.32
LiteVLS_{S}44.570.380.22
LiteVLL_{L}48.974.583.62
Table 2: Results of text-video retrieval on the test split of MSRVTT-7k. †\dagger means zero-shot results reported by the original BLIP paper.
View original tableOriginal Table 2
Table 3
MethodsR1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrow
CE (Liu et al., 2019)20.948.862.46
Frozen (Bain et al., 2021)31.059.570.53
BridgeFormer (Ge et al., 2022)37.664.875.13
CLIP4Clip (Luo et al., 2021)44.571.481.62
BLIP† (Li et al., 2022b)43.365.674.72
X-Pool (Gorti et al., 2022)46.972.882.22
LiteVLS_{S}46.771.881.72
LiteVLL_{L}50.876.384.41
Table 3: Results of text-video retrieval on the test split of MSRVTT-9k dataset.
View original tableOriginal Table 3
Table 4
MethodsR1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrow
CE (Liu et al., 2019)16.141.182.78
ClipBERT (Lei et al., 2021)20.448.060.86
Frozen (Bain et al., 2021)34.665.074.73
ALPRO (Li et al., 2022a)35.967.578.83
BridgeFormer (Ge et al., 2022)37.062.273.93
CLIP4Clip (Luo et al., 2021)43.470.280.62
LiteVLS_{S}53.779.687.01
LiteVLL_{L}53.480.787.01
Table 4: Results of text-video retrieval on the test split of DiDeMo dataset.
View original tableOriginal Table 4

Table 2, Table 3 and Table 4 show the comparison between LiteVL and recent methods on text-video retrieval on MSRVTT-7k, MSRVTT-9k and DiDeMo, respectively. On all three datasets, LiteVL surpasses previous works by a clear margin, including methods requiring heavy video-text pre-training (e.g., ALPRO, CLIP4Clip and BridgeFormer) or based on image-language pre-trained models (e.g., ClipBERT and X-Pool). Note that X-Pool also uses a parametric text-dependent pooling method to aggregate video features from an image-language pre-trained model. However, our proposed LiteVL still outperforms it with the simpler non-parametric similarity-based text-dependent pooling and the proposed dynamic scaling. Besides, LiteVLL_{L} performs significantly better than LiteVLS_{S} on both splits of MSRVTT, and similarly on DiDeMo. This indicates that the general multimodal priors learned from a large-scale image-text dataset can also benefit text-video retrieval tasks.

(i) MSRVTT-QA (Xu et al., 2017) consists of 10k videos, 243k open-ended questions, and 1.5k answer candidates based on MSRVTT. (ii) MSVD-QA (Xu et al., 2017) is based on MSVD (Chen and Dolan, 2011), and includes 1,970 videos, 50k question-answer pairs, and 2,423 answer candidates. We use top-1 accuracy (%) as the evaluation metric. For both datasets, we use the same train/val/test splits as Xu et al. (2017), and select the model with the highest accuracy on the validation set for testing.

Table 5
MethodsMSRVTT-QAMSVD-QA
HME (Fan et al., 2019)33.033.7
HGA (Jiang and Han, 2020)35.534.7
ClipBERT (Lei et al., 2021)37.4-
SSML (Amrani et al., 2021)35.135.1
CoMVT (Seo et al., 2021)39.542.6
VQA-T (Yang et al., 2021)41.546.3
ALPRO (Li et al., 2022a)42.145.9
LiteVLS_{S} (Ours)42.947.3
LiteVLL_{L} (Ours)42.542.9
Table 5: Top-1 accuracy (%) of VideoQA on the test set of MSRVTT-QA and MSVD-QA.
View original tableOriginal Table 5

In Table 5, we compare our proposed LiteVL with existing methods on the open-ended video question answering datasets MSRVTT-QA and MSVD-QA. Again, LiteVL outperforms all the compared methods, including VQA-T (Yang et al., 2021) pre-trained with 69M VideoQA samples and the recent ALPRO pre-trained with 5.5M video-text pairs. Instead, LiteVL requires no general or QA-related video-text pre-training. Interestingly, LiteVLL_{L} is initialized from BLIP pre-trained on more image-text pairs than LiteVLS_{S}, but performs worse on two VideoQA tasks. We speculate this is because the additional 115M image-text pairs used to train BLIP (129M) crawled from the web or filtered by BLIP captioner are noisy and may bias towards the captioner. This may mislead the VideoQA task which requires more precise multimodal reasoning to answer questions than retrieval task.

Table 6
MethodsMSRVTT-7kDiDeMoMSVD-QA
R1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrowR1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrowAcc.↑\uparrow
LiteVLS_{S}44.570.380.2253.779.687.0147.3
Dynamic Temporal Scaling
w/o Scaling (αt,l=1\alpha_{t,l}=1)44.469.479.5252.880.387.0147.1
w/o Temporal attention (αt,l=0\alpha_{t,l}=0)42.868.679.4251.778.585.6145.5
Text-dependent Pooling
Original features42.868.879.8251.477.985.7145.3
Original features + Temporal pooling43.069.579.8252.279.186.5146.3
Original features + Spatial pooling43.069.179.5251.778.985.9145.9
Original features + Temporal pooling + Spatial pooling43.669.879.8252.379.386.5146.4
Table 6: Ablation studies on dynamic temporal scaling and text-dependent pooling of the proposed LiteVL.
View original tableOriginal Table 6

In Table 6, we compare the proposed dynamic temporal scaling against using (i) constant scaling αl,t=1\alpha_{l,t}=1 in Eq.(2), which reduces to directly using TimeSformer as the video encoder; and (ii) constant scaling αl,t=0\alpha_{l,t}=0 in Eq.(2), which reduces to using the ViT image encoder as the video encoder. As can be seen, the proposed dynamic scaling learned upon each task performs better than the two special cases. By adopting TimeSformer (αl,t=1\alpha_{l,t}=1) instead of ViT (αl,t=0\alpha_{l,t}=0), the performance is boosted since the temporal dependency is considered via the additional temporal attention module. With the proposed lightweight temporal scaling to adjust the frame-level importance according to each specific task, the performance is further improved.

Figure 3
Figure 3: Average temporal scalings γl,t\gamma_{l,t} for different frames of each layer in the video encoder of LiteVLS_{S} trained on different tasks.

As shown in Figure 3, we visualize the average of the learned scalings γl,t\gamma_{l,t} of each layer in the video encoder for both retrieval (i.e., MSRVTT-7k, MSRVTT-9k) and VideoQA (i.e., MSRVTT-QA, MSVD-QA) tasks. For all datasets, the average scaling is lower than 0 at the first layer and then shows an upward trend as the depth increases. This indicates that the shallow layers focus more on understanding the content of each frame, and pay less attention to temporal dependency among different frames. When the depth increases, the spatial feature of each frame becomes more global  (Dosovitskiy et al., 2021), and the model gradually seeks to learn the temporal dependencies among them.

In Table 6, we compare our proposed text-dependent pooling in Section 3.3 against several baseline pooling methods using different combinations of the original features Vf{\bf V}_{f}, spatially pooled features Vft{\bf V}_{f_{t}} and temporally pooled features Vfs{\bf V}_{f_{s}}. As can be seen, compared with using only the original features, using either additional spatially or temporally pooled features improves the performance, and combining both of them further boosts performance. When coupled with the reweighting mechanism in Section 3.3, our proposed LiteVL obtains the best performance.

In addition, since the visually or temporally pooled features have much smaller sizes than the original features, using them merely increases the computation or memory cost of the cross-attention module of the video-grounded text encoder. The extra computation or memory cost incurred here is theoretically relatively acceptable.

We vary the temperature τ\tau between 0.01 and 5.0 of the text-dependent pooling to study the effect of the temperature in the text-dependent pooling. As is shown in Table 7, when τ\tau equals 1.0, both text-video retrieval and video question answering achieve the best performance. Therefore, the temperature τ\tau of this pooling method is set to 1.0 for all datasets by default.

Table 7
Pooling Methodsτ\tauMSRVTT-7kDiDeMoMSVD-QA
R1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrowR1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrowAcc.↑\uparrow
0.018.224.735.1236.723.534.23227.4
Text-dependent pooling0.144.369.779.0252.180.086.9146.1
1.044.469.479.5252.880.387.0147.1
2.043.969.179.0252.379.886.1146.3
5.044.169.378.7250.779.686.3146.4
Table 7: Effect of different temperatures (τ\tau) in the text-dependent pooling on LiteVLS_{S}.
View original tableOriginal Table 7
Table 8
MethodsMSRVTT-7kMSRVTT-9kDiDeMo
R1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrowR1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrowR1↑\uparrowR5↑\uparrowR10↑\uparrowMdR↓\downarrow
LiteVLS_{S}44.570.380.2246.771.881.7253.779.687.01
w/ top-kk44.369.980.1246.472.081.1253.579.587.11
LiteVLL_{L}48.974.583.6250.876.384.4153.480.787.01
w/ top-kk48.475.482.5250.576.584.1152.379.286.81
Table 8: Effect of using svtcs_{\mathrm{vtc}} to filter top-kk (kk=100) candidates and calculate their svtms_{\mathrm{vtm}} score for ranking.
View original tableOriginal Table 8

To better understand the effect of text-dependent pooling, we use LiteVLS_{S} to visualize the video-text pair from MSRVTT-7k testing set and their corresponding temporal weights (gt{\bf g}_{t} in Eq.(3)). As show in Figure 4, when the changes among different frames are relatively large, the proposed text-dependent pooling encourages the model to assign higher weights to frames better described by the caption. For instance, in the first example, the second and fourth frames are more related to the caption ‘‘Three kids sing together on the voice.’’ and assigned higher weights.

Figure 4
Figure 4: Bar plots of temporal weights in text-dependent pooling. Video frames more related to the caption are assigned with higher weights.
Figure 5
Figure 5: Grad-CAM visualizations on the cross-attention maps corresponding to highlighted keywords.

On the contrary, as can be seen from the last two examples in Figure 4, when the different frames only differ in minor changes and each frame is similarly close to the caption, the learned weights for each frame are also similar. For these cases, we further study the more fine-grained spatial-temporal dependencies using the Grad-CAM (Selvaraju et al., 2017) visualizations. We compute Grad-CAM using the cross-attention maps averaged over all attention heads in the 8-th layer (a specialized layer in grounding) of the video-grounded text encoder. The gradients are acquired by maximizing the video-text matching score in Eq.(7). As can be seen in Figure 5, the proposed LiteVL effectively captures the minor changes among different frames. This also indicates that our proposed text-dependent pooling provides fruitful information for the video-grounded text encoder. More visualizations are in Appendix C.

In this work, we choose BLIP to initialize our proposed model mainly because (i) it performs well on various downstream image-language tasks; and (ii) it can be regarded as a single-stream and dual-stream hybrid structure. Its dual-stream part allows efficient inference for cross-modal retrieval tasks, while its cross-attention allows deep cross-modal interaction for tasks like VQA.

On the other hand, the proposed dynamic temporal scaling and text-dependent pooling can also be applied to the dual-stream model like CLIP (Radford et al., 2021). For this setting, we also conduct a simple experiment. For CLIP, we use the proposed text-dependent pooling on top of the video features. As CLIP relies on the global features for retrieval, instead of concatenation in Eq.(5), we compute a weighted average of the reweighted features. Compared with a recent work CLIP4Clip which also extends CLIP for video retrieval, CLIP with our proposed method improves the best CLIP4Clip-meanP method by 1.9% and 1.7%, for the R1 and R10 on MSRVTT-7k, respectively.

Since the test set sizes for all three retrieval datasets used in this work are relatively small, we compute a pairwise VTM score svtms_{\mathrm{vtm}} for all video-text pairs during inference. However, the speed of inference in this approach will be slow when the size of dataset is huge in real-world scenarios.

In this section, we provide a more efficient retrieval solution. Specifically, we first compute the video-text similarity score svtcs_{\mathrm{vtc}} for all video-text pairs, then we take the top-kk candidates and calculate their VTM score for ranking. Such method can speed up inference, because the kk can be set to be very small compared with the test set size. Table 8 shows that using this efficient two-stage retrieval solution has negligible performance degradation.

We propose LiteVL, a video-language model without heavy video-language pre-training or object detectors. LiteVL inherits the already-learned alignment between the spatial visual information and textual information, from a pre-trained image-language model. Then, an extra temporal attention with dynamic temporal scaling is proposed to learn the temporal dynamics in the video. We also introduce a non-parametric pooling method which aggregates video features conditioned on the text description, enabling fine-grained video-language alignment. Empirical results show that our LiteVL outperforms the state-of-the-art methods trained with much more training data.

We gratefully acknowledge the support of  MindSpore ()2^{2} and Ascend AI Processor for this research.

Although LiteVL achieves great performance without the video-language pre-training, it is interesting to explore how to combine a few video-language pairs from the pre-training datasets to further boost the performance. In addition, we view VideoQA as a classification task, which may be limited to a fixed number of answer candidates. In the future, we would like to generation ability of the proposed LiteVL on more diverse long-form visual question answering datasets.

During the training process, the knowledge from the inherited image-text pre-trained models and the training data may have unsuitable information. Therefore, our trained models are possibly exposed to the similar risks of large language models as mentioned in Weidinger et al. (2021). Thanks to Thoppilan et al. (2022), harmful training data can be filtered to improve the safety of our model. On the other hand, there is no generative task involved in our video-text understanding framework, which means our framework will not output offensive language.

Before deploying the models in real-world applications, risk analysis is necessary since the used data may contain some unintended privacy information and improper video/text that do not conform to social norms.

References

  1. Amrani et al. (2021) Elad Amrani, Rami Ben-Ari, Daniel Rotman, and Alex M. Bronstein. 2021. Noise estimation using density estimation for self-supervised multimodal learning. In AAAI.Source
  2. Arnab et al. (2021) Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Lucic, and Cordelia Schmid. 2021. Vivit: A video vision transformer. In ICCV.Source
  3. Bain et al. (2021) Max Bain, Arsha Nagrani, Gül Varol, and Andrew Zisserman. 2021. Frozen in time: A joint video and image encoder for end-to-end retrieval. In ICCV.Source
  4. Bertasius et al. (2021) Gedas Bertasius, Heng Wang, and Lorenzo Torresani. 2021. Is space-time attention all you need for video understanding? In ICML.Source
  5. Chen and Dolan (2011) David L. Chen and William B. Dolan. 2011. Collecting highly parallel data for paraphrase evaluation. In ACL.Source
  6. Chen et al. (2020) Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. 2020. Uniter: Universal image-text representation learning. In ECCV.Source
  7. Cubuk et al. (2020) Ekin Dogus Cubuk, Barret Zoph, Jonathon Shlens, and Quoc Le. 2020. Randaugment: Practical automated data augmentation with a reduced search space. In NeurIPS.Source
  8. Devlin et al. (2019) Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: pre-training of deep bidirectional transformers for language understanding. In NAACL.Source
  9. Dosovitskiy et al. (2021) Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. 2021. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR.Source
  10. Fan et al. (2019) Chenyou Fan, Xiaofan Zhang, Shu Zhang, Wensheng Wang, Chi Zhang, and Heng Huang. 2019. Heterogeneous memory enhanced multimodal attention model for video question answering. In CVPR.Source
  11. Gabeur et al. (2020) Valentin Gabeur, Chen Sun, Karteek Alahari, and Cordelia Schmid. 2020. Multi-modal transformer for video retrieval. In ECCV.Source
  12. Ge et al. (2022) Yuying Ge, Yixiao Ge, Xihui Liu, Dian Li, Ying Shan, Xiaohu Qie, and Ping Luo. 2022. Bridgeformer: Bridging video-text retrieval with multiple choice questions. In CVPR.Source
  13. Gorti et al. (2022) Satya Krishna Gorti, Noel Vouitsis, Junwei Ma, Keyvan Golestan, Maksims Volkovs, Animesh Garg, and Guangwei Yu. 2022. X-pool: Cross-modal language-video attention for text-video retrieval. In CVPR.Source
  14. Han et al. (2021) Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang. 2021. Transformer in transformer. In NeurIPS.Source
  15. Hendricks et al. (2017) Lisa Anne Hendricks, Oliver Wang, Eli Shechtman, Josef Sivic, Trevor Darrell, and Bryan C. Russell. 2017. Localizing moments in video with natural language. In ICCV.Source
  16. Jiang and Han (2020) Pin Jiang and Yahong Han. 2020. Reasoning with heterogeneous graph alignment for video question answering. In AAAI.Source
  17. Krishna et al. (2016) Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A. Shamma, Michael S. Bernstein, and Li Fei-Fei. 2016. Visual genome: Connecting language and vision using crowdsourced dense image annotations. CoRR, abs/1602.07332.Source
  18. Lei et al. (2021) Jie Lei, Linjie Li, Luowei Zhou, Zhe Gan, Tamara L. Berg, Mohit Bansal, and Jingjing Liu. 2021. Less is more: Clipbert for video-and-language learning via sparse sampling. In CVPR.Source
  19. Li et al. (2022a) Dongxu Li, Junnan Li, Hongdong Li, Juan Carlos Niebles, and Steven C. H. Hoi. 2022a. Align and prompt: Video-and-language pre-training with entity prompts. In CVPR.Source
  20. Li et al. (2022b) Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi. 2022b. BLIP: bootstrapping language-image pre-training for unified vision-language understanding and generation. In ICML.Source
  21. Li et al. (2021) Junnan Li, Ramprasaath R. Selvaraju, Akhilesh Gotmare, Shafiq R. Joty, Caiming Xiong, and Steven Chu-Hong Hoi. 2021. Align before fuse: Vision and language representation learning with momentum distillation. In NeurIPS.Source
  22. Lin et al. (2014) Tsung-Yi Lin, Michael Maire, Serge J. Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C. Lawrence Zitnick. 2014. Microsoft COCO: common objects in context. In ECCV.Source
  23. Liu et al. (2019) Yang Liu, Samuel Albanie, Arsha Nagrani, and Andrew Zisserman. 2019. Use what you have: Video retrieval using representations from collaborative experts. In BMVC.Source
  24. Liu et al. (2021) Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. 2021. Swin transformer: Hierarchical vision transformer using shifted windows. In ICCV.Source
  25. Luo et al. (2020) Huaishao Luo, Lei Ji, Botian Shi, Haoyang Huang, Nan Duan, Tianrui Li, Xilin Chen, and Ming Zhou. 2020. Univilm: A unified video and language pre-training model for multimodal understanding and generation. CoRR, abs/2002.06353.Source
  26. Luo et al. (2021) Huaishao Luo, Lei Ji, Ming Zhong, Yang Chen, Wen Lei, Nan Duan, and Tianrui Li. 2021. Clip4clip: An empirical study of CLIP for end to end video clip retrieval. CoRR, abs/2104.08860.Source
  27. Miech et al. (2019) Antoine Miech, Dimitri Zhukov, Jean-Baptiste Alayrac, Makarand Tapaswi, Ivan Laptev, and Josef Sivic. 2019. Howto100m: Learning a text-video embedding by watching hundred million narrated video clips. In ICCV.Source
  28. (28) MindSpore. https://www.mindspore.cn. 2021.Source
  29. Radford et al. (2021) Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. 2021. Learning transferable visual models from natural language supervision. In ICML.Source
  30. Selvaraju et al. (2017) Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. 2017. Grad-cam: Visual explanations from deep networks via gradient-based localization. In ICCV.Source
  31. Seo et al. (2021) Paul Hongsuck Seo, Arsha Nagrani, and Cordelia Schmid. 2021. Look before you speak: Visually contextualized utterances. In CVPR.Source
  32. Sharma et al. (2018) Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. 2018. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In ACL.Source
  33. Sun et al. (2019) Chen Sun, Austin Myers, Carl Vondrick, Kevin Murphy, and Cordelia Schmid. 2019. Videobert: A joint model for video and language representation learning. In ICCV.Source
  34. Thoppilan et al. (2022) Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, et al. 2022. Lamda: Language models for dialog applications. CoRR, abs/2201.08239.Source
  35. Touvron et al. (2021) Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. 2021. Training data-efficient image transformers & distillation through attention. In ICML.Source
  36. Vaswani et al. (2017) Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention is all you need. In NeurIPS.Source
  37. Wang et al. (2021) Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. 2021. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. In ICCV.Source
  38. Weidinger et al. (2021) Laura Weidinger, John Mellor, Maribeth Rauh, Conor Griffin, Jonathan Uesato, Po-Sen Huang, Myra Cheng, Mia Glaese, Borja Balle, Atoosa Kasirzadeh, et al. 2021. Ethical and social risks of harm from language models. CoRR, abs/2112.04359.Source
  39. Xu et al. (2017) Dejing Xu, Zhou Zhao, Jun Xiao, Fei Wu, Hanwang Zhang, Xiangnan He, and Yueting Zhuang. 2017. Video question answering via gradually refined attention over appearance and motion. In ACM MM.Source
  40. Xu et al. (2021) Hu Xu, Gargi Ghosh, Po-Yao Huang, Dmytro Okhonko, Armen Aghajanyan, Florian Metze, Luke Zettlemoyer, and Christoph Feichtenhofer. 2021. Videoclip: Contrastive pre-training for zero-shot video-text understanding. In EMNLP.Source
  41. Xu et al. (2016) Jun Xu, Tao Mei, Ting Yao, and Yong Rui. 2016. MSR-VTT: A large video description dataset for bridging video and language. In CVPR.Source
  42. Yang et al. (2021) Antoine Yang, Antoine Miech, Josef Sivic, Ivan Laptev, and Cordelia Schmid. 2021. Just ask: Learning to answer questions from millions of narrated videos. In ICCV.Source
  43. Zhu and Yang (2020) Linchao Zhu and Yi Yang. 2020. Actbert: Learning global-local video-text representations. In CVPR.Source

We list the detailed fine-tuning setups on each dataset in Table 9 and Table 10. For all downstream datasets, we resize each frame to 224×\times224 unless otherwise stated. Following ALPRO (Li et al., 2022a), we randomly select NvN_{v} frames from the video, with parameters Nv2\frac{N_{v}}{2} frames from the first and second half of the video, respectively. We use RandomAugment (Cubuk et al., 2020) on the frames sampled from each video. For all experiments, we use the same random seed (e.g., 42) to ensure reproduction.

Table 9
ConfigMSRVTTDiDeMo
OptimizerAdamWAdamW
Init learning rate (lr)2.5e-54e-5
Scaling learning rate1.25×\timeslr1.25×\timeslr
Weight decay1e-31e-3
Optimizer momentumβ1,β2\beta_{1},\beta_{2}=0.9,0.98β1,β2\beta_{1},\beta_{2}=0.9,0.98
Lr schedulelinear decaylinear decay
Warmup ratio0.10.1
Batch size6496
Init τc\tau_{c}0.070.07
Text length4050
Frame number88
Training epochs510
AugmentationRandAug(2,5)RandAug(2,5)
Table 9: Experimental setup for MSRVTT (both 7k and 9k splits) and DiDeMo text-video retrieval.
View original tableOriginal Table 9
Table 10
ConfigMSRVTT-QAMSVD-QA
OptimizerAdamWAdamW
Init learning rate (lr)5e-55e-5
Scaling learning rate1.25×\timeslr1.0×\timeslr
Weight decay1e-31e-3
Optimizer momentumβ1,β2\beta_{1},\beta_{2}=0.9,0.98β1,β2\beta_{1},\beta_{2}=0.9,0.98
Lr schedulelinear decaylinear decay
Warmup ratio0.10.1
Batch size9696
Init τc\tau_{c}0.070.07
Text length4040
Frame number1616
Training epochs1015
AugmentationRandAug(2,5)RandAug(2,5)
Table 10: Experimental setup for fientuning on MSRVTT-QA and MSVD-QA.
View original tableOriginal Table 10

Table 11
MethodsPooling MethodVideo EncoderText EncoderPre-training Data
HT100M Miech et al. (2019)Temporal2D/3D CNNword2vecHowTo100M
NoiseEST. (Amrani et al., 2021)Temporal2D/3D CNNword2vecHowto100M
ClipBERT (Lei et al., 2021)Temporal2D CNNBERTCOCO, VG
VideoClip (Xu et al., 2021)Global (Average)3D CNN (S3D)BERTHowTo100M
ALPRO (Li et al., 2022a)TemporalTimeSformerBERTCC3M, WebVid2M
CLIP4Clip (Luo et al., 2021)TemporalViT (CLIP)BERT (CLIP)HowTo100M
BLIP (Li et al., 2022b)OriginalViTBERTCOCO,VG,CC3M,CC12M,SBU
Frozen (Bain et al., 2021)Global ([CLS])TimeSformerDistilBERTCC3M,WebVid2M
BridgeFormer (Ge et al., 2022)OriginalViTDistilBERTCC3M,WebVid2M
VQA-T (Yang et al., 2021)Global ([CLS])3D CNNDistilBERTHowToVQA69M
LiteVL (Ours)Spatial + Temporal + OriginalTimeSformerBERT-
Table 11: Comparison between previous works with ours in terms of pooling method, video encoder, text encoder and pre-training dataset. The pooling method refers to the way to aggregate the video feature based on the original video feature VL∈R(1+ST)×D{\bf V}_{L}\in\mathbb{R}^{(1+ST)\times D} (Original), before the alignment with text feature. “Spatial” and “Temporal” denote the spatially-pooled feature Vft∈RT×D{\bf V}_{f_{t}}\in\mathbb{R}^{T\times D}, and temporally-pooled Vfs∈RS×D{\bf V}_{f_{s}}\in\mathbb{R}^{S\times D} from VL{\bf V}_{L}.
View original tableOriginal Table 11

To align video and text features, previous approaches can be generally divided into two categories. On the one hand, common dual-stream models CLIP4Clip (Luo et al., 2021) fuse global video feature from global mean pooling or the [CLS] token, and then interact fused video feature with text feature based on a simple multilayer perceptron head on the top. On the other hand, the cross-attention module is adopted where the key/value are obtained from the aggregated video feature, and the query is obtained from the text feature. Previous methods mainly use two ways to aggregate the original output video features VL{\bf V}_{L} into Vf{\bf V}_{f} in the video-grounded text encoder: (i) keep the original features without modification; (ii) apply mean pooling over the spatial or temporal dimension.

We provide a more detailed comparison with related works in Table 11. We list how previous works extract the video features used for the alignment with text features. In addition, the video encoder, text encoder, and pre-training data used by differnt methods are also provided.

We provide more visualizations of temporal weights gt\bf{g}_{t} in Figure 6. To better understand how text-dependent pooling affects the decision, we take a closer look at when the proposed text-dependent pooling changes the decision over vanilla pooling (Remark 1). We find that the temporal weights of the changed decisions have a clearly higher standard deviation than the unchanged ones, indicating that text-dependent pooling tends to change the decisions when the different frames are more dissimilar. For instance, for the first case in Figure 6, its caption ‘‘The girl shows the boys her medal in this cartoon’’ is mainly related to the middle two frames. By assigning higher importance to these two frames, the proposed text-dependent pooling makes a correct decision while the vanilla pooling fails.

Figure 6
Figure 6: Bar plot of temporal weights learned by the text-dependent pooling.