face recognition using deep learning - master thesis...face recognition using deep learning master...

79
Face recognition using Deep Learning Master Thesis Author : Serra, Xavier 1 Advisor : Cast´ an, Javier 2 Tutor : Escalera, Sergio 3 1 Master in Artificial Intelligence Barcelona School of Informatics 2 GoldenSpear LLC 3 Department of Mathematics and Computer Science University of Barcelona Barcelona School of Informatics, January 2017 Barcelona School of Informatics Face recognition using Deep Learning 1 / 44

Upload: others

Post on 31-Dec-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face recognition using Deep LearningMaster Thesis

Author : Serra, Xavier1 Advisor : Castan, Javier2

Tutor : Escalera, Sergio3

1Master in Artificial IntelligenceBarcelona School of Informatics

2GoldenSpear LLC

3Department of Mathematics and Computer ScienceUniversity of Barcelona

Barcelona School of Informatics, January 2017

Barcelona School of Informatics Face recognition using Deep Learning 1 / 44

Page 2: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Outline

1 Introduction and GoalsIntroductionGoals

2 How it has been approachedProblemsCommon approachesProposed approachDatasets

3 Outcome

4 Conclusions

Barcelona School of Informatics Face recognition using Deep Learning 2 / 44

Page 3: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Outline

1 Introduction and GoalsIntroductionGoals

2 How it has been approachedProblemsCommon approachesProposed approachDatasets

3 Outcome

4 Conclusions

Barcelona School of Informatics Face recognition using Deep Learning 3 / 44

Page 4: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Uses of Face Recognition

Face Recognition has drawn plenty of attention

It has potential for multiple applications:

Biometrical verification

Search for a person through cameras

Automatically tagging friends

Finding similar people

...

So, what is actually Face Recognition?

Barcelona School of Informatics Face recognition using Deep Learning 4 / 44

Page 5: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face Recognition in fiction

How has fiction pictured face recognition?

Barcelona School of Informatics Face recognition using Deep Learning 5 / 44

Page 6: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Actual Face Recognition

How does Face Recognition actually work?

Eigenfaces

Active Appearance Models

Support Vector Machines

Bayesian models

Convolutional Neural Networks

...

Figure: Example of a CNN

Barcelona School of Informatics Face recognition using Deep Learning 6 / 44

Page 7: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Goal of this master thesis

Developing a face recognition system so that:

Keeps a DB of known users

Given a new picture, determines the closest match

Capable of on-line learning

Usable in uncontrolled environments

Reasonably fast

Barcelona School of Informatics Face recognition using Deep Learning 7 / 44

Page 8: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Outline

1 Introduction and GoalsIntroductionGoals

2 How it has been approachedProblemsCommon approachesProposed approachDatasets

3 Outcome

4 Conclusions

Barcelona School of Informatics Face recognition using Deep Learning 8 / 44

Page 9: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face Recognition Problems

Many factors to take into account:

Light conditions

Expression

Face orientation

Age

...

It can be summarized as Intra-class variability

Figure: Intra-class variability

Barcelona School of Informatics Face recognition using Deep Learning 9 / 44

Page 10: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face Recognition Problems

Many factors to take into account:

Light conditions

Expression

Face orientation

Age

...

It can be summarized as Intra-class variability

Figure: Intra-class variability

Barcelona School of Informatics Face recognition using Deep Learning 9 / 44

Page 11: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face Recognition Problems

Many factors to take into account:

Light conditions

Expression

Face orientation

Age

...

It can be summarized as Intra-class variability

Figure: Intra-class variability

Barcelona School of Informatics Face recognition using Deep Learning 9 / 44

Page 12: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face Recognition Problems

Many factors to take into account:

Light conditions

Expression

Face orientation

Age

...

It can be summarized as Intra-class variability

Figure: Intra-class variability

Barcelona School of Informatics Face recognition using Deep Learning 9 / 44

Page 13: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face Recognition Problems

Many factors to take into account:

Light conditions

Expression

Face orientation

Age

...

It can be summarized as Intra-class variability

Figure: Intra-class variability

Barcelona School of Informatics Face recognition using Deep Learning 9 / 44

Page 14: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face Recognition Problems

Many factors to take into account:

Light conditions

Expression

Face orientation

Age

...

It can be summarized as Intra-class variability

Figure: Intra-class variability

Barcelona School of Informatics Face recognition using Deep Learning 9 / 44

Page 15: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face Recognition Problems

Inter-class similarity is also an issue:

Figure: Inter-class similarity

Barcelona School of Informatics Face recognition using Deep Learning 10 / 44

Page 16: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common Face Recognition approach

Problems of raw images:

Excessive noise

Large dimensionality

Variability is too high

Solution?

Convert input image into a reduced space

Feature extraction

Manually crafted

Automatically found

Barcelona School of Informatics Face recognition using Deep Learning 11 / 44

Page 17: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common Face Recognition approach

Problems of raw images:

Excessive noise

Large dimensionality

Variability is too high

Solution?

Convert input image into a reduced space

Feature extraction

Manually crafted

Automatically found

Barcelona School of Informatics Face recognition using Deep Learning 11 / 44

Page 18: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common Face Recognition approach

Problems of raw images:

Excessive noise

Large dimensionality

Variability is too high

Solution?

Convert input image into a reduced space

Feature extraction

Manually crafted

Automatically found

Barcelona School of Informatics Face recognition using Deep Learning 11 / 44

Page 19: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common Face Recognition approach

Problems of raw images:

Excessive noise

Large dimensionality

Variability is too high

Solution?

Convert input image into a reduced space

Feature extraction

Manually crafted

Automatically found

Barcelona School of Informatics Face recognition using Deep Learning 11 / 44

Page 20: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common Face Recognition approach

Problems of raw images:

Excessive noise

Large dimensionality

Variability is too high

Solution?

Convert input image into a reduced space

Feature extraction

Manually crafted

Automatically found

Barcelona School of Informatics Face recognition using Deep Learning 11 / 44

Page 21: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common Face Recognition approach

Problems of raw images:

Excessive noise

Large dimensionality

Variability is too high

Solution?

Convert input image into a reduced space

Feature extraction

Manually crafted

Automatically found

Barcelona School of Informatics Face recognition using Deep Learning 11 / 44

Page 22: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common Face Recognition approach

Problems of raw images:

Excessive noise

Large dimensionality

Variability is too high

Solution?

Convert input image into a reduced space

Feature extraction

Manually crafted

Automatically found

Barcelona School of Informatics Face recognition using Deep Learning 11 / 44

Page 23: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common approachesEigenfaces

Reduces faces into more compact representations

Uses PCA to produce those

Set of eigenvectors from the covariance matrix

Comparison by linear combination of eigenfaces

Figure: Set of eigenfaces

Barcelona School of Informatics Face recognition using Deep Learning 12 / 44

Page 24: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common approachesActive Appearance Models

Fits a pre-defined face shape into the image

Iteratively improves initial estimation

Allows finding sets of relevant points

Figure: Active Appearance Models fitting a face shape

Barcelona School of Informatics Face recognition using Deep Learning 13 / 44

Page 25: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common approachesSupport Vector Machines

Successful classifier in many problems

Finds the hyperplane separating two problems

Can be used to determine if two images belong to same person

Figure: Application of Support Vector Machines

Barcelona School of Informatics Face recognition using Deep Learning 14 / 44

Page 26: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common approachesBayesian models

Models each facial feature as x = µ+ ε

It corresponds to inter-class and intra-class variability

Based on the full joint distribution of face image pairs

r(x1, x2) = logP(x1, x2|HI )

P(x1, x2|HE )

Barcelona School of Informatics Face recognition using Deep Learning 15 / 44

Page 27: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Common approachesConvolutional Neural Network

It is a type of Artificial Neural Network

Works by finding increasingly abstract features

Takes into account spatial relation

High requirements in time and data

Currently providing state of art results in many CV problems

Figure: Convolutional Neural Network

Barcelona School of Informatics Face recognition using Deep Learning 16 / 44

Page 28: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Proposed approach

The proposed approach consists of 4 steps:

