0
0
Computer Visionml~8 mins

Face embedding and comparison in Computer Vision - Model Metrics & Evaluation

Choose your learning style9 modes available
Metrics & Evaluation - Face embedding and comparison
Which metric matters for Face Embedding and Comparison and WHY

Face embedding models turn faces into numbers. To check if two faces match, we compare these numbers using distance metrics like Euclidean or cosine distance. The smaller the distance, the more similar the faces.

For evaluation, True Positive Rate (Recall) and False Positive Rate matter most. Recall shows how many real matches the model finds. False positives show how often different people are wrongly matched.

We also use ROC curves and AUC (Area Under Curve) to see how well the model balances finding matches and avoiding mistakes across different thresholds.

Confusion Matrix for Face Matching
      | Predicted Match    | Predicted No Match |
      |--------------------|--------------------|
      | True Positive (TP)  | False Negative (FN) |
      | False Positive (FP) | True Negative (TN)  |

      Example:
      Suppose 100 pairs tested:
      TP = 80 (correctly matched same faces)
      FN = 10 (missed matches)
      FP = 5  (wrongly matched different faces)
      TN = 5  (correctly identified different faces)

      Total = TP + FN + FP + TN = 100
    
Precision vs Recall Tradeoff in Face Comparison

Recall means finding most of the real matches. High recall means fewer missed matches.

Precision means when the model says two faces match, it is usually right.

For example, in security, missing a match (low recall) can be bad. So recall is more important.

In photo apps, wrongly matching different people (low precision) can annoy users, so precision matters.

Adjusting the distance threshold changes this tradeoff: lower threshold increases precision but lowers recall, and vice versa.

Good vs Bad Metric Values for Face Embedding
  • Good: Recall > 90%, Precision > 90%, AUC close to 1.0 means the model finds most matches and rarely mistakes different faces.
  • Bad: Recall < 50% means many matches missed. Precision < 50% means many wrong matches. AUC near 0.5 means model guesses randomly.
Common Pitfalls in Face Embedding Metrics
  • Accuracy paradox: If most pairs are different people, high accuracy can hide poor matching ability.
  • Data leakage: Using same faces in training and testing inflates metrics falsely.
  • Overfitting: Model works well on training faces but poorly on new faces.
  • Threshold choice: Picking a bad distance threshold can skew precision and recall.
Self Check

Your face matching model has 98% accuracy but only 12% recall on matching faces. Is it good for production?

Answer: No. The model misses 88% of real matches (low recall). High accuracy is misleading because most pairs are different people. For face matching, recall is critical to find real matches. This model needs improvement.

Key Result
Recall and precision are key to evaluate face embedding comparison; high recall ensures real matches are found, high precision avoids wrong matches.