Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing...

Post on 19-Jul-2020

0 views 0 download

Transcript of Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing...

Lecture 13 -SRTTU – A.Akhavan

Lecture 13:

Face

Alireza Akhavan Pour

۱۳۹۷1اردیبهشت‌۲۵-سه‌شنبه‌

CLASS.VISION

Lecture 13 -SRTTU – A.Akhavan 2 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Face verification vs. face recognitionVerification

• Input image, name/ID

• Output whether the input image is that of the

claimed person

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”)

Lecture 13 -SRTTU – A.Akhavan 3 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

One-shot learningLearning from one

example to recognize the

person again

Lecture 13 -SRTTU – A.Akhavan 4 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Learning a “similarity” functiond(img1,img2) = degree of difference between images

If d(img1,img2) ≤ 𝜏

> 𝜏

Lecture 13 -SRTTU – A.Akhavan 5 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Siamese network

[Taigman et. al., 2014. DeepFace closing the gap to human level performance]

⋮ ⋮

𝑥(1)

⋮ ⋮

𝑥(2)

Lecture 13 -SRTTU – A.Akhavan 6 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Goal of learning

f(𝑥(1))

Parameters of NN define an encoding 𝑓(𝑥 𝑖 )

Learn parameters so that:

If 𝑥 𝑖 , 𝑥 𝑗 are the same person, f 𝑥 𝑖 − f 𝑥 𝑗 2is small.

If 𝑥 𝑖 , 𝑥 𝑗 are different persons, f 𝑥 𝑖 − f 𝑥 𝑗 2is large.

Lecture 13 -SRTTU – A.Akhavan 7 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Learning Objective

[Schroff et al.,2015, FaceNet: A unified embedding for face recognition and clustering]

Anchor Positive Anchor Negative

Lecture 13 -SRTTU – A.Akhavan 8 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Loss function

Training set: 10k pictures of 1k persons

[Schroff et al.,2015, FaceNet: A unified embedding for face recognition and clustering]

Lecture 13 -SRTTU – A.Akhavan 9 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Choosing the triplets A,P,NDuring training, if A,P,N are chosen randomly,

𝑑 𝐴, 𝑃 + 𝛼 ≤ 𝑑(𝐴,𝑁) is easily satisfied.

Choose triplets that’re “hard” to train on.

[Schroff et al.,2015, FaceNet: A unified embedding for face recognition and clustering]

Lecture 13 -SRTTU – A.Akhavan 10 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Training set using triplet lossAnchor Positive Negative

⋮ ⋮ ⋮

Lecture 13 -SRTTU – A.Akhavan 11 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Face verification and binary classification

Lecture 13 -SRTTU – A.Akhavan 12 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Learning the similarity function⋮

f(𝑥(𝑖))

f(𝑥(𝑗))

𝑥(𝑖)

𝑥(𝑗)

𝑦

[Taigman et. al., 2014. DeepFace closing the gap to human level performance]

Lecture 13 -SRTTU – A.Akhavan 13 ۱۳۹۷اردیبهشت‌۲۵–سه‌شنبه‌

Face verification supervised learning𝑥 𝑦

1

0

0

1

[Taigman et. al., 2014. DeepFace closing the gap to human level performance]

Lecture 13 -SRTTU – A.Akhavan

منابع

• https://www.coursera.org/specializations/deep-learning

14 ۱۳۹۷اردیبهشت‌۱۸-سه‌شنبه‌