Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MHHamdan/AmanPay

Repository files navigation

AmanPay — Multi-Modal Biometric Authentication

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.

Architecture

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

Install

pip install -r requirements.txt      # or: conda env create -f environment.yml
pip install -e .

Quick start

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))

Run the REST API

uvicorn api.main:app --host 0.0.0.0 --port 8000
# Docs at http://localhost:8000/docs

Endpoints: GET /health, POST /enroll, POST /authenticate, POST /verify, GET /users, DELETE /users/{user_id}. Images are sent base64-encoded.

Run the demo UI

python demo/app.py           # Gradio UI at http://localhost:7860

Train

python 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.md

Datasets follow an ImageFolder layout (data/faces/<identity>/*.png); see scripts/download_data.sh.

Test

pytest tests/ -v --cov=amanpay

Containers (Podman)

podman 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 up

Metrics

amanpay/evaluation/metrics.py implements EER, TAR@FAR, DET curves, and PAD rates (BPCER / APCER / ACER) following ISO/IEC 30107-3 conventions.

Scope

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.

About

AmanPay a multi-modal biometric authentication system for secure digital payments.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages