Topology of Out-of-Distribution Examples in Deep Neural Networks
Esha Datta [email protected] · 2025
Read Topology of Out-of-Distribution Examples in Deep Neural Networks by Esha Datta [email protected] (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2501-12522.txt.
Introduction
Esha Datta and four co-authors use topology to detect out-of-distribution inputs in deep neural networks, in a two thousand twenty-five paper. Deployed networks are notoriously overconfident and wrong when they meet unfamiliar examples.
The team examines latent layer embeddings and looks for topological landmarks that flag strange inputs. Well-trained networks simplify the topology of their training data, and the authors show that property holds for realistic large-scale data too. It fails for out-of-distribution examples, whose average persistence is statistically longer. The finding gives fresh evidence of topological simplification in real networks and a foundation for topology-informed detection methods.
Catalog record
| CREATOR | Esha Datta [email protected] |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 40 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2501-12522
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Topology of Out-of-Distribution Examples in Deep Neural Networks Esha Datta [email protected] Abstract As deep neural networks (DNNs) become increasingly common, concerns about their robustness do as well. A longstanding problem for deployed DNNs is their behavior in the face of unfamiliar inputs; specifically, these models tend to be overconfident and incorrect when encountering out-of-distribution (OOD) examples. In this work, we present a topological approach to characterizing OOD examples using latent layer embeddings from DNNs. Our goal is to identify topological features, referred to as landmarks, that indicate OOD examples. We conduct extensive experiments on benchmark datasets and a realistic DNN model, revealing a key insight for OOD detection. Well-trained DNNs have been shown to induce a topological simplification on training data for simple models and datasets; we show that this property holds for realistic, large-scale test and training data, but does not hold for OOD examples. More specifically, we find that the average lifetime (or persistence) of OOD examples is statistically longer than that of training or test examples. This indicates that DNNs struggle to induce topological simplification on unfamiliar inputs. Our empirical results provide novel evidence of topological simplification in realistic DNNs and lay the groundwork for topologically-informed OOD detection strategies. 1 Introduction In the past decade, deep neural networks (DNNs) have become ubiquitous. Deep learning techniques play a crucial role in safety-critical tasks like malware detection ( Abdelsalam et al., 2018 ) , medical image analysis ( Shen et al., 2017 ) , and autonomous driving ( Singh, 2023 ) . DNNs are generally trained under a closed-world assumption ( Krizhevsky et al., 2012 ; He et al., 2015 ) ; that is, it is assumed the model will only encounter data drawn from the same distribution as its training data. This assumption rarely holds for deployed models. An autonomous vehicle might encounter an unforeseen hazard in the road. A malware detector might encounter a novel virus. When confronted with these unfamiliar inputs, known in the literature as out-of-distribution (OOD) examples, DNNs tend to be highly confident and incorrect ( Goodfellow et al., 2014 ; Amodei et al., 2016 ) . Consequently, the detection of OOD examples has become an active area of research in machine learning ( Hendrycks and Gimpel, 2016 ; Liang et al., 2017 ; Liu et al., 2020 ) . Topological data analysis (TDA) is a growing field that leverages tools from algebraic topology to examine shape features in high-dimensional data ( Rabadán and Blumberg, 2019 ) . Its theoretic foundations enable TDA to excel in settings where standard analytic tools may falter. Topological techniques are robust to local variation, can operate at multiple scales simultaneously, and has guaranteed stability bounds in the presence of noise ( Skaf and Laubenbacher, 2022 ) . TDA has found success in a variety of fields, including bioinformatics ( Rabadán and Blumberg, 2019 ) , dynamical systems ( Topaz et al., 2015 ) , and more recently, machine learning ( Zhang et al., 2024 ; Hensel et al., 2021 ) . 1.1 Our contributions This work contributes to the growing body of topological studies on DNN structure. We extend the persistent homology approach described by Naitzat et al. (2020) to investigate the effect of OOD examples on deep learning models. Our empirical study identifies the topological landmarks (or indications) of these examples within the latent-layer space of ResNet18 models, providing new insights to the robustness and vulnerability of DNNs in the face of unfamiliar inputs. While our methods could be viewed as an extension of Naitzat et al. (2020) , there are key departures from the original approach that enable our approach: 1. In a novel application, we leverage the topological properties of latent layer embeddings to characterize OOD examples. We validate our results across multiple benchmark datasets; 2. We demonstrate that the empirical result of Naitzat et al. (2020) extends to test datasets, multi-class classification problems, and more realistic datasets and architectures; and 3. We demonstrate the computational feasibility of a TDA pipeline for analyzing realistic DNNs at scale. The rest of the paper is structured as follows. Section 2 discusses recent studies at the intersection of TDA and machine learning. Section 3 discusses, in more detail, the intuition of our approach and our central hypotheses. In Section 4 , we provide a brief overview of relevant topics in TDA, including details on the efficient computation of persistent homology. Section 5 describes our datasets, model architectures, and experimental methodology. Section 6 presents selected results, with a more exhaustive treatment in Appendix A . Finally, we discuss the impact of our findings and potential avenues for future work in Section 7 . 2 Existing Works and Opportunities for Novel Insight This section highlights studies at the intersection of TDA and ML that have informed our investigation. Readers seeking a comprehensive overview of the literature are directed to Ballester et al. (2023) and Zia et al. (2024) . The flexibility of algebraic topology makes it well-suited for problems in ML. Algebraic topology translates the challenge of comparing shapes into a simpler one: comparing numbers. By characterizing complex structures numerically, topology enables the differentiation of high-dimensional spaces. The notion of shape equivalence (via homological invariance) gives topological approaches robustness to noise as well ( Skaf and Laubenbacher, 2022 ) . These characteristics have made computational topology successful in settings where traditional approaches struggle ( Skaf and Laubenbacher, 2022 ) . Our study employs persistent homology (PH), which is perhaps the most well-known of the TDA methods. PH can analyze data across multiple scales simultaneously and identify meaningful global signals without obfuscating local structure ( Skaf and Laubenbacher, 2022 ; Lum et al., 2013 ) Moreover, a well-developed theory of stability quantifies the extent to which PH is affected by noise ( Cohen-Steiner et al., 2005 ) . Perhaps most importantly, PH has been used to study DNNs because the topological invariants associated with neural networks appear to encode relevant quantities including validation loss ( Rieck et al., 2018 ) , shallow-to-deep layer connections ( Zheng et al., 2021 ) , and (we find), the relationship of inference data with respect to the training data. We discuss the existing approaches to PH for DNN analysis below. A brief technical background on PH computation is presented in Section 4 . Several authors study DNNs by interpreting the model architecture as a graph and applying TDA to this construction. In an early work, Rieck et al. (2018) interpret a multi-layer perceptron (MLP) model as a multipartite graph with nodes corresponding to neurons and edges a function of training weights. The study then introduces the notion of neural persistence, which characterizes the complexity of an MLP. Another approach that melds topology and graph theory, introduced by Gebhart and Schrater (2017) , uses the activation graph. This is a weighted, undirected multipartite graph that can be studied as a one-dimensional simplicial complex independent of the input data. Recently, Lacombe et al. (2021) show how the topology of an activation graph can be used for OOD detection and uncertainty quantification. These approaches rely on modeling DNNs as sequences of bipartite graphs which, by construction, cannot capture interactions between non-adjacent layers. Therefore, the typical graphical approach cannot