Skip to content

Menu

WorksComputer Science

Regularized Wasserstein Distance for Discrete Generative Modeling and Clustering Analysis

Download PDFView on arXiv

Ask your agent about this work

Your agent reads this work through Valency, with its citations and similar works. Paste this at the start of a chat.

Use the Valency MCP. Work: W_sfy6wy9r. Fetch it with get_paper_by_id, then find its nearest works with find_similar_papers and tell me what it adds.

Works with any MCP client. Not connected yet? Connect your agent

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 l2 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), making the method scalable to extremely large K; 3) the regularized Wasserstein distance provides a smooth and well-behaved optimization objective that facilitates stable convergence, whereas DDN's l2 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.

Keywords: Clustering Analysis, Generative Modeling, Regularized Wasserstein Distance

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)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 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.

Background

Regularized Wasserstein Distance

Optimal transport (OT) provides a principled framework for comparing probability distributions by quantifying the minimal cost required to transform one distribution into another. Among OT metrics, the Wasserstein distance is particularly well-suited for generative modeling, as it preserves the geometric structure between distributions even when their supports are disjoint. However, computing the exact Wasserstein distance is computationally prohibitive for large-scale problems, since solving the associated linear program incurs a cost that is cubic in the sample size.

To mitigate this limitation, entropic regularization was introduced in [21]. Let pp and qq denote the empirical distributions of real samples and generated samples, respectively. The regularized Wasserstein distance is defined as

W(p,q)=min⁡π∈Π(p,q){Eπ[c(x,y)]+λKL⁡(π∥p⊗q)}(1)W(p,q)=\min_{\pi\in\Pi(p,q)}\left\{\mathbb{E}_{\pi}[c(x,y)]+\lambda\operatorname{KL}(\pi\mathbin{\|}p\otimes q)\right\} \tag*{(1)}

where λ>0\lambda>0 is the regularization parameter, and c(x,y)c(x,y) is the ground-cost function representing the cost of transporting a unit mass from xx to yy. The entropic term renders the optimization problem strictly convex, thereby enabling efficient computation via the Sinkhorn–Knopp matrix scaling algorithm. Consequently, the regularized Wasserstein distance is also referred to as the Sinkhorn–Knopp loss. Moreover, the Sinkhorn–Knopp iterations are fully differentiable, allowing end-to-end backpropagation through the transport plan. These properties make the regularized Wasserstein distance an ideal loss function for training deep generative models, providing a smooth, robust, and computationally tractable alternative to the exact Wasserstein distance.

Discrete Distribution Networks

The DDN model consists of LL layers of Discrete Distribution Layers. For a given layer ll, denoted as GlG_l, the input is the selected sample from the previous layer, xl−1x_{l-1}. The layer generates BB new samples, Gl(xl−1)G_l(x_{l-1}), from which we select the sample xlx_l that is closest to the current training sample xx, along with its corresponding index blb_l. The loss JlJ_l for this layer is then computed only on the selected sample xlx_l.

bl=argmin⁡b∈{1,…,B}∥Gl(xl−1)[bl−1]−x∥2(2)b_l=\underset{b\in\{1,\ldots,B\}}{\operatorname{argmin}}\left\|G_l(x_{l-1})[b_{l-1}]-x\right\|^2 \tag*{(2)}
xl=Gl(xl−1)[bl](3)x_l=G_l(x_{l-1})[b_l] \tag*{(3)}
Jl=∥xl−x∥2(4)J_l=\left\|x_l-x\right\|^2 \tag*{(4)}

Regularized Wasserstein Distance for Generative Modeling and Clustering

To generate geometrically consistent prototypes, we first minimize the regularized Wasserstein distance between real and generated samples. Then, we discretize this generative model to enforce a discrete sample space. Finally, data points are assigned to the nearest prototypes according to the tree structure of DDN.

Continuous Generative Modeling with Regularized Wasserstein Distance

