This repository contains the official implementation of the Wavelet Integrated Network (WIN) originally applied for Audio Deepfake Detection using wavelet-based feature mapping modeling.
WIN/
│
├── train.py # Training script (Python implementation)
├── test.py # Testing / evaluation
├── model_info.py # Parameter & FLOPs analysis (optional)
│
├── config.py # Configuration
├── requirements.txt # Dependencies
│
├── utils/
│ ├── device.py
│ └── metrics.py
│
├── data/
│ └── dataloader.py
│
├── models/
│ ├── preprocess.py
│ ├── frontend.py
│ ├── encoder.py
│ ├── WIN_classifier.py
│ └── WIN.py
│
├── tests/
│ └── test_forward.py
│
├── Notebooks/ # Original experimental notebooks (implemented in paper)
│ ├── Backend/ # Jupyter notebooks for each wavelet
│ │ ├── bump.ipynb
│ │ ├── morlet.ipynb
│ │ ├── dog.ipynb
│ │ ├── mex_h.ipynb
│ │ └── morse.ipynb
│ │
│ └── Backend_models/ # Model checkpoints (.pth)
│ ├── bump.pth
│ ├── morlet.pth
│ ├── dog.pth
│ ├── mex_h.pth
│ └── morse.pth
├── Dataset_Formation (Contains codes for forming dataset in particular format)
│
└── README.md
Install dependencies:
pip install -r requirements.txtOptional tools for model analysis:
pip install torchinfo fvcoreThis project supports ASVspoof 2019 and ASVspoof 2021 (LA) datasets.
Datasets must be organized as:
dataset_root/
├── train/
│ ├── bonafide/
│ └── spoof/
├── dev/
│ ├── bonafide/
│ └── spoof/
└── test/
│ ├── bonafide/
│ └── spoof/
Update paths in config.py accordingly if using python.
The Dataset_Formation/ directory provides scripts to automatically organize ASVspoof 2019 and ASVspoof 2021 (LA) datasets into the required format once downloaded zip (from original ASVSpoof website) and extracted. Users are recommended to use these scripts for consistency.
Preprocessed Datasets zip download (Kaggle.com)
-
ASVspoof 2021 (LA):
https://www.kaggle.com/datasets/artharking/asv-2021-la-test -
ASVspoof 2019 (AA):
https://www.kaggle.com/datasets/artharking/asv-19-aa
These can be used directly without additional preprocessing.
The original experiments and model development were conducted using Jupyter notebooks on the Kaggle platform.
To ensure full reproducibility, this repository includes the complete set of original notebooks and trained models.
The Notebooks/ directory is organized as follows:
Notebooks/
├── Backend/ # Training and evaluation notebooks
│ ├── bump.ipynb
│ ├── morlet.ipynb
│ ├── dog.ipynb
│ ├── mex_h.ipynb
│ └── morse.ipynb
│
└── Backend_models/ # Corresponding trained model checkpoints
├── bump.pth
├── morlet.pth
├── dog.pth
├── mex_h.pth
└── morse.pth
Each notebook in Backend/ contains the complete experimental pipeline for a specific wavelet type.
The Backend_models/ directory contains the trained model checkpoints generated by these notebooks.
Two complementary implementations are provided:
- Notebook-based implementation (Original and Recommended)
- Located in
Notebooks/Backend/ - Used for initial experimentation and result generation
- Suitable for interactive analysis and visualization.
- Located in
- For modular Python implementation please follow below steps
Run training:
python train.pyThe best model is saved automatically based on validation EER.
Run evaluation:
python test.pyOutputs:
- Final EER
Verify forward pass and architecture:
python tests/test_forward.pyThis performs a dummy inference to validate model consistency.
Check parameters and FLOPs:
python model_info.pyThis reports:
- Trainable parameters
- Total parameters
- Model size
- MACs / FLOPs
- GFLOPs per second
- Layer-wise breakdown
The overall processing pipeline is:
Waveform
↓
Pre-Emphasis
↓
Sinc + CNN Frontend
↓
Positional Encoding
↓
Multi-Wavelet Classifier
↓
Sequence Pooling
↓
Classification
The Wavelet feature maps in WIN_classifier.py module supports the following wavelet types:
| Config Name | Wavelet Family |
|---|---|
| bump | Bump Wavelet |
| morlet | Morlet Wavelet |
| dog | Derivative of Gaussian (DoG) |
| mex_h | Mexican Hat (Ricker) |
| morse | Generalized Morse Wavelet |
Wavelet type can be selected in config.py:
WAVELET_TYPE = "bump" # default bump ["bump", "morlet", "dog", "morse", "mex_h"]The following metrics are used:
- Equal Error Rate (EER)
- Tandem Detection Cost Function (t-DCF)
Employing t-DCF for CM task would give value 1, as t-DCF is not employed for CM task, we in future plan to extend system for End-to-End ASV system.
Implemented in utils/metrics.py.
All hyperparameters and experiment settings are defined in:
config.py
This includes:
- Dataset paths
- Training parameters
- Model dimensions
- Wavelet selection
Modify this file to conduct different experiments.
Trained models are saved at:
WIN.pth
Defined in config.py as SAVE_PATH.
If you use this work in your research, please cite:
@article{win,
author={Shah, Arth J. and Pandey, Aniket and Patil, Hemant A.},
journal={IEEE Signal Processing Letters},
title={WINning Against Audio Deepfakes},
year={2026},
volume={33},
number={},
pages={2240-2244},
keywords={Modeling;Fans;Speech;Deepfakes;Conferences;Signal detection;Frequency;Timing;Transformers;Modules (abstract algebra);Wavelets;FAN;transformers;ADD},
doi={10.1109/LSP.2026.3695000}
}
This project is intended for academic and research use only.
For commercial usage, please contact the authors.
This repository is built on top of several open source projects.
- AASIST repo
- Rawformer Repo
- FAN repo
- FANFormer Repo (ATF module inspiration)
Authors: Arth J. Shah Aniket Pandey Hemant A. Patil
Email: 202521004@dau.ac.in , 202411001@dau.ac.in , arth123shah@gmail.com , aniket25403@gmail.com