RankCLIP: Ranking-Consistent Language-Image Pretraining

Yiming Zhang, Zhuokai Zhao, Zhaorun Chen, Zhili Feng, Zenghui Ding, Yining Sun · DOI

Abstract

Contrastive Language-Image Pretraining (CLIP) has set a new standard for vision-language tasks but relies on a rigid one-to-one matching objective that ignores nuanced semantic relationships. We present RankCLIP, a framework that introduces list-wise ranking consistency to capture many-to-many relationships both within and across modalities. By enforcing a consistent similarity structure, RankCLIP achieves superior zero-shot performance, enhanced robustness to distribution shifts, and a reduced "modality gap."

Introduction: Beyond One-to-One Matching

The success of CLIP stems from its ability to align visual and textual representations through a contrastive objective. Despite its efficacy, this "all-or-nothing" matching mechanism overlooks a fundamental truth: semantic relationships are multifaceted. For instance, an image of a dog is semantically closer to the text "cat" than to "airplane." Standard CLIP treats both "cat" and "airplane" as equally incorrect negatives, discarding valuable structural information.

Conceptual comparison between standard Contrastive Loss and RankCLIP's latent attribute-based ranking.

By ignoring these "many-to-many" relationships and secondary similarities among unmatched pairs, standard CLIP leaves significant information on the table. This leads to a less organized embedding space and a persistent "modality gap" where image and text clusters remain disjointed in the vector space.

Methodology: Enforcing Ranking Consistency

RankCLIP addresses these limitations by supplementing traditional pairwise loss with a list-wise ranking loss. The core idea is to enforce "Ranking Consistency" through two new components:

  1. Cross-modal Ranking Consistency: This ensures that the similarity ranking of a set of text descriptions relative to a specific image is consistent with the ranking of corresponding images relative to the matching text. It forces the model to learn a symmetric, consistent structure across data types.
  2. In-modal Ranking Consistency: This ensures that if two images are visually similar, their corresponding textual descriptions should maintain a similar proximity in the embedding space (and vice-versa).
The RankCLIP architecture featuring cross-modal and in-modal ranking consistency losses.

Implementation and Curriculum Learning

The model utilizes the Plackett-Luce (PL) ranking model, a probabilistic way to measure how well a predicted ranking matches a reference ranking. To handle the initial instability of random weights, the authors employ a curriculum learning strategy. The weights of the ranking losses are gradually increased as training progresses, allowing the model to master basic feature alignment before optimizing for complex semantic hierarchies.

Experimental Results

RankCLIP was evaluated using standard benchmarks including CC3M and YFCC15M for training, and ImageNet1K for zero-shot evaluation.

Zero-Shot Performance and Robustness

On ImageNet1K (trained on CC3M), RankCLIP achieved a top-1 accuracy of 10.16%, outperforming standard CLIP (9.06%) and other advanced variants. These gains were even more pronounced when testing for robustness against distribution shifts; on ImageNetV2-Matched, RankCLIP improved top-1 accuracy by approximately 1.5% over the CLIP baseline.

Generalization and Visual Grounding

Linear probing across 10 diverse downstream tasks (e.g., CIFAR, Food101) confirmed that RankCLIP learns more generalizable representations. Furthermore, qualitative analysis via Grad-CAM revealed that RankCLIP exhibits superior visual grounding, focusing more precisely on relevant objects rather than background context (e.g., focusing tightly on an aircraft rather than the surrounding tarmac).

Conclusion and Future Work

RankCLIP demonstrates that extracting signals from "unmatched" pairs through ranking consistency significantly enhances the semantic depth of learned representations. While retrieval task improvements remain modest due to the fine-grained nature of those challenges, the framework successfully narrows the modality gap and improves zero-shot classification. Future research will explore scaling RankCLIP to web-scale datasets like LAION-5B and investigating alternative ranking models to further refine retrieval performance.

Summary updated

BibTeX
@misc{zhang2024rankclip,
  author = {Yiming Zhang and Zhuokai Zhao and Zhaorun Chen and Zhili Feng and Zenghui Ding and Yining Sun},
  title = {{RankCLIP: Ranking-Consistent Language-Image Pretraining}},
  year = {2024},
  eprint = {2404.09387},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2404.09387},
}
Figure