Generative modeling is achieved by training a neural network generator GθG_\theta to minimize the regularized Wasserstein distance between the real and generated distributions. Let z∼p(z)z \sim p(z) be a latent variable drawn from a fixed prior (e.g., a standard Gaussian), and let y=Gθ(z)y = G_\theta(z) denote the generated sample. Given a mini-batch of real samples x={x1,…,xn}\mathbf{x} = \{x_1, \ldots, x_n\} and generated samples y={y1,…,ym}\mathbf{y} = \{y_1, \ldots, y_m\} with yj=Gθ(zj)y_j = G_\theta(z_j), the generator is trained by minimizing the regularized Wasserstein distance between the two empirical measures:

θ∗=arg⁡min⁡θ  W(x,y),(5)\theta^* = \underset{\theta}{\arg\min}\; W(\mathbf{x}, \mathbf{y}), \tag*{(5)}

where WW is defined as in equation (1). With SGD training, Gθ(z)G_\theta(z) is able to synthesize reasonable images.

Discrete Generative Modeling with Regularized Wasserstein Distance

To enforce a discrete sample space, we discretize it using a Discrete Distribution Network.

Network Architecture. As illustrated in Figure 2, our model consists of LL sequentially connected sub-networks {G1,G2,…,GL}\{G_1, G_2, \ldots, G_L\}. The first sub-network G1G_1 takes a fixed position embedding zz as input. For l=2,…,Ll = 2, \ldots, L, the ll-th sub-network GlG_l receives the output of the previous sub-network yl−1y_{l-1} and generates a set of BB candidate outputs:

Figure 2. Illustration of the proposed Discrete Generative Clustering (DGC) framework. The purple components denote the generative modeling module, while the blue components correspond to the clustering module.

cl={c1,c2,…,cB}=Gl(yl−1),(6)\mathbf{c}_l = \{c_1, c_2, \ldots, c_B\} = G_l(y_{l-1}), \tag*{(6)}

Every output of the model is selected from the candidates of the sub-network GlG_l according to a stochastic hard selection rule described below:

yl∼Uniform⁡{c1,c2,…,cB}.(7)y_l \sim\operatorname{Uniform}\{c_1,c_2,\ldots,c_B\}. \tag*{(7)}

This stochastic selection confers generative diversity upon the model while preserving the advantages of the multi-candidate architecture learned during training. Empirically, we observe that random sampling maintains the quality of individual candidates and introduces beneficial variability, thereby mitigating the mode collapse often seen in deterministic and greedy selection schemes.

Objective. During training, we aim to align the distribution of generated outputs with the target data distribution. Given a mini-batch target images x={x1,…,xn}\mathbf{x}=\{x_1,\ldots,x_n\} and a set of candidates cl={c1,…,cn×B}\mathbf{c}_l=\{c_1,\ldots,c_{n\times B}\} produced by the sub-network GlG_l, the training objective is the regularized Wasserstein distance between these two empirical measures. The regularized optimal transport cost at ll layer is:

θ∗=arg⁡min⁡θ W(x,cl).(8)\theta^*=\underset{\theta}{\arg\min}\ W(\mathbf{x},\mathbf{c}_l). \tag*{(8)}

The overall training objective aggregates the losses across all LL stages:

Ltotal(θ)=1L∑l=1LW(x,cl),(9)\mathcal{L}_{\mathrm{total}}(\theta)=\frac{1}{L}\sum_{l=1}^{L}W(\mathbf{x},\mathbf{c}_l), \tag*{(9)}

where θ\theta denotes the trainable parameters of the entire network. This multi-level objective ensures that every sub-network learns to produce progressively refined representations, while the final stage aligns the generated distribution with the target distribution at the most fine-grained level. Unlike the original DDN, DGC avoids two drawbacks: (i) its learning objective keeps every candidate involved in optimization, preventing candidates from becoming dead and ensuring all branches remain well-trained; (ii) it replaces hard nearest-neighbor assignment with stochastic candidate selection, thereby avoiding the density shift problem during generation. This issue is analogous to the bias caused by sequential softmax sampling in auto-regressive models.

Unsupervised Clustering Analysis

When the number of candidates K=∏l=1LBlK=\prod_{l=1}^{L}B_l is set to a small value, the proposed generative model naturally performs unsupervised clustering. The intuition is that the generative modeling objective compresses the semantic information of the data distribution into a limited set of KK representative prototypes. These prototypes serve as cluster centroids in the data space.

