# UNITER: UNiversal Image-TExt Representation Learning

UNITER learns one image-text representation for many vision-and-language tasks

Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan and 2 more · arXiv · 2019-9-25

- **Problem** Vision-and-language models are usually built for one task, so the joint embeddings they learn rarely transfer to other tasks. A single shared representation has been hard to get.
- **Method** UNITER pre-trains one Transformer over image regions and words. It masks only one modality per example, and it adds an optimal transport loss that aligns words with image regions.
- **Results** UNITER-base beats the prior state of the art by about +2.8% on VCR Q→AR and +2.5% on NLVR2.

## Why one encoder for many vision-and-language tasks

Most vision-and-language systems depend on a joint embedding of image and text, but that embedding is usually designed around one benchmark, so what it learns rarely transfers to another. The authors ask whether a single image-text representation can serve every such task, and they answer by pre-training one model on large paired data and then fine-tuning it on each downstream task.

The evaluation covers six task families over nine datasets: VQA, VCR, NLVR2, Visual Entailment, image-text retrieval including a zero-shot setting, and referring expression comprehension.

Earlier multimodal pre-training divides into two designs. Two-stream models run separate Transformers over image and text and fuse them later, while single-stream models run one Transformer over both inputs. The authors report that, with their pre-training setting, a single-stream model reaches new state-of-the-art results, even though earlier two-stream studies had found the opposite.

## Embedding regions and words into one space

Each image is represented as a set of region features, and each sentence as a sequence of WordPiece tokens. The region features are pooled ROI features from a Faster R-CNN that was pre-trained on Visual Genome object and attribute data. Each region also carries a 7-dimensional location vector made of normalized coordinates, width, height and area.

The visual feature and the location feature each pass through a fully connected layer into a shared space, are summed, and are normalized. Each token adds its word embedding to its position embedding before its own normalization. Self-attention ignores order, so the token positions and the region locations have to be supplied as explicit inputs.

A modality embedding, added before the normalization in each embedder, tells the Transformer whether an input is text or image. The Transformer then gives a contextualized vector for each region and each word, and a \[CLS\] token supplies the joint representation of the image-text pair. UNITER-base has 12 layers, hidden size 768, 12 attention heads and 86M parameters, while UNITER-large has 24 layers, hidden size 1024, 16 attention heads and 303M parameters.

## Conditional masking for language and region modeling

Masked language modeling follows BERT: about 15% of the input words are selected, most are replaced by \[MASK\], and the model predicts them from the surrounding words and all image regions. Masked region modeling works the same way on the visual side: a selected region has its visual feature replaced by zeros, and the model reconstructs it from the other regions and all words.

The difference from earlier work is that only one modality is masked in a given example, with the other kept fully visible.

Under joint random masking, a region and the word that describes it can both be hidden, so the model has to guess that pair without evidence and may learn a misalignment. Validation curves for MLM and MRC-kl accuracy show that conditional masking converges faster and reaches a higher final accuracy than joint random masking. In the ablation, random masking of both modalities lowered Meta-Sum from 399.97 to 396.51.

## Optimal transport for word-region alignment

The authors treat the words and the regions as two discrete distributions with weight vectors a and b, and they seek a transport plan T that moves weight from one side to the other at minimum total cost. The plan is constrained so that its rows sum to a and its columns sum to b, and the WRA loss is the cost of the best such plan. \\\[ \\mathcal{L}\_{\\mathrm{WRA}}(\\theta)=\\min\_{T\\in\\Pi(a,b)}\\sum\_{i=1}^{T}\\sum\_{j=1}^{K}T\_{ij}\\,c(w\_i,v\_j) \\\] The cost between word w\_i and region v\_j is the cosine distance, \\(c(w\_i,v\_j)=1-\\frac{w\_i^\\top v\_j}{\\lVert w\_i\\rVert\_2\\,\\lVert v\_j\\rVert\_2}\\).

Exact minimization over the plan is intractable, so the authors approximate it with the IPOT algorithm, which runs proximal point steps under a generalized KL Bregman penalty and needs only matrix-vector products. The authors preferred IPOT to Sinkhorn because Sinkhorn's numerical stability and performance were quite sensitive to the entropy strength epsilon in their experiments.

