Understanding Anomaly Detection with Deep Invertible Networks through Hierarchies of Distributions and Features
Robin Schirrmeister, Yuxuan Zhou, Tonio Ball, Dan Zhang
Abstract
Deep generative networks trained via maximum likelihood on a natural image dataset like CIFAR10 often assign high likelihoods to images from datasets with different objects (e.g., SVHN). We refine previous investigations of this failure at anomaly detection for invertible generative networks and provide a clear explanation of it as a combination of model bias and domain prior: Convolutional networks learn similar low-level feature distributions when trained on any natural image dataset and these low-level features dominate the likelihood. Hence, when the discriminative features between inliers and outliers are on a high-level, e.g., object shapes, anomaly detection becomes particularly challenging. To remove the negative impact of model bias and domain prior on detecting high-level differences, we propose two methods, first, using the log likelihood ratios of two identical models, one trained on the in-distribution data (e.g., CIFAR10) and the other one on a more general distribution of images (e.g., 80 Million Tiny Images). We also derive a novel outlier loss for the in-distribution network on samples from the more general distribution to further improve the performance. Secondly, using a multi-scale model like Glow, we show that lowlevel features are mainly captured at early scales. Therefore, using only the likelihood contribution of the final scale performs remarkably well for detecting high-level feature differences of the out-of-distribution and the in-distribution. This method is especially useful if one does not have access to a suitable general distribution. Overall, our methods achieve strong anomaly detection performance in the unsupervised setting, and only slightly underperform state-of-the-art classifier-based methods in the supervised setting. Code can be found at https: //github.com/boschresearch/hierarchical_anomaly_detection .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 8f5102ff-4777-4a38-88c7-9ecc41d32900Cited by top-tier papers19
- ReAct: Out-of-distribution Detection With Rectified ActivationsYiyou Sun, Chuan Guo, Yixuan LiNeurIPS 2021 · 733 citations
- On the Importance of Gradients for Detecting Distributional Shifts in the WildRui Huang, Andrew Geng, Yixuan LiNeurIPS 2021 · 515 citations
- Understanding Failures in Out-of-Distribution Detection with Deep Generative ModelsLily H. Zhang, Mark Goldstein, Rajesh RanganathICML 2021 · 129 citations
- Hierarchical VAEs Know What They Don't KnowJakob Drachmann Havtorn, Jes Frellsen, Søren Hauberg, Lars MaaløeICML 2021 · 87 citations
- RankFeat: Rank-1 Feature Removal for Out-of-distribution DetectionYue Song, Nicu Sebe, Wei WangNeurIPS 2022 · 76 citations
Builds on7
- Deep Semi-Supervised Anomaly DetectionLukas Ruff, Robert A. Vandermeulen, Nico Görnitz, Alexander Binder et al.ICLR 2020 · 678 citations
- Your classifier is secretly an energy based model and you should treat it like oneWill Grathwohl, Kuan-Chieh Wang, Jörn-Henrik Jacobsen, David Duvenaud et al.ICLR 2020 · 643 citations
- Classification-Based Anomaly Detection for General DataLiron Bergman, Yedid HoshenICLR 2020 · 412 citations
- Why Normalizing Flows Fail to Detect Out-of-Distribution DataPolina Kirichenko, Pavel Izmailov, Andrew Gordon WilsonNeurIPS 2020 · 370 citations
- Input Complexity and Out-of-distribution Detection with Likelihood-based Generative ModelsJoan Serrà, David Álvarez, Vicenç Gómez, Olga Slizovskaia et al.ICLR 2020 · 307 citations
Related papers
- Towards In-Distribution Compatible Out-of-Distribution DetectionBoxi Wu, Jie Jiang, Haidong Ren, Zifan Du et al.AAAI 2023 · 2 citations
- Further Analysis of Outlier Detection with Deep Generative ModelsZiyu Wang, Bin Dai, David P. Wipf, Jun ZhuNeurIPS 2020 · 45 citations
- Multiscale Score Matching for Out-of-Distribution DetectionAhsan Mahmood, Junier Oliva, Martin Andreas StynerICLR 2021 · 41 citations
- A Geometric Explanation of the Likelihood OOD Detection ParadoxHamidreza Kamkari, Brendan Leigh Ross, Jesse C. Cresswell, Anthony L. Caterini et al.ICML 2024 · 20 citations
- Invariant Anomaly Detection under Distribution Shifts: A Causal PerspectiveJoão B. S. Carvalho, Mengtao Zhang, Robin Geyer, Carlos Cotrini et al.NeurIPS 2023 · 18 citations
