DSP Mini Project Report
DSP Mini Project Report
Mini Project Report
On
“Face Recognition Using MATLAB”
Submitted by
Submitted to
Shraddha Mithbavkar
Subject Incharge
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
2
Introduction
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.
4
Code
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
10
Presentation Slides
11
12
13
14