arXiv(opens in a new tab)cs.CVApr 2021Cited by 5 papers on PaperVantage

Manuscript Offprint

arXiv:2104.00650

Frozen in Time: A Joint Video and Image Encoder for End-to-End Retrieval

Max Bain, Arsha Nagrani, Gül Varol, Andrew Zisserman

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Max Bain 1^{1} Arsha Nagrani 1†^{1\dagger} Gül Varol 1,2^{1,2} Andrew Zisserman 1^{1}

1^{1} Visual Geometry Group, University of Oxford

2^{2} LIGM, École des Ponts, Univ Gustave Eiffel, CNRS

{maxbain, arsha, gul, az}@robots.ox.ac.uk

Figure

Figure 1: Joint Image and Video Training: Our dual encoding model consists of a visual encoder for images and video and a text encoder for captions. Unlike 2D or 3D CNNs, our space-time transformer encoder allows us to train flexibly on both images and videos with captions jointly, by treating an image as a single frame video.

Abstract

Our objective in this work is video-text retrieval – in particular a joint embedding that enables efficient text-to-video retrieval. The challenges in this area include the design of the visual architecture and the nature of the training data, in that the available large scale video-text training datasets, such as HowTo100M, are noisy and hence competitive performance is achieved only at scale through large amounts of compute.

We address both these challenges in this paper. We propose an end-to-end trainable model that is designed to take advantage of both large-scale image and video captioning datasets. Our model is an adaptation and extension of the recent ViT and Timesformer architectures, and consists of attention in both space and time. The model is flexible and can be trained on both image and video text datasets, either independently or in conjunction. It is trained with a curriculum learning schedule that begins by treating images as 'frozen' snapshots of video, and then gradually learns to attend to increasing temporal context when trained on video datasets. We also provide a new video-text pretraining dataset WebVid-2M, comprised of over two million videos with weak captions scraped from the internet. Despite training on datasets that are an order of magnitude smaller, we show that this approach yields state-of-the-art results on standard downstream video-retrieval benchmarks including MSR-VTT, MSVD, DiDeMo and LSMDC.

1. Introduction

Joint visual-text models have become increasingly popular as they enable a wide suite of downstream tasks, including text-to-visual retrieval [36, 38, 43, 66], visual captioning [29, 65, 73], and visual question and answering [4, 33]. Their rapid development is due to the usual improvements on three fronts: new neural network architectures (e.g. transformers [63] for both text and visual inputs); new

†^{\dagger}Now at Google Research.

large-scale datasets; and new loss functions that are, for example, able to handle label noise [42]. However, their development mostly proceeds on two independent tracks: one for images, with its own architectures, training datasets and benchmarks [30, 36, 59]; and the other for videos with a similar separation of training datasets and benchmarks [3, 5, 29, 53, 72, 78]. The only common link between the two is that often video networks are initialized by pre-training image networks on image datasets [6, 8]. This separation of effort is suboptimal given the overlap in information that images and video convey over multiple tasks. For example, although classifying some human actions requires the temporal ordering of video frames, many actions can be classified from just their distribution over frames or even from a single frame [58].

In this paper we take a step towards unifying these two tracks, by proposing a dual encoder architecture which utilises the flexibility of a transformer visual encoder to train from images-with-captions, from video clips-with-captions, or from both (Fig. 1). We do this by treating images as a special case of videos that are ‘frozen in time’. Using a transformer-based architecture allows us to train with variable-length sequences, treating an image as if it was a single frame video, unlike in standard 3D CNNs [8, 23, 71] where to train on images jointly with videos one must incur the cost of actually generating a static video. Furthermore, unlike many recent methods [21, 38, 43] for video-text dual encoding, we do not use a set of ‘expert networks’ that are pre-trained on external image datasets and then fixed, but instead train the model end-to-end.

This end-to-end training is facilitated by scraping the web for a new large-scale video-text captioning dataset of over two million video alt-text pairs (WebVid-2M). We also take advantage of large-scale image captioning datasets such as Conceptual Captions [59].

We make the following contributions: (i) we propose a new end-to-end model for video retrieval that does not rely on ‘expert’ features, but instead, inspired by [6] employs a transformer architecture with a modified divided space-time attention applied directly to pixels; (ii) because our architecture can gracefully handle inputs of different lengths, it is versatile and can be flexibly trained on both video and image datasets (by treating images as a single-frame video). We build on this flexibility by designing a curriculum learning schedule that begins with images and then gradually learns to attend to increasing temporal context when trained on video datasets through temporal embedding interpolation. We show that this increases efficiency, allowing us to train models with far less GPU time; (iii) we introduce a new dataset called WebVid-2M, consisting of 2.5M video-text pairs scraped from the web; and finally (iv) we achieve state-of-the-art performance by only using the video modality on MSR-VTT [72], MSVD [10], DiDeMo [3] and LSMDC [53] – outperforming works that use pre-extracted experts from multiple modalities, as well as those that are pretrained on the noisy HowTo100M, which is 20x larger than our dataset in the number of video-text pairs.

References (100)

Couldn't load all references. Reload the page to try again.