Package: antispoofing.fusion
This package combines motion and texture analysis based countermeasures to 2D facial spoofing attacks as described in the paper ‘Complementary Countermeasures for Detecting Scenic Face Spoofing Attacks’, International Conference on Biometrics, 2013. However, it is possible to fuse scores of any combination of countermeasures using the tools provided by this package.If you use this package and/or its results, please cite the following
publications:The original paper with the fusion of countermesures explained in details:@inproceedings{Komulainen_ICB_2013,
  author = {Komulainen, Jukka and Anjos, Andr{\'{e}} and Marcel, S{\'{e}}bastien and Hadid, Abdenour and Pietik{\"a}inen, Matti},
  month = Jun,
  title = {Complementary Countermeasures for Detecting Scenic Face Spoofing Attacks},
  journal = {International Conference on Biometrics 2013},
  year = {2013},
}Bob as the core framework used to run the experiments:@inproceedings{Anjos_ACMMM_2012,
    author = {A. Anjos AND L. El Shafey AND R. Wallace AND M. G\"unther AND C. McCool AND S. Marcel},
    title = {Bob: a free signal processing and machine learning toolbox for researchers},
    year = {2012},
    month = oct,
    booktitle = {20th ACM Conference on Multimedia Systems (ACMMM), Nara, Japan},
    publisher = {ACM Press},
}If you wish to report problems or improvements concerning this code, please
contact the authors of the above mentioned papers.Raw dataThe data used in the paper is results obtained by two other satellite packages:antispoofing.motionandantispoofing.lbp. These packages should be downloaded, installed and runpriorto using the programs described in this package. Visitthe antispoofing.motionandthe antispoofing.lbppages for more information about how to use them.Of course, the package can be used for any other kind of scores that are saved in the same format as the two mentioned above.InstallationNoteIf you are reading this page through our GitHub portal and not through PyPI,
notethe development tip of the package may not be stableor become
unstable in a matter of moments.Go tohttp://pypi.python.org/pypi/antispoofing.fusionto download the latest
stable version of this package. Then, extract the .zip file to a folder of your choice.Theantispoofing.fusionpackage is a satellite package of the free signal processing and machine learning libraryBob. This dependency has to be downloaded manually. This version of the package depends onBobversion 2 or greater. To installpackages of Bob, please read theInstallation Instructions. ForBobto be able to work properly, some dependent Bob packages are required to be installed. Please make sure that you have read the Dependencies for your operating system.The most simple solution is to download and extractantispoofing.fusionpackage, then to go to the console and write:$ cd antispoofing.fusion
$ python bootstrap-buildout.py
$ bin/buildoutThis will download all required dependentBoband other packages and install them locally.User GuideIt is assumed that you have followed the installation instructions for this package and got it installed. Furthermore, we assume that you have installed the two related packages and produced output scores for each frame using boththe antispoofing.motionandthe antispoofing.lbppackages and that these scores sit on the directory./scores/. If not, please create symbolic links to this directory.Finding Valid Output ScoresThe previously generated outputs do not contain a valid score for each video frame. The motion based countermeasure needs 20 video frames for analyzing the motion correlation between the face and the background, i.e. the method cannot produce scores for the first 19 frames. On the other hand, the LBP based countermeasure is able to produce an valid output score when a face is successfully detected and the face size is above 50x50 pixels.Therefore, the frames, in which the both countermeasures have valid score (i.e. not NaN value), must be found before performing the fusion at score level. This process is performed using the script./bin/find_valid_frames.pyand by giving the locations of all used output scores, e.g.:$ ./bin/find_valid_frames.py -s scores/motion_lda scores/lbp_lda -e replayCombining the Valid Output ScoresThe scriptfuse_scores.pyperforms the fusion of the any countermeasures at score level using some of the two different methods: sum of scores or logistic linear regression (LLR) with the selected score normalization scheme: minmax, zscore or without any normalization, e.g.:$ ./bin/fuse_scores.py -s scores/motion_lda scores/lbp_lda -f SUM -n ZNorm -o scores/lda_sum_z
$ ./bin/fuse_scores.py -s scores/motion_lda scores/lbp_lda -f LLR -n None -o scores/lda_llr_rawAnalyzing the Results of Fusion at Frame-levelThe performance of the individual countermeasures and their fusion can be dumped in to a file./results/frame_based/results.txtusing the scriptframe_by_frame_analysis.py:$ ./bin/frame_by_frame_analysis.py -s scores/motion_lda scores/lbp_lda -f scores/lda_sum_z scores/lda_llr_raw -e replayTheresults.txtshows the performance of each method at frame-level.Running the Time AnalysisThe time analysis is the end of the processing chain, it fuses the scores of instantaneous scores for each method to give out a better estimation of attacks and real-accesses. To use it:$ ./bin/time_analysis.py -s scores/motion_lda scores/lbp_lda -f scores/lda_sum_z scores/lda_llr_raw -e replayThe time evolution for each method can be found in directory./results/evolution/. The folder also contains a PDF file in which you can find all methods in same figure.Mutual Error AnalysisThe scriptvenn.pyperforms mutual error analysis on the given countermeasures and outputs the results into a file./results/Venn&scatter/Venn.txt:$ ./bin/venn.py -s scores/motion_lda scores/lbp_lda -e replayProblemsIn case of problems, please contact any of the authors of the paper.