Executing Baseline Algorithms

The first thing you might want to do is to execute one of the baseline face recognition algorithms that are implemented in bob.bio.

Setting up your Database

As mentioned in the documentation of bob.bio.base, the image databases are not included in this package, so you have to download them. For example, you can easily download the images of the AT&T database, for links to other utilizable image databases please read the Databases section.

By default, bob.bio does not know, where the images are located. Hence, before running experiments you have to specify the image database directories. How this is done is explained in more detail in the Installation Instructions.

Running Baseline Experiments

To run the baseline experiments, you can use the bob bio baseline script by just going to the console and typing:

$ bob bio baseline <baseline> <database>

This script is a simple wrapper for the verify.py script that is explained in more detail in Running Biometric Recognition Experiments. The bob bio baseline --help option shows you, which other options you have. Here is an almost complete extract:

  • <baseline>: The recognition algorithms that you want to execute.

  • <database>: The database and protocol you want to use.

  • --temp-directory: The directory where temporary files of the experiments are put to.

  • --result-directory: The directory where resulting score files of the experiments are put to.

  • --verbose: Increase the verbosity level of the script. By default, only the commands that are executed are printed, and the rest of the calculation runs quietly. You can increase the verbosity by adding the --verbose parameter repeatedly (up to three times).

Usually it is a good idea to have at least verbose level 2 (i.e., calling bob bio baseline --verbose --verbose, or the short version bob bio baseline -vv).

You can find the list of readily available baselines using the resources.py command:

$ resources.py --types baseline

Running in Parallel

To run the experiments in parallel, as usual you can define an SGE grid configuration, or run with parallel threads on the local machine. Hence, to run in the SGE grid, you can simply add the --grid command line option, without parameters. Similarly, to run the experiments in parallel on the local machine, simply add a --parallel <N> option, where <N> specifies the number of parallel jobs you want to execute.

The Algorithms

The algorithms present an (incomplete) set of state-of-the-art face recognition algorithms. Here is the list of short-cuts:

Further algorithms are available, when the bob.bio.gmm package is installed:

Note

The ivector algorithm needs a lot of training data and fails on small databases such as the AT&T database.

Baseline Results

Let’s trigger the bob bio baseline script to run the baselines on the ATnT dataset:

$ bob bio baseline eigenface atnt -vv -T <TEMP_DIR> -R <RESULT_DIR>
$ bob bio baseline lda atnt -vv -T <TEMP_DIR> -R <RESULT_DIR>
$ bob bio baseline gabor_graph atnt -vv -T <TEMP_DIR> -R <RESULT_DIR>
$ bob bio baseline gmm atnt -vv -T <TEMP_DIR> -R <RESULT_DIR>
$ bob bio baseline isv atnt -vv -T <TEMP_DIR> -R <RESULT_DIR>
$ bob bio baseline plda atnt -vv -T <TEMP_DIR> -R <RESULT_DIR>
$ bob bio baseline bic atnt -vv -T <TEMP_DIR> -R <RESULT_DIR>

Then, to evaluate the results, in terms of HTER, the script bob bio metrics should be executed as the following.

$ bob bio metrics <RESULT_DIR>/atnt/eigenface/Default/nonorm/scores-dev \
                  <RESULT_DIR>/atnt/lda/Default/nonorm/scores-dev \
                  <RESULT_DIR>/atnt/gabor_graph/Default/nonorm/scores-dev \
                  <RESULT_DIR>/atnt/lgbphs/Default/nonorm/scores-dev \
                  <RESULT_DIR>/atnt/gmm/Default/nonorm/scores-dev \
                  <RESULT_DIR>/atnt/isv/Default/nonorm/scores-dev \
                  <RESULT_DIR>/atnt/plda/Default/nonorm/scores-dev \
                  <RESULT_DIR>/atnt/bic/Default/nonorm/scores-dev --no-evaluation

The aforementioned script will produce in the console the HTERs below for each baseline under the ATnT database:

Table 1 The HTER results of the baseline algorithms on the AT&T database

eigenface

lda

gaborgraph

lgbphs

gmm

isv

plda

bic

9.0%

12.8%

6.0%

9.0%

1.0%

0.1%

10.8%

4.0%

Several types of evaluation can be executed, see bob bio --help for details. Particularly, here we can enable ROC curves, DET plots and CMC curves.

$ bob bio roc <RESULT_DIR>/atnt/eigenface/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/lda/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/gabor_graph/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/lgbphs/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/gmm/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/isv/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/plda/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/bic/Default/nonorm/scores-dev --no-evaluation \
              -o ROC.pdf

$ bob bio det <RESULT_DIR>/atnt/eigenface/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/lda/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/gabor_graph/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/lgbphs/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/gmm/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/isv/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/plda/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/bic/Default/nonorm/scores-dev --no-evaluation \
              -o DET.pdf

$ bob bio cmc <RESULT_DIR>/atnt/eigenface/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/lda/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/gabor_graph/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/lgbphs/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/gmm/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/isv/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/plda/Default/nonorm/scores-dev \
              <RESULT_DIR>/atnt/bic/Default/nonorm/scores-dev --no-evaluation \
              -o CMC.pdf

For the AT&T database the results should be as follows:

../../../_images/ROC.png ../../../_images/DET.png ../../../_images/CMC.png