Skip to main content
QUICK REVIEW

[Paper Review] Inter-Instance Similarity Modeling for Contrastive Learning

Chengchao Shen, Dawei Liu|arXiv (Cornell University)|Jun 21, 2023
Advanced Image and Video Retrieval TechniquesComputer Science6 citations
TL;DR

This paper proposes PatchMix, a novel image mixing method for Vision Transformers that models rich inter-instance similarities by randomly combining patches from multiple images in a mini-batch. By enabling multi-image mixing at the patch level, PatchMix enhances contrastive learning through mix-to-origin, mix-to-mix, and origin-to-origin contrasts, achieving state-of-the-art performance with 3.0% linear accuracy gain on ImageNet-1K and 8.7% kNN accuracy improvement on CIFAR100.

ABSTRACT

The existing contrastive learning methods widely adopt one-hot instance discrimination as pretext task for self-supervised learning, which inevitably neglects rich inter-instance similarities among natural images, then leading to potential representation degeneration. In this paper, we propose a novel image mix method, PatchMix, for contrastive learning in Vision Transformer (ViT), to model inter-instance similarities among images. Following the nature of ViT, we randomly mix multiple images from mini-batch in patch level to construct mixed image patch sequences for ViT. Compared to the existing sample mix methods, our PatchMix can flexibly and efficiently mix more than two images and simulate more complicated similarity relations among natural images. In this manner, our contrastive framework can significantly reduce the gap between contrastive objective and ground truth in reality. Experimental results demonstrate that our proposed method significantly outperforms the previous state-of-the-art on both ImageNet-1K and CIFAR datasets, e.g., 3.0% linear accuracy improvement on ImageNet-1K and 8.7% kNN accuracy improvement on CIFAR100. Moreover, our method achieves the leading transfer performance on downstream tasks, object detection and instance segmentation on COCO dataset. The code is available at https://github.com/visresearch/patchmix

Motivation & Objective

  • Address the limitation of existing contrastive learning methods that rely on one-hot instance discrimination, which ignores rich inter-instance similarities in natural images.
  • Overcome the monotonous similarity objective in contrastive learning that fails to capture intra-class and inter-class similarities beyond positive pairs from the same image.
  • Improve unsupervised representation learning by modeling soft, complex similarity relations among multiple images in an unsupervised manner.
  • Enhance generalization and transferability of self-supervised models, especially for local-structure-sensitive downstream tasks like object detection and instance segmentation.
  • Develop a patch-level mixing strategy compatible with Vision Transformers that enables flexible, efficient mixing of more than two images.

Proposed method

  • Propose PatchMix, a patch-level image mixing method that randomly combines patch sequences from multiple images in a mini-batch to form hybrid image sequences.
  • Construct mixed images by sampling patches from different source images, preserving local visual components (e.g., dog head, bird wing) to simulate realistic inter-instance similarities.
  • Implement a three-stream contrastive learning framework: mix-to-origin, mix-to-mix, and origin-to-origin contrasts to model diverse similarity relations.
  • Use a temperature-scaled similarity metric in the contrastive objective to stabilize training and improve representation quality.
  • Leverage the inherent sequence nature of Vision Transformers to maintain long-range dependency learning through non-consecutive patch mixing.
  • Train the ViT model using a joint contrastive objective that balances positive pairs from mixed, original, and mixed-to-mixed samples.

Experimental results

Research questions

  • RQ1Can modeling richer inter-instance similarities among multiple images improve self-supervised representation learning in contrastive learning?
  • RQ2How does multi-image patch-level mixing compare to traditional two-image mix methods like Mixup and CutMix in capturing complex visual similarities?
  • RQ3To what extent does PatchMix reduce the distribution gap between the contrastive objective and real-world image similarity distributions?
  • RQ4Does PatchMix improve transfer performance on downstream tasks that require fine-grained local structure understanding, such as object detection and instance segmentation?
  • RQ5Can PatchMix mitigate representation degeneration and overfitting on small-scale datasets like CIFAR10 and CIFAR100 without additional data?

Key findings

  • PatchMix achieves a 3.0% improvement in linear evaluation accuracy on ImageNet-1K compared to previous state-of-the-art methods.
  • On CIFAR100, PatchMix achieves an 8.7% improvement in kNN accuracy, demonstrating stronger generalization and representation quality.
  • The method achieves state-of-the-art performance on object detection and instance segmentation tasks using the COCO dataset, confirming strong transferability.
  • Performance improves with longer pretraining schedules, reaching saturation at 800 epochs, indicating stable and scalable training dynamics.
  • Visualization confirms that PatchMix establishes significantly richer similarity distributions among related and same-category images than DINO or SDMP.
  • The model trained with PatchMix shows superior generalization, especially in capturing component-level similarities across different image instances.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.