In the last semester of my B.Sc. degree, I worked on a final year project titled “Computer Vision Based Authentication and Employee Monitoring System” with my team members Yosef Emyayu and Getachew Getu, under the guidance of our advisor Dr. Ashenafi Yadessa.

Keywords: Computer Vision (CV), Face Recognition, OpenCV, and OTP

Overview

The project builds a Computer Vision based authentication and employee monitoring system. The goal: use computer vision for authentication and employee monitoring — screening users by their face for access to a campus or specific resources like a data center. Facial features are unique, making this more secure than password-based authentication.

Computer vision (CV) is a field of computer science that deals with replicating the complex parts of the human visual system and getting the machines to comprehend and understand the visual details present in the data.

We used Python’s SQLite for employee information management (ID number, full name, department) and deployed a Raspberry Pi as the main controller. An interactive GUI built with Python’s tkinter allows admins to register employees, train the model, and monitor the system.

Face Recognition Approach

We used the LBPH (Local Binary Pattern Histogram) face detection algorithm, which gives more accurate results compared to Fisher Face and Eigen Face algorithms. For systems with enough computing power, deep learning methods such as FaceNet could provide better accuracy.

The process:

  1. Capture 50 images of a person from different angles
  2. Convert color images to grayscale
  3. Train and store encoded data in the database
  4. Classify pixels into 3x3 matrix format for LBPH recognition

The phases break down into: pre-processing, feature extraction, and classification.

Two-Factor Authentication

Since CV-based face detection is challenged by low light intensity, we developed a two-factor authentication fallback. When lighting conditions are poor (fog, night), the system prompts for password authentication, then generates a time-bounded one-time password (OTP) sent via email using SMTP.

System Modes

  • User mode: Registered employees authenticated via face recognition. On successful match, the servo motor opens the door and attendance is automatically recorded.
  • Guest mode: Unregistered visitors can request access via email notification to the admin.

Hardware Components

  • Raspberry Pi 3 (Model B V1.2)
  • Pi Camera v2.1
  • Presence detection sensor
  • LCD display for user communication
  • Keypad for input
  • Servo motor for door control

The servo motor operates from 45 degrees (closed) to 135 degrees (open) to control door movement.

Implementation

The system has two phases:

Registration and Training: Admin registers user information (ID, name, gender, email), captures face images via Pi Camera, and trains the LBPH model. Training generates a .yml encoded file used for recognition.

Recognition: Live camera feed is compared against the trained model. On match, the system displays the person’s name, opens the door via servo motor, and records attendance with timestamp. Unknown faces trigger the guest mode flow.

Project Code Structure

headshot.py        # Camera capture and image storage
recognition.py     # Face recognition and matching
train_model.py     # LBPH model training
database.py        # Employee data management
otp.py             # One-time password generation
guest.py           # Guest mode handling
admin.py           # Admin GUI and operations
main.py            # Application entry point

Future Work

  • Integrate a remote server for centralized data management
  • Synchronize data between admin interface and Raspberry Pi
  • Offload image processing for improved efficiency

The complete project is available on GitHub.