GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - tomasz-pawlaczyk/FaceID-verification: OpenCV-based face verification system using DNN face detection and LBPH recognition for real-time identity authentication.

BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
data
data
 
 
images
images
 
 
models
models
 
 
src
src
 
 
README.md
README.md
 
 

Repository files navigation

FaceID-verification

FaceID-verification is a real-time face identification system built with Python and OpenCV. It combines DNN-based face detection (ResNet SSD) with LBPH recognition to identify known users, reject unknown individuals, and handle no-face scenarios from a live webcam stream.

Project Overview

FaceID-verification is a real-time face identification and verification system built with Python and OpenCV. The application detects a face from a live webcam stream, extracts facial features, and identifies whether the detected person belongs to a set of known individuals or should be classified as an unknown user.

The system supports three decision states:

  • Known person detected (e.g., Tomas, Anne)
  • Unknown person detected
  • No face detected

Additionally displays real-time confidence (distance) evaluation

Positive verification: I was properly detected

How It Works

  1. A live video stream is captured from the webcam.
  2. A Deep Neural Network (DNN) face detector (ResNet SSD) identifies faces in the frame.
  3. The detected face is cropped, normalized (grayscale, resized to 200×200), and passed to the recognizer.
  4. An LBPH (Local Binary Patterns Histograms) model predicts the closest matching identity.
  5. A threshold-based decision layer determines:
    • If the face matches a known identity
    • If the face should be classified as Unknown
    • If no face is present

Positive verification: My friend was properly detected

Decision Logic

The system performs 1:N identification with rejection capability:

  • If no face is detected → "No face detected"
  • If face is detected:
    • Predict (label, confidence)
    • If confidence < threshold → Known identity
    • If confidence ≥ threshold → "Unknown person"

This approach prevents forced classification and introduces a practical identity rejection mechanism.

Negative verification: no face and unknown person were detected

Project Structure

face_unlock/
│
├── data/
│   ├── dataset/
│   │   ├── Tomasz/
│   │   └── Ania/
│   └── model/
│
├── models/
│   ├── deploy.prototxt
│   └── res10_300x300_ssd_iter_140000.caffemodel
│
├── src/
│   ├── collect.py
│   ├── train.py
│   ├── recognise.py
│   └── face_utils.py
│
└── README.md

Responsibilities

  • collect.py – captures and stores training data
  • train.py – trains the LBPH model and saves it to disk
  • recognise.py – performs real-time face identification
  • face_utils.py – handles DNN-based face detection

The project follows a modular structure to ensure maintainability and scalability.


OpenCV importance

OpenCV plays a critical role in two stages:

1. Deep Learning Face Detection (DNN)

The system uses OpenCV's DNN module with a pre-trained ResNet SSD model:

blob = cv2.dnn.blobFromImage(
    cv2.resize(frame, (300, 300)),
    1.0,
    (300, 300),
    (104.0, 177.0, 123.0)
)

net.setInput(blob)
detections = net.forward()

This deep learning–based detector locates faces in each video frame with higher robustness to lighting and slight pose variations compared to traditional Haar cascades.

2. Face Recognition with LBPH

The LBPH recognizer is used for identity classification:

model = cv2.face.LBPHFaceRecognizer_create()
model.train(faces, labels)

label, confidence = model.predict(face)

LBPH encodes facial texture into local binary patterns and compares histogram distances to identify faces using a confidence threshold.


How to Use

1. Install Dependencies

pip install opencv-python opencv-contrib-python numpy

2. Collect Data

Collect face samples for each person:

python src/collect.py --name Tomas
python src/collect.py --name Anne

Images will be stored under:

data/dataset/<PersonName>/

3. Train the Model

python src/train.py

This generates:

data/model/model.xml
data/model/labels.pkl

4. Run Face Identification

python src/recognise.py

Possible outputs:

  • Detected: Tomas
  • Detected: Anne
  • Unknown person
  • No face detected

Professional Value

This project demonstrates:

  • Real-time computer vision processing
  • Deep learning model integration (OpenCV DNN)
  • Face recognition pipeline design
  • Threshold-based decision systems
  • Modular architecture and model persistence
  • Practical identity verification logic

It represents a complete end-to-end computer vision application suitable for authentication, access control, and embedded identity systems.

About

OpenCV-based face verification system using DNN face detection and LBPH recognition for real-time identity authentication.

Topics

digital-idface-recognitionopen-cv

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.