A face recognition model converts a cropped facial image into an embedding: a multidimensional numerical fingerprint representing facial features. Comparing two embeddings with cosine similarity supports identity verification, duplicate detection, and selfie-to-ID checks. section 7.2.1 section 7.4
A practical face-matching workflow is:
- Detect and crop the face in each selfie or identity-document image with a face detection model. section 7.2.1
- Generate one embedding per cropped face using the face recognition model. section 7.2.1
- Calculate cosine similarity: values near 1 indicate highly similar embeddings, values near 0 unrelated faces, and values near -1 opposite vectors. section 7.2.1
- Use the resulting score for duplicate checks between selfies or selfie-to-ID identity verification. section 7.4
A common training design is a Siamese network. Two replicas of the same CNN process a pair of images, producing embeddings whose cosine similarity passes through a sigmoid. A binary label marks same-person pairs as 1 and different-person pairs as 0; binary cross-entropy loss is backpropagated through the CNN so same-person embeddings become similar and different-person embeddings separable. section 7.2.2
Selfie-to-ID fraud check
An MTCNN model crops the face from an identity document, and InceptionResnetV1 generates its embedding. Comparing it with Einstein’s selfie produces a 61.54% similarity score; Monroe’s ID produces 2.52%. A fraudulent ID reusing Einstein’s selfie reaches 100%, revealing a suspicious pasted-face attack rather than simply confirming identity. section 7.2.4
Figure 7.10 Diagram of a face-matching system comparing faces from two different photos – a selfie and an ID. First, the faces from the two photos are cropped using a face detection model, and then a face recognition model generates embeddings for the faces that are compared numerically for a match.
Trace the complete matching pipeline from selfie and ID face crops through embedding generation and numerical comparison. section 7.2.1
