HyperAIHyperAI

Command Palette

Search for a command to run...

3 months ago

Single Layer Predictive Normalized Maximum Likelihood for Out-of-Distribution Detection

Koby Bibas Meir Feder Tal Hassner

Single Layer Predictive Normalized Maximum Likelihood for Out-of-Distribution Detection

Abstract

Detecting out-of-distribution (OOD) samples is vital for developing machine learning based models for critical safety systems. Common approaches for OOD detection assume access to some OOD samples during training which may not be available in a real-life scenario. Instead, we utilize the {\em predictive normalized maximum likelihood} (pNML) learner, in which no assumptions are made on the tested input. We derive an explicit expression of the pNML and its generalization error, denoted as the {\em regret}, for a single layer neural network (NN). We show that this learner generalizes well when (i) the test vector resides in a subspace spanned by the eigenvectors associated with the large eigenvalues of the empirical correlation matrix of the training data, or (ii) the test sample is far from the decision boundary. Furthermore, we describe how to efficiently apply the derived pNML regret to any pretrained deep NN, by employing the explicit pNML for the last layer, followed by the softmax function. Applying the derived regret to deep NN requires neither additional tunable parameters nor extra data. We extensively evaluate our approach on 74 OOD detection benchmarks using DenseNet-100, ResNet-34, and WideResNet-40 models trained with CIFAR-100, CIFAR-10, SVHN, and ImageNet-30 showing a significant improvement of up to 15.6\% over recent leading methods.

Code Repositories

kobybibas/pnml_ood_detection
Official
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
out-of-distribution-detection-on-cifar-10-vs-2DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-2ResNet-34
AUROC: 99.8
out-of-distribution-detection-on-cifar-10-vs-3DenseNet-BC-100
AUROC: 99.9
out-of-distribution-detection-on-cifar-10-vs-3ResNet-34
AUROC: 99.5
out-of-distribution-detection-on-cifar-10-vs-4ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-4DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-5ResNet-34
AUROC: 99.9
out-of-distribution-detection-on-cifar-10-vs-5DenseNet-BC-100
AUROC: 99.9
out-of-distribution-detection-on-cifar-10-vs-6ResNet-34
AUROC: 99.8
out-of-distribution-detection-on-cifar-10-vs-6DenseNet-BC-100
AUROC: 99.9
out-of-distribution-detection-on-cifar-10-vs-7DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-7ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-8DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-8ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-9ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-10-vs-9DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-1DenseNet-BC-100
AUROC: 99.5
out-of-distribution-detection-on-cifar-100-vs-1ResNet-34
AUROC: 99.3
out-of-distribution-detection-on-cifar-100-vs-2DenseNet-BC-100
AUROC: 96.1
out-of-distribution-detection-on-cifar-100-vs-2ResNet-34
AUROC: 97.8
out-of-distribution-detection-on-cifar-100-vs-3ResNet-34
AUROC: 99.6
out-of-distribution-detection-on-cifar-100-vs-3DenseNet-BC-100
AUROC: 99.7
out-of-distribution-detection-on-cifar-100-vs-4DenseNet-BC-100
AUROC: 99.5
out-of-distribution-detection-on-cifar-100-vs-4ResNet-34
AUROC: 99.2
out-of-distribution-detection-on-cifar-100-vs-5DenseNet-BC-100
AUROC: 99.0
out-of-distribution-detection-on-cifar-100-vs-5ResNet-34
AUROC: 98.4
out-of-distribution-detection-on-cifar-100-vs-6ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-6DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-7DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-7ResNet-34
AUROC: 100
out-of-distribution-detection-on-cifar-100-vs-8ResNet-34
AUROC: 97.9
out-of-distribution-detection-on-cifar-100-vs-8DenseNet-BC-100
AUROC: 98.4
out-of-distribution-detection-on-svhn-vsResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vsDenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-1DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-1ResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-2DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-2ResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-3DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-3ResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-4DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-4ResNet-34
AUROC: 99.8
out-of-distribution-detection-on-svhn-vs-5DenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-5ResNet-34
AUROC: 99.8
out-of-distribution-detection-on-svhn-vs-isunDenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-isunResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-lsunResNet-34
AUROC: 99.9
out-of-distribution-detection-on-svhn-vs-lsunDenseNet-BC-100
AUROC: 100
out-of-distribution-detection-on-svhn-vs-lsun-1ResNet-34
AUROC: 100
out-of-distribution-detection-on-svhn-vs-lsun-1DenseNet-BC-100
AUROC: 100

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp