Open Set Recognition with Conditional Probabilistic Generative Models

Xin Sun, Chi Zhang, Guosheng Lin, Keck Voon LingarXiv 2020

Abstract

Deep neural networks have made breakthroughs in a wide range of visual understanding tasks. A typical challenge that hinders their real-world applications is that unknown samples may be fed into the system during the testing phase, but traditional deep neural networks will wrongly recognize these unknown samples as one of the known classes. Open set recognition (OSR) is a potential solution to overcome this problem, where the open set classifier should have the flexibility to reject unknown samples and meanwhile maintain high classification accuracy in known classes. Probabilistic generative models, such as Variational Autoencoders (VAE) and Adversarial Autoencoders (AAE), are popular methods to detect unknowns, but they cannot provide discriminative representations for known classification. In this paper, we propose a novel framework, called Conditional Probabilistic Generative Models (CPGM), for open set recognition. The core insight of our work is to add discriminative information into the probabilistic generative models, such that the proposed models can not only detect unknown samples but also classify known classes by forcing different latent features to approximate conditional Gaussian distributions. We discuss many model variants and provide comprehensive experiments to study their characteristics. Experiment results on multiple benchmark datasets reveal that the proposed method significantly outperforms the baselines and achieves new state-of-the-art performance.

Introduction

Most deep learning classifiers operate under a "closed set" assumption: they assume that every object encountered during testing will belong to one of the classes seen during training. In real-world scenarios, this assumption is frequently violated. When a standard model trained to recognize "dog" and "cat" is presented with a "kangaroo," it will typically assign a high-confidence label to one of the known classes.

Open Set Recognition (OSR) addresses this by requiring models to maintain high accuracy on known classes while effectively rejecting unknown samples. While generative models like Variational Autoencoders (VAEs) are naturally suited for modeling data distributions, they often lack discriminative power because they map all classes to a single universal latent distribution.

The CPGM Framework

The authors propose Conditional Probabilistic Generative Models (CPGM), specifically CPGM-VAE and CPGM-AAE, to bridge the gap between generative modeling and discriminative classification.

The CPGM framework architecture, illustrating the encoder-decoder structure with class-conditional priors and dual-criterion detection.

Key Architectural Innovations

  1. Class-Conditional Priors: Instead of forcing all latent features into a single centered Gaussian distribution, CPGM forces the features of each class $k$ to approximate a specific conditional Gaussian distribution $N(z; \mu_k, I)$. The means ($\mu_k$) are learned mappings from class labels.
  2. Probabilistic Ladder Architecture: To prevent "posterior collapse" in deep VAEs, a ladder structure merges bottom-up likelihoods with top-down priors across multiple layers, ensuring the latent code remains informative.
  3. Adversarial Training: In the AAE variant, a categorical distribution output is added to the encoder and mapped back into the latent space to provide class-specific means, while a discriminator ensures the latent space matches the prior.

Dual-Criterion Detection

At test time, the model employs two criteria to identify unknown samples:

  • Conditional Gaussian Distribution (CGD): Rejects samples whose latent representations are too distant from all known class clusters.
  • Reconstruction Error (RE): Rejects samples that the model fails to reconstruct accurately. Unknown samples typically yield significantly higher errors as the model attempts to map them to the nearest known class manifold.

Experimental Results and Insights

The CPGM models achieved new state-of-the-art results across several benchmarks, including MNIST, SVHN, and CIFAR-10. For instance, on MNIST outlier detection, CPGM-AAE achieved an F1-score of 0.872, significantly outperforming previous methods like CROSR (0.826).

t-SNE visualizations comparing standard VAE/AAE with the proposed CPGM-VAE and CPGM-AAE, demonstrating the superior cluster compactness of the CPGM variants.

Visualization using t-SNE reveals that CPGM-AAE creates much tighter, more compact clusters for known classes compared to CPGM-VAE and standard generative models. This compactness is crucial for OSR, as it leaves more "empty space" in the latent manifold for unknown samples to be identified as outliers. While VAEs and AAEs behave differently—with VAEs relying more on latent distribution checks and AAEs on reconstruction error—combining both criteria provides a robust fail-safe for open set environments.

Conclusion

By injecting class-conditional information into the latent priors of generative models, CPGM transforms unsupervised architectures into powerful hybrid models capable of both high-accuracy classification and reliable unknown detection. Future work will explore more complex prior distributions to better capture the manifolds of high-dimensional natural images.

Summary updated

BibTeX
@misc{sun2020open,
  author = {Xin Sun and Chi Zhang and Guosheng Lin and Keck Voon Ling},
  title = {{Open Set Recognition with Conditional Probabilistic Generative Models}},
  year = {2020},
  eprint = {2008.05129},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2008.05129},
}
Figure