Abstract
Standard contrastive learning methods often suffer from "monotonous similarity," where models are forced to treat every image as a unique entity, ignoring natural semantic overlaps between different instances. We introduce PatchMix, a patch-level image mixing strategy specifically designed for Vision Transformers (ViT). By explicitly modeling inter-instance similarities through a novel data augmentation and a triple-loss objective framework, PatchMix produces more robust visual representations, achieving state-of-the-art performance across ImageNet, CIFAR, and COCO benchmarks.
Introduction: The Problem of Monotonous Similarity
In self-supervised learning, contrastive learning typically relies on "instance discrimination." This paradigm treats two augmented views of the same image as a positive pair and all other images in a batch as negatives. While effective, this approach utilizes one-hot targets that ignore the rich, overlapping relationships inherent in natural data.
As shown in the figure above, standard objectives force the model to push semantically similar images (e.g., two different dogs) apart in the feature space. This neglect of inter-instance relationships leads to representation degeneration, where the model fails to capture the nuances of shared categories.
The PatchMix Framework
To address this, we propose PatchMix, a framework tailored for the patch-based architecture of Vision Transformers. Unlike traditional Mixup which blends pixels, PatchMix operates on the sequence of patches, making it more "native" to the ViT architecture.
1. Patch-Level Mixing
PatchMix randomly selects patches from multiple images (optimally three) to create a hybrid "mixed" image. This allows the model to learn long-distance dependencies between unrelated patches and encourages the recognition of shared features across different instances.
2. Triple-Threat Contrastive Objective
The framework utilizes a dual-encoder setup (Base and Momentum) and optimizes three distinct losses to bridge the gap between synthetic and real-world data:
- Mix-to-Origin ($L_{mto}$): Aligns the mixed image representation with the original images that provided its patches.
- Mix-to-Mix ($L_{mtm}$): Compares different mixed images sharing underlying patches to model complex inter-instance relationships.
- Origin-to-Origin ($L_{oto}$): Maintains standard contrastive loss between natural images to ensure generalization to real-world data.
Experimental Results
PatchMix was evaluated across several standard benchmarks, consistently outperforming previous state-of-the-art (SOTA) self-supervised methods:
- ImageNet-1K: Achieved a 3.0% improvement in linear accuracy over the previous SOTA (SDMP) using a ViT-B/16 backbone.
- CIFAR-100: Demonstrated a significant 8.7% jump in kNN accuracy, highlighting the method's effectiveness even on smaller datasets where overfitting is common.
- Transfer Learning: On the COCO dataset, PatchMix reached 51.9 AP for object detection, surpassing iBOT and MAE despite requiring fewer pretraining epochs.
Conclusion
By shifting the training target from a binary "same/different" to a "soft" distribution of inter-instance similarities, PatchMix allows ViTs to capture the semantic structure of visual data more effectively. While currently optimized for patch-based architectures, future work may explore saliency-based mixing or adaptations for convolutional networks to further refine inter-instance modeling.
Summary updated