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