0
0
Computer Visionml~12 mins

Face embedding and comparison in Computer Vision - Model Pipeline Trace

Choose your learning style9 modes available
Model Pipeline - Face embedding and comparison

This pipeline takes face images, turns them into special number lists called embeddings, and then compares these lists to see how similar the faces are. It helps in recognizing or verifying people by their faces.

Data Flow - 4 Stages
1Input Image
1 image x 160 x 160 x 3 (RGB)Receive a face image of size 160x160 pixels with 3 color channels1 image x 160 x 160 x 3
A photo of a person's face with height and width 160 pixels
2Face Detection and Alignment
1 image x 160 x 160 x 3Detect face location and align it to a standard pose1 aligned face image x 160 x 160 x 3
Face centered and rotated so eyes are horizontal
3Embedding Extraction
1 aligned face image x 160 x 160 x 3Pass image through a neural network to get a 128-dimensional vector1 vector x 128 dimensions
[0.12, -0.05, 0.33, ..., 0.07] (128 numbers representing the face)
4Embedding Comparison
2 vectors x 128 dimensionsCalculate distance (e.g., Euclidean) between two face embeddings1 similarity score (float)
Distance = 0.45 (lower means more similar)
Training Trace - Epoch by Epoch
Loss
1.2 |****
0.9 |***
0.7 |**
0.5 |*
0.35| 
Epochs ->
EpochLoss ↓Accuracy ↑Observation
11.20.45Model starts learning to map faces to embeddings
20.90.60Loss decreases, accuracy improves as embeddings get better
30.70.72Model learns more distinct embeddings for different faces
40.50.82Clear improvement in face representation quality
50.350.90Model converges with good accuracy on face similarity
Prediction Trace - 4 Layers
Layer 1: Input Image
Layer 2: Face Detection and Alignment
Layer 3: Neural Network Embedding Layer
Layer 4: Embedding Comparison
Model Quiz - 3 Questions
Test your understanding
What does the embedding vector represent in this pipeline?
AThe original face image pixels
BThe distance between two faces
CA list of numbers capturing unique face features
DThe aligned face image
Key Insight
Face embedding converts complex face images into simple number lists that computers can compare easily. Aligning faces first helps the model focus on important features. Training improves the model so embeddings for the same person get closer, and for different people get farther apart.