Logo

Getting Started

  • Installation
    • Install via pip
    • Install locally
    • Test your GPU installation
  • Quick Start
    • ASVspoof2019 LA, single GPU
  • WeDefense Support Status
    • Databases
    • Augmentation
    • Detection
    • Localization
  • WeDefense - How to debug?
    • 1. commond line
    • 2. vscode/cursor
      • 2.1 Option 1: Launch debug from a debug icon
      • 2.2 Option 2: Prepare a debugging startup script.
  • Contributing
    • How to add new database?
    • How to add new models?
  • Frequently Asked Questions (FAQs)

Tutorial

  • Speech Waveform Augmentation
    • Prepare the environment
    • Speed perturbation
    • Applying codecs
    • RawBoost
    • Recipes in WeDefense
      • How to turn on augmentation
      • Default behaviors in WeDefense
  • Spoof Detection Tutorial with WeDefense
    • What is Spoof Detection?
      • Task Definition
      • Why use LLR instead of raw posterior from network?
      • Evaluation Metrics
    • Step-by-Step Implementation in WeDefense
      • Prerequisites
      • Initial Configuration
      • Stage 1: Data Preparation
      • Stage 2: Data Formatting and Augmentation
      • Stage 3: Training
      • Stage 4: Model Averaging & Embedding Extraction
      • Stage 5: Logit Extraction
      • Stage 6: Score Calibration (Logits to LLR)
      • Stage 7: Performance Evaluation
      • Conclusion
    • Next Steps
  • Spoof Localization Tutorial with WeDefense
  • SASV Tutorial with WeDefense
  • Explainable AI (XAI) for Partially Spoofed Audio Detection with Grad-CAM
    • Overview
      • 📂 Reference Implementation Path
      • Key Components
      • What This Tutorial Covers
    • Complete Pipeline Overview
    • Grad-CAM Theory for Audio
      • What is Grad-CAM?
      • Mathematical Formulation
      • Why Grad-CAM for Partial Spoofing?
    • Model Architecture: SSL-Res1D
      • Pipeline Components
      • Key Configuration
      • Why This Architecture?
    • Stage 1: Data Preparation
      • Script: local/prepare_data.sh
      • Purpose
      • Input
      • Process
      • Output Files
    • Stage 3: Model Training (Overview)
      • Command
      • Training Process
      • Key Training Parameters
      • Output
    • Stage 4: Model Averaging
      • Purpose
      • Command
      • Process
      • Output
    • Stage 9: XAI Extraction with Grad-CAM
      • Script: wedefense/bin/XAI_GradCam_infer.py
      • Command
      • Step-by-Step Process
        • 1. Model Preparation
        • 2. Target Layer Selection
        • 3. Grad-CAM Initialization
        • 4. Per-Utterance Extraction
        • 5. Save Results
      • Output Format
    • Stage 10: XAI Score Analysis
      • Script: wedefense/bin/XAI_Score_analysis.py
      • Command
      • Analysis Components
        • 1. Load XAI Scores and VAD Information
        • 2. Compute Statistics
        • 3. Segment Detection
        • 4. Visualization
        • 5. Aggregate Analysis
      • Output
    • Interpreting XAI Results
      • Activation Patterns and Their Meanings
      • Decision Guidelines
        • For Bonafide Audio:
        • For Partially Spoofed Audio:
      • Common Pitfalls
      • Validation Checklist
    • Practical Usage Guide
      • Running the Complete Pipeline
        • 1. Setup Environment
        • 2. Configure Paths
        • 3. Run Data Preparation (Stage 1-2)
        • 4. Train Model (Stage 3-4)
        • 5. Evaluate Model (Stage 5-7)
        • 6. Extract XAI (Stage 9)
        • 7. Analyze XAI (Stage 10)
      • Customization Options
        • Change Target Layer
        • Adjust Detection Threshold
        • Target Different Class
    • Summary
      • Key Takeaways
      • Limitations and Future Directions
      • Resources
    • References
  • Export model with torch.jit.script()
    • Overview
    • Prerequisites
    • Usage
      • Basic Command
      • Arguments
      • Output Files
    • Examples
      • Example 1: Export Detection Model (wav2vec2_large_960)
      • Example 2: Export Localization Model (XLSR)
    • Loading and Using the Exported Model
      • Python Example (Backend Only)
      • C++ Example (LibTorch, Backend Only)
      • Python Example (Frontend + Backend - Full Pipeline)
  • Calibration Tutorial in WeDefense
  • Pruning Tutorial in WeDefense
WeDefense
  • Search


© Copyright 2025, WeDefense.

Built with Sphinx using a theme provided by Read the Docs.