Generating Adversarial Examples with Adversarial Networks

Xiao C, Li B, Zhu J, et al. Generating Adversarial Examples with Adversarial Networks[J]. arXiv: Cryptography and Security, 2018.

@article{xiao2018generating,
title={Generating Adversarial Examples with Adversarial Networks},
author={Xiao, Chaowei and Li, Bo and Zhu, Junyan and He, Warren and Liu, Mingyan and Song, Dawn},
journal={arXiv: Cryptography and Security},
year={2018}}

本文利用GAN生成adversarial samples.

主要內容

在這裏插入圖片描述

其中G\mathcal{G}是生成器, D\mathcal{D}是用於判別真假的判別器, 二者都是需要訓練的, 而ff是已知的我們需要攻擊的模型(在white-box下是不需要訓練的).

訓練判別器很普通的GAN是類似的, 即最大化下式:
LGAN=ExlogD(x)+Exlog(1D(x+G(x))).(1) \tag{1} \mathcal{L}_{GAN} = \mathbb{E}_{x} \log \mathcal{D}(x) + \mathbb{E}_{x} \log (1-\mathcal{D}(x+\mathcal{G}(x))).

訓練生成器, 除了LGAN\mathcal{L}_{GAN}, 還需要
Ladvf=Exf(x+G(x),t),(2) \tag{2} \mathcal{L}_{adv}^f = \mathbb{E}_x \ell_f (x+\mathcal{G}(x),t),
其中tt是我們所需要的攻擊目標(注意這裏通過對\ell的一些額外的選擇, 是可以用到untargeted attack的).
Lhinge=Exmax(0,G(x)2c),(3) \tag{3} \mathcal{L}_{hinge} = \mathbb{E}_x \max (0, \|\mathcal{G}(x)\|_2 -c),
顯然(3)是保證攝動不要太大.

所以訓練生成器是最小化
L=Ladvf+αLGAN+βLhinge.(4) \tag{4} \mathcal{L}=\mathcal{L}_{adv}^f+ \alpha \mathcal{L}_{GAN} + \beta \mathcal{L}_{hinge}.

black-box 拓展

該方法可以拓展到black-box上, 假設b(x)b(x)是目標網絡, 其結構和訓練數據都是未知的, 此時我們構建一個替代網絡f(x)f(x)用於逼近b(x)b(x). 利用交替訓練, 更新生成器G\mathcal{G}ff.

  1. 固定fi1f_{i-1}, 更新Gi\mathcal{G}_i: Gi\mathcal{G}_i初始化參數爲Gi1\mathcal{G}_{i-1}, 則
    Gi,Di=argminGmaxDLadvf+αLGAN+βLhinge. \mathcal{G}_i, \mathcal{D}_i = \arg \min _{\mathcal{G}} \max_{\mathcal{D}} \mathcal{L}_{adv}^f+ \alpha \mathcal{L}_{GAN} + \beta \mathcal{L}_{hinge}.
  2. 固定Gi\mathcal{G}_i, 更新fif_i: 初始化fif_i的參數爲fi1f_{i-1}, 則
    fi=argminfExH(f(x),b(x))+ExH(f(x+Gi(x)),b(x+Gi(x))). f_i=\arg \min_f \mathbb{E}_x \mathcal{H} (f(x), b(x)) + \mathbb{E}_x \mathcal{H} (f(x+\mathcal{G}_i(x)), b(x+\mathcal{G}_i(x))).
    其中H\mathcal{H}表示交叉熵損失.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章