Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.paper.btas2018_siliconemask
Commits
26423a72
Commit
26423a72
authored
May 02, 2018
by
Amir MOHAMMADI
Browse files
Update the instructions
parent
8142d3fd
Changes
15
Hide whitespace changes
Inline
Side-by-side
README.rst
View file @
26423a72
.. vim: set fileencoding=utf-8 :
.. Mon Sep 11 10:23:39 CEST 2017
===========================================================
============
A Study of the Robustness of Face Recognition to Presentation Attac
ks
===========================================================
============
===========================================================
Spoofing Deep Face Recognition with Custom Silicone Mas
ks
===========================================================
This package is part of the signal-processing and machine learning toolbox
Bob_. It contains the source code to reproduce the following paper::
@article{Mohammadi_Deeply_Vulnerable_2017,
title = {Deeply Vulnerable -- A Study of the Robustness of Face Recognition to Presentation Attacks},
author = {Mohammadi, Amir and Bhattacharjee, Sushil and Marcel, S{\'{e}}bastien},
journal = {IET biometrics},
year = {2017},
institution = {Idiap},
@article{,
title = {Spoofing Deep Face Recognition with Custom Silicone Masks},
}
...
...
@@ -29,24 +24,19 @@ unpack it. Then, you can create a conda environment with the following
command::
$ cd bob.paper.cvpr2018_facevuln
$ conda env create -f environment.yml
$ conda create --name bob.paper.cvpr2018_facevuln --override-channels \
-c https://www.idiap.ch/software/bob/conda -c defaults \
python=3 bob=4.0.1 bob.bio.video bob.bio.caffe_face=1.1.0 bob.ip.tensorflow_extractor
$ source activate bob.paper.cvpr2018_facevuln # activate the environment
$ buildout
$ bin/bob_dbmanage.py all download --missing
$ bin/nosetests -sv . # test the installation
This will install all the required software to reproduce this paper.
Downloading the dataset
s
Downloading the dataset
------------------------
Four datasets are used in this study which are publicly available.
To download the datasets please refer to their websites:
* `Mobio`_
* `Replay Attack`_
* `Replay Mobile`_
* `MSU MFSD`_
The dataset used in this study is publicly available.
To download the dataset please refer to its websites: `CSMA`_
Downloading the face recognition models
---------------------------------------
...
...
@@ -63,157 +53,29 @@ place them in the right place. So you may skip downloading those manually.
Please unzip the `FaceNet model`_ in the source directory with the name
``20170512-110547``.
ROC SDK experiments
-------------------
`ROC SDK`_ version 1.9 is used in the paper.
The `ROC SDK`_ is a commercial product and a license is needed to use
it. You can skip the `ROC SDK`_ experiments if you do not have a license.
If you do, you will also need the Bob wrapper packages for using the ROC SDK.
These packages are available upon request.
Configuring the experiments
---------------------------
Now that you have downloaded the
four
database
s
. You need to set the path
s
to
tho
se in the configuration file
s
. Bob_ supports a configuration file
Now that you have downloaded the database. You need to set the path to
the
databa
se in the configuration file. Bob_ supports a configuration file
(``~/.bob_bio_databases.txt``) in your home directory to specify where the
databases are located. Please specify the paths for the database like below::
databases are located. Please specify the paths for the database like below (by
editing the file manually) ::
$ cat ~/.bob_bio_databases.txt
[YOUR_MOBIO_IMAGE_DIRECTORY] = /databases/mobio/IMAGES_PNG/
[YOUR_MOBIO_ANNOTATION_DIRECTORY] = /databases/mobio/IMAGE_ANNOTATIONS/
[YOUR_MSU_MFSD_MOD_DIRECTORY] = /databases/MSU-MFSD/scene01/
[YOUR_REPLAY_ATTACK_DIRECTORY] = /databases/replay/protocols/replayattack-database/
[YOUR_REPLAY_MOBILE_DIRECTORY] = /databases/replay-mobile/database/
[SILICONECVPR_3DMask_Data_DIRECTORY] = /databases/CSMA
Running the experiments
-----------------------
Follow the commands below to run the computational part of the experiments with
`bob.bio.base`_.
VGG::
$ bin/verify.py config_base.py config_vgg.py config_siliconecvpr.py --protocol protocl5_licit -s vgg -A
$ bin/verify.py config_base.py config_vgg.py config_siliconecvpr.py --protocol protocl5_spoof -s vgg -A
$ bin/verify.py config_base.py config_cnn.py config_replay_licit.py
$ bin/verify.py config_base.py config_cnn.py config_replay_spoof.py
$ bin/verify.py config_base.py config_cnn.py config_replaymobile_licit.py
$ bin/verify.py config_base.py config_cnn.py config_replaymobile_spoof.py
$ bin/verify.py config_base.py config_cnn_eyes.py config_msumfsd_licit.py
$ bin/verify.py config_base.py config_cnn_eyes.py config_msumfsd_spoof.py
LightCNN::
$ bin/verify.py config_base.py config_lightcnn_eyes.py config_mobio.py
$ bin/verify.py config_base.py config_lightcnn.py config_replay_licit.py
$ bin/verify.py config_base.py config_lightcnn.py config_replay_spoof.py
$ bin/verify.py config_base.py config_lightcnn.py config_replaymobile_licit.py
$ bin/verify.py config_base.py config_lightcnn.py config_replaymobile_spoof.py
$ bin/verify.py config_base.py config_lightcnn_eyes.py config_msumfsd_licit.py
$ bin/verify.py config_base.py config_lightcnn_eyes.py config_msumfsd_spoof.py
FaceNet::
$ bin/verify.py config_base.py config_facenet_eyes.py config_mobio.py
$ bin/verify.py config_base.py config_facenet.py config_replay_licit.py
$ bin/verify.py config_base.py config_facenet.py config_replay_spoof.py
$ bin/verify.py config_base.py config_facenet.py config_replaymobile_licit.py
$ bin/verify.py config_base.py config_facenet.py config_replaymobile_spoof.py
$ bin/verify.py config_base.py config_facenet_eyes.py config_msumfsd_licit.py
$ bin/verify.py config_base.py config_facenet_eyes.py config_msumfsd_spoof.py
ISV::
$ bin/verify_isv.py config_base.py config_isv_eyes.py config_mobio.py -s isv-male
$ bin/verify_isv.py config_base.py config_isv_topleft.py config_replay_licit.py
$ bin/verify_isv.py config_base.py config_isv_topleft.py config_replay_spoof.py
$ bin/verify_isv.py config_base.py config_isv_topleft.py config_replaymobile_licit.py
$ bin/verify_isv.py config_base.py config_isv_topleft.py config_replaymobile_spoof.py
$ bin/verify_isv.py config_base.py config_isv_eyes.py config_msumfsd_licit.py
$ bin/verify_isv.py config_base.py config_isv_eyes.py config_msumfsd_spoof.py
RANKONE::
$ bin/verify.py config_base.py config_rankone.py config_mobio.py
$ bin/verify.py config_base.py config_rankone_loaded.py config_replay_licit.py
$ bin/verify.py config_base.py config_rankone_loaded.py config_replay_spoof.py
$ bin/verify.py config_base.py config_rankone_loaded.py config_replaymobile_licit.py
$ bin/verify.py config_base.py config_rankone_loaded.py config_replaymobile_spoof.py
$ bin/verify.py config_base.py config_rankone_loaded.py config_msumfsd_licit.py
$ bin/verify.py config_base.py config_rankone_loaded.py config_msumfsd_spoof.py
You can look at ``bin/verify.py --help`` to find options for parallelization of
the runs. By default results are saved in the ``./results`` directory::
$ export RESULTS_DIR=./results
The score files (output of ``verify.py`` commands) are also provided if you do
not want to run all the experiments again. You can extract them from
``./results/scores.tar.xz``. The score files can be used to generate the tables
and figures.
Generating the figures and tables
---------------------------------
The ROC and EPC curves on the Mobio dataset::
$ bin/evaluate.py -vvv \
-M 1e-5 -L 1e-3 -c EER \
-R mobio_nonorm_roc.pdf \
-E mobio_nonorm_epc.pdf \
-l VGG-Face LightCNN FaceNet ROC-SDK ISV \
-T "" "" \
-d \
$RESULTS_DIR/mobio/vgg-cosine/male/nonorm/scores-dev \
$RESULTS_DIR/mobio/lightcnn-cosine/male/nonorm/scores-dev \
$RESULTS_DIR/mobio/facenet-cosine/male/nonorm/scores-dev \
$RESULTS_DIR/mobio/rankone/male/nonorm/scores-dev \
$RESULTS_DIR/mobio/isv-male/male/nonorm/scores-dev \
-e \
$RESULTS_DIR/mobio/vgg-cosine/male/nonorm/scores-eval \
$RESULTS_DIR/mobio/lightcnn-cosine/male/nonorm/scores-eval \
$RESULTS_DIR/mobio/facenet-cosine/male/nonorm/scores-eval \
$RESULTS_DIR/mobio/rankone/male/nonorm/scores-eval \
$RESULTS_DIR/mobio/isv-male/male/nonorm/scores-eval
Score distributions of ROC-SDK and VGG-Face on Mobio::
$ bin/threshold_evolution.py $RESULTS_DIR/mobio/rankone/male/nonorm/scores-{dev,eval} -o mobio_nonorm_rankone_hist.pdf
$ bin/threshold_evolution.py $RESULTS_DIR/mobio/vgg-cosine/male/nonorm/scores-{dev,eval} -o mobio_nonorm_vgg-cosine_hist.pdf
Vulnerability analysis tables::
$ # concatenate scores of all three PA datasets:
$ for licit in "licit" "spoof";
do
for dev in "dev" "eval";
do
for alg in "facenet-cosine" "isv" "lightcnn-cosine" "rankone" "vgg-cosine";
do
cat $RESULTS_DIR/replay/$alg/grandtest-${licit}/nonorm/scores-${dev} \
$RESULTS_DIR/msu-mfsd-mod/$alg/grandtest-${licit}/nonorm/scores-${dev} \
$RESULTS_DIR/replay-mobile/$alg/grandtest-${licit}/nonorm/scores-${dev} \
> $RESULTS_DIR/three-$alg-${licit}-${dev};
done
done
done
$ # print the table values:
$ echo "replay attack"
$ for alg in "vgg-cosine" "lightcnn-cosine" "facenet-cosine" "rankone" "isv" ; do echo $alg && bin/vulnerability.py $RESULTS_DIR/replay/$alg/grandtest-{licit,spoof}/nonorm/scores-{dev,eval}; done
$ echo "msu mfsd"
$ for alg in "vgg-cosine" "lightcnn-cosine" "facenet-cosine" "rankone" "isv" ; do echo $alg && bin/vulnerability.py $RESULTS_DIR/msu-mfsd-mod/$alg/grandtest-{licit,spoof}/nonorm/scores-{dev,eval}; done
$ echo "replay mobile"
$ for alg in "vgg-cosine" "lightcnn-cosine" "facenet-cosine" "rankone" "isv" ; do echo $alg && bin/vulnerability.py $RESULTS_DIR/replay-mobile/$alg/grandtest-{licit,spoof}/nonorm/scores-{dev,eval}; done
$ echo "all datasets"
$ for alg in "vgg-cosine" "lightcnn-cosine" "facenet-cosine" "rankone" "isv" ; do echo $alg && bin/vulnerability.py $RESULTS_DIR/three-$alg-{licit,spoof}-{dev,eval}; done
Score distribution of all three PA datasets combined::
$ bin/plot_on_demand_better.py -v $RESULTS_DIR/three-{vgg-cosine,lightcnn-cosine,facenet-cosine,rankone,isv}-{licit,spoof}-{dev,eval} -t VGG-Face,LightCNN,FaceNet,ROC-SDK,ISV -o allthree_dist.pdf
A bash script is provided to help you run the code. You need to specify
a directory to save the intermediate files. For example::
$ export RESULTS_DIR=$HOME/idiap/CSMA
Then, run::
$ ./run.sh
Contact
-------
...
...
bob/paper/cvpr2018_facevuln/database/query.py
View file @
26423a72
import
os
import
pkg_resources
import
json
import
logging
from
bob.bio.base.database
import
FileListBioDatabase
from
bob.bio.video.database
import
VideoBioFile
from
bob.bio.video.utils
import
FrameSelector
,
FrameContainer
from
bob.io.image
import
to_bob
from
bob.io.base
import
load
,
HDF5File
logging
.
getLogger
(
__name__
)
class
File
(
VideoBioFile
):
"""The file interface for silicone masks data."""
...
...
@@ -37,6 +41,11 @@ class Database(FileListBioDatabase):
name
=
'siliconecvpr'
,
bio_file_class
=
None
,
models_depend_on_protocol
=
True
,
annotation_extension
=
'.json'
,
**
kwargs
):
if
annotation_directory
is
None
:
annotation_directory
=
os
.
path
.
join
(
os
.
environ
.
get
(
'RESULTS_DIR'
,
os
.
path
.
expanduser
(
'~/idiap/CSMA'
)),
'annotations'
)
logging
.
info
(
"annotation_directory changed to %s"
,
annotation_directory
)
if
bio_file_class
is
None
:
bio_file_class
=
File
filelists_directory
=
pkg_resources
.
resource_filename
(
...
...
bob/paper/cvpr2018_facevuln/script/annotate.py
View file @
26423a72
...
...
@@ -32,7 +32,7 @@ def annotate(bio_files, load_data, output_dir, landmarks):
for
i
,
f
in
enumerate
(
bio_files
):
logger
.
info
(
"Processing file %d"
,
i
+
1
)
frames
,
key
=
load_data
(
f
)
outpath
=
join
(
output_dir
,
key
+
'.
txt
'
)
outpath
=
join
(
output_dir
,
key
+
'.
json
'
)
if
isfile
(
outpath
):
logger
.
info
(
"Skipping %s"
,
outpath
)
continue
...
...
bob/paper/cvpr2018_facevuln/test.py
View file @
26423a72
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
import
numpy
as
np
from
.utils
import
confidence_for_indicator_variable
def
test_confidence_interval
():
def
assert_confidence
(
x
,
n
,
expected_lower
,
expected_upper
):
lower
,
upper
=
confidence_for_indicator_variable
(
x
,
n
)
assert
np
.
allclose
(
lower
,
expected_lower
)
assert
np
.
allclose
(
upper
,
expected_upper
)
assert_confidence
(
1
,
2
,
0.01257911709342505
,
0.98742088290657493
)
assert_confidence
(
10
,
10
,
0.69150289218123917
,
1
)
assert_confidence
(
0
,
10
,
0
,
0.30849710781876077
)
buildout.cfg
View file @
26423a72
...
...
@@ -10,8 +10,6 @@ eggs = gridtk
bob.ip.caffe_extractor
bob.bio.caffe_face
bob.ip.facelandmarks
bob.rankone
bob.bio.rankone
bob.ip.tensorflow_extractor
bob.ip.mtcnn
bob.paper.cvpr2018_facevuln
...
...
@@ -19,16 +17,10 @@ eggs = gridtk
extensions = bob.buildout
mr.developer
auto-checkout = *
develop = src/bob.measure
src/bob.ip.tensorflow_extractor
develop = src/bob.ip.tensorflow_extractor
src/bob.ip.caffe_extractor
src/bob.ip.mtcnn
src/bob.bio.base
src/bob.bio.face
src/bob.bio.video
src/bob.bio.caffe_face
src/bob.rankone
src/bob.bio.rankone
.
; options for bob.buildout
...
...
@@ -37,16 +29,11 @@ verbose = true
newest = false
[sources]
bob.rankone = git git@gitlab.idiap.ch:bob/bob.rankone.git
bob.bio.rankone = git git@gitlab.idiap.ch:bob/bob.bio.rankone.git
bob.ip.tensorflow_extractor = git git@gitlab.idiap.ch:bob/bob.ip.tensorflow_extractor.git
bob.ip.caffe_extractor = git git@gitlab.idiap.ch:bob/bob.ip.caffe_extractor.git
bob.ip.mtcnn = git git@gitlab.idiap.ch:bob/bob.ip.mtcnn.git
bob.bio.base = git git@gitlab.idiap.ch:bob/bob.bio.base.git
bob.bio.face = git git@gitlab.idiap.ch:bob/bob.bio.face.git
bob.bio.video = git git@gitlab.idiap.ch:bob/bob.bio.video.git
bob.bio.caffe_face = git git@gitlab.idiap.ch:bob/bob.bio.caffe_face.git
bob.measure = git git@gitlab.idiap.ch:bob/bob.measure.git
bob.bio.caffe_face = git https://gitlab.idiap.ch/bob/bob.bio.caffe_face.git rev=df6d43f0566a36e5dcada4503393b6d3cd5e486d
bob.ip.caffe_extractor = git https://gitlab.idiap.ch/bob/bob.ip.caffe_extractor.git rev=c4c691ce7dc0678bc0eb2dc9c90a19815694050b
bob.ip.mtcnn = git https://gitlab.idiap.ch/bob/bob.ip.mtcnn.git rev=4cc749885e334756dd003e6c13533c36b11c40e2
bob.ip.tensorflow_extractor = git https://gitlab.idiap.ch/bob/bob.ip.tensorflow_extractor.git rev=0ddf5ed3071a4ff805800c45bc220e1ccf6e13db
[scripts]
recipe = bob.buildout:scripts
...
...
config_isv_eyes.py
deleted
100644 → 0
View file @
8142d3fd
#!/usr/bin/env python
from
bob.bio.face.config.preprocessor.tan_triggs
import
preprocessor
from
bob.bio.face.config.extractor.dct_blocks
import
extractor
from
bob.bio.gmm.config.algorithm.isv
import
algorithm
sub_directory
=
'isv'
config_isv_topleft.py
deleted
100644 → 0
View file @
8142d3fd
#!/usr/bin/env python
from
bob.bio.face.config.extractor.dct_blocks
import
extractor
from
bob.bio.gmm.config.algorithm.isv
import
algorithm
from
bob.bio.face.preprocessor
import
FaceDetect
,
FaceCrop
,
TanTriggs
# This is the size of the image that this model expects
# Cropping
CROPPED_IMAGE_HEIGHT
=
80
CROPPED_IMAGE_WIDTH
=
CROPPED_IMAGE_HEIGHT
*
4
//
5
# eye positions for frontal images
RIGHT_EYE_POS
=
(
CROPPED_IMAGE_HEIGHT
//
5
,
CROPPED_IMAGE_WIDTH
//
4
-
1
)
LEFT_EYE_POS
=
(
CROPPED_IMAGE_HEIGHT
//
5
,
CROPPED_IMAGE_WIDTH
//
4
*
3
)
# Detects the face and crops it with eye detection
FACE_CROPPER
=
FaceDetect
(
face_cropper
=
FaceCrop
(
cropped_image_size
=
(
CROPPED_IMAGE_HEIGHT
,
CROPPED_IMAGE_WIDTH
),
cropped_positions
=
{
'leye'
:
LEFT_EYE_POS
,
'reye'
:
RIGHT_EYE_POS
},
color_channel
=
'gray'
),
use_flandmark
=
True
,
color_channel
=
'gray'
)
preprocessor
=
TanTriggs
(
face_cropper
=
FACE_CROPPER
)
sub_directory
=
'isv'
config_rankone.py
deleted
100644 → 0
View file @
8142d3fd
#!/usr/bin/env python
import
bob.bio.rankone
"""
Full Rank One Computing chain
"""
preprocessor
=
bob
.
bio
.
rankone
.
preprocessor
.
RankOne
()
extractor
=
bob
.
bio
.
rankone
.
extractor
.
RankOne
()
algorithm
=
bob
.
bio
.
rankone
.
algorithm
.
RankOne
()
sub_directory
=
'rankone'
config_rankone_loaded.py
deleted
100644 → 0
View file @
8142d3fd
#!/usr/bin/env python
import
bob.bio.rankone
"""
Full Rank One Computing chain
"""
preprocessor
=
bob
.
bio
.
rankone
.
preprocessor
.
RankOne
(
read_original_data
=
None
)
extractor
=
bob
.
bio
.
rankone
.
extractor
.
RankOne
(
image_is_loaded
=
True
)
algorithm
=
bob
.
bio
.
rankone
.
algorithm
.
RankOne
()
sub_directory
=
'rankone'
config_siliconecvpr.py
View file @
26423a72
from
bob.paper.cvpr2018_facevuln.database.config
import
database
database
.
original_directory
=
'[SILICONECVPR_3DMask_Data_DIRECTORY_PROCESSED]'
database
.
original_extension
=
'.hdf5'
database
.
annotation_directory
=
database
.
original_directory
groups
=
[
'dev'
]
skip_kmeans
=
True
skip_gmm
=
True
skip_isv
=
True
skip_extractor_training
=
True
skip_projector_training
=
True
skip_enroller_training
=
True
config_siliconecvpr_annotations.py
View file @
26423a72
import
os
from
os.path
import
expanduser
from
bob.paper.cvpr2018_facevuln.database.config
import
database
from
bob.ip.mtcnn
import
FaceDetector
from
bob.bio.face.config.preprocessor.face_detect
import
preprocessor
from
bob.ip.facedetect
import
detect_single_face
database
.
original_directory
=
'[SILICONECVPR_3DMask_Data_DIRECTORY_PROCESSED]'
database
.
original_extension
=
'.hdf5'
database
.
replace_directories
(
expanduser
(
'~/.bob_bio_databases.txt'
))
groups
=
[
'dev'
]
...
...
@@ -20,7 +19,7 @@ def load_data(f):
return
frames
,
key
output_dir
=
database
.
original_directory
output_dir
=
os
.
path
.
join
(
os
.
environ
.
get
(
'RESULTS_DIR'
,
expanduser
(
'~/idiap/CSMA'
)),
'annotations'
)
detector
=
FaceDetector
()
...
...
config_siliconecvpr_
prepare
.py
→
config_siliconecvpr_
copied
.py
View file @
26423a72
from
bob.paper.cvpr2018_facevuln.database.config
import
database
database
.
original_directory
=
'[SILICONECVPR_3DMask_Data_DIRECTORY_PROCESSED]'
database
.
original_extension
=
'.hdf5'
database
.
annotation_directory
=
database
.
original_directory
groups
=
[
'dev'
]
skip_kmeans
=
True
skip_gmm
=
True
...
...
protocol5_dist.pdf
View file @
26423a72
No preview for this file type
requirements.txt
View file @
26423a72
setuptools
bob.extension
gridtk
bob.measure
bob.bio.base
bob.bio.video
bob.bio.gmm
bob.ip.caffe_extractor
bob.bio.caffe_face
bob.ip.facelandmarks
bob.ip.tensorflow_extractor
bob.ip.mtcnn
run.sh
View file @
26423a72
#!/bin/bash
set
-ex
RESULTS_DIR
=
/home/amir/idiap/cvpr2018
ALL_PROTOCOLS
=(
"protocol1"
"protocol2"
"protocol3"
"protocol4"
"protocol5"
)
ALL_ALGORITHMS
=(
"facenet"
"lightcnn"
"vgg"
)
TITLES
=
"FaceNet,LightCNN,VGG-Face"
NCPU
=
4
NCPU
=
1
PROTOCOL_VARIANTS
=(
"_licit"
"_spoof"
)
FAR
=
0.01
PROTOCOLS
=(
"protocol5"
)
ALGORITHMS
=(
"facenet"
"lightcnn"
"vgg"
)
# Copy the database over
# for protocol in "${PROTOCOLS[@]}"; do
# for licit in "${PROTOCOL_VARIANTS[@]}"; do
# bin/verify.py config_base.py config_siliconecvpr_prepare.py \
# config_preprocess.py -s ${RESULTS_DIR} -o preprocessing -r 1 \
# --protocol ${protocol}${licit}
# done
# done
# Annotate the database:
# bin/annotate config_siliconecvpr_annotations.py -vv
# Run the performance and vulnerability analysis steps
#
for protocol in "${PROTOCOLS[@]}"; do
#
for licit in "${PROTOCOL_VARIANTS[@]}"; do
#
for alg in ${ALGORITHMS[@]} ; do
#
bin/verify.py config_base.py config_siliconecvpr.py \
#
config_${alg/-/_}.py -s ${RESULTS_DIR}/${alg} \
#
--protocol ${protocol}${licit} -r ${NCPU}
#
done
#
done
#
done
for
protocol
in
"
${
PROTOCOLS
[@]
}
"
;
do
for
licit
in
"
${
PROTOCOL_VARIANTS
[@]
}
"
;
do
for
alg
in
${
ALGORITHMS
[@]
}
;
do
bin/verify.py config_base.py config_siliconecvpr.py
\
config_
${
alg
/-/_
}
.py
-s
${
RESULTS_DIR
}
/
${
alg
}
\
--protocol
${
protocol
}${
licit
}
-r
${
NCPU
}
done
done
done
set
+x
# plot score distributions
...
...
@@ -38,23 +32,13 @@ set +x
for
protocol
in
"
${
PROTOCOLS
[@]
}
"
;
do
OLD_IFS
=
"
$IFS
"
IFS
=
","
SCORES
=
$(
eval echo
~/idiap/cvpr2018
/
"{
${
ALL_ALGORITHMS
[*]
}
}"
/
${
protocol
}
"{_licit,_spoof}/nonorm/scores-{dev,dev}"
)
SCORES
=
$(
eval echo
${
RESULTS_DIR
}
/
"{
${
ALL_ALGORITHMS
[*]
}
}"
/
${
protocol
}
"{_licit,_spoof}/nonorm/scores-{dev,dev}"
)
IFS
=
"
$OLD_IFS
"
bin/plot_on_demand_better.py
-vvv
\
--title
"
${
TITLES
}
"
\
--output
${
protocol
}
_dist.pdf
\
${
SCORES
}
# vulnerability analysis table
# echo "a priori threshold"
# for alg in ${ALGORITHMS[@]} ; do
# echo $alg
# bin/python `which ipython` --pdb -- bin/vulnerability.py \
# ./scores/mobio/${alg}-cosine/male/nonorm/scores-dev \
# ${RESULTS_DIR}/${alg}/${protocol}{_licit,_spoof}/nonorm/scores-dev
# done
echo
"a posteriori threshold"
for
alg
in
${
ALL_ALGORITHMS
[@]
}
;
do
echo
$alg
...
...
@@ -65,20 +49,3 @@ for protocol in "${PROTOCOLS[@]}"; do
done
done
# bin/plot_on_demand.py ${RESULTS_DIR}/facenet/{licit,spoof}/nonorm/scores-dev -i 7 -o dist_siliconecvpr_facenet.pdf
# bin/plot_on_demand.py ${RESULTS_DIR}/facenet/{licit,spoof}/nonorm/scores-dev -i 11 -o epsc_sfar_siliconecvpr_facenet.pdf
# bin/python `which ipython` --pdb -- bin/plot_on_demand_better.py -v ${RESULTS_DIR}/{vgg-cosine,rankone,isv,gabor-graph}/grandtest-{licit,spoof}/nonorm/scores-{dev,eval} -t VGG-Face,ROC-SDK,ISV,Gabor-Graph -o "${db}_dist.pdf"
# for db in replay replay-mobile msu-mfsd-mod ; do bin/python `which ipython` --pdb -- antispoofing/evaluation/script/plot_on_demand_better.py -v /home/amir/idiap/user/mobio/vgg-cosine/male/nonorm/scores-dev /home/amir/idiap/user/mobio/vgg-cosine/male/nonorm/scores-eval /home/amir/idiap/user/${db}/vgg-cosine/grandtest-spoof/nonorm/scores-dev /home/amir/idiap/user/${db}/vgg-cosine/grandtest-spoof/nonorm/scores-eval /home/amir/idiap/user/mobio/rankone/male/nonorm/scores-dev /home/amir/idiap/user/mobio/rankone/male/nonorm/scores-eval /home/amir/idiap/user/${db}/rankone/grandtest-spoof/nonorm/scores-dev /home/amir/idiap/user/${db}/rankone/grandtest-spoof/nonorm/scores-eval /home/amir/idiap/user/mobio/isv-male/male/nonorm/scores-dev /home/amir/idiap/user/mobio/isv-male/male/nonorm/scores-eval /home/amir/idiap/user/${db}/isv/grandtest-spoof/nonorm/scores-dev /home/amir/idiap/user/${db}/isv/grandtest-spoof/nonorm/scores-eval /home/amir/idiap/user/mobio/gaborgraph-male/male/nonorm/scores-dev /home/amir/idiap/user/mobio/gaborgraph-male/male/nonorm/scores-eval /home/amir/idiap/user/${db}/gabor-graph/grandtest-spoof/nonorm/scores-dev /home/amir/idiap/user/${db}/gabor-graph/grandtest-spoof/nonorm/scores-eval -t VGG-Face,ROC-SDK,ISV,Gabor-Graph -o "${db}_mobio_dist.pdf" ; done
# score dist of all three datasets
# bin/python `which ipython` --pdb -- bin/plot_on_demand_better.py -v ~/idiap/user/three-{vgg-cosine,lightcnn-cosine,facenet-cosine,rankone,isv}-{licit,spoof}-{dev,eval} -t VGG-Face,LightCNN,FaceNet,ROC-SDK,ISV -o allthree_dist.pdf
# # mean score fusion script
# for db in "replay" "replay-mobile" "msu-mfsd-mod"; do bin/bob_fuse.py -vvv \
# -t ~/idiap/user/${db}/{vgg-cosine,lightcnn-cosine,isv}/grandtest-licit/nonorm/scores-world \
# -d ~/idiap/user/${db}/{vgg-cosine,lightcnn-cosine,isv}/grandtest-spoof/nonorm/scores-dev \
# -e ~/idiap/user/${db}/{vgg-cosine,lightcnn-cosine,isv}/grandtest-spoof/nonorm/scores-eval \
# -s fusion-spoof-${db} -a mean --force ; done
# # The rest is Temp.ipynb near "def report_iapmr_perattack"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment