/ Модель

Характеристики

Параметры
403 млн
Лицензия
Apache 2.0
Архитектура
wav2vec2 · dense
Библиотека
transformers
Опубликована
11 июл 2026

wav2vec2-deepfake-voice-detector

Классификация текстаТекст → label4 профессии

Производная модели garystafford/wav2vec2-deepfake-voice-detector. Дообученная модель Wav2Vec2 классифицирует аудиоречь как человеческую или синтетическую, созданную системой TTS либо клонирования голоса.

309скачиваний за 30 дней1лайквеса обновлены11 июл 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Карточка модели zodumair/wav2vec2-deepfake-voice-detector на Hugging Face совпадает с карточкой garystafford/wav2vec2-deepfake-voice-detector, поэтому описание составлено по ней.

Модель Gary A. Stafford — дообученная версия трансформера Wav2Vec2 для бинарной классификации аудио: она оценивает, произнесена ли речь человеком или создана системой синтеза речи либо клонирования голоса. Модель рассчитана на обнаружение синтетической речи, в том числе сгенерированной ElevenLabs, Amazon Polly, Hexgrad Kokoro, Hume AI, Speechify и Luvvoice.

Архитектура — Wav2Vec2ForSequenceClassification на 402,7 млн параметров. При дообучении были заморожены сверточный экстрактор признаков и нижние 12 из 24 слоёв трансформера; верхние 12 слоёв и классификационная головка обучались на наборе из 1 866 сбалансированных аудиофрагментов длительностью 2,5–13 секунд. На вход подаётся аудио, которое приводится к моно и частоте 16 кГц; модель выдаёт оценки двух классов: «реальная речь» и «синтетическая речь». Карточка сообщает об обучении базовой модели на 53 языках, но не устанавливает, для каких языков детектор надёжно работает.

На валидационной выборке из 187 фрагментов указаны точность 97,9% и ROC-AUC 0,998; автор предупреждает, что высокая оценка отражает адаптацию к близкой предметной области и не доказывает обобщение на другие генераторы или реальные условия. Модель распространяется под лицензией Apache-2.0; для оценки качества на новых источниках рекомендуется отдельная проверка.

Сценарии применения

  • проверка аудиозаписи на синтетическую речь
  • выявление речи, созданной системами TTS
  • проверка аудио на признаки клонирования голоса
  • классификация речевых фрагментов как человеческих или искусственных

Ограничения

Заявленные высокие метрики получены на небольшой выборке из 187 примеров и не подтверждают обобщение на другие генераторы речи или условия записи. Оптимальная длительность фрагмента при обучении — 2,5–13 секунд.

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Deepfake Audio Detection Model

Fine-tuned Wav2Vec2 model for detecting AI-generated speech. Determines if audio was spoken by a human or created by AI text-to-speech/voice cloning software.

Model Details

Model Description

Fine-tuned Wav2Vec2 transformer for binary audio classification (real vs AI-generated speech). Trained to distinguish authentic human speech from synthetic audio generated by AI text-to-speech and voice cloning services including:

  • ElevenLabs
  • Amazon Polly
  • Hexgrad Kokoro
  • Hume AI
  • Speechify
  • Luvvoice

Developed by: Gary A. Stafford

Note: This model uses transfer learning from a base model already trained for deepfake detection. Fast convergence is expected due to task similarity and TTS engine overlap with the base model's training data.

How to Use

Installation

Install the required dependencies:

pip install transformers torch librosa

Optional: For GPU acceleration (recommended):

# For CUDA 11.8
pip install torch --index-url https://download.pytorch.org/whl/cu118

# For CUDA 12.1
pip install torch --index-url https://download.pytorch.org/whl/cu121

Quick Start

import torch
import librosa
from transformers import AutoModelForAudioClassification, AutoFeatureExtractor

# Load model and feature extractor
model_name = "garystafford/wav2vec2-deepfake-voice-detector"
model = AutoModelForAudioClassification.from_pretrained(model_name)
feature_extractor = AutoFeatureExtractor.from_pretrained(model_name)

# Move to GPU if available
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)
model.eval()

