0% found this document useful (0 votes)
14 views16 pages

Finalreport - PDF 09-23-10-114

The report titled 'Face Detection and Recognition Using MATLAB' details a project that develops a system for detecting and recognizing human faces using deep learning techniques, specifically Convolutional Neural Networks (CNNs) like GoogleNet and SqueezeNet. The methodology includes face detection through algorithms such as the Viola-Jones method and employs transfer learning for enhanced recognition accuracy. The results indicate significant improvements in performance under various conditions, showcasing the potential applications in biometric authentication and surveillance.

Uploaded by

22eee029
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views16 pages

Finalreport - PDF 09-23-10-114

The report titled 'Face Detection and Recognition Using MATLAB' details a project that develops a system for detecting and recognizing human faces using deep learning techniques, specifically Convolutional Neural Networks (CNNs) like GoogleNet and SqueezeNet. The methodology includes face detection through algorithms such as the Viola-Jones method and employs transfer learning for enhanced recognition accuracy. The results indicate significant improvements in performance under various conditions, showcasing the potential applications in biometric authentication and surveillance.

Uploaded by

22eee029
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

A Report

On

FACE DETECTION AND RECOGNITION USING MATLAB

Submitted by:

Ananya Gupta 2200910210007

Devansh Agrawal 2200910210013

Nikita Negi 2200910210024

Yashi Upadhyay 2200910210039

Submitted to:

Mrs.Pooja Prakash
Dr.Sanjiba Bisoyi
(Project Coordinators)

2024-25
JSS MAHAVIDYAPEETHA
JSS ACADEMY OF TECHNICAL EDUCATION, NOIDA
DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING
C-20/1, SECTOR – 62, NOIDA- 201301
DECLARATION

We hereby declare that the project report entitled "Face Detection and Recognition using
MATLAB" submitted to JSSATEN is an original work carried out by us under the
guidance of Ms.Pooja Prakash & Dr.Sanjiba Bisoyi. This project has not been submitted
for the award of any other degree, diploma, fellowship, or similar title or recognition.

All the information and data in this report have been acknowledged and referenced
wherever they have been obtained from other sources. The work embodies the results of
our research and has been completed to the best of our knowledge.

We understand that any violation of the above conditions may result in disciplinary action
as per the rules of the institution.

Signature:
Ananya Gupta

Devansh Agrawal

Nikita Negi

Yashi Upadhyay

Date:
26/12/2024

i
ACKNOWLEDGEMENT

We would like to express our sincere gratitude to Mrs.Pooja Prakash(Assistant Professor)


& Dr.Sanjiba Bisoyi (Associate Professor), EEE JSSATEN, for their invaluable guidance,
continuous support, and encouragement throughout this project. Their expert advice and
feedback were instrumental in the successful completion of this work.

We extend our heartfelt thanks to JSSATEN for providing the resources and environment
necessary to carry out this project.

Lastly, we are deeply grateful to our family and friends for their unwavering support and
understanding during this time. Their encouragement motivated us to persevere and give
our best effort.

Signature:
Ananya Gupta

Devansh Agrawal

Nikita Negi

Yashi Upadhyay

Date:
26/12/2024

ii
ABSTRACT

The project titled "Face Detection and Recognition Using MATLAB" focuses on
developing a robust system for detecting and recognizing human faces using advanced
deep learning techniques integrated with MATLAB. The system leverages Convolutional
Neural Networks (CNNs) for feature extraction and classification, utilizing pre-trained
models like GoogleNet and SqueezeNet to enhance accuracy and performance.

The methodology includes face detection using algorithms such as the Viola-Jones
method and advanced CNN-based detection frameworks. For recognition, the project
employs GoogleNet and SqueezeNet, fine-tuned for facial feature extraction and
classification tasks. MATLAB’s deep learning toolbox and image processing capabilities
are utilized to train, validate, and test the models on a curated dataset of faces.

The results demonstrate a significant improvement in accuracy, robustness, and efficiency


under diverse conditions, including variations in lighting, pose, and occlusion. The
integration of traditional algorithms like PCA and Viola-Jones with CNN-based methods
provides a comprehensive solution for face detection and recognition.

In conclusion, this project showcases the potential of combining classical and deep
learning techniques for real-world applications such as biometric authentication,
surveillance, and human-computer interaction, setting a benchmark for further
advancements in the field.

iii
TABLE OF CONTENTS

Contents Page No.

Declaration i

Acknowledgment ii

Abstract iii

List of Figures v

1 Chapter1: Introduction 1

2 Chapter 2: Face Detection 2

Sec-2.1: Face Detection In Images 2

Sec-2.2: Face Detection In Videos 3

3 Chapter 3: Face Recognition 4

Sec-3.1: Using GoogleNet 4-5

Sec-3.2: Using SqueezeNet 6-7

4 Conclusions 8

5 References 9

iv
LIST OF FIGURES

Figure No. Description Page No.

Figure-2.1.1 Code for face detection on images 2

Figure-2.1.2 Result of face detection on images 2

Figure-2.2.1 Code for face detection on videos 3

Figure-2.2.2 Result of face detection on videos 3

Figure-3.1.1 Code for training a GoogleNet network 5

Figure-3.1.2 Code for testing a GoogleNet network 5

Figure-3.1.3 Results of face recognition using GoogleNet 5

Figure-3.2.1 Code for training a SqueezeNet network 7

Figure-3.2.2 Code for training a SqueezeNet network 7

Figure-3.2.3 Results of face recognition using SqueezeNet 7

v
CHAPTER-1: INTRODUCTION
This project focuses on implementing and analyzing face detection techniques using MATLAB,
with the goal of accurately detecting and tracking human faces across various contexts. Face
detection serves as the foundation for many computer vision applications, involving the
identification and localization of faces in images and videos. By leveraging MATLAB's built-in
vision.CascadeObjectDetector, the project aims to efficiently detect faces in static images,
video files, and real-time streams, making it suitable for dynamic scenarios.

To enhance the system's capabilities, transfer learning techniques are applied for face
recognition. Pre-trained deep learning models such as GoogLeNet and SqueezeNet are utilized to
identify faces with high accuracy and minimal computational effort. GoogLeNet is known for its
efficiency and accuracy in image classification tasks, while SqueezeNet offers a lightweight
alternative with reduced memory requirements, making it ideal for resource-constrained
environments.

By combining face detection and recognition, the project develops a robust system that is
applicable in various fields, including video surveillance, security systems, and human-computer
interaction. This integration enables the system to detect and identify faces in real-time,
highlighting its potential for practical and scalable applications.

1
CHAPTER-2: FACE DETECTION

2.1 Face Detection In Images:


Face detection is a foundational step in many computer vision applications, focusing on
identifying and localizing human faces within images. This process is vital for systems like
facial recognition, emotion detection, and video surveillance. MATLAB provides a
streamlined approach to face detection with tools like vision.CascadeObjectDetector,
which efficiently detects faces in images by leveraging trained classifiers. To ensure reliable
detection, preprocessing techniques such as resizing are often employed, especially for
images exceeding standard dimensions. The detected face coordinates are then highlighted
using visualization tools to indicate results clearly.

Code Explanation:
Load Image: The imread function loads an image into MATLAB.
Check and Resize: If the image width exceeds 320 pixels, imresize resizes it to ensure
consistency while maintaining aspect ratio.
Set Up Detector: The vision.CascadeObjectDetector initializes a face detection model.
Detect Faces: The step function computes face coordinates within the image.
Draw Rectangles: The insertShape function overlays rectangles on detected face locations
for visualization.
Display Results: imshow displays the processed image with highlighted faces.

2
2.2 Face Detection In Videos:
Face detection in videos involves not only identifying faces but also tracking them across
consecutive frames, a critical step for applications like video surveillance and
human-computer interaction. Unlike static image detection, video face detection must
account for movement, lighting changes, and varying angles. MATLAB facilitates this with
tools such as vision.CascadeObjectDetector for initial detection and vision.PointTracker
for continuous tracking. By combining detection and tracking, the system ensures accurate
and stable face monitoring throughout the video.

Code Explanation:
Load Video: The VideoReader function loads the video, and the initial frame is extracted
with readFrame.
Face Detection: vision.CascadeObjectDetector identifies the face region in the initial
frame.
Bounding Box and Features: Detected face locations are marked with bounding boxes and
converted to points using bbox2points.
Feature Points: Grayscale conversion and detectMinEigenFeatures extract points for
tracking.
Point Tracker Initialization: A vision.PointTracker is set up to follow feature points in
subsequent frames.
Tracking Loop:
● For each frame, feature points are tracked using step.
● Geometric transformations (estimateGeometricTransform) refine the bounding box.
● Updated bounding boxes are visualized using insertShape and insertMarker.
Video Player: vision.VideoPlayer displays the processed video with detected and tracked
faces.

3
CHAPTER-3: FACE RECOGNITION

3.1 Using GoogleNet:


Face recognition is a crucial aspect of computer vision, focusing on identifying individual
identities by analyzing unique facial features. Convolutional neural networks (CNNs) like
GoogleNet excel in face recognition due to their ability to learn hierarchical features from
data. GoogleNet, a pre-trained CNN, can be adapted for custom face recognition tasks using
transfer learning. This approach allows efficient training on new datasets by modifying
specific layers while retaining the network's learned features, significantly reducing training
time and improving accuracy.

Code Explanation:
Dataset Preparation:
● Load the dataset using imageDatastore and split it into training and validation sets
with splitEachLabel.
Network Modification:
● Analyze the GoogLeNet architecture using analyzeNetwork.
● Replace the final feature extraction layer and classifier with task-specific layers using
replaceLayer.
Data Augmentation:
● Apply transformations like scaling, flipping, and translation using
imageDataAugmenter to create augmented datasets.
● Resize images to match the network's input size using augmentedImageDatastore.
Training the Network:
● Configure training options (trainingOptions) with parameters such as batch size,
learning rate, and epochs.
● Train the modified network using trainNetwork on augmented training data.
Testing the Network:
● Define a testing function that preprocesses an image, resizes it, and uses the classify
function to predict the label and probability.

4
5
3.2 Using SqueezeNet:
Face recognition is a critical component of modern computer vision, enabling the
identification of individuals by analyzing unique facial features. SqueezeNet, a lightweight
convolutional neural network (CNN), is particularly suited for this task due to its compact
architecture and reduced computational requirements. By employing transfer learning,
SqueezeNet can be adapted for face recognition tasks, allowing the network to learn new
categories efficiently while leveraging pre-trained weights. This approach ensures high
accuracy and fast training, even on modest hardware.

Code Explanation:
Dataset Preparation:
● Load the image dataset using imageDatastore with labels derived from folder names.
● Split the data into training and validation sets with splitEachLabel.
Network Architecture Modification:
● Analyze the SqueezeNet architecture using analyzeNetwork.
● Replace the final convolutional and classification layers with task-specific layers
using replaceLayer.
Data Preprocessing:
● Resize the training and validation datasets to match the input layer size, ensuring
compatibility with the network.
● Convert grayscale images to RGB using augmentedImageDatastore.
Training the Network:
● Set training options, including learning rate, mini-batch size, and epochs, using
trainingOptions.
● Train the modified network using trainNetwork, monitor progress, and save the
trained model.

6
Testing the Network:
● Load the saved model, predict labels on the validation data, and calculate the
accuracy.
● Randomly select validation images and display them with predicted labels and
probabilities.

7
CONCLUSIONS

● This project demonstrates how MATLAB can be used for effective face detection in
images, videos, and real-time streams. The built-in `CascadeObjectDetector` provides a
reliable and efficient method for detecting faces in various contexts.

● The addition of tracking algorithms enhances the system's ability to follow detected faces
in videos and real-time streams, making it suitable for applications such as video
surveillance and human-computer interaction.

● The use of transfer learning expands the scope to face recognition, allowing the
pre-trained networks to be adapted to new datasets with minimal effort.

8
REFERENCES

[1] F Shaker, A Abdulelah 2020 Face Detection By some Methods based on MATLAB Journal
of Al- Qadisiyah for Computer Science and Mathematics 12–17,(2020).

[2] M Harahap, A Manurung, Priya,A Prakoso, M F Tambunan, Face tracking with camshaft
algorithm for detecting student movement in a class, IOP Conf. Series: Journal of Physics: Conf.
Series 1230, doi:10.1088/1742-6596/1230/1/012018, (2020).

[3] I. Fasel and J. R. Movellan. Comparison of neurally in-spired face detection algorithms. In
Proceedings of the international conference on artificial neural networks (ICANN2002). UAM,
(2021).

9
10

You might also like