DatasetSamplesOriginal sizeClasses
MNIST70,00028×2828 \times2810
Fashion-MNIST70,00028×2828 \times2810
CIFAR-1060,00032×3232 \times3210
COIL201,440128×128128 \times12820

Table 1. Summary of datasets used in experiments. Original size refers to the native resolution.

In the clustering setting, real target images are available for matching. For each stage l=1,…,Ll = 1, \ldots, L and each target sample xix_i, we first select from the candidate set {c1,…,cBl}\{c_1, \ldots, c_{B_l}\} produced by GlG_l the candidate closest to xix_i:

yi,l=arg⁡min⁡b∈{1,…,Bl}∥cb−xi∥2.(10)y_{i,l} = \underset{b\in\{1,\ldots,B_l\}}{\arg\min}\lVert c_b-x_i\rVert_2. \tag*{(10)}

This selection is repeated across the entire DDN tree, assigning each target image to a centroid at every stage; the corresponding index is denoted by yi,ly_{i,l}.

Experiments

In this section, we present the experimental setup, quantitative and qualitative results, ablation studies, and additional analyses to validate the effectiveness of our proposed method.

Experimental Setup

Datasets. We evaluate the proposed method on four benchmark datasets: MNIST [23], Fashion-MNIST [24], CIFAR-10 [25], and COIL20 [26]. Table 1 summarizes the number of samples, original image resolutions, and class numbers. To ensure a fair comparison, all images are resized to 32×3232 \times32 pixels before being fed into the network, except for COIL20, which is resized to 128×128128 \times128 pixels. Unless otherwise stated, no data augmentation is applied, and raw pixel values are adopted as input features.

Implementation Details. The architecture of our method is detailed in Section 3. The generator is a cascade of LL stacked discrete distribution blocks. Each DDN adopts a U-Net-style encoder–decoder with instance normalization and SiLU activations. For example, we use a two layer DDN with B=5,2B = 5, 2 on the MNIST dataset. The first DDN receives an initial spatial embedding; each subsequent DDN takes the feature map produced by its predecessor, which is projected and fused into the first encoder block via a residual addition. The decoder outputs a tensor of size B×C×H×WB \times C \times H \times W, which is reshaped into BB candidate reconstructions. Each candidate is passed through a shared output head consisting of a 1×11 \times1 convolution followed by a tanh activation. During training, the candidates are compared with the target image under the regularized Wasserstein distance, and the whole model is optimized end-to-end with Adam [27] at a learning rate of 2×10−32 \times10^{-3}. Our implementation is publicly available on GitHub.

Clustering Results

We evaluate clustering performance using clustering accuracy (ACC) and normalized mutual information (NMI). ACC is obtained by aligning predicted cluster assignments with ground-truth labels via the Hungarian algorithm, while NMI quantifies the normalized mutual information shared between the two labelings. We first compare DGC with classical methods, including K-means, Gaussian Mixture Models (GMM), Hierarchical Clustering (HC), DBSCAN, and Spectral Clustering (SC). Then we compare DGC with recent generative-model-based methods, including VaDE[19], ClusterGAN[3], GAN-EM[28], VaGAN[29] and ClusterDDPM[18].

As shown in Table 2, DGC consistently outperforms all classical baselines on every dataset. On MNIST, DGC achieves 62.14% ACC, a relative improvement of 11.4% over the strongest baseline SC (55.80%), and also attains the best NMI (0.622), surpassing SC by 0.104. On COIL20, DGC reaches 51.09% ACC, exceeding SC by 0.84 points. The improvements on Fashion-MNIST and CIFAR-10 are consistent as well, where DGC attains the highest ACC and NMI among classical methods.

MethodMNISTF-MNISTCIFAR-10COIL20
ACCNMIACCNMIACCNMIACCNMI
Classical clustering vs. DGC
K-means53.240.49951.080.39223.600.10247.330.480
GMM53.720.50152.340.40921.470.11348.160.477
HC52.100.48549.750.37820.120.09546.200.465
DBSCAN48.330.45245.600.34118.450.08842.110.430
SC55.800.51853.900.42125.300.12150.250.492
DGC62.140.62754.810.42825.380.13851.090.511
Generative-model-based clustering vs. DGC
VaDE94.460.89162.870.61126.650.15175.480.779
ClusterGAN95.000.89063.000.64028.120.15677.000.811
GAN-EM94.930.89963.570.64223.140.11074.030.833
VaGAN95.750.90166.950.67130.200.17281.670.868
ClusterDDPM94.730.91267.500.64228.900.16078.800.850
DGC+ClusterGAN96.420.92568.330.65229.150.16580.050.879

