NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Class-Balancing Diffusion Models

Yiming Qin, Huangjie Zheng, Jiangchao Yao, Mingyuan Zhou, Ya Zhang · DOI

Abstract

Diffusion-based models have shown the merits of generating high-quality visual data while preserving better diversity in recent studies. However, such observation is only justified with curated data distribution, where the data samples are nicely pre-processed to be uniformly distributed in terms of their labels. In practice, a long-tailed data distribution appears more common and how diffusion models perform on such class-imbalanced data remains unknown. In this work, we first investigate this problem and observe significant degradation in both diversity and fidelity when the diffusion model is trained on datasets with class-imbalanced distributions. Especially in tail classes, the generations largely lose diversity and we observe severe mode-collapse issues. To tackle this problem, we set from the hypothesis that the data distribution is not class-balanced, and propose Class-Balancing Diffusion Models (CBDM) that are trained with a distribution adjustment regularizer as a solution. Experiments show that images generated by CBDM exhibit higher diversity and quality in both quantitative and qualitative ways. Our method benchmarked the generation results on CIFAR100/CIFAR100LT dataset and shows outstanding performance on the downstream recognition task.

The Challenge of Long-Tailed Data

Most generative models are developed using "curated" datasets like ImageNet or CIFAR, where every category has roughly the same number of images. However, the real world is "long-tailed": a few "head" classes are abundant, while many "tail" classes are extremely rare.

Standard diffusion models, such as the Denoising Diffusion Probabilistic Model (DDPM), struggle significantly on these imbalanced datasets. As the frequency of a class decreases, the model's ability to capture its distribution falters. This leads to a sharp increase in the Fréchet Inception Distance (FID), indicating a loss of both fidelity and diversity. In tail classes, the model often suffers from mode collapse—generating the same few low-quality images repeatedly—or produces unrecognizable semantics.

Figure 1: Class frequency vs. FID showing quality degradation in tail classes.

Methodology: Class-Balancing Diffusion Models (CBDM)

The core contribution of this work is the Class-Balancing Diffusion Model (CBDM). Rather than simply over-sampling rare classes, which can lead to overfitting, CBDM introduces a Distribution Adjustment Regularizer into the training objective.

  1. Knowledge Transfer: The regularizer manifests as an additional Mean Squared Error (MSE) loss that encourages the model to increase feature similarity between different classes. This allows tail classes to "borrow" structural information and common features from well-represented head classes without losing their unique identity.
  2. Stop-Gradient Operation: To prevent the model from collapsing into a state where it ignores class labels entirely, a "stop-gradient" operation is implemented. This ensures the regularization remains stable and label-specific information is preserved.
  3. Plug-and-Play Integration: CBDM is designed for simplicity. It can be implemented in just a few lines of code and added to almost any existing conditional diffusion backbone, such as EDM or Diffusion-ViT.

Experimental Results

The researchers evaluated CBDM on several benchmarks, including CIFAR10-LT, CIFAR100-LT, and high-resolution datasets like CUB-200 and ImageNet-LT.

Superior Diversity and Fidelity

On CIFAR100-LT, CBDM achieved an FID of 6.26, significantly outperforming the baseline DDPM (7.38). Qualitative results demonstrate that while DDPM produces blurry or repetitive artifacts for tail classes, CBDM produces distinct, recognizable objects with varied textures and colors.

Figure 5: Qualitative comparison between DDPM and CBDM on tail and body classes.

Downstream Impact

Beyond image quality, the study explored the utility of generated data for training classifiers. Images generated by CBDM are high-quality enough to serve as effective data augmentation. Using CBDM to augment a ResNet-32 classifier on CIFAR100-LT improved the classifier's recall from 0.39 to 0.47, demonstrating the practical value of balanced generative modeling for recognition tasks.

Conclusion

CBDM addresses a critical gap in generative modeling by enabling diffusion models to handle the class imbalances inherent in real-world data. By leveraging a distribution adjustment regularizer, the model prevents mode collapse in tail classes and significantly boosts both the diversity and fidelity of generated images. Future work may explore "ultra-long-tail" scenarios and further optimize the computational overhead introduced by the regularization process.

Summary updated

BibTeX
@inproceedings{qin2023class,
  author = {Yiming Qin and Huangjie Zheng and Jiangchao Yao and Mingyuan Zhou and Ya Zhang},
  title = {{Class-Balancing Diffusion Models}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  doi = {10.1109/cvpr52729.2023.01768},
}
Figure