Skip to main content
QUICK REVIEW

[Paper Review] Detecting Out-of-distribution Samples via Variational Auto-encoder with Reliable Uncertainty Estimation

Xuming Ran, Mingkun Xu|arXiv (Cornell University)|Jul 16, 2020
Anomaly Detection Techniques and ApplicationsComputer Science37 references6 citations
TL;DR

This paper proposes INCPVAE, a variational autoencoder with improved noise contrastive priors (INCP) integrated into the encoder to enable reliable uncertainty estimation for out-of-distribution (OOD) detection. By replacing likelihood with INCP-KL ratio as the OOD detection metric, the model achieves state-of-the-art AUROC of 1.000 on CIFAR10 vs. SVHN, outperforming standard VAEs and prior methods.

ABSTRACT

Variational autoencoders (VAEs) are influential generative models with rich representation capabilities from the deep neural network architecture and Bayesian method. However, VAE models have a weakness that assign a higher likelihood to out-of-distribution (OOD) inputs than in-distribution (ID) inputs. To address this problem, a reliable uncertainty estimation is considered to be critical for in-depth understanding of OOD inputs. In this study, we propose an improved noise contrastive prior (INCP) to be able to integrate into the encoder of VAEs, called INCPVAE. INCP is scalable, trainable and compatible with VAEs, and it also adopts the merits from the INCP for uncertainty estimation. Experiments on various datasets demonstrate that compared to the standard VAEs, our model is superior in uncertainty estimation for the OOD data and is robust in anomaly detection tasks. The INCPVAE model obtains reliable uncertainty estimation for OOD inputs and solves the OOD problem in VAE models.

Motivation & Objective

  • To address the OOD problem in VAEs, where OOD samples are assigned higher likelihoods than in-distribution (ID) samples.
  • To develop a method that enables reliable uncertainty estimation for OOD inputs in unsupervised generative models.
  • To integrate noise contrastive priors (NCPs) into the VAE framework, which were previously limited to classifier models.
  • To propose a novel OOD detection criterion based on INCP-KL ratio, improving robustness and performance over likelihood-based methods.

Proposed method

  • Propose an improved noise contrastive prior (INCP) tailored for VAEs, enabling trainable and scalable uncertainty estimation.
  • Integrate INCP into the encoder of VAEs, allowing joint training with ID data and OOD data generated by adding Gaussian noise to ID inputs.
  • Define a new metric, the ELBO Ratio, to estimate uncertainty by comparing ELBO values under increasing noise levels.
  • Use the INCP-KL ratio—computed as the ratio of KL divergence under INCP to standard KL—as the primary OOD detection criterion.
  • Train the model end-to-end using a modified loss function that incorporates INCP to encourage high uncertainty for OOD inputs.
  • Apply a simple threshold (e.g., α = 1) on the INCP-KL ratio to classify samples as OOD or ID, enabling practical deployment.
Figure 1: Generating OOD samples by adding Gaussian Noise to the baseline data. The baseline data is sample from the original image dataset (e.g., FashionMNIST, MNIST, CIFAR10, SVHN). We add the Gaussian Noise at three levels to generate the OOD sample with different complexity. The Baseline+Noise i
Figure 1: Generating OOD samples by adding Gaussian Noise to the baseline data. The baseline data is sample from the original image dataset (e.g., FashionMNIST, MNIST, CIFAR10, SVHN). We add the Gaussian Noise at three levels to generate the OOD sample with different complexity. The Baseline+Noise i

Experimental results

Research questions

  • RQ1Can improved noise contrastive priors (INCP) be successfully adapted to the VAE framework to enhance uncertainty estimation for OOD detection?
  • RQ2Does the ELBO Ratio metric reliably index uncertainty in input data, especially under increasing noise levels?
  • RQ3Can the INCP-KL ratio outperform likelihood and other baselines in detecting OOD samples across diverse datasets?
  • RQ4Is the proposed method robust to distribution shifts, such as detecting MNIST data when trained on FashionMNIST?
  • RQ5Can the INCPVAE model generalize to real-world OOD data beyond synthetic noise-based OOD generation?

Key findings

  • The INCPVAE model achieves a state-of-the-art AUROC of 1.000 and AUPRC of 1.000 on the CIFAR10 vs. SVHN OOD detection benchmark, significantly outperforming traditional VAEs and prior methods.
  • The ELBO Ratio increases with noise level, demonstrating reliable uncertainty estimation across four datasets, confirming its sensitivity to input uncertainty.
  • INCPVAE successfully transfers uncertainty estimation from FashionMNIST to MNIST, while standard VAEs fail to do so, indicating improved generalization of uncertainty representation.
  • Traditional VAEs assign higher likelihoods to OOD inputs than ID inputs, confirming the OOD problem, whereas INCPVAE mitigates this by using INCP-KL ratio as a detection metric.
  • The INCP-KL ratio method achieves 1.000 AUROC and 1.000 AUPRC on CIFAR10 vs. SVHN, surpassing baselines such as likelihood (AUROC: 0.057), ODIN (0.752), and Mahalanobis distance (0.942).
  • The model’s performance remains robust even when OOD data is generated via simple Gaussian noise, suggesting potential for extension with more realistic OOD data generation techniques.
(a) FashionMNIST
(a) FashionMNIST

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.