HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

With a Little Help from My Friends: Nearest-Neighbor Contrastive Learning of Visual Representations

Debidatta Dwibedi Yusuf Aytar Jonathan Tompson Pierre Sermanet Andrew Zisserman

With a Little Help from My Friends: Nearest-Neighbor Contrastive Learning of Visual Representations

Abstract

Self-supervised learning algorithms based on instance discrimination train encoders to be invariant to pre-defined transformations of the same instance. While most methods treat different views of the same image as positives for a contrastive loss, we are interested in using positives from other instances in the dataset. Our method, Nearest-Neighbor Contrastive Learning of visual Representations (NNCLR), samples the nearest neighbors from the dataset in the latent space, and treats them as positives. This provides more semantic variations than pre-defined transformations. We find that using the nearest-neighbor as positive in contrastive losses improves performance significantly on ImageNet classification, from 71.7% to 75.6%, outperforming previous state-of-the-art methods. On semi-supervised learning benchmarks we improve performance significantly when only 1% ImageNet labels are available, from 53.8% to 56.5%. On transfer learning benchmarks our method outperforms state-of-the-art methods (including supervised learning with ImageNet) on 8 out of 12 downstream datasets. Furthermore, we demonstrate empirically that our method is less reliant on complex data augmentations. We see a relative reduction of only 2.1% ImageNet Top-1 accuracy when we train using only random crops.

Code Repositories

Benchmarks

BenchmarkMethodologyMetrics
fine-grained-image-classification-on-birdsnapNNCLR
Accuracy: 61.4%
fine-grained-image-classification-on-caltechNNCLR
Top-1 Error Rate: 8.7%
fine-grained-image-classification-on-fgvcNNCLR
Accuracy: 64.1
fine-grained-image-classification-on-sun397NNCLR
Accuracy: 62.5
image-classification-on-cifar-10NNCLR
Percentage correct: 93.7
image-classification-on-cifar-100NNCLR
Percentage correct: 79
image-classification-on-dtdNNCLR
Accuracy: 75.5
image-classification-on-flowers-102NNCLR
Accuracy: 95.1
image-classification-on-food-101-1NNCLR
Accuracy (%): 76.7
image-classification-on-oxford-iiit-petsNNCLR
Accuracy: 91.8
image-classification-on-pascal-voc-2007NNCLR
Accuracy: 83
image-classification-on-stanford-carsNNCLR
Accuracy: 67.1
self-supervised-image-classification-onNNCLR (ResNet-50, multi-crop)
Number of Params: 25M
Top 1 Accuracy: 75.6%
Top 5 Accuracy: 92.4
semi-supervised-image-classification-on-1NNCLR (ResNet-50)
Top 1 Accuracy: 56.4%
Top 5 Accuracy: 80.7
semi-supervised-image-classification-on-2NNCLR (ResNet-50)
Top 1 Accuracy: 69.8%
Top 5 Accuracy: 89.3

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp