Face identification
St Stanfor
- rd University
05-Nov-2019 1
Lecture: Face Recognition
Juan Carlos Niebles and Ranjay Krishna Stanford Vision and Learning Lab
Lecture: Face Recognition Juan Carlos Niebles and Ranjay Krishna - - PowerPoint PPT Presentation
Face identification Lecture: Face Recognition Juan Carlos Niebles and Ranjay Krishna Stanford Vision and Learning Lab 05-Nov-2019 1 St Stanfor ord University CS 131 Roadmap Face identification Pixels Segments Images Videos Web
Face identification
St Stanfor
05-Nov-2019 1
Juan Carlos Niebles and Ranjay Krishna Stanford Vision and Learning Lab
Face identification
St Stanfor
05-Nov-2019 2
Convolutions Edges Descriptors
Resizing Segmentation Clustering Recognition Detection Machine learning
Motion Tracking
Neural networks Convolutional neural networks
Face identification
St Stanfor
05-Nov-2019 3
Face identification
St Stanfor
05-Nov-2019 4
the image to get the desired output:
Slide credit: L. Lazebnik Dataset: ETH-80, by B. Leibe
Face identification
St Stanfor
05-Nov-2019 5
Training Images Image Features
Face identification
St Stanfor
05-Nov-2019 6
Training Labels Training Images Training Image Features
Face identification
St Stanfor
05-Nov-2019 7
Training Labels Training Images Training Image Features Learned Classifier
Face identification
St Stanfor
05-Nov-2019 8
Training Labels Training Images Training Image Features Image Features
Test Image
Learned Classifier
Face identification
St Stanfor
05-Nov-2019 9
Prediction
Training Labels Training Images Training Image Features Image Features
Test Image
Learned Classifier Learned Classifier
Face identification
St Stanfor
05-Nov-2019 10
Prediction
Training Labels Training Images Training Image Features Image Features
Test Image
Learned Classifier Learned Classifier
Face identification
St Stanfor
05-Nov-2019 11
Input image
Color: Quantize RGB values
Invariance? ? Translation ? Scale ? Rotation ? Occlusion
Face identification
St Stanfor
05-Nov-2019 12
Input image
Color: Quantize RGB values
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Face identification
St Stanfor
05-Nov-2019 13
Input image
Color: Quantize RGB values
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Global shape: PCA space
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Face identification
St Stanfor
05-Nov-2019 14
Input image
Color: Quantize RGB values
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Global shape: PCA space
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Face identification
St Stanfor
05-Nov-2019 15
Input image
Color: Quantize RGB values
Invariance? ? Translation ? Scale ? Rotation ? Occlusion
Global shape: PCA space
Invariance? ? Translation ? Scale ? Rotation ? Occlusion
Local shape: shape context
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Face identification
St Stanfor
05-Nov-2019 16
Input image
Color: Quantize RGB values
Invariance? ? Translation ? Scale ? Rotation ? Occlusion
Global shape: PCA space
Invariance? ? Translation ? Scale ? Rotation ? Occlusion
Local shape: shape context
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Face identification
St Stanfor
05-Nov-2019 17
Input image
Color: Quantize RGB values
Invariance? ? Translation ? Scale ? Rotation ? Occlusion
Global shape: PCA space
Invariance? ? Translation ? Scale ? Rotation ? Occlusion
Local shape: shape context
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Texture: Filter banks
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Face identification
St Stanfor
05-Nov-2019 18
Input image
Color: Quantize RGB values
Invariance? ? Translation ? Scale ? Rotation ? Occlusion
Global shape: PCA space
Invariance? ? Translation ? Scale ? Rotation ? Occlusion
Local shape: shape context
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Texture: Filter banks
Invariance? ? Translation ? Scale ? Rotation (in-planar) ? Occlusion
Face identification
St Stanfor
05-Nov-2019 19
Prediction
Training Labels Training Images Training Image Features Image Features
Test Image
Learned Classifier Learned Classifier
Face identification
St Stanfor
05-Nov-2019 20
Training examples from class 1 Training examples from class 2
Slide credit: L. Lazebnik
Face identification
St Stanfor
05-Nov-2019 21
Prediction
Training Labels Training Images Training Image Features Image Features
Test Image
Learned Classifier Learned Classifier
Face identification
St Stanfor
05-Nov-2019 22
Test example Training examples from class 1 Training examples from class 2
Slide credit: L. Lazebnik
Face identification
St Stanfor
05-Nov-2019 23
Face identification
St Stanfor
05-Nov-2019 24
Face identification
St Stanfor
05-Nov-2019 25
2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12
Face identification
St Stanfor
05-Nov-2019 26
Face identification
St Stanfor
05-Nov-2019 27
2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12 2 4 6 8 10 12
Face identification
St Stanfor
05-Nov-2019 28
Turk and Pentland, Eigenfaces for Recognition, Journal of Cognitive Neuroscience 3 (1): 71–86.
Using Class Specific Linear Projection". IEEE Transactions on pattern analysis and machine intelligence 19 (7): 711. 1997.
Face identification
St Stanfor
05-Nov-2019 29
Courtesy of Johannes M. Zanker
Face identification
St Stanfor
05-Nov-2019 30
Kanwisher, et al. 1997
Face identification
St Stanfor
05-Nov-2019 31
Detection finds the faces in images Recognition recognizes WHO the person is
Face identification
St Stanfor
05-Nov-2019 32
Face identification
St Stanfor
05-Nov-2019 33
Face identification
St Stanfor
05-Nov-2019 34
Face identification
St Stanfor
05-Nov-2019 35
Face identification
St Stanfor
05-Nov-2019 36
Face identification
St Stanfor
05-Nov-2019 37
Face identification
St Stanfor
05-Nov-2019 38
dimensional space
– If represented in grayscale intensity, an N x M image is a point in RNM – E.g. 100x100 image = 10,000 dim
Slide credit: Chuck Dyer, Steve Seitz, Nishino
Face identification
St Stanfor
05-Nov-2019 39
Face identification
St Stanfor
05-Nov-2019 40
dimensional space
– If represented in grayscale intensity, an N x M image is a point in RNM – E.g. 100x100 image = 10,000 dim
dimensional vectors correspond to valid face images
subspace of face images
Slide credit: Chuck Dyer, Steve Seitz, Nishino
Face identification
St Stanfor
05-Nov-2019 41
Face identification
St Stanfor
05-Nov-2019 42
subspace has the largest variance among all n-dim subspaces.
Face identification
St Stanfor
05-Nov-2019 43
captures key appearance characteristics of the visual DOFs.
(dimensionality reduction)
and measuring the EUCLIDEAN distance between them.
Face identification
St Stanfor
05-Nov-2019 44
Turk and Pentland, Eigenfaces for Recognition, Journal of Cognitive Neuroscience 3 (1): 71–86.
Using Class Specific Linear Projection". IEEE Transactions on pattern analysis and machine intelligence 19 (7): 711. 1997.
Face identification
St Stanfor
05-Nov-2019 45
the first k (k<<d) directions of maximum variance
Face identification
St Stanfor
05-Nov-2019 46
Face identification
St Stanfor
05-Nov-2019 47
Mean: μ
Face identification
St Stanfor
05-Nov-2019 48
Principal component (eigenvector) ɸk μ + 3σkɸk μ – 3σkɸk
Face identification
St Stanfor
05-Nov-2019 49
Note that each image is formulated into a long vector!
µ = 1 N xi
Face identification
St Stanfor
05-Nov-2019 50
4. Compute the covariance matrix 5. Compute the eigenvectors of the covariance matrix Σ 6. Compute each training image xi ‘s projections as 7. Visualize the estimated training face xi
xi → xi
c ⋅φ1, xi c ⋅φ2,..., xi c ⋅φK
xi ≈ µ + a1φ1 + a2φ2 +...+ aKφK
Face identification
St Stanfor
05-Nov-2019 51
6. Compute each training image xi ‘s projections as 7. Visualize the reconstructed training face xi
xi → xi
c ⋅φ1, xi c ⋅φ2,..., xi c ⋅φK
xi ≈ µ + a1φ1 + a2φ2 +...+ aKφK
a1φ1 a2φ2 aKφK ...
Reconstructed training face
𝑦"
Face identification
St Stanfor
05-Nov-2019 52
Face identification
St Stanfor
05-Nov-2019 53
discrimination between faces.
K = 4 K = 200 K = 400
Face identification
St Stanfor
05-Nov-2019 54
1. Take query image t 2. Project into eigenface space and compute projection 3. Compare projection w with all N training projections
(note: this “K” refers to the k-NN algorithm, is different from the previous K’s referring to the # of principal components)
t → (t −µ)⋅φ1, (t −µ)⋅φ2,..., (t −µ)⋅φK
Face identification
St Stanfor
05-Nov-2019 56
–All faces centered in frame –Same size –Some sensitivity to angle
–“Learn” one set of PCA vectors for each angle –Use the one with lowest error
–(sometimes this is good!) –Doesn’t know that faces are wrapped around 3D objects (heads) –Makes no effort to preserve class distinctions
Face identification
St Stanfor
05-Nov-2019 57
dimensional basis, but may NOT be optimal for discrimination… Is there a better dimensionality reduction?
Face identification
St Stanfor
05-Nov-2019 58
Face identification
St Stanfor
05-Nov-2019 59
Face identification
St Stanfor
05-Nov-2019 60
Face identification
St Stanfor
05-Nov-2019 61
Face identification
St Stanfor
05-Nov-2019 62
Turk and Pentland, Eigenfaces for Recognition, Journal of Cognitive Neuroscience 3 (1): 71–86.
Using Class Specific Linear Projection". IEEE Transactions on pattern analysis and machine intelligence 19 (7): 711. 1997.
Face identification
St Stanfor
05-Nov-2019 63
Face identification
St Stanfor
05-Nov-2019 64
Slide inspired by N. Vasconcelos
Face identification
St Stanfor
05-Nov-2019 65
– Find projection that maximizes scatter between classes and minimizes scatter within classes
Face identification
St Stanfor
05-Nov-2019 66
Poor Projection
x1 x2 x1 x2
Good
Face identification
St Stanfor
05-Nov-2019 67
Face identification
St Stanfor
05-Nov-2019 68
points from x to a new space (For this example, assume m == 1):
Face identification
St Stanfor
05-Nov-2019 69
Slide inspired by N. Vasconcelos
Between class scatter Within class scatter
Face identification
St Stanfor
05-Nov-2019 70
The following objective function: Can be written as
Face identification
St Stanfor
05-Nov-2019 71
Slide inspired by N. Vasconcelos
Face identification
St Stanfor
05-Nov-2019 72
Slide inspired by N. Vasconcelos
Face identification
St Stanfor
05-Nov-2019 73
Slide inspired by N. Vasconcelos
Face identification
St Stanfor
05-Nov-2019 74
2
S
1
S
B
S
2 1
S S SW + =
x1 x2
Within class scatter Between class scatter
Face identification
St Stanfor
05-Nov-2019 75
denominator constant, i.e.
we define the Lagrangian as
Slide inspired by N. Vasconcelos
Face identification
St Stanfor
05-Nov-2019 76
With respect to w to zeros we get
exists
Slide inspired by N. Vasconcelos
Face identification
St Stanfor
05-Nov-2019 77
Slide inspired by N. Vasconcelos
Face identification
St Stanfor
05-Nov-2019 78
Face identification
St Stanfor
05-Nov-2019 79
{ }
N
x x , ,
1 !
å =
= N k k
x N
1
1 µ
å =
Î
i k
x k i i
x N
c
µ 1
Face identification
St Stanfor
05-Nov-2019 80
=
=
c i i W
S S
1
( )( )
T i k x i k i
x x S
i k
µ µ
c
Î
𝑇( = )
"*+ ,
)
(𝜈" − 𝜈-)(𝜈" − 𝜈-)&
Face identification
St Stanfor
05-Nov-2019 81
such that the projection converts all the points from x to a new space z:
W S W S
B T B =
~ W S W S
W T W =
~
W S W W S W S S W
W T B T W B
W W
max arg ~ ~ max arg = =
Face identification
St Stanfor
05-Nov-2019 82
W T B T
W
i W i i B
Face identification
St Stanfor
05-Nov-2019 83
m i w S w S
i W i i B
, , 1 ! = = l
Face identification
St Stanfor
05-Nov-2019 84
face space
while minimising the within class scatter.
Face identification
St Stanfor
05-Nov-2019 85
Face identification
St Stanfor
05-Nov-2019 86
1 image
With glasses Without glasses 3 Lighting conditions 5 expressions
Face identification
St Stanfor
05-Nov-2019 87
Face identification
St Stanfor
05-Nov-2019 88
Turk and Pentland, Eigenfaces for Recognition, Journal of Cognitive Neuroscience 3 (1): 71–86.
Using Class Specific Linear Projection". IEEE Transactions on pattern analysis and machine intelligence 19 (7): 711. 1997.