Distributionally Robust K-Means Clustering

Vikrant Malik, Taylan Kargin, Babak HassibiarXiv 2026 · arXiv

TL;DR

Standard $K$-means clustering is notoriously sensitive to outliers, noise, and data scarcity. This paper introduces a distributionally robust $K$-means variant ($DRKM$) that optimizes for the worst-case scenario within a geometric Wasserstein-2 ambiguity ball, naturally transforming rigid hard-clustering assignments into a mathematically rigorous soft-clustering scheme with provable convergence.

What Problem Does This Paper Address?

The classical $K$-means algorithm is a staple of unsupervised learning, but it suffers from a fundamental flaw: it assumes your empirical dataset perfectly represents the true underlying population distribution. In the real world—especially in low-data regimes or high-dimensional spaces—this assumption falls apart due to the curse of dimensionality, sampling bias, and data corruption. A few well-placed outliers can drastically skew cluster centroids, leading to poor downstream performance.

While existing robust clustering techniques attempt to mitigate this (e.g., by heuristically "trimming" away distant data points), they often require prior knowledge of the exact number of outliers and lack solid theoretical foundations. The authors tackle this gap by developing a mathematically principled framework that inherently protects against distributional shifts and anomalies.

Methods

The authors formulate the problem using Distributionally Robust Optimization (DRO). Instead of minimizing the average squared distance solely on the observed data points, they minimize the worst-case risk over an entire family of plausible distributions.

  1. Wasserstein-2 Ambiguity Ball: They define a "ball" of radius $r$ around the empirical data distribution using the Wasserstein-2 ($W_2$) distance. The $W_2$ metric is uniquely suited for this because it incorporates the underlying geometry of the data space and can handle both continuous and discrete distributions.
  2. Minimax Formulation & Strong Duality: This setup yields a challenging minimax (inf-sup) optimization problem. By applying strong duality theorems, the authors reduce this infinite-dimensional problem into a tractable, finite-dimensional dual form.
  3. Emergent Soft Clustering: Remarkably, the math of the dual formulation naturally replaces the traditional "hard" nearest-neighbor assignments of $K$-means with a smooth, stochastic assignment rule. Data points near cluster boundaries or outliers are given fractional, probabilistic weights, which acts as a built-in regularizer against cluster misrepresentation.
  4. Block Coordinate Descent (BCD): To solve this efficiently, the authors propose a BCD algorithm (Algorithm 1 & 2) that alternates between solving a quadratic program for the soft assignments and applying a closed-form update for the cluster centers. They prove that this approach guarantees a monotonic decrease in the objective function and achieves local linear convergence.

Datasets

The algorithm was evaluated on a mix of standard real-world benchmarks and large-scale synthetic datasets:

  • Real-World Benchmarks (UCI Repository): NIPS (high-dimensional text data), MNIST (handwritten digits), SKIN-segmentation, Fashion-MNIST (clothing images), and the Shuttle dataset.
  • Synthetic Data: High-dimensional Gaussian Mixture Models (GMMs) designed to test performance across varying sample sizes ($N$) and under explicit outlier cluster corruptions.

Key Insights and Ideas

  • Soft Clustering is Mathematically Optimal for Robustness: Soft clustering is often used as an intuitive heuristic. Here, the authors show it is the exact mathematical consequence of optimizing for worst-case geometric distribution shifts.
  • No Outlier Prior Needed: Methods like Trimmed $K$-means require the user to input the exact number or percentage of outliers beforehand. $DRKM$ automatically downweights anomalies via its optimization landscape without needing to know the outlier count a priori.
  • Geometry-Aware Regularization: By using the Wasserstein metric rather than statistical distances like KL-divergence, the regularization explicitly accounts for where data points lie in space, preventing distant outliers from dragging cluster centers away from the true data cores.

Key Results

  • Superior Outlier Detection: In experiments on the NIPS and MNIST datasets with injected noise, the proposed method ($DRKM++$) achieved perfect or near-perfect outlier recall (correctly identifying up to 100% of ground-truth outliers), significantly outperforming standard $K$-means++ and robust baselines like Trimmed $K$-means ($TKM++$).
  • Resilience to Heavy Noise: When evaluating classification accuracy on Fashion-MNIST corrupted with 40% Gaussian noise, $DRKM++$ maintained a high and highly consistent accuracy (~83-84%), whereas standard $K$-means performance fluctuated wildly depending on initialization.
  • Scalability: On massive synthetic datasets ($N = 10^6$ points), $DRKM++$ scaled efficiently, delivering superior accuracy in seconds, while competing robust implementations either failed to run or took significantly longer.

Limitations and Future Work

  • Hyperparameter Tuning: The performance of the algorithm relies on tuning the robustness parameter $\gamma$ (or implicitly, the ambiguity radius $r$). While the paper provides theoretical bounds for $r$, practical calibration in completely unsupervised settings remains a challenge.
  • Computational Overhead: Although it scales well compared to other robust baselines, each iteration of $DRKM$ requires solving a quadratic program for soft assignments, making it computationally heavier per iteration than standard vanilla $K$-means.
  • Future Directions: While not explicitly detailed by the authors, promising extensions include integrating this robust framework directly into deep embedding spaces (deep clustering) or adapting it to non-Euclidean manifolds.

Summary updated

Abstract

K-means clustering is a workhorse of unsupervised learning, but it is notoriously brittle to outliers, distribution shifts, and limited sample sizes. Viewing k-means as Lloyd--Max quantization of the empirical distribution, we develop a distributionally robust variant that protects against such pathologies. We posit that the unknown population distribution lies within a Wasserstein-2 ball around the empirical distribution. In this setting, one seeks cluster centers that minimize the worst-case expected squared distance over this ambiguity set, leading to a minimax formulation. A tractable dual yields a soft-clustering scheme that replaces hard assignments with smoothly weighted ones. We propose an efficient block coordinate descent algorithm with provable monotonic decrease and local linear convergence. Experiments on standard benchmarks and large-scale synthetic data demonstrate substantial gains in outlier detection and robustness to noise.
BibTeX
@misc{malik2026distributionally,
  author = {Vikrant Malik and Taylan Kargin and Babak Hassibi},
  title = {{Distributionally Robust K-Means Clustering}},
  year = {2026},
  eprint = {2604.11118},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.11118},
}

Loading related content...

Figure