Contrastive Cross-Modal Knowledge Sharing Pre-training for Vision-Language Representation Learning and Retrieval

Keyu Wen, Zhenshan Tan, Qingrong Cheng, Cheng Chen, Xiaodong GuarXiv 2022 · DOI

Introduction

Vision-Language Pre-training (VLP) has become a cornerstone of modern AI, enabling models to understand the relationship between images and text. However, existing architectures face a significant bottleneck: the trade-off between inference speed and retrieval accuracy. The COOKIE (Contrastive Cross-Modal Knowledge Sharing) framework addresses this by bridging the gap between slow, high-accuracy "one-stream" models and fast, lower-accuracy "double-stream" models.

The Efficiency-Accuracy Trade-off

In VLP, researchers typically choose between two paradigms:

  1. One-stream models: These concatenate image and text tokens into a single transformer. While highly accurate due to deep cross-modal interaction, they suffer from an inference time explosion ($O(N^2)$ complexity for matching).
  2. Double-stream models: These encode modalities separately into a shared embedding space. They are fast ($O(N)$ complexity) but often lack the nuanced semantic interaction required for top-tier performance.
Comparison of VLP architectures: (a) double-stream, (b) one-stream, and (c) the proposed weight-sharing approach.

The authors propose a double-stream backbone enhanced by three key innovations designed to simulate the "intelligence" of one-stream models without sacrificing speed.

Weight-Sharing Transformer Encoder (WS-TE)

Instead of keeping the two streams entirely separate, the top layers of both the visual and textual encoders share weights. This forces both paths to process information using a shared semantic logic, effectively aligning the representations of related concepts like "luggage" across modalities.

Text-Aligned Visual Transformer (TAV-TE)

To bridge the distribution gap between CNN-based visual features and Transformer-based text features, the TAV-TE module provides a global attention mechanism. This aligns the visual distribution with textual features before they enter the shared weight-sharing layers.

Triple Contrastive Learning

COOKIE employs a triple-contrastive strategy to preserve both cross-modal and unimodal knowledge:

  • Cross-Modal Contrastive Learning (CCL): Aligns images with their corresponding text.
  • Visual Contrastive Learning (VCL): Maintains the image encoder's structural understanding.
  • Textual Contrastive Learning (TCL): Ensures the text encoder retains linguistic common sense.
Detailed architecture of the COOKIE framework, illustrating the visual and text paths, TAV-TE, and weight-sharing layers.

Experimental Results

The model was pre-trained on 5.9 million image-text pairs from datasets including Conceptual Captions, SBU, MSCOCO, and Flickr30K.

Performance and Speed

COOKIE achieves state-of-the-art retrieval performance while operating at 3/1000th the inference time of mainstream one-stream competitors like Oscar. On the MSCOCO 5K test set, COOKIE reached an R@1 of 71.6, outperforming Oscar's 70.0.

Unimodal and Cross-Domain Gains

The triple-contrastive approach yielded significant improvements in unimodal tasks, with a 5.7% gain in image-to-image retrieval and a 3.9% gain in text-to-text matching. Furthermore, despite being trained on static images, COOKIE improved R@1 scores on the MSRVTT video dataset from 16.0 to 20.0.

Conclusion

By utilizing weight-sharing and triple-contrastive learning, COOKIE demonstrates that cross-modal interaction can be achieved through shared model parameters rather than data concatenation. This paradigm shift allows for high-accuracy vision-language representation learning with the efficiency required for real-world retrieval applications.

Summary updated

BibTeX
@misc{wen2022contrastive,
  author = {Keyu Wen and Zhenshan Tan and Qingrong Cheng and Cheng Chen and Xiaodong Gu},
  title = {{Contrastive Cross-Modal Knowledge Sharing Pre-training for Vision-Language Representation Learning and Retrieval}},
  year = {2022},
  eprint = {2207.00733},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2207.00733},
}
Figure