A face-detection algorithm locates a face in an image and returns its position as a bounding box. In KYC face matching, it crops faces from selfie and identity-document photos before recognition generates embeddings for comparison. section 7.2.1
A practical face-matching pipeline separates three stages:
- Detect and crop the face from each photograph. section 7.2.1
- Transform each crop into a numerical face embedding with a recognition model. section 7.2.1
- Compare embeddings with cosine similarity to support duplicate or identity checks. section 7.2.1
Detecting faces in two Einstein photographs
Using MTCNN from facenet_pytorch, crop faces from two Albert Einstein images, pass the crops to InceptionResnetV1, and compare the resulting 512-dimensional embeddings. The demonstrated pair produces a cosine similarity of 0.7652. section 7.2.3
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 selfie-versus-ID workflow from face detection and cropping through recognition and numerical embedding comparison. section 7.2.1

