Unicoder-VL: A Universal Encoder for Vision and Language by Cross-Modal Pre-Training

Gen Li, Nan Duan, Yuejian Fang, Ming Gong, Daxin Jiang

Introduction

Historically, computer vision (CV) and natural language processing (NLP) have operated in silos. While CV models like ResNet excel at object identification, they often lack the capacity for complex linguistic reasoning. Conversely, NLP models like BERT handle intricate text but remain "blind" to visual context. Cross-modal tasks—such as image retrieval based on descriptive captions or visual question answering—traditionally required bespoke "fusion layers" to bridge these modalities.

Unicoder-VL addresses this by proposing a universal encoder: a single architecture that learns to "ground" language in visual reality through massive cross-modal pre-training. By treating image regions as "visual tokens" alongside text, it achieves state-of-the-art results with minimal task-specific fine-tuning.

Methods

Unicoder-VL utilizes a single-stream multi-layer Transformer architecture. Unlike dual-stream models that process modalities separately before merging, Unicoder-VL feeds both into the same Transformer early on, facilitating deep, bidirectional interaction from the first layer.

Overview of the Unicoder-VL architecture and input pipeline, showing how image regions and text tokens are combined.

The Input Pipeline

  • Linguistic Stream: Text is tokenized using the standard WordPiece method.
  • Visual Stream: Images are processed via a pre-trained Faster R-CNN to extract features for the top 100 "Regions of Interest" (RoIs). Each region is represented by its visual features and a 5D location vector (normalized coordinates and area fraction) to provide spatial context.
  • Fusion: Both streams are projected into a shared embedding space and combined with positional and segment embeddings before entering the Transformer.

Pre-training Tasks

The model is trained on three simultaneous self-supervised tasks:

  1. Masked Language Modeling (MLM): Predicting missing words in a caption using both linguistic context and image regions.
  2. Masked Object Classification (MOC): Predicting the object category of a masked image region based on text and other regions.
  3. Visual-linguistic Matching (VLM): A binary classification task to determine if an image and caption pair are correctly matched.

Datasets and Evaluation

The model was pre-trained on a corpus of 3.8 million image-caption pairs, combining Conceptual Captions (~3M) and SBU Captions (~0.8M). Evaluation was conducted on standard benchmarks:

  • MSCOCO & Flickr30K: For image-to-text and text-to-image retrieval.
  • VCR (Visual Commonsense Reasoning): A dataset requiring models to answer questions about movie scenes and provide rationales.

Key Insights

  • Visual Grounding via "Cloze" Tasks: Masking both words and image regions forces the model to learn cross-modal relationships. To predict a masked word like "truck," the model must attend to the corresponding visual region.
  • Zero-Shot Capability: Remarkably, the pre-trained model outperformed several older models on MSCOCO even without fine-tuning on that specific dataset, indicating a robust general understanding of visual-linguistic mapping.
  • Single-Stream Efficiency: The authors demonstrate that the single-stream approach is highly effective at capturing high-level relationships, as every word can attend to every image region at every layer.

Key Results

Unicoder-VL established new performance benchmarks across multiple tasks. On the MSCOCO 1K test set, it achieved an 84.3% R@1 for sentence retrieval, a significant improvement over previous benchmarks.

Table showing Unicoder-VL's state-of-the-art performance on MSCOCO and Flickr30k retrieval tasks compared to existing methods.

In the Visual Commonsense Reasoning (VCR) task, the model achieved 72.6% on the Q->A sub-task, significantly outperforming the R2C baseline (63.8%). This suggests that cross-modal pre-training enhances cognitive-level understanding beyond simple object recognition.

Limitations and Future Work

Despite its success, Unicoder-VL has areas for improvement. The Faster R-CNN backbone is currently fixed; fine-tuning it alongside the Transformer could further boost performance. Additionally, the model relies on web-scraped data which can be noisy; higher-quality human annotations might yield better results. Future research will explore extending the architecture to image captioning, scene graph generation, and video-based question answering.

Summary updated

BibTeX
@inproceedings{li2020unicoder,
  author = {Gen Li and Nan Duan and Yuejian Fang and Ming Gong and Daxin Jiang},
  title = {{Unicoder-VL: A Universal Encoder for Vision and Language by Cross-Modal Pre-Training}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i07.6795},
}
Figure