๐Ÿ›ก๏ธ VoiceGuard

Real-Time AI Detection & Prevention of Voice Cloning Impersonation Attacks

SIH 2026 ยท Problem Statement SIH26104

Python PyTorch FastAPI Model Size Latency License Status


A sub-200ms edge detection engine that analyzes raw audio waveforms to detect and terminate synthesized deepfake calls โ€” purpose-built for India's multilingual telecom ecosystem.


๐Ÿ“Œ Table of Contents


๐Ÿšจ The Problem

Voice cloning technology has made it trivial to impersonate anyone. A 10-second sample of a person's voice is enough to train a model that can speak anything in their voice.

In India, this has fueled a rising wave of financial fraud, misinformation, and identity theft carried out over ordinary phone calls:

  • ๐Ÿ“ž "Mom, I've been kidnapped" scams using a cloned child's voice
  • ๐Ÿฆ OTP / bank executive frauds with cloned official voices
  • ๐Ÿ—ณ๏ธ Political misinformation spread via fabricated audio of public figures
  • ๐Ÿ‡ฎ๐Ÿ‡ณ Multilingual attacks exploiting gaps in accent- and language-agnostic detection

Existing defenses are slow, GPU-hungry, and fail on Indian languages and accents.


๐Ÿ’ก Our Solution

VoiceGuard is a real-time, streaming deepfake detection system that:

Capability Detail
โšก Real-time Sliding 250ms windows, verdicts in <185ms
๐Ÿ—ฃ๏ธ Raw waveform analysis 1D Sinc-Conv learns acoustic features directly โ€” no mel-spectrogram bottleneck
๐ŸงŠ Edge-optimized INT8 dynamic quantization + Conv-BN fusion = runs on 2 vCPU cores, 2.2MB effective footprint
๐Ÿ‡ฎ๐Ÿ‡ณ India-first Trained on samples across 12 Indic languages, zero accent bias
๐Ÿšจ Autonomous kill-switch Auto-terminates calls at 75% synthetic confidence over 2 consecutive windows
๐Ÿ” Privacy-preserving No raw audio stored; SHA-256 chunk hashing; on-premise inference

Detection Classes

Class Meaning
gt Ground truth โ€” bona-fide human speech โœ…
synthetic_indic TTS-synthesized Indian-language speech ๐Ÿšจ
diffwave DiffWave neural vocoder ๐Ÿšจ
melgan MelGAN neural vocoder ๐Ÿšจ
wavenet WaveNet neural vocoder ๐Ÿšจ

๐Ÿง  Model Architecture

VoiceGuardRawNet โ€” a compact quantized 1D RawNet designed for CPU-only, low-latency edge deployment:

Input: Raw 16 kHz waveform (1.5s window = 24,000 samples)
  โ”‚
  โ”œโ”€โ”€ SincConv            (64 learnable sinc band-pass filters, k=129)
  โ”œโ”€โ”€ ResidualBlock       (64 โ†’ 64)
  โ”œโ”€โ”€ ResidualBlock       (64 โ†’ 128, stride 2)
  โ”œโ”€โ”€ ResidualBlock       (128 โ†’ 128)
  โ”œโ”€โ”€ MaxPool1d           (k=10, stride 10)
  โ”œโ”€โ”€ BiGRU               (2 layers, hidden 256)   โ”€โ”€โ–บ  INT8 quantized
  โ””โ”€โ”€ Linear              (512 โ†’ 5 classes)

Key optimizations applied:

  • ๐Ÿ”น Learnable sinc band-pass filters replace hand-crafted features
  • ๐Ÿ”น Conv-BN fusion for reduced inference latency
  • ๐Ÿ”น INT8 dynamic quantization on GRU + Linear layers
  • ๐Ÿ”น Sinc kernel pre-caching eliminates runtime torch.sinc() calls
  • ๐Ÿ”น ~206K parameters โ†’ extremely lightweight

โšก Performance Benchmarks

Model footprint and latency measured on 2 vCPU threads (no GPU):

Metric Baseline Fused Fused + INT8 Budget
P95 Latency 126 ms 160 ms 138 ms โœ… <185 ms
Model Size 1.0 MB โ€” 1.02 MB โœ… <2.2 MB
Mean Latency ~104 ms ~128 ms ~110 ms โœ…

๐Ÿ“Š Both latency and footprint stay comfortably within SIH deployment budgets โ€” no GPU required.


๐Ÿš€ Quick Start

1. Clone the repository

git clone https://huggingface.co/indrajit4533/voiceguard
cd voiceguard

2. Install dependencies

pip install -r requirements.txt

3. Run the server

python app.py

4. Open the dashboard

http://localhost:8000

๐ŸŽฏ The live dashboard includes an audio-upload interface where you can test real files and see class probabilities, threat scores, and inference latency instantly.


๐Ÿ”Œ API Reference

GET / โ€” Landing dashboard

Serves the interactive VoiceGuard web UI โ€” upload audio, see live detection results.

GET /api/health

