FaceNet is a facial recognition system developed by Florian Schroff, Dmitry Kalenichenko and James Philbina, a group of researchers affiliated to Google. The system was first presented in the IEEE Conference on Computer Vision and Pattern Recognition held in 2015.[1] The system uses a deep convolutional neural network to learn a mapping (also called an embedding) from a set of face images to the 128-dimensional Euclidean space and the similarity between two face images is assessed based on the square of the Euclidean distance between the corresponding normalized vectors in the 128-dimensional Euclidean space. The system used the triplet loss function as the cost function and introduced a new online triplet mining method. The system achieved an accuracy of 99.63% which is the highest score on Labeled Faces in the Wild dataset in the unrestricted with labeled outside data protocol.[2]

Structure

Basic structure

The structure of the FaceNet facenet recognition system is represented schematically in Figure 1.

Figure 1: Overall structure of the FaceNet face recognition system

For training, the researchers used as input batches of about 1800 images in which for each identity there were about 40 similar images and several randomly sampled images relating to other identities. These batches were fed to a deep convolutional neural network and the network was trained using stochastic gradient descent method with standard backpropagation and the Adaptive Gradient Optimizer (AdaGrad) algorithm. The learning rate was initially set at 0.05 which was later lowered while finalizing the model.

Structure of the CNN

The researchers used used two types of architectures, which they called NN1 and NN2, and explored their trade-offs. The practical differences between the models lie in the difference of parameters and FLOPS. The details of the NN1 model are presented in the table below.

Structure of the CNN used in the model NN1 in the FaceNet face recognition system
LayerSize-in
(rows × cols × #filters)
Size-out
(rows × cols × #filters)
Kernel
(rows × cols, stride)
ParametersFLOPS
conv1220×220×3110×110×647×7×3, 29K115M
pool1110×110×6455×55×643×3×64, 20
rnorm155×55×6455×55×640
conv2a55×55×6455×55×641×1×64, 14K13M
conv255×55×6455×55×1923×3×64, 1111K335M
rnorm255×55×19255×55×1920
pool255×55×19228×28×1923×3×192, 20
conv3a28×28×19228×28×1921×1×192, 137K29M
conv328×28×19228×28×3843×3×192, 1664K521M
pool328×28×38414×14×3843×3×384, 20
conv4a14×14×38414×14×3841×1×384, 1148K29M
conv414×14×38414×14×2563×3×384, 1885K173M
conv5a14×14×25614×14×2561×1×256, 166K13M
conv514×14×25614×14×2563×3×256, 1590K116M
conv6a14×14×25614×14×2561×1×256, 166K13M
conv614×14×25614×14×2563×3×256, 1590K116M
pool414×14×2563×3×256, 27×7×2560
concat7×7×2567×7×2560
fc17×7×2561×32×128maxout p=2103M103M
fc21×32×1281×32×128maxout p=234M34M
fc71281×32×1281×1×128524K0.5M
L21×1×1281×1×1280
Total140M1.6B

Triplet loss function

The Triplet Loss minimizes the distance between an anchor and a positive, both of which have the same identity, and maximizes the distance between the anchor and a negative of a different identity.

The loss function that was used in the FaceNet system was called the "Triplet Loss Function". This was a novel idea introduced by the developers of the FaceNet system. This function is defined using certain triplets of the form of training images. In this triplet, (called an "anchor image") denotes the image of a person, (called a "positive image") denotes some other image of the person whose image is and (called a "negative image") denotes the image of some other person different from the person whose image is . Let be some image and let be the embedding of in the 128-dimensional Euclidean space. It shall be assumed that the L2-norm of is unity. (The L2 norm of a vector in a finite dimensional Euclidean space is denoted by .) We pick such triplets from the training data set and let there be such triplets and be a typical triplet. The training is to ensure that, after learning, the following condition called the "triplet constraint" should be satisfied by all triplets in the training data set:

where is a constant called the margin and its value has to be set manually. Its value has been set as 0.2.

Thus, the function to be minimized is the following function called the triplet loss function:

Selection of triplets

In general the number of triplets of the form is very large. To make computations faster, the Google researchers considered only those triplets which violate the triplet constraint. For this, for a given anchor image they chose that positive image for which is maximum (such a positive image was called a "hard positive image") and that negative image for which is minimum (such a positive image was called a "hard negative image"). since using the whole training data set to determine the hard positive and hard negative images was computationally expensive and infeasible, the researchers experimented with several methods for selecting the triplets.

  • Generate triplets offline computing the minimum and maximum on a subset of the data.
  • Generate triplets online by selecting the hard positive/negative examples from within a mini-batch.

Performance

On the widely used Labeled Faces in the Wild (LFW) dataset, the FaceNet system achieved an accuracy of 99.63% which is the highest score on LFW in the unrestricted with labeled outside data protocol.[2] On YouTube Faces DB the system achieved an accuracy of 95.12%.[1]

See also

Further reading

  • Rajesh Gopakumar; Karunagar A; Kotegar, M.; Vishal Anand (September 2023). "A Quantitative Study on the FaceNet System": in Proceedings of ICACCP 2023. Singapore: Springer Nature. pp. 211–222. ISBN 9789819942848.
  • Ivan William; De Rosal Ignatius Moses Setiadi; Eko Hari Rachmawanto; Heru Agus Santoso; Christy Atika Sari (2019). "Face Recognition using FaceNet (Survey, Performance Test, and Comparison)" in Proceedings of Fourth International Conference on Informatics and Computing. IEEE Xplore. Retrieved 6 October 2023.
  • For a discussion on the vulnerabilities of Facenet-based face recognition algorithms in applications to the Deepfake videos: Pavel Korshunov; Sébastien Marcel (2022). "The Threat of Deepfakes to Computer and Human Visions" in: Handbook of Digital Face Manipulation and Detection From DeepFakes to Morphing Attacks (PDF). Springer. pp. 97–114. ISBN 978-3-030-87664-7. Retrieved 5 October 2023.
  • For a discussion on applying FaceNet for verifying faces in Android: Vasco Correia Veloso (January 2022). Hands-On Artificial Intelligence for Android. BPB Publications. ISBN 9789355510242. Amazon

References

  1. 1 2 Florian Schroff; Dmitry Kalenichenko; James Philbin. "FaceNet: A Unified Embedding for Face Recognition and Clustering" (PDF). The Computer Vision Foundation. Retrieved 4 October 2023.
  2. 1 2 Erik Learned-Miller; Gary Huang; Aruni RoyChowdhury; Haoxiang Li; Gang Hua (April 2016). "Labeled Faces in the Wild: A Survey". Advances in Face Detection and Facial Image Analysis (PDF). Springer. pp. 189–248. Retrieved 5 October 2023.
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.