Deepfake-audio-detection

mo-thecreator/Deepfake-audio-detection

mo-thecreator 260K downloads apache-2.0 Audio Classification
Frameworkstransformerssafetensors
Tagstensorboardwav2vec2audio-classificationgenerated_from_trainerbase_model:mo-thecreator/wav2vec2-base-finetunedbase_model:finetune:mo-thecreator/wav2vec2-base-finetuned
Downloads
260K
License
apache-2.0
Pipeline
Audio Classification
Author
mo-thecreator

Run Deepfake-audio-detection locally on a Q4KM hard drive

Boost your deployment speed with Q4KM’s high‑performance SSDs pre‑loaded with the Deepfake‑audio‑detection model. Each drive ships with the full Hugging Face repository, ready for immediate inference...

Shop Q4KM Drives

Technical Overview

Model ID: mo-thecreator/Deepfake-audio-detection
Model Name: Deepfake‑audio‑detection
Author: mo‑thecreator
Pipeline Tag: audio‑classification

The Deepfake‑audio‑detection model is a fine‑tuned wav2vec2‑base‑finetuned transformer that classifies short audio clips as either genuine speech or synthetic (deepfake) speech. Built on the proven wav2vec2 architecture, it converts raw waveforms into high‑dimensional acoustic representations and then applies a lightweight classification head to output a binary label (real vs. fake). The model is specifically optimized for detecting AI‑generated voice for that are increasingly used in fraud, misinformation, and unauthorized voice cloning.

Key Features & Capabilities

  • End‑to‑end audio processing: No feature extraction step required – the model ingests raw PCM waveforms (16 kHz) directly.
  • High accuracy: Achieves 98.82 % accuracy on the held‑out evaluation set with a loss of 0.0829.
  • Lightweight inference: Uses the base‑size wav2vec2 (≈95 M parameters) making it feasible on consumer‑grade GPUs.
  • TensorBoard logging & safetensors support: Enables easy monitoring and fast loading.
  • Endpoints‑compatible: Ready for deployment via Hugging Face Inference Endpoints or any ONNX‑compatible serving stack.

Architecture Highlights

  • The backbone is a wav2vec2‑base encoder (12 transformer layers, 768 hidden size, 8 attention heads).
  • A classification head (single linear layer) is added on top of the pooled encoder output to produce a 2‑class softmax.
  • Fine‑tuning was performed with a learning rate of 3e‑5, linear scheduler, and a warm‑up ratio of 0.1.
  • Training employed gradient accumulation (4 steps) to achieve an effective batch size of 32 while fitting on a single GPU.

Intended Use Cases

  • Real‑time monitoring of call‑center audio streams for synthetic voice intrusion.
  • Verification of podcast or broadcast recordings before publication.
  • Forensic analysis of audio evidence in legal investigations.
  • Integration into anti‑spoofing modules for voice‑assistant platforms.

Benchmark Performance

For audio‑classification models, the most relevant benchmarks are accuracy and loss on a held‑out validation set, as well as ROC‑AUC when dealing with imbalanced classes. The Deepfake‑audio‑detection model reports:

  • Loss: 0.0829
  • Accuracy: 98.82 %

These numbers were obtained after 5 epochs of training on an undisclosed “None” dataset (presumably a curated collection of genuine and synthetic speech). An accuracy above 98 % indicates that the model can reliably separate deepfake audio from authentic recordings in the test distribution. Compared with the original wav2vec2‑base model (which typically achieves ~90 % on generic speech classification tasks), the fine‑tuned version shows a substantial boost, confirming the effectiveness of the targeted fine‑tuning.

While the README does not provide ROC‑AUC or precision‑recall metrics, the high accuracy and low loss suggest a strong separation margin, which is critical for security‑sensitive deployments where false negatives (missed deepfakes) are costly.

Hardware Requirements

The model contains roughly 95 M parameters (wav2vec2‑base + classification head). In practice, the following hardware recommendations ensure smooth inference:

  • VRAM for inference: 4 GB of GPU memory is sufficient for batch size = 1 (single audio clip). For batch processing (e.g., 8‑clip batches), 6–8 GB is advisable.
  • Recommended GPU: NVIDIA RTX 3060 (12 GB) or higher, AMD Radeon RX 6700 XT, or any GPU supporting CUDA 11+ / ROCm.
  • CPU: Modern multi‑core CPU (Intel i5‑12400 or AMD Ryzen 5 5600X) can handle preprocessing and model loading; a minimum of 8 GB RAM is recommended.
  • Storage: The model files (including safetensors) occupy ~350 MB. Including tokenizer and configuration files, allocate at least 500 MB of disk space.
  • Performance: On a RTX 3060, inference latency for a 5‑second audio clip is ~30 ms, enabling near‑real‑time processing at 30 fps.

Use Cases

The Deepfake‑audio‑detection model is designed for any scenario where the authenticity of spoken content matters. Typical deployments include:

  • Call‑center fraud protection: Real‑time scoring of inbound calls to flag synthetic voices before agents engage.
  • Media verification: Automated pipelines that scan podcasts, news clips, and user‑generated videos for deepfake audio.
  • Voice‑assistant security: Adding an anti‑spoofing layer to smart speakers and virtual assistants.
  • Legal forensics: Assisting investigators in determining whether a recorded confession or testimony has been tampered with.
  • Content moderation platforms: Detecting AI‑generated audio in social‑media uploads to enforce community guidelines.

Integration is straightforward via the Hugging Face pipeline("audio-classification") API, ONNX Runtime, or TensorRT for ultra‑low latency. The model’s “endpoints_compatible” tag also means it can be deployed on Hugging Face Inference Endpoints with a single click.

Training Details

The model was fine‑tuned on a proprietary “None” dataset that contains a balanced mix of authentic speech and AI‑generated voice samples. Training was performed using the Hugging Face Trainer API with the following hyper‑parameters:

  • Learning rate: 3 × 10⁻⁵
  • Batch size (per GPU): 8 (effective batch size 32 via gradient accumulation of 4)
  • Number of epochs: 5
  • Optimizer: Adam (β₁=0.9, β₂=0.999, ε=1e‑8)
  • Learning‑rate scheduler: Linear with a warm‑up ratio of 0.1
  • Seed: 42 (ensuring reproducibility)

Training was conducted on a single NVIDIA RTX 3090 (24 GB VRAM) using PyTorch 2.1.2 and Transformers 4.39.3. The loss curve shows rapid convergence, dropping from 0.1448 in the first epoch to 0.0108 by the final epoch, while validation accuracy climbed to 98.82 %.

Fine‑tuning capabilities are preserved: users can load the base wav2vec2‑base‑finetuned checkpoint and continue training on domain‑specific deepfake datasets (e.g., specific language or codec). The model’s generated_from_trainer tag guarantees that the training script, optimizer state, and scheduler are stored in the safetensors format for easy reuse.

Licensing Information

The model card lists the Apache‑2.0 license, even though the top‑level “License” field is marked “unknown”. Apache‑2.0 is a permissive open‑source license that grants:

  • Freedom to use the model for commercial or non‑commercial purposes.
  • Permission to modify, distribute, and create derivative works.
  • Obligation to retain the original copyright notice and provide a copy of the license.
  • Requirement to include a NOTICE file if the distribution includes any additional attribution.

Because the license is permissive, you can embed the model in SaaS products, mobile apps, or on‑premise security tools without paying royalties. The only practical restriction is the need for proper attribution (e.g., “Based on mo‑thecreator/Deepfake‑audio‑detection, licensed under Apache‑2.0”). If you plan to redistribute the model binary, ensure the Apache‑2.0 license text accompanies it.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives