Efficient Unsupervised Visual Representation Learning with Explicit Cluster Balancing

Ioannis Maniadis Metaxas, Georgios Tzimiropoulos, Ioannis Patras

Abstract

Self-supervised learning (SSL) via clustering-based methods has emerged as a powerful paradigm for visual representation learning. However, these methods often suffer from "cluster collapse," where the model assigns all samples to a few clusters, or they rely on large batch sizes to maintain stable cluster statistics. This paper introduces Explicit Cluster Balancing (ExCB), a framework that prevents collapse by tracking and balancing cluster sizes across training batches using an Exponential Moving Average (EMA) and a novel balancing operator. ExCB achieves state-of-the-art performance on ImageNet-1K while significantly reducing the dependency on large-scale computational resources, maintaining stability even with small batch sizes.

Introduction

In the field of self-supervised learning (SSL), group discrimination or clustering-based methods have demonstrated significant potential. These approaches learn representations by assigning images to pseudo-labels (clusters) and optimizing the network to predict these assignments. A persistent challenge in this domain is "cluster collapse," a failure mode where the model maps all inputs to a single cluster to minimize loss trivially.

To mitigate this, existing methods typically employ balancing constraints. However, these solutions often introduce new bottlenecks. Offline methods, such as DeepCluster, require periodic re-clustering of the entire dataset, which is computationally expensive and difficult to scale. Conversely, online methods like SwAV or DINO rely on in-batch statistics to enforce uniformity. This creates a "large batch dependency," where performance degrades significantly if the batch size is too small to provide a representative sample of the data distribution.

Explicit Cluster Balancing (ExCB)

ExCB addresses these limitations by decoupling cluster balancing from the immediate batch size. The framework operates within a teacher-student architecture and introduces two primary innovations: explicit size tracking and a balancing operator.

Measuring Cluster Sizes

Unlike previous online methods that rely on soft probability distributions within a single batch, ExCB maintains a running estimate of cluster sizes ($s$) across the entire dataset. This is achieved using an Exponential Moving Average (EMA). Crucially, ExCB utilizes hard assignments—assigning each sample to exactly one cluster—to update these estimates. The authors argue that hard assignments provide a more robust and reliable measure of the actual cluster distribution than soft confidence-based proxies, which can be volatile during the early stages of training.

The Balancing Operator

The core of the framework is the Balancing Operator ($\mathcal{B}$), which dynamically adjusts the cosine similarity between image features and cluster centroids based on the estimated cluster sizes.

  • Undersized Clusters: If a cluster is identified as being smaller than the target uniform distribution, the operator increases its similarity scores, making it more "attractive" for future samples.
  • Oversized Clusters: Conversely, if a cluster is oversized, the operator decreases its scores, effectively pushing samples toward less populated clusters.

This mechanism enforces a "soft" constraint. Rather than forcing absolute uniformity—which can hinder the learning of natural data hierarchies—ExCB ensures that clusters remain within a healthy range (approximately 70% to 130% of the optimal size).

Experimental Results

ExCB was evaluated on standard benchmarks, including ImageNet-1K and MS COCO, using both ResNet-50 and Vision Transformer (ViT) backbones.

Efficiency and Accuracy

On ImageNet-1K with a ResNet-50 backbone, ExCB achieved a linear probing accuracy of 76.5% in 400 epochs with a batch size of 1024. This performance is notable because many competing SSL methods require 800 or more epochs or significantly larger batch sizes (e.g., 4096) to reach comparable accuracy. When using a ViT-S/16 backbone, ExCB reached 77.1% accuracy, outperforming established methods like DINO and TWIST under similar training configurations.

Robustness to Batch Size

A key advantage of ExCB is its stability across different hardware constraints. While most online clustering methods experience a sharp decline in accuracy when the batch size is reduced to 256, ExCB maintained a high accuracy of 70.5% (trained for 100 epochs without multi-crop). This robustness democratizes high-quality SSL, making it accessible to researchers without access to massive GPU clusters.

Downstream Tasks

To verify the generalizability of the learned representations, the authors evaluated ExCB on MS COCO object detection and instance segmentation. The results showed that ExCB matched or exceeded the performance of models trained for twice as long, confirming that the efficiency of the training process does not come at the cost of feature quality.

Conclusion and Future Work

ExCB provides a scalable and efficient solution to the problem of cluster collapse in self-supervised learning. By explicitly tracking cluster sizes and applying a dynamic balancing operator, the method removes the requirement for massive batch sizes and expensive offline operations.

While the method is highly stable, it introduces a momentum hyperparameter ($m_s$) for tracking cluster sizes. Future research could explore the impact of this parameter across diverse data distributions, such as medical or satellite imagery. Additionally, the authors suggest that the explicit balancing logic of ExCB could be extended to other modalities, including audio and multi-modal learning environments like CLIP, where data imbalance remains a significant challenge.

Summary updated

BibTeX
@inproceedings{metaxas2024efficient,
  author = {Ioannis Maniadis Metaxas and Georgios Tzimiropoulos and Ioannis Patras},
  title = {{Efficient Unsupervised Visual Representation Learning with Explicit Cluster Balancing}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73411-3\_25},
}
Figure