# PyEER
**PyEER** is a python package intended for biometric systems performance evaluation but it can be used to evaluate binary
classification systems also. It has been developed with the idea of providing researchers and the scientific community in
general with a tool to correctly evaluate and report the performance of their systems.
Within this package, two command line programs are provided:
* **geteerinf:** Useful to evaluate biometrics systems in verification scenarios as well as binary classification systems.
* **getcmcinf:** Useful to evaluate biometrics systems in identification scenarios.
Utilities provided within this package can also be used to develop other scripts by importing the module **pyeer**.
## Installing
To install the **PyEER** package you only need to type into a terminal the following line:
pip install pyeer
## Usage
Using **PyEER** is very easy and straightforward. Don't you believe? Let's see if we can convince you.
### geteerinf
When evaluating biometric systems in verification scenarios some researchers will only report Equal Error Rate (EER) values
to show the accuracy of their proposals. However, this is wrong. The behavior of biometric systems cannot be fully assessed in this way. In other to achieve that, Receiver Operating Characteristic (ROC) or Detection Error Tradeoff (DET) graph must
be reported. It is also very common to report other operating points besides EER (i.e. MR100, FMR1000, ZeroFMR, and ZeroFNMR).
**geteerinf** provides these and more. You will only need to provide genuine match scores and impostor match scores [1]. Genuine
match scores are obtained by matching feature sets of the same class (same person), while impostor matching scores are obtained
by matching feature sets of different classes (different persons).
#### Input file formats
Genuine match scores and impostor match scores must be provided in separated files one score per line. Each line can have any
number of columns but the scores must be in the last column. Additionally, impostor match scores can be provided in a different
format which explained next
###### Histogram format
Although the vast majority of the systems report scores normalized between 0 and 1, there are some that
report integer scores [3]. When computing a lot of impostor scores, millions of them, it can be computationally expensive to read
all those scores from a file. Therefore, in those cases may be worth it to use this format.
Restrictions: Only integer scores are supported
File format: Each line contains the number of scores equals to the index of the line in the file (starting from zero).
Recommendations: Use this format for very large experiments (millions of scores).
If you have any doubts left, you should check the example files on [GitHub](https://github.com/manuelaguadomtz/pyeer/tree/master/pyeer/example_files).
#### Usage examples
##### To print the help
geteerinf -h
##### One experiment (Non-histogram format):
geteerinf -p "example_files/non_hist/" -i "exp3_false.txt" -g "exp3_true.txt" -e "exp3"
##### More than one experiment (Non-histogram format):
geteerinf -p "example_files/non_hist/" -i "exp1_false.txt,exp2_false.txt" -g "exp1_true.txt,exp2_true.txt" -e "exp1,exp2"
##### One experiment (Histogram format):
geteerinf -p "example_files/hist/" -i "exp1_false.txt" -g "exp1_true.txt" -e "exp1" -ht
#### Output
All of the above examples will generate the following information:
* Graphs:
* Receiver operating characteristic (ROC)
* Detection error tradeoff (DET)
* False Match Rate (FMR) and False Non-Match Rate(FNMR)
* Genuine and impostor score histograms
* pyeer_report.csv:
* Genuine scores mean
* Genuine sores standard deviation
* Impostor scores mean
* Impostor sores standard deviation
* Sensitivity index (d') (See [NICE:II](http://nice2.di.ubi.pt/) protocol evaluation)
* Equal Error Rate (EER) (EER values are reported as specified in [2]).
* Area under the ROC curve
* Youden's J statistic (Youden's Index)
* Youden's Index threshold
* Matthews Correlation Coefficient (MCC)
* Matthews Correlation Coefficient threshold
* Equal Error Rate (EER) (EER values are reported as specified in [2]).
* ZeroFMR, FMR1000, FMR100, FMR20, FMR10, and ZeroFNMR
* Equal Error Rate threshold
* ZeroFMR, FMR1000, FMR100, FMR20, FMR10, and ZeroFNMR thresholds
* rates.csv:
* False Match Rates
* False Non-Match Rates
#### To use from your own scripts
from pyeer.eer_info import get_eer_stats
from pyeer.report import generate_eer_report, export_error_rates
from pyeer.plot import plot_eer_stats
# Calculating stats for classifier A
stats_a = get_eer_stats(gscores_a, iscores_a)
# Calculating stats for classifier B
stats_b = get_eer_stats(gscores_b, iscores_b)
# Generating CSV report
generate_eer_report([stats_a, stats_b], ['A', 'B'], 'pyeer_report.csv')
# Generating HTML report
generate_eer_report([stats_a, stats_b], ['A', 'B'], 'pyeer_report.html')
# Generating Latex report
generate_eer_report([stats_a, stats_b], ['A', 'B'], 'pyeer_report.tex')
# Generating JSON report
generate_eer_report([stats_a, stats_b], ['A', 'B'], 'pyeer_report.json')
# Exporting error rates (Exporting FMR and FNMR to a CSV file)
# This is the DET curve, the ROC curve is a plot of FMR against 1 - FNMR
export_error_rates(stats_a.fmr, stats_a.fnmr, 'A_DET.csv')
export_error_rates(stats_b.fmr, stats_b.fnmr, 'B_DET.csv')
# Plotting
plot_eer_stats([stats_a, stats_b], ['A', 'B'])
### getcmcinf
In identification experiments in closed sets sometimes only rank values are reported [1]. To obtain rank values and the Cumulative match curve (CMC) **getcmcinf** is provided. It receives the match scores and genuine correspondences. The input format will be described
next.
#### Input files format
Input files must have the following formats:
* **Match scores:** Each line must have the following format: (query template score)
* **Genuine query-template pairs:** Each line must have the following format: (query corresponding_template)
For more clarification, you should check the example files on [GitHub](https://github.com/manuelaguadomtz/pyeer/tree/master/pyeer/example_files).
#### Usage examples
##### To print the script help
getcmcinf -h
##### One experiment
getcmcinf -p "example_files/cmc/" -ms "exp1_scores.txt" -t "exp1_tp.txt" -e "Exp1"
##### More than one experiment
getcmcinf -p "example_files/cmc/" -ms "exp1_scores.txt,exp2_scores.txt" -t "exp1_tp.txt,exp2_tp.txt" -e "Exp1,Exp2"
#### Output
All of the above examples will generate the following information:
* Graphs:
* Cumulative match curve (CMC)
* pyeer_report.csv:
* Rank identification rates
#### To use from your own scripts
from pyeer.cmc_stats import load_scores_from_file, get_cmc_curve, CMCstats
from pyeer.report import generate_cmc_report
from pyeer.plot import plot_cmc_stats
# CMC maximum rank
r = 20
# Loading scores
sfile = 'cmc/exp1_scores.txt' # The scores file
tp_file = 'cmc/exp1_tp.txt' # The genuine pairs relationship in "sfile"
scores = load_scores_from_file(sfile, tp_file)
# Calculating CMC curve
ranks = get_cmc_curve(scores, r)
# Creating stats
stats = [CMCstats(exp_id='A', ranks=ranks)]
# Generating CSV report
generate_cmc_report(stats, r, 'pyeer_report.csv')
# Generating HTML report
generate_cmc_report(stats, r, 'pyeer_report.html')
# Generating Latex report
generate_cmc_report(stats, r, 'pyeer_report.tex')
# Generating Latex report
generate_cmc_report(stats, r, 'pyeer_report.json')
# Plotting
plot_cmc_stats(stats, r)
## Contributing
Do you find **PyEER** useful? You can collaborate with us:
[GitHub](https://github.com/manuelaguadomtz/pyeer>)
Please follow our contributing guidelines.
### Contributors
We would like to thanks to those who has collaborated with the project:
* [ljsoler](https://github.com/ljsoler)
* Added support in CMC stats for multiple templates for a single query
* [jpalancar](https://github.com/jpalancar)
* Testing and guidance
## References
[1] D. Maltoni et al., Handbook of Fingerprint Recognition, Springer-Verlag London Limited 2009
[2] Maio D., Maltoni D., Cappelli R., Wayman J.L., and Jain A.K., "FVC2000: Fingerprint verification
competition,"" IEEE Transactions on Pattern Analysis Machine Intelligence, vol. 24, no. 3, pp. 402–412,
2002
[3] Hernandez-Palancar, J., Munoz-Briseno, A., & Gago-Alonso, A. (2014). Using a triangular matching
approach for latent fingerprint and palmprint identification. International Journal of Pattern
Recognition and Artificial Intelligence, 28, 1460004.
Raw data
{
"_id": null,
"home_page": "https://github.com/manuelaguadomtz/pyeer",
"name": "pyeer",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Equal Error Rate,False Match Rate,ROC,DET,False Non-Match Rate,EER,FMR,FNMR,ZeroFNMR,ZeroFMR,CMC,Biometric Systems",
"author": "Manuel Aguado Mart\u00ednez",
"author_email": "manuelaguadomtz@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8a/18/f5a4973dd5311abcdb3b841a07179f9908a2cdc83a29e24a51d2a9b3d5f6/pyeer-0.5.6.tar.gz",
"platform": null,
"description": "# PyEER\n\n**PyEER** is a python package intended for biometric systems performance evaluation but it can be used to evaluate binary\nclassification systems also. It has been developed with the idea of providing researchers and the scientific community in\ngeneral with a tool to correctly evaluate and report the performance of their systems.\n\nWithin this package, two command line programs are provided:\n\n* **geteerinf:** Useful to evaluate biometrics systems in verification scenarios as well as binary classification systems.\n\n* **getcmcinf:** Useful to evaluate biometrics systems in identification scenarios.\n\nUtilities provided within this package can also be used to develop other scripts by importing the module **pyeer**.\n\n## Installing\n\nTo install the **PyEER** package you only need to type into a terminal the following line:\n\n pip install pyeer\n\n## Usage\n\nUsing **PyEER** is very easy and straightforward. Don't you believe? Let's see if we can convince you.\n\n### geteerinf\n\nWhen evaluating biometric systems in verification scenarios some researchers will only report Equal Error Rate (EER) values\nto show the accuracy of their proposals. However, this is wrong. The behavior of biometric systems cannot be fully assessed in this way. In other to achieve that, Receiver Operating Characteristic (ROC) or Detection Error Tradeoff (DET) graph must\nbe reported. It is also very common to report other operating points besides EER (i.e. MR100, FMR1000, ZeroFMR, and ZeroFNMR).\n**geteerinf** provides these and more. You will only need to provide genuine match scores and impostor match scores [1]. Genuine\nmatch scores are obtained by matching feature sets of the same class (same person), while impostor matching scores are obtained\nby matching feature sets of different classes (different persons).\n\n#### Input file formats\n\nGenuine match scores and impostor match scores must be provided in separated files one score per line. Each line can have any\nnumber of columns but the scores must be in the last column. Additionally, impostor match scores can be provided in a different\nformat which explained next\n\n###### Histogram format \n\nAlthough the vast majority of the systems report scores normalized between 0 and 1, there are some that\nreport integer scores [3]. When computing a lot of impostor scores, millions of them, it can be computationally expensive to read\nall those scores from a file. Therefore, in those cases may be worth it to use this format.\n\nRestrictions: Only integer scores are supported\n\nFile format: Each line contains the number of scores equals to the index of the line in the file (starting from zero).\n\nRecommendations: Use this format for very large experiments (millions of scores).\n\nIf you have any doubts left, you should check the example files on [GitHub](https://github.com/manuelaguadomtz/pyeer/tree/master/pyeer/example_files).\n\n#### Usage examples\n\n##### To print the help\n\n geteerinf -h\n\n##### One experiment (Non-histogram format):\n\n geteerinf -p \"example_files/non_hist/\" -i \"exp3_false.txt\" -g \"exp3_true.txt\" -e \"exp3\"\n\n##### More than one experiment (Non-histogram format):\n\n geteerinf -p \"example_files/non_hist/\" -i \"exp1_false.txt,exp2_false.txt\" -g \"exp1_true.txt,exp2_true.txt\" -e \"exp1,exp2\"\n\n##### One experiment (Histogram format):\n\n geteerinf -p \"example_files/hist/\" -i \"exp1_false.txt\" -g \"exp1_true.txt\" -e \"exp1\" -ht\n\n#### Output\n\nAll of the above examples will generate the following information:\n\n* Graphs: \n * Receiver operating characteristic (ROC)\n * Detection error tradeoff (DET)\n * False Match Rate (FMR) and False Non-Match Rate(FNMR)\n * Genuine and impostor score histograms\n* pyeer_report.csv: \n * Genuine scores mean\n * Genuine sores standard deviation\n * Impostor scores mean\n * Impostor sores standard deviation\n * Sensitivity index (d') (See [NICE:II](http://nice2.di.ubi.pt/) protocol evaluation)\n * Equal Error Rate (EER) (EER values are reported as specified in [2]).\n * Area under the ROC curve\n * Youden's J statistic (Youden's Index)\n * Youden's Index threshold\n * Matthews Correlation Coefficient (MCC)\n * Matthews Correlation Coefficient threshold\n * Equal Error Rate (EER) (EER values are reported as specified in [2]).\n * ZeroFMR, FMR1000, FMR100, FMR20, FMR10, and ZeroFNMR\n * Equal Error Rate threshold\n * ZeroFMR, FMR1000, FMR100, FMR20, FMR10, and ZeroFNMR thresholds\n* rates.csv:\n * False Match Rates\n * False Non-Match Rates\n\n#### To use from your own scripts\n\n from pyeer.eer_info import get_eer_stats\n from pyeer.report import generate_eer_report, export_error_rates\n from pyeer.plot import plot_eer_stats\n\n # Calculating stats for classifier A\n stats_a = get_eer_stats(gscores_a, iscores_a)\n\n # Calculating stats for classifier B\n stats_b = get_eer_stats(gscores_b, iscores_b)\n\n # Generating CSV report\n generate_eer_report([stats_a, stats_b], ['A', 'B'], 'pyeer_report.csv')\n\n # Generating HTML report\n generate_eer_report([stats_a, stats_b], ['A', 'B'], 'pyeer_report.html')\n\n # Generating Latex report\n generate_eer_report([stats_a, stats_b], ['A', 'B'], 'pyeer_report.tex')\n\n # Generating JSON report\n generate_eer_report([stats_a, stats_b], ['A', 'B'], 'pyeer_report.json')\n\n # Exporting error rates (Exporting FMR and FNMR to a CSV file)\n # This is the DET curve, the ROC curve is a plot of FMR against 1 - FNMR\n export_error_rates(stats_a.fmr, stats_a.fnmr, 'A_DET.csv')\n export_error_rates(stats_b.fmr, stats_b.fnmr, 'B_DET.csv')\n\n # Plotting\n plot_eer_stats([stats_a, stats_b], ['A', 'B'])\n\n### getcmcinf\n\nIn identification experiments in closed sets sometimes only rank values are reported [1]. To obtain rank values and the Cumulative match curve (CMC) **getcmcinf** is provided. It receives the match scores and genuine correspondences. The input format will be described\nnext.\n\n#### Input files format\n\nInput files must have the following formats:\n\n* **Match scores:** Each line must have the following format: (query template score)\n\n* **Genuine query-template pairs:** Each line must have the following format: (query corresponding_template)\n\nFor more clarification, you should check the example files on [GitHub](https://github.com/manuelaguadomtz/pyeer/tree/master/pyeer/example_files).\n\n#### Usage examples\n\n##### To print the script help\n\n getcmcinf -h\n\n##### One experiment\n\n getcmcinf -p \"example_files/cmc/\" -ms \"exp1_scores.txt\" -t \"exp1_tp.txt\" -e \"Exp1\"\n\n##### More than one experiment\n\n getcmcinf -p \"example_files/cmc/\" -ms \"exp1_scores.txt,exp2_scores.txt\" -t \"exp1_tp.txt,exp2_tp.txt\" -e \"Exp1,Exp2\"\n\n\n#### Output\n\nAll of the above examples will generate the following information:\n\n* Graphs: \n * Cumulative match curve (CMC)\n \n* pyeer_report.csv: \n * Rank identification rates\n\n#### To use from your own scripts\n\n from pyeer.cmc_stats import load_scores_from_file, get_cmc_curve, CMCstats\n from pyeer.report import generate_cmc_report\n from pyeer.plot import plot_cmc_stats\n\n # CMC maximum rank\n r = 20\n\n # Loading scores\n sfile = 'cmc/exp1_scores.txt' # The scores file\n tp_file = 'cmc/exp1_tp.txt' # The genuine pairs relationship in \"sfile\"\n scores = load_scores_from_file(sfile, tp_file)\n\n # Calculating CMC curve\n ranks = get_cmc_curve(scores, r)\n\n # Creating stats\n stats = [CMCstats(exp_id='A', ranks=ranks)]\n\n # Generating CSV report\n generate_cmc_report(stats, r, 'pyeer_report.csv')\n\n # Generating HTML report\n generate_cmc_report(stats, r, 'pyeer_report.html')\n\n # Generating Latex report\n generate_cmc_report(stats, r, 'pyeer_report.tex')\n\n # Generating Latex report\n generate_cmc_report(stats, r, 'pyeer_report.json')\n\n # Plotting\n plot_cmc_stats(stats, r)\n\n\n## Contributing\n\nDo you find **PyEER** useful? You can collaborate with us:\n\n[GitHub](https://github.com/manuelaguadomtz/pyeer>)\n\nPlease follow our contributing guidelines.\n\n### Contributors\n\nWe would like to thanks to those who has collaborated with the project:\n\n* [ljsoler](https://github.com/ljsoler)\n * Added support in CMC stats for multiple templates for a single query\n* [jpalancar](https://github.com/jpalancar)\n * Testing and guidance\n\n\n## References\n\n[1] D. Maltoni et al., Handbook of Fingerprint Recognition, Springer-Verlag London Limited 2009\n\n[2] Maio D., Maltoni D., Cappelli R., Wayman J.L., and Jain A.K., \"FVC2000: Fingerprint verification\ncompetition,\"\" IEEE Transactions on Pattern Analysis Machine Intelligence, vol. 24, no. 3, pp. 402\u2013412,\n2002\n\n[3] Hernandez-Palancar, J., Munoz-Briseno, A., & Gago-Alonso, A. (2014). Using a triangular matching\napproach for latent fingerprint and palmprint identification. International Journal of Pattern \nRecognition and Artificial Intelligence, 28, 1460004.\n\n",
"bugtrack_url": null,
"license": "",
"summary": "A python package for biometric and binary classification systems performance evaluation",
"version": "0.5.6",
"project_urls": {
"Homepage": "https://github.com/manuelaguadomtz/pyeer"
},
"split_keywords": [
"equal error rate",
"false match rate",
"roc",
"det",
"false non-match rate",
"eer",
"fmr",
"fnmr",
"zerofnmr",
"zerofmr",
"cmc",
"biometric systems"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8a18f5a4973dd5311abcdb3b841a07179f9908a2cdc83a29e24a51d2a9b3d5f6",
"md5": "ebb45b4f585b1e0724d43d766784eeb7",
"sha256": "58b5041abac56133d047b878d032a82faa8f8b7fecdc404b4a62089dbaf919f9"
},
"downloads": -1,
"filename": "pyeer-0.5.6.tar.gz",
"has_sig": false,
"md5_digest": "ebb45b4f585b1e0724d43d766784eeb7",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 607099,
"upload_time": "2023-12-16T17:50:59",
"upload_time_iso_8601": "2023-12-16T17:50:59.727741Z",
"url": "https://files.pythonhosted.org/packages/8a/18/f5a4973dd5311abcdb3b841a07179f9908a2cdc83a29e24a51d2a9b3d5f6/pyeer-0.5.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-16 17:50:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "manuelaguadomtz",
"github_project": "pyeer",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyeer"
}