Traditional clustering algorithms operate under a restrictive assumption: they require the user to specify the exact number of clusters ($k$) before analyzing the data. In algorithms like $k$-means, spectral clustering, or matrix factorization, $k$ is not just a hyperparameter—it is a structural constraint built directly into the optimization landscape.
As noted by Rui Chen et al. and Elad Amrani et al., this requirement fails in open-world scenarios where the true number of categories is unknown or dynamic. Forcing a fixed cluster count onto a dataset can obscure its natural hierarchical structure, create artificial groupings, or over-specialize models, as highlighted by Grace Huang et al..
To move beyond this bottleneck, researchers have developed frameworks that treat the number of clusters as an emergent property of the data's geometry, density, or statistical distribution rather than a fixed input.
Density Peaks and Statistical Splitting
One intuitive way to discover the number of clusters dynamically is to start with a simple configuration and iteratively test whether a cluster should be divided. But how do we know when a cluster contains more than one true group?
The answer lies in statistical testing for unimodality or distribution shape. For instance, Argyris Kalogeratos et al. proposed Dip-means, an incremental method that evaluates whether a group of data points exhibits a single density peak. If a cluster is found to be multi-modal (having more than one peak), it is split.
Similarly, Pietro Michiardi et al. scaled this concept to massive datasets using a MapReduce implementation of the G-means algorithm. Their approach iteratively splits clusters that fail a Gaussian distribution test, transforming a blind guessing game into a sequence of localized statistical decisions.
Physical and Topological Analogies
Another powerful paradigm bypasses explicit splitting rules by mapping data points to physical or topological systems where clusters form naturally.
Consider a thermal system where data points act as nodes that can pass heat. In the framework introduced by Yi Fang et al., data points are treated as thermal components. By simulating heat transfer across the network, the algorithm naturally identifies "heat centers" (which act as cluster exemplars) and "heat sinks" (the cluster members). Because the heat flows according to the intrinsic density of the network, the true number of clusters emerges organically without any prior configuration.
A similar intuition applies to graph-based data. Instead of forcing a global partition, Minsu Cho et al. developed a mode-seeking algorithm on graphs using random walks. By tracking how random walks converge toward "authority modes," the algorithm identifies natural cluster centers and filters out background noise without needing a predefined metric space or cluster count.
Convex Optimization and Inherent Submodularity
Can we formulate the discovery of cluster counts as a mathematically rigorous optimization problem that avoids local minima? Traditional $k$-means objectives are non-convex and NP-hard to solve globally when $k$ is variable. However, by shifting to convex formulations or submodular functions, the optimal number of clusters can be found exactly.
Ashkan Panahi et al. demonstrated this using Sum of Norms (SON) clustering. SON formulates clustering as a convex optimization problem where data points are pulled toward shared centroids via a regularization penalty. The number of unique centroids—and thus the number of clusters—is an output of the optimization process rather than an input constraint.
In a parallel vein, the authors of Minimum Average Cost Clustering utilized submodular functions to measure data inhomogeneity, proving that the optimal cluster count can be computed exactly in polynomial time based entirely on the data's inherent properties.
Real-World Applications and Decentralized Environments
The ability to cluster without a predefined $k$ is vital in modern distributed and open-world machine learning systems:
- Clustered Federated Learning (CFL): In decentralized networks, a central server cannot see the global data distribution due to privacy constraints. Dun Zeng et al. introduced StoCFL to automatically group similar clients into clusters dynamically. Further refining this, Xiaoying Tang et al. developed HCFL+, which determines the optimal number of client clusters on-the-fly, preventing over-specialization or under-personalization without requiring global visibility.
- Open-World Computer Vision: When discovering novel scene categories or learning unsupervised image representations, models cannot assume a fixed label vocabulary. Ruimao Zhang et al. combined generative learning with compositional sampling to simultaneously cluster images and discover new categories, allowing the system to adapt autonomously to the inherent diversity of visual data.
By shifting the perspective from "How do we partition data into $k$ groups?" to "How does the data naturally organize itself?", these methodologies enable machine learning systems to operate autonomously in complex, unpredictable environments.