face recognition and feature subspaces devi parikh virginia tech 11/07/13 slides borrowed from derek...

59
Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik, Silvio Savarese, Fei-Fei Li Chuck Close, self portrait Lucas by Chuck Close 1

Upload: alison-whitehead

Post on 26-Dec-2015

215 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Face Recognition and Feature Subspaces

Devi ParikhVirginia Tech

11/07/13

Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik, Silvio Savarese, Fei-Fei Li

Chuck Close, self portraitLucas by Chuck Close

1

Page 2: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

This class: face recognition

• Two methods: “Eigenfaces” and “Fisherfaces”• Feature subspaces: PCA and FLD

• Look at results from recent vendor test

• Look at interesting findings about human face recognition

2

Page 3: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Applications of Face Recognition• Surveillance

3

Page 4: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Applications of Face Recognition• Album organization: iPhoto 2009

http://www.apple.com/ilife/iphoto/ 4

Page 5: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Facebook friend-tagging with auto-suggest

5

Page 6: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Face recognition: once you’ve detected and cropped a face, try to recognize it

Detection Recognition “Sally”

6

Page 7: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Face recognition: overview

• Typical scenario: few examples per face, identify or verify test example

• What’s hard: changes in expression, lighting, age, occlusion, viewpoint

• Basic approaches (all nearest neighbor)1. Project into a new subspace (or kernel space)

(e.g., “Eigenfaces”=PCA)2. Measure face features3. Make 3d face model, compare

shape+appearance (e.g., AAM)7

Page 8: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Typical face recognition scenarios

• Verification: a person is claiming a particular identity; verify whether that is true– E.g., security

• Closed-world identification: assign a face to one person from among a known set

• General identification: assign a face to a known person or to “unknown”

8

Page 9: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

What makes face recognition hard?

Expression

9

Page 10: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

What makes face recognition hard?

Lighting

10

Page 11: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

What makes face recognition hard?

Occlusion

11

Page 12: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

What makes face recognition hard?

Viewpoint

12

Page 13: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Simple idea for face recognition

1. Treat face image as a vector of intensities

2. Recognize face by nearest neighbor in database

x

nyy ...1

xy kk

k argmin

13

Page 14: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

The space of all face images• When viewed as vectors of pixel values, face images are

extremely high-dimensional– 100x100 image = 10,000 dimensions– Slow and lots of storage

• But very few 10,000-dimensional vectors are valid face images

• We want to effectively model the subspace of face images

14

Page 15: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

The space of all face images• Eigenface idea: construct a low-dimensional linear

subspace that best explains the variation in the set of face images

15

Page 16: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Principal Component Analysis (PCA)

• Given: N data points x1, … ,xN in Rd

• We want to find a new set of features that are linear combinations of original ones:

u(xi) = uT(xi – µ)

(µ: mean of data points)

• Choose unit vector u in Rd that captures the most data variance

Forsyth & Ponce, Sec. 22.3.1, 22.3.2 16

Page 17: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Principal Component Analysis• Direction that maximizes the variance of the projected data:

Projection of data point

Covariance matrix of data = XXT

The direction that maximizes the variance is the eigenvector associated with the largest eigenvalue of Σ

N

N

1/N

Maximizesubject to ||u||=1

17

Page 18: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Implementation issue

• Covariance matrix is huge (M2 for M pixels)• But typically # examples << M• Simple trick

– X is MxN matrix of normalized training data– Solve for eigenvectors u of XTX instead of XXT

– XTXu = lu– XXTXu = lXu– (XXT)Xu = l(Xu).

– Then Xu is eigenvector of covariance XXT

– Need to normalize each vector of Xu into unit length

18

Page 19: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Eigenfaces (PCA on face images)1. Compute the principal components (“eigenfaces”)

of the covariance matrix

2. Keep K eigenvectors with largest eigenvalues

3. Represent all face images in the dataset as linear combinations of eigenfaces

– Perform nearest neighbor on these coefficients

M. Turk and A. Pentland, Face Recognition using Eigenfaces, CVPR 1991

𝑽=𝑽 (: ,largest eig)

𝑿 𝒑𝒄𝒂=𝑽 (: ,largesteig )𝑻 𝑿19

Page 20: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Eigenfaces example

• Training images• x1,…,xN

20

Page 21: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Eigenfaces exampleTop eigenvectors: u1,…uk

Mean: μ

21

Page 22: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Visualization of eigenfacesPrincipal component (eigenvector) uk

μ + 3σkuk

μ – 3σkuk

22

Page 23: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Representation and reconstruction• Face x in “face space” coordinates:

=

23

Page 24: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Representation and reconstruction• Face x in “face space” coordinates:

• Reconstruction:

= +

µ + w1u1+w2u2+w3u3+w4u4+ …

=

^x =

24

Page 25: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

P = 4

P = 200

P = 400

Reconstruction

After computing eigenfaces using 400 face images from ORL face database

25

Page 26: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Eigenvalues (variance along eigenvectors)

26

Page 27: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

NotePreserving variance (minimizing MSE) does not necessarily lead to qualitatively good reconstruction.

