音訊深偽檢測器解析:MFCC、CQCC 與原始波形模型
Inside an Audio Deepfake Detector: MFCCs, CQCC and Raw Waveform Models
文章梳理音訊深偽檢測的三類輸入表徵:MFCC、CQCC,以及原始音訊波形模型。文中介紹各方法如何處理頻率資訊,並指出 AASIST 的評測結果較當時 SOTA 相對提升 20%,其輕量版本有 85K 個參數,亦勝過競爭模型。但在網上收集的真實及偽造音訊上,使用 ASVspoof 2019 訓練的模型 EER 惡化 200% 至 1000%;作者建議以域外、經壓縮及帶噪的音訊進行測試。
Recently, I had to read about anti-spoofing techniques in audio for work. I found it the easiest way to comprehend the whole thing by asking myself just one question – what does the model actually look at? And there are only three possible answers to it, which also correspond to three periods of development in the field.
The first possible answer is MFCCs. They originate from the world of speech recognition. In brief, audio is split into frames of 20 to 25 ms, its spectrum is computed, it is filtered via a mel filter bank corresponding to human hearing, the log of it is taken, and, finally, a Discrete Cosine Transform is done. The result is a compact vector per each frame.
Image created with AI assistance.
The issue here is that mel-scale tends to compress the high frequencies, and this is precisely the range in which many artifacts of synthesis occur. Vocoders and codecs are known to produce their fingerprints in the high frequency bands, along with small details in the spectrum that are smoothened out by MFCC. This is why the linear versions such as LFCC often perform better for spoof detection. In Müller et al.'s study "Does Audio Deepfake Detection Generalize?", replacing melspec with cqtspec or logspec inputs improved EER by 37% on average.
The second choice is CQCC or Constant Q Cepstral Coefficients proposed by Todisco, Delgado and Evans from EURECOM in 2016. This idea was inspired from music analysis field. As the name suggests, in the case of Constant Q Transform the frequency bins are geometrically spaced, so we get better frequency resolution at lower frequencies and better time resolution at higher frequencies unlike a normal STFT where we get just one trade-off. We then follow with the same process of cepstrum calculation as before. Using this along with a simple GMM classifier on the ASVspoof 2015 dataset, the performance outperformed all the previously reported results, including those attacks not encountered during training.
The issue, which the authors point out themselves in their follow-up paper from 2017, is that optimal CQCC design depends on the nature of the attack and application scenario. A custom-built feature can generalize no further than the design decisions behind it.
The third solution is to not design any feature at all and train the model using raw audio. Tak et al. presented a RawNet2 architecture for spoof detection at ICASSP 2021. Its inputs are raw samples followed by a layer of learnable sinc band-pass filters, then residual layers and GRU. It performed particularly well on A17, a voice conversion attack, which was difficult for a hand-designed system in the ASVspoof 2019 LA dataset. AASIST, proposed by Jung et al. at ICASSP 2022, is an extension of RawNet2 encoder with graph attention over two different perspectives on spectra and time domain, as the artifacts may appear in either one. It achieved a 20% relative improvement over the state-of-the-art result and its lightweight version, with 85K parameters, even surpassed the competitors.
Finally, the less discussed bit. Benchmarks make all three families appear more competent than they really are. In the very same Müller et al. paper, a collection of in-the-wild real and spoofed audio recordings of celebrities and politicians was compiled from the Internet. Those models trained on ASVspoof 2019 benchmark saw their EER get worse by somewhere between 200% and 1000% on that dataset, and frequently performed not much better than a random guess. A clean studio-trained dataset is just not representative of a cloned voice memo sent through WhatsApp and a smartphone speaker.
Key learning points. The front-end is much more important than one thinks, so don't just settle for melspecs. Learned front-ends, raw waveform or self-supervised speech models, tend to be more robust than static ones, but it's not some kind of black magic. And always test on out-of-domain compressed noisy audio before trusting any EER score.
I'm curious what front-end approaches other people use in practice, especially for telephony audio. Let me know in the comments.
If you want to go further, there's a good overview of a production audio analysis architecture, and a primer on how neural vocoders leave the artifacts these detectors look for.
Sources:
- Todisco, Delgado, Evans: Constant Q cepstral coefficients (Computer Speech & Language, 2017)
- Tak et al.: End-to-end anti-spoofing with RawNet2
- Jung et al.: AASIST
- Müller et al.: Does Audio Deepfake Detection Generalize?
Note: I used AI tools while drafting this post and reviewed it before publishing. The cover and image were made with AI assistance.
Disclosure: I work as an AI intern at Neural Defend, a deepfake detection company. The Neural Defend guides linked above are from my employer.
來源:DEV Community · dev.to
