Neuron Activation Coverage: Rethinking Out-of-distribution Detection and Generalization (2306.02879v3)
Abstract: The out-of-distribution (OOD) problem generally arises when neural networks encounter data that significantly deviates from the training data distribution, i.e., in-distribution (InD). In this paper, we study the OOD problem from a neuron activation view. We first formulate neuron activation states by considering both the neuron output and its influence on model decisions. Then, to characterize the relationship between neurons and OOD issues, we introduce the \textit{neuron activation coverage} (NAC) -- a simple measure for neuron behaviors under InD data. Leveraging our NAC, we show that 1) InD and OOD inputs can be largely separated based on the neuron behavior, which significantly eases the OOD detection problem and beats the 21 previous methods over three benchmarks (CIFAR-10, CIFAR-100, and ImageNet-1K). 2) a positive correlation between NAC and model generalization ability consistently holds across architectures and datasets, which enables a NAC-based criterion for evaluating model robustness. Compared to prevalent InD validation criteria, we show that NAC not only can select more robust models, but also has a stronger correlation with OOD test performance.
- Line: Out-of-distribution detection by leveraging important neurons. In CVPR, pp. 19852–19862. IEEE, 2023.
- Introduction to Software Testing. Cambridge University Press, 2008.
- Towards better understanding of gradient-based attribution methods for deep neural networks. In ICLR, 2018.
- Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019.
- Ensemble of averages: Improving model selection and boosting performance in domain generalization. In NeurIPS, 2022.
- Unified out-of-distribution detection: A model-specific perspective. In ICCV. IEEE, 2023.
- On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation. PLOS ONE, 10:1–46, 07 2015.
- Feed two birds with one scone: Exploiting wild data for both out-of-distribution generalization and detection. In ICML, pp. 1454–1471. PMLR, 2023.
- Recognition in terra incognita. In ECCV, pp. 472–489. Springer, 2018.
- Towards open set deep networks. In CVPR, pp. 1563–1572. IEEE, 2016.
- In or out? fixing imagenet out-of-distribution detection evaluation. In ICML, pp. 2471–2506. PMLR, 2023.
- Generalizing from several related classification tasks to a new unlabeled sample. In NeurIPS, pp. 2178–2186, 2011.
- SWAD: domain generalization by seeking flat minima. In NeurIPS, pp. 22405–22418, 2021.
- A boundary based out-of-distribution classifier for generalized zero-shot learning. In ECCV, pp. 572–588. Springer, 2020.
- Describing textures in the wild. In CVPR, pp. 3606–3613. IEEE, 2014.
- Underspecification presents challenges for credibility in modern machine learning. arXiv preprint arXiv:2011.03395, 2020.
- Imagenet: A large-scale hierarchical image database. In CVPR, pp. 248–255. IEEE, 2009.
- Li Deng. The mnist database of handwritten digit images for machine learning research [best of the web]. IEEE Signal Processing Magazine, 29(6):141–142, 2012.
- Learning confidence for out-of-distribution detection in neural networks. arXiv preprint arXiv:1802.04865, 2018.
- Extremely simple activation shaping for out-of-distribution detection. In ICLR, 2023.
- Neural mean discrepancy for efficient out-of-distribution detection. In CVPR, pp. 19195–19205. IEEE, 2022.
- An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
- Maximum-entropy fine grained classification. In NeurIPS, pp. 635–645, 2018.
- Unbiased metric learning: On the utilization of multiple datasets and web images for softening bias. In ICCV, pp. 1657–1664. IEEE, 2013.
- Exploring the limits of out-of-distribution detection. In NeurIPS, pp. 7068–7081, 2021.
- Domain-adversarial training of neural networks. J. Mach. Learn. Res., 17:59:1–59:35, 2016.
- In search of lost domain generalization. In ICLR, 2021.
- On calibration of modern neural networks. In ICML, pp. 1321–1330. PMLR, 2017.
- Deep residual learning for image recognition. In CVPR, pp. 770–778. IEEE, 2016.
- A baseline for detecting misclassified and out-of-distribution examples in neural networks. In ICLR, 2017.
- Deep anomaly detection with outlier exposure. In ICLR, 2019a.
- Using self-supervised learning can improve model robustness and uncertainty. In NeurIPS, pp. 15637–15648, 2019b.
- Scaling out-of-distribution detection for real-world settings. In ICML, pp. 8759–8773. PMLR, 2022.
- The inaturalist species classification and detection dataset. In CVPR, pp. 8769–8778. IEEE, 2018.
- Generalized ODIN: detecting out-of-distribution image without learning from out-of-distribution data. In CVPR, pp. 10948–10957. IEEE, 2020.
- Feature space singularity for out-of-distribution detection. In SafeAI@AAAI, 2021a.
- MOS: Towards scaling out-of-distribution detection for large semantic space. In CVPR, pp. 8710–8719. IEEE, 2021.
- On the importance of gradients for detecting distributional shifts in the wild. In NeurIPS, pp. 677–689, 2021b.
- Revisiting flow generative models for out-of-distribution detection. In ICLR, 2022.
- Selfreg: Self-supervised contrastive regularization for domain generalization. In ICCV, pp. 9599–9608. IEEE, 2021.
- Why normalizing flows fail to detect out-of-distribution data. In NeurIPS, pp. 20578–20589, 2020.
- WILDS: A benchmark of in-the-wild distribution shifts. In ICML, pp. 5637–5664. PMLR, 2021.
- Opengan: Open-set recognition via open data generation. In ICCV, pp. 793–802. IEEE, 2021.
- Steven G. Krantz. Real Analysis and Foundations. Chapman Hall/CRC, 2005.
- Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
- Out-of-distribution generalization via risk extrapolation (rex). In ICML, pp. 5815–5826. PMLR, 2021.
- S. Kullback and R. A. Leibler. On Information and Sufficiency. The Annals of Mathematical Statistics, 22(1):79 – 86, 1951.
- Ya Le and Xuan S. Yang. Tiny imagenet visual recognition challenge. CS 231N, 7(7):3, 2015.
- Acceleration of DNN backward propagation by selective computation of gradients. In DAC, pp. 85. ACM, 2019.
- A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In NeurIPS, pp. 7167–7177, 2018.
- Deeper, broader and artier domain generalization. In ICCV, pp. 5543–5551. IEEE, 2017.
- Learning to generalize: Meta-learning for domain generalization. In AAAI, pp. 3490–3497. AAAI, 2018a.
- Domain generalization with adversarial feature learning. In CVPR, pp. 5400–5409. IEEE, 2018b.
- Enhancing the reliability of out-of-distribution image detection in neural networks. In ICLR, 2018.
- Energy-based out-of-distribution detection. In NeurIPS, pp. 21464–21475, 2020.
- GEN: pushing the limits of softmax-based out-of-distribution detection. In CVPR, pp. 23946–23955. IEEE, 2023.
- Deepgauge: multi-granularity testing criteria for deep learning systems. In ASE, pp. 120–131. ACM, 2018.
- Reading digits in natural images with unsupervised feature learning. In NeurIPS Workshop on Deep Learning and Unsupervised Feature Learning, 2011.
- Learning explanations that are hard to vary. In ICLR, 2021.
- Deepxplore: Automated whitebox testing of deep learning systems. In SOSP, pp. 1–18. ACM, 2017.
- Fishr: Invariant gradient variances for out-of-distribution generalization. In ICML, pp. 18347–18377. PMLR, 2022.
- Do imagenet classifiers generalize to imagenet? In ICML, pp. 5389–5400. PMLR, 2019.
- A simple fix to mahalanobis distance for improving near-ood detection. arXiv preprint arXiv:2106.09022, 2021.
- Overcoming concept shift in domain-aware settings through consolidated internal distributions. In AAAI, pp. 9623–9631. AAAI Press, 2023.
- Distributionally robust neural networks. In ICLR, 2020.
- Detecting out-of-distribution examples with gram matrices. In ICML, pp. 8491–8501. PMLR, 2020.
- Lloyd S. Shapley. A value for n-person games. Classics in game theory, 69, 1997.
- Gradient matching for domain generalization. In ICLR, 2022.
- Learning important features through propagating activation differences. In ICML, pp. 3145–3153. PMLR, 2017.
- Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
- Rankfeat: Rank-1 feature removal for out-of-distribution detection. In NeurIPS, 2022.
- Deep CORAL: correlation alignment for deep domain adaptation. In ECCV, pp. 443–450. Springer, 2016.
- DICE: leveraging sparsification for out-of-distribution detection. In ECCV, pp. 691–708. Springer, 2022.
- React: Out-of-distribution detection with rectified activations. In NeurIPS, pp. 144–157, 2021.
- Out-of-distribution detection with deep nearest neighbors. In ICML, pp. 20827–20840. PMLR, 2022.
- Axiomatic attribution for deep networks. In ICML, pp. 3319–3328. PMLR, 2017.
- Going deeper with convolutions. In CVPR, pp. 1–9. IEEE, 2015.
- Neuron coverage-guided domain generalization. IEEE Trans. Pattern Anal. Mach. Intell., 45(1):1302–1311, 2023.
- Exploring covariate and concept shift for out-of-distribution detection. In NeurIPS Workshops, 2021.
- Uncertainty estimation using a single deep deterministic neural network. In ICML, pp. 9690–9700. PMLR, 2020.
- Vladimir Vapnik. An overview of statistical learning theory. IEEE Trans. Neural Networks, 10(5):988–999, 1999.
- Deep hashing network for unsupervised domain adaptation. In CVPR, pp. 5385–5394. IEEE, 2017.
- Vim: Out-of-distribution with virtual-logit matching. In CVPR, pp. 4911–4920. IEEE, 2022.
- Deephunter: a coverage-guided fuzz testing framework for deep neural networks. In ISSTA, pp. 146–157. ACM, 2019.
- NPC: neuron path coverage via characterizing decision logic of deep neural networks. ACM Trans. Softw. Eng. Methodol., 31(3):47:1–47:27, 2022.
- Openood: Benchmarking generalized out-of-distribution detection. In NeurIPS Datasets and Benchmarks, 2022.
- Full-spectrum out-of-distribution detection. Int. J. Comput. Vis., 131(10):2607–2622, 2023.
- Pcl: Proxy-based contrastive learning for domain generalization. In CVPR, pp. 7097–7107. IEEE, 2022.
- Revisiting neuron coverage for dnn testing: A layer-wise and distribution-aware criterion. In ICSE. ACM, 2023.
- Openood v1.5: Enhanced benchmark for out-of-distribution detection. arXiv preprint arXiv:2306.09301, 2023a.
- Out-of-distribution detection based on in-distribution data patterns memorization with modern hopfield energy. In ICLR, 2023b.
- NICO++: towards better benchmarking for domain generalization. In CVPR, pp. 16036–16047. IEEE, 2023c.
- Places: A 10 million image database for scene recognition. IEEE Trans. Pattern Anal. Mach. Intell., 40(6):1452–1464, 2018.
- Sparse invariant risk minimization. In ICML, pp. 27222–27244. PMLR, 2022.
- Ev Zisselman and Aviv Tamar. Deep residual flow for out of distribution detection. In CVPR, pp. 13991–14000. IEEE, 2020.