NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

You Never Cluster Alone

Yuming Shen, Ziyi Shen, Menghan Wang, Jie Qin, Philip Torr, Ling Shao

In the rapidly evolving world of unsupervised deep clustering, recent trends have borrowed heavily from contrastive learning. The foundational idea is straightforward: teach a model to recognize that two different augmented views of the same image are "similar," while views of different images are "dissimilar." While this instance-level approach has led to impressive gains, a team of researchers argues in their NeurIPS 2021 paper that we have been missing the forest for the trees—or rather, the cluster for the data point.

The Problem: Missing the Holistic Context

Traditional contrastive learning focuses almost exclusively on instance-level representations. It asks: "Is this specific image of a dog similar to its augmented version?" However, in the context of clustering, looking at a single data point in isolation often leads to ambiguity.

Consider the classic "TwoMoons" dataset. A data point sitting right between two interlocking crescent shapes might look like it belongs to either cluster if you only examine its immediate neighbors.

TwoMoons dataset illustrating the need for holistic context in clustering.

To correctly assign this ambiguous point, the model needs to understand the "holistic context"—the overall shape, distribution, and identity of the clusters themselves. Most current models fail to explicitly represent this cluster-level context, leading to sub-optimal assignments when data points sit near complex cluster boundaries.

The Solution: Twin-Contrast Clustering (TCC)

To bridge this gap, the authors propose Twin-Contrast Clustering (TCC), a framework that operates on two simultaneous, complementary tracks:

Architecture of Twin-Contrast Clustering showing both instance-level and cluster-level tracks.
  1. Instance-Level Track: This follows the standard approach where individual images are projected into a feature space. However, TCC derives an Evidence Lower Bound (ELBO) for the contrastive loss that directly incorporates cluster assignments. To keep the training end-to-end and differentiable, the model utilizes the Gumbel-softmax trick, allowing it to "choose" a cluster while maintaining the flow of gradients.
  2. Cluster-Level Track: This is TCC's core innovation. The model aggregates the features of all images in a batch, weighted by their probability of belonging to a specific cluster. This weighted aggregation creates a unified "set representation" for the cluster itself.
  3. Cluster Augmentation: Just as we flip or recolor individual images to create "positive pairs" for standard contrastive learning, TCC "augments" entire clusters. It achieves this by using different subsets of data or injecting "irrelevant minorities" (data points with low assignment confidence) to ensure the learned cluster representation is robust and consistent.

By contrasting these cluster representations against a memory bank of previous clusters (using a MoCo-style queue), the model learns to distinguish the distinct "identity" of one cluster from another.

Key Insights and Efficiency

  • "You Never Cluster Alone": The fundamental breakthrough is recognizing that the identity of a cluster is defined by the collective features of its members. By explicitly modeling this collective identity, TCC resolves ambiguities that stump instance-only models.
  • Weighted Aggregation as Context: Using assignment probabilities as weights to form cluster features allows the model to naturally ignore outliers while focusing heavily on the "core" of the cluster.
  • Computational Efficiency: Unlike previous state-of-the-art (SOTA) methods like MiCE, which rely on a computationally heavy "mixture-of-experts" approach (requiring $K$ different experts for $K$ clusters), TCC scales linearly with the number of clusters, making it far more efficient.

Impressive Benchmark Results

The model was rigorously evaluated on five standard computer vision benchmarks, including CIFAR-10, CIFAR-100, STL-10, ImageNet-10, and ImageNet-Dog. TCC demonstrated significant performance jumps over previous methods:

  • CIFAR-10: Achieved a remarkable 90.6% accuracy, representing a massive leap from the previous SOTA (MiCE) at 83.5%.
  • ImageNet-Dog: Reached 59.5% accuracy, outperforming competing contrastive methods by a healthy margin.
  • Training Efficiency: TCC reached peak performance in fewer training epochs and less wall-clock time compared to its predecessors, thanks to its streamlined, expert-free architecture.
  • End-to-End Learning: Unlike many clustering pipelines that require a pre-training phase followed by a separate clustering step (like k-means), TCC learns everything from scratch in a single, unified phase.

Limitations and Future Directions

While TCC is a powerhouse on most datasets, it was the runner-up on STL-10, where the "CC" (Contrastive Clustering) method performed slightly better. The authors suggest this might be due to the specific high-resolution nature of the STL-10 dataset.

Additionally, the current model assumes a uniform prior—essentially guessing that all clusters are roughly the same size. In real-world, "in-the-wild" data, clusters are often highly imbalanced. Future work could involve adapting TCC to handle long-tailed distributions where some clusters are vastly larger than others. Finally, while the heuristic cluster augmentations work exceptionally well in practice, developing a more formal theoretical foundation for "augmenting sets" remains an exciting open research question.

Summary updated

BibTeX
@inproceedings{shen2021you,
  author = {Yuming Shen and Ziyi Shen and Menghan Wang and Jie Qin and Philip Torr and Ling Shao},
  title = {{You Never Cluster Alone}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=bvzhvNPZlqG},
}
Figure