Paper commentary
Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks
Oscar uses object tags to ease vision-language alignment learning
- Problem Vision-language models concatenate image regions and words and let attention find their matches, so alignment must be learned weakly. Overlapping detector boxes make neighboring region features hard to tell apart.
- Method Oscar adds detected object tags as a third input beside words and regions. It pre-trains with a masked token loss and a contrastive loss.
- Results OscarB reached 137.6 CIDEr on COCO captioning under CIDEr optimization, against 129.3 for the best base-size prior model.
Why alignment is hard for existing VLP models
Vision-language pre-training models usually concatenate image region features with word embeddings and let self-attention discover which region matches which word. The input carries no explicit correspondence between regions and words, so the model has to learn alignment as a weakly supervised problem. Detector boxes add a second difficulty: they are over-sampled, so neighbouring boxes overlap and their embeddings become hard to tell apart.
The authors illustrate this with dog and couch, whose region features blur together while their words stay distinct.
The study asks whether a signal that already exists in the data, namely the objects both the image and its caption contain, can supply the missing correspondence.
Object tags as anchor points
The starting observation is that a detector finds the salient objects of an image reliably, and that captions tend to name those same objects. Oscar turns this overlap into an explicit input signal instead of leaving it for attention to discover.
Each training sample becomes a triple of word tokens, object tags and region vectors, whereas existing methods keep only the text and the regions. The tags are written as words detected from the image, so they sit in the linguistic embedding space that BERT already provides. The authors expect that, because text-to-tag links are easy to learn within the text, attention from the matching words will favour the regions the tags came from.
Region features are extracted with Faster R-CNN as 2048-dimensional vectors, each with a region position of 4 or 6 values. The position is concatenated to the feature and passed through a linear projection, so each region matches the word embedding size. The same detector also yields a set of high precision object tags, whose word embeddings form the tag segment of the input.
Two losses on two views of the input
The input can be read through a modality view, which separates text from image, and a dictionary view, which assigns each part to the semantic space of its tokens. The dictionary view motivates the first loss, because word tokens and tags share one linguistic space while region features lie in a visual one.
The Masked Token Loss replaces each token of h, the concatenation of words and tags, with a [MASK] token with probability 15%. The model predicts the hidden token from the remaining tokens and from all region features, and the loss is a negative log-likelihood. Written out, the loss is \(L_{MTL}=-\mathbb{E}_{(v,h)\sim D}\log p(h_i\mid h_{\backslash i},v)\), so minimizing it raises the probability of each masked token given its context and the image.
The authors note that this resembles the masked language model used by BERT, with image features added as context.
The Contrastive Loss uses the modality view: the tags and regions form the image side and the words form the text side. With probability 50%, the tags are replaced by a tag sequence sampled from the dataset, which gives a polluted pair. A fully connected layer on the [CLS] output acts as a binary classifier that labels the original pair as 1 and the polluted pairs as 0.
The loss is \(L_C=-\mathbb{E}_{(h',w)\sim D}\log p(y\mid f(h',w))\), and it is minimized over the original and polluted pairs.
The total objective is the plain sum \(L_{\text{Pre-training}}=L_{MTL}+L_C\), with no weighting coefficient in the stated form. The authors keep both losses simple so that each one's learning signal can be read on its own. They report that this simple joint loss performs well in their experiments, compared with the more complex objectives of existing VLP methods.
Pre-training data and settings
The pre-training corpus combines existing V+L datasets, including COCO, Conceptual Captions, SBU captions, Flickr30k and GQA. It covers 4.1 million unique images and 6.5 million text-tag-image triples.
The two variants are initialized from BERT base, with hidden size 768 for OscarB, and from BERT large, with hidden size 1024 for OscarL. The trainable parameters are the BERT parameters together with the linear projection W applied to the region features. The optimizer is AdamW, and the sequence lengths are 35 for discrete tokens and 50 for region features.
Fine-tuning the same model per task
For image-text retrieval, a binary classifier on the [CLS] output decides whether a pair is aligned, and an unaligned pair is made by swapping in another image or caption. The authors use this binary loss instead of ranking losses, because they found it works better, and retrieval is evaluated with top-K results on the 1K and 5K COCO test sets.
For captioning, 15% of the caption tokens are masked and their ids are predicted from the output representations. A causal attention mask lets each caption token see only earlier caption tokens, while every caption token sees all image regions and tags. At inference, generation starts from a [MASK] token and ends at the [STOP] token, with beam size 5.
NoCaps uses tags built from predicted Visual Genome and Open Images labels, and Oscar is trained on COCO without the pre-training initialization. That model starts from BERT, and training uses the COCO captioning training set with constrained beam search.
For VQA, the question, tags and region features form one input, and the [CLS] output feeds a linear classifier over a shared set of 3,129 answers. The VQA targets are soft scores based on the human answers, and training minimizes a cross-entropy loss against them.
For GQA, the model chooses from a shared set of 1,852 candidate answers, and the authors also build a second model, Oscar*B, fine-tuned first on the all-split and then on the balanced-split. For NLVR2, the sentence is paired with each of two images to form two sequences, and the two [CLS] outputs are concatenated and passed to an MLP classifier.
Results against prior models
Table 1 compares Oscar with the best small model, the best base-size VLP model and the best large-size model on each task. OscarB reached 54.0 image-retrieval R@1 and 70.0 text-retrieval R@1, against 48.4 and 63.3 for the best base-size prior model. OscarL reached 57.5 and 73.5 on the same two metrics, against 51.7 and 66.6 for the best large-size prior model.
On VQA test-std, OscarB scored 73.44 and OscarL 73.82, against 72.54 for the best base-size model and 73.40 for the best large-size model.
On COCO captioning under CIDEr optimization, OscarB reached 137.6 CIDEr and OscarL 140.0, against 129.3 for the best base-size model. The text states that Oscar improves BLEU@4 and CIDEr over prior VLP captioning by more than 2 and 10 points, respectively, while the table values quoted here give a different difference, so the two should be read against their own baselines.
On NoCaps validation, models trained only on COCO reached 79.3 overall CIDEr with constrained beam search, against 73.1 for UpDown with the same decoding. The authors read the larger gap on near-domain and out-of-domain images as evidence of generalization.
What the object tags contribute
The authors compare three fine-tuning settings on the base model: no tags, tags predicted by a detector trained on COCO, and ground-truth COCO tags as an upper bound. Fine-tuning with tags converges faster and reaches better values than the no-tag setting on all three tasks, which are VQA, image retrieval and image captioning. On VQA and retrieval, tags-only training reached the baseline's final performance in about half the training time.
Two pre-training variants use tags from the Visual Genome detector (OscarVG) and from the Open Images detector (OscarOI), both trained for 589k steps. On VQA dev, the no-tag baseline scored 70.93, against 71.70 for OscarVG and 71.15 for OscarOI. The authors hypothesize that the Visual Genome detector's more diverse object set explains its slight edge over the Open Images detector, whose tags are more precise.
In an attention study on COCO 1K retrieval with models initialized from BERT base without pre-training, adding tags to the partial attention setting helps. Region features carry more information than tags alone, and the authors conclude that tags add little as plain features but matter more as anchor points.
In the t-SNE map of last-layer outputs, the same object is closer across the two modalities when tags are used. Related classes such as animals, furniture and vehicles move closer together yet remain distinguishable, which the authors read as a sign that tags act as anchor points. In the captioning examples, the tagged model names the rose and the flowers in a vase, which the authors attribute to the object tags detected by Faster R-CNN.
Limitations
The benefit depends on the detector, since ground-truth tags remain the upper bound in the comparison. The authors expect that more accurate object detectors would close part of that gap.
The authors state that the NLVR2 fine-tuning architecture is not necessarily the best choice, and they point to the Pair-biattn fine-tuning of UNITER as a better option.
On GQA test-std, the neural state machine reached 63.17, against 61.23 for OscarB, and the authors leave the structural prior of that model for future work.
The NoCaps comparison uses only COCO captioning training data and no pre-training initialization.
The qualitative t-SNE and caption analyses are not quantified, so they show direction rather than size.
Paper info
- Authors
- Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, Yejin Choi, Jianfeng Gao
- Venue
- arXiv · Preprint
- First published
- 2020-4-13
- Added
- 2026-11-13
- Updated
- 2020-7-26
- Version
- v5
- arXiv
- 2004.06165
- Category
- cs.CV · cs.CL · cs.IR · cs.LG
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
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
Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, Yejin Choi, Jianfeng Gao (2020). Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks. arXiv:2004.06165v5. https://arxiv.org/abs/2004.06165v5
BibTeX
@misc{li2020oscar,
title = {{Oscar: Object-Semantics Aligned Pre-training for Vision-Language Tasks}},
author = {Xiujun Li and Xi Yin and Chunyuan Li and Pengchuan Zhang and Xiaowei Hu and Lei Zhang and Lijuan Wang and Houdong Hu and Li Dong and Furu Wei and Yejin Choi and Jianfeng Gao},
year = {2020},
eprint = {2004.06165},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2004.06165v5}
}