Back to paper library
arXiv 2021Multimodal learningPaper notes

Florence

Renaissance

Original paper

Florence: A New Foundation Model for Computer Vision

Paper authors

Lu Yuan · Dongdong Chen · Yi-Ling Chen …

Show all 23 authors

Lu Yuan · Dongdong Chen · Yi-Ling Chen · Noel Codella · Xiyang Dai · Jianfeng Gao · Houdong Hu · Xuedong Huang · Boxin Li · Chunyuan Li · Ce Liu · Mengchen Liu · Zicheng Liu · Yumao Lu · Yu Shi · Lijuan Wang · Jianfeng Wang · Bin Xiao · Zhen Xiao · Jianwei Yang · Michael Zeng · Luowei Zhou · Pengchuan Zhang

Publication
Publication venue not yet verified
First submitted to arXiv
arXiv:2111.11432
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{multimodalityflorence2021,
  title = {{Florence: A New Foundation Model for Computer Vision}},
  author = {Lu Yuan and Dongdong Chen and Yi-Ling Chen and Noel Codella and Xiyang Dai and Jianfeng Gao and Houdong Hu and Xuedong Huang and Boxin Li and Chunyuan Li and Ce Liu and Mengchen Liu and Zicheng Liu and Yumao Lu and Yu Shi and Lijuan Wang and Jianfeng Wang and Bin Xiao and Zhen Xiao and Jianwei Yang and Michael Zeng and Luowei Zhou and Pengchuan Zhang},
  year = {2021},
  eprint = {2111.11432},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.11432}
}
On this page

Florence, the birthplace of the Renaissance.

The paper published by Microsoft has a bold name, reflecting both the artistry and audacity behind it.

The term "foundation model" emerged as a concept in the field of natural language processing.

In earlier years, we typically referred to these as "pre-trained models," but as model sizes grew exponentially, reaching almost incomprehensible scales, we discovered that pre-trained models could perform a wide range of tasks, no longer confined to just a few specific ones.

People began to view such models as "foundational," as they provided basic feature representations that could be applied to a variety of tasks, hence the term "foundation model."

Since this paper has such an ambitious title, let’s dive straight into the main topic.

Defining the Problem

While the natural language field has already seen iconic foundation models, the authors aim to establish a similar benchmark in the computer vision field. They define the problem space for what they call a "foundation model" in computer vision, proposing a three-dimensional problem space:

  1. Space: Visual understanding levels ranging from coarser tasks (such as scene classification) to finer ones (such as object detection).
  2. Time: From static images to dynamic video understanding that involves time series.
  3. Modality: From pure RGB image information to multimodal data (such as integrating text descriptions, sound, and depth information).

The problem they aim to solve is: to develop a foundation model and corresponding adapters that can lightly learn general representations from large, diverse upstream data, and, with minimal additional training or modifications, apply to different types of visual tasks across the three dimensions.

In other words, they want to create a model that can handle tasks across the "space-time-modality" spectrum, whether it be scene classification, object detection, behavior recognition in videos, image-text retrieval, or tasks that intertwine vision and language.

Solving the Problem

Model Architecture

This architecture diagram is clear and roughly divided into three parts:

  1. Prepare a large training dataset.
  2. Train the foundation model with unified image-text contrastive learning.
  3. Attach different adapters for downstream tasks.

Alright, we've just read through another paper. (Wait, what?)

Training Dataset

ALIGN showed the value of noisy image-text data at scale. Florence still filters near-duplicates, small images, and image-text mismatches.

Before starting, the authors managed to acquire an enormous image-text dataset (FLD-900M), which contains 900 million image-text pairs, about 9.7 million unique queries, and a total of 7.5 billion tokens.

Unified Image-Text Contrastive Learning

The first step is to solve the problem of integrating image and text data. Do you remember the CLIP model from not long ago?

The training idea behind CLIP is:

  • Treat image-text pairs as positive samples.
  • Treat other text as negative samples.

The issue with this approach is that online data often features "multiple images corresponding to the same text description." If using the CLIP method with the assumption of "one image, one text," then handling multiple images for a single text description becomes challenging. Therefore, the authors reference another contrastive learning framework called "Unified Image-Text Contrastive Learning."

The original term is Unified Image-Text Contrastive Learning, abbreviated as UniCL.

The specific approach is to create a hash label for each text description, mapping the same description (regardless of how many images correspond to it) to the same label yy.

If a batch contains multiple images with exactly the same text description, they share a hash label and can count as positives in both image-to-text and text-to-image directions. The method no longer treats another image with the identical description as a negative; pairs with different labels remain negative. It does not group different paraphrases merely because they have similar meanings.

Mathematically, let fθf_\theta be the image encoder and fϕf_\phi the text encoder.

Given an image xx and its corresponding text description tt, we first convert fθ(x)f_\theta(x) and fϕ(t)f_\phi(t) into feature vectors.

  • The normalized image feature is

    u=fθ(x)∥fθ(x)∥u = \frac{f_\theta(x)}{\|f_\theta(x)\|}
  • The normalized text feature is

    v=fϕ(t)∥fϕ(t)∥v = \frac{f_\phi(t)}{\|f_\phi(t)\|}

