AmanPay authenticates users for secure digital payments by fusing face and fingerprint biometrics, with built-in liveness / anti-spoofing (PAD) detection that visibly rejects fake biometrics.
Hackathon demo. Ships with ImageNet-pretrained backbones and untrained biometric heads so the full pipeline runs end-to-end out of the box; train the encoders on real data for production-grade accuracy.
| Stage | Component |
|---|---|
| Face | MTCNN alignment → MobileNetV3-Large → 512-d embedding + liveness head |
| Fingerprint | CLAHE enhancement → MobileNetV3-Large + minutiae attention → 512-d embedding + PAD head |
| Fusion | Cross-modal attention → unified 512-d template (early / late / transformer also available) |
| Decision | Cosine similarity vs. enrolled template, gated by liveness/PAD thresholds |
pip install -r requirements.txt # or: conda env create -f environment.yml
pip install -e .import torch
from amanpay.config import AmanPayConfig
from amanpay.models.authenticator import AmanPayAuthenticator
auth = AmanPayAuthenticator(AmanPayConfig()).eval()
face, fp = torch.randn(1, 3, 224, 224), torch.randn(1, 3, 224, 224)
auth.enroll("alice", face, fp)
print(auth.authenticate("alice", face, fp))uvicorn api.main:app --host 0.0.0.0 --port 8000
# Docs at http://localhost:8000/docsEndpoints: GET /health, POST /enroll, POST /authenticate, POST /verify,
GET /users, DELETE /users/{user_id}. Images are sent base64-encoded.
python demo/app.py # Gradio UI at http://localhost:7860python scripts/train_face.py --config configs/base.yaml --data_root data/faces
python scripts/train_fingerprint.py --config configs/base.yaml --data_root data/fingerprints
python scripts/train_fusion.py --config configs/base.yaml \
--face_ckpt checkpoints/face_encoder_best.pt \
--fp_ckpt checkpoints/fingerprint_encoder_best.pt
python scripts/evaluate.py --config configs/base.yaml --output report.mdDatasets follow an ImageFolder layout (data/faces/<identity>/*.png); see
scripts/download_data.sh.
pytest tests/ -v --cov=amanpaypodman build -t amanpay .
podman run -p 8000:8000 amanpay # REST API
podman run -p 7860:7860 amanpay python demo/app.py # Demo UI
# or: podman-compose upamanpay/evaluation/metrics.py implements EER, TAR@FAR, DET curves, and PAD
rates (BPCER / APCER / ACER) following ISO/IEC 30107-3 conventions.
In scope: face encoder, fingerprint encoder, fusion, liveness/PAD, REST API, demo UI. Out of scope (roadmap): federated learning, blockchain/ZKP, temporal GNN fraud detection.