
flava (base image text foundation)
Multimodal882 ops241.4M params
One transformer trio for images, text and both together, pretrained on 70M public image-text pairs.
Multimodal · 1,851 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
The TorchMultimodal reference implementation of the FLAVA model class from facebookresearch/multimodal.
About this model's family
FLAVA is a foundational language and vision alignment model that explicitly targets vision, language, and their multimodal combination all at once. The motivation is that existing models are often either cross-modal (contrastive) or multi-modal (with earlier fusion) but not both, and often only target specific modalities or tasks. The paper validates it on 35 tasks across vision, NLP and multimodal domains.
The model has an image encoder, a text encoder and a multimodal encoder that fuses and aligns the two, all based on transformers. The image encoder is a ViT-B/16, and unusually the text encoder uses exactly the same ViT architecture, with different parameters. The multimodal encoder applies two learned linear projections to each image and text hidden state, concatenates them with an extra classification token, and runs a further transformer that allows cross-attention between the two modalities. The Hub card describes that multimodal encoder as a 6-layer encoder.
Pretraining mixes multimodal and unimodal objectives: contrastive, masked multimodal modeling and image-text matching on image-text pairs, plus masked image modeling and masked language modeling on unpaired images and text. The global contrastive loss back-propagates across all GPUs rather than only locally, which the authors found gives a noticeable gain. Masked multimodal modeling masks both the image patches and the text tokens and works on both modalities jointly. The multimodal corpus, called PMD for Public Multimodal Datasets, totals 70M image-text pairs with 68M unique images. That is around 6x smaller than CLIP's training data, and FLAVA works significantly better on language and multimodal tasks while slightly worse than CLIP on some vision-only tasks. The card also admits FLAVA doesn't work well on tasks containing scene text, given the lack of scene text in most public datasets.
Key idea. FLAVA combines dual and fusion encoder approaches into one holistic model, pretrained with objectives from both categories on unimodal and multimodal data, so a single model serves vision, language and vision-and-language tasks.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{singh2022flavafoundationallanguagevision,
title={FLAVA: A Foundational Language And Vision Alignment Model},
author={Amanpreet Singh and Ronghang Hu and Vedanuj Goswami and Guillaume Couairon and Wojciech Galuba and Marcus Rohrbach and Douwe Kiela},
year={2022},
eprint={2112.04482},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2112.04482},
}