Abstract
Face identification (FI) is ubiquitous and drives many high-stake decisions made by law enforcement. State-of-the-art FI approaches compare two images by taking the cosine similarity between their image embeddings. Yet, such an approach suffers from poor out-of-distribution (OOD) generalization to new types of images (e.g., when a query face is masked, cropped, or rotated) not included in the training set or the gallery. Here, we propose a re-ranking approach that compares two faces using the Earth Mover's Distance on the deep, spatial features of image patches. Our extra comparison stage explicitly examines image similarity at a fine-grained level (e.g., eyes to eyes) and is more robust to OOD perturbations and occlusions than traditional FI. Interestingly, without finetuning feature extractors, our method consistently improves the accuracy on all tested OOD queries: masked, cropped, rotated, and adversarial while obtaining similar results on in-distribution images.
Introduction
Standard face identification systems typically compress a face image into a single mathematical vector, known as a global embedding. While these systems excel in controlled environments, they are remarkably brittle when faced with real-world "perturbations" such as surgical masks, sunglasses, or poor cropping. In these out-of-distribution (OOD) scenarios, the global vector changes so drastically that the system fails to recognize the individual. DeepFace-EMD addresses this by introducing a hierarchical approach that moves beyond global similarity to a fine-grained, patch-based comparison.
Methodology: A Two-Stage Pipeline
The core of the DeepFace-EMD approach is a two-stage re-ranking pipeline that leverages existing pre-trained models without requiring additional training or fine-tuning.
- Stage 1 (Global Ranking): A standard pre-trained model (e.g., ArcFace) performs a rapid search across the database using traditional global embeddings and cosine similarity to identify the top-100 most likely candidates.
- Stage 2 (Patch-wise Re-ranking): The system then performs a "deep dive" into these candidates. Instead of global vectors, it extracts spatial feature maps (typically grids like $8 \times 8$) from the final convolutional layer. These patches are compared using the Earth Mover’s Distance (EMD).
EMD treats the comparison as an optimal transport problem, finding the most efficient way to match feature weights between the query and the gallery patches. This allows the system to explicitly align features—matching "eyes to eyes"—even when faces are partially occluded or misaligned. To further enhance robustness, the authors utilize Average Pooling Correlation (APC) to weight features, effectively ignoring occluded regions like masks while focusing on visible, discriminative areas.
Experimental Results
The researchers evaluated DeepFace-EMD across several benchmarks, including LFW (Labeled Faces in the Wild), LFW-crop, and specialized datasets for masks (CALFW-Mask) and profiles (CFP).
Qualitative results demonstrate that Stage 2 consistently corrects errors made by the initial global ranking. For instance, in cases where a subject is wearing a mask or sunglasses, the global ranking often places incorrect individuals at the top due to the drastic change in the embedding. The EMD re-ranking stage successfully identifies the correct match by focusing on the unoccluded patches of the face.
Quantitative improvements were significant:
- Masked Faces: On CALFW-Mask, ArcFace accuracy (P@1) improved from 96.81% to 99.92%.
- Random Crops: On LFW-crop, accuracy rose from 87.35% to 96.26%.
- Real-world Masks: On the MLFW dataset, the EMD approach achieved 48.23% accuracy, outperforming models specifically fine-tuned for masked data (41.64%).
Conclusion and Future Work
DeepFace-EMD demonstrates that the spatial data already generated by modern convolutional neural networks is a powerful, underutilized resource for robust face identification. By shifting from global to patch-wise comparison, the system achieves state-of-the-art OOD performance without the need for expensive retraining. While the EMD optimization is computationally more intensive than cosine similarity—approximately 12 times slower—its use as a re-ranking step for a small candidate pool makes it a viable solution for high-stakes applications. Future research will focus on optimizing EMD solvers and developing models specifically trained to produce distinct patch-level embeddings.
Summary updated