Fast and Interpretable Face Identification for Out-Of-Distribution Data Using Vision Transformers

Hai Phan, Cindy X. Le, Vu Le, Yihui He, Anh Totti Nguyen

Introduction

Modern face identification (FI) systems typically employ Siamese neural networks to compare image pairs via global embeddings. While effective under controlled conditions, these systems often struggle with "out-of-distribution" (OOD) data—real-world scenarios involving masks, sunglasses, or significant variations in appearance. In such cases, global summaries change drastically, leading to false negatives.

Existing state-of-the-art (SOTA) solutions like DeepFace-EMD address this by performing patch-wise comparisons using Earth Mover’s Distance (EMD). However, the cubic computational complexity ($O(n^3 \log n)$) of EMD makes these methods too slow for real-time applications. Furthermore, these "black box" models offer little interpretability, hindering human-in-the-loop verification in high-stakes environments like law enforcement.

The H2L Architecture

To overcome these challenges, researchers proposed Model H2L (Hybrid-to-Linear), a 2-image Vision Transformer (ViT) designed for both speed and robustness. The architecture integrates several key innovations:

  1. Hybrid Feature Extraction: The model utilizes a pre-trained CNN (ArcFace) to generate initial patch embeddings, combining the local feature-extraction capabilities of CNNs with the global relational modeling of Transformers.
  2. Cross-Attention Mechanism: Unlike standard ViTs, H2L processes two images simultaneously within a single Transformer. This enables cross-attention, allowing the model to dynamically focus on matching visible features (e.g., the eyes) while ignoring occluded regions (e.g., a mask).
  3. Linear Feature Extraction: Instead of the standard [CLS] token, H2L employs linear layers to extract features directly from spatial patch outputs, preserving granular information for the final comparison.
Architecture of the proposed H2L model, showing the integration of CNN patch embeddings with a Transformer Encoder and ArcFace training loss.

Performance and Speed

The H2L model demonstrates significant improvements in computational efficiency. By leveraging the $O(n^2)$ complexity of the attention mechanism, H2L achieves a substantial speedup over EMD-based methods. Empirical tests across various datasets, including CALFW and AgeDB with synthetic occlusions, show that the proposed ViT is consistently more than twice as fast as DeepFace-EMD.

Inference time comparison (in seconds) between the SOTA DeepFaceEMD and the proposed ViT across multiple OOD datasets.

In terms of accuracy, H2L remains highly competitive. On the masked CALFW dataset, it achieved a 99.29% Precision at 1 (P@1) score, matching the performance of much slower SOTA models while significantly outperforming standard CNN-based Siamese networks.

Interpretability and Human-AI Synergy

A standout feature of the H2L model is its inherent interpretability. The cross-attention maps serve as heatmaps, indicating which facial regions the model prioritized during comparison. A human study involving 21 participants revealed that these visual explanations are highly effective. Without AI assistance, humans scored approximately 54% accuracy on difficult OOD pairs. When provided with H2L's attention heatmaps, human accuracy improved to approximately 74%, demonstrating a clear synergy between AI interpretability and human decision-making.

Conclusion

Model H2L represents a significant advancement in face identification, offering a rare combination of speed, accuracy, and interpretability. By replacing computationally expensive patch-matching algorithms with an efficient cross-attention Transformer, the model enables real-time OOD face verification. Future work will explore further hyperparameter optimization and the handling of extreme facial angles to enhance robustness in even more diverse real-world scenarios.

Summary updated

BibTeX
@inproceedings{phan2024fast,
  author = {Hai Phan and Cindy X. Le and Vu Le and Yihui He and Anh Totti Nguyen},
  title = {{Fast and Interpretable Face Identification for Out-Of-Distribution Data Using Vision Transformers}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2024},
  doi = {10.1109/wacv57701.2024.00618},
}
Figure