Hao Tan, Mohit Bansal
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
| Task | Dataset | Metric | Value | Model |
|---|---|---|---|---|
| Visual Question Answering (VQA) | A-OKVQA | DA VQA Score | 25.9 | LXMERT |
| Visual Question Answering (VQA) | A-OKVQA | MC Accuracy | 41.6 | LXMERT |
| Visual Question Answering (VQA) | GQA Test2019 | Accuracy | 62.71 | LXR955, Ensemble |
| Visual Question Answering (VQA) | GQA Test2019 | Binary | 79.79 | LXR955, Ensemble |
| Visual Question Answering (VQA) | GQA Test2019 | Consistency | 93.1 | LXR955, Ensemble |
| Visual Question Answering (VQA) | GQA Test2019 | Distribution | 6.42 | LXR955, Ensemble |
| Visual Question Answering (VQA) | GQA Test2019 | Open | 47.64 | LXR955, Ensemble |
| Visual Question Answering (VQA) | GQA Test2019 | Plausibility | 85.21 | LXR955, Ensemble |
| Visual Question Answering (VQA) | GQA Test2019 | Validity | 96.36 | LXR955, Ensemble |
| Visual Question Answering (VQA) | GQA Test2019 | Accuracy | 60.33 | LXR955, Single Model |
| Visual Question Answering (VQA) | GQA Test2019 | Binary | 77.16 | LXR955, Single Model |
| Visual Question Answering (VQA) | GQA Test2019 | Consistency | 89.59 | LXR955, Single Model |
| Visual Question Answering (VQA) | GQA Test2019 | Distribution | 5.69 | LXR955, Single Model |
| Visual Question Answering (VQA) | GQA Test2019 | Open | 45.47 | LXR955, Single Model |
| Visual Question Answering (VQA) | GQA Test2019 | Plausibility | 84.53 | LXR955, Single Model |
| Visual Question Answering (VQA) | GQA Test2019 | Validity | 96.35 | LXR955, Single Model |
| Visual Question Answering (VQA) | GQA test-std | Accuracy | 60.3 | LXMERT |
| Visual Question Answering (VQA) | VizWiz 2018 | number | 24.76 | LXR955, No Ensemble |
| Visual Question Answering (VQA) | VizWiz 2018 | other | 39 | LXR955, No Ensemble |
| Visual Question Answering (VQA) | VizWiz 2018 | overall | 55.4 | LXR955, No Ensemble |
| Visual Question Answering (VQA) | VizWiz 2018 | unanswerable | 82.26 | LXR955, No Ensemble |
| Visual Question Answering (VQA) | VizWiz 2018 | yes/no | 74 | LXR955, No Ensemble |
| Visual Question Answering (VQA) | GQA test-dev | Accuracy | 60 | LXMERT (Pre-train + scratch) |
| Visual Question Answering (VQA) | VQA v2 test-dev | Accuracy | 69.9 | LXMERT (Pre-train + scratch) |
| Visual Question Answering (VQA) | VQA v2 test-std | overall | 72.5 | LXMERT |
| Visual Reasoning | NLVR2 Dev | Accuracy | 74.9 | LXMERT (Pre-train + scratch) |
| Visual Reasoning | NLVR2 Test | Accuracy | 76.2 | LXMERT |