Hard Sample-Conditioned Decorrelated Attention for Robust Face Recognition
Authors & Institutions
Tahar Chettaoui
Fraunhofer Institute for Computer Graphics Research IGD
Guray Ozgur
Fraunhofer Institute for Computer Graphics Research IGD
TU Darmstadt
Eduarda Caldeira
Fraunhofer Institute for Computer Graphics Research IGD
TU Darmstadt
Naser Damer
Fraunhofer Institute for Computer Graphics Research IGD
TU Darmstadt
Fadi Boutros
Fraunhofer Institute for Computer Graphics Research IGD
What Problem It Solves
ViT-HarDis targets redundant attention specifically where the embedding is dangerously close to another identity. It is designed to improve large-scale and low-resolution face recognition while keeping inference latency, model shape, and embedding interfaces unchanged.
Key Result
On the controlled ViT-S ablation, TAR at FAR 1e-4 rises from 84.46% to 85.72% on IJB-B and from 88.18% to 89.09% on IJB-C. With ViT-B trained on WebFace4M, the method reports 95.84% on IJB-B, 97.24% on IJB-C, and 75.97% TinyFace Rank-1, leading the compared ViT-based systems. Inference cost is unchanged because the penalty is training-only, although the authors report roughly 30% longer training on WebFace4M.
Abstract
Multi-head attention in Vision Transformers (ViTs) allows independent attention patterns across heads, but without explicit regularization, heads may learn redundant patterns rather than complementary roles. Correlation-based penalties encourage head disentanglement, yet apply uniform regularization across all training samples. In face recognition (FR), hard samples whose embeddings lie close to competing identities are critical for optimization and generalization. Motivated by this, we propose ViT-HarDis, which conditions attention head disentanglement on sample difficulty: samples with high cosine similarity to negative class centers receive stronger head decorrelation, enforcing specialization where identity ambiguity is highest. Experiments show improvements over both the baseline and uniform disentanglement on most benchmarks. Our analysis shows that ViT-HarDis reduces the similarity of hard samples to competing class centers while decreasing inter-head attention similarity, and that applying disentanglement only to the final transformer layers outperforms regularizing the entire network. Trained on WebFace4M, ViT-HarDis achieves SOTA results among ViT-based methods on IJB-B, IJB-C, and TinyFace Rank-1, while achieving the best IJB-B and TinyFace results when trained on MS1MV3, improving FR without architectural modifications or additional inference cost. Code: https://github.com/TaharChettaoui/Hard-Sample-Conditioned-Attention-for-FR.
Research Starting Point
Vision Transformers can allocate different facial regions to different attention heads, but those heads often converge on redundant patterns. Uniform decorrelation penalties treat an easy frontal portrait and an identity-ambiguous hard sample alike, even though difficult samples near competing class centers are the ones most likely to determine verification errors. The paper asks whether training capacity can be focused on those difficult identities without changing the deployed architecture.
Method
The method measures sample hardness from cosine similarity to the closest negative class center. For each selected transformer block it computes an inter-head attention-correlation penalty, weights that penalty more strongly for harder correctly classified samples, and adds it to the normal margin-based face-recognition loss. Experiments compare the baseline, uniform disentanglement, and hardness-conditioned disentanglement; layer ablations show that regularizing only the final quarter of transformer blocks is more effective than applying the constraint everywhere.
Paper Summary
For teams already using a ViT face encoder, this is a training-time improvement rather than a deployment rewrite. The gains are strongest on difficult large-scale and low-resolution tests, but they come with extra training time and still need validation on the target population.