Test-Time Distribution Normalization for Contrastively Learned Vision-language Models

Yifei Zhou, Juntao Ren, Fengyu Li, Ramin Zabih, Ser-Nam Lim
2/22/2023
cs.LGcs.CLcs.CV

No official code found. Best implementation: fengyuli-dev/distribution-normalization (27 stars, last commit 2024-01-15).

Abstract

Advances in the field of vision-language contrastive learning have made it possible for many downstream applications to be carried out efficiently and accurately by simply taking the dot product between image and text representations. One of the most representative approaches proposed recently known as CLIP has garnered widespread adoption due to its effectiveness. CLIP is trained with an InfoNCE loss that takes into account both positive and negative samples to help learn a much more robust representation space. This paper reveals that the common downstream practice of taking a dot product is only a zeroth-order approximation of the optimization goal, resulting in a loss of information during test-time. Intuitively, since the model has been optimized based on the InfoNCE loss, test-time procedures should also be in alignment. The question lies in how one can retrieve any semblance of negative samples information during inference in a computationally efficient way. To this end, we propose Distribution Normalization (DN), where we approximate the mean representation of a batch of test samples and use such a mean to represent what would be analogous to negative samples in the InfoNCE loss. DN requires no retraining or fine-tuning and can be effortlessly applied during inference. Extensive experiments on a wide variety of downstream tasks exhibit a clear advantage of DN over the dot product on top of other existing test-time augmentation methods.

View on arXivView PDF

Code Implementations(1)

Test-Time Distribution Normalization For Contrastively Learned Vision-language Models

271PythonJan 30, 20232 years ago

Similar Papers

Cite this paper

@article{zhou2023testtime,
  title  = {Test-Time Distribution Normalization for Contrastively Learned Vision-language Models},
  author = {Yifei Zhou and Juntao Ren and Fengyu Li and Ramin Zabih and Ser-Nam Lim},
  year   = {2023},
  eprint = {2302.11084},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2302.11084v2},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2302.11084.svg)](https://codeofpaper.com/paper/2302.11084)

Discussion