Skip to main content
COMPUTER VISION & BIOMETRICSSTATUS: WORKING APPLICATION

AttendAI — Biometric Face Recognition & Attendance Engine

Local-first facial recognition and attendance platform built with InsightFace buffalo_l (SCRFD + ArcFace 512-D), ONNX Runtime, FAISS, and FastAPI.

Current Implementation Status: Complete InsightFace buffalo_l + FAISS + FastAPI biometric attendance codebase with local enrollment, camera worker, and automated tests; ready for site-specific pilot calibration.

AttendAI InsightFace and FAISS local biometric face recognition attendance system

Industry Context & Problem Statement

Industrial facilities, farms, schools, and enterprise offices frequently encounter high failure rates with contact fingerprint scanners (soiled or worn fingerprints, mechanical sensor failures) and proxy check-ins with shareable RFID cards.

Contact-based attendance hardware slows down shift changes and breaks down in dusty industrial or agricultural environments, while cloud-only facial recognition SaaS incurs recurring per-user fees and stalls when internet links drop.

Proposed Solution & Technical Challenge

CASDO Technologies built AttendAI as a self-hosted, local-first facial biometric engine. Using InsightFace buffalo_l (SCRFD detection + ArcFace 512-D embeddings), FAISS vector indexing, and a FastAPI + SQLAlchemy backend, AttendAI enrolls personnel with multi-angle augmentation, matches faces from live camera feeds locally, and logs attendance events without cloud dependency.

Core Architectural Challenge

Building a thread-safe, low-latency facial enrollment and multi-face recognition pipeline that extracts strictly L2-normalized 512-dimensional embeddings, performs fast cosine similarity search locally via FAISS, gracefully switches between CUDA GPU and CPU execution providers, and persists attendance records through a structured REST API.

SYSTEM ARCHITECTURE

Architecture Breakdown

  • Thread-Safe FaceEngine: Lock-synchronized InsightFace buffalo_l pipeline running SCRFD detection (det_size=640x640, det_thresh=0.4) and ArcFace 512-D feature extraction.
  • FAISS Similarity Index: Local vector index executing fast cosine similarity lookups against L2-normalized employee embedding templates.
  • Enrollment Augmentation: Albumentations-powered enrollment pipeline improving robustness across varied pose angles and ambient lighting.
  • Backend API & Database: FastAPI REST endpoints with SQLAlchemy 2.0 models, Pydantic schemas, and automated unit tests.
VERIFIED STACK

Implemented Technology Stack

  • Face Detection & Recognition: InsightFace buffalo_l pack (SCRFD face detector + ArcFace 512-D recognition encoder) with strict L2 vector normalization
  • Execution & Vector Search: ONNX Runtime (CUDAExecutionProvider with automatic CPUExecutionProvider fallback) and FAISS-CPU inner-product cosine similarity index
  • Computer Vision & Augmentation: OpenCV, Albumentations enrollment augmentation, NumPy, SciPy
  • Backend & Persistence: FastAPI, Uvicorn, SQLAlchemy 2.0, Pydantic v2, structured CRUD and automated test suite
InsightFace (buffalo_l)ArcFace 512-DFAISSONNX RuntimeOpenCVAlbumentationsFastAPISQLAlchemy 2.0
EXECUTION METHODOLOGY

Implementation Methodology

  1. Implemented core computer vision module (face_engine.py, camera.py, augmentation.py, enroll_user.py, attendance_worker.py) with strict thread safety.
  2. Paired CV workers with a modular FastAPI + SQLAlchemy backend (app.py, crud.py, models.py, schemas.py, database.py).
  3. Added resilient CPU fallback and mock-face test harnesses so automated pytest validation runs cleanly in non-GPU environments.
TRADE-OFFS & RATIONALE

Key Engineering Decisions

  • Chose ONNX Runtime with ordered provider fallback (CUDA -> CPU) to avoid hard NVIDIA driver lock-in on budget office deployments.
  • Used strict L2 vector normalization with FAISS inner-product search so threshold tuning remains mathematically consistent as employee registries grow.

Measured & Verified Outcomes

  • Engineered complete enrollment (enroll_user.py), thread-safe FaceEngine wrapper, real-time camera worker (attendance_worker.py), and FastAPI/SQLAlchemy backend.
  • Enforced strict L2 normalization (||v||_2 = 1.0) on all 512-D ArcFace embeddings so FAISS inner-product lookups compute exact cosine similarity in milliseconds.
  • Built resilient hardware fallback (CUDA GPU -> CPU ONNX Runtime -> mock test mode) enabling CI testing and deployment on both GPU workstations and standard edge PCs.
  • Stored mathematical facial embeddings rather than relying on cloud biometric APIs, preserving local organizational data sovereignty.

Known Limitations & Scope Boundaries

  • •Real-world false-accept / false-reject rates (FAR/FRR) and throughput latency depend on camera resolution, mounting angle, lighting uniformity, and GPU vs. CPU hardware; site-specific calibration is performed during pilot onboarding.
  • •High-security physical access control (beyond standard workplace attendance) requires dedicated infrared/depth anti-spoofing cameras rather than single-lens RGB webcams.

Planned Roadmap Extensions

  • → Integrating dedicated NIR/depth liveness camera modules for high-security turnstile access.
  • → Direct payroll and ERP webhook synchronization across multi-branch campuses.