DeepFool算法

# 正文

${\rho }_{adv}\left(\stackrel{^}{k}\right)={\mathbb{E}}_{x}\frac{\mathrm{\Delta }\left(x;\stackrel{^}{k}\right)}{||x|{|}_{2}}$

${\mathbf{\text{r}}}_{\star }\left({\mathbf{\text{x}}}_{0}\right):=\mathrm{arg}\underset{\mathbf{\text{r}}}{min}||\mathbf{\text{r}}|{|}_{2}$$\textbf{r}_{\star}(\textbf{x}_0):=\arg\min\limits_{\textbf{r}}||\textbf{r}||_2$
$s.t.\ sign(f(x_0+\textbf{r}))\neq sign(f(x_0))$
$=-\frac{f\left({x}_{0}\right)}{||\mathbf{\text{w}}|{|}_{2}^{2}}\mathbf{\text{w}}$$=-\dfrac{f(x_0)}{||\textbf{w}||_2^2}\textbf{w}$

$\mathrm{arg}\underset{\mathbf{\text{r}}}{min}||\mathbf{\text{r}}|{|}_{2}$$\arg\min\limits_{\textbf{r}}||\textbf{r}||_2$
$s.t.\mathrm{\exists }k:{\mathbf{\text{w}}}_{k}^{T}\left({x}_{0}+\mathbf{\text{r}}\right)+{\mathbf{\text{b}}}_{k}\ge {\mathbf{\text{w}}}_{\stackrel{^}{k}\left({x}_{0}\right)}^{T}\left({x}_{0}+\mathbf{\text{r}}\right)+{\mathbf{\text{b}}}_{\stackrel{^}{k}\left({x}_{0}\right)}$$s.t. \exists k: \textbf{w}^T_k(x_0+\textbf{r})+\textbf{b}_k\geq \textbf{w}^T_{\hat{k}(x_0)}(x_0+\textbf{r})+\textbf{b}_{\hat{k}(x_0)}$

$k$$k$个分类边界：${\mathcal{F}}_{k}=\left\{x:{f}_{k}\left(x\right)-{f}_{\stackrel{^}{k}\left({x}_{0}\right)}\left(x\right)=0\right\}$$\mathscr{F}_k=\{x:f_k(x)-f_{\hat{k}(x_0)}(x)=0\}$
${x}_{0}$$x_0$与所在的凸区域可由超平面$P$$P$围成：

$P=\bigcap _{k=1}^{c}\left\{x:{f}_{\stackrel{^}{k}\left({x}_{0}\right)}\left(x\right)\ge {f}_{k}\left(x\right)\right\}$

$\stackrel{^}{l}\left({x}_{0}\right)=\mathrm{arg}\underset{k\ne \stackrel{^}{k}\left({x}_{0}\right)}{min}\frac{|{f}_{k}\left({x}_{0}\right)-{f}_{\stackrel{^}{k}\left({x}_{0}\right)}\left({x}_{0}\right)|}{||{\mathbf{\text{w}}}_{k}-{\mathbf{\text{w}}}_{\stackrel{^}{k}\left({x}_{0}\right)}|{|}_{2}}$

${\mathbf{\text{r}}}_{\star }\left({x}_{0}\right)=\frac{|{f}_{\stackrel{^}{l}\left({x}_{0}\right)}\left({x}_{0}\right)-{f}_{\stackrel{^}{k}\left({x}_{0}\right)}\left({x}_{0}\right)|}{||{\mathbf{\text{w}}}_{\stackrel{^}{l}\left({x}_{0}\right)}-{\mathbf{\text{w}}}_{\stackrel{^}{k}\left({x}_{0}\right)}|{|}_{2}^{2}}\left({\mathbf{\text{w}}}_{\stackrel{^}{l}\left({x}_{0}\right)}-{\mathbf{\text{w}}}_{\stackrel{^}{k}\left({x}_{0}\right)}\right)$

$P=\bigcap _{k=1}^{c}\left\{x:{f}_{k}\left({x}_{i}\right)-{f}_{\stackrel{^}{k}\left({x}_{0}\right)}\left({x}_{i}\right)+▽{f}_{k}\left({x}_{i}{\right)}^{\mathrm{\top }}x-▽{f}_{\stackrel{^}{k}\left({x}_{0}\right)}\left({x}_{i}{\right)}^{\mathrm{\top }}x\le 0\right\}$

# 小结

## 代码

cleverhans_github地址：https://github.com/tensorflow/cleverhans

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客