1 of 140

حامیان دوره

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

2 of 140

بازشناسی چهره��Deep Face Recognition�& One-Shot Learning�

Alireza Akhavanpour

2

March 2021

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

3 of 140

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

4 of 140

کاربردها...

  • چین با به کار گیری سیستم تشخیص چهرهSkynet در دو سال 2000 مجرم را که توسط سیستم بازشناسی و تطبیق چهره شناسایی شد دستگیر کرده است.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

5 of 140

کاربردها...

  • در بانک ABC چین دیگر نیازی به کارت برای برداشت پول از حساب نیست و این عملیات فقط با اسکن چهره انجام می شود.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

6 of 140

کاربردها...

  • حل مشکل مصرف بیش از حد دستمال توالت در چین با الگوریتم بازشناسی چهره!

در این روش در هر بار درخواست، چهره ی فرد اسکن شده و سپس قطعه دستمالی به طول 60 سانتیمتر توسط دستگاه به وی داده میشود. دستگاه تصویر چهره فرد را برای 9 دقیقه ذخیره میکند و در طول این 9 دقیقه با استفاده از تطبیق چهره از ارائه مجدد دستمال به فرد خود داری میکند!!!

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

7 of 140

کاربردها...

  • در انگلیس اولین مجرم را با سیستم شناسایی چهره با تشخیص دوربین نصب شده روی ون دستگیر کردند.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

8 of 140

کاربردها...

  • یافتن حساب شبکه اجتماع فرد با تنها یک عکس گرفته شده در مترو در روسیه

اپلیکیشن FindFace این کار را با بررسی عکس چهره‌ی فرد و مقایسه با بیش از ۲۰۰ میلیون عکس پروفایل کاربران محبوب‌ترین شبکه‌ی اجتماعی روسیه،VK، انجام می‌دهد. در سپتامبر ۲۰۱۷، شهرداری مسکو اعلام کرد که حدود ۵۰۰۰ دوربین مداربسته‌ی این شهر را مجهز به این اپلیکیشن کرده تا افراد تحت تعقیب به‌صورت خودکار شناسایی شوند. بنا به گفته‌ی مقامات مسکو، از زمان راه اندازی این تکنولوژی،۶ نفر دستگیر شده‌اند. (منبع)

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

9 of 140

کاربردها...

  • پلیس چین در کنسرت پاپ با استفاده از «تشخیص چهره» مجرم را دستگیر کرد

تکنولوژی تشخیص چهره در کنسرت جکی چونگ، خواننده محبوب چینی اجرا شده و مجرم دستگیر شده است. یعنی کنسرتی که حداقل ۶۰ هزارنفر در آن شرکت داشتند.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

10 of 140

کاربردها...�احراز هویت آنلاین

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

11 of 140

مراحل اصلی در یک سامانه بازشناسی چهره

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

12 of 140

بازشناسی چهره(Face Recognition)

  • تایید/تصدیق (verification)
    • 1:1 face recognition
    • ورودی: تصویر، نام/ID
    • خروجی: تصویر آیا واقعا متعلق به فرد ادعا شده است؟
  • تعیین هویت (identification)
    • 1 :N face recognition
    • دیتابیسی از K فرد داریم.
    • یک تصویر ورودی داده می‌شود.
    • خروجی: ID فرد بازشناسی شده اگر جزو K نفر باشد. (یا «شناخته نشد!»)

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

13 of 140

پروتکل های ارزیابی

  • probe (or query) set
  • gallery (or database) set

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

14 of 140

تقسیم بندی بر اساس پروتکل‌های ارزیابی

  • Closed-set protocol
    • یکسانی هویت‌ها زمان ارزیابی و تست با هویت‌های زمان آموزش
  • open-set protocol
    • تفاوت هویت های زمان ارزیابی و تست با هویت‌های زمان آموزش

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

15 of 140

in-the-wild concept

(b) H.-W. Ng and S. Winkler. A data-driven approach to cleaning large face datasets. In Image Processing (ICIP), 2014 IEEE International Conference on, pages 343–347. IEEE,2014. 9, 25

(a) R. Gross, I. Matthews, J. Cohn, T. Kanade, and S. Baker. Multi-pie. Image and Vision Computing, 28(5):807–813, 2010. 9

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

16 of 140

End-to-end pipeline

  1. Detection
  2. Preprocessing
  3. Feature extraction
  4. Classification

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

17 of 140

داده های ارزیابی رایج و تحلیل Benchmarkها

  • LFW
  • PubFig
  • YTF
  • CFP
  • CACD
  • PIPA
  • MegaFace
  • IJB-C

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

18 of 140

داده های ارزیابی رایج و تحلیل Benchmarkها

  • LFW
  • PubFig
  • YTF
  • CFP
  • CACD
  • PIPA
  • MegaFace
  • IJB-C

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

19 of 140

مجموعه داده ارزیابی LFW

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

20 of 140

مجموعه داده ارزیابی MegaFace

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

21 of 140

مجموعه داده های آموزش

  • مجموعه‌داده CASIA Web-Face

    • این مجموعه‌داده شامل 453453 تصویر چهره متفاوت از 10575 فرد است.
    • این مجموعه‌داده پاک و بدون نویز و اشتباه است.
    • www.cbsr.ia.ac.cn/english/CASIA-WebFace-Datab

  • مجموعه‌داده MS-Celeb-1M

    • این مجموعه‌داده به‌مراتب مجموعه‌داده‌ی بزرگ‌تری محسوب می‌شود.
    • این مجموعه شامل بیش از 8 میلیون تصویر چهره متفاوت از 100 هزار فرد است[41].
    • برخلاف قبلی این مجموعه‌داده با نویز و برچسب اشتباه همراه است.
    • https://www.microsoft.com/en-us/research/project/ms-celeb-1m-challenge-recognizing-one-million-celebrities-real-world/
  • مجموعه‌داده VGGFace2

    • محققان دانشگاه آکسفورد نسخه 2 مجموعه‌داده‌ی VGGFace را با 3.31میلیون تصویر از 9131 فرد مختلف ارائه کردند. این تصاویر با کمک جست‌و‌جوی تصویر گوگل جمع‌آوری‌شده و در تغییرات مختلف برای هر فرد نظیر سن، جهت، نو و ... هستند. این مجموعه‌داده شامل افراد مختلفی نظیر سیاست‌مداران، ورزشکاران، بازیگران و ... است و به‌طور تقریبی از هر فرد 362 تصویر مختلف موجود است.
    • http://www.robots.ox.ac.uk/~vgg/data/vgg_face2/

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

22 of 140

One-Shot Learning

  • One-shot learning is a classification task where one, or a few examples are used to classify many new examples in the future.

The Omniglot dataset:

  • 1,623 characters
  • 50 different alphabets
  • 20 examples for each character

https://github.com/brendenlake/omniglot/

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

23 of 140

meta-learning problem for few-shot classification

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

24 of 140

It is hard!

Humans learn new concepts with very little supervision – e.g. a child can generalize the concept of “giraffe” from a single picture in a book – yet our best deep learning systems need hundreds or thousands of examples.

— Matching Networks for One Shot Learning, 2017.

http://papers.nips.cc/paper/6385-matching-networks-for-one-shot-learning

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

25 of 140

One-shot learning is related to but different from zero-shot learning!

This should be distinguished from zero-shot learning, in which the model cannot look at any examples from the target classes.

— Siamese Neural Networks for One-shot Image Recognition, 2015.

https://www.cs.cmu.edu/~rsalakhu/papers/oneshot1.pdf

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

26 of 140

One-shot learning

    • آموزش از روی یک نمونه برای بازشناختن مجدد فرد

CNN

Softmax(5)

    • مشکلات
      • تصاویر بسیار کم.
      • اگر فرد جدید اضافه شود؟

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

27 of 140

Siamese Network

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

28 of 140

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

Siamese network

 

 

 

 

 

 

Softmax

128

 

 

 

 

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

29 of 140

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

30 of 140

Let’s code

  • 1-OneShot(siamese).ipynb

https://colab.research.google.com/github/Alireza-Akhavan/deep-face-recognition/blob/master/aaiss2020/1-OneShot(siamese).ipynb

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

31 of 140

Signature Verification using a “Siamese”

Verification consists of comparing an extracted feature vector with a stored feature vector for the signer. Signatures closer to this stored representation than a chosen threshold are accepted, all other signatures are rejected as forgeries.

— Signature Verification using a “Siamese” Time Delay Neural Network, 1993.

http://papers.nips.cc/paper/769-signature-verification-using-a-siamese-time-delay-neural-network.pdf

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

32 of 140

Siamese Neural Networks for�One-Shot Image Recognition

Siamese networks were used more recently, where deep convolutional neural networks were used in parallel image inputs in a 2015 paper by Gregory Koch, et al. titled “Siamese Neural Networks for One-Shot Image Recognition.

https://www.cs.cmu.edu/~rsalakhu/papers/oneshot1.pdf

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

33 of 140

Siamese Neural Networks for�One-Shot Image Recognition

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

34 of 140

Siamese Neural Networks for�One-Shot Image Recognition

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

35 of 140

مجموعه داده ارزیابی LFW

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

36 of 140

Triplet loss

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

37 of 140

Triplet loss

minimize

maximize

Positive

Negative

Anchor

 

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

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

38 of 140

Triplet loss

Positive

Anchor

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

Anchor

Negative

(A)

(A)

(p)

(N)

 

 

 

 

 

 

 

 

0

0

margin

 

 

 

 

 

0.8

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

39 of 140

تابع loss

  • با فرض داشتن P ,A و N

 

 

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

 

  • اگر دیتاستی با 10.000 تصویر از 1000 فرد داشته باشیم باید از 10000 تصویر برای ساخت سه تایی ها استفاده کنیم.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

40 of 140

انتخاب سه‌تایی‌ها(Tripletها) A و P وN

    • اگر A و P و N به صورت تصادفی انتخاب شوند شرط

 

به راحتی برآورده می‌شود.

    • انتخاب Tripletهایی که برای آموزش «سخت» است.

 

 

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

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

41 of 140

مجموعه داده آموزش(Training set) برای Triplet Loss

Anchor

Positive

Negative

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

42 of 140

انتخاب Tripletها

    • مشکل اصلی:
      • چگونه سه‌تایی‌ها را انتخاب کنیم؟
    • راه حل؟
      • انتخاب Tripleهای سخت در mini-batch بزرگ (1000<)

Useful triplets = hardest errors

انتخاب�همه positive‌ها

به اندازه کافی

سخت

خیلی ساده

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

43 of 140

Choosing triplets: trap

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

44 of 140

انتخاب Tripletها: تله!

 

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

minimize

maximize

Anchor

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

45 of 140

انتخاب Tripletها: تله!

به جای ...

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

46 of 140

انتخاب Tripletها: تله!

    • Selecting hardest negative may lead to the collapse early in training

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

47 of 140

انتخاب Tripletها

انتخاب�همه positive‌ها

خیلی سخت

خیلی ساده

Semi-hard

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

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

48 of 140

انتخاب Tripletها

 

  • خیلی ساده! شرایط از قبل برقرار است و چیزی برای یادگیری ندارد!

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

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

49 of 140

انتخاب Tripletها

 

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

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

50 of 140

انتخاب Tripletها

 

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

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

51 of 140

Let’s code…

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

52 of 140

More

… for models trained from scratch as well as pretrained ones, using a variant of the triplet loss to perform end-to-end deep metric learning outperforms most other published methods by a large margin.

— In Defense of the Triplet Loss for Person Re-Identification, 2017. https://arxiv.org/abs/1703.07737

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

53 of 140

خلاصه Triplet loss

 

LFW

Megaface

Google’s Facenet

99.63

70.5

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

54 of 140

بازنگری هدف!

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

55 of 140

یادگیری تابع «شباهت» (“similarity” function)

    • d(img1,img2) = میزان تفاوت بین دو تصویر

 

یکسان

 

متفاوت

4

0.5

6

10

4

6

7

12

«علیرضا اخوان پور»

تصویر فرد ناشناس

Face Verification

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

56 of 140

فضای نرونی و خمینه (manifold)

نورون1

نورون2

نورون3

نورون4

نورون5 و ...

DiCarlo and Cox , TICS (2007)

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

57 of 140

فضای نرونی خوب و بد

DiCarlo and Cox , TICS (2007)

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

58 of 140

 

 

 

 

فضای 128 تایی encoding تصاویر

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

59 of 140

هدف یادگیری

 

 

 

 

  • یادگیری پارامترها به نحوی که:

 

 

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

60 of 140

بخش 2:

یادگیری متریک

Metric learning

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

61 of 140

تابع Softmax

    • ویژگی‌هایی که آموزش می‌بیند فقط separable هستند، اما discriminative نیستند!
    • این ویژگی‌ها به اندازه کافی موثر نیستند.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

62 of 140

نیاز به metric learning داریم!

[Yandong Wen et. al., 2016. A Discriminative Deep Feature Learning Approach for Face Recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

63 of 140

نیاز به metric learning داریم!

  • Tightness of the cluster
  • Discriminative features

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

64 of 140

Learning the similarity function

 

 

 

 

 

 

 

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

 

 

 

 

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

65 of 140

Center loss

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

66 of 140

Center Loss

    • Idea: pull the points to class centroids

[Wen et al.,2016, A discriminative feature learning approach for deep face recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

67 of 140

Separable vs Discriminative

[Wen et al.,2016, A discriminative feature learning approach for deep face recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

68 of 140

A toy example : What’s wrong with Softmax

[Wen et al.,2016, A discriminative feature learning approach for deep face recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

69 of 140

A toy example : What’s wrong with Softmax

 

 

[Wen et al.,2016, A discriminative feature learning approach for deep face recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

70 of 140

آیا ویژگی‌ها برای خوشه بندی مناسب است؟

Separable,

the deep features are not discriminative enough.

by intra-class variation

training set

testing set

[Wen et al.,2016, A discriminative feature learning approach for deep face recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

71 of 140

آیا ویژگی‌ها برای خوشه بندی مناسب است؟

Separable,

the deep features are not discriminative enough.

by intra-class variation

Training Set (50K)

Test Set (10K)

[Wen et al.,2016, A discriminative feature learning approach for deep face recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

72 of 140

افزودن center loss برایdiscriminative شدن ویژگی‌ها!

[Wen et al.,2016, A discriminative feature learning approach for deep face recognition]

 

 

 

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

73 of 140

 

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

74 of 140

 

[Wen et al.,2016, A discriminative feature learning approach for deep face recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

75 of 140

Let’s code…

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

76 of 140

خلاصه center loss

    • خلاصه:
      • ایجاد توده‌ی درون کلاسی و جدایی بین کلاس‌ها
      • کارایی خوب، همگرایی ساده
    • پیاده سازی‌ها:

LFW

Megaface

Center Loss

99.28%

65.234%

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

77 of 140

مقایسه نتایج

LFW

Megaface

Google’s Facenet

99.63

70.5

Center Loss

99.28%

65.234%

  • بین 100M-200M تصویر چهره

از 8 میلیون شخص متفاوت

  • 0.7 میلیون تصویر چهره از 17,189 شخص مختلف
  • برای چالش مگافیس تنها از 490 هزار تصویر برای اموزش استفاده شده است.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

78 of 140

Angular Softmax loss

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

79 of 140

Center loss

Angular Softmax

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

80 of 140

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

81 of 140

Large Margin Softmax (L-Softmax)

[Weiyang, et al., 2016, Large-margin softmax loss for convolutional neural networks]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

82 of 140

Large Margin Softmax (L-Softmax)

As f is the inner product between W and x, it can be also formulated as

[Weiyang, et al., 2016, Large-margin softmax loss for convolutional neural networks]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

83 of 140

Large Margin Softmax (L-Softmax)

As f is the inner product between W and x, it can be also formulated as

[Weiyang, et al., 2016, Large-margin softmax loss for convolutional neural networks]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

84 of 140

Large Margin Softmax (L-Softmax)

W1 * x > W2 * x

[Weiyang, et al., 2016, Large-margin softmax loss for convolutional neural networks]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

85 of 140

Large Margin Softmax (L-Softmax)

W1 * x > W2 * x

[Weiyang, et al., 2016, Large-margin softmax loss for convolutional neural networks]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

86 of 140

Large Margin Softmax (L-Softmax)

[Weiyang, et al., 2016, Large-margin softmax loss for convolutional neural networks]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

87 of 140

SphereFace

[Weiyang et al.,2017, SphereFace: Deep Hypersphere Embedding for Face Recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

88 of 140

[Weiyang et al.,2017, SphereFace: Deep Hypersphere Embedding for Face Recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

89 of 140

[Weiyang et al.,2017, SphereFace: Deep Hypersphere Embedding for Face Recognition]

 

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

90 of 140

مقدار mهای مختلف برای Angular Softmax

[Weiyang et al.,2017, SphereFace: Deep Hypersphere Embedding for Face Recognition]

m=1

m=3

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

91 of 140

Angular Softmax

[Weiyang et al.,2017, SphereFace: Deep Hypersphere Embedding for Face Recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

92 of 140

Angular Softmax

[Weiyang et al.,2017, SphereFace: Deep Hypersphere Embedding for Face Recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

93 of 140

خلاصه Angular Softmax

    • خلاصه:
      • همگرایی نسبتا دشوار
    • پیاده سازی‌ها:
      • wy1iu/sphereface(caffe) – کد رسمی منتشر شده توسط نویسنده مقاله�https://github.com/wy1iu/sphereface

LFW

Megaface

Angular Softmax

99.4%

72.72%

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

94 of 140

Am Softmax

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

95 of 140

Additive Margin Softmax

[Wang et al.,2018, Additive Margin Softmax for Face Verification]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

96 of 140

خلاصه AMSoftmax

    • خلاصه:
      • همگرایی نسبتا خوب
      • کارایی خوب، همگرایی ساده
    • پیاده سازی‌ها:
      • (caffe) – کد رسمی منتشر شده توسط نویسنده مقاله�https://github.com/happynear/AMSoftmax

    • بیشتر بخوانیم:

https://towardsdatascience.com/additive-margin-softmax-loss-am-softmax-912e11ce1c6b

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

97 of 140

ArcFace

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

98 of 140

ArcFace

[Deng et al.,2018, ArcFace: Additive Angular Margin Loss for Deep Face Recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

99 of 140

ArcFace

[Deng et al.,2018, ArcFace: Additive Angular Margin Loss for Deep Face Recognition]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

100 of 140

خلاصه ArcFace

    • پیاده سازی‌ها:
      • (MXNet) – کد رسمی منتشر شده توسط نویسنده مقاله�https://github.com/deepinsight/insightface

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

101 of 140

AdaptiveFace: Adaptive Margin and Sampling for Face Recognition

CVPR2019

They proposed to adjust the margins for different classes adaptively to address the problem of unbalanced data

Hao Liu, Xiangyu Zhu, Zhen Lei, Stan Z. Li; Proceedings of the IEEE/CVF �Conference on Computer Vision and Pattern Recognition (CVPR), 2019, pp. 11947-11956

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

102 of 140

THE DEVELOPMENT OF LOSS FUNCTIONS

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

103 of 140

Network architectures

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

104 of 140

برخی از پیاده سازی های رایج

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

105 of 140

Let’s code…

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

106 of 140

بخش 4:

تشخیص و تراز کردن چهره

Face Detection & alignment

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

107 of 140

Face Detection

تشخیص چهره

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

108 of 140

Face detection

  • What is the meaning of a ‘correct detection’?

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

109 of 140

Face detection

  • What is the meaning of a ‘correct detection’?
    • More than 50%?!

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

110 of 140

Face detection metric

  • Metric?
    • How well a face detection algorithm performs by counting the:
      • true positives

TP: detections considered as correct

      • false positives

FP: detections considered as incorrect

      • false negative

FN: faces that were not detected

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

111 of 140

Face detection metric

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

112 of 140

Face detection metric:�ROC curve and AUC

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

113 of 140

Face detection metric:�AP: Average precision

It is defined as the set of mean precision at a set of eleven equally spaced recall levels{0, 0.1, ..., 1}:

 

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

114 of 140

مجموعه داده ها ی تشخیص چهره

  • Wider
    • 32k images
    • 494k faces

  • Celeba
    • 200k images, 10k persons
    • Landmarks, 40 binary attributes
  • FDDB
    • 2845 images
    • 5171 faces

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

115 of 140

مجموعه داده ها ی تشخیص چهره

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

116 of 140

الگوریتم کلاسیک Viola-Jones�

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

117 of 140

الگوریتم کلاسیک Viola-Jones: آموزش�

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

118 of 140

الگوریتم کلاسیک Viola-Jones: inference�

    • بهینه سازی:
      • ویژگی‌ها با هم گروه‌هایی به نام stage تشکیل دهند
      • اگر patch انتخاب شده در هر stage رَد شد الگوریتم غیر چهره برگردانده و خارج شود.

Stage 1

Stages

Stage N

yes

Stage 2

yes

Face

اطلاعات بیشتر: جلسه 22

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

119 of 140

الگوریتم کلاسیک Viola-Jones: نتایج wider�

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

120 of 140

نتایج wider برای سایر الگوریتم ها�

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

121 of 140

نتایج wider برای سایر الگوریتم ها�

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

122 of 140

MTCNN: از سه شبکه آبشاری تشکیل شده

[Zhang et al.,2016, Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

123 of 140

MTCNN: از سه شبکه آبشاری تشکیل شده

[Zhang et al.,2016, Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks]

    • شبکه اول، شبکه پیشنهاددهنده یا P-Net

بسیار سبک برای پیدا کردن تمامی نواحی مشکوک به وجود چهره. این شبکه با سرعت خیلی بالا و دقت خیلی پایین عمل میکند و تمامی نواحی مروبط به چهره را برای ما پیدا می‌کند. این شبکه نرخ مثبت کاذب خیلی بالایی دارد.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

124 of 140

MTCNN: از سه شبکه آبشاری تشکیل شده

[Zhang et al.,2016, Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks]

    • شبکه دوم، شبکه محدود‌کننده R-Net

این شبکه از تصاویر حاصل از خروجی شبکه اول ورودی می‌گیرد؛ این شبکه تعداد پارامترهای بیشتری دارد و نواحی اشتباه پیداشده را حذف می‌کند.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

125 of 140

MTCNN: از سه شبکه آبشاری تشکیل شده

[Zhang et al.,2016, Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks]

    • شبکه سوم، شبکه خروجی یا O-Net

از لحاظ تعداد پارامتر و تعداد لایه این شبکه از دو شبکه قبلی پیچیده تر و کند تر است. کاری شبیه به شبکه دوم بر روی نواحی باقی‌مانده انجام میدهد و دقت شبکه را بالا می‌برد و به قطعیت وجود یا عدم وجود چهره در نواحی باقیمانده که توسط دو شبکه قبل تشخیص داده شده را مشخص می‌کند، هر سه شبکه همزمان به پیدا کردن landmark‌های چهره نظیر چشم‌ها و بینی و alignment نقاط هم میپردازند که در نهایت شبکه آخر دقت رگرسیون بالایی برای این نقاط نیز دارد.

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

126 of 140

کار فرعی MTCNN:landmark های چهره!

[Zhang et al.,2016, Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks]

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

127 of 140

خلاصه MTCNN

    • خلاصه:
      • روش تشخیص چهره (Face Detection) مبتنی بر یادگیری عمیق
      • از سه شبکه عمیق متوالی تشکیل شده
      • وجود یا عدم وجود چهره به همراه 5 نقطه از چهره را برمی‌گرداند.
      • این روش کند است.
    • پیاده سازی‌ها:

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

128 of 140

Let’s code…

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

129 of 140

Let’s code…

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

130 of 140

Let’s code…

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

131 of 140

نگاشت چهره با 5 نقطه صورت

160

160

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

132 of 140

Let’s code…

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

133 of 140

بخش 5:

بهبود کارایی

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

134 of 140

ترفند: افزونگی داده augmentation – روش 1

  • افزونگی داده در زمان تست (Test time augment):
    • Flip کردن تصویر
    • محاسبه دو embedding
    • میانگین گیری

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

135 of 140

ترفند: افزونگی داده augmentation – روش 2

  • افزونگی داده در زمان تست (Test time augment):
    • Flip کردن تصویر
    • محاسبه دو embedding
    • چسباندن

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

136 of 140

Affine Transform

04_MTCNN-wrap-with-landmarks.ipynb

Let’s code…

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

137 of 140

مجموعه داده چهره های ایرانی - نسخه 1

http://iran-celeb.ir/

۲۳۶۳نفر

۱۹۴۶۳۷تصویر

۱۶۰۷اقا

۷۵۶ خانم

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

138 of 140

Recognition Evaluation

  • False alarms or Type 1 errors:

When the algorithm identifies someone who has never been seen before

  • Misses or Type 2 errors:

When the algorithm returns an incorrect identity

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

139 of 140

منابع

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning

140 of 140

منابع

http://class.vision | علیرضا اخوان پور

Deep Face Recognition & one-shot learning