lecture 1: introduction to “computer vision”class.vision/96-97/13-face.pdf · deepface closing...

14
Lecture 13 - SRTTU A.Akhavan Lecture 13: Face Alireza Akhavan Pour سهشنبه- ۲۵ اردیبهشت۱۳۹۷ 1 CLASS.VISION

Upload: others

Post on 19-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

Lecture 13 -SRTTU – A.Akhavan

Lecture 13:

Face

Alireza Akhavan Pour

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

CLASS.VISION

Page 2: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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

Page 3: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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

One-shot learningLearning from one

example to recognize the

person again

Page 4: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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

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

If d(img1,img2) ≤ 𝜏

> 𝜏

Page 5: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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

Siamese network

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

⋮ ⋮

𝑥(1)

⋮ ⋮

𝑥(2)

Page 6: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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.

Page 7: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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

Page 8: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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]

Page 9: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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]

Page 10: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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

Training set using triplet lossAnchor Positive Negative

⋮ ⋮ ⋮

Page 11: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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

Face verification and binary classification

Page 12: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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

Learning the similarity function⋮

f(𝑥(𝑖))

f(𝑥(𝑗))

𝑥(𝑖)

𝑥(𝑗)

𝑦

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

Page 13: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

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]

Page 14: Lecture 1: Introduction to “Computer Vision”class.vision/96-97/13-face.pdf · DeepFace closing the gap to human level performance] SRTTU – A.Akhavan Lecture 13 - 13 ۱۳۹۷تشهبیدرا۲۵–هبنشهس

Lecture 13 -SRTTU – A.Akhavan

منابع

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

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