The code of "ALIF: Low-Cost Adversarial Audio Attacks on Black-Box Speech Platforms Using Linguistic Features".
Here we provide the code for generating the attack examples described in the paper, and audio demos can be found on the Demo Page.
-
alif_otl.py: The implementation of ALIF-OTL which is described in the paper.
-
alif_otl_run.py: Run alif_otl.py and generate the example.
-
alif_ota.py: The implementation of ALIF-OTA which is described in the paper.
-
alif_ota_run.py: Run alif_ota.py and generate the example.
-
optimizer.py: We implement the particle swarm optimization here and use it in the ALIF-OTA.
-
ASRs.py: The speech-to-text APIs need to be implemented here.
-
tacotron2: The repo of tacotron2 and we add some code at the bottom of model.py.
-
Python==3.6.13
-
torch==1.8.0+cu111
You are supposed to build the tacotron2 environment by yourself and more details can be found in Tacotron2.
-
You need to implement the functions in ASRs.py by yourself.
-
Set the parameters in alif_otl_run.py or alif_ota_run.py.
-
Just run alif_otl_run.py or alif_ota_run.py and the results will be saved in the directory alif_otl_example or alif_ota_example.
python alif_otl_run.py
orpython alif_ota_run.py