TasksSotADatasetsPapersMethodsSubmitAbout
Papers With Code 2

A community resource for machine learning research: papers, code, benchmarks, and state-of-the-art results.

Explore

Notable BenchmarksAll SotADatasetsPapersMethods

Community

Submit ResultsAbout

Data sourced from the PWC Archive (CC-BY-SA 4.0). Built by the community, for the community.

Papers/CoCa: Contrastive Captioners are Image-Text Foundation Mod...

CoCa: Contrastive Captioners are Image-Text Foundation Models

Jiahui Yu, ZiRui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, Yonghui Wu

2022-05-04Zero-Shot Cross-Modal RetrievalVideo RetrievalImage ClassificationAction ClassificationRepresentation LearningVisual EntailmentImage CaptioningVisual ReasoningZero-Shot Transfer Image ClassificationRetrievalVisual Question Answering (VQA)Visual Question Answering
PaperPDFCodeCodeCodeCodeCodeCode

Abstract

Exploring large-scale pretrained foundation models is of significant interest in computer vision because these models can be quickly transferred to many downstream tasks. This paper presents Contrastive Captioner (CoCa), a minimalist design to pretrain an image-text encoder-decoder foundation model jointly with contrastive loss and captioning loss, thereby subsuming model capabilities from contrastive approaches like CLIP and generative methods like SimVLM. In contrast to standard encoder-decoder transformers where all decoder layers attend to encoder outputs, CoCa omits cross-attention in the first half of decoder layers to encode unimodal text representations, and cascades the remaining decoder layers which cross-attend to the image encoder for multimodal image-text representations. We apply a contrastive loss between unimodal image and text embeddings, in addition to a captioning loss on the multimodal decoder outputs which predicts text tokens autoregressively. By sharing the same computational graph, the two training objectives are computed efficiently with minimal overhead. CoCa is pretrained end-to-end and from scratch on both web-scale alt-text data and annotated images by treating all labels simply as text, seamlessly unifying natural language supervision for representation learning. Empirically, CoCa achieves state-of-the-art performance with zero-shot transfer or minimal task-specific adaptation on a broad range of downstream tasks, spanning visual recognition (ImageNet, Kinetics-400/600/700, Moments-in-Time), crossmodal retrieval (MSCOCO, Flickr30K, MSR-VTT), multimodal understanding (VQA, SNLI-VE, NLVR2), and image captioning (MSCOCO, NoCaps). Notably on ImageNet classification, CoCa obtains 86.3% zero-shot top-1 accuracy, 90.6% with a frozen encoder and learned classification head, and new state-of-the-art 91.0% top-1 accuracy on ImageNet with a finetuned encoder.

Results

