介绍
现有工作
优化问题
文章将对抗样本问题总结成两个优化问题:
给定分类器
f
(
x
)
:
x
∈
X
→
y
∈
Y
f(x) : x \in \mathcal{X} \rightarrow y \in \mathcal{Y}
f(x):x∈X→y∈Y和原始的输入
x
∈
X
\mathbf{x} \in \mathcal{X}
x∈X,那么无目标和有目标的对抗样本攻击可以表述成以下的优化问题:
- 无目标攻击
argmin x ∗ L ( x , x ∗ ) s.t. f ( x ∗ ) ≠ f ( x ) \operatorname{argmin}_{\mathbf{x}^{*}} L\left(\mathbf{x}, \mathbf{x}^{*}\right) \text { s.t. } f\left(\mathbf{x}^{*}\right) \neq f(\mathbf{x}) argminx∗L(x,x∗) s.t. f(x∗)̸=f(x)
其中 L L L是原始样本和对抗样本之间的视觉损失函数,如L2损失。 - 有目标攻击
argmin x ⋅ L ( x , x ∗ ) s . t . f ( x ∗ ) = y t , where y t ∈ Y \operatorname{argmin}_{x} \cdot L\left(x, x^{*}\right) s . t . f\left(x^{*}\right)=y_{t}, \text { where } y_{t} \in \mathcal{Y} argminx⋅L(x,x∗)s.t.f(x∗)=yt, where yt∈Y
其中 y y y是指定的目标标签。
解决方法
- 基于解优化问题:L-BFGS,C&W
具有速度慢但是性能好的特点 - 基于一步梯度:fast gradient sign(FGSM),fast least likely class(FLLC)
具有速度快的优势,泛化能力较强 - 基于多步梯度:I-FGSM,BIM
本文方法
ATN网络是一个通过神经网络生成对抗样本的过程,可应用于多种应用场景,本文主要讨论有目标的白盒攻击。
ATN网络定义为:
g
f
,
θ
(
x
)
:
x
∈
X
→
x
′
g_{f, \boldsymbol{\theta}}(\mathbf{x}) : \mathbf{x} \in \mathcal{X} \rightarrow \mathbf{x}^{\prime}
gf,θ(x):x∈X→x′
其中f是要攻击的目标网络输出每一个类的概率,
θ
\theta
θ是ATN网络的参数,追求视觉损失小:
x
′
∼
x
\mathbf{x}^{\prime} \sim \mathbf{x}
x′∼x,且分类非原始目标:
argmax
f
(
x
)
≠
argmax
f
(
x
′
)
\operatorname{argmax}f(\mathbf{x}) \neq \operatorname{argmax} f\left(\mathbf{x}^{\prime}\right)
argmaxf(x)̸=argmaxf(x′)
为了找到
g
g
g,可以解以下优化问题:
argmin
θ
∑
x
i
∈
X
β
L
X
(
g
f
,
θ
(
x
i
)
,
x
i
)
+
L
Y
(
f
(
g
f
,
θ
(
x
i
)
)
,
f
(
x
i
)
)
\underset{\boldsymbol{\theta}}{\operatorname{argmin}} \sum_{\mathbf{x}_{i} \in \mathcal{X}} \beta L_{\mathcal{X}}\left(g_{f, \boldsymbol{\theta}}\left(\mathbf{x}_{i}\right), \mathbf{x}_{i}\right)+L_{\mathcal{Y}}\left(f\left(g_{f, \boldsymbol{\theta}}\left(\mathbf{x}_{i}\right)\right), f\left(\mathbf{x}_{i}\right)\right)
θargminxi∈X∑βLX(gf,θ(xi),xi)+LY(f(gf,θ(xi)),f(xi))
其中
L
X
L_{\mathcal{X}}
LX是视觉损失,
L
Y
L_{\mathcal{Y}}
LY是类别损失。
针对有目标的攻击,文章将
L
Y
L_{\mathcal{Y}}
LY定义为
L
Y
,
t
(
y
′
,
y
)
=
L
2
(
y
′
,
r
(
y
,
t
)
)
L_{\mathcal{Y}, t}\left(\mathbf{y}^{\prime}, \mathbf{y}\right)=L_{2}\left(\mathbf{y}^{\prime}, r(\mathbf{y}, t)\right)
LY,t(y′,y)=L2(y′,r(y,t))
其中
r
α
(
y
,
t
)
=
norm
(
{
α
∗
max
y
if
k
=
t
y
k
otherwise
}
k
∈
y
)
r_{\alpha}(\mathbf{y}, t)=\operatorname{norm}\left(\left\{\begin{array}{cc}{\alpha * \max \mathrm{y}} & {\text { if } k=t} \\ {y_{k}} & {\text { otherwise }}\end{array}\right\}_{k \in \mathrm{y}}\right)
rα(y,t)=norm({α∗maxyyk if k=t otherwise }k∈y)
目的是保持其他类别的先后顺序不变。
生成对抗样本类别
- 生成对抗噪声
- 生成对抗样本
实验结果 MNIST
- 针对单网络设置的ATN不具有泛化能。
- ATN网络很好的保持了先后顺序,有利于减少视觉损失。
- 针对多网络训练的ATN泛化行会好一些。
imagenet实验待补充