Digital Signal Processing
Mini Project Report
On
“Face Recognition Using MATLAB”
Submitted by
1. Amar Ghayal (A-22)
2. Pratik Sambare (B-19)
3. Pranay Sawant (B-20)
Submitted to
Shraddha Mithbavkar
Subject Incharge
Department of Electronics Engineering
Datta Meghe College of Engineering, Airoli, Navi Mumbai-400708
University of Mumbai
2020-2021
1
Index
Sr No Content Page No
1. Introduction 3
2. Method Used 4
3. Code 5-7
4. Output 8-9
5. Conclusion 10
6. Presentation Slides 11-14
2
Introduction
Object detection and tracking are important in many computer vision
applications, including activity recognition, automotive safety and surveillance.
Presented here is a face detection using MATLAB system that can detect not
only a human face but also eyes and upper body. Face detection is an easy and
simple task for humans, but not so for computers. It has been regarded as the
most complex and challenging problem in the field of computer vision due to
large intra-class variations caused by the changes in facial appearance, lighting
and expression. Such variations result in the face distribution to be highly
nonlinear and complex in any space that is linear to the original image space.
Face detection is the process of identifying one or more human faces in images
or videos. It plays an important part in many biometric, security and
surveillance systems, as well as image and video indexing systems.
Face detection and recognition are being applied to a variety of applications
recently. The main reason for this change is to reduce unnecessary human
intervention and increase overall system efficiency. Face detection has been
around for a while in our digital cameras, both digital SLR and compact
cameras. When we point the camera to a scene, they have the ability to find the
faces and set the exposure and the focus automatically.
Since we generally want the people in our picture to be the one who are sharp
and well exposed, this is a very helpful technology. Most of the biometrics
security systems include facial recognition as one of the key security checks.
Some of the surveillance systems in UK also implement this technology for
crime prevention and also to stop passport and other various types of frauds.
Advantages of face detection include better security, easy integration, and
automated identification; Disadvantages include huge storage requirements,
vulnerable detection, and potential privacy issues.
3
Method Used
Viola-Jones Method:
There are different types of algorithms used in face detection. Here, we have
used Viola-Jones algorithm for Face Recognition using MATLAB program.
The main focus of this method is to achieve a reasonably high face detection
rate in the smallest amount of time possible. This learning algorithm is then
applied which selects the critical visual features and generates classifiers.
Background or in other words the fewer interesting regions are discarded by a
cascade classifier.
Reese's study concluded that the Viola-Jones algorithm achieved better
performance, with average accuracy of 74.8% and average speed of 0.03s per
image, and suggested that more work could be done to improve the accuracy of
the Viola-Jones algorithm for face detection from thermal infrared images.
4
Code
Face Recognition System is Divided in 3 Parts
1. Data Collection
2. Training Model
3. Testing Model
1. Data Collection
clc
clear all
close all
warning off;
cao=webcam;
faceDetector=vision.CascadeObjectDetector;
c=150;
temp=0;
while true
e=cao.snapshot;
bboxes =step(faceDetector,e);
if(sum(sum(bboxes))~=0)
if(temp>=c)
break;
else
es=imcrop(e,bboxes(1,:));
es=imresize(es,[227 227]);
filename=strcat(num2str(temp),'.bmp');
imwrite(es,filename);
temp=temp+1;
imshow(es);
drawnow;
end
else
imshow(e);
5
drawnow;
end
end
2. Training Model
clc
clear all
close all
warning off
g=alexnet;
layers=g.Layers;
layers(23)=fullyConnectedLayer(2);
layers(25)=classificationLayer;
allImages=imageDatastore('datastorage','IncludeSubfolders',true,
'LabelSource','foldernames');
opts=trainingOptions('sgdm','InitialLearnRate',0.001,'MaxEpochs',20,'MiniBatc
hSize',64);
myNet1=trainNetwork(allImages,layers,opts);
save myNet1;
3. Testing Model
clc;close;clear
c=webcam;
load myNet1;
faceDetector=vision.CascadeObjectDetector;
while true
e=c.snapshot;
bboxes =step(faceDetector,e);
if(sum(sum(bboxes))~=0)
es=imcrop(e,bboxes(1,:));
es=imresize(es,[227 227]);
label=classify(myNet1,es);
image(e);
title(char(label));
drawnow;
6
else
image(e);
title('No Face Detected');
end
end
7
Output
8
9
Conclusion
Face Recognition Using MATLAB is working as it is detecting two different
faces and showing their names on the screen. Also, if no one is in front of
camera then it is showing “No Face Detected” message on screen. This system
can be used as surveillance system at various places.
10
Presentation Slides
11
12
13
14