Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
caisar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
caisar
Commits
b4d1b099
Commit
b4d1b099
authored
1 year ago
by
Julien Girard-Satabin
Browse files
Options
Downloads
Patches
Plain Diff
[doc] Rephrased the local robustness property, removing ambiguity on the word expected
parent
1f7b47eb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/mnist.rst
+22
-13
22 additions, 13 deletions
doc/mnist.rst
with
22 additions
and
13 deletions
doc/mnist.rst
+
22
−
13
View file @
b4d1b099
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment