0% found this document useful (0 votes)
6 views

Project Report Template

The project report details the development of a Face Recognition System using Python, OpenCV, and Tkinter, aimed at capturing, saving, and verifying user face images. It outlines the experimental procedure, software and hardware requirements, and the functionalities of the GUI application, including user management and duplicate image deletion. The report also discusses observations, results, and areas for improvement, emphasizing the need for enhanced accuracy and efficiency in face matching and data management.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Project Report Template

The project report details the development of a Face Recognition System using Python, OpenCV, and Tkinter, aimed at capturing, saving, and verifying user face images. It outlines the experimental procedure, software and hardware requirements, and the functionalities of the GUI application, including user management and duplicate image deletion. The report also discusses observations, results, and areas for improvement, emphasizing the need for enhanced accuracy and efficiency in face matching and data management.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

VIETNAM NATIONAL UNIVERSITY HCMC

INTERNATIONAL UNIVERSITY

School of Electrical Engineering

TERM PROJECT REPORT


Topic: FacestreamID Verification Improvement

Submitted by

Students’ Name: Tong Khanh Hoang ID: EEACIU24041


Contents
Experimental Procedure 3

Discussion of Results 4

Self-Evaluation 4

References 4

International University 2
School of EE
Experimental Procedure
This code outlines an experimental procedure to implement a Face Recognition System using
Python, OpenCV, and Tkinter for a graphical interface. Below is a description of experimental
setup, equipment, and procedure:
1. Objective
The goal is to develop a system that can:
 Capture and save face images for user registration.
 Perform face recognition by matching real-time input with saved faces.
 Manage image data by removing duplicates or purging all saved images.

You can try my complete app through this following link:


https://drive.google.com/drive/folders/1ce6qHD5iR8R-D1zAHfQoRloVpZQnUFc9?usp=sharing
Installation Requirements:
1. Install:
a) OpenCV (cv2): for computer vision tasks Command: “pip install opencv-python”
b) NumPy: for numerical computations Command: “pip install numpy”
2. Built-In Libraries (No installation needed):
a) os: a library to interact with the operating system
b) Tkinter: a library for creating graphical user interfaces (GUIs) in Python
c) Threading: a library to run multiple threads for parallel task execution

International University 3
School of EE
d) Time: a library for handling time-related tasks
- To process with the development of this Verification System, it is required to obtain an Agreement
License from for the use of the Open Source Computer Vision Library. The license can be downloaded
through the link:
https://github.com/kipr/opencv/blob/master/data/haarcascades/haarcascade_frontalface_default.xml
Equipment and Components Used
1. Hardware
 Laptop: A system capable of Running Python on Visual Studio Code.
 Webcam: Integrated or external webcam for face capture.
2. Software
 Python 3.13.1: Programming language for implementing the system
 OpenCV: Library for real-time computer vision and image processing.
 Tkinter: GUI library in Python for creating user interfaces.
 Haar Cascade Classifier: Prer-trained model for face detection, provided by OpenCV.
3. Data Storage
 Local directory (dataset): Used to save and manage captured face images.
Experiment Setup
1. Software Environment
 Install required Python libraries (cv2, numpy, tkinter) using pip:
pip install opencv-python numpy
2. Directory Structure
 Create a directory dataset in the project folder for storing images.
3. Face Detection Model
 The Haar Cascade model ( haarcascade_frontalface_default_xml ) is used for
detecting faces in images
Procedure
1. Setup the Application
o Run the script to initialize the GUI application.
o The interface provides buttons for:
 Adding a user face.
 Verifying a user’s face.

International University 4
School of EE
 Managing images (deleting duplicates or purging all).
2. Capture Face Images
o The "Add User" button prompts the user for their name.
o Captures 25 images of the user's face through the webcam and saves them in the
dataset directory.
3. Verify User Face
o The "Verify User" button compares the live webcam feed to saved faces in the
dataset.
o Uses pixel-wise comparisons to match the input face with the stored images.
4. Delete Duplicate Images

o The "Delete Duplicates" button removes similar images based on pixel-level


differences below a threshold
5. Purge All Images
o The "Purge All Images" button deletes all images from the dataset directory.
6. Help and Exit
o A "Help" button explains how the system works.
o An "Exit" button closes the application.

Data Collection
 Data (face images) is captured via the webcam and saved in JPEG format in the dataset
directory.
 Image files are named with the format <name>_<count>.jpg.

International University 5
School of EE
Observations
 Face Detection: Real-time detection accuracy depends on lighting and camera quality.
 Performance: The system displays FPS (frames per second) to monitor performance
during operation.

 Duplicates: Images are compared using pixel-level differences to remove redundancy.

Experimental Results

International University 6
School of EE
The provided script is a GUI-based Face Recognition System implemented using Python,
OpenCV, and Tkinter. Below is a detailed breakdown of the outcomes and observations for each
functionality:
1. GUI Functionality
The application GUI provides six core features:
 Add User: Captures and saves images of a user's face to a dataset folder.
 Verify User: Matches a live camera feed against stored faces in the dataset and identifies
users.
 Delete Duplicates: Detects and removes duplicate or similar images from the dataset.
 Purge All Images: Deletes all images in the dataset.
 Help: Displays an informational dialog explaining how to use the application.
 Exit: Safely terminates the application.
2. Face Detection and Image Capture
 The application uses Haar Cascade classifiers for face detection.
 It captures up to 25 images of a user's face, saving them in a dataset directory named
<username>_<count>.jpg.
3. Face Matching
 Captures a live video feed, detects faces, and compares them with saved images in the
dataset using Euclidean distance.
 Matches are identified by the filename (e.g., username) of the closest image in the
dataset.
4. Duplicate Detection
 The delete duplicates function identifies duplicate images using pixel-wise differences.
 Retains the 15 most recent unique images and removes duplicates based on a similarity
threshold.
5. Description of Results
The provided script is a GUI-based Face Recognition System implemented using Python,
OpenCV, and Tkinter. Below is a detailed breakdown of the outcomes and observations for each
functionality:

1. GUI Functionality
The application GUI provides six core features:
 Add User: Captures and saves images of a user's face to a dataset folder.
 Verify User: Matches a live camera feed against stored faces in the dataset and identifies
users.
 Delete Duplicates: Detects and removes duplicate or similar images from the dataset.

International University 7
School of EE
 Purge All Images: Deletes all images in the dataset.
 Help: Displays an informational dialog explaining how to use the application.
 Exit: Safely terminates the application.
Observations:
 The GUI is responsive, thanks to the use of threads for computationally intensive tasks.
 Decorative elements like the Christmas border improve visual appeal but don't affect
core functionality.

2. Face Detection and Image Capture


 The application uses Haar Cascade classifiers for face detection.
 It captures up to 25 images of a user's face, saving them in a dataset directory named
<username>_<count>.jpg.
Observations:
 Performance: Real-time face detection works well under good lighting conditions.
 Limitations: Haar Cascade detection struggles with low-light conditions and side
profiles.

3. Face Matching
 Captures a live video feed, detects faces, and compares them with saved images in the
dataset using Euclidean distance.
 Matches are identified by the filename (e.g., username) of the closest image in the
dataset.
Observations:
 Accuracy: Matching based solely on Euclidean distance between grayscale image pixels
can lead to false positives or errors.
 Real-time Results: Displaying FPS (frames per second) on the feed ensures real-time
feedback.

4. Duplicate Detection
 The delete duplicates function identifies duplicate images using pixel-wise differences.
 Retains the 15 most recent unique images and removes duplicates based on a similarity
threshold.
Observations:
 Efficiency: Works well for small datasets but may not scale efficiently with larger
datasets due to its pixel-wise approach.

International University 8
School of EE
 Enhancement Opportunity: Incorporating feature-based methods (e.g., embeddings)
could improve detection.

5. Data Management
 The purge_all_images function completely clears the dataset, ensuring easy dataset
management.
6. Help and User-Friendliness
 A help dialog explains each functionality, making the application beginner friendly.
 Informational messages and error handling improve usability.
Discussion of Result

Points Needing Improvement (Uploaded Code)

1. Face Matching Accuracy:


o The uploaded code uses Euclidean distance for face matching, which is
simplistic and prone to errors.
o Recommendation: Use feature-based embeddings from advanced models like
FaceNet or dlib for higher accuracy.

2. GUI Improvements:
o The uploaded code includes basic GUI functionality with options like "Add User"
and "Verify User."
o Recommendation: Add features like duplicate image deletion and dataset
management for better usability.

3. Efficiency in Data Management:


o The uploaded code stores raw face images, which can quickly consume storage
space.
o Recommendation: Save face embeddings instead of raw images to reduce
storage requirements and speed up face matching.

4. Error Handling:
o The uploaded code lacks comprehensive error handling for situations like missing
Haar Cascade files or failed webcam initialization.
o Recommendation: Add error handling with clear messages for better robustness.

International University 9
School of EE
5. Scalability:
o The current implementation is not designed for large datasets.

o Recommendation: Integrate cloud storage or databases for managing larger


datasets.

6. Application Packaging:
o The code lacks instructions or functionality for creating a standalone executable.

o Recommendation: Use tools like PyInstaller to package the application.

Improvements in the Provided Code

Duplicate Detection:

 The provided code introduces a delete_duplicates function to manage the dataset by


removing redundant entries.

 This functionality is absent in the uploaded code and significantly improves dataset
management.

Comprehensive GUI:

 The provided code features a more interactive and user-friendly GUI with buttons
for:
o Adding users.

o Verifying users.

o Deleting duplicates.

o Purging all images.

o Displaying a help dialog.

 These additions make the interface intuitive and accessible.

Progress Display:

 The provided code displays real-time FPS during face detection and matching,
providing feedback on system performance.

International University 10
School of EE
Multithreading:

 The face matching functionality in the provided code is executed in a separate


thread to avoid freezing the GUI during computational tasks.

Dataset Purging:

 A "Purge All Images" option is added, allowing users to clear the entire dataset
easily, improving usability.

Help Menu:

 A help dialog is included to explain the software’s features, making it beginner-


friendly.

Decorative Enhancements:

 The provided code includes a "Christmas Border" for visual appeal, which is not
critical but adds a creative touch.
Self-Evaluation
 I learned a lot through this project, which not only fueled my curiosity but also promoted my
background knowledge, which played a role in my development. Improve the ability to work
in groups and discuss and recognize problems.
References
[1]OpenCV documentation, https://docs.opencv.org/
[2]Tkinter documentation,
https://docs.python.org/3/library/tkinter.html
[3]TTKBootstrap documentation
https://ttkbootstrap.readthedocs.io/
[4]PyInstalle manual
https://pyinstaller.readthedocs.io/
[5] Tran, M. H. (2024) "Python 101: Face Stream Verification System" [Lecture PDF]
Institution: Ho Chi Minh City International University – HCMIU. Fall 2024.

International University 11
School of EE

You might also like