Manuscript Offprint

arXiv:2611.24557

The geometry of neural network decision boundaries

Dylan M Paiton, David L Schultheiss, Matthias Kümmerer, Zac Cranko, Matthias Bethge

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Artificial neural networks (ANNs) are built using well-understood mathematical operations, yet their complex nature poses significant challenges to intuitively understanding their decision-making processes. This work introduces a method for visualizing and measuring ANN decision boundary geometry directly in the high-dimensional input space, avoiding distortions found with traditional projection-based techniques. We analyze boundary curvatures and distances in diverse inputs, architectures, and training methods. Boundary distances grow smoothly and slowly with consistent curvature as the size of the subspace increases, suggesting that decision boundaries are close to input samples within large, continuous subspaces. We also quantify how much boundary distances and curvatures reduce near dataset samples after adversarial training. Training methodology has a significantly stronger impact on boundary distance and curvature than architecture or test-set accuracy. These findings are contextualized within prior work, supporting or refuting several previously proposed theories of boundary behavior. Our analytically and empirically supported methodology lays the foundation for future studies to improve network interpretability and understanding.

1 Introduction

An artificial neural network (ANN) used for classification can be described entirely in terms of its category decision boundaries in the input space. Understanding these boundaries is crucial for enhancing robustness and interpretability, particularly for applications in high-stakes domains. However, measuring or visualizing those boundaries is challenging due to the high-dimensional and non-linear relationship between the network's inputs and outputs. A common approach to understanding these boundaries is to visualize them by projecting the decision surface onto a two-dimensional plane [Yu et al., 2018, Rodrigues et al., 2019]. Although informative, this suffers from limitations: high-dimensional points can map to the same projected location, the distances between points are distorted, and the projections lack invertibility back to the original high-dimensional decision space [Féraud and Clérot, 2002, Rauber et al., 2016]. An alternative strategy investigates the decision boundary directly in the high-dimensional input space. Early work in this direction [Golland, 2001, Baehrens

*Equal contribution. Code: github.com/bethgelab/adversarial_subspaces

Figure

Figure 1: The decision boundary for an adversarially trained ResNet-50. (Left) A subspace centered on a dataset image (class 5 exemplar, bottom middle) is defined, with each orthogonal axis corresponding to a direction where the decision boundary is closest. Principal curvature is measured at random points within the subspace. (Right) A 2-dimensional subspace is visualized using two adversarial directions, accurately showing the boundary shape and distances to alternate class labels. Perturbation images outside the graph are rescaled for visualization, with their ℓ2\ell_2 length indicated on the axes. Each color represents a class (e.g., deer: class 4, dogs: class 5, horses: class 7). White arrows indicate sampling directions within the subspace to locate the boundary.

et al., 2010] laid the foundation for the modern focus on adversarial attacks [Biggio et al., 2013, Szegedy et al., 2014]. Examples produced by adversarial attacks are a worst-case demonstration of a classifier's inability to gracefully cope with identity-preserving shifts or distortions of its input [Gilmer et al., 2019]. To construct one, an adversary perturbs the ANN input in a small but specific way such that the output changes significantly. The perturbation is optimized to be as close as possible to the ANN's decision boundary.

Adversarial examples provide context for the ultimate goal of improving interpretability and our understanding of classifier behavior by measuring and visualizing the output space near unaltered dataset samples. Previous work has explored ANN responses in the proximity of adversarial examples [Warde-Farley and Goodfellow, 2016, Tabacof and Valle, 2016, He et al., 2018, Tramèr et al., 2017, Swirszcz et al., 2019, Karimi and Derr, 2022], or within hand-picked two-dimensional input domains [Humayun et al., 2023]. However, these methods analyze one or two boundary dimensions at a time, leaving key questions unanswered about the high-dimensional structure of the boundary. For example: How many orthogonal directions from an input sample maintain close proximity to the decision boundary? How does the boundary behave between these directions? Does the boundary distance increase smoothly or does it fluctuate with increased search space dimensionality? What is the high-dimensional distribution of class label regions around dataset inputs?

