An open API service indexing awesome lists of open source software.

https://github.com/slrwndqhr18/vit-detecting-deepfake-audio


https://github.com/slrwndqhr18/vit-detecting-deepfake-audio

deepfake-detection machine-learning python pytorch transformer vit

Last synced: 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Detecting deepfake audio using VIT

This project is about detecting deepfake audio using attention algorithem.

idea source
paper: https://ieeexplore.ieee.org/document/10197715
by: Guzin Ulutas

## Model architecture

image

[Fig1. ML Architecture]
In this project I designed simple but effective structure. The main logic is 3 things.
- Converting audio data to CQT image had conducted in parallel programing.
- VIT model is mixed with LoRA model.
- Training model process has amp code.

------------------------------
## About Code

I used VIT as base model and added LoRA for accuracy.
Important thing in here is you need to convert audio data into the CQT image. this process will be done at preprocessing layer.

|File name|description|
|------|---|
| /model | Every codes related to ML model |
| /model/Component | Codes that used inside the ML model.Its a component of ML model like attention alg or FN layer. |
| handleConfig.py | load CONFIG.yaml and setup every parameters |
| handleDataset.py | By using PyTorch Dataloader, revise and format preprocessed data into PyTorch data structure |
| handlePreprocess | Load raw dataset and execure preprocessing |
| makeGraph | Just making graph to see the result. Nothing important in here. |
| handleMultiPs | Making the CQT file using multiprocessing. |

- main.py is the entry point of process. Just run main.py
- /model/Executor.py is the entry point of ML model. It is a class to load params and define model train / test / run process.
- For the reduction of preprocessing time, parallel programin is used in here.
- There is the code about amp, and this reduced training time alot.

## Result

image

About 95% accuracy, but there is a problem in here.
The scheduler that I used in here is not optimized. It works in low epoch number, but it causes error if the number of epoch is high.So using the same code is ok, but before to use this, I should find more great schduler.

Test was conducted epoch=8, and the result was great.