Next, define a learnable temperature parameter τ\tau (tau). Given a mini-batch BB, where each sample has a label yiy_i, the total loss function LL includes contrastive losses in two directions:

  1. Image-to-text contrastive loss Li2tL_{i2t}
  2. Text-to-image contrastive loss Lt2iL_{t2i}

The final loss is

L=Li2t+Lt2iL = L_{i2t} + L_{t2i}

Through these two directions of contrast, the model simultaneously learns the matching relationship between "image-to-text" and "text-to-image."

Additionally, the authors found that long and meaningful language descriptions are more effective for learning than single-word descriptions. However, since some data contains very short descriptions (like single words), they use templates like "A photo of the [WORD]" to extend the description and provide more contextual features. But later, they discovered that these synthetic prompts negatively impacted higher-level retrieval and vision-language tasks. Therefore, the authors divided the training process into two stages:

  • Stage 1: Train for 1 million iterations using all data (including short texts with augmented descriptions).
  • Stage 2: Remove all artificial templates and augmented texts, and retrain for 180,000 iterations using only the original data to make the model more sensitive to natural text descriptions.

Finally, they added a high-resolution fine-tuning step (80,000 iterations) that increased the image input size from 224×224224 \times 224 to 384×384384 \times 384, similar to other large pre-training methods, to enhance model performance.

Two-Tower Architecture

The model adopts a "Two-Tower" design:

  • Text Encoder: A 12-layer Transformer, similar in structure to the text encoder in CLIP.
  • Image Encoder: A hierarchical Vision Transformer based on CoSwin Transformer.

The entire model has 893 million parameters, with the text Transformer having 256 million parameters and the CoSwin-H image Transformer having 637 million parameters.

Downstream Task Adapters - Object-Level

And now, we move on to solving the fine-grained problem, starting with object-level tasks.

Image-level features alone may not suffice for tasks like object detection and segmentation that require fine-grained localization.

To address this, the authors connect the pre-trained Florence image encoder to an adapter called Dynamic Head or Dynamic DETR, extending from global image semantics to object-level feature learning.

The core concept of Dynamic Head is to connect feature pyramids, spatial dimensions, and channel dimensions through a set of three attention mechanisms.

Since applying multi-head attention to the entire 3D feature tensor would be computationally expensive, the authors decompose it into level-wise, spatial-wise, and channel-wise attention, stacking them sequentially for efficient multi-dimensional feature relationships.

Additionally, the authors built a massive object detection pre-training dataset called FLOD-9M.

This dataset combines well-known datasets like COCO, LVIS, OpenImages, and Object365, and generates pseudo-labeled data for ImageNet-22K. FLOD-9M contains about 8.96 million images, 25,190 object categories, and over 33.4 million bounding boxes.

Downstream Task Adapters - Fine-Grained-Level

The next problem is fine-grained, where more detailed feature representations are required in tasks like visual question answering and image captioning.

Many earlier studies extracted object-level features from images using an object detector, then fed those features into a fusion network for task prediction. However, newer approaches attempt to learn fine-grained information directly from grid features without relying on explicitly annotated object boxes.

The authors extend Florence to fine-grained representations using METER.

The approach replaces the original METER image encoder with the pre-trained Florence image encoder (CoSwin) and uses the pre-trained RoBERTa as the text encoder. Additionally, they employ a Co-attention Transformer module to simultaneously encode both image and text features, allowing the two modalities to interact, and finally fine-tune on downstream tasks (e.g., VQA).

Downstream Task Adapters - Video

The last dimension defined by the authors is time, or video.

Transformers' self-attention design can easily scale to video tasks.

The authors propose the "Video CoSwin adapter" to extend the pre-trained CoSwin, which was trained on images, to the video domain.

To adapt to video features, they change the token embedding method from 2D convolution to 3D convolution, allowing them to handle both spatial and temporal features. The original CoSwin uses 2D convolutions to generate patch tokens; now, these 2D kernels are expanded into 3D kernels to account for the temporal dimension.

Mathematically, if the original 2D convolution kernel size is Kh×KwK_{h} \times K_{w}, with the introduction of the temporal dimension TT, the new 3D kernel is Kt×Kh×KwK_{t} \times K_{h} \times K_{w}.

If the 2D weights are W2DW_{2D}, the 3D weights W3DW_{3D} are initialized as follows:

W3D(t,h,w)=W2D(h,w)Ktfor t=1,…,Kt.W_{3D}(t,h,w) = \frac{W_{2D}(h,w)}{K_{t}} \quad \text{for } t=1,\dots,K_{t}.

This is the paper's weight-copying initialization to preserve the output scale; the video model still needs training afterward.

In Swin Transformer, patch merging is a process that reduces the feature dimensions. For video features, the authors use 3D convolution-based patch merging to combine features in both spatial and temporal dimensions, allowing more interaction between features across different time segments.