Table 2. Clustering performance comparison.

To further assess DGC against recent generative-model-based clustering methods, we apply DGC as a secondary clustering module on the feature representations produced by ClusterGAN, resulting in the variant DGC + ClusterGAN. All generative baselines are evaluated under the same protocol for fairness. In particular, we re-implemented ClusterDDPM based on their official code. The original paper reports approximately 97.67% accuracy on MNIST, while our reproduced result is 94.73% under the same setting. As shown in Table 2, DGC+ClusterGAN achieves the best ACC and NMI on MNIST (96.42% and 0.925) and Fashion-MNIST (68.33% and 0.652), and achieves the best NMI on COIL20 (0.879). These results demonstrate that DGC serves as an effective and general clustering module that can be integrated with different generative models, providing robust improvements over their original clustering performance.

Qualitative Analysis

Cluster Center Visualization. Unlike traditional methods that produce abstract centroid parameters, our cluster centers are actual generated samples from the data distribution. Figure 3 compares the cluster centers produced by different algorithms. Notably, we do not apply any data normalization; the raw pixel values are used directly. Our method generates more meaningful and visually interpretable centers.

Comparison of cluster centers

Figure 3. Comparison of cluster centers. Prototypes: Class mean, DDN, K-Means and GMM (columns = matched digit 0–9).

To verify whether the prototypes produced by DDN are statistically representative, we compare them with the real class-wise means on MNIST. As reported in Table 3, DDN achieves the best average cosine similarity (0.9844), the lowest MSE (0.0233), and the highest PSNR (22.35 dB) among all prototype estimators. Moreover, DDN attains the best per-digit cosine similarity on 5 of 10 digits and the best per-digit MSE on 5 of 10 digits. In contrast, K-Means suffers from a catastrophic outlier on digit 9 (cosine similarity of 0.853 and MSE of 0.2061), and GMM degrades notably on digits 4–5. These results indicate that generative prototypes are not only closer to the true class means on average but also more stable across categories, making them more reliable for nearest-prototype assignment in clustering.

MethodCos.↑\uparrowMSE↓\downarrowPSNR (dB)↑\uparrowCos. winsMSE wins
K-Means0.96950.043819.6032
GMM0.97430.034920.5923
DDN0.98440.023322.3555

Table 3. Prototype quality comparison on MNIST. All prototypes are compared with the real class-wise means over 60,000 training samples resized to 32×3232 \times32. PSNR is computed with a peak value of 2 under [−1,1][-1,1] normalization. Cos. wins / MSE wins report the number of digits (out of 10) on which each method achieves the best per-digit cosine similarity / MSE.

t-SNE Visualization. Figure 4 visualizes the embedding spaces of different methods on MNIST. The t-SNE visualization on MNIST compares the embedding spaces of different clustering methods. The ground-truth labels form clear and well-separated clusters. In contrast, K-means and GMM produce heavily overlapping clusters with ambiguous boundaries, especially between similar digits. Our method yields compact, distinctly separated clusters that closely match the ground-truth structure, demonstrating that it learns more discriminative feature representations and preserves the data manifold better than traditional baselines.

t-SNE visualization on MNIST

Figure 4. t-SNE visualization on MNIST. Colors indicate ground-truth digit classes. Our method yields more separated clusters.

Generation Results. Our model generates diverse samples by randomly selecting among the KK candidates. Figure 5 shows continuous and discrete generation results on MNIST and FFHQ. The discrete outputs maintain high visual quality while exhibiting diversity, which demonstrates the generation ability of DDN with the regularized Wasserstein distance.

Continuous MNIST generated samples

(a) (a) Continuous (MNIST)

Discrete MNIST generated samples

(b) (b) Discrete (MNIST)

