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.

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.
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.
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
Implementation Methodology
- Implemented core computer vision module (face_engine.py, camera.py, augmentation.py, enroll_user.py, attendance_worker.py) with strict thread safety.
- Paired CV workers with a modular FastAPI + SQLAlchemy backend (app.py, crud.py, models.py, schemas.py, database.py).
- Added resilient CPU fallback and mock-face test harnesses so automated pytest validation runs cleanly in non-GPU environments.
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.
Related CASDO Engineering Services
Real-time object detection, multi-object tracking, facial vector biometrics, and specialized visual inspection engineered for local edge deployment.
Bespoke AI systems architected around your proprietary workflows, data sovereignty requirements, and deterministic safety boundaries.
Tailored multi-tenant platforms, domain-specific applications, and offline-resilient transactional backends engineered without rigid SaaS lock-in.
Applicable Industries
Edge computer vision inspection architectures, contactless biometric shift tracking, and secure OT-to-IT telemetry.
Audited double-entry ledgers, multi-year installment amortization systems, and human-verified financial workflow automation.
Geodesic farm digital twins, FAO-56 precision irrigation modeling, livestock computer vision, and BMS-standard plant breeding software.
Related Engineering Solutions
Explore purpose-built industry and capability architectures engineered by CASDO Technologies.
Edge AI Computer Vision for Agriculture & Livestock
Uniting Ultralytics YOLO11s cattle posture tracking, ByteTrack temporal smoothing, and WGS84 PostGIS farm digital twins for low-bandwidth field estates.
On-Premise Hospital EMR & Clinical AI R&D
Sovereign clinical record deployments engineered for uninterrupted local hospital networks alongside transparent, non-clinical medical imaging research prototypes.
Enterprise RAG, Private LLMs & Auditable AI Agents
Grounded document intelligence and bounded multi-step AI agents engineered with permission-aware retrieval, strict schema validation, and human approval queues.