DEV Community

CaraComp
CaraComp

Posted on Originally published at go.caracomp.com

CCTV Facial Recognition: Why a 98% Match Proves Nothing

Deconstructing why high confidence scores fail in video forensics highlights a fundamental architectural misunderstanding in computer vision: conflating continuous pixel ingestion with identity verification.

For engineers designing biometric pipelines, security video footage and facial comparison solve entirely distinct computational problems. An RTSP camera stream provides sensor data—timestamps, bounding boxes, and compressed H.264/H.265 frames. Turning that raw sensor output into actionable identity evidence requires an isolated, math-intensive comparison pipeline that converts pixel arrays into high-dimensional geometric embeddings.

When software reports a "98% match," it isn't outputting a ground-truth probability. It is simply evaluating a distance function in latent space—and treating that metric as definitive identity proof is an engineering trap.

The Math Behind the Match: Embeddings and Vector Space

Modern facial comparison pipelines extract facial landmarks and project them into a fixed-length embedding space (typically a 128-dimensional or 512-dimensional vector) using deep metric learning models like ArcFace or CosFace.

Identity matching comes down to vector distance calculations:

  • Euclidean Distance (L2 Norm): Measuring the straight-line geometric distance between two embedding vectors.
  • Cosine Similarity: Measuring the angular difference between normalized feature vectors.

A "98% match" simply reflects an arbitrary normalization of an L2 distance score falling beneath a preconfigured threshold. However, high-dimensional vector spaces are susceptible to domain shift. Real-world video introduces severe technical degradation: non-frontal yaw and pitch angles, low sensor dynamic range, motion blur, and compression artifacts.

These factors distort spatial landmark coordinates. When an altered 2D projection passes through an inference model, the resulting vector shifts in latent space. Two completely different individuals under identical harsh top-down lighting can yield closer Euclidean vectors than two photos of the same individual taken under different color temperatures and resolutions.

Pipeline Design: Mitigating False Positives

When building software for investigators, forensic analysts, or SIU teams, relying on naive vector search without rigorous calibration leads to severe False Acceptance Rates (FAR). To design robust computer vision systems:

  1. Separate Ingestion from Comparison: Treat video extraction as an unverified ingestion step. True comparison should be handled via deterministic 1-to-1 or batch analysis against vetted reference data.
  2. Calibrate Strict Distance Thresholds: Implement dynamic thresholds tied to image quality assessment (IQA) metrics. If the input resolution or illumination score is sub-optimal, the acceptance threshold must tighten automatically.
  3. Preserve Explainability: Black-box percentage scores are legally and technically vulnerable. Systems should surface landmark alignment grids, confidence intervals, and raw vector distance metrics rather than proprietary single-number match ratings.

High-accuracy facial comparison is not about automating a verdict; it is about providing calibrated mathematical measurements for human-in-the-loop review.

How do you handle domain shift and image degradation when calculating vector similarity in your computer vision pipelines? What threshold calibration techniques have worked best in your production environments?

Top comments (0)