In this work, we introduce a novel approach that quantitatively analyzes the geometry of ANN decision boundaries in high-dimensional subspaces centered on dataset samples. Our method provides the first evidence that decision boundaries are close to natural inputs within large subspaces across architectures and datasets, supporting the hypothesis that adversarial examples occupy dense regions of input space [Goodfellow et al., 2014, Tabacof and Valle, 2016, Moosavi-Dezfooli et al., 2017a, He et al., 2018]. Specifically, we propose an untargeted adversarial attack framework coupled with a principled method to measure high-dimensional boundary curvature. Our approach corrects inaccuracies in prior boundary curvature estimates and enables more precise 2D visualizations.

Our findings reveal a large subspace around input samples where the decision boundary remains only marginally farther away than at its closest point. Moreover, we show that

Figure

Figure 2: Boundary distances. The distance from a test set image to the decision boundary grows sub-linearly with increasing subspace dimensionality and remains consistent across model architectures. (Left, top) Box plots show decision boundary distances for uniformly sampled directions within n-dimensional subspaces (horizontal axis), with dots indicating distances along the subspace axes, averaged across images. Boxes show interquartile ranges, whiskers represent the 10% and 90% percentiles, and dashed lines show random sample means. Every other dimension up to 50 is shown. (Left, bottom) Similar to the top panel, but the vertical axis shows the largest boundary distance within the subspace divided by the largest boundary distance along the subspace axes. Low values indicate that the boundary remains close to the input sample between the axes. (Right) Histograms of boundary distances for randomly sampled directions within subspaces, with dimensionality increasing across subplots (odd-numbered dimensions are shown). The mean shifts rightward and variance increases proportionately with dimensionality, suggesting a smooth growth in distance with increasing dimensionality. Line colors represent training schemes as per the legend.

boundary distances increase smoothly as the dimensionality of the subspace grows. We further demonstrate that adversarial training, widely considered the state-of-the-art defense against adversarial attacks [Gowal et al., 2020, Bai et al., 2021], not only increases boundary distance but also reduces boundary curvature, supporting prior hypotheses [Moosavi-Dezfooli et al., 2018]. Additionally, we provide new evidence that adversarial training affects class label composition near natural inputs, indicating reduced semantic information in label proximity.

In summary, we contribute the first quantitative analysis of the geometry of nonlinear ANN decision boundaries in high-dimensional subspaces centered on dataset samples, a novel curvature measurement method that corrects errors in prior approaches, and new insights into adversarial training's impact on boundary smoothness and label distributions. Our experiments confirm consistent trends across datasets, architectures, and generalization performance, offering a principled foundation for understanding decision boundaries and improving interpretability in deep learning.