Adding WRA to the best setting raised Meta-Sum from 399.97 to 400.93, with the largest gains on VQA and RefCOCO+. The authors read this as region-level alignment helping tasks that need region recognition, while Flickr and NLVR2 show comparable results.

## Three ways to supervise masked regions

Visual features are continuous, so a class likelihood cannot supervise them directly, and the authors propose three variants of masked region modeling with one shared objective shape. Masked region feature regression passes the Transformer output of a masked region through a fully connected layer and applies an L2 regression to the original ROI feature.

Masked region classification uses the most confident class from the Faster R-CNN detector as a one-hot label and minimizes cross-entropy.

The authors note that the detector's top class is not verified ground truth, so MRC-kl uses the full detector distribution as a soft label and minimizes the KL divergence between the two distributions. Among the MRM variants added to MLM and ITM, MRC-kl reached 397.09 and MRC reached 393.97, while MRFR reached 396.24. Combining MRC-kl and MRFR gave 399.97, which the authors describe as complementary.

## Pre-training data and the in-domain split

Pre-training uses only image-sentence pairs drawn from COCO, Visual Genome, Conceptual Captions and SBU Captions. COCO and Visual Genome form the in-domain set, and Conceptual Captions and SBU Captions form the out-of-domain set; Table 1 lists 533K COCO pairs, 5.06M Visual Genome pairs, 3.0M Conceptual Captions pairs and 990K SBU pairs in training.

After filtering, the in-domain training set has 5.6M image-text pairs and the internal validation set has 131K pairs, about half the size of the LXMERT data.

Validation and test images of the downstream tasks are removed from the COCO splits, since they are scattered across the raw splits of several tasks.

## Which pre-training tasks and data help

The ablation uses VQA, NLVR2, Flickr30K retrieval and RefCOCO+, and Meta-Sum adds their scores together. ITM alone reaches 385.29 and MLM alone reaches 386.10, and MRFR alone is slightly lower overall at 344.66 although it helps NLVR2.

MLM plus ITM reaches 393.04, and the full combination of MLM, ITM, MRC-kl, MRFR and WRA reaches 400.93. Using only the out-of-domain data gives 396.91, below the 400.93 from in-domain data, while training on both gives 405.24.

## Downstream results and the two-stage VCR setup

The comparison set includes MCAN for VQA, MaxEnt for NLVR2, B2T2 for VCR, SCAN for retrieval, EVE-Image for SNLI-VE and MAttNet for referring expressions, along with ViLBERT, LXMERT, Unicoder-VL, VisualBERT and VL-BERT as pre-trained baselines. UNITER-large is reported as new state of the art across all benchmarks in this comparison, while UNITER-base leads by a large margin on all tasks except VQA.

Relative to the prior state of the art, UNITER-base is about +2.8% higher on VCR Q→AR, +2.5% on NLVR2, +7% on SNLI-VE, +4% on R@1 for image-text retrieval and +2% on referring expression comprehension. On VQA, UNITER-base beats the image-text-only pre-trained models by more than 1.5%, and the authors note that LXMERT was pre-trained with downstream VQA data.

For VCR the authors add a second pre-training stage on the VCR data itself, using MLM, MRFR and MRC-kl, with ITM dropped because VCR text does not describe the image. Without any stage, UNITER-base scores 53.52 on Q→AR, while the two-stage setting reaches 57.76. Second-stage pre-training alone gives 55.6 on Q→AR, compared with 54.94 for first-stage pre-training alone, so the VCR-specific stage matters more.

## Input format for NLVR2

NLVR2 takes two images, while the pre-training pairs have one image each, so the authors compare three input formats. Triplet joint embedding reached 73.03 on dev and 73.89 on test-P, Pair reached 75.85 and 75.80, and Pair-biattn, which adds bidirectional attention between the paired images, reached 77.18 and 77.85. The authors attribute the advantage of Pair to pre-training on single image-text pairs, which makes triplet input hard to fine-tune, and Pair-biattn adds the cross-image interactions that Pair lacks.

## Limitations

