ココアのお勉強ブログ

技術職の一般人です。趣味でコード書いたりソフト触ったり。

Improving the Robustness of Deep Neural Networks via Stability Training 軽く読んだのでメモ

Improving the Robustness of Deep Neural Networks via Stability Training という論文を少しだけ読んだのでメモ。

後ろの方雑になってしまったけど許してください...

どんなもの?

画像の視覚入力の小さな摂動(変化)は、ニューラルネットワークの出力を大きく歪める可能性がある。

例えば図1で

「ほぼ重複しているが、若干違いがあるような画像のペア」の例が左と真ん中の列(赤いお花と建物の画像)。

imageAが元画像、imageBがJPEG圧縮して quality factor が 50 の画像。

quality factorの数値を変えることによりJPEGの圧縮率が変わるらしい

https://faq.canon.jp/app/answers/detail/a_id/12801

f:id:hotcocoastudy:20191012083203p:plain

図1 Near-duplicate images can confuse state-of-the-art neural networks due to feature embedding instability.

右の列(草生えてるやつ)は全く異なる画像のペア画像。

変化(difference)の小さい画像は変化の大きな画像に匹敵する(Dという距離を測る指標があり、左と真ん中の列のD値と右の列のD値が匹敵していることが分かりますね)。

本論文ではそのような微細な変化のあるデータセットを安定させる分類方法を提案した。

 

先行研究と比べてどこがすごい?

  • JPEG-50 圧縮による変化
  • トリミングを若干ずらすRandom cropping (論文だとoffset = 10)
  • thumbnail resizingによる変化

のような変化を加えた画像に対しても従来の学習方法より安定した特徴量が得られることを確認した。以下その学習方法を Stability Training と呼ぶ。

 

技術や手法のキモはどこ?

L_0 を今まで用いてきたLoss(例えば画像分類タスクだとSoftmax cross entropy)として、それにα倍された L_stability と呼ばれる新しいLossを足す。

f:id:hotcocoastudy:20191012093022p:plain

x は入力、x' は歪めた(変化を加えた)画像

L_stability は出力 f(x) を f(x') に近づけるLossである。

f:id:hotcocoastudy:20191012093311p:plain

詳しくは後述。

①特徴埋め込みのためのStability

ここでは Ranking triplet を用いている。

 

f:id:hotcocoastudy:20191012091936p:plain

図2 triplet samplingの例(画像はhttps://techblog.zozo.com/entry/metric_learningより引用、編集してます)

論文では

a→q

と表現する文字が変わっているようが意味は同じようです(多分)。

目的は以下のようにすることです。

f:id:hotcocoastudy:20191012092548p:plain

hinge lossを使ってL_0を

f:id:hotcocoastudy:20191012092614p:plain

L2距離を使った stability loss を

f:id:hotcocoastudy:20191012092713p:plain

と定義することができる。

②分類のためのStability

分類で一般に用いられる cross-entropy loss をL_0として定義し、

f:id:hotcocoastudy:20191012093937p:plain

KL-divergence を用いて stability loss を

f:id:hotcocoastudy:20191012094241p:plain

と定義できる。

 

まとめると以下の図3のようになる。

f:id:hotcocoastudy:20191012090727p:plain

図3 The architecture used to apply stability training to any given deep neural network

 

どうやって有効だと検証した?

図4は特徴距離D(L2距離)の比較

f:id:hotcocoastudy:20191012094553p:plain

図4 Cumulative distribution of the deep ranking feature distance.

図5は

  • JPEG-50 圧縮による変化
  • トリミングを若干ずらすRandom cropping (論文だとoffset = 10)
  • thumbnail resizingによる変化

のような変化を加えた画像に対する従来の学習方法と提案手法の比較。

f:id:hotcocoastudy:20191012094521p:plain

図5 Precision-recall performance for near-duplicate detection using feature distance thresholding on deep ranking features.

f:id:hotcocoastudy:20191012095327p:plain

f:id:hotcocoastudy:20191012095303p:plain

f:id:hotcocoastudy:20191012094943p:plain

図6 : Examples of near-duplicate image pairs that are robustly recognized as near-duplicates by stabilized features (small feature distance), but easily confuse un-stabilized features (large feature distance). Left group: using JPEG-50 compression corruptions. Right group: random cropping CROP-10 corruptions. For each image pair, we display the reference image x, the difference with its corrupted copy x − x 0 , and the distance in feature space D(f(x), f(x 0 )) for the un-stabilized (red) and stabilized features (green).

 

議論はある? 

 

次に読むべき論文は?

これ気になってます

Adversarial Examples Are Not Bugs, They Are Features