Billion-Scale Pretraining with Vision Transformers for Multi-Task Visual Representations

Josh Beal, Hao-Yu Wu, Dong Huk Park, Andrew Zhai, Dmitry Kislyuk

TL;DR

Pinterest researchers have successfully scaled visual pretraining to a staggering 1.3 billion images, transitioning their core "Unified Visual Embedding" system from traditional CNNs to Vision Transformers (ViT). This shift, powered by a novel weakly-supervised label generation pipeline, resulted in a massive 36% improvement in relevance and a 23% boost in click-through volume for their production visual shopping tools.

What Problem Does This Paper Address?

While large-scale pretraining is a staple of modern computer vision research, its application at "extreme scale" within complex, multi-task production environments remains under-documented. Engineers at Pinterest faced a classic industrial challenge: how to build a single, high-capacity representation that powers dozens of downstream tasks—from skin-tone classification to billion-scale image retrieval—while outperforming highly optimized, domain-specific models.

Specifically, they addressed two hurdles:

  1. Data Quality at Scale: How do you generate meaningful labels for over a billion images when user-provided text is noisy, abstract, or incomplete?
  2. Architecture Evolution: Can Vision Transformers (ViTs) actually supplant the industry-standard ResNet/ResNeXt architectures in a high-throughput production setting?

Methods

The authors introduce a two-pronged approach: a massive new dataset and a transition to Transformer-based backbones.

The Label Generation Pipeline

To create their Annotations-1.3B dataset, the team developed a systematic way to turn noisy web signals into clean training labels. As shown in Figure 2, the process involves:

  • Visual Dictionary Restriction: They algorithmically assigned a "concreteness score" to terms. By training small classifiers to see if a term (like "jaguar") could actually be distinguished based on visual features alone, they filtered out abstract terms that confuse models.
  • Annotation Clustering & L1 Restriction: To handle the "long-tail" distribution of labels and polysemy (e.g., "jaguar" the animal vs. "jaguar" the car), they used k-means clustering on text embeddings and restricted labels to match the broad category (L1 interest) of the image.
Overview of the label generation procedure

Architecture Shift

The paper details the migration from a ResNeXt-101 backbone to Vision Transformers (ViT-B/16 and ViT-B/32). They integrated these into a multi-task learning framework that jointly optimizes for classification, metric learning (triplet loss), and fairness-aware regularization.

The Unified Visual Embedding architecture, showing the transition to ViT

Datasets

  • Annotations-1.3B: A new internal dataset of 1.329 billion images with 18k labels, derived from Pinterest's image corpus and metadata.
  • Evaluation Benchmarks: The models were tested on internal production sets—Visual Shopping (VS), Flashlight, and Lens—as well as public benchmarks like ImageNet-1k and ObjectNet to test cross-domain generalization.

Key Insights and Ideas

  • The ViT Scaling Advantage: One of the most critical findings is that while CNNs (ResNeXt) perform slightly better at small data scales, ViTs have a much higher performance ceiling. As the dataset grows toward 1.3B images, the ViT architecture begins to significantly outpace the CNN.
Retrieval performance scales better with ViT as dataset size increases
  • Concreteness Matters: Simply having more data isn't enough. The authors found that filtering the dictionary for "visually concrete" terms provided a measurable boost in retrieval precision.
  • Production Efficiency: Contrary to the perception that Transformers are "slow," the team found that ViT-B/16 (224x resolution) actually had lower single-image inference latency (8.7ms) compared to their ResNeXt-101 baseline (15.6ms), making it a win for both accuracy and system cost.

Key Results

  • Production Impact: In A/B testing on Pinterest's Visual Shopping system, the ViT-based model increased click-through volume by 23%.
  • Relevance: Human evaluators found a 38% relative improvement in "extremely similar" results compared to the previous production model.
  • Zero-Shot Gains: The pretraining was so effective that it doubled the performance (from 42.4% to 84.9% R@P95) on a near-duplicate image detection task, even though the model wasn't specifically trained for it.
Qualitative comparison showing ViT-B/16 matching more similar product results

Limitations and Future Work

  • Resolution Constraints: Due to the quadratic complexity of self-attention, the authors were limited in how much they could increase image resolution or decrease patch size (e.g., moving to 8x8 patches) without hitting GPU memory walls.
  • Model Capacity: While 1.3B images is massive, the authors suggest that even larger "Huge" or "Giant" ViT variants might be needed to fully saturate the potential of such a large dataset.
  • Future Directions: The team points toward exploring parallel scaling of model capacity alongside dataset size to see where the point of diminishing returns truly lies.

Summary updated

BibTeX
@inproceedings{beal2022billion,
  author = {Josh Beal and Hao-Yu Wu and Dong Huk Park and Andrew Zhai and Dmitry Kislyuk},
  title = {{Billion-Scale Pretraining with Vision Transformers for Multi-Task Visual Representations}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2022},
  url = {https://openreview.net/forum?id=z4MPE23Wxg},
}
Figure