NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Attentive Merging of Hidden Embeddings from Pre-trained Speech Model for Anti-spoofing Detection

Zihan Pan, Tianchi Liu, Hardik B. Sailor, Qiongqiong Wang

Abstract

Self-supervised learning (SSL) speech representation models, trained on large speech corpora, have demonstrated effectiveness in extracting hierarchical speech embeddings through multiple transformer layers. However, the behavior of these embeddings in specific tasks remains uncertain. This paper investigates the multi-layer behavior of the WavLM model in anti-spoofing and proposes an attentive merging method to leverage the hierarchical hidden embeddings. Results demonstrate the feasibility of fine-tuning WavLM to achieve the best equal error rate (EER) of 0.65%, 3.50%, and 3.19% on the ASVspoof 2019LA, 2021LA, and 2021DF evaluation sets, respectively. Notably, we find that the early hidden transformer layers of the WavLM large model contribute significantly to the anti-spoofing task, enabling computational efficiency by utilizing a partial pre-trained model.

Introduction

As synthetic speech generation techniques like Text-to-Speech (TTS) and Voice Conversion (VC) become increasingly sophisticated, traditional anti-spoofing systems struggle to generalize. While large Self-Supervised Learning (SSL) models like WavLM have shown promise, they often function as "black boxes." This research, conducted by researchers from A*STAR, aims to understand which internal layers of these massive models are most effective for detecting spoofed audio and proposes a novel method to intelligently combine these layers.

The Attentive Merging (AttM) Framework

The core innovation is the Attentive Merging (AttM) method, designed to extract and weigh embeddings from all 24 layers of a WavLM Large model.

The proposed Attentive Merging framework architecture, showing the SSL pre-trained model and the attentive merging block.

The process involves several key steps:

  1. Feature Extraction: Extracting embeddings from every transformer layer rather than just the final output.
  2. Attentive Weighting: Using a "squeeze and excitation" operation to determine layer importance. These scores re-weight the embeddings via a Hadamard product, allowing the system to focus on the most discriminative cues for spoofing.
  3. Projection and Classification: Weighted embeddings are concatenated, reduced in dimensionality through a linear projection network, and passed to a final classifier (either an LSTM or an ECAPA-TDNN).
  4. Fine-tuning Strategy: A three-stage strategy is used, starting with frozen weights to train the merging block and gradually unfreezing the SSL model for task-specific optimization.

Experimental Setup

The models were evaluated using the industry-standard ASVspoof benchmarks:

  • 2019 LA (Logical Access): Baseline for training and evaluation.
  • 2021 LA: Features diverse, state-of-the-art TTS and VC attacks.
  • 2021 DF (Deepfake): Focuses on compressed deepfake audio, representing a significant challenge.

Layer-wise Analysis: The "Early Bird" Advantage

A key finding of this study is that the early to middle layers (specifically around layer 12) of WavLM are significantly more useful for anti-spoofing than the final layers. While deeper layers capture high-level semantic content (what is being said), anti-spoofing relies on low-level acoustic artifacts (how it was generated) typically found in earlier representations.

Heatmap visualizing the importance weights of WavLM layers across different model configurations, highlighting the dominance of early-to-middle layers.

As shown in the heatmap, layers 1 through 12 consistently receive higher attention weights compared to the later layers (13-24). This observation allowed the researchers to achieve top-tier performance using only a partial model (e.g., the first 12 layers), reducing transformer-related computational costs by approximately 50% without sacrificing accuracy.

Results and Performance

The AttM method set new benchmarks across several datasets, demonstrating that fine-tuning the SSL model is mandatory for optimal performance:

  • ASVspoof 2019 LA: Achieved an Equal Error Rate (EER) of 0.65%.
  • ASVspoof 2021 LA: Achieved an EER of 3.50%.
  • ASVspoof 2021 DF: Achieved an EER of 3.19%, representing a new state-of-the-art for this challenging dataset.

Conclusion

This work demonstrates that attentive merging of hierarchical embeddings significantly improves deepfake detection. By identifying that early layers contain the most relevant acoustic cues, the researchers have paved the way for more efficient, lightweight architectures. Future work will focus on further characterizing these specific acoustic features to enhance real-time detection capabilities against increasingly sophisticated synthetic speech attacks.

Summary updated

BibTeX
@inproceedings{pan2024attentive,
  author = {Zihan Pan and Tianchi Liu and Hardik B. Sailor and Qiongqiong Wang},
  title = {{Attentive Merging of Hidden Embeddings from Pre-trained Speech Model for Anti-spoofing Detection}},
  booktitle = {Interspeech},
  year = {2024},
  url = {https://openreview.net/forum?id=npbCZHJ4sT},
}
Figure