Step 4: Performing comparison with stored ones

Step 3: Extracting features using a CNN

Step 2: Frontalizing the found face

Step 1: Locating the main face in the image

Barcelona School of Informatics Face recognition using Deep Learning 17 / 44

Page 29: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Proposed approach

The proposed approach consists of 4 steps:

Step 4: Performing comparison with stored ones

Step 3: Extracting features using a CNN

Step 2: Frontalizing the found face

Step 1: Locating the main face in the image

Barcelona School of Informatics Face recognition using Deep Learning 17 / 44

Page 30: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Proposed approach

The proposed approach consists of 4 steps:

Step 4: Performing comparison with stored ones

Step 3: Extracting features using a CNN

Step 2: Frontalizing the found face

Step 1: Locating the main face in the image

Barcelona School of Informatics Face recognition using Deep Learning 17 / 44

Page 31: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Proposed approach

The proposed approach consists of 4 steps:

Step 4: Performing comparison with stored ones

Step 3: Extracting features using a CNN

Step 2: Frontalizing the found face

Step 1: Locating the main face in the image

Barcelona School of Informatics Face recognition using Deep Learning 17 / 44

Page 32: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Proposed approach

The proposed approach consists of 4 steps:

Step 4: Performing comparison with stored ones

Step 3: Extracting features using a CNN

Step 2: Frontalizing the found face

Step 1: Locating the main face in the image

Barcelona School of Informatics Face recognition using Deep Learning 17 / 44

Page 33: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Step 1: Locate the face

Goal: Look for the bounding box of the most likely face

Figure: Locating the face

Benefit: Prevent erroneously located faces in next step

Barcelona School of Informatics Face recognition using Deep Learning 18 / 44

Page 34: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Step 1: Locate the face

Procedure:

Using a region based Convolutional Neural Networks (FasterRCNN [RHGS15])

Set of possible face locations is produced

Most promising face is kept: distance to center + confidence

Figure: Selecting most likely face

Barcelona School of Informatics Face recognition using Deep Learning 19 / 44

Page 35: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Step 2: Frontalize the face

Goal: Frontalize the face so that it is looking at the camera

Figure: Frontalizing the found face

Benefits: Eliminate background noise + Equally placed faces

Barcelona School of Informatics Face recognition using Deep Learning 20 / 44

Page 36: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Step 2: Frontalize the face

Procedure:

1 Locate a set of 46 fiducial points

2 Consider the same points in a 3D pre-defined model

3 Generate a projection matrix to map from 2D input to the 3Dreference

4 (Apply vertical similarity to fill in empty spots) ← Discarded

Figure: Frontalization process [HHPE15]

Barcelona School of Informatics Face recognition using Deep Learning 21 / 44

Page 37: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Step 2: Frontalize the face

Not working perfectly:

Figure: Examples of successful and unsuccessful frontalizations

Barcelona School of Informatics Face recognition using Deep Learning 22 / 44

Page 38: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Step 3: Extract relevant features

Goal: Automatically extract a set of relevant features from the face

Benefits: More efficient comparison + Reduction in variability

Procedure:

A CNN has been used to process each image

Each image is compressed into a reduced representation

A feature vector of 4096 features is generated

Based on Facebook’s DeepFace method [TYRW14]

Figure: CNN architecture used

Barcelona School of Informatics Face recognition using Deep Learning 23 / 44

Page 39: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Step 3: Extract relevant features

Goal: Automatically extract a set of relevant features from the face

Benefits: More efficient comparison + Reduction in variability

Procedure:

A CNN has been used to process each image

Each image is compressed into a reduced representation

A feature vector of 4096 features is generated

Based on Facebook’s DeepFace method [TYRW14]

Figure: CNN architecture used

Barcelona School of Informatics Face recognition using Deep Learning 23 / 44

Page 40: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Step 4: Compare them

Goal: Perform the comparison with DB to look for a match

Procedure:

1 Given a generated feature vector g

2 Iterates over all people in the DB

3 Each person has N relevant feature vectors F = f1, f2, ...fN4 Distance comparison is performed between g and each fi ∈ F

5 Various selection measures considered: minimum, mean, etc.

Barcelona School of Informatics Face recognition using Deep Learning 24 / 44

Page 41: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Datasets used

Three datasets considered:

Casia dataset: 495,000 pictures / 10,500 people

CACD dataset: 160,000 pictures / 2,000 people

FaceScrub: 100,000 pictures / 500 people

Training: 500,000 pictures / 9,351 people

Testing: 100,000 pictures / 1,671 people

Additionally, to use as a benchmark:

Labeled Faces in the Wild : 13,000 pictures / 5,700 people

Barcelona School of Informatics Face recognition using Deep Learning 25 / 44

Page 42: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Datasets usedGenerated datasets

From training dataset, we generated two extra:

Augmented:

Using data augmentationRandomly modifying light intensityOther data augmentations made not much sense − rotation, scaling,etc.1M instances

Grayscale:

Convert previous dataset to grayscaleAims to make the problem easier for CNNBoth training and testing sets convertedCNN modified accordingly

Barcelona School of Informatics Face recognition using Deep Learning 26 / 44

Page 43: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Datasets usedGenerated datasets

From training dataset, we generated two extra:

Augmented:

Using data augmentationRandomly modifying light intensityOther data augmentations made not much sense − rotation, scaling,etc.1M instances

Grayscale:

Convert previous dataset to grayscaleAims to make the problem easier for CNNBoth training and testing sets convertedCNN modified accordingly

Barcelona School of Informatics Face recognition using Deep Learning 26 / 44

Page 44: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Datasets usedGenerated datasets

From training dataset, we generated two extra:

Augmented:

Using data augmentationRandomly modifying light intensityOther data augmentations made not much sense − rotation, scaling,etc.1M instances

Grayscale:

Convert previous dataset to grayscaleAims to make the problem easier for CNNBoth training and testing sets convertedCNN modified accordingly

Barcelona School of Informatics Face recognition using Deep Learning 26 / 44

Page 45: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Outline

1 Introduction and GoalsIntroductionGoals

2 How it has been approachedProblemsCommon approachesProposed approachDatasets

3 Outcome

4 Conclusions

Barcelona School of Informatics Face recognition using Deep Learning 27 / 44

Page 46: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

How to evaluate their performance?

Face Recognition systems can be evaluated according to:

Face Verification

Face Recognition

Both intrinsically related...... but differently evaluated

Barcelona School of Informatics Face recognition using Deep Learning 28 / 44

Page 47: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

How to evaluate their performance?

Face Recognition systems can be evaluated according to:

Face Verification

Face Recognition

Both intrinsically related...

... but differently evaluated

Barcelona School of Informatics Face recognition using Deep Learning 28 / 44

Page 48: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

How to evaluate their performance?

Face Recognition systems can be evaluated according to:

Face Verification

Face Recognition

Both intrinsically related...... but differently evaluated

Barcelona School of Informatics Face recognition using Deep Learning 28 / 44

Page 49: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face VerificationDescription

Goal: Determining whether two pictures belong to same person:

Needed on most Face Recognition systems

Performance not directly related with Face Recognition step

Commonly used as benchmark to compare methods

The Labeled Faces in the Wild dataset has been used

2000 training pairs / 1000 test pairs

Allowed for hyperparameter tuning

Barcelona School of Informatics Face recognition using Deep Learning 29 / 44

Page 50: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face VerificationExamples

Figure: Example on test pairs

Barcelona School of Informatics Face recognition using Deep Learning 30 / 44

Page 51: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face VerificationProcedure

Comparison performed using Euclidean and Taxicab distances

Weighted variations considered but discarded due to bad results

Training consists in:

1 Obtain distance between all train pairs

2 Find the optimal threshold placement to separate classes

Figure: Example best case scenario Figure: Example more difficult scenario

Barcelona School of Informatics Face recognition using Deep Learning 31 / 44

Page 52: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face VerificationProcedure

Comparison performed using Euclidean and Taxicab distances

Weighted variations considered but discarded due to bad results

Training consists in:

1 Obtain distance between all train pairs

2 Find the optimal threshold placement to separate classes

Figure: Example best case scenario Figure: Example more difficult scenario

Barcelona School of Informatics Face recognition using Deep Learning 31 / 44

Page 53: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face VerificationResults

a

Method Accuracy

Ours 0.896

Joint Bayesian 0.9242

Tom-vs-Pete 0.9330

High-dim LBP 0.9517

TL Joint Bayesian 0.9633

FaceNet 0.9963

DeepFace 0.9735

Human performance 0.9753

Table: Results state of art methods

Reasons

Too few training data

Further need forparameter tuning

Improve distance metric

Barcelona School of Informatics Face recognition using Deep Learning 32 / 44

Page 54: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Results

Figure: Accuracy according todataset

Figure: Accuracy according todistance

Barcelona School of Informatics Face recognition using Deep Learning 33 / 44

Page 55: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionDescription

Goal: Determining who the person is:

Select among a set of people in a DB

Person-wise comparison ⇒ Face Verification

Closest match is selected

Need to determine if there is a match at all

Seemingly more difficult than Face Verification...

... empirical results prove it may not be so

Barcelona School of Informatics Face recognition using Deep Learning 34 / 44

Page 56: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionProcedure

Reminder:

comparing feature vector f with all people in DB

Each person has N feature vectors F = f1, f2, ...fN

Comparison strategies:

1 Distance to closest feature vector in F

2 Mean distance to all fi ∈ F

3 Product of 1 and 2

4 Product of distance to furthest feature vector in f and 3

The smallest distance is chosen as a match

Barcelona School of Informatics Face recognition using Deep Learning 35 / 44

Page 57: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionProcedure

Reminder:

comparing feature vector f with all people in DB

Each person has N feature vectors F = f1, f2, ...fN

Comparison strategies:

1 Distance to closest feature vector in F

2 Mean distance to all fi ∈ F

3 Product of 1 and 2

4 Product of distance to furthest feature vector in f and 3

The smallest distance is chosen as a match

Barcelona School of Informatics Face recognition using Deep Learning 35 / 44

Page 58: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionProcedure

Reminder:

comparing feature vector f with all people in DB

Each person has N feature vectors F = f1, f2, ...fN

Comparison strategies:

1 Distance to closest feature vector in F

2 Mean distance to all fi ∈ F

3 Product of 1 and 2

4 Product of distance to furthest feature vector in f and 3

The smallest distance is chosen as a match

Barcelona School of Informatics Face recognition using Deep Learning 35 / 44

Page 59: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionProcedure

Reminder:

comparing feature vector f with all people in DB

Each person has N feature vectors F = f1, f2, ...fN

Comparison strategies:

1 Distance to closest feature vector in F

2 Mean distance to all fi ∈ F

3 Product of 1 and 2

4 Product of distance to furthest feature vector in f and 3

The smallest distance is chosen as a match

Barcelona School of Informatics Face recognition using Deep Learning 35 / 44

Page 60: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionProcedure

Reminder:

comparing feature vector f with all people in DB

Each person has N feature vectors F = f1, f2, ...fN

Comparison strategies:

1 Distance to closest feature vector in F

2 Mean distance to all fi ∈ F

3 Product of 1 and 2

4 Product of distance to furthest feature vector in f and 3

The smallest distance is chosen as a match

Barcelona School of Informatics Face recognition using Deep Learning 35 / 44

Page 61: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionProcedure

Reminder:

comparing feature vector f with all people in DB

Each person has N feature vectors F = f1, f2, ...fN

Comparison strategies:

1 Distance to closest feature vector in F

2 Mean distance to all fi ∈ F

3 Product of 1 and 2

4 Product of distance to furthest feature vector in f and 3

The smallest distance is chosen as a match

Barcelona School of Informatics Face recognition using Deep Learning 35 / 44

Page 62: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionKeeping Procedure

Each new feature vector f may be kept into the system:

1 If less than T1 feature vectors stored, keep it

2 If distance M between f and mean of F less than T2, discard it

3 If M higher than T3, discard it (extreme outlier)

