CODER: Coupled Diversity-Sensitive Momentum Contrastive Learning for Image-Text Retrieval

Haoran Wang, Dongliang He, Wenhao Wu, Boyang Xia, Min Yang, Fu Li, Yunlong Yu, Zhong Ji, Errui Ding, Jingdong Wang · DOI

Abstract

Image-Text Retrieval (ITR) is a fundamental task in cross-modal understanding. Traditional contrastive learning methods often struggle with semantic ambiguity and the limited availability of negative samples during training. We propose CODER (Coupled Diversity-Sensitive Momentum Contrastive Learning), a framework designed to make contrastive learning "diversity-aware." By adaptively weighting negative samples based on their semantic density and incorporating external commonsense knowledge, CODER achieves state-of-the-art results on MSCOCO and Flickr30K benchmarks while significantly improving inference efficiency compared to cross-attention models.

Introduction

The core of Image-Text Retrieval (ITR) lies in learning a shared embedding space where semantically related images and texts are pulled together. However, existing contrastive learning paradigms face three primary limitations:

  1. Memory Constraints: GPU memory limits the number of negative samples per batch.
  2. Uniform Weighting: Treating all negative samples as equally important ignores the informative nature of "hard" negatives.
  3. Knowledge Gap: Relying solely on paired data misses broader semantic relationships.

CODER addresses these by introducing a diversity-sensitive loss and a dual-branch architecture that leverages both instance-level features and high-level concepts.

Methodology

Diversity-Sensitive Contrastive Learning (DCL)

The primary innovation of CODER is the Diversity-Sensitive Contrastive Learning (DCL) mechanism. It identifies semantically ambiguous anchors—those with many negative samples at similar distances—and assigns them higher weights in the loss function.

Conceptual illustration of diversity-sensitive learning. (a-d) show abstract point distributions, while (e) provides a concrete example of semantic ambiguity between an image and multiple text descriptions.

As shown in Figure 3, an anchor image (like the dog jumping) may have several captions that are semantically close but not exact matches. DCL calculates a "Diversity Score" based on the standard deviation of similarities to negatives, forcing the model to learn finer-grained distinctions in crowded regions of the embedding space.

System Architecture

CODER utilizes a dual-branch architecture to capture both fine-grained details and high-level semantics.

The CODER architecture, featuring (a) Instance-level branch with momentum encoders, (b) Concept-level branch with commonsense graphs, and (c-d) the associated loss functions (DCL and PGC).
  1. Instance Branch: Processes raw image regions (Faster R-CNN) and text tokens (BERT). It uses Coupled Momentum Contrastive Learning (MCL) to maintain large queues of negative samples, allowing the model to see thousands of negatives without massive batch sizes.
  2. Concept Branch: Bridges the modality gap using a Commonsense Knowledge Graph. It maps images and text to high-level concepts processed via a Graph Convolutional Network (GCN).
  3. Prototype-Guided Classification (PGC): Performs online clustering to align image and text embeddings for the same concept into shared semantic "prototypes."

Experiments and Results

CODER was evaluated on the MSCOCO and Flickr30K benchmarks, setting a new high bar for performance.

State-of-the-Art Performance

On MSCOCO (1K test), CODER achieved a Recall@1 of 82.1% for text retrieval and 65.5% for image retrieval, outperforming previous leaders like SGRAF. On Flickr30K, it surpassed the previous best "R@sum" (the sum of all recall metrics) by a staggering 13.7%.

Efficiency and Visualization

Unlike heavy cross-attention models that are slow at test time, CODER follows a dual-encoder design. This allows for pre-computing features, resulting in inference speeds roughly 6x faster than competitors. T-SNE visualizations confirm that CODER produces a highly structured embedding space with clear semantic clusters, rather than a uniform cloud.

Conclusion

CODER demonstrates that accounting for semantic ambiguity through diversity-sensitive weighting significantly enhances cross-modal retrieval. By combining momentum-based negative sampling with a concept-aware dual-branch architecture, it provides a robust and efficient solution for large-scale image-text search. Future work includes scaling this paradigm to billion-parameter vision-language models and refining the dependency on pre-defined knowledge graphs.

Summary updated

BibTeX
@inproceedings{wang2022coder,
  author = {Haoran Wang and Dongliang He and Wenhao Wu and Boyang Xia and Min Yang and Fu Li and Yunlong Yu and Zhong Ji and Errui Ding and Jingdong Wang},
  title = {{CODER: Coupled Diversity-Sensitive Momentum Contrastive Learning for Image-Text Retrieval}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-20059-5\_40},
}
Figure