CLIPLoss and Norm-Based Data Selection Methods for Multimodal Contrastive Learning

Yiping Wang, Yifang Chen, Wendan Yan, Alex Fang, Wenjing Zhou, Kevin Jamieson, Simon Shaolei Du · OpenReview

Abstract

Data selection has emerged as a core issue for large-scale visual-language model pretraining (e.g., CLIP), particularly with noisy web-curated datasets. Three main data selection approaches are: (1) leveraging external non-CLIP models to aid data selection, (2) training new CLIP-style embedding models that are more effective at selecting high-quality data than the original OpenAI CLIP model, and (3) designing better metrics or strategies universally applicable to any CLIP embedding without requiring specific model properties (e.g., CLIPScore is one popular metric). While the first two approaches have been extensively studied, the third remains under-explored. In this paper, we advance the third approach by proposing two new methods. Firstly, instead of classical CLIP scores that only consider the alignment between two modalities from a single sample, we introduce negCLIPLoss, a CLIP loss-inspired method that adds the alignment between one sample and its contrastive pairs as an extra normalization term for better quality measurement. Secondly, when downstream tasks are known, we propose a new norm-based metric, NormSim, to measure the similarity between pretraining data and target data. We test our methods on the data selection benchmark, DataComp. Compared to the best baseline using only OpenAI's CLIP-L/14, our methods achieve a 5.3% improvement on ImageNet-1k and a 2.8% improvement on 38 downstream evaluation tasks. Moreover, both negCLIPLoss and NormSim are compatible with existing techniques. By combining our methods with the current best methods DFN and HYPE, we can boost average performance on downstream tasks by 0.9%, achieving a new state-of-the-art.

Introduction

Training powerful vision-language models like CLIP requires massive amounts of data, usually scraped from the web. However, web data is incredibly noisy; many image-text pairs are mismatched, low-quality, or irrelevant to specific downstream tasks. The standard approach to mitigate this is "data selection." Currently, the most common metric is CLIPScore (the cosine similarity between an image and its caption).

CLIPScore has a significant flaw: it evaluates each pair in isolation. This allows generic captions (e.g., "Listing Image 7") to achieve high scores across many different images, leading to the inclusion of low-quality data. While some state-of-the-art methods use heavy "teacher" models for filtering, these are computationally expensive. This research proposes two efficient, universally applicable metrics: s-CLIPLoss and NormSim.

Proposed Methods

The authors introduce two distinct strategies to refine data selection without requiring external models or massive retraining:

s-CLIPLoss (surrogate-CLIPLoss)

Instead of just looking at the similarity between an image and its own caption, s-CLIPLoss introduces a normalization term ($\mathfrak{N}$). This term measures how well a sample matches other contrastive pairs in a batch. If a caption matches many different images (indicating it is generic), the normalization term penalizes it. This effectively "de-biases" the quality score, ensuring that only highly specific and well-aligned pairs are selected.

The mathematical definition of s-CLIPLoss and its normalization term.

NormSim (p-Norm Similarity)

When downstream tasks are known (e.g., identifying objects in ImageNet), NormSim can be used to select pretraining data that is distributionally similar to the target. It uses a $p$-norm metric to measure similarity in the vision embedding space, allowing the model to specialize on relevant data while maintaining the benefits of large-scale pretraining.

Experimental Results

The methods were evaluated on the DataComp-medium benchmark (128M image-text pairs) across 38 downstream tasks, including ImageNet-1k and MSCOCO.

Addressing the "Image" Bias

A key insight is that captions containing generic words like "image" or "photo" often yield high CLIPScores despite poor descriptive quality. s-CLIPLoss identifies these because they match many images across the batch, resulting in a high normalization penalty.

Example of a generic real-estate caption being correctly identified as low-quality by the normalization term.

Performance and Efficiency

  • Accuracy Gains: Using standard OpenAI CLIP-L/14 embeddings, the new methods improved ImageNet-1k accuracy by 5.3% and average performance across 38 tasks by 2.8%.
  • State-of-the-Art: Combining s-CLIPLoss and NormSim with existing top-tier methods like DFN and HYPE achieved a new SOTA on the DataComp-medium leaderboard.
  • Computational Efficiency: Unlike methods requiring hundreds of GPU hours for OCR or LLM-based filtering, s-CLIPLoss is nearly "free" once embeddings are computed, reducing preprocessing time from 900+ hours to just 5 hours at scale.

Conclusion

s-CLIPLoss and NormSim provide a robust, efficient, and universal way to improve data selection for multimodal models. These metrics are orthogonal to existing filtering networks, allowing for easy integration into current pipelines to achieve superior performance with significantly lower computational overhead.

Summary updated

BibTeX
@inproceedings{wang2024cliploss,
  author = {Yiping Wang and Yifang Chen and Wendan Yan and Alex Fang and Wenjing Zhou and Kevin Jamieson and Simon Shaolei Du},
  title = {{CLIPLoss and Norm-Based Data Selection Methods for Multimodal Contrastive Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=TJ49WYbbkT},
}
Figure