Skip to content

Commit d1966db

Browse files
Irina NicolaeIrina Nicolae
authored andcommitted
Update README and docs with new methods
1 parent 2fc7223 commit d1966db

File tree

8 files changed

+63
-17
lines changed

8 files changed

+63
-17
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ The following **defence** methods are also supported:
2626
* Virtual adversarial training ([Miyato et al., 2015](https://arxiv.org/abs/1507.00677))
2727
* Gaussian data augmentation ([Zantedeschi et al., 2017](https://arxiv.org/abs/1707.06728))
2828
* Thermometer encoding ([Buckman et al., 2018](https://openreview.net/forum?id=S18Su--CW))
29+
* Total variance minimization ([Guo et al., 2018](https://openreview.net/forum?id=SyJ7ClWCb))
30+
* JPEG compression ([Dziugaite et al., 2016](https://arxiv.org/abs/1608.00853))
2931

3032
ART also implements **detection** methods of adversarial samples:
3133
* Basic detector based on inputs
3234
* Detector trained on the activations of a specific layer
3335

3436
The following **detector of poisoning attacks** is also supported:
35-
* Detector based on activations analysis
37+
* Detector based on activations analysis ([Chen et al., 2018](https://arxiv.org/abs/1811.03728))
3638

3739
## Setup
3840

art/defences/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
from art.defences.adversarial_trainer import AdversarialTrainer, StaticAdversarialTrainer
55
from art.defences.feature_squeezing import FeatureSqueezing
66
from art.defences.gaussian_augmentation import GaussianAugmentation
7+
from art.defences.jpeg_compression import JpegCompression
78
from art.defences.label_smoothing import LabelSmoothing
8-
from art.defences.spatial_smoothing import SpatialSmoothing
99
from art.defences.reverse_sigmoid import ReverseSigmoid
10+
from art.defences.spatial_smoothing import SpatialSmoothing
11+
from art.defences.thermometer_encoding import ThermometerEncoding
12+
from art.defences.variance_minimization import TotalVarMin

art/defences/jpeg_compression.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
class JpegCompression(Preprocessor):
1616
"""
17-
Implement the jpeg compression defence approach.
17+
Implement the jpeg compression defence approach. Some related papers: https://arxiv.org/pdf/1705.02900.pdf,
18+
https://arxiv.org/abs/1608.00853
1819
"""
1920
params = ['quality', 'channel_index']
2021

art/defences/variance_minimization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
class TotalVarMin(Preprocessor):
1515
"""
16-
Implement the total variance minimization defence approach. Defence method from
17-
https://openreview.net/forum?id=SyJ7ClWCb.
16+
Implement the total variance minimization defence approach. Defence method from [Guo et al., 2018].
17+
Paper link: https://openreview.net/forum?id=SyJ7ClWCb
1818
"""
1919
params = ['prob', 'norm', 'lam', 'solver', 'maxiter']
2020

art/poison_detection/activation_defence.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
class ActivationDefence(PoisonFilteringDefence):
1818
"""
19-
Class performing Activation Analysis Defence
19+
Method from [Chen et al., 2018] performing poisoning detection based on activations clustering.
20+
Paper link: https://arxiv.org/abs/1811.03728
2021
"""
2122
defence_params = ['nb_clusters', 'clustering_method', 'nb_dims', 'reduce', 'cluster_analysis']
2223
valid_clustering = ['KMeans']
@@ -141,7 +142,7 @@ def analyze_clusters(self, **kwargs):
141142
:param kwargs: a dictionary of cluster-analysis-specific parameters
142143
:type kwargs: `dict`
143144
:return: assigned_clean_by_class, an array of arrays that contains what data points where classified as clean.
144-
:rtype: `ndarray`
145+
:rtype: `np.ndarray`
145146
"""
146147
self.set_params(**kwargs)
147148

@@ -170,10 +171,9 @@ def visualize_clusters(self, x_raw, save=True, folder='.', **kwargs):
170171
:type folder: `str`
171172
:param kwargs: a dictionary of cluster-analysis-specific parameters
172173
:type kwargs: `dict`
173-
174-
:return: sprites_by_class: Array with sprite images sprites_by_class, where sprites_by_class[i][j] contains the sprite of
175-
class i cluster j.
176-
:rtype: sprites_by_class: `ndarray`
174+
:return: sprites_by_class: Array with sprite images sprites_by_class, where sprites_by_class[i][j] contains the
175+
sprite of class i cluster j.
176+
:rtype: sprites_by_class: `np.ndarray`
177177
"""
178178
self.set_params(**kwargs)
179179

@@ -210,7 +210,7 @@ def set_params(self, **kwargs):
210210
:param nb_clusters: Number of clusters to be produced. Should be greater than 2.
211211
:type nb_clusters: `int`
212212
:param clustering_method: Clustering method to use
213-
:type clustering_method: `string`
213+
:type clustering_method: `str`
214214
:param nb_dims: Number of dimensions to project on
215215
:type nb_dims: `int`
216216
:param reduce: Reduction technique
@@ -237,7 +237,7 @@ def set_params(self, **kwargs):
237237

238238
def _get_activations(self):
239239
"""
240-
Find activations from :class:Classifier
240+
Find activations from :class:`Classifier`
241241
"""
242242
logger.info('Getting activations')
243243

docs/index.rst

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ The library is still under development. Feedback, bug reports and extensions are
1616
Supported Attack and Defense Methods
1717
------------------------------------
1818

19-
The Adversarial Robustness Toolbox contains implementations of the following attacks:
19+
The Adversarial Robustness Toolbox contains implementations of the following evasion attacks:
2020

2121
* DeepFool (`Moosavi-Dezfooli et al., 2015`_)
2222
* Fast gradient method (`Goodfellow et al., 2014`_)
23-
* Basic Iterative Method (`Kurakin et al., 2016`_)
23+
* Basic iterative method (`Kurakin et al., 2016`_)
24+
* Projected gradient descent (`Madry et al., 2017`_)
2425
* Jacobian saliency map (`Papernot et al., 2016`_)
2526
* Universal perturbation (`Moosavi-Dezfooli et al., 2016`_)
2627
* Virtual adversarial method (`Miyato et al., 2015`_)
@@ -35,6 +36,17 @@ The following defense methods are also supported:
3536
* Adversarial training (`Szegedy et al., 2013`_)
3637
* Virtual adversarial training (`Miyato et al., 2015`_)
3738
* Gaussian data augmentation (`Zantedeschi et al., 2017`_)
39+
* Thermometer encoding (`Buckman et al., 2018`_)
40+
* Total variance minimization (`Guo et al., 2018`_)
41+
* JPEG compression (`Dziugaite et al., 2016`_)
42+
43+
ART also implements detection methods of adversarial samples:
44+
45+
* Basic detector based on inputs
46+
* Detector trained on the activations of a specific layer
47+
48+
The following detector of poisoning attacks is also supported:
49+
* Detector based on activations analysis (`Chen et al., 2018`_)
3850

3951

4052
.. toctree::
@@ -68,6 +80,7 @@ Indices and tables
6880
.. _Moosavi-Dezfooli et al., 2015: https://arxiv.org/abs/1511.04599
6981
.. _Goodfellow et al., 2014: https://arxiv.org/abs/1412.6572
7082
.. _Kurakin et al., 2016: https://arxiv.org/abs/1607.02533
83+
.. _Madry et al., 2017: https://arxiv.org/abs/1706.06083
7184
.. _Papernot et al., 2016: https://arxiv.org/abs/1511.07528
7285
.. _Moosavi-Dezfooli et al., 2016: https://arxiv.org/abs/1610.08401
7386
.. _Carlini and Wagner, 2016: https://arxiv.org/abs/1608.04644
@@ -77,3 +90,7 @@ Indices and tables
7790
.. _Szegedy et al., 2013: http://arxiv.org/abs/1312.6199
7891
.. _Miyato et al., 2015: https://arxiv.org/abs/1507.00677
7992
.. _Zantedeschi et al., 2017: https://arxiv.org/abs/1707.06728
93+
.. _Buckman et al., 2018: https://openreview.net/forum?id=S18Su--CW
94+
.. _Guo et al., 2018: https://openreview.net/forum?id=SyJ7ClWCb
95+
.. _Dziugaite et al., 2016: https://arxiv.org/abs/1608.00853
96+
.. _Chen et al., 2018: https://arxiv.org/abs/1811.03728

docs/modules/attacks.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Basic Iterative Method
2222
.. autoclass:: BasicIterativeMethod
2323
:members:
2424

25+
Projected Gradient Descent
26+
--------------------------
27+
.. autoclass:: ProjectedGradientDescent
28+
:members:
29+
2530
Jacobian Saliency Map Attack
2631
----------------------------
2732
.. autoclass:: SaliencyMapMethod
@@ -32,8 +37,8 @@ NewtonFool
3237
.. autoclass:: NewtonFool
3338
:members:
3439

35-
Universarsal Perturbation Attack
36-
--------------------------------
40+
Universal Perturbation Attack
41+
-----------------------------
3742
.. autoclass:: UniversalPerturbation
3843
:members:
3944

docs/modules/defences.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,21 @@ Gaussian Data Augmentation
3535
.. autoclass:: GaussianAugmentation
3636
:members:
3737
:special-members:
38+
39+
JPEG Compression
40+
----------------
41+
.. autoclass:: JpegCompression
42+
:members:
43+
:special-members:
44+
45+
Thermometer Encoding
46+
--------------------
47+
.. autoclass:: ThermometerEncoding
48+
:members:
49+
:special-members:
50+
51+
Total Variance Minimization
52+
---------------------------
53+
.. autoclass:: TotalVarMin
54+
:members:
55+
:special-members:

0 commit comments

Comments
 (0)