题目:Towards Evaluating the Robustness of Neural Networks
作者:Nicholas Carlini, David Wagner
会议: ICLR (International Conference on Learning Representations)
单位:MIT-IBM Watson AI Lab, IBM Research
关于JSMA中选择像素对来进行修改的方法,作者做出了不一样的解释:
假设softmax层最小的输入为-100,那么softmax层的对于该输入的输出为0,即使增加了10,由-100变成了-90,仍然为0,显然这对输出没有什么影响。而如果softmax层最大的输入为10,将其更改为了0,显然这会使得输出产生巨大的变化。而JSMA的攻击方式并不会考虑从0到10和从-100到-90的不同,他是一视同仁的。
而在蒸馏训练之后,会使得这样的不同放大。假设输出类向量为:[ -674.3225 , -371.59705 , -177.78831 , 562.87225 ,-1313.5781 , 998.18207 , -886.97107 , -511.58194 ,-126.719666, -43.129272]。要改变类别实际上只需要第四个数比第六个数大即可(即562增长,998下降)。但是JSMA会由于增长562会使得例如-1313,-886的数增加很多而放弃。这实际上是算法本身的问题。
要攻击防御性蒸馏模型实际上很简单,只需要不考虑这些其他的类向量值,只考虑需要超过的类向量和自身的类向量值即可,甚至可以只关注增加自身的类向量
。
Nicholas Carlini和David Wagner提出了一系列能够改变类向量的目标函数:
f 1 ( x ′ ) = − loss F , t ( x ′ ) + 1 f_{1}\left(x^{\prime}\right)=-\operatorname{loss}_{F, t}\left(x^{\prime}\right)+1 f1(x′)=−lossF,t(x′)+1
f 2 ( x ′ ) = ( max i ≠ t ( F ( x ′ ) i ) − F ( x ′ ) t ) + f_{2}\left(x^{\prime}\right)=\left(\max _{i \neq t}\left(F\left(x^{\prime}\right)_{i}\right)-F\left(x^{\prime}\right)_{t}\right)^{+} f2(x′)=(maxi=t(F(x′)i)−F(x′)t)+
f 3 ( x ′ ) = softplus ( max i ≠ t ( F ( x ′ ) i ) − F ( x ′ ) t ) − log ( 2 ) f_{3}\left(x^{\prime}\right)=\operatorname{softplus}\left(\max _{i \neq t}\left(F\left(x^{\prime}\right)_{i}\right)-F\left(x^{\prime}\right)_{t}\right)-\log (2) f3(x′)=softplus(maxi=t(F(x′)i)−F(x′)t)−log(2)
f 4 ( x ′ ) = ( 0.5 − F ( x ′ ) t ) + f_{4}\left(x^{\prime}\right)=\left(0.5-F\left(x^{\prime}\right)_{t}\right)^{+} f4(x′)=(0.5−F(x′)t)+
f 5 ( x ′ ) = − log ( 2 F ( x ′ ) t − 2 ) f_{5}\left(x^{\prime}\right)=-\log \left(2 F\left(x^{\prime}\right)_{t}-2\right) f5(x′)=−log(2F(x′)t−2)
f δ ( x ′ ) = ( max i ≠ t ( Z ( x ′ ) i ) − Z ( x ′ ) t ) + f_{\delta}\left(x^{\prime}\right)=\left(\max _{i \neq t}\left(Z\left(x^{\prime}\right)_{i}\right)-Z\left(x^{\prime}\right)_{t}\right)^{+} fδ(x′)=(maxi=t(Z(x′)i)−Z(x′)t)+
f 7 ( x ′ ) = softplus ( max i ≠ t Z ( x ′ ) i ) − Z ( x ′ ) t ) − log ( 2 ) \left.f_{7}\left(x^{\prime}\right)=\operatorname{softplus}\left(\max _{i \neq t} Z\left(x^{\prime}\right)_{i}\right)-Z\left(x^{\prime}\right)_{t}\right)-\log (2) f7(x′)=softplus(maxi=tZ(x′)i)−Z(x′)t)−log(2)
其中, l o s s loss loss就是xx的交叉熵损失函数, t t t是目标攻击类别, s o f t p l u s ( x ) = l o g ( 1 + e x p ( x ) ) softplus(x)=log(1+exp(x)) softplus(x)=log(1+exp(x))。 F ( x ) F(x) F(x)是 s o f t m a x softmax softmax层对于样本 x x x的输出, Z ( x ) Z(x) Z(x)是logit层对于样本 x x x的输出,也就是softmax层的输入
可以得到目标函数
minimize x ∥ x − x 0 ∥ 2 2 + c ⋅ f ( x , t ) subject to x ∈ [ 0 , 1 ] p \begin{aligned} &\text { minimize }_{\mathbf{x}}\left\|\mathbf{x}-\mathbf{x}_{0}\right\|_{2}^{2}+c \cdot f(\mathbf{x}, t)\\ &\text { subject to } \mathbf{x} \in[0,1]^{p} \end{aligned} minimize x∥x−x0∥22+c⋅f(x,t) subject to x∈[0,1]p
为了保证输出能够产生一个合理的图像,需要0≤xi+δi≤1,这实际上被称为盒约束 (box constraints)。作者总结出了三种解决盒约束优化问题的方式:
这样的改变使得优化问题变成以 w w w为优化器的无约束最小化问题,并且可以将DNN的典型优化工具(即反向传播)用于求解最优w并获得相应的对抗性示例 x x x
根据此,作者提出了三种范数约束求解的方法
https://blog.csdn.net/kearney1995/article/details/79904095