arXiv:2610.41789cs.CVOct 2026

Manuscript Offprint

arXiv:2610.41789

Hard Sample-Conditioned Decorrelated Attention for Robust Face Recognition

Tahar Chettaoui, Guray Ozgur, Eduarda Caldeira, Naser Damer, Fadi Boutros

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.

1. Introduction

Face recognition (FR) has achieved remarkable progress in recent years, driven by advances in deep neural network architectures, innovations in training objectives, particularly margin-based softmax losses, and the availability of large-scale annotated face datasets [2, 9, 10, 19, 34]. Recent years have witnessed a shift from convolutional neural networks (CNNs) [15] to Vision Transformers (ViTs) [13], which leverage multi-head attention to capture complex spatial relationships and identity-discriminative pat-

terns. ViT-based FR systems have demonstrated competitive performance on evaluation benchmarks, establishing themselves as a promising direction for FR [4–7, 20, 31].

Although multi-head attention enables ViT to capture diverse representations, prior works [21, 26, 33] in general computer vision have shown that many attention heads become highly correlated or redundant, thus limiting the effective utilization of model capacity. An existing attention head disentanglement method [1], primarily developed for general vision tasks, addresses this issue by uniformly penalizing correlations between attention heads. However, this approach treats all samples equally and does not account for differences in sample difficulty. In practice, hard samples that lie near decision boundaries are more critical for learning and generalization [17, 19, 25]. We argue that attention head specialization should be adaptive, applying stronger disentanglement to these challenging cases, better exploiting model capacity while preserving complementary attention patterns where they are most needed.

Motivated by these observations, we propose ViT-HarDis, a hard sample-conditioned attention head disentanglement framework for ViT-based FR. Instead of uniformly encouraging attention head diversity, our method adaptively strengthens decorrelation according to sample difficulty, promoting specialization for identity-ambiguous samples while preserving the original architecture. Beyond this adaptive regularization strategy, we analyze attention head redundancy in ViT-based FR, revealing that increasing the number of attention heads leads to higher redundancy without improving recognition accuracy. Our experiments demonstrate that ViT-HarDis outperforms both the baseline ViT and uniform disentanglement (ViT-Dis) on most considered benchmarks, including IJB-B [35], IJB-C [24], and TinyFace [3], while reducing the similarity of hard samples to competing identity centers and decreasing inter-head attention similarity. We further show that applying disentanglement only to the final transformer layers outperforms regularizing all layers, indicating that head specialization is layer-dependent. Finally, we train ViT-HarDis on MS1MV3 [10] and WebFace4M [39], achieving SOTA results among

ViT-based methods on IJB-B, IJB-C, and TinyFace Rank-1 when trained on WebFace4M, and the best IJB-B and TinyFace results when trained on MS1MV3, without architectural modifications or additional inference cost.

References (38)