Unicom: Universal and Compact Representation Learning for Image Retrieval

Xiang An, Jiankang Deng, Kaicheng Yang, Jaiwei Li, Ziyong Feng, Jia Guo, Jing Yang, Tongliang Liu

In the field of computer vision, image retrieval—the ability to find semantically similar images within massive databases—is a fundamental task. This technology powers everything from e-commerce product searches to biodiversity monitoring. At its core, image retrieval relies on "embeddings," which are compact numerical summaries of an image's content.

However, traditional models often face a trade-off between universality and efficiency. Models trained on narrow datasets like ImageNet lack the breadth to generalize to open-world scenarios, while self-supervised models like CLIP can suffer from a "semantic gap," where different images of the same category are treated as distinct entities. A new framework, UNICOM (Universal and Compact representation learning), addresses these challenges by bridging large-scale pre-training with a robust, compact descriptor architecture.

The Challenge: Universality and Semantic Gaps

Modern image retrieval systems encounter two primary hurdles:

  1. The Universality Gap: Models pre-trained on human-labeled datasets are often limited to a few thousand categories, failing to capture the diversity of the real world.
  2. The Semantic Gap in Self-Supervision: Contrastive models typically employ "instance discrimination," treating every image as its own unique class. This can be counter-productive; for example, two different photos of a "golden retriever" might be pushed apart in the embedding space despite being semantically identical.

While clustering images into "pseudo-classes" can mitigate this, scaling to hundreds of millions of images (like the LAION-400M dataset) introduces "inter-class conflict"—noisy, overlapping labels where semantically similar clusters are incorrectly differentiated.

The UNICOM Framework

UNICOM introduces a two-stage pipeline designed to create robust, high-performance representations at scale.

1. Multi-modal Clustering

To ground the visual features in semantic meaning, UNICOM utilizes a pre-trained CLIP model to extract both visual and textual features from the LAION-400M dataset. By performing a massive, one-time offline clustering step, the framework groups 400 million instances into one million pseudo-classes. The inclusion of text provides a semantic "anchor," ensuring that clusters are more accurate than those generated by vision-only methods.

The UNICOM multi-modal clustering pipeline uses both image and text encoders to group 400 million images into one million semantic pseudo-classes.

2. Dual Random Partial Selections

To train a classifier effectively on these one million noisy classes, UNICOM employs two innovative sampling strategies:

  • Random Class Selection: Instead of comparing an image against all one million classes simultaneously, the model samples a subset of negative classes for each training step. This acts as a natural filter against the inherent noise of automated clustering, reducing the likelihood of receiving conflicting gradient signals from semantically similar but differently labeled classes.
  • Random Feature Selection: To ensure embeddings are "compact," the model randomly selects a subset of feature dimensions during training. This forces every dimension to carry significant information, preventing the model from relying on a few dominant features.

Key Results and Impact

UNICOM sets new benchmarks across 13 classification tasks and 7 major image retrieval datasets, including CUB-200-2011 and Google Landmarks v2. On average, UNICOM (ViT-L/14) achieved a 69.9% retrieval result, outperforming standard Open-CLIP by 7.5%.

One of the most significant advantages of UNICOM is its efficiency. The "forced compactness" of the training phase allows the model to maintain remarkably high performance even when embeddings are truncated to very low dimensions. As shown in the evaluation on the CUB dataset, UNICOM at just 32 dimensions can outperform many competing methods using 512 dimensions.

Performance comparison on the CUB dataset: UNICOM maintains high Recall@1 even as the embedding dimension is significantly reduced.

Conclusion

UNICOM demonstrates that large-scale representation learning can be both universal and compact. By leveraging multi-modal clustering and noise-robust sampling, it provides a scalable solution for high-performance image retrieval in the open world. Future work may explore "online" clustering to further refine category assignments as the model evolves, potentially removing the need for an initial multi-modal teacher.

Summary updated

BibTeX
@inproceedings{an2023unicom,
  author = {Xiang An and Jiankang Deng and Kaicheng Yang and Jaiwei Li and Ziyong Feng and Jia Guo and Jing Yang and Tongliang Liu},
  title = {{Unicom: Universal and Compact Representation Learning for Image Retrieval}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=3YFDsSRSxB-},
}
Figure