Continuous FFHQ generated samples

(c) (c) Continuous (FFHQ)

Discrete FFHQ generated samples

(d) (d) Discrete (FFHQ)

Figure 5. Generated samples. Continuous results are obtained by interpolation; discrete results are randomly selected candidates.

Effect of Candidate Number KK. We investigate the impact of the number of candidate prototypes KK on the generative quality. As visualized in Figure 6, directly increasing KK within a small range (e.g., K≤10K \le10) leads to noticeable improvements in the clarity and diversity of the generated digit images. However, naively enlarging KK beyond 10 introduces significant computational overhead. To address this, we adopt a tree-structured multi-layer DDN to organize the candidates, which effectively scales up KK (up to 10610^{6}) while strictly guaranteeing the clustering efficiency of O(log⁡K)O(\log K). With this hierarchical design, larger KK values provide a richer prototype hypothesis space, enabling the model to capture finer data distributions and generate much clearer, more realistic, and separated digit prototypes compared to the baseline methods.

Figure 6. Visualization of generation results with different candidate numbers KK on the MNIST dataset. When K≤10K \le10, we use a single-layer DDN with the corresponding KK. When K>10K > 10, we use log⁡K\log K DDN layers.

As shown in Figure 7, we evaluate the runtime efficiency with respect to the number of candidates KK on the MNIST dataset. The results demonstrate that for small values of KK (K≤10K \le10), the runtime remains nearly constant at approximately 5.5 min, which reflects the fixed baseline overhead of the process.

Time consumption of different number of cluster K on the MNIST dataset

Figure 7. Time consumption of different number of cluster KK on the MNIST dataset.

As KK increases to 10210^{2} and beyond, the runtime begins to rise. Notably, when plotted against KK on a logarithmic scale, the measured runtime curve aligns almost perfectly with the theoretical O(log⁡K)O(\log K) reference line. This strong agreement visually verifies that our method achieves an O(log⁡K)O(\log K) time complexity for large candidate sets. Even at K=106K = 10^{6}, the total time consumption is only 23.9 min, further confirming the high scalability and efficiency of the proposed approach.

Ablation Studies

Effect of Network Width. We further examine the sensitivity of DGC to the network width nfn_f, i.e., the number of channels in the convolutional layers. Specifically, we vary nf∈{4,8,16,32}n_f \in\{4, 8, 16, 32\} while keeping all other hyperparameters fixed. As shown in Table 4, the clustering accuracy (ACC) remains largely stable across different widths: increasing nfn_f from 4 to 32 improves the ACC by only 1.34 percentage points on MNIST, and by less than 0.6 points on Fashion-MNIST, CIFAR-10, and COIL20. Notably, even the compact network with nf=4n_f = 4 already achieves competitive clustering performance, suggesting that the clustering objective relies primarily on the discriminative information captured by the learned prototypes rather than on the capacity of the network. In contrast, the visual quality of the generated samples improves noticeably with larger nfn_f: a wider network provides a richer hypothesis space and models finer details of the data distribution, yielding clearer and more realistic prototypes. We therefore adopt nf=32n_f = 32 as the default configuration to balance clustering performance and generative fidelity.

ConfigMNIST ACCMNIST NMIF-MNIST ACCF-MNIST NMICIFAR-10 ACCCIFAR-10 NMICOIL20 ACCCOIL20 NMI
(a) Effect of network width nfn_f (with λ=0.1\lambda= 0.1)
460.800.61254.300.42125.000.13250.600.496
861.000.62154.600.43025.100.13450.870.503
1661.200.62454.700.42725.300.13751.000.508
3262.140.62754.810.42825.380.13851.090.511
(b) DDN baseline with SPLIT-AND-PRUNE
3254.200.54247.800.37122.200.12244.400.454
(c) DDN baseline without Sinkhorn–Knopp loss
3211.500.05114.200.09210.800.0216.500.031
(d) Sensitivity to Sinkhorn–Knopp loss weight λ\lambda (at nf=32n_f = 32)
0.0155.200.45349.300.34221.400.09145.100.407
0.0559.800.55852.600.39423.900.12549.200.478
0.1062.140.62754.810.43025.380.14051.090.511
0.5036.900.28232.400.22313.100.04229.800.292