4 Select the feature vectors - FO - far from mean (outliers)

5 Face Verification between f and all fi ∈ FO6 If less than half matches, keep it (rare enough case)

7 If more than T4 feature vector stored, discard closest to mean

T1, T2, T3 and T4 are hyperparameters

Barcelona School of Informatics Face recognition using Deep Learning 36 / 44

Page 63: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionKeeping Procedure

Each new feature vector f may be kept into the system:

1 If less than T1 feature vectors stored, keep it

2 If distance M between f and mean of F less than T2, discard it

3 If M higher than T3, discard it (extreme outlier)

4 Select the feature vectors - FO - far from mean (outliers)

5 Face Verification between f and all fi ∈ FO6 If less than half matches, keep it (rare enough case)

7 If more than T4 feature vector stored, discard closest to mean

T1, T2, T3 and T4 are hyperparameters

Barcelona School of Informatics Face recognition using Deep Learning 36 / 44

Page 64: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionKeeping Procedure

Each new feature vector f may be kept into the system:

1 If less than T1 feature vectors stored, keep it

2 If distance M between f and mean of F less than T2, discard it

3 If M higher than T3, discard it (extreme outlier)

4 Select the feature vectors - FO - far from mean (outliers)

5 Face Verification between f and all fi ∈ FO6 If less than half matches, keep it (rare enough case)

7 If more than T4 feature vector stored, discard closest to mean

T1, T2, T3 and T4 are hyperparameters

Barcelona School of Informatics Face recognition using Deep Learning 36 / 44

Page 65: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionKeeping Procedure

Each new feature vector f may be kept into the system:

1 If less than T1 feature vectors stored, keep it

2 If distance M between f and mean of F less than T2, discard it

3 If M higher than T3, discard it (extreme outlier)

4 Select the feature vectors - FO - far from mean (outliers)

5 Face Verification between f and all fi ∈ FO6 If less than half matches, keep it (rare enough case)

7 If more than T4 feature vector stored, discard closest to mean

T1, T2, T3 and T4 are hyperparameters

Barcelona School of Informatics Face recognition using Deep Learning 36 / 44

Page 66: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionKeeping Procedure

Each new feature vector f may be kept into the system:

1 If less than T1 feature vectors stored, keep it

2 If distance M between f and mean of F less than T2, discard it

3 If M higher than T3, discard it (extreme outlier)

4 Select the feature vectors - FO - far from mean (outliers)

5 Face Verification between f and all fi ∈ FO6 If less than half matches, keep it (rare enough case)

7 If more than T4 feature vector stored, discard closest to mean

T1, T2, T3 and T4 are hyperparameters

Barcelona School of Informatics Face recognition using Deep Learning 36 / 44

Page 67: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionKeeping Procedure

Each new feature vector f may be kept into the system:

1 If less than T1 feature vectors stored, keep it

2 If distance M between f and mean of F less than T2, discard it

3 If M higher than T3, discard it (extreme outlier)

4 Select the feature vectors - FO - far from mean (outliers)

5 Face Verification between f and all fi ∈ FO

6 If less than half matches, keep it (rare enough case)

7 If more than T4 feature vector stored, discard closest to mean

T1, T2, T3 and T4 are hyperparameters

Barcelona School of Informatics Face recognition using Deep Learning 36 / 44

Page 68: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionKeeping Procedure

Each new feature vector f may be kept into the system:

1 If less than T1 feature vectors stored, keep it

2 If distance M between f and mean of F less than T2, discard it

3 If M higher than T3, discard it (extreme outlier)

4 Select the feature vectors - FO - far from mean (outliers)

5 Face Verification between f and all fi ∈ FO6 If less than half matches, keep it (rare enough case)

7 If more than T4 feature vector stored, discard closest to mean

T1, T2, T3 and T4 are hyperparameters

Barcelona School of Informatics Face recognition using Deep Learning 36 / 44

Page 69: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionKeeping Procedure

Each new feature vector f may be kept into the system:

1 If less than T1 feature vectors stored, keep it

2 If distance M between f and mean of F less than T2, discard it

