Professional Documents
Culture Documents
DeepLearning.AI makes these slides available for educational purposes. You may not use or distribute
these slides for commercial purposes. You may make copies of these slides and use or distribute them for
educational purposes as long as you cite DeepLearning.AI as the source of the slides.
What is face
deeplearning.ai
recognition?
Face recognition
Recognition
• Has a database of K persons
• Get an input image
• Output ID if the image is any of the K persons (or
“not recognized”)
Andrew Ng
Face recognition
One-shot learning
deeplearning.ai
One-shot learning
Learning from one
example to recognize the
person again
Andrew Ng
Learning a “similarity” function
d(img1,img2) = degree of difference between images
If d(img1,img2) ≤ -
> -
Andrew Ng
Face recognition
Siamese network
deeplearning.ai
Siamese network
⋮ ⋮
" ($)
⋮ ⋮
" (&)
[Taigman et. al., 2014. DeepFace closing the gap to human level performance] Andrew Ng
Goal of learning
⋮ ⋮
f(" ($) )
Andrew Ng
Face recognition
Triplet loss
deeplearning.ai
Learning Objective
[Schroff et al.,2015, FaceNet: A unified embedding for face recognition and clustering] Andrew Ng
Loss function
[Schroff et al.,2015, FaceNet: A unified embedding for face recognition and clustering] Andrew Ng
Choosing the triplets A,P,N
[Schroff et al.,2015, FaceNet: A unified embedding for face recognition and clustering] Andrew Ng
Training set using triplet loss
Anchor Positive Negative
⋮ ⋮ ⋮
Andrew Ng
Face recognition
[Taigman et. al., 2014. DeepFace closing the gap to human level performance] Andrew Ng
Face verification supervised learning
$ (
[Taigman et. al., 2014. DeepFace closing the gap to human level performance] Andrew Ng
Neural Style
Transfer
⋮ ⋮ &'
26×26×256 13×13×256 13×13×384 13×13×384 6×6×256
55×55×96
FC FC
224×224×3 110×110×96 4096 4096
[Zeiler and Fergus., 2013, Visualizing and understanding convolutional networks] Andrew Ng
Visualizing deep layers
Andrew Ng
Visualizing deep layers: Layer 1
Andrew Ng
Visualizing deep layers: Layer 2
Andrew Ng
Visualizing deep layers: Layer 3
Andrew Ng
Visualizing deep layers: Layer 3
Andrew Ng
Visualizing deep layers: Layer 4
Andrew Ng
Visualizing deep layers: Layer 5
Andrew Ng
Neural Style
Transfer
Cost function
deeplearning.ai
Neural style transfer cost function
Content C Style S
Generated image G
[Gatys et al., 2015. A neural algorithm of artistic style. Images on slide generated by Justin Johnson] Andrew Ng
Find the generated image G
1. Initiate G randomly
G: 100×100×3
Content cost
deeplearning.ai
function
Content cost function
" # = % "'()*+)* ,, # + / "0*12+ (4, #)
• Say you use hidden layer ! to compute content cost.
• Use pre-trained ConvNet. (E.g., VGG network)
• Let 6[2](9) and 6[2](:) be the activation of layer !
on the images
• If 6[2](9) and 6[2](:) are similar, both images have
similar content
"#
34 83
123 94 44 187
2 30
34 44 187 192
34 44 187 92 124
34 76 232
34 76 232 34
67 232
346776 83 124
194 142
⋮
83 194 94
67 83 194 202
%' %'
%( %(
%& %&
1D and 3D
deeplearning.ai
generalizations of
models
Convolutions in 2D and 1D
∗
2D filter
5×5
2D input image
14×14
1 20 15 3 18 12 4 17 1 3 10 3 1
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D data
Andrew Ng
3D convolution
∗
3D filter
3D volume
Andrew Ng