# Load and preprocess audio (automatically resamples to 16kHz)
audio, sr = librosa.load("path/to/audio.wav", sr=16000, mono=True)
inputs = feature_extractor(audio, sampling_rate=16000, return_tensors="pt", padding=True)
inputs = {k: v.to(device) for k, v in inputs.items()}

# Run inference
with torch.no_grad():
    outputs = model(**inputs)
    logits = outputs.logits
    probs = torch.nn.functional.softmax(logits, dim=-1)

# Get prediction
prob_real = probs[0][0].item()
prob_fake = probs[0][1].item()
prediction = "fake" if prob_fake > 0.5 else "real"

print(f"Prediction: {prediction}")
print(f"Confidence: {max(prob_real, prob_fake):.2%}")
print(f"Probabilities - Real: {prob_real:.2%}, Fake: {prob_fake:.2%}")

Expected Input

  • Audio format: WAV, MP3, FLAC, or any format supported by librosa
  • Sample rate: Automatically resampled to 16kHz
  • Channels: Converted to mono
  • Duration: Optimal performance on 2.5-13 second clips (model training range)

Output

The model outputs logits (raw, unnormalized scores) for two classes:

  • Class 0: Real (human) audio
  • Class 1: Fake (AI-generated) audio

Converting Logits to Probabilities:

Apply softmax to convert raw logits into interpretable probability scores:

probs = torch.nn.functional.softmax(logits, dim=-1)
  • Single sample: logits.shape = (1, 2) → probs.shape = (1, 2) where probs[0] contains [prob_real, prob_fake] summing to 1.0
  • Batch processing: logits.shape = (N, 2) → probs.shape = (N, 2) where each sample's probabilities sum to 1.0 independently
  • dim=-1: Applies softmax across classes for each sample, not across samples

Batch Processing Example

import glob

audio_files = glob.glob("audio_folder/*.wav")

for audio_path in audio_files:
    audio, _ = librosa.load(audio_path, sr=16000, mono=True)
    inputs = feature_extractor(audio, sampling_rate=16000, return_tensors="pt", padding=True)
    inputs = {k: v.to(device) for k, v in inputs.items()}

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

    prediction = "fake" if probs[0][1] > 0.5 else "real"
    print(f"{audio_path}: {prediction} ({probs[0][1]:.2%} fake)")

Training Details

Dataset

Source: garystafford/deepfake-audio-detection

Composition:

  • Real audio: YouTube recordings from 14 source videos, human speech samples
  • Synthetic audio: Generated using 6 TTS platforms (ElevenLabs, Amazon Polly, Hexgrad Kokoro, Hume AI, Speechify, Luvvoice)
  • Format: FLAC, 16kHz mono, 2.5-13 second chunks
  • Total samples: 1,866 (balanced: 933 real, 933 fake)
  • Processing: Two-pass audio splitting with silence detection, concatenation of short segments, and VAD-based sub-chunking

Split:

SplitRealFakeTotalPercentage
Train7467461,49280%
Validation939418710%
Test949318710%

Stratified splitting applied to ensure balanced class distribution across all splits.

Training Approach

Base Model: Gustking/wav2vec2-large-xlsr-deepfake-audio-classification - A Wav2Vec2-XLSR model pre-trained on 53 languages and already fine-tuned for deepfake audio detection.

Method: Transfer learning with selective layer freezing:

  • Frozen:
    • Wav2Vec2 feature extractor (convolutional layers)
    • Bottom 12 transformer encoder layers
  • Trained:
    • Top 12 transformer encoder layers (upper half)
    • Classification head (256-dimensional projection + linear classifier)
    • ~160M trainable parameters (approximately half the model)
  • Rationale: Freezing low-level acoustic features while training high-level semantic layers allows the model to adapt to this dataset's specific TTS characteristics and speaker patterns while preserving general audio understanding.

Hyperparameters

