概述
比较这些语音嵌入中的两个可以判断是否是同一个人在说话。它成为说话人验证的标准基线,因为它在 VoxCeleb 基准测试中以更少的参数击败了更大的模型,并且可以在开放工具包中免费获得。
主要要点
- ECAPA-TDNN 将任意长度的语音转换为 192 个说话人嵌入,并通过嵌入的余弦相似度来比较两个录音。
- 它对 x 向量设计的关键补充是 SE-Res2Blocks、多层特征聚合和通道相关的关注统计池。
- 在 VoxCeleb1 上,1470 万参数的 ECAPA-TDNN 达到了 0.87% 的等错误率,超过了 2390 万参数的 ResNet34 基线的 1.19%。
- 该模型使用边距为 0.2、比例为 30 的附加角边距 softmax 对 VoxCeleb2 的 5,994 个说话者进行训练。
- 语音验证可能会被克隆或重播的语音所欺骗,因此它应该与欺骗对策配合使用,并作为多种因素之一。
深入探讨
Speaker recognition answers a different question from speech recognition. Speech recognition asks what was said; speaker recognition asks who said it. It comes in three main forms. Verification checks a claim: is this voice the enrolled account holder, yes or no? Identification picks one speaker out of a known group. Diarization splits a recording into segments by speaker. All three rely on a speaker embedding, a fixed-length vector of numbers that captures the characteristics of a voice while ignoring the words spoken. ECAPA-TDNN, short for Emphasized Channel Attention, Propagation and Aggregation in Time Delay Neural Network, is a network designed to produce such embeddings, described by Brecht Desplanques, Jenthe Thienpondt and Kris Demuynck of Ghent University in a paper submitted in May 2020 and published at Interspeech 2020.
The pipeline runs in a fixed order. Audio, typically sampled at 16 kHz, is converted into 80 mel-frequency cepstral coefficients (MFCCs, a compact description of the sound spectrum) computed over 25-millisecond windows every 10 milliseconds. The network then applies one-dimensional convolutions along time, which is what a time delay neural network (TDNN) does: each layer looks at a short stretch of neighboring frames, and dilated layers look at frames spaced further apart to widen the context. ECAPA-TDNN replaces plain layers with SE-Res2Blocks. A Res2Net block splits channels into groups that process the signal at several scales, and a squeeze-and-excitation (SE) block computes a summary of the whole recording and uses it to re-weight each channel, emphasizing the ones that carry speaker information. Outputs from all these blocks are concatenated, so shallow and deep features both reach the end of the network.
Next comes pooling, the step that turns a variable-length sequence into one vector. ECAPA-TDNN uses attentive statistics pooling that is channel-dependent and context-dependent: for each channel it learns which frames matter most, for example vowels rather than silence, then computes a weighted mean and weighted standard deviation over time. A final fully connected layer compresses these statistics into the 192-dimensional embedding. During training, the network learns to classify the 5,994 speakers in the development part of the VoxCeleb2 dataset using a loss called additive angular margin softmax (AAM-softmax), which forces embeddings of the same person to cluster tightly and different people to stay apart. At test time the classifier is thrown away. Two recordings are compared by the cosine similarity of their embeddings, the scores are normalized, and a threshold decides accept or reject.
ECAPA-TDNN extended a lineage of speaker models. Older systems used i-vectors, a statistical summary of a recording. In 2018 Snyder and colleagues at Johns Hopkins introduced x-vectors, embeddings from a TDNN trained to tell speakers apart, and showed that augmenting training audio with noise and reverberation let them beat i-vector baselines. VoxCeleb2, released by Oxford researchers in June 2018 with over one million utterances from over 6,000 speakers collected automatically from open-source media, supplied the training data. ECAPA-TDNN added the channel attention, multi-layer aggregation and attentive pooling in 2020. That October, the same Ghent group's fused system took first place in both supervised verification tracks of the VoxCeleb Speaker Recognition Challenge 2020 (VoxSRC-20).
The paper's main comparison is on the VoxCeleb1 test set using equal error rate (EER), the point where the share of impostors wrongly accepted equals the share of genuine speakers wrongly rejected. The larger ECAPA-TDNN, with 1,024 channels and 14.7 million parameters, reached 0.87% EER, against 1.19% for a ResNet34 with 23.9 million parameters and 1.26% for an extended TDNN with 20.4 million. The smaller version, with 6.2 million parameters, reached 1.01%. The authors report an average relative improvement of 18.7% in EER over the best baseline on each test set. Later models have pushed further: NVIDIA's TitaNet, posted in October 2021, reported 0.68% EER on the VoxCeleb1 trials, and self-supervised models such as WavLM, pre-trained on 94,000 hours of speech, are often fine-tuned for speaker tasks. ECAPA-TDNN remains popular because it is small, fast and well documented.
The model has clear limits. Benchmark EERs come from celebrity interview clips; accuracy usually drops when the enrollment and test audio differ in microphone, language, background noise or length, so systems are tuned on in-domain data. Very short clips give the pooling layer little to work with. Close relatives and imitators are harder to separate. The most serious threat is spoofing: voice cloning and replayed recordings can fool a verifier that was never trained to detect them. The ASVspoof 5 challenge, described in August 2024, evaluates countermeasures and spoofing-robust verification against crowdsourced deepfakes and, for the first time, adversarial attacks. In practice, voice verification works best as one factor among several rather than as the only key.
Running ECAPA-TDNN is cheap. With 6 to 15 million parameters it runs on an ordinary CPU, and the SpeechBrain model on Hugging Face can be loaded in a few lines of Python. Training from scratch is more demanding: the paper used six augmented copies of every utterance (babble, noise, reverberation, faster and slower tempo, and audio compression), SpecAugment masking, the Adam optimizer with a cyclical learning rate over four cycles of 130,000 iterations, and mini-batches of 128. Teams that deploy voice biometrics also handle sensitive personal data, so clear consent, secure storage of voiceprints and a fallback for people the system rejects are part of the cost.
04工作示例
使用预训练的 ECAPA-TDNN 验证两个录音
使用 pip 安装 SpeechBrain 并录制三个剪辑,每个剪辑约十秒,两个来自同一个人,一个来自不同的人,保存为 16 kHz 单声道 WAV 文件。
使用SpeakerRecognition.from_hparams(source='speechbrain/spkrec-ecapa-voxceleb')加载预训练模型。
对同一个人的两个剪辑调用 verify_files 并记下返回的分数和预测。
对每个人的一个剪辑调用 verify_files,并注意分数较低且预测为 0。
从同一源加载 EncoderClassifier,并对一个波形调用encode_batch,以确认嵌入有 192 个值。
在嘈杂的房间或通过电话线重新录制同一个讲话者的剪辑,然后重复比较,看看在不匹配的情况下分数如何下降。
它显示了什么
学习器最终会得到匹配和不匹配对的相似度分数以及每个剪辑的 192 维嵌入。检查发现,同一说话人对的得分明显高于不同说话人对的得分,并且当录音条件不同时,差距会缩小,这说明了为什么部署的系统会根据自己的音频校准阈值。
现实世界的实施
开源验证:SpeechBrain 的预训练 ECAPA-TDNN 模型根据 Apache-2.0 许可证发布,并在 VoxCeleb1 和 VoxCeleb2 上进行训练,报告的相等错误率为 0.80%,并通过单个 verify_files 调用比较两个音频文件。
基准竞赛:根特 IDLab 团队将六个 ECAPA-TDNN 变体与四个 ResNet34 系统融合在一起,并在 2020 年 VoxCeleb 说话人识别挑战赛的两个监督验证赛道中获得第一名。
说话人分类:会议转录管道通过将音频切割成短窗口、提取每个说话人嵌入以及对嵌入靠近的窗口进行聚类来标记谁在说话。
语音登录和欺诈检查:验证系统注册客户的语音嵌入一次,然后将每个新呼叫与其进行比较,理想情况下与 ASVspoof 5 挑战中评估的那种欺骗检测器配对。
ECAPA-TDNN的未来:说话人验证模型如何工作
Research on speaker embeddings has moved in three directions since 2020. The first is better encoders: TitaNet in October 2021 reported 0.68% EER on VoxCeleb1 with depth-wise separable convolutions, and self-supervised models such as WavLM, trained on 94,000 hours of unlabeled speech and posted in October 2021, provide general speech representations that can be fine-tuned for verification. ECAPA-TDNN is still widely used as a reference baseline against which such models are compared. The second direction is robustness under domain shift, such as different languages, devices and far-field microphones, where challenge results show gaps between curated benchmark audio and real-world calls. The third and most urgent is security against synthetic speech. As voice-cloning tools improve, verification must be paired with countermeasures that detect spoofed audio, and the ASVspoof 5 challenge of 2024 introduced metrics for spoofing-robust automatic speaker verification and tested adversarial attacks for the first time. Open questions include how to keep accuracy across demographic groups and accents, how to protect stored voiceprints, and whether embeddings can be designed to reveal identity for verification while leaking less about age, health or emotion.
付诸实践
为什么这很重要
- 交通与覆盖范围. 它通过转录、旁白和语音界面提高了可访问性。
- 成本与预算. 媒体团队可以用更少的预算更快地交付精美的音频。
- 速度与规模. 面向客户的系统可以处理更大规模的语音交互。
留意
- 如果未征得同意,语音滥用和冒充风险就会增加。
- 由于口音、方言或嘈杂的环境,准确性可能会下降。
- 如果没有明确的标签,合成音频可能会被误认为是真实的语音。
后续步骤
- 获得语音捕获、克隆和重用的明确同意。
- 测试不同扬声器和背景条件下的质量。
- 定义人员必须审查或批准输出的时间。
- 标记合成音频并保留来源记录以供问责。
资料来源与延伸阅读
- arXiv / Interspeech 2020 (Desplanques, Thienpondt and Demuynck)ECAPA-TDNN:基于 TDNN 的说话人验证中强调通道注意、传播和聚合
- ICASSP 2018 (Snyder et al., Johns Hopkins University)X-Vectors:用于说话人识别的鲁棒 DNN 嵌入
- arXiv / Interspeech 2018 (Chung, Nagrani and Zisserman)VoxCeleb2:深度说话人识别
- arXiv (Thienpondt, Desplanques and Demuynck, 2020)IDLAB VoxCeleb 说话人识别挑战赛 2020 系统说明
- SpeechBrain on Hugging FaceSpeechbrain/spkrec-ecapa-voxceleb
- arXiv (Koluguri, Park and Ginsburg, 2021)TitaNet:具有 1D 深度可分离卷积和全局上下文的说话者表示神经模型
- arXiv (Chen et al., 2021)WavLM:用于全栈语音处理的大规模自监督预训练
- arXiv (2024)ASVspoof 5:众包语音数据、深度伪造和大规模对抗性攻击
不断探索
常见问题
什么是 ECAPA-TDNN:说话人验证模型如何工作?
ECAPA-TDNN 是一种神经网络,由根特大学的研究人员在 Interspeech 2020 上发布,可将任意长度的语音录音转换为描述说话者声音的 192 个数字的简短列表。比较这些语音嵌入中的两个可以判断是否是同一个人在说话。它成为说话人验证的标准基线,因为它在 VoxCeleb 基准测试中以更少的参数击败了更大的模型,并且可以在开放工具包中免费获得。
对于给定的语音片段,ECAPA-TDNN 模型的主要输出是什么?
ECAPA-TDNN 将可变长度的话语映射到表示说话者语音特征的单个固定长度嵌入向量。
通常如何比较两个 ECAPA-TDNN 嵌入来确定它们是否属于同一说话人?
提取嵌入后,余弦相似度(或类似 PLDA 的相关评分)可衡量两个声纹的接近程度。
“注意力统计池”层有什么作用?
注意力统计池将学习到的注意力权重分配给帧,并将它们聚合成加权平均值和标准差,强调信息丰富的帧。
哪个数据集最常用于训练和基准测试 ECAPA-TDNN 说话人模型?
VoxCeleb 是从视频中截取的大量名人采访片段,是训练和评估说话人验证系统的标准语料库。
“SE”(挤压激励)块对架构有什么贡献?
挤压激励模块学习使用全局信息来缩放每个特征通道,让网络强调最有用的通道。