Face recognition problem

本文探讨了人脸识别领域的两大核心问题:面部验证与面部识别。详细介绍了FaceNet模型如何通过神经网络将面部图像编码为128维向量,实现1:1匹配的面部验证和1:K匹配的面部识别。此外,还讲解了三元组损失函数在训练过程中的应用。
部署运行你感兴趣的模型镜像

Face recognition problems commonly fall into two categories:

  • Face Verification - “is this the claimed person?”. For example, at some airports, you can pass through customs by letting a system scan your passport and then verifying that you (the person carrying the passport) are the correct person. A mobile phone that unlocks using your face is also using face verification. This is a 1:1 matching problem.
  • Face Recognition - “who is this person?”. For example, the video lecture showed a face recognition video of Baidu employees entering the office without needing to otherwise identify themselves. This is a 1:K matching problem.

FaceNet learns a neural network that encodes a face image into a vector of 128 numbers. By comparing two such vectors, you can then determine if two pictures are of the same person.

you will:

  • Implement the triplet loss function
  • Use a pertained model to map face images into 128-dimensional encodings
  • Use these encodings to perform face verification and face recognition

1 - Encoding face images into a 128-dimensional vector

The key things you need to know are:

  • This network uses 96x96 dimensional RGB images as its input. Specifically, inputs a face image (or batch of m face images) as a tensor of shape (m, nc, nh, hw) = (m, 3, 96, 96)
  • It outputs a matrix of shape (m, 128) that encodes each input face image into a 128-dimensional vector

So, an encoding is a good one if:

  • The encodings of two images of the same person are quite similar to each other
  • The encodings of two images of different persons are very different
FRmodel = faceRecoModel(input_shape=(3, 96, 96))
FRmodel.compile(optimizer='adam', loss=triplet_loss, metrics=['accuracy'])
1.2 - The Triplet Loss

For an image x, we denote its encoding f(x), where f is the function computed by the neural network.

Training will use triplets of images (A, P, N):

  • A is an "Anchor image–a picture of a person.
  • P is a “” image–a picture of the same person as the Anchor image.
  • N is a “Negative” image–a picure of a different person than the Anchor image.

What you should remember:

  • Face verification solves an easier 1:1 matching problem; face recognition addresses a harder 1:K matching problem.
  • The triplet loss is an effective loss function for training a neural network to learn an encoding of a face image.
  • The same encoding can be used for verification and recognition. Measuring distances between two images’ encodings allows you to determine whether they are pictures of the same person.

您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值