Commit 8978d0a9 by Pedro TOME

first commit

parents
*~
*.swp
*.pyc
*.so
*.dylib
bin
eggs
parts
.installed.cfg
.mr.developer.cfg
*.egg-info
develop-eggs
sphinx
dist
.nfs*
.gdb_history
build
*.egg
src/
db.sql3
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
include README.rst bootstrap.py buildout.cfg COPYING
recursive-include docs *.py *.rst
.. vim: set fileencoding=utf-8 :
.. Pedro Tome <pedro.tome@idiap.ch>
.. Thu Jan 15 12:51:09 CEST 2015
.. image:: http://img.shields.io/badge/docs-stable-yellow.png
:target: http://pythonhosted.org/fingerveinreclib/index.html
.. image:: http://img.shields.io/badge/docs-latest-orange.png
:target: https://www.idiap.ch/software/bob/docs/latest/idiap/facereclib/master/index.html
.. image:: https://travis-ci.org/idiap/fingerveinreclib.svg?branch=master
:target: https://travis-ci.org/idiap/fingerveinreclib
.. image:: https://coveralls.io/repos/idiap/fingerveinreclib/badge.png
:target: https://coveralls.io/r/idiap/fingerveinreclib
.. image:: https://img.shields.io/badge/github-master-0000c0.png
:target: https://github.com/idiap/fingerveinreclib/tree/master
.. image:: http://img.shields.io/pypi/v/fingerveinreclib.png
:target: https://pypi.python.org/pypi/fingerveinreclib
.. image:: http://img.shields.io/pypi/dm/fingerveinreclib.png
:target: https://pypi.python.org/pypi/fingerveinreclib
===================================
The Fingervein Recognition Library
===================================
Welcome to the Finger vein Recognition Library based on Bob.
This library is designed to perform a fair comparison of finger vein recognition algorithms.
It contains scripts to execute various kinds of finger vein recognition experiments on a variety of finger vein image databases, and running the help is as easy as going to the command line and typing::
$ bin/fingerveinverify.py --help
About
-----
This library is developed at the `Biometrics group <http://www.idiap.ch/~marcel/professional/Research_Team.html>`_ at the `Idiap Research Institute <http://www.idiap.ch>`_.
The FingerVeinRecLib is designed to run finger vein recognition experiments in a comparable and reproducible manner.
.. note::
When you are working at Idiap_, you might get a version of the FingerVeinRecLib, where all paths are set up such that you can directly start running experiments.
Outside Idiap_, you need to set up the paths to point to your databases, please check `Read Further`_ on how to do that.
Databases
.........
To achieve this goal, interfaces to many publicly available facial image databases are contained, and default evaluation protocols are defined, e.g.:
- UTFVP - University of Twente Finger Vein Database [http://website]
- VERA Finger vein Database [http://www.idiap.ch/scientific-research/resources]
Algorithms
..........
Together with that, a broad variety of traditional and state-of-the-art finger vein recognition algorithms such as:
- Maximum Curvature [MNM+05]_
- Repeated Line Tracking [MNM+04]_
- Wide Line Detector [HDLTL+10]_
is provided.
Furthermore, tools to evaluate the results can easily be used to create scientific plots, and interfaces to run experiments using parallel processes or an SGE grid are provided.
Extensions
..........
On top of these already pre-coded algorithms, the FingerVeinRecLib provides an easy Python interface for implementing new image preprocessors, feature types, finger vein recognition algorithms or database interfaces, which directly integrate into the fingervein recognition experiment.
Hence, after a short period of coding, researchers can compare their new invention directly with already existing algorithms in a fair manner.
References
..........
.. [MNM+05] *N. Miura, A. Nagasaka, and T. Miyatake*. **Extraction of Finger-Vein Pattern Using Maximum Curvature Points in Image Profiles**. Proceedings on IAPR conference on machine vision applications, 9, pp. 347--350, 2005.
.. [MNM+04] *N. Miura, A. Nagasaka, and T. Miyatake*. **Feature extraction of finger vein patterns based on repeated line tracking and its application to personal identification**. Machine Vision and Applications, Vol. 15, Num. 4, pp. 194--203, 2004.
.. [HDLTL+10] *B. Huang, Y. Dai, R. Li, D. Tang and W. Li*. **Finger-vein authentication based on wide line detector and pattern normalization**. Proceedings of the 20th International Conference on Pattern Recognition (ICPR), 2010.
Installation
------------
To download the FingerVeinRecLib, please go to http://pypi.python.org/pypi/fingerveinreclib, click on the **download** button and extract the .zip file to a folder of your choice.
The FingerVeinRecLib is a satellite package of the free signal processing and machine learning library Bob_, and some of its algorithms rely on the `CSU Face Recognition Resources`_.
These two dependencies have to be downloaded manually, as explained in the following.
Bob
...
You will need a copy of Bob in version 1.2.0 or newer to run the algorithms.
Please download Bob_ from its webpage.
After downloading, you should go to the console and write::
$ python bootstrap.py
$ bin/buildout
This will download all required packages and install them locally.
If you don't want all the database packages to be downloaded, please remove the xbob.db.[database] lines from the ``eggs`` section of the file **buildout.cfg** in the main directory before calling the three commands above.
Test your installation
......................
To verify that your installation worked as expected, you might want to run our test utilities::
$ bin/nosetests
Usually, all tests should pass, if you use the latest packages of Bob_.
With other versions of Bob_, you might find some failing tests, or some errors might occur.
Cite our paper
--------------
If you use the FingerVeinRecLib in any of your experiments, please cite the following paper::
@inproceedings{Tome_IEEEBIOSIG2014,
author = {Tome, Pedro and Vanoni, Matthias and Marcel, S{\'{e}}bastien},
keywords = {Biometrics, Finger vein, Spoofing Attacks},
projects = {Idiap, BEAT},
month = sep,
title = {On the Vulnerability of Finger Vein Recognition to Spoofing},
booktitle = {IEEE International Conference of the Biometrics Special Interest Group (BIOSIG)},
volume = {230},
year = {2014},
ocation = {Darmstadt, Germay},
pdf = {http://publications.idiap.ch/downloads/papers/2014/Tome_IEEEBIOSIG2014.pdf}
}
.. _bob: http://www.idiap.ch/software/bob
.. _idiap: http://www.idiap.ch
.. _bioidiap at github: http://www.github.com/bioidiap
#see http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
__import__('pkg_resources').declare_namespace(__name__)
#!/usr/bin/env python
# Pedro Tome <Pedro.Tome@idiap.ch>
import configurations
import tools
import preprocessing
import features
import tests
import script
#import utils
#!/usr/bin/env python
# Pedro Tome <Pedro.Tome@idiap.ch>
"""Configuration files for different steps of the fingervein recognition tool chain"""
import databases
import preprocessing
import features
import tools
import grid
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <pedro.tome@idiap.ch>
"""Configuration files for image databases"""
#!/usr/bin/env python
import bob.db.utfvp
import facereclib
utfvp_directory = "/idiap/resource/database/UTFVP/data/"
database = facereclib.databases.DatabaseBob(
database = bob.db.utfvp.Database(
original_directory = utfvp_directory,
original_extension = ".png"
),
name = 'utfvp',
)
#!/usr/bin/env python
import bob.db.vera
import facereclib
vera_directory = "/idiap/project/vera"
database = facereclib.databases.DatabaseBob(
database = bob.db.vera.Database(
original_directory = vera_directory,
original_extension = ".png",
),
name = 'vera',
)
\ No newline at end of file
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
"""Configuration files for feature extractors"""
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
import bob.fingervein
# Parameters
BLOCK_SIZE = 59 # one or two parameters for block size
BLOCK_OVERLAP = 15 # one or two parameters for block overlap
# LBP parameters
LBP_RADIUS = 16
LBP_NEIGHBOR_COUNT = 16
LBP_UNIFORM = True
LBP_CIRCULAR = True
LBP_ROTATION_INVARIANT = False
LBP_COMPARE_TO_AVERAGE = False
LBP_ADD_AVERAGE = False
# histogram options
SPARSE_HISTOGRAM = False
SPLIT_HISTOGRAM = None
#Define feature extractor
feature_extractor = bob.fingervein.features.LocalBinaryPatterns(
block_size = BLOCK_SIZE, # one or two parameters for block size
block_overlap = BLOCK_OVERLAP, # one or two parameters for block overlap
lbp_radius = LBP_RADIUS,
lbp_neighbor_count = LBP_NEIGHBOR_COUNT,
lbp_uniform = LBP_UNIFORM,
lbp_circular = LBP_CIRCULAR,
lbp_rotation_invariant = LBP_ROTATION_INVARIANT,
lbp_compare_to_average = LBP_COMPARE_TO_AVERAGE,
lbp_add_average = LBP_ADD_AVERAGE,
# histogram options
sparse_histogram = SPARSE_HISTOGRAM,
split_histogram = SPLIT_HISTOGRAM
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
import bob.fingervein
# Parameters
SIGMA_DERIVATES = 5 #Sigma used for determining derivatives
GPU_ACCELERATION = False
#Define feature extractor
feature_extractor = bob.fingervein.features.MaximumCurvature(
sigma = SIGMA_DERIVATES,
gpu = GPU_ACCELERATION
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
import bob.fingervein
# Parameters
#Define feature extractor
feature_extractor = bob.fingervein.features.NormalisedCrossCorrelation(
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
import bob.fingervein
# Parameters
NUMBER_ITERATIONS = 3000 # Maximum number of iterations
DISTANCE_R = 1 # Distance between tracking point and cross section of the profile
PROFILE_WIDTH = 21 # Width of profile
#Define feature extractor
feature_extractor = bob.fingervein.features.RepeatedLineTracking(
iterations = NUMBER_ITERATIONS,
r = DISTANCE_R,
profile_w = PROFILE_WIDTH
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
import bob.fingervein
# Parameters
RADIUS_NEIGHBOURHOOD_REGION = 5 # Radius of the circular neighbourhood region
NEIGHBOURHOOD_THRESHOLD = 1
SUM_NEIGHBOURHOOD = 41 #Sum of neigbourhood threshold
RESCALE = True
#Define feature extractor
feature_extractor = bob.fingervein.features.WideLineDetector(
radius = RADIUS_NEIGHBOURHOOD_REGION,
threshold = NEIGHBOURHOOD_THRESHOLD,
g = SUM_NEIGHBOURHOOD,
rescale = RESCALE
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
"""Configuration files for SGE grid executions"""
#!/usr/bin/env python
import facereclib
# define a queue with demanding parameters
grid = facereclib.utils.GridParameters(
training_queue = '32G',
# preprocessing
number_of_preprocessings_per_job = 200,
preprocessing_queue = '4G',
# feature extraction
number_of_extracted_features_per_job = 200,
extraction_queue = '8G',
# feature projection
number_of_projected_features_per_job = 200,
projection_queue = '8G',
# model enrollment
number_of_enrolled_models_per_job = 10,
enrollment_queue = '8G',
# scoring
number_of_models_per_scoring_job = 10,
scoring_queue = '8G'
)
#!/usr/bin/env python
import facereclib
# define a queue specifically for the xbob.db.gbu database
grid = facereclib.utils.GridParameters(
training_queue = '32G',
# preprocessing
number_of_preprocessings_per_job = 1000,
preprocessing_queue = '8G',
# feature extraction
number_of_extracted_features_per_job = 100,
extraction_queue = '8G',
# feature projection
number_of_projected_features_per_job = 100,
projection_queue = '8G',
# model enrollment
number_of_enrolled_models_per_job = 100,
enrollment_queue = '8G',
# scoring
number_of_models_per_scoring_job = 10,
scoring_queue = '8G'
)
#!/usr/bin/env python
import facereclib
# setup of the grid parameters
# define a queue with demanding parameters
grid = facereclib.utils.GridParameters(
training_queue = '8G',
# preprocessing
number_of_preprocessing_jobs = 32,
preprocessing_queue = '4G-io-big',
# feature extraction
number_of_extraction_jobs = 32,
extraction_queue = '4G-io-big',
# feature projection
number_of_projection_jobs = 32,
projection_queue = {},
# model enrollment
number_of_enrollment_jobs = 32,
enrollment_queue = {},
# scoring
number_of_scoring_jobs = 32,
scoring_queue = {'queue': 'q_gpu'},
)
#!/usr/bin/env python
import facereclib
# setup of the grid parameters
# define a queue with demanding parameters
grid = facereclib.utils.GridParameters(
training_queue = '8G',
# preprocessing
number_of_preprocessing_jobs = 32,
preprocessing_queue = '4G-io-big',
# feature extraction
number_of_extraction_jobs = 32,
extraction_queue = '4G-io-big',
# feature projection
number_of_projection_jobs = 32,
projection_queue = {},
# model enrollment
number_of_enrollment_jobs = 32,
enrollment_queue = {},
# scoring
number_of_scoring_jobs = 32,
scoring_queue = '4G-io-big',
)
#!/usr/bin/env python
import facereclib
# setup of the grid parameters
# define a queue with demanding parameters
grid = facereclib.utils.GridParameters(
training_queue = '8G',
# preprocessing
number_of_preprocessings_per_job = 1000,
preprocessing_queue = {},
# feature extraction
number_of_extracted_features_per_job = 1000,
extraction_queue = {},
# feature projection
number_of_projected_features_per_job = 1000,
projection_queue = {},
# model enrollment
number_of_enrolled_models_per_job = 100,
enrollment_queue = '2G',
# scoring
number_of_models_per_scoring_job = 1500,
scoring_queue = {'queue': 'q_gpu'},
)
#!/usr/bin/env python
import facereclib
# define the queue using all the default parameters
grid = facereclib.utils.GridParameters(
)
#!/usr/bin/env python
# setup of the grid parameters
# default queue used for training
training_queue = { 'queue':'q1d', 'memfree':'8G' }
# number of images that one job should preprocess
number_of_images_per_job = 1000
preprocessing_queue = {}
# number of features that one job should extract
number_of_features_per_job = 10000
extraction_queue = {}
# number of features that one job should project
number_of_projections_per_job = 100000
projection_queue = {}
# number of models that should be enrolled by one enroll job
number_of_models_per_enroll_job = 1000
enroll_queue = {}
# number of models that one score computation should use
number_of_models_per_score_job = 500
score_queue = {}
#!/usr/bin/env python
import facereclib
# define the queue using all the default parameters
grid = facereclib.utils.GridParameters(
grid = 'local',
number_of_parallel_processes = 4
)
# define a queue that is highly parallelized
grid_p16 = facereclib.utils.GridParameters(
number_of_preprocessings_per_job = 50,
number_of_extracted_features_per_job = 50,
number_of_projected_features_per_job = 50,
number_of_enrolled_models_per_job = 10,
number_of_models_per_scoring_job = 10,
grid = 'local',
number_of_parallel_processes = 4
)
#!/usr/bin/env python
import facereclib
# define a queue for small databases
grid = facereclib.utils.GridParameters(
training_queue = '8G',
# preprocessing
number_of_preprocessings_per_job = 20,
# feature extraction
number_of_extracted_features_per_job = 20,
# feature projection
number_of_projected_features_per_job = 20,
# model enrollment
number_of_enrolled_models_per_job = 5,
# scoring
number_of_models_per_scoring_job = 5,
)
#!/usr/bin/env python
import facereclib
# define a queue with very demanding parameters
grid = facereclib.utils.GridParameters(
training_queue = '64G',
# preprocessing
number_of_preprocessings_per_job = 100,
preprocessing_queue = '4G',
# feature extraction
number_of_extracted_features_per_job = 100,
extraction_queue = '8G-io-big',
# feature projection
number_of_projected_features_per_job = 20,
projection_queue = '8G-io-big',
# model enrollment
number_of_enrolled_models_per_job = 2,
enrollment_queue = '8G-io-big',
# scoring
number_of_models_per_scoring_job = 1,
scoring_queue = '8G-io-big'
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
"""Configuration files for image preprocessors"""
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
import bob.fingervein
# Contour localization mask
CONTOUR_MASK_HEIGHT = 4 # Height of the mask
CONTOUR_MASK_WIDTH = 40 # Width of the mask
PADDING_OFFSET = 5
PADDING_THRESHOLD = 0.2 #Threshold for padding black zones
PREPROCESSING = None
FINGERCONTOUR = 'leemaskMod' # Options: 'leemaskMatlab', 'konomask'
POSTPROCESSING = 'CircGabor' # Options: None, 'HE', 'HFE', 'CircGabor'
GPU_ACCELERATION = False
# define the preprocessor
preprocessor = bob.fingervein.preprocessing.FingerCrop(
mask_h =CONTOUR_MASK_HEIGHT,
mask_w =CONTOUR_MASK_WIDTH,
padding_offset = PADDING_OFFSET,
padding_threshold = PADDING_THRESHOLD,
preprocessing = PREPROCESSING,
fingercontour = FINGERCONTOUR,
postprocessing = POSTPROCESSING,
gpu = GPU_ACCELERATION
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
import bob.fingervein
# Contour localization mask
CONTOUR_MASK_HEIGHT = 4 # Height of the mask
CONTOUR_MASK_WIDTH = 40 # Width of the mask
PADDING_OFFSET = 5
PADDING_THRESHOLD = 0.2 #Threshold for padding black zones
PREPROCESSING = None
FINGERCONTOUR = 'leemaskMod' # Options: 'leemaskMatlab', 'konomask'
POSTPROCESSING = 'HE' # Options: None, 'HE', 'HFE', 'CircGabor'
GPU_ACCELERATION = False
# define the preprocessor
preprocessor = bob.fingervein.preprocessing.FingerCrop(
mask_h =CONTOUR_MASK_HEIGHT,
mask_w =CONTOUR_MASK_WIDTH,
padding_offset = PADDING_OFFSET,
padding_threshold = PADDING_THRESHOLD,
preprocessing = PREPROCESSING,
fingercontour = FINGERCONTOUR,
postprocessing = POSTPROCESSING,
gpu = GPU_ACCELERATION
)
#!/usr/bin/env python
# vim: set fileencoding=utf-8 :
# Pedro Tome <Pedro.Tome@idiap.ch>
import bob.fingervein
# Contour localization mask
CONTOUR_MASK_HEIGHT = 4 # Height of the mask
CONTOUR_MASK_WIDTH = 40 # Width of the mask
PADDING_OFFSET = 5
PADDING_THRESHOLD = 0.2 #Threshold for padding black zones
PREPROCESSING = None
FINGERCONTOUR = 'leemaskMod' # Options: 'leemaskMatlab', 'konomask'
POSTPROCESSING = 'HFE' # Options: None, 'HE', 'HFE', 'CircGabor'
GPU_ACCELERATION = False
# define the preprocessor
preprocessor = bob.fingervein.preprocessing.FingerCrop(
mask_h =CONTOUR_MASK_HEIGHT,
mask_w =CONTOUR_MASK_WIDTH,
padding_offset = PADDING_OFFSET,
padding_threshold = PADDING_THRESHOLD,
preprocessing = PREPROCESSING,
fingercontour = FINGERCONTOUR,