tartarleft / BGMA

demos and source code for BGMA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Background Music Attack

Demos and PyTorch implementation of Background Music Attack (BGMA) in our paper "Fooling Speaker Identification Systems with Adversarial Background Music" (INTERSPEECH 2023).

Prerequisites

  • Python (3.6.9)
  • Pytorch (1.2.0)
  • SoundFile (0.10.3)
  • librosa (0.8.1)
  • CUDA
  • numpy
  • pydub
  • tqdm

Demos of Adversarial Music

The following are the adversarial music generated by the migration of PGD. There are two examples for each target model: X-vector, D-TDNN, and ECAPA. The targeted model is indicated by the file name.

X-vector_1.mp4
X-vector_2.mp4
D-TDNN_1.mp4
D-TDNN_2.mp4
ECAPA_1.mp4
ECAPA_2.mp4

The following are the adversarial music generated by BGMA, which is more auditorily natural with less white-noise-like sound in the music.

X-vector_1.mp4
X-vector_2.mp4
D-TDNN_1.mp4
D-TDNN_2.mp4
ECAPA_1.mp4
ECAPA_2.mp4

Pretrained Models

We provide the pretrained SI models and pretrained music model in the link. To run this project, unzip the 'ckpt' folder into the root directory of the project.

Data

We provide the test waves on TIMIT and the enrolled speaker embeddings in link. To run this project,, unzip the 'data' folder into the root directory of the project. To reimplement the experiment in our paper, you also have to download the MUSAN dataset and use the classical-HD subset as the initialization music. You can download the dataset into './data' or modify the corresponding path in './config/basic.json'.

Usage

To run the PGD attack on music wave, run:

python Attacker-BGM.py --exp mupgd

To run BGMA on all the initialization muisc, run:

python Attacker-BGM.py --exp BGMA-rand

To run BGMA on one slices of muisc for all the target speakers, run:

python Attacker-BGM.py --exp BGMA-all

Reference

Play-As-You-Like

About

demos and source code for BGMA


Languages

Language:Python 100.0%