Manuscript Offprint

arXiv:2611.00653

Regularized Wasserstein Distance for Discrete Generative Modeling and Clustering Analysis

Senmao Ye, Fei Liu, Dawei Zhang, Yuqian Zheng, Jun Zhang, Zhonglong zheng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

In this paper, we formulate clustering analysis as discrete generative modeling. Specifically, when the generator is restricted to a finite candidate space, the generated samples naturally emerge as the most representative prototypes of the underlying data distribution. To model such a discrete candidate space, we employ a Discrete Distribution Network (DDN). However, DDN suffers from unstable training due to its hard nearest-neighbor selection. To stabilize training and encourage geometric consistency, we replace DDN's ℓ2\ell_2 loss between images with regularized Wasserstein distance between the empirical distributions of real and generated images. The resulting framework, termed Discrete Generative Clustering (DGC), offers four notable advantages: 1) the learned cluster centers are directly interpretable, as they are realistic synthetic samples; 2) the inference cost scales logarithmically with the number of clusters, i.e., O(log⁡K)O(\log K), making the method scalable to extremely large KK; 3) the regularized Wasserstein distance provides a smooth and well-behaved optimization objective that facilitates stable convergence, whereas DDN's ℓ2\ell_2 loss tends to converge to poor local optima; and 4) DGC replaces DDN's nearest-neighbor selection with random-neighbor selection, which avoids the density shift problem during multi-step forward. Extensive experiments on several benchmarks demonstrate the effectiveness and desirable properties of DGC. The code is publicly available at GitHub.

*Corresponding author.

Email address: senmaoy@gmail.com, feiliu@scut.edu.cn, davidzhang@zjnu.edu.cn, everygreen870@gmail.com, junzhang@ieee.org, zhonglong@zjnu.edu.cn

Keywords: Clustering Analysis, Generative Modeling, Regularized Wasserstein Distance

1. Introduction

Clustering analysis is a fundamental task in unsupervised learning, aiming to partition data into meaningful groups without label supervision [1; 2; 3; 4; 5; 6; 7]. It plays a critical role in image segmentation, bioinformatics, anomaly detection, and exploratory data analysis. Despite decades of research, traditional clustering methods still suffer from several inherent limitations. Partition-based algorithms like K-Means [8] require a predefined number of clusters KK and are highly sensitive to initialization. Model-based approaches such as Gaussian Mixture Models (GMM) [9] assume specific parametric forms and become computationally expensive as KK grows. Hierarchical methods incur O(n2)\mathcal{O}(n^2) complexity [10], and density-based methods like DBSCAN [11; 12] are sensitive to hyperparameter choices. Moreover, many of these methods yield cluster centers that are abstract mathematical constructs, lacking direct physical interpretability [13].

In recent years, generative models [14; 15; 16; 17] have demonstrated remarkable capability in modeling complex data distributions, providing new paradigms for tasks such as image segmentation, image classification, and object detection. For clustering analysis, existing models [3; 18; 19] invert the generative process to extract unsupervised deep feature representations. However, the clustering step is still accomplished by conventional methods such as K-means and GMM. These generation-based cluster models do not further explore the intrinsic relationship between clustering and generation.

To connect clustering analysis and generative modeling, this paper introduces Discrete Generative Clustering (DGC). As depicted in Figure 1, the core idea is to generate a set of candidate samples that faithfully represent the entire dataset. We first discretize generative modeling via a hard selection operation proposed by Discrete Distribution

Network [20]. To preserve global geometric fidelity, we minimize the regularized Wasserstein distance [21; 22] between the distribution of generated

Figure

Figure 1: Clustering analysis is a special case of generative modeling.

candidates and the real data distribution. The regularized Wasserstein distance is differentiable and computationally efficient and better preserves the underlying manifold structure than DDN's image-wise loss. Finally, each data point is assigned to its nearest prototype according to the tree structure of DDN.

The proposed Discrete Generative Clustering offers several notable advantages. First, it provides interpretability, as the cluster centers are actual samples generated from the underlying data distribution, rather than abstract latent parameters. DGC provides a probabilistic interpretation of image clustering, grounded in generative modeling. Second, it exhibits high computational efficiency, with a complexity of O(log⁡K)O(\log K), which remains tractable for extremely large numbers of clusters. Third, it ensures optimization stability: the regularized Wasserstein distance defines a smooth and well-behaved optimization objective, in contrast to DDN's original ℓ2\ell_2-based loss functions that are prone to falling into local optima. Fourth, DGC is free of DDN's density shift problem caused by multi-step nearest-neighbor selection in training. Such training bias will accumulate when the number of DDN layers grow. Extensive experimental results demonstrate that DGC achieves competitive clustering performance while yielding visually interpretable cluster centers. Ablation studies further substantiate the individual contribution of each component. To facilitate reproducibility, the source code is made publicly available.

References (18)

  • Latent space clustering in generative adversarial networks, in: Proceedings of the AAAI conference on artificial intelligence, Vol. 33, 2019, pp. 4610–4617
  • Kriegel, J. Sander, X. Xu, A density-based algorithm for discovering clusters in large spatial databases with noise, in: Proceedings of the 2nd International Conference on Knowledge Discovery and Data Mining (KDD), AAAI Press, 1996, pp. 226–231
  • Leung, H. Che, C. Liu, Self-supervised semantic graph propagation for multi-view clustering, Neural Networks 202 (2026) 108973
  • D. Müllner, Modern hierarchical, agglomerative clustering algorithms, arXiv preprint arXiv:1109.2378 (2011). (opens arXiv in a new tab)
  • Kriegel, J. Sander, X. Xu, A density-based algorithm for discovering clusters in large spatial databases with noise, in: Proceedings of the Second International Conference on Knowledge Discovery and Data Mining (KDD '96), 1996, pp. 226–231
  • Science or art?, in: Proceedings of ICML Workshop on Unsupervised and Transfer Learning, 2012, pp. 65–79
  • H. M. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. B. Fox, R. Garnett (Eds.), Advances in Neural Information Processing Systems, 2019, pp. 11895–11907
  • 9th International Conference on Learning Representations, ICLR, OpenReview.net, 2021
  • Zhang, Clusterddpm: an em clustering framework with denoising diffusion probabilistic models, Information Sciences (2025) 122518
  • An unsupervised and generative approach to clustering, in: Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence, IJCAI 2017, Melbourne, Australia, August 19-25, 2017, ijcai.org, 2017, pp. 1965–1972
  • International Conference on Learning Representations, Vol. 2025, 2025, pp. 60698–60721
  • Lightspeed computation of optimal transportation distances, in: Advances in Neural Information Processing Systems (NeurIPS) 26, Curran Associates, Inc., 2013, pp. 2292–2300
  • Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms
  • Adam: A Method for Stochastic Optimization
  • GAN based EM learning framework, in: S. Kraus (Ed.), Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI 2019, Macao, China, August 10-16, 2019, ijcai.org, 2019, pp. 4404–4411
  • Neural Networks Learn
  • Proceedings of the 21st International Conference on Artificial Intelligence and Statistics (AISTATS), Vol. 84, PMLR, 2018, pp. 1608–1617
  • Proceedings of the 34th International Conference on Machine Learning (ICML), Vol. 70, PMLR, 2017, pp. 1955–1964