Multi-query multi-head attention pooling and Inter-topK penalty for speaker verification

Miao Zhao, Yufeng Ma, Yiwei Ding, Yu Zheng, Min Liu, Minqiang Xu · DOI

Abstract

This paper describes the multi-query multi-head attention (MQMHA) pooling and inter-topK penalty methods which were first proposed in our submitted system description for VoxCeleb speaker recognition challenge (VoxSRC) 2021. Most multi-head attention pooling mechanisms either attend to the whole feature through multiple heads or attend to several split parts of the whole feature. Our proposed MQMHA combines both these two mechanisms and gain more diversified information. The margin-based softmax loss functions are commonly adopted to obtain discriminative speaker representations. To further enhance the inter-class discriminability, we propose a method that adds an extra inter-topK penalty on some confused speakers. By adopting both the MQMHA and inter-topK penalty, we achieved state-of-the-art performance in all of the public VoxCeleb test sets.

Introduction

Speaker verification is the task of determining whether two audio segments belong to the same person. This process involves two critical components: a pooling mechanism to aggregate variable-length audio features into a fixed-size embedding, and a discriminative loss function to ensure embeddings from different speakers are well-separated. While standard multi-head attention and margin-based losses (like AM-Softmax) have been successful, they often fail to capture the full breadth of acoustic information or struggle with highly similar "hard" negative cases.

This paper introduces two key innovations to address these limitations: Multi-Query Multi-Head Attention (MQMHA) pooling and an Inter-topK penalty for loss functions. Together, these methods achieved state-of-the-art performance across all public VoxCeleb benchmarks.

Methods

Multi-Query Multi-Head Attention (MQMHA)

Standard attention mechanisms typically either look at the entire feature with multiple heads or divide the feature into segments with one head per segment. MQMHA combines these strategies by splitting feature channels into $H$ groups and assigning $Q$ trainable queries to each group. This allows the model to attend to multiple distinct patterns within the same frequency sub-segment, resulting in a richer and more diverse speaker representation.

Inter-topK Penalty

Building on the AM-Softmax loss, the authors propose an Inter-topK penalty to enhance inter-class discriminability. Instead of applying a uniform margin to all non-target classes, this method identifies the $k$ most similar "imposter" speakers (hard prototypes) and applies an additional penalty $m'$. This forces the model to work harder at separating speakers who are naturally close in the embedding space.

The baseline architecture uses a modified ResNet-34 backbone followed by a pooling layer and a linear layer to produce the final speaker embedding.

Experimental Setup

The models were trained using the VoxCeleb2-dev dataset, which contains over 1 million utterances. To increase robustness, the authors employed 3-fold speed augmentation and added noise/reverberation from the MUSAN and RIR datasets. Evaluation was conducted on five standard benchmarks: VoxCeleb1-O, -E, -H, VoxSRC20-dev, and VoxSRC21-val.

Key Results and Discussion

The combination of MQMHA and the Inter-topK penalty yielded significant improvements over the baseline (Statistics pooling + AM-Softmax). On the challenging VoxSRC21-val set, the proposed system reduced the Equal Error Rate (EER) from 2.9167% to 2.5100%, a relative improvement of nearly 14%.

Performance Comparison

As shown in the results below, MQMHA consistently outperforms other pooling methods like Multi-Head Attention (MHA) and Self-Attention (SA). Furthermore, the Inter-topK penalty alone (with $k=5$) improved EER by approximately 7% compared to the baseline.

Performance comparison of various pooling and loss methods across five test sets, highlighting the superiority of the combined MQMHA and Inter-topK approach.

Insights

  • Diversity in Pooling: The success of MQMHA suggests that a single attention head per feature group is often insufficient. Multiple queries allow the model to capture overlapping but distinct characteristics, such as pitch versus resonance, within the same frequency bands.
  • Targeted Hard Mining: Simply increasing the global margin in loss functions can be counterproductive. The Inter-topK penalty demonstrates that focusing the model's "attention" on the most confusing speakers is a more effective strategy for achieving high discriminability.

Conclusion

The proposed MQMHA pooling and Inter-topK penalty provide a powerful framework for improving speaker verification systems. By capturing more diversified information and specifically penalizing the most difficult classification errors, these methods set a new performance standard on the VoxCeleb benchmarks. Future work will focus on automating hyperparameter selection and testing the system's robustness in more extreme real-world conditions.

Summary updated

BibTeX
@misc{zhao2021multi,
  author = {Miao Zhao and Yufeng Ma and Yiwei Ding and Yu Zheng and Min Liu and Minqiang Xu},
  title = {{Multi-query multi-head attention pooling and Inter-topK penalty for speaker verification}},
  year = {2021},
  eprint = {2110.05042},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.05042},
}
Figure