This repository makes available the PyPAD toolkit for evaluating a Presentation Attack Detection for ID Cards based on the paper: "Forged presentation attack detection for ID cards on remote verification systems" by Sebastian Gonzalez and Juan E. Tapia.
This paper developed an end-to-end Presentation Attack Detection system for a remote biometric ID Cards system based on MobileNetV2 and an updated concatenate approach applied to Chilean ID Cards. Several composite scenarios based on cropped and splice areas and different capture sources are used, including bona fide and presentation attack species such as printed, display, composite, plastic (PVC), and synthetic ID card images. This proposal was developed using a database consisting of 190.000 real case images with the support of a third-party company. Also, a new framework called PyPAD was developed to estimate multi-class metrics that are compliant with the ISO/IEC 30107-3 standard and will be made available for research purposes. Our method was trained on the source and border convolutional neural networks separately. Border can reach BPCER100 1.69%, and Source reached 2.36% BPCER100 on ID Cards attacks. A two-stage concatenate model attack using a border and source networks together can reach 0.92% of BPCER100.
The PyPAD toolkit has the following features:
- It is fully compliant with ISO 30107-3 and configurable to choose and estimate results based on different thresholds.
- It is able to calculate metrics for binary and multi-class PAD systems.
- It can plot DET curves containing all the presentation attack species for comparison. The plot depicts the two operational points typically reported, BPCER10 and BPCER20, with values highlighted.
- An EER plot is automatically created, which can help us understand the relation between BPCER, APCER, and system thresholds.
- Kernel Distribution Estimation (KDE) plots are reported using a linear and a log scale to highlight details and thresholds.
- Configurable confusion matrices for multi-class problems and different thresholds.
- A summary report is automatically generated describing different operational points (BPCER, APCER).
- Download or build (see instructions below) the .whl PyPAD file (pip install -e PyPAD)
- Go to your project's virtual environment and install with pip:
pip install pypad-23.10.1-py3-none-any.whl- If you are using conda, first install pip inside your conda environment:
conda install pip, then install the .whl package
- If you are using conda, first install pip inside your conda environment:
- Use inside your project as follows:
from pypad.metrics.iso_30107_3 import apcer, and call the function asapcer(...)
- Install "build" inside your environment using pip:
pip install build - Then build the package:
python -m build - The package will be available inside the
distfolder
- You can find an example of some functions of this library at
example/pypad.ipynb. Running this on yout system will require Jupyter Lab. - The following packages are included as dependencies and will be installed if not already present on your environment:
scipy,sklearn,matplotlib,seaborn, andpandas.
Title = {Forged presentation attack detection for ID cards on remote verification systems},
journal = {Pattern Recognition},
pages = {111352},
year = {2025},
issn = {0031-3203},
doi = {https://doi.org/10.1016/j.patcog.2025.111352},
url = {https://www.sciencedirect.com/science/article/pii/S0031320325000123},
author = {Sebastian Gonzalez and Juan E. Tapia},
}
This toolkit is only for research purposes. For any commercial use, please contact juan.tapia-farias@h-da.de.
Add MAD metrics.