Table 4. Ablation study on network width nfn_f, Sinkhorn–Knopp loss presence, and weight λ\lambda.

Effect of regularized Wasserstein distance. We further ablate the effect of Sinkhorn–Knopp loss in Table 4. DDN baseline with SPLIT-AND-PRUNE represents the original DDN’s results and DDN baseline without Sinkhorn–Knopp loss removes SPLIT-AND-PRUNE operation and Chain Dropout from DNN.

First, we compare DGC with the original DDN baseline with SPLIT-AND-PRUNE (row (b)). DGC consistently outperforms this baseline, e.g., 62.14% vs. 54.20% ACC on MNIST, 54.81% vs. 47.80% on Fashion-MNIST, 25.38% vs. 22.20% on CIFAR-10, and 51.09% vs. 44.40% on COIL20, confirming the benefit of our Sinkhorn-based objective and the hierarchical candidate selection. Removing the Wasserstein distance term (row (c)) causes a catastrophic degradation across all datasets. On MNIST, the ACC drops from 62.14% to 11.50%, which is essentially random guessing, and similar collapses are observed on Fashion-MNIST (14.20%), CIFAR-10 (10.80%), and COIL20 (6.50%, whose random baseline is 5%). This confirms that without an optimal-transport-based geometric constraint, the generated prototypes fail to align with the true data distribution and clustering degenerates into trivial solutions.

The weight λ\lambda of the regularized Wasserstein distance plays a critical role. At λ=0.01\lambda= 0.01, the performance is markedly lower (e.g., 55.20% ACC on MNIST). This is because a small λ\lambda weakens the entropic regularization and makes the Sinkhorn–Knopp iteration converge very slowly; with the iteration number truncated at 30, the approximation error becomes non-negligible, and the computed regularized Wasserstein distance no longer reflects the true transport cost. As λ\lambda increases to 0.05, the accuracy improves substantially (59.80% on MNIST), and the best results are obtained at $\lambda = 0.10 (62.14%62.14\% on MNIST), where the regularized Wasserstein distance is accurately approximated within 30 iterations while still preserving sufficient geometric structure. However, when λ\lambda is too large, e.g., λ=0.50\lambda= 0.50, the entropy regularization dominates the transport cost and the regularized Wasserstein distance gradually deviates from the true earth mover’s distance. Consequently, the geometric information is no longer faithfully preserved, and the ACC drops sharply to 36.90%36.90\% on MNIST, with analogous declines on the other datasets. These results demonstrate that λ\lambda should be chosen in a moderate range to balance the approximation accuracy of the Sinkhorn iteration and the geometric fidelity of the optimal transport objective.

Convergence Analysis. Figure 8 compares the training loss curves of DDN’s ℓ2\ell_{2} loss and the proposed regularized Wasserstein distance. In contrast to adversarial training, which often suffers from instability and oscillations, our method converges smoothly without severe fluctuations. This desirable behavior can be attributed to the strict convexity of the entropy-regularized optimal transport problem with respect to the transport plan, which yields well-behaved gradients throughout training. The ℓ2\ell_{2} loss prones to getting trapped in poor local optima, as reflected by a loss curve that plateaus early with little subsequent improvement. With the regularized Wasserstein distance, the loss decreases steadily and reaches a good solution, exhibiting only minor fluctuations typical of stochastic optimization.

Figure 8. Training loss comparison of mean squared loss and Sinkhorn–Knopp loss.

Related Work

Our proposed DGC shares conceptual similarities with several classic clustering paradigms, yet differs fundamentally in both formulation and practical behavior.

K-means. K-means seeks to partition data into KK clusters by minimizing the within-cluster variance [8]. While intuitive, it is sensitive to initialization, requires a fixed KK, and operates on raw feature space without learning representations. DGC, in contrast, learns the cluster centers end-to-end via a deep neural network. Moreover, DGC optimizes a regularized Wasserstein distance objective that preserves global geometric structure [21, 30], in contrast to the squared Euclidean distance used in K-means, whose non-convex objective provides no guarantee of reaching a global optimum.

