Skip to content

Commit

Permalink
支持白盒攻击facenet
Browse files Browse the repository at this point in the history
  • Loading branch information
duoergun0729 committed Sep 17, 2018
1 parent 361c9ee commit 9b5d6f3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
*.so
*.egg
*.egg-info
*.pb
dist
build

.idea/
thirdparty/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 38 additions & 2 deletions applications/face_recognition_attack/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
# Face Recogniztion Attack

## white box attack
## White box attack
We chose a pre-trained FaceNet model that is a state-of-the-art and widely used face-recognition system as our white-box attacked model. We used gradient-based attacks methods and modify its loss function using FaceNet embedding distance.

FaceNet and its pre-trained model can be downloaded from `https://github.com/davidsandberg/facenet`.
## Install

FaceNet and its pre-trained model can be downloaded from `https://github.com/davidsandberg/facenet`.

cd applications/

### Clone facenet

git clone https://github.com/davidsandberg/facenet.git

### Download pre-trained model

baidu netdisk https://pan.baidu.com/s/1gF6iwpF77UUHkibQY6QwMA

you can get 20180402-114759.zip,unzip it,get 20180402-114759.pb

cd applications/face_recognition_attack
total 93600
drwxr-xr-x 3 root root 4096 Sep 17 16:59 ./
drwxr-xr-x 3 root root 4096 Sep 17 16:33 ../
-rw-r--r-- 1 root root 95745767 Apr 9 14:45 20180402-114759.pb
-rw-r--r-- 1 root root 34639 Sep 17 16:33 Bill_Gates_0001.png
drwxr-xr-x 9 root root 4096 Sep 17 16:58 facenet/
-rw-r--r-- 1 root root 6114 Sep 17 16:33 facenet_fr.py
-rw-r--r-- 1 root root 36618 Sep 17 16:33 Michael_Jordan_0002.png
-rw-r--r-- 1 root root 388 Sep 17 16:33 README.md

## Attack face recogniztion



![Bill_Gates_0001.png](Bill_Gates_0001.png)
![Michael_Jordan_0002.png](Michael_Jordan_0002.png)

python facenet_fr.py

![Bill_Gates_0001_2_Michael_Jordan_00021114.png](Bill_Gates_0001_2_Michael_Jordan_00021114.png)
4 changes: 2 additions & 2 deletions applications/face_recognition_attack/facenet_fr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
import os
import time

sys.path.append("../../../facenet/src")
sys.path.append("../thirdparty/facenet/src")
import facenet

FACENET_MODEL_CHECKPOINT = "/mnt/model/facenet/20180402-114759/20180402-114759.pb"
FACENET_MODEL_CHECKPOINT = "20180402-114759.pb"


def get_pic_from_png(pic_path):
Expand Down

0 comments on commit 9b5d6f3

Please sign in to comment.