Skip to main content
QUICK REVIEW

[Paper Review] Robust Contrastive Learning Using Negative Samples with Diminished Semantics

Songwei Ge, Shlok Mishra|arXiv (Cornell University)|Oct 27, 2021
Domain Adaptation and Few-Shot LearningComputer Science57 references24 citations
TL;DR

This paper proposes a novel contrastive learning framework that improves robustness by generating negative samples preserving only non-semantic features like texture and local patches. Using texture-based and patch-based augmentations to create such negatives, the method reduces reliance on superficial features, leading to significantly improved out-of-distribution generalization, especially on fine-grained and sketch-based benchmarks.

ABSTRACT

Unsupervised learning has recently made exceptional progress because of the development of more effective contrastive learning methods. However, CNNs are prone to depend on low-level features that humans deem non-semantic. This dependency has been conjectured to induce a lack of robustness to image perturbations or domain shift. In this paper, we show that by generating carefully designed negative samples, contrastive learning can learn more robust representations with less dependence on such features. Contrastive learning utilizes positive pairs that preserve semantic information while perturbing superficial features in the training images. Similarly, we propose to generate negative samples in a reversed way, where only the superfluous instead of the semantic features are preserved. We develop two methods, texture-based and patch-based augmentations, to generate negative samples. These samples achieve better generalization, especially under out-of-domain settings. We also analyze our method and the generated texture-based samples, showing that texture features are indispensable in classifying particular ImageNet classes and especially finer classes. We also show that model bias favors texture and shape features differently under different test settings. Our code, trained models, and ImageNet-Texture dataset can be found at https://github.com/SongweiGe/Contrastive-Learning-with-Non-Semantic-Negatives.

Motivation & Objective

  • Address the issue of CNNs relying on non-semantic, superficial features such as texture and local patches, which hurt robustness under domain shift.
  • Investigate whether negative samples that preserve only non-semantic features can regularize contrastive learning and reduce model bias toward low-level patterns.
  • Develop a new dataset, ImageNet-Texture, to enable systematic study of shape-texture bias in visual representation learning.
  • Demonstrate that controlling the trade-off between shape and texture features improves performance on diverse downstream tasks, especially fine-grained and OOD settings.

Proposed method

  • Generate texture-based negative samples using classic texture synthesis methods applied to patches extracted from ImageNet images.
  • Create patch-based negative samples by tiling randomly sampled patches of varying sizes from the same input image.
  • Integrate these non-semantic negative samples into standard contrastive learning frameworks like MoCo and BYOL by minimizing representation similarity between input and negative samples.
  • Control the relative importance of shape and texture features via a learnable penalty on similarity between query and non-semantic negative samples.
  • Use the proposed ImageNet-Texture dataset to analyze how texture and shape features contribute to classification performance across different classes and datasets.
  • Apply the method to standard contrastive learning objectives (e.g., MoCo, BYOL) without modifying the loss function, enabling plug-and-play integration.

Experimental results

Research questions

  • RQ1Can negative samples that preserve only non-semantic features (e.g., texture, local patches) improve the robustness of contrastive learning representations?
  • RQ2How does the trade-off between shape and texture bias affect model generalization, particularly under out-of-distribution settings?
  • RQ3To what extent do texture features contribute to accurate classification in fine-grained image recognition tasks?
  • RQ4Can the proposed negative sample generation methods outperform standard negative sampling strategies in terms of generalization and robustness?
  • RQ5Does the use of non-semantic negatives reduce model dependence on superficial features while maintaining or improving in-domain accuracy?

Key findings

  • The proposed negative samples—texture-based and patch-based—achieve consistent improvements in generalization performance across ImageNet-100, ImageNet-1K, and STL-10, especially under out-of-distribution (OOD) settings.
  • Models trained with non-semantic negatives show reduced reliance on texture features, leading to better performance on ImageNet-Sketch, which emphasizes shape.
  • Texture features are found to be particularly important for fine-grained classification, such as dog breeds, indicating that their role is context-dependent.
  • The method enables effective control of the shape-texture trade-off: increasing penalty on non-semantic negatives shifts model bias toward shape, improving performance on shape-sensitive benchmarks.
  • The ImageNet-Texture dataset reveals that texture is more critical than shape for certain classes (e.g., dishrag, plaque), highlighting class-specific feature importance.
  • The non-semantic negative samples are more effective than standard negative samples in contrastive learning, as they act as harder, more informative negatives that better regularize the model.

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.