TransFace: Calibrating Transformer Training for Face Recognition from a Data-Centric Perspective

Jun Dan, Yang Liu, Haoyu Xie, Jiankang Deng, Haoran Xie, Xuansong Xie, Baigui Sun

Introduction

Vision Transformers (ViTs) have demonstrated remarkable scalability, often surpassing Convolutional Neural Networks (CNNs) as dataset sizes increase. However, in the domain of large-scale Face Recognition (FR), ViTs have historically struggled to outperform state-of-the-art CNN baselines despite the availability of massive datasets like Glint360K. TransFace addresses this "performance gap" by identifying and resolving two critical data-centric bottlenecks: destructive data augmentation and patch-level overfitting.

The Challenges of ViTs in Face Recognition

The authors identify two primary reasons for the sub-optimal performance of ViTs in FR:

  1. Destructive Augmentation: Standard augmentation techniques such as Mixup, CutMix, and Random Erasing are effective for general object recognition but prove detrimental to face recognition. These methods often destroy the precise spatial and structural relationships (e.g., the distance between facial landmarks) that are essential for identity verification.
  2. Patch Overfitting: ViTs process images as sequences of tokens. During training, they tend to overfit to a few "dominant" patches—typically high-contrast areas like the eyes or forehead—while ignoring the rest of the face. This "shortcut learning" makes the model fragile; if these dominant patches are obscured (e.g., by sunglasses or hair), the model's recognition capability collapses.
Destructive effects of traditional data augmentation on facial structure.

The TransFace Framework

To overcome these issues, TransFace introduces two novel components designed to calibrate the training process without altering the core Transformer architecture.

Dominant Patch Amplitude Perturbation (DPAP)

DPAP is a structure-preserving augmentation strategy. First, a Squeeze-and-Excitation (SE) module identifies the "dominant" patches that contribute most to the model's prediction. Instead of erasing these patches, DPAP transforms them into the frequency domain using a Fast Fourier Transform (FFT).

The key insight is that the phase spectrum of the Fourier transform contains structural and identity information, while the amplitude spectrum represents style and texture. By perturbing only the amplitude and then performing an Inverse FFT (IFFT), DPAP creates diverse training samples that retain the original facial geometry. This forces the model to look beyond the dominant features and learn from more subtle cues like the jawline or ears.

Entropy-guided Hard Sample Mining (EHSM)

Traditional hard sample mining focuses on global image loss. In contrast, EHSM leverages the token-based nature of ViTs by analyzing the information entropy of local tokens. High-quality, informative images typically exhibit high entropy across tokens, whereas low-quality or blurry images (hard samples) show low entropy. EHSM dynamically re-weights the loss function to prioritize these low-entropy samples, ensuring the model extracts maximum information from difficult training data.

Overview of the TransFace framework, comparing DPAP with previous methods and illustrating the EHSM process.

Experimental Results

TransFace was evaluated on rigorous benchmarks, including MS1MV2 and the 17-million-image Glint360K dataset.

  • State-of-the-Art Performance: On the challenging IJB-C benchmark, TransFace-L (Large) achieved a True Acceptance Rate (TAR) of 97.61% at a False Acceptance Rate (FAR) of 1E-4, significantly outperforming the standard ViT-L baseline (97.13%).
  • Efficiency and Robustness: Even the smaller variant, TransFace-S, outperformed the baseline ViT-S by 0.56% on IJB-C, demonstrating that the data-centric calibrations are effective across different model scales.
  • Ablation Studies: Results confirmed that DPAP and EHSM are complementary. While DPAP prevents shortcut learning by diversifying features, EHSM ensures the model focuses on the most informative "hard" tokens, leading to more stable and accurate identity representations.

Conclusion

TransFace demonstrates that the key to unlocking the potential of Vision Transformers for face recognition lies not in architectural complexity, but in data-centric calibration. By preserving facial structure through frequency-domain augmentation (DPAP) and mining hard samples via local token entropy (EHSM), TransFace establishes a new state-of-the-art for ViTs in the FR domain. These strategies offer a promising path for other identity-sensitive tasks where preserving structural integrity is paramount.

Summary updated

BibTeX
@inproceedings{dan2023transface,
  author = {Jun Dan and Yang Liu and Haoyu Xie and Jiankang Deng and Haoran Xie and Xuansong Xie and Baigui Sun},
  title = {{TransFace: Calibrating Transformer Training for Face Recognition from a Data-Centric Perspective}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  doi = {10.1109/iccv51070.2023.01887},
}
Figure