This repository presents a lightweight face anti-spoofing solution using the MiniFASNetV2SE architecture, achieving ~98% validation accuracy. It provides a training pipeline, pretrained weights, and ONNX export capabilities, making it ideal for applications requiring robust facial recognition while ensuring security against spoofing attempts.
The face-antispoof-onnx repository features a lightweight and efficient face anti-spoofing model built on the MiniFASNetV2SE architecture. This model effectively distinguishes between genuine faces and various spoofing attacks, such as printed photographs and displayed images. Achieving approximately 98% validation accuracy on a dataset of more than 70,000 samples, this project is designed for applications requiring robust biometric security.
The model demonstrates excellent precision and performance metrics, validated against the CelebA Spoof benchmark:
| Metric | Model | Quantized |
|---|---|---|
| Overall Accuracy | 97.80% | 97.80% |
| Real Accuracy | 98.16% | 98.14% |
| Spoof Accuracy | 97.50% | 97.52% |
| ROC-AUC | 0.9978 | 0.9978 |
| Average Precision | 0.9981 | 0.9981 |
This high precision (>99%) at operational thresholds significantly reduces the chances of false biometric access, making it suitable for secure applications.
Pre-trained models are included in the models/ directory:
Compared to its predecessor (MobileNetV4), the MiniFAS architecture offers:
To run the demo for webcam input or to test a single image, the following command can be utilized:
python demo.py --camera [index] # For webcam
python demo.py --image path/to/face.jpg # For image input
This model is integrated into advanced systems such as SURI, a sophisticated AI attendance solution.
The repository encompasses the following components:
├── src/ # Source code for MiniFAS
├── scripts/ # Tools for training and exporting models
├── docs/ # Technical documentation
├── models/ # Pre-trained models
└── demo.py # Inference demo script
The model operates optimally when applied to well-lit, frontal facial images. Detailed conditions and best practices can be reviewed in the repository's documentation on limitations.
The face-antispoof-onnx repository serves as an essential resource for developers and researchers looking to implement advanced face anti-spoofing solutions in their applications.
No comments yet.
Sign in to be the first to comment.