Swin Transformer segments the image into small windows and performs self-attention calculations within these windows. Then, in the next layer, it shifts the window positions to exchange features across windows. For video, the authors extend this concept by changing 2D shifted windows to 3D shifted windows, which also shift in time.

To initialize the 3D relative position embeddings, the authors replicate the pre-trained 2D relative-position embeddings along the temporal dimension, so each temporal offset initially uses the same 2D values.

E3D(t,h,w)=E2D(h,w),∀tE_{3D}(t,h,w) = E_{2D}(h,w), \quad \forall t

This equation is a simplified way to show initialization; later video training learns the temporal variation.

With these minimal modifications, most layers (like self-attention, FFN layers) can directly inherit 2D pre-trained weights. Finally, they use a dynamic window size strategy to reduce memory pressure, using smaller windows in the early stages and larger windows later on.

Space-Time-Modality

Returning to the initial diagram:

  1. Space: Visual understanding of scene classification and object detection.
  2. Time: Dynamic video understanding with time series.
  3. Modality: Integration of text descriptions and image mappings.

Starting from a shared image-text pretrained model, the authors attach separate object-level, fine-grained vision-language, and video adapters to address these axes.

Discussion

In the experimental results section, there are ten charts. Let’s focus on a few key points.

Zero-Shot Classification Transfer

This experiment directly uses the Florence model to predict whether an image and text are semantically aligned.

Florence has the highest reported score on 9 of the 12 zero-shot classification datasets in the table. On ImageNet-1K, it reaches 83.74% Top-1 and 97.18% Top-5 accuracy.

Linear Probe Classification

In this experiment, the Florence image encoder is frozen, and only the additional linear layers are adjusted to evaluate the generalization ability of the feature representations.

Florence has the highest reported linear-probe score on 9 of 11 classification benchmarks. It does not lead on CIFAR10 or CIFAR100; the authors suggest those datasets' original 32×3232 \times 32 image resolution may affect the comparison.

ImageNet-1K Fine-Tuning

In this experiment, category names are passed through the text encoder to obtain feature embeddings, and category templates from ImageNet are used to extend the descriptions.

In this supervised ImageNet-1K fine-tuning evaluation, Florence reaches 90.05% Top-1 and 99.02% Top-5 accuracy, above the listed BiT and ALIGN results. Its Top-1 remains below CoAtNet-7's 90.88%. The table lists about 3.8 times as many backbone parameters and 3.3 times as much pretraining data for CoAtNet-7.

Image-Text Retrieval Results

Zero-shot transfer and fine-tuning evaluations for image-text retrieval were conducted on the Flickr30k and MSCOCO datasets.

Florence's fine-tuned rows have the highest R@1 in both retrieval directions on the listed Flickr30K and MSCOCO comparisons. A few zero-shot R@5 columns are led by other models. The paper's efficiency comparison concerns fine-tuning epochs—about 6% and 8% of ALIGN's for the two datasets—not measured total compute or wall-clock cost.

Zero-Shot Transfer in Object Detection

The left side of the figure shows supervised fine-tuning examples on COCO, Objects365, and Visual Genome; the right side shows cross-domain zero-shot transfer examples.

On those three supervised detection benchmarks, Florence exceeds the listed comparison rows. Visual Genome reports AP50, whereas the other two report AP averaged across IoU thresholds:

For zero-shot transfer, the authors freeze CoSwin, train a category-agnostic proposal adapter on FLOD-9M, then classify proposals without target-class training. The following table covers 11 cross-domain datasets:

Florence exceeds the listed 5-shot fine-tuning baseline on 7 of 11 datasets. It also exceeds the full-data baseline on Packages, which has only 26 training images; BCCD and Chess Pieces remain well below supervised fine-tuning.

VQA Evaluation Results

  • Model Setup:
    • The image encoder is replaced with Florence’s CoSwin-H.
    • The text embedding layer and modality-specific embeddings remain; weight decay is disabled for both.
    • Pre-trained using ITM and MLM for 43 epochs, with an image input size of 384.
  • Downstream Task:
    • Visual Question Answering (VQA): Answering questions based on image content (3,129 possible answers).
    • The model uses binary cross-entropy loss and fine-tuned for 10 epochs with a learning rate of 8×10−68 \times 10^{-6}.

Florence reports 80.16 on test-dev and 80.36 on test-std, just above SimVLM's 80.03 / 80.34 in the table. For this VQA result, the image encoder first received pretraining on 900 million image-text pairs; the subsequent vision-language stage uses about 20 million captions. Neither stage should be described as training on only nine million pairs, and these rows do not isolate data efficiency.

Conclusion

Although the paper focuses on the "foundation model" direction, its 637M-parameter visual backbone is smaller than some larger models. The full two-tower pretrained model has 893M parameters.

The authors believe that, although the model size is smaller than some existing models with tens of billions of parameters, the experimental results show that Florence has successfully extended to multiple tasks, including spatial, temporal, and cross-modal applications, while demonstrating excellent transfer abilities.

Since initial results have been achieved on a "smaller-scale" model, the next step will likely be expanding to larger models, and we look forward to seeing what comes next.