Every model uses off-the-shelf detectors trained on COCO and Visual Genome, and the referring expression val and test images are a subset of the COCO training split. The authors use these contaminated features for a fair comparison with concurrent work, and they report that the MAttNet accuracy rises by 1.5% with them. Experiments with strictly correct features were left to future work.

Table 2 gives one Meta-Sum value per row, and the paper does not report seed counts or variance for these ablations.

## Paper info

- **Authors**: Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, Jingjing Liu
- **Venue**: arXiv · Preprint
- **First published**: 2019-9-25
- **Added**: 2026-11-12
- **Updated**: 2020-7-17
- **Version**: v3
- **arXiv**: 1909.11740
- **Category**: cs.CV · cs.CL · cs.LG
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1909.11740v3) · [PDF ↗](https://arxiv.org/pdf/1909.11740v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, Jingjing Liu (2019). UNITER: UNiversal Image-TExt Representation Learning. arXiv:1909.11740v3. https://arxiv.org/abs/1909.11740v3

**BibTeX**

```
@misc{chen2019uniter,
  title = {{UNITER: UNiversal Image-TExt Representation Learning}},
  author = {Yen-Chun Chen and Linjie Li and Licheng Yu and Ahmed El Kholy and Faisal Ahmed and Zhe Gan and Yu Cheng and Jingjing Liu},
  year = {2019},
  eprint = {1909.11740},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.11740v3}
}
```

## Other paper commentary

- [Learning Face Representation from Scratch](https://refivu.com/en/papers/c66cea99-ee67-42f0-85f5-a773fc796f34-learning-face-representation-from-scratch.md)
- [Learning deep representations by mutual information estimation and maximization](https://refivu.com/en/papers/0ecc4e49-5a6d-49c7-a22d-0464db0ce259-learning-deep-representations-by-mutual-information.md)
- [Digging Into Self-Supervised Monocular Depth Estimation](https://refivu.com/en/papers/501b9eb4-7fd4-43f0-8b68-eaaf0aab3b71-digging-into-self-supervised-monocular-depth-estimation.md)
- [Unsupervised Representation Learning by Predicting Image Rotations](https://refivu.com/en/papers/44e2c7d7-5798-499b-99ea-bd1b30e157b3-unsupervised-representation-learning-by-predicting-image.md)
- [HuBERT: Self-Supervised Speech Representation Learning by Masked Prediction of Hidden Units](https://refivu.com/en/papers/4fe3f455-0287-4182-b603-63ebb7e4b5fc-hubert-self-supervised-speech-representation-learning-by.md)
- [Robust Recovery of Subspace Structures by Low-Rank Representation](https://refivu.com/en/papers/14c27646-6e22-4f5b-b820-67e75508bf84-robust-recovery-of-subspace-structures-by-low-rank.md)
- [CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation](https://refivu.com/en/papers/eb07d47d-3eb5-4fba-ba4e-7d3bd33335aa-codet5-identifier-aware-unified-pre-trained-encoder-decoder.md)
- [DreamFusion: Text-to-3D using 2D Diffusion](https://refivu.com/en/papers/8748788c-c1b0-47b9-a624-78c1f27630e6-dreamfusion-text-to-3d-using-2d-diffusion.md)
- [Two-Stream Adaptive Graph Convolutional Networks for Skeleton-Based Action Recognition](https://refivu.com/en/papers/34b4bb2a-43de-4874-9031-6b02160d4003-two-stream-adaptive-graph-convolutional-networks-for.md)
- [Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-shot Cross-dataset Transfer](https://refivu.com/en/papers/8f3933a0-30e6-41a0-8d25-597109ee5170-towards-robust-monocular-depth-estimation-mixing-datasets.md)
- [Simple Baselines for Human Pose Estimation and Tracking](https://refivu.com/en/papers/1bfa3990-5650-4254-9d74-6addde0897ee-simple-baselines-for-human-pose-estimation-and-tracking.md)
- [Generative AI](https://refivu.com/en/papers/20462cc3-15fd-4b36-8393-33848e90e0dd-generative-ai.md)

## Terms in this paper

- [masked language modeling (MLM)](https://refivu.com/en/terms/b69aff1c3ded-masked-language-modeling-mlm)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/c2b71a61-22ad-48f9-af71-922539fd9eab-uniter-universal-image-text-representation-learning)
