顔認識AI
03

Project 03 · 2024 · Harsh Yadav

FaceAttend.

顔認識型勤怠管理システム

A full-stack biometric attendance platform powered by deep learning. Employees check in and out using their face — no cards, no PINs, no proxies. Powered by ResNet-34 generating 128-dimensional face encodings with sub-second verification.

Year2024
RoleFull-Stack ML Eng.
BackendFastAPI + Motor
AI ModelResNet-34 (128D)
ResNet 34 layers · 128D vectors
Euclidean Distance Match
0.6 Login Tolerance
0.65 Check-in Tolerance
Architecture · アーキテクチャ FastAPI · ResNet-34 · MongoDB · React
128DFace vector size
0.6Login tolerance (strict)
MITLicense
No raw images stored
[01] How It Works

A face is a key. ResNet-34 is the lock.

FaceAttend uses ResNet-34 to generate compact 128-dimensional face embeddings. Registration captures a face image, encodes it to a vector, and stores it in MongoDB. Authentication computes a new embedding from a submitted face and finds the Euclidean distance to the stored vector.

Python FastAPI ResNet-34 face_recognition Motor MongoDB Atlas React 18 PyJWT
System Architecture · システム設計 顔認識パイプライン
┌─────────────────────────────────────────────────┐ │ CLIENT LAYER │ │ React Frontend ── Grafix Dashboard UI │ └──────────────┬──────────────────────────────────┘ │ HTTP / multipart/form-data ▼ ┌─────────────────────────────────────────────────┐ │ API GATEWAY (FastAPI + Uvicorn) │ │ JWT Auth Middleware | Pydantic Schemas │ └──────┬──────────────────────┬───────────────────┘ ▼ ▼ employer.py attendance.py employee.py /checkin /checkout │ │ └──────────┬───────────┘ ▼ ┌─────────────────────────────────────────────────┐ │ FACE RECOGNITION ENGINE │ │ PIL / OpenCV ──► Resize & Normalize │ │ face_locations() ──► Bounding Box Detection │ │ face_encodings() ──► ResNet-34 128D Vector │ │ compare_faces() ──► Euclidean Distance │ │ ✅ Match → JWT Issued | ❌ No Match → 401 │ └──────────────────────┬──────────────────────────┘ ▼ ┌─────────────────────────────────────────────────┐ │ DATA LAYER (Motor + MongoDB Atlas) │ │ employers {} employees {} attendance {} │ │ face_encoding: [128D float vector] │ └─────────────────────────────────────────────────┘
Operation Tolerance Rationale
/login/face 0.6 Stricter — protects account access
/attendance/checkin 0.65 Lenient — daily use, varied lighting
/attendance/checkout 0.65 Same as check-in