References (100)

  • Interpreting adversarial robustness: A view from decision surface in input space (opens arXiv in a new tab)
  • Constructing and visualizing high-quality classifier decision boundary maps
  • A methodology to explain neural network classification
  • Visualizing the hidden activity of artificial neural networks
  • How to explain individual classification decisions
  • Evasion attacks against machine learning at test time
  • Intriguing properties of neural networks
  • Adversarial examples are a natural consequence of test error in noise
  • Adversarial perturbations of deep neural networks
  • Exploring the space of adversarial images
  • Decision boundary analysis of adversarial examples
  • The space of transferable adversarial examples (opens arXiv in a new tab)
  • Visualizations of decision regions in the presence of adversarial examples
  • Decision boundaries of deep neural networks
  • Splinecam: Exact visualization and characterization of deep network geometry and decision boundaries
  • Explaining and Harnessing Adversarial Examples
  • Universal adversarial perturbations
  • Uncovering the limits of adversarial training against norm-bounded adversarial examples (opens arXiv in a new tab)
  • Recent advances in adversarial training for adversarial robustness (opens the publisher in a new tab)
  • Robustness of classifiers to universal perturbations: A geometric perspective
  • Deep residual learning for image recognition
  • Learning multiple layers of features from tiny images
  • On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming
  • Towards evaluating the robustness of neural networks
  • The logbarrier adversarial attack: making effective use of decision boundary information
  • Ead: elastic-net attacks to deep neural networks via adversarial examples
  • Mervin E. Muller. A note on a method for generating points uniformly on n-dimensional spheres. Commun. ACM, 2(4):19–20, April 1959. ISSN 0001-0782. doi: 10.1145/377939.377946. URL https://doi.org/10.1145/377939.377946. (opens the publisher in a new tab)
  • Towards deep learning models resistant to adversarial attacks
  • Mma training: Direct input space margin maximization through adversarial training
  • Robustness of classifiers: from adversarial to random noise
  • Delving into transferable adversarial examples and black-box attacks
  • Characterizing adversarial subspaces using local intrinsic dimensionality
  • Benchmarking neural network robustness to common corruptions and perturbations (opens arXiv in a new tab)
  • A new defense against adversarial images: Turning a weakness into a strength
  • The vulnerability of learning to adversarial perturbation increases with intrinsic dimensionality
  • First-order adversarial vulnerability of neural networks and input dimension
  • The data-driven transferable adversarial space
  • Linear modeling of the adversarial noise space
  • Understanding the decision boundary of deep neural networks: An empirical study (opens arXiv in a new tab)
  • The iso-response method: measuring neuronal stimulus integration with closed-loop experiments
  • Nonlinear mechanisms and higher-order statistics in biological vision and electronic image processing: review and perspectives
  • Spatiotemporal elements of macaque v1 receptive fields
  • Conjectures regarding the nonlinear geometry of visual neurons
  • Separability and geometry of object manifolds in deep neural networks
  • Selective and invariant features of neural response surfaces measured with principal curvature (opens the publisher in a new tab)
  • Selectivity and robustness of sparse coding networks
  • Exponential expressivity in deep neural networks through transient chaos
  • Robustness via curvature regularization, and vice versa
  • Understanding deep learning via decision boundary
  • Manifold-based approach for neural network robustness analysis (opens the publisher in a new tab)
  • Preventing gradient attenuation in lipschitz constrained convolutional networks
  • Enforcing linearity in dnn succours robustness and adversarial image generation
  • Theoretically principled trade-off between robustness and accuracy
  • Adversarial weight perturbation helps robust generalization
  • Semi-supervised learning with interactive label propagation guided by feature space projections
  • Projections as visual aids for classification system design
  • Detecting adversarial examples from sensitivity inconsistency of spatial-transform domain
  • why should i trust you?
  • Explaining predictions by approximating the local decision boundary (opens arXiv in a new tab)
  • Towards A Rigorous Science of Interpretable Machine Learning
  • Towards falsifiable interpretability research (opens arXiv in a new tab)
  • Certified adversarial robustness with additive noise
  • Simulating a primary visual cortex at the front of cnns improves robustness to image perturbations
  • A boundary tilting perspective on the phenomenon of adversarial examples (opens arXiv in a new tab)
  • Adversarial examples are not bugs, they are features
  • Magnus and Heinz Neudecker
  • Robustness (python library), 2019
  • Fast and accurate deep network learning by exponential linear units (elus) (opens arXiv in a new tab)
  • Gradient-based learning applied to document recognition
  • Image surface predicates and the neural encoding of two-dimensional signal variations (opens the publisher in a new tab)
  • Analysis of universal adversarial perturbations
  • Orthogonality and clipping 26 G Comparisons to related work: Decision boundary curvature 28
  • Most often we will refer to $\mathfrak{X}(M) \overset{\mathrm{def}}{=} \Gamma(\mathrm{TM})$, and represent elements of $\mathfrak{X}(M)$ with the letters $X,Y,Z$
  • M \to N$ is differentiable, then the differential of $F$ at $p \in M$ is the linear mapping denoted $\mathrm{d}F_p: \mathrm{T}_p M \to \mathrm{T}_p N$, where the action on tangent vectors is defined by
  • As is common practice, we often omit the $p$ subscripts for clarity
  • This defines a connection in each tensor bundle,$^4$ which we overload with $\nabla$ [Lee, 2018, Prop
  • 4.22] with $\nabla^2 f(X,Y) \stackrel{\mathrm{def}}{=} \nabla_X \mathrm{d}f(Y)$ for $X,Y \in \mathfrak{X}(M)$
  • If the inclusion is a smooth isometry, that is
  • If $M$, $\tilde{M}$ are of dimensions $m<n$, then $\mathrm{T}_p M$ occupies an $m$ dimensional subspace of $\mathrm{T}_p M$ for each $p\in M$
  • For example, subspace principal curvature
  • Suppose $F: U \subseteq \tilde{M} \to \mathbb{R}$ is a local defining function for $M$, that is, $M \cap U = F^{-1}(\{0\})$ for an open $U \subseteq M$
  • The Weingarten equation [Lee, 2018, Thm
  • Let $M$ be the graph of a smooth function $f: \mathbb{R}^n \to \mathbb{R}$, that is, $M = \{(x, f(x)) \mid x \in \mathbb{R}^n\}$
  • Denote by $\nabla f$ the vector of partial derivatives of $f$, and by $\mathrm{H}_f$ and $\mathrm{H}_F$, the matrices of second order partial derivatives of $F$ and $f$, all with respect to usual coordinate frames, $(x^i)$, on $\mathbb{R}^n$ and $\mathbb{R}^{n+1}$
  • 1.32, §5] to calculate the Gaussian and mean curvature at a point $(x_0, y_0) \in (\mathbb{R}^{n-1} \times \mathbb{R}) \cap M$
  • C.40] there are open connected neighborhoods $U_0 \times V_0 \subseteq \mathbb{R}^{n-1} \times \mathbb{R}$ with $(x_0, y_0) \in U_0 \times V_0$ and a smooth function $g: U_0 \to V_0$ so that $(U_0 \times V_0) \cap M$ is the graph of $g$
  • Then for $i, j \in [n-1]$ and $x \in U_0$
  • This definition of $\left(P^{\mathsf{T}}\right)^{*}s$ essentially restricts the shape operator to a linear subspace of the tangential space and is motivated by the principles of differential geometry
  • For each architecture, one model was trained on the unmodified CIFAR-10 dataset [Krizhevsky and Hinton, 2009]
  • The optimization algorithm stopped after finding 50 orthogonal adversarial vectors for all 100 test images
  • The accuracy of both models at different perturbation lengths ε and dimensions is shown in Table 2
  • We can see that the perturbation length is increasing with dimension number
  • perceptual distance
  • Figure 7 shows how many of the samples pointed to decision boundaries that were outside of the allowed input pixel bounds
  • For the naturally trained model there is also a much larger increase of adversarial dimension with increasing distance to distance to decision boundary
  • Each subplot shows a subspace of increasing dimensionality, ascending left-to-right, then top-to-bottom
  • a ResNet-50 [He et al., 2016] and a WideResNet-70-16, of which the latter is the state-of-the-art adversarially trained network for CIFAR-10 images [Gowal et al., 2020]
  • (left) The subfigure shows the distribution of the n-th found adversarial perturbations across images
  • These figures indicate that there is little difference between the two model architectures regarding distance to the decision boundary and perturbation length over dimensions
  • The observation that this finding is agnostic to model architecture is further supported by the similarity in distributions of samples measuring the distance to decision boundary that can be seen on the right hand side of the same figures

Couldn't load all references. Reload the page to try again.