ParameterValue
Learning rate3e-5
Epochs (max)5
Early stopping patience3 evaluations
Evaluation frequencyEvery 30 steps
Per-device batch size4
Gradient accumulation steps4
Effective batch size16
OptimizerAdamW
Warmup ratio0.1 (10%)
Weight decay0.01
Save strategyEvery 30 steps
Metric for best modelROC-AUC
PrecisionFP16

Training Statistics:

  • Training samples: 1,492 (746 real, 746 fake)
  • Validation samples: 187 (93 real, 94 fake)
  • Trainable parameters: 160,336,770 (~160M parameters, approximately 50% of full model)
  • Training approach: Freeze feature extractor and bottom 12 transformer layers; train top 12 transformer layers + classification head
  • Convergence: Efficient convergence (typically ~3-4 epochs) due to base model's existing deepfake detection capabilities
  • Why high performance? Transfer learning from a specialist deepfake detector allows rapid adaptation to this dataset while training substantial portions of the model to capture dataset-specific patterns

Architecture

The model uses AutoModelForAudioClassification with a two-class output (0=real, 1=fake):

  • Feature Extractor (Frozen): 7 convolutional layers extract acoustic features from raw audio
  • Transformer Encoder:
    • Layers 0-11 (Frozen): Preserve low-level acoustic and phonetic representations
    • Layers 12-23 (Trained): Adapt high-level semantic features to deepfake patterns
  • Classification Head (Trained): 256-dimensional projection + linear classifier

This architecture balances efficiency with adaptability—frozen layers preserve general audio understanding while trained layers (~160M parameters) learn dataset-specific deepfake detection patterns.

Model Performance

⚠️ IMPORTANT CONTEXT: These high-performance metrics reflect fine-tuning a specialist model on its own domain. The base model (Gustking/wav2vec2-large-xlsr-deepfake-audio-classification) was already trained for deepfake detection, likely on similar TTS engines. These results demonstrate successful adaptation to this specific dataset of 1,866 samples, NOT general deepfake detection capability from scratch. The excellent ROC-AUC (0.998) indicates near-perfect class separation, though 4 samples (2.1%) are still misclassified at the default 0.5 threshold.

Validation Set Performance

The model performs well on the validation set of 187 audio clips (94 real, 93 fake):

Validation Results (at threshold 0.5):

  • Accuracy: 97.9% (183 out of 187 samples correctly classified)
  • ROC-AUC: 0.998 (near-perfect class separation)
  • Balanced Accuracy: 97.9%

Per-Class Metrics (threshold 0.5):

ClassPrecisionRecallF1-ScoreSupport
Real1.000.960.9894
Fake0.961.000.9893

Confusion Matrix (threshold 0.5):

Pred RealPred Fake
True Real904
True Fake093

Note: Best balanced accuracy of 98.4% achieved at threshold 0.9 (96.8% real recall, 100% fake recall).

Important Notes on Performance

Context for High Performance:

  1. Moderate validation set: 187 samples provides reasonable evaluation, though larger test sets recommended for production validation
  2. Transfer learning: Base model already trained for deepfake detection on similar TTS engines - fine-tuning adapts existing knowledge
  3. Dataset characteristics: TTS-generated audio has distinctive artifacts (prosody patterns, spectral signatures) that differentiate it from human speech
  4. ROC-AUC of 0.998: Indicates near-perfect ranking/separation of classes; 4 real samples misclassified as fake at threshold 0.5, while all fake samples correctly identified
  5. Recommended validation: Test on TTS engines NOT in training data (e.g., OpenAI TTS, Azure Neural, advanced voice cloning systems) for true generalization assessment

Generalization Limitations:

  • Model may not generalize well to:
    • Novel TTS engines not represented in training data
    • Advanced voice cloning/conversion systems
    • Real-time voice manipulation
    • Low-quality recordings with significant noise

Inference Performance

Estimated based on model architecture:

  • Latency: ~50-100ms per sample (varies by hardware)
  • Recommended use: Batch processing for efficiency

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers · text-classification

Нельзя запустить

Для архитектуры wav2vec2 нет загрузчика под задачу text-classification.

Класс архитектуры
Wav2Vec2ForSequenceClassification
Ревизия весов
eaa7dae

0 моделей