Skip to content

ritvi-alagusankar/facedetection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

1 – Online Face Detection and Recognition System (Traditional Methods)

πŸ“Œ Overview

This project implements a real-time face detection and recognition system using classical computer vision techniques instead of deep learning. We combined Viola–Jones and HOG for face detection and implemented three recognition models:

  1. Eigenfaces + SVM (PCA-based)
  2. Fisherfaces (PCA + LDA)
  3. LBPH (Local Binary Pattern Histogram)

A Next.js frontend and FastAPI backend were developed to integrate all models into a GUI, enabling real-time webcam-based detection and recognition.


βš™ Features

  • Two-stage detection: Viola–Jones Haar Cascade + HOG-based detector for robustness.
  • Multiple recognition models for performance comparison.
  • Custom dataset of 8 members (~70 images per person), with preprocessing and augmentation.
  • Real-time GUI for live video-based recognition.
  • Evaluation with confusion matrices and classification reports.

πŸ“‚ Models

Model 1 – Eigenfaces + SVM

  • PCA to extract Eigenfaces, retaining 95% variance.
  • RBF-kernel SVM for classification.
  • Accuracy: 93.6% on test set.

Model 2 – Fisherfaces

  • PCA for dimensionality reduction, followed by LDA for class separability.
  • Accuracy: ~72%.

Model 3 – LBPH

  • Local texture-based features using 8x8 grid, radius=1, 8 neighbors.
  • Robust to lighting changes.
  • Accuracy: ~100% on test set with confidence threshold.

πŸ—‚ Dataset Preparation

  • Videos captured for each member β†’ frames extracted β†’ faces detected.
  • Augmentation: flipping, brightness/contrast adjustment, rotation, translation, noise.
  • Resizing and histogram equalization for uniformity.

πŸ–₯ GUI Implementation

  • Frontend: Next.js interface for model selection and live camera streaming.
  • Backend: FastAPI server integrating all three recognition models.
  • Real-time predictions displayed with bounding boxes and labels.

πŸ“Š Results Summary

Model Accuracy Strengths Weaknesses
Eigenfaces+SVM 93.6% Strong generalization, compact features Sensitive to lighting
Fisherfaces ~72% Better class separation than PCA Lower accuracy
LBPH ~100% Very robust to lighting and textures May struggle with large pose changes

image image image image image image image image image image image image

This project develops two high-accuracy face detection and recognition systems using deep learning, integrated into a Next.js frontend and FastAPI backend for real-time performance.

System 1: MTCNN + FaceNet + FaceClassifier

  • Face Detection: MTCNN extracts and aligns faces.
  • Embedding Generation: InceptionResNetV1 (FaceNet) creates 512-D feature vectors.
  • Classification: Custom classifier predicts identities from embeddings.
  • Training: Heavy data augmentation for robustness; 92.41% validation accuracy.

System 2: DeepFace Framework

  • Enrollment: RetinaFace detector + ArcFace model to store averaged embeddings.
  • Real-time Recognition: YuNet detector for speed; cosine similarity for matching.
  • Performance: Flexible, modular, and easily updatable pipeline.

πŸ“‚ Dataset

  • 320 images (40 per person) across 8 classes.
  • Captured from multiple angles and stored in PNG format.
  • 75:25 train-validation split.

βš™οΈ Key Features

  • Supports both traditional (MTCNN + FaceNet) and DeepFace-based pipelines.
  • Frontend GUI allows mode selection, uploads, and displays recognition results.
  • Backend optimised for low latency and scalable concurrent requests.

πŸ“Š Results

  • System 1: 92.41% validation accuracy, strong robustness to augmentation noise.
  • System 2: Fast and accurate real-time recognition with modular detector switching.

πŸš€ Future Work

  • Expand dataset diversity.
  • Explore alternative face detection methods.
  • Fine-tune models for higher accuracy.
  • Deploy to mobile/edge devices with lightweight formats like CoreML.
image image image image image image image image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •