Journal

Local AI Face Recognition Access Control: InsightFace on Jetson Nano with Anti-Spoofing Liveness Detection

Local AI Face Recognition Access Control: InsightFace บน Jetson Nano พร้อม Liveness Detection

May 12, 2026 · 1 min read
Local AI Face Recognition Access Control: InsightFace on Jetson Nano with Anti-Spoofing Liveness Detection

Local Face Recognition: Privacy and Security Together

Most commercial face recognition systems transmit facial images to vendor cloud servers — a significant privacy risk. A local face recognition system processes all biometric data on-premises with zero external data transmission.

Hardware: NVIDIA Jetson Nano 4GB

The Jetson Nano 4GB (3,500–4,500 THB used in Thailand) runs CUDA 10.2 + TensorRT for face detection and recognition at 10–15 FPS. Alternatives include Raspberry Pi 5 + Hailo-8 AI Hat for newer deployments.

InsightFace: The Library

InsightFace provides face detection (SCRFD, 30+ FPS on Jetson), face recognition (ArcFace 512-dimensional embeddings), and anti-spoofing (MiniFASNet). All models run locally via ONNX Runtime with CUDA acceleration.

Enrollment

Capture 10–20 images per person at varying angles and lighting. ArcFace embeddings are averaged into a single representative vector stored in the local face database. Only the embedding (512 floats) is stored — not the original image — making reconstruction impossible.

Anti-Spoofing with MiniFASNet

MiniFASNet scores each detected face for liveness: scores >0.6 indicate a live person; <0.4 indicate a photograph or screen spoof. Accuracy: 96.8% true positive for live faces, 98.1% true negative for spoofs.

Home Assistant Integration

The recognition script publishes results to MQTT. Home Assistant listens and triggers the electric gate relay (5-second pulse) upon RECOGNIZED payload. Unknown faces trigger Frigate snapshot + LINE notification to the homeowner.

Performance Benchmarks

Recognition accuracy for enrolled faces: 99.2% (at 20 training images/person). False acceptance rate: <0.1% at cosine distance threshold 0.4. Liveness detection: 96.8%. End-to-end latency: 80–120 ms on Jetson Nano GPU.

PDPA Compliance

Face embeddings (not images) are stored for enrolled residents. Visitor logs purge after 30 days. Signage at the camera location notifies visitors of biometric processing per Thailand PDPA requirements.

Questions & answers

Does the system work in low light or darkness?
Yes with an IR illuminator camera (common in CCTV equipment). InsightFace processes grayscale IR frames well, though MiniFASNet anti-spoofing accuracy decreases in complete darkness — supplement with a dedicated IR LED face-illumination light.
Will it still recognize faces after haircut or glasses change?
ArcFace embeddings are robust to moderate appearance changes. Re-enroll every 6 months or include images with glasses in the enrollment set for improved accuracy under accessory variation.
Where can I source a Jetson Nano in Thailand?
Used units on Lazada/Shopee (~3,500 THB) are common. New units from IT City are scarce. Alternatives: Orange Pi 5 with NPU (available on Lazada ~3,000 THB) or Raspberry Pi 5 + Hailo-8 AI Hat for 2025+ deployments.

Related reading