3 If M higher than T3, discard it (extreme outlier)

4 Select the feature vectors - FO - far from mean (outliers)

5 Face Verification between f and all fi ∈ FO6 If less than half matches, keep it (rare enough case)

7 If more than T4 feature vector stored, discard closest to mean

T1, T2, T3 and T4 are hyperparameters

Barcelona School of Informatics Face recognition using Deep Learning 36 / 44

Page 70: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionKeeping Procedure

Each new feature vector f may be kept into the system:

1 If less than T1 feature vectors stored, keep it

2 If distance M between f and mean of F less than T2, discard it

3 If M higher than T3, discard it (extreme outlier)

4 Select the feature vectors - FO - far from mean (outliers)

5 Face Verification between f and all fi ∈ FO6 If less than half matches, keep it (rare enough case)

7 If more than T4 feature vector stored, discard closest to mean

T1, T2, T3 and T4 are hyperparameters

Barcelona School of Informatics Face recognition using Deep Learning 36 / 44

Page 71: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionDataset

Self-generated dataset, from training dataset:

100 people (50 females / 50 males)

30 training images each

50 training images each

Manually cleaned

Barcelona School of Informatics Face recognition using Deep Learning 37 / 44

Page 72: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionResults

Figure: Accuracy according tonumber kept images

Figure: Accuracy according tocomparison strategy

A 95% of accuracy was reached

Barcelona School of Informatics Face recognition using Deep Learning 38 / 44

Page 73: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Face RecognitionResults

Figure: Accuracy according tonumber kept images

Figure: Accuracy according tocomparison strategy

A 95% of accuracy was reached

Barcelona School of Informatics Face recognition using Deep Learning 38 / 44

Page 74: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Outline

1 Introduction and GoalsIntroductionGoals

2 How it has been approachedProblemsCommon approachesProposed approachDatasets

3 Outcome

4 Conclusions

Barcelona School of Informatics Face recognition using Deep Learning 39 / 44

Page 75: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

To conclude...

We have developed a functional Face Recognition System usingCNNs

Works in uncontrolled environment, capable of on-line learning

Compared with state of art methods, it underperforms in FaceVerification

Quality results achieved in Face Recognition

Exhaustive tests performed − reliable results

Barcelona School of Informatics Face recognition using Deep Learning 40 / 44

Page 76: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

... or not!

Future work lines:

Improve CNN performance:

More dataBetter parameter tuning

Test more comparison metrics:

Further try thresholding strategiesDifferent weights

Enhance matching capabilities:

Use more complex strategies − apart from min, mean, etc.Modify on-line learning mechanism

Consider other alternatives for feature extraction:

Other existing approachesDevelop one on our own

Barcelona School of Informatics Face recognition using Deep Learning 41 / 44

Page 77: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

References I

Tal Hassner, Shai Harel, Eran Paz, and Roee Enbar, Effective facefrontalization in unconstrained images, IEEE Conf. on ComputerVision and Pattern Recognition (CVPR), June 2015.

Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun, Faster r-cnn:Towards real-time object detection with region proposal networks,Advances in Neural Information Processing Systems 28 (C. Cortes,N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, eds.),Curran Associates, Inc., 2015, pp. 91–99.

Yaniv Taigman, Ming Yang, Marc’Aurelio Ranzato, and Lior Wolf,Deepface: Closing the gap to human-level performance in faceverification, Proceedings of the 2014 IEEE Conference on ComputerVision and Pattern Recognition (Washington, DC, USA), CVPR ’14,IEEE Computer Society, 2014, pp. 1701–1708.

Barcelona School of Informatics Face recognition using Deep Learning 42 / 44

Page 78: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Questions?

Any Question?

Barcelona School of Informatics Face recognition using Deep Learning 43 / 44

Page 79: Face recognition using Deep Learning - Master Thesis...Face recognition using Deep Learning Master Thesis Author: Serra, Xavier1 Advisor: Cast an , Javier2 Tutor: Escalera, Sergio3

Thank you!

Thank you for your attention!

Barcelona School of Informatics Face recognition using Deep Learning 44 / 44