shehzeen / waveguard_defense Goto Github PK
View Code? Open in Web Editor NEWThis is the codebase for defense framework described in USENIX '21 paper "WaveGuard: Understanding and Mitigating Audio Adversarial Examples"
This is the codebase for defense framework described in USENIX '21 paper "WaveGuard: Understanding and Mitigating Audio Adversarial Examples"
When running the code, the lpc defense does not work for me: running the code always emits .wav files that are completely silent.
The command I am running is python Defender/defender_multiple.py --in_dir /tmp/a/ --out_base /tmp/ --defender_type lpc --defender_hp 10
. When I run this I see the input is non-zero (INput wav -0.8821411 0.92477417
) but the output is completely zero (LPC min max 0.0 0.0
).
I've traced it down to the fact that the voiced_unvoiced
function looks like it always returning an array consisting entirely of 0s. This function depends on only two libraries (numpy and scipy.signal) so I don't believe it's a dependency issue.
The input I'm using is the test input here.
If you'd like to unit test this, then I've provided a numpy file here so that if you run
from lpc import voiced_unvoiced
print(voiced_unvoiced(np.load("lpc.npy")))
then you should get the output [0 0 0 0 0 . . . 0 0 0]
.
I think that this is an error, but I'm not certain. Am I doing something wrong here? Maybe the inputs should be pre-processed in some way ahead of time? Or the hyperparameters are wrong (I don't think this is the case as I've tried all values in [2..100]).
To evaluate the defense AUC, the README instructs me to run this command:
python evaluate_detector.py --in_orig <DIR CONTAINING ORIGINAL UNDEFENDED AUDIO> \
--in_orig_def <DIR CONTAINING ORIGINAL DEFENDED AUDIO> \
--in_adv <DIR CONTAINING ADVERSARIAL UNDEFENDED AUDIO> \
--in_adv_def <DIR CONTAINING ADVERSARIAL DEFENDED AUDIO>
How do I generate the folder contents of what I pass to --in_adv
and --in_adv_def
? I'm particularly interested in an implementation of the adaptive attack algorithm from the paper.
Hello, I'm studying your article. I encountered an error when reading the code. In the file spectral.py, I variable error. In addition, what version of deepspeech do you use?
if axis is None:
ndims = t.get_shape().ndims
if ndims is None:
raise ValueError('Cannot run on tensor with dynamic ndims')
dims = []
for i in range(ndims):
try:
dim = int(t.get_shape()[i])
except:
dim = tf.shape(t)[i]
dims.append(dim)
return dims
else:
try:
dim = int(t.get_shape()[axis])
except:
dim = tf.shape(t)[i] // The variable I here is not clear
return dim
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.