Skip to content
Snippets Groups Projects
Commit b4d1b099 authored by Julien Girard-Satabin's avatar Julien Girard-Satabin
Browse files

[doc] Rephrased the local robustness property, removing ambiguity on the word expected

parent 1f7b47eb
No related branches found
No related tags found
No related merge requests found
...@@ -39,26 +39,32 @@ remaining :math:`784` columns represent the greyscale value of the respective ...@@ -39,26 +39,32 @@ remaining :math:`784` columns represent the greyscale value of the respective
pixels, rescaled into :math:`[0, 1]`. pixels, rescaled into :math:`[0, 1]`.
Properties Properties
---------- ==========
Generally speaking, the property we are interested in verifying is the local Generally speaking, the property we are interested in verifying is the local
robustness of a machine learning model on the elements of a set. That is, the robustness of a machine learning model on the elements of a set.
model classifies all elements of a set being at an :math:`l_\infty`-distance of More formally, let :math:`\mathcal{X}` be an input set,
at most :math:`\epsilon \geq 0` with a same label. A general formulation of this (in our case a subset of :math:`\mathbb{R}^{28\times 28}`),
latter states that, given a classifier :math:`C`, a set :math:`X`, and some :math:`\mathcal{Y} \subset \mathbb{R}` be an output set; and
perturbation :math:`\epsilon \geq 0`, it must hold that :math:`\forall x,x' :math:`C : \mathcal{X} \mapsto \mathcal{Y}` a classifier.
For a given :math:`\epsilon \in \mathbb{R}`,
a classifier is :math:`\epsilon`-locally-robust if it
classifies all elements of :math:`\mathcal{X}`
being at an :math:`l_\infty`-distance of
at most :math:`\epsilon \geq 0` with the same label.
A general formulation of this property is the following: :math:`\forall x,x'
\in X. \ \lVert x - x' \rVert_\infty \leq \epsilon \Rightarrow C(x) = C(x')`. \in X. \ \lVert x - x' \rVert_\infty \leq \epsilon \Rightarrow C(x) = C(x')`.
Since we actually deal with a *dataset* of finite elements for which we also Since we actually deal with a *dataset* of finite elements,
know the expected labels, we will instead verify a slightly different property: we will instead verify a slightly different property:
given a classifier :math:`C`, an element :math:`x \in X` such that :math:`C(x) = given a classifier :math:`C`, an element :math:`x \in X`,
y`, and some perturbation :math:`\epsilon \geq 0`, it must hold that and some perturbation :math:`\epsilon \geq 0`, it must hold that
:math:`\forall x'. \ \lVert x - x' \rVert_\infty \leq \epsilon \Rightarrow C(x) :math:`\forall x'. \ \lVert x - x' \rVert_\infty \leq \epsilon \Rightarrow C(x)
= y = C(x')`. Obviously, such a property must be verified for all elements of a = C(x')`. Obviously, such a property must be verified for all elements of a
dataset. dataset.
Modelling the problem using WhyML Modelling the problem using WhyML
--------------------------------- =================================
As described for the example on :ref:`acas_xu`, we first need to write a As described for the example on :ref:`acas_xu`, we first need to write a
specification file containing a WhyML theory to describe the verification specification file containing a WhyML theory to describe the verification
...@@ -133,7 +139,7 @@ The corresponding neural network in ONNX format is available under the ...@@ -133,7 +139,7 @@ The corresponding neural network in ONNX format is available under the
<https://git.frama-c.com/pub/caisar/-/blob/master/examples/mnist/nets/MNIST_256_2.onnx>`_. <https://git.frama-c.com/pub/caisar/-/blob/master/examples/mnist/nets/MNIST_256_2.onnx>`_.
Verifying the property with CAISAR Verifying the property with CAISAR
---------------------------------- ==================================
Now we may verify whether the previous robustness specification holds on the Now we may verify whether the previous robustness specification holds on the
MNIST fragment ``mnist_test.csv`` by means of the nnenum prover. This can be MNIST fragment ``mnist_test.csv`` by means of the nnenum prover. This can be
...@@ -149,6 +155,9 @@ for which nnenum is sure that the model ``MNIST_256_2.onnx`` is not robust with ...@@ -149,6 +155,9 @@ for which nnenum is sure that the model ``MNIST_256_2.onnx`` is not robust with
respect to :math:`1 \%` perturbation. At the moment, CAISAR is not able to tell respect to :math:`1 \%` perturbation. At the moment, CAISAR is not able to tell
which are the images in the dataset that cause such result. which are the images in the dataset that cause such result.
References
==========
.. [LiDeng2012] Li Deng, *The MNIST Database of Handwritten Digit Images for .. [LiDeng2012] Li Deng, *The MNIST Database of Handwritten Digit Images for
Machine Learning Research*, IEEE Signal Process. Mag., 2012, pp. Machine Learning Research*, IEEE Signal Process. Mag., 2012, pp.
141-142, doi: 10.1109/MSP.2012.2211477 141-142, doi: 10.1109/MSP.2012.2211477
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment