LXMERT: Learning Cross-Modality Encoder Representations from Transformers
About
Vision-and-language reasoning requires an understanding of visual concepts, language semantics, and, most importantly, the alignment and relationships between these two modalities. We thus propose the LXMERT (Learning Cross-Modality Encoder Representations from Transformers) framework to learn these vision-and-language connections. In LXMERT, we build a large-scale Transformer model that consists of three encoders: an object relationship encoder, a language encoder, and a cross-modality encoder. Next, to endow our model with the capability of connecting vision and language semantics, we pre-train the model with large amounts of image-and-sentence pairs, via five diverse representative pre-training tasks: masked language modeling, masked object prediction (feature regression and label classification), cross-modality matching, and image question answering. These tasks help in learning both intra-modality and cross-modality relationships. After fine-tuning from our pre-trained parameters, our model achieves the state-of-the-art results on two visual question answering datasets (i.e., VQA and GQA). We also show the generalizability of our pre-trained cross-modality model by adapting it to a challenging visual-reasoning task, NLVR2, and improve the previous best result by 22% absolute (54% to 76%). Lastly, we demonstrate detailed ablation studies to prove that both our novel model components and pre-training strategies significantly contribute to our strong results; and also present several attention visualizations for the different encoders. Code and pre-trained models publicly available at: https://github.com/airsplay/lxmert
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Visual Question Answering | GQA | Accuracy60 | 963 | |
| Visual Question Answering | VQA v2 (test-dev) | Overall Accuracy72.45 | 664 | |
| Natural Language Understanding | GLUE (dev) | SST-2 (Acc)90.2 | 504 | |
| Visual Question Answering | VQA v2 (test-std) | Accuracy72.54 | 466 | |
| Natural Language Understanding | GLUE | SST-290.2 | 452 | |
| Natural Language Understanding | GLUE (test) | SST-2 Accuracy82.4 | 416 | |
| Visual Question Answering | VQA 2.0 (test-dev) | Accuracy72.42 | 337 | |
| Natural Language Visual Reasoning | NLVR2 (test-p) | Accuracy74.5 | 327 | |
| Visual Question Answering | OK-VQA (test) | Accuracy42.03 | 296 | |
| Natural Language Visual Reasoning | NLVR2 (dev) | Accuracy74.9 | 288 |