# Probabilistic Modeling of Deep Features for Out-of-Distribution and Adversarial Detection

arXiv: https://arxiv.org/abs/1909.11786 · HTML: https://mlsanity.com/paper/1909.11786/

## Key facts

- Cited by 39 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 25 Sep 2019.

## Built on by (most cited first, 30 of 39)

- [Anomalib: A Deep Learning Library for Anomaly Detection](https://mlsanity.com/paper/2202.08341/) (2022)
- [The Eyecandies Dataset for Unsupervised Multimodal Anomaly Detection and Localization](https://mlsanity.com/paper/2210.04570/) (2022)
- [EasyNet: An Easy Network for 3D Industrial Anomaly Detection](https://mlsanity.com/paper/2307.13925/) (2023)
- [Learning to Detect Multi-class Anomalies with Just One Normal Image Prompt](https://mlsanity.com/paper/2505.09264/) (2025)
- [Do We Really Need to Learn Representations from In-domain Data for Outlier Detection?](https://mlsanity.com/paper/2105.09270/) (2021)
- [Two Coupled Rejection Metrics Can Tell Adversarial Examples Apart](https://mlsanity.com/paper/2105.14785/) (2021)
- [A Data-Driven Measure of Relative Uncertainty for Misclassification Detection](https://mlsanity.com/paper/2306.01710/) (2023)
- [Learning image representations for anomaly detection: application to discovery of histological alterations in drug development](https://mlsanity.com/paper/2210.07675/) (2022)
- [On Pixel-level Performance Assessment in Anomaly Detection](https://mlsanity.com/paper/2310.16435/) (2023)
- [Out-of-Distribution Data: An Acquaintance of Adversarial Examples -- A Survey](https://mlsanity.com/paper/2404.05219/) (2024)
- [Mitigating Sampling Bias and Improving Robustness in Active Learning](https://mlsanity.com/paper/2109.06321/) (2021)
- [FRE: A Fast Method For Anomaly Detection And Segmentation](https://mlsanity.com/paper/2211.12650/) (2022)
- [Subspace Modeling for Fast Out-Of-Distribution and Anomaly Detection](https://mlsanity.com/paper/2203.10422/) (2022)
- [Semi-Supervised Learning for Anomaly Traffic Detection via Bidirectional Normalizing Flows](https://mlsanity.com/paper/2403.10550/) (2024)
- [Robust Contrastive Active Learning with Feature-guided Query Strategies](https://mlsanity.com/paper/2109.06873/) (2021)
- [Adversarial Detection without Model Information](https://mlsanity.com/paper/2202.04271/) (2022)
- [A Functional Data Perspective and Baseline On Multi-Layer Out-of-Distribution Detection](https://mlsanity.com/paper/2306.03522/) (2023)
- [Situation Monitor: Diversity-Driven Zero-Shot Out-of-Distribution Detection using Budding Ensemble Architecture for Object Detection](https://mlsanity.com/paper/2406.03188/) (2024)
- [Attention Fusion Reverse Distillation for Multi-Lighting Image Anomaly Detection](https://mlsanity.com/paper/2406.04573/) (2024)
- [FlowCLAS: Enhancing Normalizing Flow Via Contrastive Learning For Anomaly Segmentation](https://mlsanity.com/paper/2411.19888/) (2024)
- [CLIP-Flow: A Universal Discriminator for AI-Generated Images Inspired by Anomaly Detection](https://mlsanity.com/paper/2508.09477/) (2025)
- [Energy-Based Anomaly Detection and Localization](https://mlsanity.com/paper/2105.03270/) (2021)
- [Embracing Unknown Step by Step: Towards Reliable Sparse Training in Real World](https://mlsanity.com/paper/2403.20047/) (2024)
- [Adaptive Residual Transformation for Enhanced Feature-Based OOD Detection in SAR Imagery](https://mlsanity.com/paper/2411.00274/) (2024)
- [Uncertainty Quantification in Continual Open-World Learning](https://mlsanity.com/paper/2412.16409/) (2024)
- [Quantitative Benchmarking of Anomaly Detection Methods in Digital Pathology](https://mlsanity.com/paper/2506.19234/) (2025)
- [Interpreting deep learning output for out-of-distribution detection](https://mlsanity.com/paper/2211.03637/) (2022)
- [Using Skew to Assess the Quality of GAN-generated Image Features](https://mlsanity.com/paper/2310.20636/) (2023)
- [Multi-Class Anomaly Detection based on Regularized Discriminative Coupled hypersphere-based Feature Adaptation](https://mlsanity.com/paper/2311.14506/) (2023)
- [Towards Visual Syntactical Understanding](https://mlsanity.com/paper/2401.17497/) (2024)

## Abstract (arXiv)

We present a principled approach for detecting out-of-distribution (OOD) and adversarial samples in deep neural networks. Our approach consists in modeling the outputs of the various layers (deep features) with parametric probability distributions once training is completed. At inference, the likelihoods of the deep features w.r.t the previously learnt distributions are calculated and used to derive uncertainty estimates that can discriminate in-distribution samples from OOD samples. We explore the use of two classes of multivariate distributions for modeling the deep features - Gaussian and Gaussian mixture - and study the trade-off between accuracy and computational complexity. We demonstrate benefits of our approach on image features by detecting OOD images and adversarially-generated images, using popular DNN architectures on MNIST and CIFAR10 datasets. We show that more precise modeling of the feature distributions result in significantly improved detection of OOD and adversarial samples; up to 12 percentage points in AUPR and AUROC metrics. We further show that our approach remains extremely effective when applied to video data and associated spatio-temporal features by detecting adversarial samples on activity classification tasks using UCF101 dataset, and the C3D network. To our knowledge, our methodology is the first one reported for reliably detecting white-box adversarial framing, a state-of-the-art adversarial attack for video classifiers.
