{ "info": { "author": "Ivana Chingovska", "author_email": "ivana.chingovska@idiap.ch", "bugtrack_url": null, "classifiers": [], "description": "===============================================================\n Fusing counter-measures for detecting attacks in Replay-Attack\n===============================================================\n\nThis package implements:\n - cropping face bounding boxes from Replay-Attack database\n - extracting GLCM features for spoofing detection\n - generating classification scores for the features using SVM and LDA\n - extracting other types of features using other satellite packages it depends on\n - calculating Q-statistics and fusing classification scores at score-level using other satellite package it depends on.\n\nThis satellite package depends on the following satellite packages: `antispoofing.lbp `_ , `antispoofing.lbptop `_ , `antispoofing.motion `_ , `antispoofing.fusion `_ , `antispoofing.utils `_ . This dependence enables an interface for the scripts in these satellite packages through antispoofing.competition_icb2013, which means easy spoofing score generation using different types of features, as well as analysis of the common errors and fusion of the methods at score-level.\n\nThe fused system consisting of several of these counter-measures is submitted to the The 2nd competition on counter measures to 2D facial spoofing attacks, in conjuction with ICB 2013.\n\nIf you use this package and/or its results, please cite the following\npublications:\n \n1. Bob as the core framework used to run the experiments::\n\n @inproceedings{Anjos_ACMMM_2012,\n author = {A. Anjos AND L. El Shafey AND R. Wallace AND M. G\\\"unther AND C. McCool AND S. Marcel},\n title = {Bob: a free signal processing and machine learning toolbox for researchers},\n year = {2012},\n month = oct,\n booktitle = {20th ACM Conference on Multimedia Systems (ACMMM), Nara, Japan},\n publisher = {ACM Press},\n }\n\n2. The 2nd competition on counter measures to 2D facial spoofing attacks::\n \n @INPROCEEDINGS{Chingovska_ICB2013_2013,\n author = {Chingovska, Ivana and others},\n keywords = {Anti-spoofing, Competition, Counter-Measures, face spoofing, presentation attack},\n title = {The 2nd competition on counter measures to 2D facial spoofing attacks},\n booktitle = {International Conference of Biometrics 2013},\n year = {2013}\n }\n\n\nIf you wish to report problems or improvements concerning this code, please\ncontact the authors of the above mentioned papers.\n\nRaw data\n--------\n\nThe data used in the paper is publicly available and should be downloaded and\ninstalled **prior** to try using the programs described in this package. Visit\n`the REPLAY-ATTACK database portal\n`_ for more information.\n\nInstallation\n------------\n\n.. note:: \n\n If you are reading this page through our GitHub portal and not through PyPI,\n note **the development tip of the package may not be stable** or become\n unstable in a matter of moments.\n\n Go to `http://pypi.python.org/pypi/antispoofing.competition_icb2013\n `_ to download the latest\n stable version of this package.\n\nThere are 2 options you can follow to get this package installed and\noperational on your computer: you can use automatic installers like `pip `_ (or `easy_install\n`_) or manually download, unpack and\nuse `zc.buildout `_ to create a\nvirtual work environment just for this package.\n\nUsing an automatic installer\n============================\n\nUsing ``pip`` is the easiest (shell commands are marked with a ``$`` signal)::\n\n $ pip install antispoofing.competition_icb2013\n\nYou can also do the same with ``easy_install``::\n\n $ easy_install antispoofing.competition_icb2013\n\nThis will download and install this package plus any other required\ndependencies. It will also verify if the version of Bob you have installed\nis compatible.\n\nThis scheme works well with virtual environments by `virtualenv\n`_ or if you have root access to your\nmachine. Otherwise, we recommend you use the next option.\n\nUsing ``zc.buildout``\n=====================\n\nDownload the latest version of this package from `PyPI\n`_ and unpack it in your\nworking area. The installation of the toolkit itself uses `buildout\n`_. You don't need to understand its inner workings\nto use this package. Here is a recipe to get you started::\n \n $ python bootstrap.py \n $ ./bin/buildout\n\nThese 2 commands should download and install all non-installed dependencies and\nget you a fully operational test and development environment.\n\n.. note::\n\n The python shell used in the first line of the previous command set\n determines the python interpreter that will be used for all scripts developed\n inside this package. Because this package makes use of `Bob\n `_, you must make sure that the ``bootstrap.py``\n script is called with the **same** interpreter used to build Bob, or\n unexpected problems might occur.\n\n If Bob is installed by the administrator of your system, it is safe to\n consider it uses the default python interpreter. In this case, the above 3\n command lines should work as expected. If you have Bob installed somewhere\n else on a private directory, edit the file ``buildout.cfg`` **before**\n running ``./bin/buildout``. Find the section named ``external`` and edit the\n line ``egg-directories`` to point to the ``lib`` directory of the Bob\n installation you want to use. For example::\n\n [external]\n recipe = xbob.buildout:external\n egg-directories=/Users/crazyfox/work/bob/build/lib\n\nUser Guide\n----------\n\nThis section explains how to use the package in order to: a) crop face bounding boxes from Replay-Attack; b) calculate the GLCM\nfeatures on Replay-Attack database; c) generate LBP, LBP-TOP and motion correlation features on Replay-Attack; d) generate classification scores using\nLinear Discriminant Analysis (LDA) and Support Vector Machines (SVM) and Multi-Layer perceptron (MLP); e) calculate common errors and Q-statistics for each of the features; f) perform fusion at score-level for the different classification scores.\n\nFor generation of LBP, LBP-TOP and motion-correlation features, please refer to the corresponding satellite packages (`antispoofing.lbp `_ , `antispoofing.lbptop `_ , `antispoofing.motion `_ respectively). For fusion at score-level, please refer to the corresponding satellite package (`antispoofing.fusion `_).\n\nCrop face bounding boxes\n========================\n\nThe features used in the paper are generated over the normalized face bounding boxes of the frames in the videos. The script to be used for face cropping and normalization is ``./bin/crop_faces.py``. It outputs .hdf5 files for each video, containing 3D numpy.array of pixel values of the normalized cropped frames. The first dimension of the array corresponds to the frames of the video files.::\n\n $ ./bin/crop_faces.py replay\n \nTo execute this script for the anonymized test-set, please call::\n\n $ ./bin/crop_faces.py replay --ICB-2013\n \nTo see all the options for the scripts ``crop_faces.py``.\njust type ``--help`` at the command line. If you want to see all the options for a specific database (e.g. protocols, lighting conditions etc.), type the following command (for Replay-Attack)::\n \n $ ./bin/calcglcm.py replay --help \n\nThis script uses the automatic face detections provided alongside Replay-Attack database. For frames with no detections, we copy the face detection from the previous frame (if there is one). In our work, we consider all the face bounding boxes smaller then 50x50 pixels as invalid detections (option ``--ff``). Frames with no detected face or invalid detected face (<50x50 pixels) are set to Nan in our .hdf5 files. The face bounding boxes are normalized to 64x64 before storing (option ``-n``).\n\nCalculate the GLCM features\n===========================\n\nThe first stage of the process is calculating the feature vectors on per-frame basis. The script operates on .hdf5 files as obtained using ``./bin/crop_faces.py``. The first dimension of the array corresponds to the frames of the video files.\n\nThe program to be used for calculating the GLCM features is ``./bin/calcglcm.py``::\n\n $ ./bin/calcglcm.py replay\n \nTo execute this script for the anonymized test-set, call::\n\n $ ./bin/calc_faces.py replay --ICB-2013 \n\nTo see all the options for the scripts ``calcglcm.py`` just type ``--help`` at the command line. If you want to see all the options for a specific database (e.g. protocols, lighting conditions etc.), type the following command (for Replay-Attack)::\n \n $ ./bin/calcglcm.py replay --help\n\n\nClassification with linear discriminant analysis (LDA)\n======================================================\n\nThe classification with LDA is performed using the script\n``./bin/ldatrain.py``. To execute the script with prior normalization and PCA\ndimensionality reduction as is done in the paper (for Replay-Attack), call::\n\n $ ./bin/ldatrain.py -r -n replay\n \nIf you want to normalize the output scores as well, just set the ``--ns`` option. \n \nTo execute this script for the anonymized test-set, call::\n\n $ ./bin/ldatrain.py -r -n replay --ICB-2013 \n\nTo reproduce our results, set the parameters cost=-1 (option ``-c -1``) and gamma=3 (option ``-g 3``) in the training of the SVM.\n\nThis script can be used to calculate the LDA scores not only for GLCM, but also for any other features computed with any other of the satellite packages. To see all the options for this script, just type ``--help`` at the command\nline.\n\nClassification with support vector machine (SVM)\n================================================\n\nThe classification with SVM is performed using the script\n``./bin/svmtrain.py``. To execute the script with prior normalization of the data in\nthe range ``[-1, 1]`` and PCA reduction as in the paper (for Replay-Attack), call::\n\n $ ./bin/svmtrain.py -n -r replay\n \nIf you want to normalize the output scores as well, just set the ``--ns`` option. \n \nTo call this script for the anonymized test-set, call::\n\n $ ./bin/svmtrain.py -n -r replay --ICB-2013 \n \nTo reproduce our results, set the parameters cost=-1 (option ``-c -1``) and gamma=3 (option ``-g 3``) in the training of the SVM.\n\nThis script can be used to calculate the SVM scores not only for GLCM, but also for any other features computed with any other of the satellite packages. To see all the options for this script, just type ``--help`` at the command\nline.\n\nBounding box countermeasure\n===========================\n\nA fast countermeasure that takes account the area of the face bounding box as a feature.::\n\n $ ./bin/icb2013_facebb_countermeasure.py --input-dir [Database dir] -v [database]\n\n\nQ-Statistic\n===========\n\nFusion two or more countermeasures is one way to improve the classification performance. Kuncheva and Whitaker [1] shown the combination of statistically independent classifiers maximises the performance of a fusion and in order to measure this dependency, they proposed the Q-Statistic. For two countermeasures (A and B), the Q-Statistics can be defined.\n\n.. math::\n\n Q_{A,B} = \\frac{N_{11}N_{00} - N_{01}N_{10}}{N_{11}N_{00} +N_{01}N_{10}}\n\nwhere `\\mathcal{N}` is the number of times that a countermeasure make a correct classification (`\\mathcal{N_1}`) or make an incorrect classification (`\\mathcal{N_0}`).\n\nTo run the Q-Statistic script call::\n\n $ ./bin/icb2013_qstatistic.py --input-dir [Set of scores of each countermeasure] -v [database]\n \nGenerating other types of features\n==================================\n\nThis package depends on other satellite packages for calculating other types of features: LBP, LBP-TOP and motion correlation. To read more details and to generate these types of features, please refer to the corresponding satellite packages (`antispoofing.lbp `_ , `antispoofing.lbptop `_ , `antispoofing.motion `_ respectively). Note that it is possoble to call the scripts belonging to these other satellite packages within antispoofing.competition_icb2013 satellite package.\n\nTo generate classificatio scores for the other types of features, you can use the methods provided by this or the other correponding satellite packages.\n\nFusion of counter-measures\n==========================\n\nThe classification scores obtained using different features and classification techniques can be fused at score level. To read about the available fusion techniques as well as to perform the fusion, please refer to the corresponding satellite package `antispoofing.fusion `_ . Note that you can call the scripts belonging to antispoofing.fusion satellite package within antispoofing.competition_icb2013 satellite package.\n\nGenerating error rates\n======================\n\nTo calculate the threshold on the classification scores of a single or a fused counter-measure, use ``./bin/eval_threshold.py``. Note that as an input argument you need to give the file with the developments scores to evaluate the threshold. To calculate the error rates, use ``./bin/apply_threshold.py``. To see all the options for these two scripts,\njust type ``--help`` at the command line. \n\nReferences\n----------\n\n[1] L. I. Kuncheva and C. J. Whitaker, \u201cMeasures of diversity in classifier ensembles and their relationship with the ensemble accuracy,\u201d Mach. Learn., vol. 51, pp. 181\u2013207, May 2003.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/antispoofing.competition_icb2013", "keywords": null, "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "antispoofing.competition_icb2013", "package_url": "https://pypi.org/project/antispoofing.competition_icb2013/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/antispoofing.competition_icb2013/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/antispoofing.competition_icb2013" }, "release_url": "https://pypi.org/project/antispoofing.competition_icb2013/1.1.0/", "requires_dist": null, "requires_python": null, "summary": "Fusion of spoofing counter measures for the REPLAY-ATTACK database (competition entry for 2nd competition on counter measures to 2D facial spoofing attacks, ICB 2013)", "version": "1.1.0" }, "last_serial": 829089, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "d5b8472578a9dfa6eba485cdba2b073c", "sha256": "151939701b7b2c10a6aefa9750d0e934cb2d28e429be2832e259ceba088b31eb" }, "downloads": -1, "filename": "antispoofing.competition_icb2013-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d5b8472578a9dfa6eba485cdba2b073c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17043, "upload_time": "2013-07-16T16:44:53", "url": "https://files.pythonhosted.org/packages/a4/aa/da8bcad7655fb1a9e5a6e84bd365bf4c44ac6525f00b1b2e680c104ddbae/antispoofing.competition_icb2013-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "70d0e67e4154d2143e73fc7ad4580b58", "sha256": "12f74d20c71fbec95ce12f0c42701ca067c08c3ff04425835638af2e38a482c0" }, "downloads": -1, "filename": "antispoofing.competition_icb2013-1.1.0.zip", "has_sig": false, "md5_digest": "70d0e67e4154d2143e73fc7ad4580b58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35642, "upload_time": "2013-07-31T09:42:29", "url": "https://files.pythonhosted.org/packages/0b/f3/c7387669d8f95361a68181358e29315a05602398d3f758750e4c33dbae0c/antispoofing.competition_icb2013-1.1.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "70d0e67e4154d2143e73fc7ad4580b58", "sha256": "12f74d20c71fbec95ce12f0c42701ca067c08c3ff04425835638af2e38a482c0" }, "downloads": -1, "filename": "antispoofing.competition_icb2013-1.1.0.zip", "has_sig": false, "md5_digest": "70d0e67e4154d2143e73fc7ad4580b58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35642, "upload_time": "2013-07-31T09:42:29", "url": "https://files.pythonhosted.org/packages/0b/f3/c7387669d8f95361a68181358e29315a05602398d3f758750e4c33dbae0c/antispoofing.competition_icb2013-1.1.0.zip" } ] }