Hostname: page-component-74656f9884-8rzl6 Total loading time: 0 Render date: 2026-11-06T10:47:02.481Z Has data issue: false hasContentIssue false

A domain-theoretic framework for robustness analysis of neural networks

Published online by Cambridge University Press:  23 May 2023

Can Zhou
Affiliation:
Department of Computer Science, University of Oxford, Oxford, UK
Razin A. Shaikh
Affiliation:
Department of Computer Science, University of Oxford, Oxford, UK Quantinuum Ltd., Oxford, UK
Yiran Li
Affiliation:
School of Computer Science, University of Nottingham Ningbo China, Ningbo, China
Amin Farjudian*
Affiliation:
School of Computer Science, University of Nottingham Ningbo China, Ningbo, China
*
*Corresponding author. Email: Amin.Farjudian@gmail.com
Rights & Permissions [Opens in a new window]

Abstract

A domain-theoretic framework is presented for validated robustness analysis of neural networks. First, global robustness of a general class of networks is analyzed. Then, using the fact that Edalat’s domain-theoretic L-derivative coincides with Clarke’s generalized gradient, the framework is extended for attack-agnostic local robustness analysis. The proposed framework is ideal for designing algorithms which are correct by construction. This claim is exemplified by developing a validated algorithm for estimation of Lipschitz constant of feedforward regressors. The completeness of the algorithm is proved over differentiable networks and also over general position ${\mathrm{ReLU}}$ networks. Computability results are obtained within the framework of effectively given domains. Using the proposed domain model, differentiable and non-differentiable networks can be analyzed uniformly. The validated algorithm is implemented using arbitrary-precision interval arithmetic, and the results of some experiments are presented. The software implementation is truly validated, as it handles floating-point errors as well.

Information

Type
Paper
Copyright
© The Author(s), 2023. Published by Cambridge University Press
Figure 0

Figure 1. Left: The function ${\mathrm{ReLU}}: (-2,2) \to {\mathbb{R}}$ (solid black) and the line $y_\lambda$ (in ) from (14) for some $\lambda \in [0,1]$, which lies entirely in the shaded cone. Right: The step function $b \chi_O: (-2,2) \to {\mathbb{I}}{\mathbb{R}}_\bot$ in which $b = [0,1]$ and $O = (-1,1)$. We have ${\mathrm{ReLU}} \in \delta(O,b)$.

Figure 1

Figure 2. The dynamics of the first three bisections of Algorithm 1 for a two-dimensional scenario. The starting search region X is shown in blue color for reference.

Figure 2

Figure 3. Dependency problem: The network computes the constant function zero. Hence, we must have $N'(x)=0$ for all x. But the Clarke-gradient at $x=0$ is overestimated as $[{-}1,1]$.

Figure 3

Table 1. Experiment 1: Random, ${\mathrm{ReLU}}$, Layer sizes = [2, 2, 2]. Our method is called lipDT, which is the only case where both the method and the implementations are validated

Figure 4

Figure 4. Weights, biases, and the input domain of the network of Experiment 1.

Figure 5

Table 2. The results of lipDT on Experiment 1 for the first 5 bisections

Figure 6

Figure 5. For very small input domains, lipDT is the only method which returns the correct result.

Figure 7

Table 3. Experiment 2: MNIST, ${\mathrm{ReLU}}$, Layer sizes = [784, 10, 10, 2]

Figure 8

Figure 6. lipDT scales (almost) linearly with respect to the number of layers.

Figure 9

Figure 7. lipDT scales almost linearly with respect to the width of the network.

Figure 10

Figure 8. Lipschitz constant versus capacity. Left: All the capacities up to 3000. Right: Capacities up to 200. The under-parametrized regime extends to capacity 42, where interpolation starts, and after which, the curve remains almost flat. Maximum Lipschitz constant is attained at capacity 21.

Figure 11

Figure 9. The dashed black curve is a piecewise linear interpolation of the data points. The blue curves show the output of the neural networks. Interpolation starts at capacity 42. The highest Lipschitz constant is attained at capacity 21. Also, see, Belkin (2021, Figure 3.6).

Figure 12

Figure 10. Dynamics of the Lipschitz constant through successive epochs. The network with three neurons reaches its best loss much earlier than 100, 000 epochs, so we stop the training at 20, 000 epochs.

Figure 13

Figure 11. Left: Clever returns an outlier at epoch 251. Right: Comparison with lipDT (for the first 350 epochs) reveals that the Lipschitz constant does not have a jump.