{
  "status": "healthy",
  "model_loaded": true,
  "model_type": "VoiceGuardRawNet INT8",
  "classes": ["synthetic_indic", "diffwave", "melgan", "gt", "wavenet"]
}

POST /api/analyze

Upload audio (multipart/form-data, field: file):

curl -X POST http://localhost:8000/api/analyze \
     -F "file=@sample.wav"

Response:

{
  "threat_score": 96.4,
  "authenticity_score": 3.6,
  "top_class": "melgan",
  "action": "TERMINATE CALL",
  "is_synthetic": true,
  "probabilities": {
    "synthetic_indic": 1.2,
    "diffwave": 0.8,
    "melgan": 96.4,
    "gt": 3.6,
    "wavenet": 0.0
  },
  "inference_ms": 132.5
}

๐Ÿ–ฅ๏ธ Live Demo

โ–ถ๏ธ Open the Live Demo

Try it with:

  • ๐ŸŽ™๏ธ Your own voice recording โ†’ expect ALLOW CALL
  • ๐Ÿ”Š Any TTS / AI voice clip โ†’ expect TERMINATE CALL
  • ๐Ÿ“ Real-world deepfake audio datasets (ASVspoof, MLAAD, etc.)

๐Ÿ—๏ธ System Design

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Inbound    โ”‚ โ”€โ”€โ–บ โ”‚ Streaming    โ”‚ โ”€โ”€โ–บ โ”‚ VoiceGuard RawNet โ”‚ โ”€โ”€โ–บ โ”‚  Verdict   โ”‚
โ”‚ VoIP Call  โ”‚     โ”‚ Ring Buffer  โ”‚     โ”‚ INT8 Inference    โ”‚     โ”‚ Pass/Drop  โ”‚
โ”‚            โ”‚     โ”‚ (250ms win)  โ”‚     โ”‚ 2 vCPU, <185ms   โ”‚     โ”‚            โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                   โ”‚                      โ”‚                     โ”‚
       โ”‚                   โ”‚                      โ”‚                     โ–ผ
       โ”‚                   โ”‚                      โ”‚            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ”‚                   โ”‚                      โ”‚            โ”‚  Kill-Switch โ”‚
       โ”‚                   โ”‚                      โ”‚            โ”‚  โ‰ฅ75% ร— 2w   โ”‚
       โ”‚                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”          โ”‚            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
       โ”‚                               โ”‚          โ”‚                     โ”‚
       โ–ผ                               โ–ผ          โ–ผ                     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ SHA-256    โ”‚                 โ”‚ Threat     โ”‚  โ”‚ Audit Log  โ”‚   โ”‚ Call        โ”‚
โ”‚ Chunk Hash โ”‚                 โ”‚ Scorer     โ”‚  โ”‚ (Forensic) โ”‚   โ”‚ Termination โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Streaming pipeline

  1. Ingest โ€” raw VoIP stream partitioned into 250ms chunks (~4,000 samples @16kHz)
  2. Buffer โ€” sliding window accumulates 1.5s (24,000 samples) for context
  3. Detect โ€” INT8 model scores each window; threat = 1 โˆ’ P(bona_fide)
  4. Mitigate โ€” sustained โ‰ฅ75% confidence across 2 consecutive windows triggers automatic call termination

๐Ÿ›ก๏ธ Mitigation Workflow

High Threat Detected (โ‰ฅ75%)
        โ”‚
        โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Kill-Switch Arm  โ”‚  โ”€โ”€ 1st consecutive window above threshold
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
        โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Second Window?   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
   โ”‚ No              โ”‚ Yes
   โ–ผ                 โ–ผ
 Re-analyze    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
               โ”‚ TERMINATE CALL   โ”‚
               โ”‚ + Forensic Audit โ”‚
               โ”‚ + Alert Dispatch โ”‚
               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ› ๏ธ Tech Stack

Layer Technology
Backend FastAPI + Uvicorn
Model PyTorch (1D RawNet, INT8 dynamic quantization)
Audio TorchAudio
Web UI HTML / Tailwind CSS / vanilla JS
Serialization Safetensors (pickle-free, secure)
Deployment Hugging Face / Docker / local edge servers

๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ Team

VoiceGuard is built by Team's for Smart India Hackathon 2026 (SIH26104):

๐Ÿ‘ฉโ€๐Ÿ’ป Member Role
Indrajit Yadav Founder & Lead Developer ยท Model Design, Backend, Quantization & Deployment
Swetha S Team Member ยท Model support & Evaluation
Harinandan P S Team Member ยท Pipeline & Integration Support
Dharshini M Team Member ยท UI/UX & Design
Sudarsan Team Member ยท Testing & Deployment Support
Divya Team Member ยท Research & Documentation

๐Ÿ“‹ Disclaimer

This project is provided for research and ethical security applications under Smart India Hackathon 2026. VoiceGuard is designed to detect and protect against voice-cloning fraud โ€” it does not generate synthetic speech. Use responsibly.


Built with โค๏ธ for India's telecom ecosystem

Smart India Hackathon 2026 ยท Problem Statement SIH26104

๐Ÿ”— View on Hugging Face

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support