Machine learningMachine learningMachine learningAlgorithm

Self-supervised K-means

Also known as: self-supervised clustering with K-means, deep clustering with K-means, unsupervised K-means with pseudo-labels, SSL K-means

OriginatorCaron, M. et al. (DeepCluster framework)Year2018Sources2Related methods5

Self-supervised K-means is a clustering technique that combines K-means assignment with self-supervised representation learning. The model alternates between clustering unlabeled data points into K groups and using those cluster assignments as pseudo-labels to refine an underlying feature representation, yielding increasingly coherent clusters without any human-annotated ground truth.

Key highlights

  • Leverages large volumes of unlabeled data to learn useful representations at no annotation cost.
  • Produces transferable embeddings that can be fine-tuned for downstream classification or regression tasks.
  • Jointly optimizes clustering structure and feature quality, yielding more semantically coherent clusters than raw-space K-means.
  • Scalable to high-dimensional inputs where traditional K-means degrades due to the curse of dimensionality.
  • Compatible with modern deep encoder architectures and can serve as a pretraining step before supervised fine-tuning.

Intuition

This section is available to Pro members. Upgrade to Pro

How it works

This section is available to Pro members. Upgrade to Pro

When to use it

Use self-supervised K-means when you have abundant unlabeled data and need to discover natural groupings without annotation, or when you want to pre-train representations for a downstream task at low labeling cost. It is especially effective with high-dimensional inputs (images, text embeddings, sensor signals) where raw-space K-means fails. Do not use it when interpretable, coefficient-based models are required, when K is not meaningful for your domain, or when your dataset is small enough that labeled data could be collected affordably — in that case supervised classifiers will outperform any self-supervised approach.

Strengths & limitations

Strengths
  • Leverages large volumes of unlabeled data to learn useful representations at no annotation cost.
  • Produces transferable embeddings that can be fine-tuned for downstream classification or regression tasks.
  • Jointly optimizes clustering structure and feature quality, yielding more semantically coherent clusters than raw-space K-means.
  • Scalable to high-dimensional inputs where traditional K-means degrades due to the curse of dimensionality.
  • Compatible with modern deep encoder architectures and can serve as a pretraining step before supervised fine-tuning.
Limitations
  • Requires choosing K in advance; unlike density-based methods it cannot discover the number of clusters automatically.
  • Sensitive to initialization of cluster centroids and encoder weights; poor initialization can cause degenerate solutions where some clusters collapse.
  • Computationally expensive compared to plain K-means due to the alternating encoder-training loop.
  • Convergence is not guaranteed; monitoring cluster assignment stability across iterations is necessary.
  • Pseudo-label quality can degrade if cluster assignments are dominated by spurious patterns early in training.

Common pitfalls

This section is available to Pro members. Upgrade to Pro

Applications

This section is available to Pro members. Upgrade to Pro

Frequently asked

How is self-supervised K-means different from plain K-means?

Plain K-means clusters data in the original feature space and produces no transferable representation. Self-supervised K-means uses cluster assignments as pseudo-labels to iteratively improve an encoder, so the embeddings become progressively more cluster-friendly and useful for downstream tasks.

How do I choose the number of clusters K?

Domain knowledge is the first guide. When that is unavailable, run multiple values of K and compare silhouette scores, Davies-Bouldin index, or downstream task performance on a small labeled probe set. There is no universally optimal K; the best value depends on the data's true structure.

What stops the clusters from collapsing to a single group?

Cluster collapse is a real risk. Common mitigations include random centroid re-initialization for empty clusters, cluster-size balancing losses, and periodic reassignment of points from large clusters to empty ones. Monitoring cluster sizes at each iteration is essential.

Do I need a deep neural encoder, or can I use simpler features?

A deep encoder is not strictly required. Self-supervised K-means can be applied with any trainable feature extractor, including shallow networks or PCA-initialized projections. However, the benefit of the iterative loop is largest when the encoder has enough capacity to reshape the embedding space in response to cluster feedback.

How do I evaluate the quality of the learned representations?

The standard approach is a linear evaluation protocol: freeze the encoder weights, train a simple linear classifier on a small labeled subset, and report accuracy. Better representations produce higher linear-evaluation accuracy. Cluster-intrinsic metrics (silhouette, NMI against any available ground truth) are complementary diagnostics.

Sources

  1. 1.
    Caron, M., Bojanowski, P., Joulin, A., & Douze, M. (2018). Deep Clustering for Unsupervised Learning of Visual Features. In Proceedings of the European Conference on Computer Vision (ECCV), 132–149.
  2. 2.
    Self-supervised learning. Wikipedia.

You have read it. What now?

Cite this page

ScholarGate. (2026, June 3). Self-supervised K-means. ScholarGate. https://scholargate.app/machine-learning/self-supervised-k-means

Self-supervised K-means — Self-supervised K-means Clustering