Skip to main content
QUICK REVIEW

[Paper Review] Improving Contrastive Learning by Visualizing Feature Transformation

Rui Zhu, Bingchen Zhao|arXiv (Cornell University)|Aug 6, 2021
Domain Adaptation and Few-Shot LearningComputer Science55 references4 citations
TL;DR

This paper proposes a novel feature transformation (FT) method to improve contrastive self-supervised learning by generating harder positive pairs through extrapolation and diversified negative pairs via interpolation, visualized using a new score distribution analysis tool. The approach boosts accuracy by 6.0% on ImageNet-100 over MoCo and 2.1% on ImageNet-1K over MoCoV2, with consistent gains across downstream tasks like detection and segmentation.

ABSTRACT

Contrastive learning, which aims at minimizing the distance between positive pairs while maximizing that of negative ones, has been widely and successfully applied in unsupervised feature learning, where the design of positive and negative (pos/neg) pairs is one of its keys. In this paper, we attempt to devise a feature-level data manipulation, differing from data augmentation, to enhance the generic contrastive self-supervised learning. To this end, we first design a visualization scheme for pos/neg score (Pos/neg score indicates cosine similarity of pos/neg pair.) distribution, which enables us to analyze, interpret and understand the learning process. To our knowledge, this is the first attempt of its kind. More importantly, leveraging this tool, we gain some significant observations, which inspire our novel Feature Transformation proposals including the extrapolation of positives. This operation creates harder positives to boost the learning because hard positives enable the model to be more view-invariant. Besides, we propose the interpolation among negatives, which provides diversified negatives and makes the model more discriminative. It is the first attempt to deal with both challenges simultaneously. Experiment results show that our proposed Feature Transformation can improve at least 6.0% accuracy on ImageNet-100 over MoCo baseline, and about 2.0% accuracy on ImageNet-1K over the MoCoV2 baseline. Transferring to the downstream tasks successfully demonstrate our model is less task-bias. Visualization tools and codes https://github.com/DTennant/CL-Visualizing-Feature-Transformation .

Motivation & Objective

  • To develop a visualization tool for analyzing positive and negative pair score distributions during contrastive learning training.
  • To identify key patterns in score distributions that reveal insights into model behavior and representation quality.
  • To design feature-level data manipulations (feature transformation) that improve contrastive learning performance beyond traditional data augmentation.
  • To reduce task-bias in pre-trained models by creating more view-invariant and discriminative representations.
  • To demonstrate the generality and robustness of the proposed method across multiple contrastive learning frameworks and downstream tasks.

Proposed method

  • Introduces a visualization scheme to track and analyze the cosine similarity (pos/neg score) distribution of positive and negative pairs during training.
  • Proposes positive extrapolation to increase the view variance of positive pairs, creating 'harder' positives that encourage view-invariance.
  • Introduces interpolation among negative features to generate diversified negative samples, enhancing discriminative capacity.
  • Applies feature transformations directly on the feature space without requiring additional data augmentation or re-normalization.
  • Employs a learnable mixing strategy with hyperparameters α_in and α_ex to control interpolation and extrapolation intensity.
  • Validates that ℓ₂ normalization after transformation has negligible impact on performance, though recommended for consistency on the unit sphere.

Experimental results

Research questions

  • RQ1How do positive and negative pair score distributions evolve during contrastive learning, and what insights can they reveal about model optimization?
  • RQ2Can feature-level manipulations—such as extrapolation and interpolation—improve contrastive learning more effectively than data augmentation?
  • RQ3Does generating harder positives and diversified negatives lead to better generalization and reduced task-bias in downstream tasks?
  • RQ4To what extent can the proposed feature transformation be generalized across different contrastive learning architectures and datasets?
  • RQ5Can the visualization tool serve as a diagnostic tool to guide the design of effective feature transformations?

Key findings

  • The visualization tool reveals that smaller positive scores (indicating higher view variance) correlate with better convergence and higher accuracy, motivating the design of harder positives.
  • Positive extrapolation increases view variance and reduces positive similarity, leading to a 1.7% accuracy gain on ImageNet-100 (from 71.1% to 72.8%) in the ablation study.
  • The proposed feature transformation improves MoCo by 6.0% on ImageNet-100 and MoCoV2 by 2.1% on ImageNet-1K, demonstrating significant performance gains.
  • On downstream tasks, the method achieves consistent improvements: +1.7% on iNaturalist2018, +0.9% on CUB-200, and +1.1% on FGVC-aircraft over MoCo and MoCo-V2 baselines.
  • The method outperforms task-specific models like DetCo and InsLoc on object detection and instance segmentation, indicating reduced task-bias.
  • The feature transformation is robust and effective across multiple contrastive models, including MoCo, SimCLR, InfoMin, SWAV, and SimSiam, with gains ranging from 0.7% to 5.77% on ImageNet-100.

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.