0
0
Computer Visionml~8 mins

Face detection with deep learning in Computer Vision - Model Metrics & Evaluation

Choose your learning style9 modes available
Metrics & Evaluation - Face detection with deep learning
Which metric matters for face detection and WHY

For face detection, the key metrics are Precision and Recall. Precision tells us how many detected faces are actually faces, so it helps avoid false alarms. Recall tells us how many real faces the model finds, so it helps avoid missing faces. Both matter because missing a face or wrongly detecting a face can cause problems in real life, like security or photo tagging.

Confusion matrix for face detection
      | Predicted Face | Predicted No Face |
      |----------------|-------------------|
      | True Positive  | False Positive    |
      | False Negative | True Negative     |

      Example:
      TP = 90 (faces correctly detected)
      FP = 10 (wrongly detected faces)
      FN = 15 (faces missed)
      TN = 885 (correctly ignored non-faces)

      Total samples = 90 + 10 + 15 + 885 = 1000
    
Precision vs Recall tradeoff with examples

If the model tries to find every face (high recall), it might detect some things that are not faces (lower precision). For example, in a security camera, missing a face (low recall) is bad because you want to catch everyone. But if it detects too many false faces (low precision), it wastes time checking wrong alerts.

On the other hand, if the model is very strict and only detects faces it is sure about (high precision), it might miss some faces (low recall). This might be okay for photo apps where false faces annoy users, but not for safety systems.

What good vs bad metric values look like for face detection

Good: Precision and Recall both above 90%. This means most detected faces are real, and most real faces are found.

Bad: Precision below 70% means many false alarms. Recall below 70% means many faces missed. For example, 50% recall means half the faces are not detected, which is usually unacceptable.

Common pitfalls in face detection metrics
  • Accuracy paradox: If most images have no faces, a model that always says "no face" can have high accuracy but is useless.
  • Data leakage: Testing on images very similar to training can give too optimistic metrics.
  • Overfitting: Very high training metrics but poor test metrics mean the model learned noise, not real face patterns.
Self-check question

Your face detection model has 98% accuracy but only 12% recall on faces. Is it good for production? Why or why not?

Answer: No, it is not good. The high accuracy is misleading because most images might not have faces. The very low recall means the model misses almost all faces, which defeats the purpose of face detection.

Key Result
Precision and recall are key for face detection; both must be high to ensure real faces are found without many false alarms.