Adaptive Rectangle Loss for Speaker Verification

Ruida Li, Shuo Fang, Chenguang Ma, Liang LiInterspeech 2022

Abstract

From the perspective of pair similarity optimization, speaker verification is expected to satisfy the criterion that each intraclass similarity is higher than the maximal inter-class similarity. However, we find that most softmax-based losses are suboptimal which encourages each sample to have a higher target similarity score only than its corresponding non-target similarity scores but not all the non-target ones. To this end, we propose a batch-wise maximum softmax loss, in which the non-target logits are replaced by the ones derived from the whole batch. To further emphasize the minority hard non-target pairs, an adaptive margin mechanism is introduced at the same time. The proposed loss is named Adaptive Rectangle loss due to its rectangle decision boundary. In addition, an annealing strategy is introduced to improve the stability of the training process and boost the convergence. Experimentally, we demonstrate the superiority of adaptive rectangle loss on speaker verification tasks. Results on VoxCeleb show that our proposed loss outperforms state-of-the-art by 10.11% in EER.

Introduction

Speaker Verification (SV) is an open-set problem where a system must determine if two speech segments belong to the same identity, often involving speakers never seen during training. While current models utilize margin-based softmax variants like AM-Softmax or Circle Loss, these functions primarily optimize for local class separation. They encourage a sample to be more similar to its target class than its own non-target classes, but they do not explicitly enforce a global threshold where the minimum intra-class similarity exceeds the maximum inter-class similarity across the entire dataset. This paper, presented at Interspeech 2022, proposes Adaptive Rectangle Loss to bridge this gap by enforcing a stricter, rectangular decision boundary.

Methodology

Rectangle Loss and Decision Boundaries

The proposed Rectangle Loss reformulates the standard softmax to be batch-wise. Instead of comparing a sample's target similarity ($s_p$) against its specific non-target logits, the non-target logits are replaced by the maximum non-target similarities ($s_n$) found within the entire training batch. This forces the model to ensure that any target pair is more similar than any "impostor" pair present in the batch, effectively proxying the global thresholding used during inference.

Comparison of decision boundaries for (a) AM-Softmax, (b) Circle loss, and (c) the proposed Rectangle loss.

As shown in Figure 1, the decision boundary for the proposed loss is rectangular, unlike the circular or triangular boundaries of previous methods. This approach also decouples the gradients for $s_p$ and $s_n$, allowing the model to optimize both ends of the similarity spectrum independently and more effectively.

Adaptive Margin Mechanism

To address the imbalance between common "easy" non-target pairs and critical "hard" ones, the authors introduce an adaptive margin. Hard pairs are defined as those whose similarity $s_n$ is higher than the marginal average target similarity. An additional margin penalty is applied specifically to these hard pairs to amplify their gradients and ensure they are not overlooked during training.

The adaptive margin mechanism identifies hard non-target pairs to amplify their gradients.

Annealing Strategy

Because the rectangular boundary is sharper and more difficult to optimize, the authors employ an annealing strategy. The training process begins with a standard Softmax loss and gradually transitions to the Adaptive Rectangle Loss, ensuring stability and boosting convergence.

Experiments and Results

The model was trained on the VoxCeleb2 development set with standard data augmentations. Evaluation was conducted on the VoxCeleb1 test sets (Original, Extended, and Hard) using an ECAPA-TDNN architecture.

Metric AM-Softmax Circle Loss Adaptive Rectangle Loss Relative Gain
Vox1-O EER (%) 0.91 0.89 0.80 10.11%
Vox1-O minDCF 0.1096 0.1028 0.0755 26.50%
Vox1-H EER (%) 2.17 2.20 1.99 7.87%

The results demonstrate a consistent improvement across all metrics. Notably, the 10.11% relative gain in EER and the 26.50% improvement in minDCF on VoxCeleb1-O highlight the effectiveness of the rectangular boundary in reducing false acceptances and rejections.

Conclusion

Adaptive Rectangle Loss offers a novel perspective on metric learning for speaker verification by aligning the training objective with the global thresholding requirements of real-world deployment. By focusing on batch-wise maximums and hard-pair mining through an adaptive margin, the method significantly outperforms traditional margin-based losses. Future work may explore the scalability of this approach to larger batch sizes and its applicability to other biometric verification tasks.

Summary updated

BibTeX
@inproceedings{li2022adaptive,
  author = {Ruida Li and Shuo Fang and Chenguang Ma and Liang Li},
  title = {{Adaptive Rectangle Loss for Speaker Verification}},
  booktitle = {Interspeech},
  year = {2022},
  url = {https://openreview.net/forum?id=nWPIGs8s6A6},
}
Figure