当前位置:网站首页>[machine learning notes] [face recognition] deeplearning ai course4 4th week programming
[machine learning notes] [face recognition] deeplearning ai course4 4th week programming
2022-07-26 10:38:00 【LittleSeedling】
Face recognition
The goal is :
1. Use pre trained models , Conduct
1.1 Face verification
1.2 Face recognition
Face verification
Give a group 【 Face and identity 】, Look up... In the database ,【 Face 】 and 【 identity 】 match .
Send two pictures into CNN Online code become 128 Dimension vector .
Compare the two code Between distance , The smaller the distance , The more similar
CNN The Internet
Use FaceNet Model ( Others have been trained )
CNN Loss function of
Triplet loss
- A yes “Anchor”, It's an image of a person .
- P yes “Positive”, Is relative to “Anchor” Another image of the same person .
- N yes “Negative”, Is relative to “Anchor” Another image of a different person .
A-P The square of , Add each dimension + α \alpha α < A-N The square of , Add each dimension
∑ i n ∣ ∣ f ( A i ) − f ( P i ) ∣ ∣ 2 + α < ∑ i n ∣ ∣ f ( A i ) − f ( N i ) ∣ ∣ 2 \sum_i^n||f(A_i)-f(P_i)||^2 + \alpha < \sum_i^n||f(A_i) - f(N_i)||^2 i∑n∣∣f(Ai)−f(Pi)∣∣2+α<i∑n∣∣f(Ai)−f(Ni)∣∣2
A And P Between distance Be as small as possible ,A And N Between distance Try to be as big as possible .
among , α \alpha α yes 【 identical 】 and 【 Different 】 At least the distinction between images .
Transposition to ,
∑ i n ∣ ∣ f ( A i ) − f ( P i ) ∣ ∣ 2 − ∑ i n ∣ ∣ f ( A i ) − f ( N i ) ∣ ∣ 2 + α < 0 \sum_i^n||f(A_i)-f(P_i)||^2 - \sum_i^n||f(A_i) - f(N_i)||^2 + \alpha < 0 i∑n∣∣f(Ai)−f(Pi)∣∣2−i∑n∣∣f(Ai)−f(Ni)∣∣2+α<0
We define , Loss function ( Triplet loss ):
J ( A , P , N ) = m a x ( ∑ i n ∣ ∣ f ( A i ) − f ( P i ) ∣ ∣ 2 − ∑ i n ∣ ∣ f ( A i ) − f ( N i ) ∣ ∣ 2 + α , 0 ) J(A,P,N) = max(\sum_i^n||f(A_i)-f(P_i)||^2 - \sum_i^n||f(A_i) - f(N_i)||^2 + \alpha,0) J(A,P,N)=max(i∑n∣∣f(Ai)−f(Pi)∣∣2−i∑n∣∣f(Ai)−f(Ni)∣∣2+α,0)
send J As small as possible .
Implementation verification
Input 【 Face 】 and 【 identity 】. We need to verify that , The 【 Face 】 Is it this 【 identity 】.
We can store all the data in the database in advance 【 Face 】 Encoding , And use Dictionaries take 【 Face 】 and 【 identity 】 One-to-one correspondence .
after , Whenever the camera takes a picture , We just need to put it in CNN Online code , And then This code And database Code of corresponding identity Calculate both distance . if distance dist Less than threshold The verification is successful .
Face recognition
Input 【 Face 】. We need to verify that , The 【 Face 】 Is it in the database .
The practice is similar Face verification , In advance, code Good database all 【 Face 】
Traverse the coding of all faces in the database , Calculate the distance between the two . Take the minimum value of all distances .
If it's time to Minimum distance Less than threshold , Then the verification is successful .
边栏推荐
- 从蚂蚁的觅食过程看团队研发(转载)
- algorithm
- 反射机制简述
- 如何实现临时的图形要素现实
- 13 以对象管理资源
- .net operation redis hash object
- Redis implementation of distributed lock solution
- .NET操作Redis sorted set有序集合
- 剑指Offer(八):跳台阶
- Asynctask < T> decoration and await are not used in synchronous methods to obtain asynchronous return values (asynchronous methods are called in synchronous methods)
猜你喜欢

Okaleido生态核心权益OKA,尽在聚变Mining模式

Introduction to data analysis | kaggle Titanic mission

Issue 6: which mainstream programming language should college students choose

uniapp使用简单方法signalR(仅用于web调试,无法打包app)
![[Halcon vision] Fourier transform of image](/img/9c/d6ed4ab3e40f706f3b5b8b5cc51db9.png)
[Halcon vision] Fourier transform of image

2022/07/25 ------ arrangement of strings
![[leetcode每日一题2021/8/30]528. 按权重随机选择【中等】](/img/13/c6cb176d7065035f60d55ad20ed1bf.png)
[leetcode每日一题2021/8/30]528. 按权重随机选择【中等】

数据分析入门 | kaggle泰坦尼克任务

Okaleido ecological core equity Oka, all in fusion mining mode

el-table实现可编辑表格
随机推荐
Oracle创建索引
剑指Offer(四十三):左旋转字符串
Redis docker instance and data structure
GIS方法类期刊和论文的综述(Introduction)怎么写?
少了个分号
.NET操作Redis Set无序集合
Summary of common skills in H5 development of mobile terminal
Okaleido生态核心权益OKA,尽在聚变Mining模式
【机器学习小记】【风格迁移】deeplearning.ai course4 4th week programming(tensorflow2)
[machine learning notes] [style transfer] deeplearning ai course4 4th week programming(tensorflow2)
剑指Offer(十):矩形覆盖
What if MySQL can't get in
关于硕博士开题报告编写的思考
uniapp使用简单方法signalR(仅用于web调试,无法打包app)
L2-005 set similarity (intersection of vector and set)
C语言回调函数
Comparison of packet capturing tools fiddler and Wireshark
数据分析入门 | kaggle泰坦尼克任务
反射机制简述
2022pta平时训练题(1~10题字符串处理问题)