liveBook · Manning

MTCNN

As explained in Fight Fraud with Machine Learning

MTCNN is a cascaded convolutional neural-network model for detecting and localizing faces in images.

MTCNN is a face-detection model used to locate and crop faces before face recognition. In KYC workflows, it turns selfie and identity-document images into focused face inputs for comparison. section 7.2.3 section 7.2.4

A practical face-matching workflow separates three jobs:

  • Use MTCNN to detect and crop the face from each image. section 7.2.3
  • Use InceptionResnetV1 to convert each cropped face into an embedding. section 7.2.3
  • Compare embeddings with cosine similarity for duplicate checks or selfie-to-ID checks. section 7.2.3 section 7.2.4

Detecting a face before a selfie-to-ID check

A selfie and passport image are each passed through MTCNN, producing cropped face tensors. The recognition model then generates embeddings, and cosine similarity compares them. Einstein’s selfie and ID score 61.54%, while a different person scores 2.52%; a suspicious 100% score can indicate that the selfie was pasted onto a fake ID. section 7.2.4

mtcnn = MTCNN()
resnet = InceptionResnetV1(pretrained='vggface2').eval()

Inspect the Python model initialization for MTCNN and the accompanying pretrained face-recognition model. section 7.2.3

How Fight Fraud with Machine Learning covers it

How deep it goes
Demonstrates model initialization, image cropping, visualization, and downstream embedding comparison without explaining MTCNN internals.
Examples
Uses Einstein selfies and an identity document, including different-person and fraudulently reused-face comparisons.
What it assumes
Assumes Python image handling and tensor familiarity while supplying a workflow with PIL, PyTorch, torchvision, and facenet-pytorch.
What you can do after
Apply it via facenet-pytorch to crop faces before generating embeddings for fraud-oriented image comparisons.
How it connects
Connects face detection with face recognition, embeddings, cosine similarity, duplicate detection, and identity-document verification.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Fight Fraud with Machine Learning. The section links point to the parts of the book it draws on.