Code Monkey home page Code Monkey logo

tdl-add's Introduction

TDL for partially deepfake detection

This is the pytorch implementation of our work titled "An Efficient Temporary Deepfake Location Approach Based Embeddings for Partially Spoofed Audio Detection ," which was available on arxiv at "https://arxiv.org/abs/2309.03036".

1. Offline Data Extraction

python preprocess.py 

Please download the training, development and evaluation set from ASVspoof PartialSpoof Database first.

Please ensure the data and label position are correct. If you need to adjust, please modify the class ASVspoof2019PSRaw in raw_dataset.py.

After downloading, plase place the train, dev, and eval raw wave folders of 19PS under /home/xieyuankun/data/asv2019PS/.

We have provided the padded label in ./label/. Please place the train, dev, and eval labels under /home/xieyuankun/data/asv2019PS/ASVspoof2019_PS_cm_protocols/.

After preprocess, the last hidden states of wav2vec2 will be saved in /home/xieyuankun/data/asv2019PS/preprocess_xls-r-300m.

2. Train Model

python main_train.py 

Before running the main_train.py, please change the path_to_features according to the files' location on your machine.

If training is slow, consider adjusting the num_worker parameter in conjunction with the number of CPU cores. The default is set to 8. If performance remains slow, you may explore multi-GPU training in args.

3. Test

python generate_score_offline.py 
python eval_ps.py

You will get the final test EER, Precision, Recall and F1_score.

tdl-add's People

Contributors

xieyuankun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

maximusarthur

tdl-add's Issues

preprocess.py文件问题

你的preprocess.py文件会一次性把数据集导入cpu撑爆,请问是否有改进的代码?

训练问题

您好,请问能否告知一下您训练的环境,我采用您开源的代码进行训练的时候,十分缓慢。如果可以,能否给出一个预训练模型,方便我进行一些测试。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.