机器学习进阶(二)
对抗攻击模型
Attack

Constrain应该根据不同的攻击模型类型来决定,模型是文本,语音还是图像?
应当选取和人感知相近的constrain。

How to Attack
\[ x^{*} = \arg{\min_{d(x^{0}, x^{'} \leq \varepsilon)} L(x^{'})} \]


what happend?
在下图中的上半部分,tiger cat的置信范围是比较宽的,超出置信范围后,也会得到一个类似的结果。
但在下半部分中,选取一个特定的特征空间,在这个特征空间中,tiger cat的范围是十分狭窄的,且超出置信范围后,会得到一个有很大区别的结果。

Attack Approaches
Name | website |
---|---|
FGSM | https://arxiv.org/abs/1412.6572 |
Basic iterative method | https://arxiv.org/abs/1607.02533 |
L-BFGS | https://arxiv.org/abs/1312.6199 |
Deepfool | https://arxiv.org/abs/1511.04599 |
JSMA | https://arxiv.org/abs/1511.07528 |
C&W | https://arxiv.org/abs/1608.04644 |
Elastic net attack | https://arxiv.org/abs/1709.04114 |
Spatially Transformed | https://arxiv.org/abs/1801.02612 |
One Pixel Attack | https://arxiv.org/abs/1710.08864 |
...... only list a few |
不同的方法会使用不同的constraints和optimization methods来训练attck method。
Black Box Attack
If you have the training data of the target network
- Train a proxy network yourself
- Using the proxy network to generate attcked objects
如果没有训练数据,我们可以使用提供的model来得到模型预测的标签,我们便可以运用这些数据来进行attack。
Universal adversarial perturbations
Attack in the Real World
Some papers
Defense
- Passive defense: Finding the attached image without modifying the model
- Proactive defense: Training a model that is robust to adversarial attack
Passive defense
攻击生效往往是某一个或某几个维度上的特征,使用filter进行平滑化处理,可以在不大幅度改变原image的情况下,过滤调一些attck 特征。

通过对input的处理,来判断该input是否为attck


Proactive Defense
Proactive Defense的主要思想是找出漏洞,补起来。
在训练模型的时候,找出那些attack input,给attack正确的标签,再重新进行训练。
To learn more ...
- Reference
- https://adversarial-ml-tutorial.org
- Adversarial Attack Toolbox:
- https://github.com/bethgelab/foolbox
- https://github.com/IBM/adversarial-robustness-toolbox
- https://github.com/tensorflow/cleverhans
机器学习进阶(二)
https://www.spacezxy.top/2022/05/04/ML-Advanced/ML-Advanced-2/