All4One: Symbiotic Neighbour Contrastive Learning via Self-Attention and Redundancy Reduction

Imanol G. Estepa, Ignacio Saras'ua, Bhalaji Nagarajan, P. Radeva
2/14/2026

No official code found. Best implementation: vturrisi/solo-learn (1,576 stars, MIT, PyTorch, last commit 2026-04-22). 1 more below.

Abstract

Nearest neighbour-based methods have proved to be one of the most successful self-supervised learning (SSL) approaches due to their high generalization capabilities. However, their computational efficiency decreases when more than one neighbour is used. In this paper, we propose a novel contrastive SSL approach, which we call All4One, that reduces the distance between neighbour representations using "centroids" created through a self-attention mechanism. We use a Centroid Contrasting objective along with single Neighbour Contrasting and Feature Contrasting objectives. Centroids help in learning contextual information from multiple neighbours whereas the neighbour contrast enables learning representations directly from the neighbours and the feature contrast allows learning representations unique to the features. This combination enables All4One to outperform popular instance discrimination approaches by more than 1% on linear classification evaluation for popular benchmark datasets and obtains state-of-the-art (SoTA) results. Finally, we show that All4One is robust towards embedding dimensionalities and augmentations, surpassing NNCLR and Barlow Twins by more than 5% on low dimensionality and weak augmentation settings. Source code is available in https://github.com/ImaGonEs/all4one.

View on arXivView PDF

Code Implementations(2)

vturrisi/solo-learnCommunity100%
PyTorchMIT

solo-learn: a library of self-supervised methods for visual representation learning powered by Pytorch Lightning

1,576205Shell, PythonMar 6, 20216 months agoMIT
barlow-twinsbyolcontrastive-learningdeepclusterdino+15 more
ImaGonEs/all4oneCommunity100%
MIT

[ICCV2023] Official PyTorch Implementation of "All4One: Symbiotic Neighbour Contrastive Learning via Self-Attention and Redundancy Reduction"

40Shell, PythonAug 16, 20232 years agoMIT

Similar Papers

Cite this paper

@article{estepa2026allone,
  title  = {All4One: Symbiotic Neighbour Contrastive Learning via Self-Attention and Redundancy Reduction},
  author = {Imanol G. Estepa and Ignacio Saras'ua and Bhalaji Nagarajan and P. Radeva},
  year   = {2026},
  eprint = {2303.09417},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2303.09417},
  journal = {ICCV 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2303.09417.svg)](https://codeofpaper.com/paper/2303.09417)

Discussion