Self-Organizing Maps. SOM is a neural network-based clustering method that preserves topological structure by mapping high-dimensional data onto a low-dimensional grid [31]. Both SOM and DGC share a similar objective: they try to assign each data point to its nearest prototype. However, DGC offers several advantages. First, its tree-structured architecture enables efficient inference with O(log⁡K)O(\log K) complexity, whereas SOM typically requires scanning all prototypes (O(K)O(K)). Second, SOM focuses on preserving local topology (neighborhood relationships), while DGC aims to produce cluster centers that are the most representative samples from the data distribution, offering clearer interpretability. Third, DGC leverages a deep neural network to learn the underlying data structure automatically, avoiding hand-crafted rules for handling nearby node similarity.

Clustering with Generative Models. A number of recent studies have sought to connect generative modeling with clustering. ClusterGAN [3] and ClusterDDPM [18], for instance, adopt a two-stage pipeline in which a generative model first learns unsupervised deep representations of the data, and a conventional clustering algorithm such as K-means or GMM is then applied to the extracted features. While effective in practice, these methods treat the generative model merely as a feature extractor and do not exploit the structural relationship between the generation process and the clustering objective. In a different line of work, optimal transport has been introduced into clustering as a distance measure [32, 2, 33]; however, these approaches employ Wasserstein distance purely as a metric for comparing clusters, rather than as a distribution fitting criterion. Consequently, existing methods generally regard generation and clustering as two independent tasks. The former aims to model the global data distribution for realistic sampling, while the latter seeks representative centers for data partitioning. In this paper, we argue that clustering can be naturally formulated as a constrained generative modeling problem.

