Skip to content

Extended Universal Adversarial Perturbation to targeted attack.

Notifications You must be signed in to change notification settings

Uno-Takashi/Targeted-Universal-Adversarial-Perturbation

 
 

Repository files navigation

Targeted Universal adversarial perturbations

This repos extended Universal Adversarial Perturbation to target attack.

Only Python3.x ver included.

python: Python3.x code to generate universal perturbations using TensorFlow.Required library is written requirements.txt .

Usage

Get started

To get started, you can run the demo code to apply a pre-computed universal perturbation for Inception on the image of your choice

python demo_inception.py -i data/test_img.png	

This will download the pre-trained model, and show the image without and with universal perturbation with the estimated labels. In this example, the pre-computed targeted universal perturbation in data/precomputing_perturbations/universal-target-00001.npy is used. This Perturbation targeted kit fox class.And data/precomputing_perturbations/ folder include all target perturbation.

Computing a targeted universal perturbation for your model

To compute a targeted universal perturbation for your model, please follow the same struture as in demo_inception.py. In particular, you should use the targeted-universal_perturbation function (see targeted-universal_pert.py for details), with the set of training images used to compute the perturbation, as well as the feedforward and gradient functions.

Targeted Perturbations

precomputing_perturbations directory include some precomputing targeted universal adversarial perturbations.

Reference

[1] S. Moosavi-Dezfooli*, A. Fawzi*, O. Fawzi, P. Frossard: Universal adversarial perturbations, CVPR 2017.

ターゲット型汎用的摂動(Japanese Docmentation)

このリポジトリはUniversal Adversarial Perturbationをターゲット型攻撃に拡張したものです。Python3.xのコードのみ含みます。

python3.x:TensorFlowを使い実装しています。ライブラリ環境はrequirements.txtに検証時に使用した環境を提供しています

おおよその性質はUniversal Adversarial Perturbaionと同様ですが、摂動を重ね合わせた画像がターゲットへと誤認する割合は60~70%です

使い方

はじめに

まず最初に、あなたの指定した任意の画像について、Inceptionモデルを使い、事前学習によって作られたTargeted Universal Adversarial Perturbationを重ね、識別結果を視覚化します。

python demo_inception.py -i data/test_img.png	

これを行うと自動的に事前学習されたInceptionモデルをダウンロードし、test_img.pngに「kit fox」をターゲットとしたTargeted Universal Adversarial Perturbationを添加し、識別した結果の文字列とともにを出力します。

kit fox targeted images

これらの摂動は"Universal"であるため自らが用意した別の画像に対しても重ね合わせるだけで、同様の性質を示すことを確認しています。

100クラスをターゲットとして、あらかじめ摂動を計算しています。ソースコードの上部のtarget=1を(labels.txtを参考にし)1~100の好きに変更することで容易にターゲット摂動を重ね合わせることができます。 例えばtarget=3とすれば次のような結果となります。

kit fox targeted images

またこれ以外のクラスについての攻撃や自身のモデルにおいて行いたい場合次の章を参照してください。

自分のモデルでTargeted Universal Adversarial Perturbationを計算する

参考文献

[1] S. Moosavi-Dezfooli*, A. Fawzi*, O. Fawzi, P. Frossard: Universal adversarial perturbations, CVPR 2017.

*Targeted verの論文は卒業論文として執筆したため人にお見せできる論文ではありません。 したがって手法を公開した論文は存在しません。ソースコードからお気持ちを察してください。

About

Extended Universal Adversarial Perturbation to targeted attack.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Python 100.0%