All models

flava (base image text foundation)

One transformer trio for images, text and both together, pretrained on 70M public image-text pairs.

Multimodal · 882 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (49 KB)

Open in a new tab

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.

At a glance

Family
FLAVA
Parameters
241.4M
Operations
882
Framework
PyTorch
Recurrent
No
Published
CVPR 2022
Cited by
565 (as of 18 October 2026)
Authors
Amanpreet Singh, Ronghang Hu, Vedanuj Goswami and others
Name in source
flava:base-image-text-foundation
License
BSD-3-Clause
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m5035
Graph hash
58db8451eb9812ce11bfed12d7179bda950263f7cb4bf32f5ffa053b31007989
Skeleton hash
ebf867bb63295cf3bbdeec2f123d95863ba46f3ae81e06c5b4e045aab4d57a48
Architecture hash
5b1e5a0b3dd622944e587c48cc7d8884b13779f090eb17c142fff9354b6ff657
Diagram SHA-256
2506d2e0ea3247b4f8557e4c6af921f41cd673e49618794a0ca57635fd2ca679
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

The transformers FlavaModel port, the class the card recommends for most use cases over FlavaForPreTraining.

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.

  • FLAVA
  • flava-full
  • foundational language and vision alignment model
  • vision-language model
  • multimodal foundation model
  • image-text
  • contrastive pretraining
  • masked multimodal modeling
  • PMD
  • public multimodal datasets
  • torchmultimodal
  • FlavaModel

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@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}, 
}