DGD: Density Gradient-Guided Diffusion for Long-Tailed Clustering

Xulun Ye, Yuanyuan Deng, Kun ZhouCVPR 2026 Findings 2026

TL;DR

Mainstream deep clustering methods often fail on real-world data because they assume balanced classes, whereas actual data is typically long-tailed. To address this, Density Gradient-guided Diffusion (DGD) uses an unsupervised density gradient field to steer a diffusion model into generating synthetic samples within sparse, tail-class regions. Combined with a closed-loop contrastive feedback mechanism to maintain semantic consistency, DGD achieves state-of-the-art performance in both long-tailed clustering and long-tailed anomaly detection.

What Problem Does This Paper Address?

Deep clustering has made massive strides in unsupervised representation learning, but it harbors a major blind spot: the assumption of uniform class distributions. In the real world, data is notoriously long-tailed. A few "head" classes contain an abundance of samples, while numerous "tail" classes suffer from severe data scarcity.

When traditional deep clustering algorithms encounter long-tailed data, the feature space becomes dominated by head classes. This skews decision boundaries, effectively swallowing up the subtle semantic features of tail classes and tanking tail-class recall.

Figure 1. Comparison of decision boundaries. (a) Existing meth- ods [3, 5, 57] yield biased boundaries due to head-class domi- nance. (b) Our DGD uses guidance flow to generate tail samples and better correct tail-class representation. Circles denote head/tail samples and the blue line is the class boundary.

While supervised long-tailed learning mitigates this using label priors (e.g., reweighting or resampling), unsupervised clustering cannot rely on annotations. Recent attempts to mix existing samples (like ConMix) help, but they cannot extrapolate beyond the original, sparse data boundaries. On the other hand, standard generative models like Diffusion Models (DMs) naturally drift toward high-density head regions when unguided, or they generate semantically ambiguous data ("semantic confusion") due to the lack of clear class boundaries.

Methods

DGD tackles these challenges using a novel three-stage framework that couples directed data generation with cluster-guided refinement:

  1. Latent Space Density Modeling: The framework maps images into a low-dimensional latent space using a feature extractor. It then applies non-parametric Gaussian Kernel Density Estimation (KDE) to map out the local data density. By defining a differentiable potential function based on this density, the authors calculate a density gradient field that points directly from high-density (head) regions toward low-density (tail) regions.
  2. Density Gradient-guided Diffusion Generation: This gradient field acts as a "guidance flow" injected into the reverse denoising process of a Diffusion Model (DDPM). It explicitly shifts the sampling mean toward data-sparse boundaries. To ensure global exploration early on and fine-grained detail preservation later, DGD uses a time-decaying guidance schedule.
  3. Contrastive Clustering Feedback: To prevent the model from generating unrealistic or semantically confused samples, DGD introduces a closed-loop "generation–clustering–regeneration" cycle. Generated features are merged with real features and assigned pseudo-labels via a clustering head. High-confidence samples are filtered and optimized using an InfoNCE structural consistency loss, pulling intra-class features together and pushing inter-class features apart.
Figure 2. The framework of our method consists of three parts: (1) Latent space density modeling module; (2) Density Gradient-guided Diffusion Generation module; (3) Contrastive clustering feedback module. This tripartite architecture enables adaptive tail sample com- pletion and semantic enhancement by dynamically coupling density-aware generation with cluster-guided refinement.

Datasets

The authors evaluated DGD across two distinct tasks using several standard benchmarks modified to exhibit long-tailed distributions with imbalance ratios ($r$ or $\beta$) ranging from 5 to 200:

  • Long-Tailed Clustering: CIFAR-10-LT, STL-10-LT, and Tiny-ImageNet-LT.
  • Long-Tailed Anomaly Detection (LTAD): MVTec-AD, VisA, and DAGM.

Key Insights and Ideas

  • Density as an Unsupervised Prior: In the absence of labels, local data density gradients can serve as an effective proxy for class scarcity, successfully driving generative models to fill the gaps in underrepresented manifolds.
  • Theoretical Equivalence to Reweighting: The authors mathematically demonstrate that adding the density gradient to the diffusion sampling mean acts as an exponential reweighting of the original data distribution, providing a solid theoretical foundation for why this guidance works.
  • The Power of the Closed Loop: Generation and clustering enjoy a symbiotic relationship here. Generated tail samples refine and balance the clustering boundaries, while the clustering head provides pseudo-labels that act as semantic anchors for subsequent generation cycles.

Key Results

DGD demonstrates superior performance in both image generation quality and downstream clustering accuracy:

Generative Quality

On CIFAR-10-LT (imbalance ratio = 10), DGD achieved a Fréchet Inception Distance (FID) of 5.12 and an Inception Score (IS) of 15.7, comfortably outperforming standard diffusion baselines like DDPM, DDIM, and specialized long-tail generative methods like Adaptive Data Augmentation (ADA).

Clustering Performance

DGD consistently outperformed 11 representative deep clustering and long-tailed learning methods. For instance, on CIFAR-10-LT with an imbalance ratio of 10, DGD achieved a Clustering Accuracy (ACC) of 54.5% and a Normalized Mutual Information (NMI) of 56.7%, outperforming its closest competitor, ConMix (51.3% ACC, 56.2% NMI).

t-SNE visualizations clearly illustrate how DGD prevents tail samples from collapsing into head-class clusters, creating more compact, well-separated representations.

Figure 4. t-SNE visualization of feature embeddings on CIFAR- 10-LT with imbalance ratio = 10 for the baseline (left) and DGD- enhanced model (right).

Extended Application (LTAD)

When adapted as an augmentation module (DGD-AM) for unsupervised anomaly detection under long-tailed settings, it consistently boosted the performance of the baseline UniAD model, particularly on minority (low-density) classes, without sacrificing head-class accuracy.

Limitations and Future Work

Not discussed in the paper.

Summary updated

BibTeX
@inproceedings{ye2026dgd,
  author = {Xulun Ye and Yuanyuan Deng and Kun Zhou},
  title = {{DGD: Density Gradient-Guided Diffusion for Long-Tailed Clustering}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2026},
  url = {https://openreview.net/forum?id=hQzQkUgAwU},
}
Figure