Engineering a Cross-Platform Face Recognition Pipeline with Anti-Spoofing
I recently went down a rabbit hole after hearing how a major bankβs ATM face scanners were defeated by a literal piece of printer paper. Itβs a classic example of what happens when we build for the "happy path" instead of the real world.
If youβre building biometrics for something like employee clock-ins or secure access, you canβt just rely on a basic detection demo-you need a pipeline that actually knows the difference between a human and a photo. This article walks through building a cross-platform, offline-first face recognition system that handles everything from the initial camera frame to the final identity match.
Key Pipeline Features
- Runs lightweight AI models locally via ONNX, making it fast enough for mobile devices and tablets.
- Filters out noise by requiring a minimum detection confidence score of
0.7. - Cleans up overlapping boxes using Non-Maximum Suppression (NMS) at a
0.4IoU threshold. - Implements a dedicated anti-spoofing layer using a
112x112face crop and a 2-class softmax model. - Requires a spoof score of
0.1or lower to ensure the subject is a live person, not a printout or screen. - Generates 128-dimensional face signatures (embeddings) using FaceNet for high-precision matching.
- Uses HNSW indexing to search through thousands of stored faces in under
1ms. - Built with .NET MAUI to share the same processing logic across Android, Windows, and cloud environments.
The hard truth is that if your biometric system can be tricked by a $20 desk printer, your entire security model is just theater.
Read the full article here: https://erwinwilsonceniza.qzz.io/blogs/engineering-a-cross-platform-face-recognition-pipeline-with-anti-spoofing
Comments
No comments yet. Start the discussion.