References

  1. [1]B. S. Everitt, S. Landau, M. Leese, D. Stahl, Cluster Analysis, 5th Edition, John Wiley & Sons, 2011.
  2. [2]E. Del Barrio, J. A. Cuesta-Albertos, C. Matrán, J. M. Mayo-Íscar, Robust clustering tools based on optimal transportation, Statistics and Computing 29 (1) (2019) 139–160.DOI
  3. [3]S. Mukherjee, H. Asnani, E. Lin, S. Kannan, Clustergan: Latent space clustering in generative adversarial networks, in: Proceedings of the AAAI conference on artificial intelligence, Vol. 33, 2019, pp. 4610–4617.arxiv.org/abs/1809.03627
  4. [4]M. Ester, H.-P. 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.
  5. [5]H. Jiang, W. Ma, Y. Luo, X. Duan, J. Zhang, Covariance-driven consistency and mmd complementarity with hybrid graph for multi-view clustering, Neural Networks 205 (2027) 109382.DOI
  6. [6]S. Peng, Y. Yuan, X. Yang, Z. Yang, F. Nie, Hierarchical feature based dual contrastive multiview clustering, Neural Networks 205 (2027) 109372.DOI
  7. [7]J. Qiu, Y. Ye, L. Peng, D. Yang, J. Xian, M.-F. Leung, H. Che, C. Liu, Self-supervised semantic graph propagation for multi-view clustering, Neural Networks 202 (2026) 108973.DOI
  8. [8]S. P. Lloyd, Least squares quantization in pcm, IEEE Transactions on Information Theory 28 (2) (1982) 129–137.DOI
  9. [9]C. M. Bishop, Pattern Recognition and Machine Learning, Springer, 2006.
  10. [10]D. Müllner, Modern hierarchical, agglomerative clustering algorithms, arXiv preprint arXiv:1109.2378 (2011).arxiv.org/abs/1109.2378
  11. [11]M. Ester, H.-P. 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.
  12. [12]Y. Liu, J. Mi, H. Wang, An efficient spectral clustering algorithm based on adaptive granular ball anchors, Pattern Recognition (2026) 114747.DOI
  13. [13]I. Guyon, U. Von Luxburg, R. C. Williamson, Clustering: Science or art?, in: Proceedings of ICML Workshop on Unsupervised and Transfer Learning, 2012, pp. 65–79.
  14. [14]J. Ho, A. Jain, P. Abbeel, Denoising diffusion probabilistic models, Advances in Neural Information Processing Systems 33 (2020).arxiv.org/abs/2006.11239
  15. [15]Y. Song, S. Ermon, Generative modeling by estimating gradients of the data distribution, in: 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.arxiv.org/abs/1907.05600
  16. [16]Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, B. Poole, Score-based generative modeling through stochastic differential equations, in: 9th International Conference on Learning Representations, ICLR, OpenReview.net, 2021.
  17. [17]A. Hyvärinen, Estimation of non-normalized statistical models by score matching, Journal of Machine Learning Research 6 (Apr) (2005) 695–709.DOI
  18. [18]J. Yan, J. Liu, Z.-y. Zhang, Clusterddpm: an em clustering framework with denoising diffusion probabilistic models, Information Sciences (2025) 122518.arxiv.org/abs/2312.08029
  19. [19]Z. Jiang, Y. Zheng, H. Tan, B. Tang, H. Zhou, Variational deep embedding: 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.
  20. [20]L. Yang, Discrete distribution networks, in: International Conference on Learning Representations, Vol. 2025, 2025, pp. 60698–60721.arxiv.org/abs/2401.00036
  21. [21]M. Cuturi, Sinkhorn distances: Lightspeed computation of optimal transportation distances, in: Advances in Neural Information Processing Systems (NeurIPS) 26, Curran Associates, Inc., 2013, pp. 2292–2300.arxiv.org/abs/1306.0895
  22. [22]X. Qian, G. Cabanes, P. Rastin, M. A. Guidani, G. Marracchi, M. Clausel, N. Grozavu, Incremental clustering based on wasserstein distance between histogram models, Pattern Recognition 162 (2025) 111414.DOI
  23. [23]Y. LeCun, L. Bottou, Y. Bengio, P. Haffner, Gradient-based learning applied to document recognition, Proceedings of the IEEE 86 (11) (1998) 2278–2324.
  24. [24]H. Xiao, K. Rasul, R. Vollgraf, Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms, arXiv preprint arXiv:1708.07747 (2017).arxiv.org/abs/1708.07747
  25. [25]A. Krizhevsky, G. Hinton, et al., Learning multiple layers of features from tiny images (2009).
  26. [26]S. A. Nene, S. K. Nayar, H. Murase, Columbia object image library (coil-20), Tech. Rep. CUCS-005-96, Columbia University, Department of Computer Science (1996).
  27. [27]D. P. Kingma, J. Ba, Adam: A method for stochastic optimization, arXiv preprint arXiv:1412.6980 (2014).arxiv.org/abs/1412.6980
  28. [28]W. Zhao, S. Wang, Z. Xie, J. Shi, C. Xu, GAN-EM: 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.arxiv.org/abs/1812.00335
  29. [29]L. Yang, W. Fan, N. Bouguila, Clustering analysis via deep generative models with mixture models, IEEE Trans. Neural Networks Learn. Syst. 33 (1) (2022) 340–350.
  30. [30]A. Genevay, G. Peyré, M. Cuturi, Learning generative models with sinkhorn divergences, in: Proceedings of the 21st International Conference on Artificial Intelligence and Statistics (AISTATS), Vol. 84, PMLR, 2018, pp. 1608–1617.arxiv.org/abs/1706.00292
  31. [31]T. Kohonen, The self-organizing map, Proceedings of the IEEE 78 (9) (1990) 1464–1480.
  32. [32]S. Chakraborty, D. Paul, S. Das, Hierarchical clustering with optimal transport, Statistics & Probability Letters 163 (2020) 108781.DOI
  33. [33]C. Laclau, I. Redko, B. Matei, Y. Bennani, V. Brault, Co-clustering through optimal transport, in: Proceedings of the 34th International Conference on Machine Learning (ICML), Vol. 70, PMLR, 2017, pp. 1955–1964.arxiv.org/abs/1705.06189

AI tools statement

No AI-use declaration is available for this version in Valency.

The available record does not establish whether AI systems or models contributed to this work.

How AI tools are recorded

Paper details

Cite this paper

Publication

Published
Version
Latest

Data & code

Code, data, proofs and workflows the authors linked for testing, review and reproduction. These links are part of this work’s metadata and are released under the same license as the rest of that metadata. Valency doesn’t host the files; each keeps the license set where it’s hosted.

Pick where to look, or just type