当前位置:网站首页>[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 .
边栏推荐
- 同步方法中不使用asyncTask<T> 修饰和await获取异步返回值(同步方法中调用异步方法)
- 链式方法调用的事务问题剖析
- [leetcode每日一题2021/8/30]528. 按权重随机选择【中等】
- Introduction to Phoenix (Level 1: Phoenix installation, level 2: Phoenix basic grammar)
- kali 查看ip地址
- Using native JS to realize custom scroll bar (click to reach, drag to reach)
- C language callback function
- 第5期:大学生入职必备技能之二
- Issue 5: the second essential skill for College Students
- Parallelism, concurrency and several directions for high concurrency optimization
猜你喜欢

【机器学习小记】【人脸识别】deeplearning.ai course4 4th week programming
![[leetcode每日一题2021/2/18]【详解】995. K 连续位的最小翻转次数](/img/de/62fca587cde95110c2a967ca93eea5.png)
[leetcode每日一题2021/2/18]【详解】995. K 连续位的最小翻转次数

反射机制简述

Dry goods likeshop takeout order system is open source, 100% open source, no encryption

Comparison of packet capturing tools fiddler and Wireshark

Zongzi battle - guess who can win

sigmod 函数与softmax 函数对比

Problems encountered in QRcode QR code (C language)
![[Halcon vision] threshold segmentation](/img/1c/e2463a796f99804a55680b69e714a6.png)
[Halcon vision] threshold segmentation

Application of.Net open source framework in industrial production
随机推荐
Redis implementation of distributed lock solution
剑指Offer(五十三):表示数值的字符串
Oracle cannot start tnslistener service cannot start
hx711 数据波动大的问题
[leetcode每日一题2021/4/23]368. 最大整除子集
uniapp使用简单方法signalR(仅用于web调试,无法打包app)
Simple use of json-c Library -- converting JSON files to struct
关于硕博士开题报告编写的思考
vscode上使用anaconda(已经配置好环境)
QRcode二维码(C语言)遇到的问题
2022pta usual training questions (1-10 string processing questions)
Redis Docker实例与数据结构
将json文件中数组转换为struct
剑指Offer(二十):包含min函数的栈
algorithm
【论文下饭】Deep Mining External Imperfect Data for ChestX-ray Disease Screening
点击el-dropdown-item/@click.native
.NET5WTM(ASP.NET Core) PGSql开箱操作
STM32 阿里云MQTT esp8266 AT命令
Mlx90640 infrared thermal imager temperature sensor module development notes (VI) pseudo color coding of infrared images