TaskDatasetMetricValueModel
VideoMSR-VTTtext-to-video R@130CoCa (zero-shot)
VideoMSR-VTTtext-to-video R@1061.6CoCa (zero-shot)
VideoMSR-VTTtext-to-video R@552.4CoCa (zero-shot)
VideoMSR-VTTvideo-to-text R@149.9CoCa (zero-shot)
VideoMSR-VTTvideo-to-text R@1081.4CoCa (zero-shot)
VideoMSR-VTTvideo-to-text R@573.4CoCa (zero-shot)
VideoKinetics-700Top-1 Accuracy82.7CoCa (finetuned)
VideoKinetics-700Top-1 Accuracy81.1CoCa (frozen)
VideoMoments in TimeTop 1 Accuracy49CoCa (finetuned)
VideoMoments in TimeTop 1 Accuracy47.4CoCa (frozen)
VideoKinetics-400Acc@188.9CoCa (finetuned)
VideoKinetics-400Acc@188CoCa (frozen)
VideoKinetics-600Top-1 Accuracy89.4CoCa (finetuned)
VideoKinetics-600Top-1 Accuracy88.5CoCa (frozen)
Visual Question Answering (VQA)VQA v2 test-devAccuracy82.3CoCa
Visual ReasoningNLVR2 DevAccuracy86.1CoCa
Visual ReasoningNLVR2 TestAccuracy87CoCa
Natural Language InferenceSNLI-VE valAccuracy87CoCa
Natural Language InferenceSNLI-VE testAccuracy87.1CoCa
Image CaptioningCOCO CaptionsBLEU-440.9CoCa
Image CaptioningCOCO CaptionsCIDER143.6CoCa
Image CaptioningCOCO CaptionsMETEOR33.9CoCa
Image CaptioningCOCO CaptionsSPICE24.7CoCa
Image Retrieval with Multi-Modal QueryFlickr30kImage-to-text R@192.5CoCa
Image Retrieval with Multi-Modal QueryFlickr30kImage-to-text R@1099.9CoCa
Image Retrieval with Multi-Modal QueryFlickr30kImage-to-text R@599.5CoCa
Image Retrieval with Multi-Modal QueryFlickr30kText-to-image R@180.4CoCa
Image Retrieval with Multi-Modal QueryFlickr30kText-to-image R@1097.7CoCa
Image Retrieval with Multi-Modal QueryFlickr30kText-to-image R@595.7CoCa
Image Retrieval with Multi-Modal QueryCOCO 2014Image-to-text R@166.3CoCa
Image Retrieval with Multi-Modal QueryCOCO 2014Image-to-text R@1091.8CoCa
Image Retrieval with Multi-Modal QueryCOCO 2014Image-to-text R@586.2CoCa
Image Retrieval with Multi-Modal QueryCOCO 2014Text-to-image R@151.2CoCa
Image Retrieval with Multi-Modal QueryCOCO 2014Text-to-image R@1082CoCa
Image Retrieval with Multi-Modal QueryCOCO 2014Text-to-image R@574.2CoCa
Image ClassificationObjectNetTop-1 Accuracy82.7CoCa
Video RetrievalMSR-VTTtext-to-video R@130CoCa (zero-shot)
Video RetrievalMSR-VTTtext-to-video R@1061.6CoCa (zero-shot)
Video RetrievalMSR-VTTtext-to-video R@552.4CoCa (zero-shot)
Video RetrievalMSR-VTTvideo-to-text R@149.9CoCa (zero-shot)
Video RetrievalMSR-VTTvideo-to-text R@1081.4CoCa (zero-shot)
Video RetrievalMSR-VTTvideo-to-text R@573.4CoCa (zero-shot)
Zero-Shot Transfer Image ClassificationImageNet V2Accuracy (Private)80.7CoCa
Zero-Shot Transfer Image ClassificationImageNet-AAccuracy (Private)90.2CoCa
Zero-Shot Transfer Image ClassificationImageNetAccuracy (Private)86.3CoCa
Zero-Shot Transfer Image ClassificationImageNet-RAccuracy96.5CoCa
Zero-Shot Transfer Image ClassificationObjectNetAccuracy (Private)82.7CoCa
Zero-Shot Transfer Image ClassificationImageNet-SketchAccuracy (Private)77.6CoCa
Visual Question AnsweringVQA v2 test-devAccuracy82.3CoCa

Related Papers

Touch in the Wild: Learning Fine-Grained Manipulation with a Portable Visuo-Tactile Gripper2025-07-20Automatic Classification and Segmentation of Tunnel Cracks Based on Deep Learning and Visual Explanations2025-07-18Adversarial attacks to image classification systems using evolutionary algorithms2025-07-17Efficient Adaptation of Pre-trained Vision Transformer underpinned by Approximately Orthogonal Fine-Tuning Strategy2025-07-17Federated Learning for Commercial Image Sources2025-07-17MUPAX: Multidimensional Problem Agnostic eXplainable AI2025-07-17Spectral Bellman Method: Unifying Representation and Exploration in RL2025-07-17Boosting Team Modeling through Tempo-Relational Representation Learning2025-07-17