P = 200

27

Page 28: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Recognition with eigenfacesProcess labeled training images• Find mean µ and covariance matrix Σ• Find k principal components (eigenvectors of Σ) u1,…uk

• Project each training image xi onto subspace spanned by principal components:(wi1,…,wik) = (u1

T(xi – µ), … , ukT(xi – µ))

Given novel image x• Project onto subspace:

(w1,…,wk) = (u1T(x – µ), … , uk

T(x – µ))• Optional: check reconstruction error x – x to determine

whether image is really a face• Classify as closest training face in k-dimensional subspace

^

M. Turk and A. Pentland, Face Recognition using Eigenfaces, CVPR 199128

Page 29: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

PCA

• General dimensionality reduction technique

• Preserves most of variance with a much more compact representation– Lower storage requirements (eigenvectors + a few

numbers per face)– Faster matching

• What are the problems for face recognition?29

Page 30: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Limitations

Global appearance method: not robust to misalignment, background variation

30

Page 31: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Limitations• The direction of maximum variance is not always

good for classification

31

Page 32: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

A more discriminative subspace: FLD• Fisher Linear Discriminants “Fisher Faces”

• PCA preserves maximum variance

• FLD preserves discrimination– Find projection that maximizes scatter between

classes and minimizes scatter within classes

Reference: Eigenfaces vs. Fisherfaces, Belheumer et al., PAMI 1997

32

Page 33: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Comparing with PCA

33

Page 34: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Variables

• N Sample images: • c classes:

• Average of each class:

• Average of all data:

Nxx ,,1

c ,,1

ikx

ki

i xN

1

N

kkxN 1

1

34

Page 35: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Scatter Matrices

• Scatter of class i: Tikx

iki xxSik

c

iiW SS

1

c

i

TiiiB NS

1

• Within class scatter:

• Between class scatter:

35

Page 36: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Illustration

2S

1S

BS

21 SSSW

x1

x2Within class scatter

Between class scatter

36

Page 37: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Mathematical Formulation• After projection

– Between class scatter– Within class scatter

• Objective

• Solution: Generalized Eigenvectors

• Rank of Wopt is limited

– Rank(SB) <= |C|-1

– Rank(SW) <= N-C

kT

k xWy

WSWS BT

B ~

WSWS WT

W ~

WSW

WSW

S

SW

WT

BT

W

Bopt

WWmax arg~

~max arg

miwSwS iWiiB ,,1

37

Page 38: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Illustration

2S

1S

BS

21 SSSW

x1

x2

38

Page 39: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Recognition with FLD• Use PCA to reduce dimensions to N-C

• Compute within-class and between-class scatter matrices for PCA coefficients

• Solve generalized eigenvector problem

• Project to FLD subspace (c-1 dimensions)

• Classify by nearest neighbor

WSW

WSWW

WT

BT

fldW

max arg miwSwS iWiiB ,,1

Tikx

iki xxSik

c

iiW SS

1

c

i

TiiiB NS

1

xWx Toptˆ

)pca( XWpca

𝑊 𝑇𝑜𝑝𝑡=𝑊𝑇 𝑓𝑙𝑑𝑊𝑇𝑝𝑐𝑎Note: x in step 2 refers to PCA coef; x in step 4 refers to original data

39

Page 40: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Results: Eigenface vs. Fisherface

• Variation in Facial Expression, Eyewear, and Lighting

• Input:160 images of 16 people• Train:159 images• Test: 1 image

With glasses

Without glasses

3 Lighting conditions

5 expressions

Reference: Eigenfaces vs. Fisherfaces, Belheumer et al., PAMI 199740

Page 42: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Large scale comparison of methods• FRVT 2006 Report• Not much (or any) information available about

methods, but gives idea of what is doable

42

Page 43: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

FVRT Challenge

• Frontal faces– FVRT2006 evaluation

False Rejection Rate at False Acceptance Rate = 0.001

43

Page 44: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

FVRT Challenge

• Frontal faces– FVRT2006 evaluation: controlled illumination

44

Page 45: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

FVRT Challenge

• Frontal faces– FVRT2006 evaluation: uncontrolled illumination

45

Page 46: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

FVRT Challenge

• Frontal faces– FVRT2006 evaluation: computers win!

46

Page 48: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

48

Page 49: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

49

Page 50: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

50

Page 51: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

51

Page 52: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

52

Page 53: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

53

Page 54: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

54

Page 55: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

55

Page 56: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

56

Page 57: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Things to remember

• PCA is a generally useful dimensionality reduction technique– But not ideal for discrimination

• FLD better for discrimination, though only ideal under Gaussian data assumptions

• Computer face recognition works very well under controlled environments – still room for improvement in general conditions

57

Page 58: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Next class• Video processing

58

Page 59: Face Recognition and Feature Subspaces Devi Parikh Virginia Tech 11/07/13 Slides borrowed from Derek Hoiem, who borrowed some slides from Lana Lazebnik,

Questions?

See you Tuesday!

59Slide credit: Devi Parikh