Neural Codec-based Adversarial Sample Detection for Speaker Verification

Xuanjun Chen, Jiawei Du, Haibin Wu, Jyh-Shing Roger Jang, Hung-yi Lee

Abstract

Automatic Speaker Verification (ASV) systems are increasingly vulnerable to adversarial attacks—subtle, human-inaudible perturbations designed to deceive AI models. This paper presents a novel defense framework that utilizes neural audio codecs as a purification mechanism. By leveraging the "sieve effect" of neural codecs, the system can effectively strip away adversarial noise. The proposed method detects attacks by calculating the similarity score difference between original and reconstructed audio. Experimental results demonstrate that this approach, particularly using the Descript-audio-codec (DAC), achieves state-of-the-art detection accuracy of 99.32%, outperforming complex ensemble-based methods with a single-model architecture.

Introduction

Automatic Speaker Verification (ASV) has become a standard security feature for identity authentication in mobile devices and financial services. However, the rise of adversarial attacks poses a significant threat to the reliability of these systems. These attacks involve injecting carefully crafted noise into a voice signal, which, while remaining imperceptible to human listeners, can cause an ASV system to misidentify an unauthorized speaker as a registered user.

Existing defenses often rely on adversarial training, which requires prior knowledge of specific attack types, or computationally intensive ensemble models. This research proposes an attack-independent defense strategy that treats neural audio codecs as a "filter" to neutralize malicious perturbations without needing to know the attack's nature beforehand.

Methodology

The Neural Codec as a Sieve

Neural audio codecs, such as Encodec or DAC, are designed to compress audio into a compact, quantized representation (a codebook) and then reconstruct it. The researchers hypothesized that adversarial noise is fundamentally superficial and redundant compared to the core features of human speech. Consequently, the codec acts as a "sieve": during the encoding and quantization process, the essential speech features are retained while the fine-grained adversarial perturbations are discarded as noise.

Score Difference Detection

The detection framework operates through a comparison of similarity scores:

  1. Original Score ($s$): The system calculates the ASV similarity score for the raw input audio.
  2. Reconstructed Score ($s'$): The input is passed through a neural codec, and a new similarity score is calculated for the reconstructed version.
  3. Detection Logic: In a genuine sample, the codec preserves the speaker's identity, resulting in a low difference between $s$ and $s'$. In an adversarial sample, the codec removes the malicious noise, causing the ASV model to revert to the "true" (non-matching) identity of the speaker. This results in a significant jump in the score difference, which serves as a clear indicator of an attack.

Experimental Setup

The study utilized the VoxCeleb2 dataset for training the ASV model (an X-vector variant) and VoxCeleb1-O for evaluation. To test the robustness of the defense, adversarial samples were generated using the Basic Iterative Method (BIM) across three different attack budgets ($\epsilon = 5, 10, 15$). The researchers benchmarked 15 different neural codec variants, including Descript-audio-codec (DAC), Encodec, and FunCodec, to identify the most effective architecture for purification.

Key Insights

The Power of Quantization

The study found that aggressive quantization is the primary driver of defense effectiveness. By forcing the audio signal into discrete "bins," the codec effectively "snaps" adversarial perturbations back to the nearest legitimate speech feature, neutralizing the attack's intended effect on the ASV model.

Superiority of DAC

Among the tested models, the Descript-audio-codec (DAC) emerged as the top performer. It provided the highest detection rates while maintaining the highest fidelity for genuine speech. This suggests that the architectural choices in DAC are particularly well-suited for separating identity-bearing speech features from malicious noise.

Efficiency vs. Complexity

One of the most significant findings was that a single-model approach using DAC outperformed previous state-of-the-art (SOTA) methods that relied on complex ensembles of multiple models. This indicates that a well-chosen neural codec can provide superior protection with lower architectural complexity than traditional ensemble defenses.

Results

  • Detection Performance: Using the DAC D1 model, the system achieved a detection rate of 99.32% (at a 0.01 False Protection Rate) against strong adversarial attacks ($\epsilon = 15$).
  • SOTA Comparison: The proposed method surpassed the previous best ensemble-based detection method by a margin of 0.69% to 1.16%, depending on the detection threshold.
  • Quality Preservation: DAC maintained a low Equal Error Rate (EER) for genuine users, demonstrating a superior balance between security and system usability compared to other codecs like FunCodec.

Conclusion and Future Work

Neural codec-based detection offers a highly effective, attack-independent solution for securing speaker verification systems. By exploiting the inherent quantization properties of codecs, the framework can identify adversarial samples with high precision.

However, the method involves a trade-off: while it effectively catches attacks, the reconstruction process introduces slight distortions that can marginally impact the experience for genuine users. Additionally, the requirement to process audio twice (original and reconstructed) introduces computational latency. Future research will focus on optimizing codec architectures specifically for this purification task, aiming to eliminate adversarial noise while perfectly preserving the speaker's unique identity.

Summary updated

BibTeX
@inproceedings{chen2024neural,
  author = {Xuanjun Chen and Jiawei Du and Haibin Wu and Jyh-Shing Roger Jang and Hung-yi Lee},
  title = {{Neural Codec-based Adversarial Sample Detection for Speaker Verification}},
  booktitle = {Interspeech},
  year = {2024},
  doi = {10.21437/interspeech.2024-1191},
}
Figure