Skip to content
ModelListedExternal
Download

Deepfake Audio Wav2vec2

Deepfake-Audio-Wav2Vec2 is a fine-tuned audio classification model trained to detect real vs spoofed (deepfake) speech audio.

KindOtherVersionRevision e1197e2Bgrade

Model source

Kind
Other
File size
361 MB
Version
vRevision e1197e2
Updated
Sep 22, 2026
Downloads
1.8K
Source
Hugging Face

Source description

🧾 Model Card β€” Deepfake-Audio-Wav2Vec2


🧠 Model Overview

Deepfake-Audio-Wav2Vec2 is a fine-tuned audio classification model trained to detect real vs spoofed (deepfake) speech audio.

The model is built on top of facebook/wav2vec2-base, a self-supervised speech representation model, and adapted for binary deepfake audio detection.

It learns subtle acoustic artifacts and synthetic speech patterns that differentiate genuine human recordings from AI-generated or manipulated audio samples.

This model is intended for:

  • Deepfake voice detection
  • Audio authenticity verification
  • Research in anti-spoofing systems
  • Security pipelines for voice-based applications

πŸ—οΈ Training Details

ParameterValue
Base Modelfacebook/wav2vec2-base
FrameworkHugging Face Transformers
Training HardwareGPU (CUDA)
Task TypeAudio Classification
Classesbonafide / spoof
Audio Sample Rate16 kHz
Input DurationFixed audio segments
OptimizationAdamW
Loss FunctionCross Entropy

🎯 Label Classes

  • 🟒 Bonafide β†’ Real / authentic speech
  • πŸ”΄ Spoof β†’ Deepfake / synthetic audio

πŸ“Š Evaluation Metrics

MetricScore
Accuracy92.8%
Precision89.7%
Recall88.0%
F1 Score88.4%

βœ… The model demonstrates strong detection performance across real and spoofed samples.


πŸ“‚ Dataset Description

The model was trained on a balanced subset of the ASVspoof 2021 PA dataset for binary anti-spoofing classification.

The dataset includes:

  • Genuine speech recordings
  • Spoofed / manipulated audio samples
  • Replay and synthetic attack scenarios

Training was performed on balanced class samples to improve robustness across both labels.


πŸ’» Example Usage

import torch
import torchaudio
import numpy as np
from transformers import AutoFeatureExtractor, AutoModelForAudioClassification

model_id = "Vansh180/deepfake-audio-wav2vec2"

feature_extractor = AutoFeatureExtractor.from_pretrained(model_id)
model = AutoModelForAudioClassification.from_pretrained(model_id)

model.eval()

def predict_audio(audio_path):
    wav, sr = torchaudio.load(audio_path)

    if wav.shape[0] > 1:
        wav = wav.mean(dim=0, keepdim=True)

    inputs = feature_extractor(
        wav.squeeze().numpy(),
        sampling_rate=16000,
        return_tensors="pt"
    )

    with torch.no_grad():
        outputs = model(**inputs)
        probs = torch.softmax(outputs.logits, dim=1)

    prediction = torch.argmax(probs, dim=1).item()
    confidence = probs[0][prediction].item()

    return {
        "prediction": model.config.id2label[prediction],
        "confidence": confidence
    }

print(predict_audio("sample.wav"))

Sources

1 source
Hugging FacePrimaryVersion e1197e2063deb056b0a6a348f3913d27de7f3d83
huggingface.co/Vansh180/deepfake-audio-wav2vec2/tree/e1197e2063deb056b0a6a348f3913d27de7f3d83

Verified Sep 6

Model artifacts

1 artifact

model.safetensors

safetensors Β· 361 MB Β· SHA-256 e6bc501e391e…70ec Β· Hugging Face

Download

Source excerpts

2 excerpts

--- language: en license: mit pipeline_tag: audio-classification tags: - audio-classification - deepfake-detection - spoof-detection - wav2vec2 - pytorch - transformers metrics: - accuracy - precision - recall - f1 model-index: - name: Deepfake-Audio-Wav2Vec2 results: - task: type: audio-classification name: Deepfake Audio Detection dataset: name: Balanced ASVspoof 2021 PA type: custom metrics: - type: accuracy value: 0.928 name: Accuracy - type: precision value: 0.897 name: Precision - type: recall value: 0.880 name: Recall - type: f1 value: 0.924 name: F1 Score --- # 🧾 Model Card β€” Deepfake-Audio-Wav2Vec2 --- # 🧠 Model Overview Deepfake-Audio-Wav2Vec2 is a fine-tuned **audio classification model** trained to detect **real vs spoofed (deepfake) speech audio**. The model is built on top of **facebook/wav2vec2-base**, a self-supervised speech representation model, and adapted for **binary deepfake audio detection**. It learns subtle acoustic artifacts and synthetic speech patterns that differentiate **genuine human recordings** from **AI-generated or manipulated audio samples**. This model is intended for: - Deepfake voice detection - Audio authenticity verification - Research in anti-spoofing systems - Security pipelines for voice-based applications --- # πŸ—οΈ Training Details | Parameter | Value | |----------|------| | Base Model | facebook/wav2vec2-base | | Framework | Hugging Face Transformers | | Training Hardware | GPU (CUDA) | | Task Type | Audio Classification | | Classes | bonafide / spoof | | Audio Sample Rate | 16 kHz | | Input Duration | Fixed audio segments | | Optimization | AdamW | | Loss Function | Cross Entropy | --- # 🎯 Label Classes - 🟒 **Bonafide** β†’ Real / authentic speech - πŸ”΄ **Spoof** β†’ Deepfake / synthetic audio --- # πŸ“Š Evaluation Metrics | Metric | Score | |------|------:| | Accuracy | 92.8% | | Precision | 89.7% | | Recall | 88.0% | | F1 Score | 88.4% | βœ… The model demonstrates strong detection performance across real and spoofed samples. --- # πŸ“‚ Dataset Description The model was trained on a **balanced subset of the ASVspoof 2021 PA dataset** for binary anti-spoofing classification. The dataset includes: - Genuine speech recordings - Spoofed / manipulated audio samples - Replay and synthetic attack scenarios Training was performed on balanced class samples to improve robustness ac...

Source context: 1758 downloads Β· 1 likes Β· Pipeline audio-classification Β· Library transformers Β· Repo Vansh180/deepfake-audio-wav2vec2