0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

(論文補足)Explaining and Harnessing Adversarial Examples 補足

Last updated at Posted at 2023-06-17

はじめに

この記事は「Explaining and Harnessing Adversarial Examples」という論文を読み進める中で論文に書かれていない計算過程や疑問などをまとめたものです。読みにくい部分や間違いなどあるかもしれません。ご容赦ください。

第5章補足

摂動の計算

第5章ではロジスティック回帰による3, 7の画像の分類を考えている。損失関数は以下の通り。

\mathbb{E}_{x, y\sim p_{data}}\zeta(-y(w^{\top}x+b)). 

ここで、$y\in {-1,1}, \zeta(z)=\log(1+e^z)$である。

y\in\{-1,1\} \\
\zeta(z)=\log(1+e^z)

である。$y=-1$が7の画像に対応する。
損失関数が期待値表現になっているのはバッチ処理を意識しているからと思われる。
この式から、摂動

\eta=\epsilon\text{sign}(\nabla_xJ(\theta, x, y))

を計算する。
$\zeta'(z)=1-\zeta(z)$を用いると、

\begin{align}
\eta
&=\epsilon\text{sign}(\frac{\partial J}{\partial x})\\
&=\epsilon\text{sign}(\frac{\partial}{\partial x}\zeta(-y(w^{\top}x+b)))\\
&=\epsilon\text{sign}(1-\zeta(-y(w^{\top}x+b))\frac{\partial}{\partial x}(-y(w^{\top}x+b))\\
&=\epsilon\text{sign}(1-\zeta(-y(w^{\top}x+b))(-yw))\\
&=\epsilon(-y)\text{sign}(w)\quad(\because 1-\zeta(z)>0,\quad\text{sign}(y)=y)
\end{align}

となる。
これはFigure 2の画像(d)において、画像(c)の7の画像に画像(b)が、画像(c)の3の画像に画像(b)の反転が薄く重なっていることの簡単な説明になる。

敵対的サンプル攻撃に対抗するロジスティック回帰モデルの損失関数の計算

敵対的サンプル$\tilde{x}$に対して

\mathbb{E}_{x, y\sim p_{data}}\zeta(-y(w^{\top}\tilde{x}+b)). 

を計算する。

\begin{align}
&\quad\mathbb{E}_{x, y\sim p_{data}}\zeta(-y(w^{\top}\tilde{x}+b))\\
&=\mathbb{E}_{x, y\sim p_{data}}\zeta(-y(w^{\top}x+b+w^{\top}\eta))\\
&=\mathbb{E}_{x, y\sim p_{data}}\zeta(-y(w^{\top}x+b+w^{\top}(-\epsilon y)\text{sign}(w)))\\
&=\mathbb{E}_{x, y\sim p_{data}}\zeta(-y(w^{\top}x+b-\epsilon y||w||_1))\\
&=\mathbb{E}_{x, y\sim p_{data}}\zeta(\epsilon||w||_1-y(w^{\top}x+b))\\

\end{align}

論文によるとここの計算結果は

\mathbb{E}_{x, y\sim p_{data}}\zeta(y(\epsilon||w||_1-w^{\top}x-b))

となるらしく、論文の記述と結果が異なってしまった。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?