Unsupervised Learning for Class Distribution Mismatch

Pan Du, Wangbo Zhao, Xinai Lu, Nian Liu, Zhikai Li, Chaoyu Gong, Suyun Zhao, Hong Chen, Cuiping Li, Kai Wang, Yang You

Introduction

In real-world machine learning deployments, models often encounter a Class Distribution Mismatch (CDM). This occurs when the categories present in the training data do not perfectly align with those encountered during inference. Specifically, a model might be trained on unlabeled data containing "known" classes (e.g., dogs) and "unknown" classes (e.g., forest animals), only to face entirely "new" classes (e.g., cats) in the testing phase.

Comparison of SCDM and UCDM frameworks and their performance on open-set tasks.

Traditional approaches rely on Semi-Supervised Learning (SSL), which requires a small set of human-labeled "seed" data to anchor known classes. However, labeling is costly and these models often fail to distinguish between "unknown" training noise and truly "new" test instances. The proposed UCDM (Unsupervised Learning for Class Distribution Mismatch) framework removes the need for human labels entirely, utilizing unlabeled data and class names to build robust open-set classifiers.

Methodology: Diffusion-Based Data Engine

The primary innovation of UCDM is the use of Diffusion Probabilistic Models (DPMs) to synthesize high-quality training pairs from unlabeled "seed" images. This process involves two main components:

1. Positive Instance Generation

The model selects a random unlabeled image, adds noise, and then uses a diffusion model guided by a text prompt (e.g., "A photo of a dog") to reconstruct it. This ensures the output belongs to a known class while maintaining the original image's "style," lighting, and background, preventing the classifier from overfitting to synthetic artifacts.

2. Negative Instance Generation

To help the model learn what a class is not, UCDM employs Conditional DDIM Inversion. By moving an image's latent representation away from a specific class concept (e.g., "dog"), the model effectively "erases" the object while keeping the rest of the scene intact. This creates perfect counter-examples for boundary-setting in open-set recognition.

The UCDM process for generating positive and negative training instances using diffusion models.

3. Iterative Labeling and Architecture

The system simultaneously trains a "closed-set" classifier (distinguishing between known classes) and an "open-set" classifier (identifying known vs. "other"). As training progresses, the model identifies high-confidence real-world images, assigns pseudo-labels, and incorporates them back into the training pool.

Experimental Results

UCDM was evaluated on CIFAR-10, CIFAR-100, and Tiny-ImageNet benchmarks. The results demonstrate that UCDM significantly outperforms state-of-the-art semi-supervised methods like OpenMatch, even though UCDM uses zero human labels.

On the complex Tiny-ImageNet dataset (with 60% mismatch), UCDM achieved:

  • A 35.1% accuracy boost on known classes.
  • A 63.7% improvement on unknown classes.
  • A 72.5% gain on entirely new classes.

These results suggest that the diversity of "hallucinated" data provided by diffusion models is more effective for training than small, rigid sets of human-provided labels.

Conclusion

UCDM represents a shift toward fully unsupervised open-set learning. By leveraging the generative power of diffusion models to preserve style and create hard negatives, the framework achieves superior robustness against class distribution mismatch. Future work will explore using Large Language Models (LLMs) to generate more diverse prompts and improving the computational efficiency of the synthetic labeling process.

Summary updated

BibTeX
@inproceedings{du2025unsupervised,
  author = {Pan Du and Wangbo Zhao and Xinai Lu and Nian Liu and Zhikai Li and Chaoyu Gong and Suyun Zhao and Hong Chen and Cuiping Li and Kai Wang and Yang You},
  title = {{Unsupervised Learning for Class Distribution Mismatch}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=cnogN1gvbu},
}
Figure