A deep learning framework for audio deepfake detection using models including AASIST and LCNN architectures.
- Support for multiple model architectures (AASIST, LCNN)
- Multi-GPU and single-GPU training support
- Comprehensive evaluation metrics
- Audio preprocessing and augmentation
- Pre-trained model checkpoints
- Python 3.10+
- CUDA-compatible GPU (recommended)
- Conda package manager
- Create and activate conda environment:
conda create -n deepfake python=3.10
conda activate deepfake- Install dependencies:
pip install -r requirements.txtAlternatively, you can use the provided conda environment file:
conda env create -f environment.yml
conda activate deepfakePrepare your dataset with the following structure:
data/
├── train.txt
├── test.txt
└── audio_files/
├── file1.wav
├── file2.wav
└── ...
Create label files (train.txt, test.txt) with the following format:
file_id,file_path,label
0069156,aigc_speech_detection_tasks_part1/0069156.wav,Bonafide
0069157,aigc_speech_detection_tasks_part1/0069157.wav,Spoof
Where:
file_id: Unique identifier for the audio filefile_path: Relative path to the audio filelabel: Either "Bonafide" (real) or "Spoof" (fake)
For training with multiple GPUs:
bash train.shFor training with a single GPU:
bash run_single.shYou can also run training directly with custom parameters:
python train.py --config_path configs/your_config.yamlRun inference on a dataset:
python inference.py --model_path path/to/model.pth --data_path path/to/test_dataUse the provided shell script for quick inference:
bash infer.sh path/to/audio_file.wavThis project supports multiple architectures:
- AASIST: Audio Anti-Spoofing using Integrated Spectro-Temporal graph attention
- LCNN: Light Convolutional Neural Network
├── module/ # Model architectures
│ ├── AASIST.py # AASIST model implementation
│ └── LCNN.py # LCNN model implementation
├── scripts/ # Utility scripts
├── ckpts/ # Pre-trained checkpoints
├── exports/ # Training outputs
├── dataset.py # Dataset loading utilities
├── model.py # Model wrapper
├── learner.py # Training logic
├── inference.py # Inference utilities
├── metrics.py # Evaluation metrics
└── params.py # Configuration parameters
Training logs and model checkpoints are saved in the exports/ directory. You can monitor training progress and evaluate model performance using the provided metrics.
Feel free to submit issues and pull requests to improve this project.
This project is licensed under the MIT License - see the LICENSE file for details.