Back to Projects

Employee Face Recognition System

An Adaptive Multi-Centroid Face Recognition System designed to handle intra-class variations and false positives in corporate environments.

Computer VisionPythonFaceNetFastAPI

Problem Statement

Traditional verification methods struggle with scalability and variations. This system creates personalized recognition profiles to ensure secure, efficient employee verification.

Implementation Details

Problem Statement

In corporate environments, secure and efficient employee verification is critical. Traditional methods like ID cards or passwords can be lost or shared. While face recognition offers a seamless alternative, generic solutions often struggle with:

  • Intra-class Variation: An employee's face looks different across days (lighting, angles, expressions).
  • False Positives: Incorrectly identifying a stranger as an employee is a security risk.
  • Scalability: Adding new employees shouldn't require retraining the entire deep learning model from scratch.

This project solves these issues by implementing an Adaptive Multi-Centroid Face Recognition System that creates a personalized recognition profile for each employee.

Methodology

The system uses FaceNet (InceptionResnetV1) pretrained on VGGFace2 to generate 512-dimensional face embeddings. Instead of simple averaging, we employ a sophisticated clustering approach.

Key Components

  • Preprocessing (MTCNN): Detects faces with high confidence (0.95), aligns/crops to 160x160, and rejects low-quality images.
  • Multi-Centroid Representation (K-Means): Calculates K=3 centroids per user to capture different "modes" (e.g., Frontal, Side Profile, Smiling), improving robustness.
  • Adaptive Thresholding: Calculates a personalized threshold for each employee based on the 3rd percentile of their self-similarity scores, rather than a global threshold.

Deployment with FastAPI

The system is deployed as a high-performance REST API using FastAPI. The /recognize endpoint enforces a strict mode policy:

  • Rejects requests with 0 or >1 faces to prevent ambiguity.
  • Requires match confidence to exceed the employee's specific personalized threshold.
  • Enforces a Margin Check: The best match must be significantly closer than the second best match (> 0.05 distance).

New employees can be added dynamically without restarting the server or retraining.

Tech Stack

PythonFaceNetFastAPIK-MeansMTCNNScikit-Learn