GenView: Enhancing View Quality with Pretrained Generative Model for Self-Supervised Learning

Xiaojie Li, Yibo Yang, Xiangtai Li, Jianlong Wu, Yue Yu, Bernard Ghanem, Min Zhang

Abstract

Self-supervised learning has achieved remarkable success in acquiring high-quality representations from unlabeled data. The widely adopted contrastive learning framework aims to learn invariant representations by minimizing the distance between positive views originating from the same image. However, existing techniques to construct positive views highly rely on manual transformations, resulting in limited diversity and potentially false positive pairs. To tackle these challenges, we present GenView, a controllable framework that augments the diversity of positive views leveraging the power of pretrained generative models while preserving semantics. We develop an adaptive view generation method that dynamically adjusts the noise level in sampling to ensure the preservation of essential semantic meaning while introducing variability. Additionally, we introduce a quality-driven contrastive loss, which assesses the quality of positive pairs by considering both foreground similarity and background diversity. This loss prioritizes the high-quality positive pairs we construct while reducing the influence of low-quality pairs, thereby mitigating potential semantic inconsistencies introduced by generative models and aggressive data augmentation. Thanks to the improved positive view quality and the quality-driven contrastive loss, GenView significantly improves self-supervised learning across various tasks. For instance, GenView improves MoCov2 performance by 2.5%/2.2% on ImageNet linear/semi-supervised classification. Moreover, GenView even performs much better than naively augmenting the ImageNet dataset with Laion400M or ImageNet21K. Code is available at https://github.com/xiaojieli0903/genview.

Introduction

Self-supervised learning (SSL), particularly contrastive learning, has revolutionized representation learning by utilizing unlabeled data. The core principle involves learning invariant features by pulling together "positive views" of the same image while pushing apart "negative views" from different images. However, traditional methods rely on manual data augmentations like random cropping and color jittering. These methods suffer from limited diversity—unable to change object pose or texture—and the risk of "false positives" where aggressive crops capture only background, misleading the model.

Overview of GenView compared to standard contrastive learning. GenView generates diverse positive views while maintaining semantic consistency through a quality-driven loss.

To address these limitations, we propose GenView, a framework that leverages pretrained generative models (e.g., Stable Diffusion) to create semantically consistent yet highly diverse positive views.

Methodology

The GenView framework consists of two primary components: Adaptive View Generation and Quality-Driven Contrastive Loss.

The GenView framework architecture. It integrates an Adaptive View Generation module to create diverse views and a Quality-Driven Contrastive Loss to prioritize high-quality training pairs.

Adaptive View Generation

Instead of applying uniform noise, GenView adaptively adjusts the generation process based on image content. By performing PCA on features from a frozen CLIP image encoder, the system estimates the foreground proportion. For images with small foregrounds, lower noise levels are used to prevent the generative model from erasing the subject. Conversely, for images with prominent subjects, higher noise levels are applied to encourage the generation of diverse poses, actions, and environments.

Quality-Driven Contrastive Loss

Generative models can occasionally produce artifacts or semantic drift. To mitigate this, we introduce a reweighting mechanism for the contrastive loss. We calculate a quality score $q = s_{foreground} - s_{background}$, where $s$ represents cosine similarity. This score prioritizes pairs with high foreground similarity (semantic preservation) and low background similarity (environmental invariance), effectively filtering out low-quality or inconsistent generations.

Experimental Results

GenView was evaluated on ImageNet-1K and several downstream tasks, demonstrating significant improvements over standard SSL baselines.

  • Classification Performance: GenView improved MoCov2's linear probing accuracy on ImageNet-1K by 2.5% and MoCov3 by 3.8%.
  • Data Efficiency: Remarkably, GenView using only 0.15M generated images outperformed naive dataset expansion using 0.3M real images from Laion400M or ImageNet-21K.
  • Semi-Supervised Learning: With only 1% of ImageNet labels, GenView boosted MoCov2's top-1 accuracy by 8.5%.
  • Transferability: Pretrained models showed superior performance in object detection and instance segmentation on MS-COCO, indicating more robust and generalized feature representations.

Discussion and Conclusion

GenView demonstrates that pretrained generative models can serve as powerful "world priors" for self-supervised learning. By using the original real image as a "semantic anchor" and adaptively controlling the generation process, GenView overcomes the diversity limits of manual augmentations. While computational costs for offline generation and potential hallucinations in complex scenes remain areas for future work, GenView sets a new standard for high-quality view generation in SSL.

Summary updated

BibTeX
@inproceedings{li2024genview,
  author = {Xiaojie Li and Yibo Yang and Xiangtai Li and Jianlong Wu and Yue Yu and Bernard Ghanem and Min Zhang},
  title = {{GenView: Enhancing View Quality with Pretrained Generative Model for Self-Supervised Learning}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73113-6\_18},
}
Figure