1 00:00:00,000 --> 00:00:02,280 Hi everyone, thanks for coming to our presentation. 2 00:00:03,320 --> 00:00:09,620 So our presentation is on targeted adversarial examples for black box audio systems and we'd 3 00:00:09,620 --> 00:00:11,200 like to thank Geekpont for hosting us. 4 00:00:13,120 --> 00:00:18,080 So a little bit about us, my name is Amogh, I'm a student at UC Berkeley, I'm an officer 5 00:00:18,080 --> 00:00:22,600 at Machine Learning at Berkeley organization and I'm also a researcher at UC Berkeley RISE 6 00:00:22,600 --> 00:00:22,760 Lab. 7 00:00:23,280 --> 00:00:28,340 Hey everyone, I'm Rohan, I'm also a student at UC Berkeley, I'm the VP of Education at 8 00:00:28,340 --> 00:00:32,500 Machine Learning at Berkeley organization and I'm also a researcher at Berkeley AI Research 9 00:00:32,500 --> 00:00:33,040 or BEAR. 10 00:00:35,880 --> 00:00:39,840 So let's start off with a brief intro of what exactly is an adversarial example. 11 00:00:40,460 --> 00:00:45,300 So in the most common sense, an adversarial example is something that is given to a model 12 00:00:45,300 --> 00:00:50,660 as input such that the model misclassifies its output but to humans it looks like if 13 00:00:50,660 --> 00:00:51,580 the model is getting it wrong. 14 00:00:51,840 --> 00:00:56,020 So for example in this case, we have an image of a panda and the model predicts it with 15 00:00:56,020 --> 00:00:58,320 58% confidence that it's a panda. 16 00:00:58,320 --> 00:01:01,120 That's a correct example, that's when the model gets it right. 17 00:01:01,460 --> 00:01:05,360 Now suppose we add some noise to it on the right as you can see, it's multiplied by some 18 00:01:05,360 --> 00:01:09,460 really small magnitude, like 0.007, such that when you add this noise to the image, 19 00:01:09,540 --> 00:01:13,680 to humans, the humans can't tell the difference between the adversarial image and the normal 20 00:01:13,680 --> 00:01:13,960 image. 21 00:01:14,220 --> 00:01:16,720 So you can see here in the example, the panda looks exactly the same. 22 00:01:16,940 --> 00:01:21,120 But to the model, the model now thinks this image is a gibbon with 99% confidence. 23 00:01:21,560 --> 00:01:25,300 So this is an adversarial example because the model misclassified what the output was 24 00:01:25,300 --> 00:01:28,000 even though to humans it looks like it's still the original image. 25 00:01:31,840 --> 00:01:36,340 Okay, so going more about the definitions of adversarial examples, there's two types. 26 00:01:37,080 --> 00:01:39,460 There's untargeted attacks and there's targeted attacks. 27 00:01:39,920 --> 00:01:43,960 Untargeted attacks means you provide input to the model to trick the model in order to 28 00:01:43,960 --> 00:01:46,800 make it misclassify the input as anything else. 29 00:01:47,080 --> 00:01:51,160 While a targeted attack, we provide input to the model such that we want the model 30 00:01:51,160 --> 00:01:54,940 to classify the input as a predetermined target. 31 00:01:55,300 --> 00:01:58,000 So targeted attacks are more difficult. 32 00:01:58,320 --> 00:02:00,760 But we don't always recommend on targeted attacks because we, we're trying to trick 33 00:02:00,760 --> 00:02:04,360 the model into classifying it as something that was determined originally and to some 34 00:02:04,900 --> 00:02:05,600 specific class. 35 00:02:07,220 --> 00:02:10,480 In addition, there's also white box attacks and black box attacks. 36 00:02:10,780 --> 00:02:15,500 So white box, in a white box attack, we have complete knowledge over all the internals 37 00:02:15,500 --> 00:02:15,900 of the model. 38 00:02:15,980 --> 00:02:19,740 So we know it's parameters and it's architecture and this allows for a gradient computation. 39 00:02:20,280 --> 00:02:24,380 In a black box attack, we have no knowledge of the model or the, any of its parameters 40 00:02:24,380 --> 00:02:26,300 except for the output logits of the model. 41 00:02:26,520 --> 00:02:28,300 This means that a white box of attack, we have no knowledge of the model or the, any 42 00:02:28,300 --> 00:02:32,560 since you have more information, we can craft a better and a more efficient attack. 43 00:02:32,740 --> 00:02:34,840 A black box attack, this becomes more difficult 44 00:02:34,840 --> 00:02:37,340 since we don't know any of the internals of the ML model. 45 00:02:39,240 --> 00:02:39,820 Cool, yeah. 46 00:02:39,940 --> 00:02:42,520 So now many of you might be asking, why does this matter? 47 00:02:42,920 --> 00:02:46,580 So black box attacks can actually be of particular interest in ASR systems, 48 00:02:46,800 --> 00:02:48,760 ASR being automatic speech recognition. 49 00:02:49,340 --> 00:02:52,080 So if you look at a typical deep model for an ASR system, 50 00:02:52,300 --> 00:02:53,340 this is kind of how it works. 51 00:02:53,740 --> 00:02:56,640 At the bottom, we have the raw audio wave file or the source. 52 00:02:57,520 --> 00:02:59,880 Typically, all the models use some sort of feature extraction. 53 00:03:00,260 --> 00:03:02,500 So typically what is done is an MFCC conversion, 54 00:03:02,780 --> 00:03:05,580 which is basically it takes the audio file and converts it 55 00:03:05,580 --> 00:03:08,440 using a Fourier transform into the frequency domain. 56 00:03:08,720 --> 00:03:11,980 So you can see in the colored graph over there or the colored map, 57 00:03:12,140 --> 00:03:15,160 that's basically frequency on the y-axis and time on the x-axis. 58 00:03:15,580 --> 00:03:17,720 Now this graph is what's passed into the model. 59 00:03:17,840 --> 00:03:21,060 The model uses some sort of series of convolutional and recurrent layers 60 00:03:21,060 --> 00:03:23,380 to get a distribution of the output alphabet. 61 00:03:23,700 --> 00:03:26,140 And this alphabet is finally decoded into the final, 62 00:03:26,220 --> 00:03:26,620 you know, the output alphabet. 63 00:03:26,640 --> 00:03:27,940 This is the final translated string. 64 00:03:28,440 --> 00:03:31,480 So this is a typical workflow of how a model works. 65 00:03:32,080 --> 00:03:33,400 So looking at this model, 66 00:03:33,560 --> 00:03:35,700 if we want to create an adversarial audio file, 67 00:03:36,500 --> 00:03:39,440 what we want to do is change the input audio file 68 00:03:39,440 --> 00:03:42,620 such that we can trick the model into translating what we want 69 00:03:42,620 --> 00:03:44,560 at the final decoder step. 70 00:03:45,520 --> 00:03:47,620 And if we can do this with a black box approach, 71 00:03:47,900 --> 00:03:51,820 we can apply this to proprietary systems such as Google or IBM APIs, 72 00:03:52,020 --> 00:03:54,780 for which we don't know the model architecture is the parameters, 73 00:03:55,000 --> 00:03:56,620 but if we use a black box approach, 74 00:03:56,620 --> 00:03:58,160 we can still craft adversarial examples 75 00:03:58,160 --> 00:04:00,160 to trick these systems and fool these systems. 76 00:04:04,080 --> 00:04:06,420 So there's some few classic adversarial examples. 77 00:04:07,280 --> 00:04:09,260 So one is the first method proposed, 78 00:04:09,480 --> 00:04:11,660 which is basically to take the gradient iteratively. 79 00:04:11,880 --> 00:04:13,880 So this is a white box targeted approach 80 00:04:13,880 --> 00:04:17,480 in which basically you take the gradient of the model output 81 00:04:17,480 --> 00:04:18,440 with respect to the input, 82 00:04:18,580 --> 00:04:20,180 and then you apply that gradient to the input, 83 00:04:20,300 --> 00:04:22,040 and you keep repeating again and again and again 84 00:04:22,040 --> 00:04:23,980 as your adversarial example gets better. 85 00:04:25,060 --> 00:04:26,360 Fast gradient sign method, 86 00:04:26,620 --> 00:04:29,340 which is probably one of the most popular forms of attacks, 87 00:04:29,820 --> 00:04:31,020 is a very simple method. 88 00:04:31,380 --> 00:04:33,440 Basically, you take the gradient of the input 89 00:04:33,440 --> 00:04:36,080 with respect to your model parameters, 90 00:04:36,280 --> 00:04:38,200 and you just take the sign of that gradient. 91 00:04:38,420 --> 00:04:40,440 So for example, if the gradient is negative at a particular place, 92 00:04:40,500 --> 00:04:41,640 you just make a negative one. 93 00:04:41,680 --> 00:04:42,860 If it's positive, you make it plus one. 94 00:04:43,000 --> 00:04:44,940 And you apply some very small perturbation. 95 00:04:45,140 --> 00:04:46,000 So in the example before, 96 00:04:46,080 --> 00:04:48,000 you saw we applied a magnitude of 0.007. 97 00:04:48,160 --> 00:04:49,260 You apply something like that. 98 00:04:49,420 --> 00:04:50,560 And it's just one gradient step, 99 00:04:50,660 --> 00:04:51,620 and you have an adversarial example. 100 00:04:51,940 --> 00:04:53,580 And so this is if we're taking white box, 101 00:04:54,380 --> 00:04:55,540 untargeted adversarial examples. 102 00:04:56,620 --> 00:04:58,860 And finally, there was a seminal paper by Houdini 103 00:04:58,860 --> 00:05:00,960 that explored adversarial examples 104 00:05:00,960 --> 00:05:02,260 within the realm space of audio. 105 00:05:02,640 --> 00:05:04,080 So what he was able to do 106 00:05:04,080 --> 00:05:06,360 was create white box and black box 107 00:05:06,360 --> 00:05:08,220 adversarial examples for audio systems. 108 00:05:08,460 --> 00:05:10,560 However, a key limitation that he noticed 109 00:05:10,560 --> 00:05:13,060 was that he wasn't able to backpropagate 110 00:05:13,060 --> 00:05:14,620 through the MSCC conversion layer. 111 00:05:14,860 --> 00:05:17,720 What this meant was that he had adversarial spectrograms, 112 00:05:17,720 --> 00:05:20,100 but not necessarily adversarial raw audio files. 113 00:05:20,400 --> 00:05:22,320 So if you think of this in a real-world setting, 114 00:05:22,460 --> 00:05:25,040 we want raw audio files to be played 115 00:05:25,580 --> 00:05:26,460 or given to an API. 116 00:05:26,620 --> 00:05:28,340 They won't accept spectrograms. 117 00:05:28,360 --> 00:05:30,100 So in this case, he was severely limited 118 00:05:30,100 --> 00:05:32,800 by not being able to create raw adversarial audio files, 119 00:05:32,980 --> 00:05:34,820 but only ending up with spectrograms. 120 00:05:36,400 --> 00:05:38,380 Okay, so now let's go over some prior work, 121 00:05:38,440 --> 00:05:40,820 specifically in the audio realm. 122 00:05:41,100 --> 00:05:42,840 So there's two key papers in this area. 123 00:05:42,960 --> 00:05:45,840 One by UCLA, which is a black box genetic algorithm 124 00:05:45,840 --> 00:05:47,020 on single word classes. 125 00:05:47,340 --> 00:05:48,700 So this is a black box attack 126 00:05:48,700 --> 00:05:52,420 in which they crafted adversarial examples 127 00:05:52,420 --> 00:05:54,200 without knowledge of any of the model parameters. 128 00:05:54,600 --> 00:05:56,260 And they do this via a genetic algorithm, 129 00:05:56,620 --> 00:05:57,680 which we'll cover later. 130 00:05:58,000 --> 00:05:59,260 But the thing about this paper 131 00:05:59,260 --> 00:06:00,860 is that it's only on single word classes, 132 00:06:01,060 --> 00:06:04,060 which means they have a predefined set of classes 133 00:06:04,060 --> 00:06:05,000 of just single words. 134 00:06:05,200 --> 00:06:07,680 And what this means is they can use a softmax loss 135 00:06:08,280 --> 00:06:11,180 to try to trick the model into misclassifying a single word. 136 00:06:11,460 --> 00:06:13,600 The other paper is by Carlini and Wagner, 137 00:06:13,760 --> 00:06:14,780 also from UC Berkeley. 138 00:06:15,040 --> 00:06:16,420 And this is a white box attack. 139 00:06:16,720 --> 00:06:18,840 So they had access to the model parameters, 140 00:06:18,980 --> 00:06:20,880 and they were able to do gradient computation. 141 00:06:21,260 --> 00:06:23,460 However, this wasn't on single word classes. 142 00:06:23,700 --> 00:06:26,040 They were actually able to generate phrases 143 00:06:26,040 --> 00:06:29,100 and sentences of adversarial audio examples. 144 00:06:29,760 --> 00:06:32,940 So the way they do this is via something called a CTC loss, 145 00:06:33,140 --> 00:06:34,280 which you can see at the bottom. 146 00:06:35,240 --> 00:06:37,020 A CTC loss is a loss for comparison 147 00:06:37,020 --> 00:06:38,680 with arbitrary length translations. 148 00:06:39,280 --> 00:06:41,040 What this means is essentially that 149 00:06:41,040 --> 00:06:44,820 it's a way to score how well the original audio 150 00:06:44,820 --> 00:06:47,260 translates to a final sequence, 151 00:06:47,680 --> 00:06:48,880 in this case, which is a target. 152 00:06:49,600 --> 00:06:52,820 So it basically takes in the final sequence 153 00:06:52,820 --> 00:06:54,780 and the logits of the model 154 00:06:54,780 --> 00:06:56,020 and gives you some kind of a final sequence. 155 00:06:56,040 --> 00:06:56,820 And it gives you some probability 156 00:06:56,820 --> 00:07:00,360 that the model will predict our final sequence. 157 00:07:00,900 --> 00:07:04,120 Our project aims to combine parts of these two papers 158 00:07:04,120 --> 00:07:07,100 by doing a black box genetic algorithm approach, 159 00:07:07,360 --> 00:07:11,440 except having the targets be phrases and sentences. 160 00:07:11,700 --> 00:07:13,060 And we do this via CTC loss. 161 00:07:15,800 --> 00:07:19,260 So here's a quick diagram of our problem statement. 162 00:07:19,800 --> 00:07:21,520 Basically, how this works is that 163 00:07:21,520 --> 00:07:22,780 we'll have some benign input, 164 00:07:23,000 --> 00:07:24,280 which is something like, 165 00:07:24,340 --> 00:07:25,920 without the data set, the article is useless. 166 00:07:26,040 --> 00:07:27,480 So this is a raw audio. 167 00:07:27,620 --> 00:07:28,660 That's the benign input. 168 00:07:28,880 --> 00:07:30,060 You want to be able to figure out 169 00:07:30,060 --> 00:07:32,060 a slight perturbation to the raw audio 170 00:07:32,060 --> 00:07:33,800 via some adversarial noise, 171 00:07:34,080 --> 00:07:36,060 such that when we combine the benign input 172 00:07:36,060 --> 00:07:38,720 and the adversarial noise, 173 00:07:38,940 --> 00:07:41,420 that the ASR systems translate the audio 174 00:07:41,420 --> 00:07:42,300 as something malicious. 175 00:07:42,500 --> 00:07:45,020 In this case, which is OKGoogleBrowseToEvil.com. 176 00:07:45,200 --> 00:07:46,720 So as you can see, in a real world setting, 177 00:07:46,800 --> 00:07:48,200 if people were able to figure this out, 178 00:07:48,380 --> 00:07:51,280 this can actually potentially be harmful for people, 179 00:07:51,440 --> 00:07:53,020 because the humans won't recognize 180 00:07:53,020 --> 00:07:54,200 the difference in the audio, 181 00:07:54,340 --> 00:07:55,980 but the ASR systems will translate. 182 00:07:56,040 --> 00:07:56,920 They'll translate it as something incorrect. 183 00:07:59,020 --> 00:08:01,380 So to explain it a little bit more formally, 184 00:08:01,540 --> 00:08:02,860 what we're trying to do is a black box 185 00:08:02,860 --> 00:08:04,520 targeted attack for audio systems. 186 00:08:04,980 --> 00:08:06,560 So this means, given a target T, 187 00:08:06,680 --> 00:08:07,920 this is your output translation 188 00:08:07,920 --> 00:08:09,000 where you want the model to guess. 189 00:08:09,180 --> 00:08:12,000 So in our case, it would be OKGoogleBrowseToEvil.com. 190 00:08:12,160 --> 00:08:13,500 And a benign input X, 191 00:08:13,760 --> 00:08:15,100 we want the model M, 192 00:08:15,100 --> 00:08:16,120 and the model M, 193 00:08:16,220 --> 00:08:17,440 we want to perturb X 194 00:08:17,440 --> 00:08:19,620 with a very slight small delta 195 00:08:19,620 --> 00:08:20,840 to create X prime, 196 00:08:21,020 --> 00:08:25,420 such that when the model classifies X prime, 197 00:08:25,500 --> 00:08:26,020 M of X prime, 198 00:08:26,040 --> 00:08:27,100 that equals T, 199 00:08:27,260 --> 00:08:28,180 or the given target T. 200 00:08:28,680 --> 00:08:30,580 We also want to do this with the constraint 201 00:08:30,580 --> 00:08:32,400 that we want to maximize the cross-correlation 202 00:08:32,400 --> 00:08:34,100 between X and X prime. 203 00:08:34,560 --> 00:08:35,600 So in the audio realm, 204 00:08:35,700 --> 00:08:37,380 cross-correlation is a measure of the similarity 205 00:08:37,380 --> 00:08:38,560 between your two audio files. 206 00:08:38,920 --> 00:08:41,700 So if we try and create an adversarial example 207 00:08:41,700 --> 00:08:42,860 that matches the target 208 00:08:42,860 --> 00:08:44,280 while maximizing the correlation 209 00:08:44,280 --> 00:08:46,120 between the original benign input 210 00:08:46,120 --> 00:08:47,120 and the adversarial input, 211 00:08:47,300 --> 00:08:48,280 that's basically saying 212 00:08:48,280 --> 00:08:49,620 we want to create a translation 213 00:08:49,620 --> 00:08:51,560 such that the model predicts it's wrong, 214 00:08:51,720 --> 00:08:53,140 but it's still as similar 215 00:08:53,140 --> 00:08:54,840 to the original audio file as possible. 216 00:08:55,440 --> 00:08:56,160 And remember, 217 00:08:56,300 --> 00:08:57,400 since this is a black box attack, 218 00:08:57,620 --> 00:08:59,300 we only have access to the logits, 219 00:08:59,340 --> 00:09:00,840 or the output distribution 220 00:09:00,840 --> 00:09:02,920 over the alphabet of M. 221 00:09:03,060 --> 00:09:03,900 We don't have any access 222 00:09:03,900 --> 00:09:05,440 to the gradients or the model parameters. 223 00:09:08,080 --> 00:09:08,480 Question? 224 00:09:08,480 --> 00:09:09,640 Are you using cross-correlation 225 00:09:09,640 --> 00:09:11,280 sort of like as a model of human hearing? 226 00:09:12,140 --> 00:09:12,760 Exactly, yeah. 227 00:09:16,400 --> 00:09:18,620 So the model we use is deep speech. 228 00:09:18,940 --> 00:09:20,760 So this is the model we're targeting. 229 00:09:20,940 --> 00:09:22,800 It's an architecture created by Baidu 230 00:09:22,800 --> 00:09:23,900 and published in a research paper, 231 00:09:24,020 --> 00:09:24,820 and then it was created 232 00:09:24,820 --> 00:09:26,400 and it was implemented in a TensorFlow by Mozilla, 233 00:09:26,560 --> 00:09:27,720 and it's available on GitHub 234 00:09:27,720 --> 00:09:29,340 as an open source code. 235 00:09:30,120 --> 00:09:31,340 So we used this attack, 236 00:09:31,460 --> 00:09:33,540 and we attacked this specific model on deep speech, 237 00:09:33,740 --> 00:09:35,340 and the dataset that we used 238 00:09:35,340 --> 00:09:36,460 is the Common Voice Dataset. 239 00:09:36,580 --> 00:09:38,220 So this consists of voice samples 240 00:09:38,220 --> 00:09:40,720 ranging from three to seven seconds, 241 00:09:40,880 --> 00:09:42,880 and it's sampled at a rate of 16 kilohertz. 242 00:09:43,140 --> 00:09:44,500 So you can see in the bottom right, 243 00:09:44,620 --> 00:09:46,260 that's a diagram of the deep speech model. 244 00:09:46,520 --> 00:09:47,760 Similar to other ASR systems, 245 00:09:47,980 --> 00:09:49,440 it accepts an input spectrogram, 246 00:09:50,140 --> 00:09:52,320 then it passes it through some convolutional layers 247 00:09:52,320 --> 00:09:54,000 and a stacked bidirectional LSTM 248 00:09:54,000 --> 00:09:54,680 to finally, 249 00:09:54,820 --> 00:09:57,340 get the output distribution over the alphabet. 250 00:09:59,680 --> 00:10:02,200 Okay, so this is our final algorithm, 251 00:10:02,340 --> 00:10:03,560 which is a guided selection, 252 00:10:03,800 --> 00:10:05,240 which is a genetic algorithm approach. 253 00:10:05,600 --> 00:10:07,380 So basically how a genetic algorithm works 254 00:10:07,380 --> 00:10:09,240 is that it's rooted in evolutionary theory, 255 00:10:09,420 --> 00:10:12,180 and we start off with a benign input, 256 00:10:12,300 --> 00:10:14,600 and we first generate what's considered a population 257 00:10:14,600 --> 00:10:15,940 by adding random noise. 258 00:10:16,060 --> 00:10:16,580 So in our case, 259 00:10:16,600 --> 00:10:18,620 we generated a population of size 100 260 00:10:18,620 --> 00:10:21,360 by adding just random noise to the original input. 261 00:10:21,660 --> 00:10:23,900 Then it's an iterative process, 262 00:10:23,940 --> 00:10:24,700 so in each iteration, 263 00:10:24,820 --> 00:10:27,220 we score every sample in the population, 264 00:10:27,500 --> 00:10:28,660 pick the best ones, 265 00:10:28,880 --> 00:10:31,700 and then use those high-scoring samples 266 00:10:31,700 --> 00:10:33,260 to create a new population 267 00:10:33,260 --> 00:10:34,700 in the next what's called generation. 268 00:10:35,140 --> 00:10:36,520 And over time, as you can see, 269 00:10:36,620 --> 00:10:39,440 we'll eventually keep getting better and better samples 270 00:10:39,440 --> 00:10:41,560 to the point where we can actually fool the model. 271 00:10:41,860 --> 00:10:43,400 So in our case, on each iteration, 272 00:10:43,600 --> 00:10:46,020 we select the best 10 samples using a scoring function, 273 00:10:46,180 --> 00:10:48,020 and our scoring function is CTC loss, 274 00:10:48,200 --> 00:10:49,220 which is what we described earlier. 275 00:10:49,480 --> 00:10:51,280 Then we perform what's called crossover 276 00:10:51,280 --> 00:10:52,860 and momentum mutation, 277 00:10:53,680 --> 00:10:54,800 which we'll go over in the next session. 278 00:10:54,820 --> 00:10:55,000 Next slide. 279 00:10:55,360 --> 00:10:57,260 And finally, we apply a high-pass filter 280 00:10:57,260 --> 00:10:58,280 to the added noise. 281 00:10:58,580 --> 00:11:00,540 The reason for this is a heuristic-based approach. 282 00:11:00,880 --> 00:11:04,020 Humans recognize low frequencies 283 00:11:04,020 --> 00:11:05,380 but more than high frequencies, 284 00:11:05,460 --> 00:11:06,740 so we apply a high-pass filter. 285 00:11:07,000 --> 00:11:10,400 We'll be able to basically still trick the model 286 00:11:10,400 --> 00:11:13,500 but make it less recognizable for a human ear. 287 00:11:15,620 --> 00:11:17,060 So this is a visual demonstration 288 00:11:17,060 --> 00:11:18,320 of what's going on in our algorithm. 289 00:11:18,780 --> 00:11:20,060 So initially, we start off with a population 290 00:11:20,060 --> 00:11:21,920 of about 100 audio samples. 291 00:11:22,060 --> 00:11:23,800 This is generated by adding random noise. 292 00:11:24,180 --> 00:11:24,800 Then we'll... 293 00:11:24,800 --> 00:11:26,260 Then we'll evaluate each with the CTC loss 294 00:11:26,260 --> 00:11:27,700 and we'll calculate a fitness score. 295 00:11:27,960 --> 00:11:29,700 Out of this, we'll pick this elite population, 296 00:11:30,020 --> 00:11:32,560 which is basically the top 10 of this sample. 297 00:11:32,880 --> 00:11:34,500 And then in order to get the next generation, 298 00:11:34,720 --> 00:11:36,180 we'll perform something called crossover mutation. 299 00:11:36,940 --> 00:11:39,060 So in evolutionary theory, basically, 300 00:11:39,180 --> 00:11:40,980 the way you get from one generation to the next 301 00:11:40,980 --> 00:11:44,180 is you choose two parents from this elite sample, 302 00:11:44,400 --> 00:11:45,620 and then you perform a crossover. 303 00:11:45,840 --> 00:11:47,480 So you can see we chose the two samples, 304 00:11:47,840 --> 00:11:48,740 the red and the gold, 305 00:11:48,860 --> 00:11:50,840 and we perform crossovers. 306 00:11:50,880 --> 00:11:52,940 So we'll randomly choose either the red 307 00:11:52,940 --> 00:11:54,520 or the gold attribute at every index. 308 00:11:54,800 --> 00:11:56,680 And at that point, we can kind of combine them together 309 00:11:56,680 --> 00:11:59,320 to get this like layered approach of red and gold. 310 00:11:59,620 --> 00:12:01,260 And so this is basically saying like, 311 00:12:01,340 --> 00:12:03,820 all right, we have our elite population. 312 00:12:04,040 --> 00:12:05,600 We'll choose a couple as parents, 313 00:12:05,720 --> 00:12:06,840 and from them, we'll create a child. 314 00:12:07,160 --> 00:12:09,860 And that'll generate the red and gold sequence. 315 00:12:10,780 --> 00:12:12,560 Finally, the last step is that we want to add 316 00:12:12,560 --> 00:12:13,640 some variation to each generation. 317 00:12:14,040 --> 00:12:15,500 So we'll do that using a mutation. 318 00:12:15,740 --> 00:12:16,940 So this is a randomly applied mutation, 319 00:12:17,200 --> 00:12:19,220 and we have a special form of adding this mutation 320 00:12:19,740 --> 00:12:20,480 called momentum mutation, 321 00:12:20,680 --> 00:12:22,000 which we'll cover in the next slide. 322 00:12:22,240 --> 00:12:24,660 But the basic idea is we'll start with this population, 323 00:12:24,800 --> 00:12:25,920 we'll choose the best, 324 00:12:26,040 --> 00:12:28,420 we'll use these parents to create these children, 325 00:12:28,620 --> 00:12:30,880 and then we'll finally add some cleverly added noise 326 00:12:30,880 --> 00:12:33,800 in order to create some randomness in the samples. 327 00:12:34,260 --> 00:12:38,840 So you'll see that over time, 328 00:12:39,020 --> 00:12:41,720 the best traits for our samples 329 00:12:41,720 --> 00:12:43,580 will carry on from generation to generation, 330 00:12:43,840 --> 00:12:46,240 while the traits which are not affecting our score 331 00:12:46,240 --> 00:12:47,380 will eventually die out. 332 00:12:49,300 --> 00:12:51,380 Okay, so now we go over momentum mutation, 333 00:12:51,560 --> 00:12:54,400 which is basically our unique way of adding mutation 334 00:12:54,800 --> 00:12:55,340 to our samples. 335 00:12:55,720 --> 00:12:57,860 So in a standard genetic algorithm, 336 00:12:58,140 --> 00:13:01,140 the probability of having a mutation is static, 337 00:13:01,360 --> 00:13:02,440 from generation to generation. 338 00:13:03,520 --> 00:13:06,820 What we try to do is change the probability of mutation 339 00:13:06,820 --> 00:13:08,260 and make it dynamic, 340 00:13:08,460 --> 00:13:11,400 and have that be a function of the difference in scores 341 00:13:11,400 --> 00:13:13,760 across the iterations of the generations. 342 00:13:14,560 --> 00:13:17,580 And what we do is if there's little increase in score 343 00:13:17,580 --> 00:13:18,700 between the generations, 344 00:13:18,900 --> 00:13:20,280 we increase the momentum 345 00:13:20,640 --> 00:13:22,320 by increasing the probability of the mutation. 346 00:13:22,600 --> 00:13:24,140 And if there's a higher score, 347 00:13:24,800 --> 00:13:26,540 higher difference of scores between the generations, 348 00:13:26,640 --> 00:13:28,000 we decrease the probability of mutation. 349 00:13:28,420 --> 00:13:30,260 And the reason for this is that if we see 350 00:13:30,260 --> 00:13:32,720 very little increase in score across generations, 351 00:13:33,180 --> 00:13:35,000 which is basically what we need to do 352 00:13:35,000 --> 00:13:36,480 is give the algorithm a little kick, 353 00:13:36,660 --> 00:13:38,880 and we do that by increasing the randomness 354 00:13:38,880 --> 00:13:40,040 in our algorithm. 355 00:13:40,340 --> 00:13:43,600 And doing so will allow us to basically move out 356 00:13:43,600 --> 00:13:46,380 of a local minimum and globally optimize. 357 00:13:46,680 --> 00:13:47,960 So if we're stuck at a local minimum, 358 00:13:48,080 --> 00:13:50,140 we provide more increased probability of mutation, 359 00:13:50,400 --> 00:13:51,520 increase the randomness, 360 00:13:51,640 --> 00:13:54,060 and the goal is to eventually go out 361 00:13:54,800 --> 00:13:55,820 and escape out of that little hump 362 00:13:55,820 --> 00:13:57,400 and be able to continue our optimization. 363 00:13:57,940 --> 00:14:00,380 So what this does is it encourages the decoding 364 00:14:00,380 --> 00:14:01,380 to build up to the target 365 00:14:01,380 --> 00:14:03,200 after making the input similar to silence. 366 00:14:03,460 --> 00:14:05,400 So as you can see in the blue box on the right, 367 00:14:06,320 --> 00:14:08,580 our decodings while training first start off 368 00:14:08,580 --> 00:14:10,280 with the original benign input, 369 00:14:10,460 --> 00:14:14,340 and slowly it pairs down the letters 370 00:14:14,340 --> 00:14:15,320 till we get to near silence, 371 00:14:15,680 --> 00:14:16,620 which is the E now. 372 00:14:16,920 --> 00:14:18,500 And through this momentum mutation, 373 00:14:18,740 --> 00:14:21,020 by increasing the probability of the mutation, 374 00:14:21,220 --> 00:14:22,780 we can add more letters, 375 00:14:22,880 --> 00:14:24,580 and our algorithm's able to finally 376 00:14:24,800 --> 00:14:26,160 get our target of hello world. 377 00:14:29,560 --> 00:14:31,660 So this genetic algorithm approach 378 00:14:31,660 --> 00:14:33,440 works best when the search space is large. 379 00:14:33,900 --> 00:14:35,480 So as you may have heard, 380 00:14:35,560 --> 00:14:37,040 we just randomly add mutations 381 00:14:37,040 --> 00:14:38,700 and hope that we get something good. 382 00:14:38,920 --> 00:14:41,540 However, when the adversarial example is near the target, 383 00:14:41,740 --> 00:14:43,860 we only need a few key perturbations 384 00:14:43,860 --> 00:14:46,020 to correctly classify it. 385 00:14:46,320 --> 00:14:48,480 Only a few key perturbations are necessary. 386 00:14:48,900 --> 00:14:50,280 So in this case, 387 00:14:50,380 --> 00:14:51,980 genetic algorithms are not the best approach 388 00:14:51,980 --> 00:14:53,900 because they'll randomly add noise 389 00:14:53,900 --> 00:14:55,040 to a bunch of different places 390 00:14:55,040 --> 00:14:56,540 that we don't necessarily want noise. 391 00:14:56,620 --> 00:14:58,580 We only want noise in a few specific places. 392 00:14:59,120 --> 00:15:00,180 So at this step, 393 00:15:00,260 --> 00:15:01,340 we apply a gradient estimation. 394 00:15:01,720 --> 00:15:03,540 So the way gradient estimation works is 395 00:15:03,540 --> 00:15:04,880 we basically suppose 396 00:15:04,880 --> 00:15:06,880 our sampling rate is 16,000 kHz, 397 00:15:06,960 --> 00:15:07,340 like we said. 398 00:15:07,500 --> 00:15:08,880 That means for a one second audio clip, 399 00:15:09,000 --> 00:15:10,580 we have 16,000 points of evaluation. 400 00:15:11,560 --> 00:15:12,640 For gradient estimation, 401 00:15:12,940 --> 00:15:14,060 for each point, 402 00:15:14,180 --> 00:15:15,200 we randomly perturb it, 403 00:15:15,220 --> 00:15:16,180 either up or down, 404 00:15:16,300 --> 00:15:17,300 and then we pass it to the model 405 00:15:17,300 --> 00:15:18,820 and see what the difference in scores is. 406 00:15:19,240 --> 00:15:21,140 Finally, we combine all of these 407 00:15:21,600 --> 00:15:22,880 to get our gradient estimate. 408 00:15:22,880 --> 00:15:25,660 You can think of this as a limit derivative, kind of. 409 00:15:26,260 --> 00:15:27,980 Basically, we were perturbing each index 410 00:15:27,980 --> 00:15:29,000 up and down 411 00:15:29,000 --> 00:15:30,800 and seeing how much that changes the final loss 412 00:15:30,800 --> 00:15:32,800 and using that as an estimate of the gradient. 413 00:15:33,880 --> 00:15:35,160 Now you might have heard me say, 414 00:15:35,260 --> 00:15:36,820 for a one second audio clip, 415 00:15:36,960 --> 00:15:38,580 there's 16,000 possible indices. 416 00:15:38,960 --> 00:15:39,840 So of course, 417 00:15:39,880 --> 00:15:40,940 this is going to be a lot of computation 418 00:15:40,940 --> 00:15:42,360 for just one gradient step. 419 00:15:42,800 --> 00:15:43,880 So as a heuristic, 420 00:15:43,900 --> 00:15:46,340 in order to kind of reduce the computation cost, 421 00:15:46,600 --> 00:15:48,540 we randomly choose 100 best indices 422 00:15:48,540 --> 00:15:50,860 and apply the gradient estimation to those points 423 00:15:50,860 --> 00:15:52,420 and keep iterating again and again. 424 00:15:54,480 --> 00:15:56,040 Okay, so let's go over some results. 425 00:15:56,380 --> 00:15:58,480 So we tested on the first 100 samples 426 00:15:58,480 --> 00:15:59,560 of the common voice dataset, 427 00:15:59,840 --> 00:16:02,060 and our target phrases are randomly generated 428 00:16:02,060 --> 00:16:03,160 two target words. 429 00:16:03,420 --> 00:16:06,740 So our targeted attack similarity is 89.25%. 430 00:16:06,740 --> 00:16:08,820 So this is the similarity between our target 431 00:16:08,820 --> 00:16:10,940 and the final translated sequence 432 00:16:10,940 --> 00:16:12,300 after 3,000 generations. 433 00:16:12,640 --> 00:16:15,040 And we calculated this using a Levenstein distance. 434 00:16:15,360 --> 00:16:18,620 And our average similarity score is 94.6%. 435 00:16:18,620 --> 00:16:21,180 So this is similarity between the original benign input 436 00:16:21,180 --> 00:16:22,860 and our perturbed adversarial input. 437 00:16:22,880 --> 00:16:25,580 And this is computed via a cross-correlation 438 00:16:25,580 --> 00:16:26,520 as described earlier. 439 00:16:28,460 --> 00:16:30,320 So let's put these results into perspective 440 00:16:30,320 --> 00:16:31,700 by comparing to some of the baselines. 441 00:16:31,980 --> 00:16:33,240 So as Amogh mentioned earlier, 442 00:16:33,420 --> 00:16:35,140 we have two baselines we're explicitly comparing to. 443 00:16:35,280 --> 00:16:37,100 The Carlini and Wagner paper 444 00:16:37,100 --> 00:16:39,260 that describes white box attacks on CTC loss, 445 00:16:39,460 --> 00:16:42,400 and the UCLA paper describing black box attacks 446 00:16:42,400 --> 00:16:43,960 on a single word softmax loss. 447 00:16:44,460 --> 00:16:45,500 So as you can see, 448 00:16:46,020 --> 00:16:48,300 our attack success rate is 35% 449 00:16:48,300 --> 00:16:51,780 for basically Levenstein distance of zero, 450 00:16:51,860 --> 00:16:52,860 like exactly cross-correlation. 451 00:16:52,880 --> 00:16:54,860 And this correctly classifies it as the targeted input. 452 00:16:55,480 --> 00:16:58,720 For the gradient-based approach, 453 00:16:58,840 --> 00:16:59,460 it was 100%. 454 00:16:59,460 --> 00:17:01,700 While for this softmax loss, it's 87%. 455 00:17:01,700 --> 00:17:03,040 So this may seem low, 456 00:17:03,220 --> 00:17:05,200 but thinking about it in the black box perspective 457 00:17:05,200 --> 00:17:08,140 of how complex it is to kind of optimize 458 00:17:08,140 --> 00:17:10,920 over longer phrases rather than just one softmax loss, 459 00:17:11,120 --> 00:17:13,640 we can see that our results are pretty competitive. 460 00:17:14,080 --> 00:17:15,440 And the average similarity score, 461 00:17:15,560 --> 00:17:17,060 we kept at 94.6%. 462 00:17:17,060 --> 00:17:19,500 For the gradient-based approach, it was 99.9%. 463 00:17:19,500 --> 00:17:21,480 And for the black box approach, it was 89%. 464 00:17:21,480 --> 00:17:23,580 And as you can see here on the graph on the bottom, 465 00:17:23,680 --> 00:17:25,820 we have a histogram of the Levenstein distances 466 00:17:26,660 --> 00:17:28,880 after our attack of over 3,000 generations. 467 00:17:29,300 --> 00:17:30,800 So you can see, basically, 468 00:17:30,840 --> 00:17:32,600 the distribution is very near zero. 469 00:17:32,740 --> 00:17:34,520 We have a large percentage that are at zero, 470 00:17:34,620 --> 00:17:36,160 meaning they're exactly correctly classified, 471 00:17:36,400 --> 00:17:39,800 and more with just a couple or a few points 472 00:17:39,800 --> 00:17:40,720 off of the Levenstein distance. 473 00:17:41,060 --> 00:17:43,360 What this means is that there's an inherent trade-off 474 00:17:43,360 --> 00:17:45,680 between how much we run the algorithm 475 00:17:45,680 --> 00:17:48,160 and the attack with success rate. 476 00:17:48,360 --> 00:17:50,400 So as you can see, if we run the algorithm for longer, 477 00:17:50,400 --> 00:17:52,560 our average similarity score will drop 478 00:17:52,560 --> 00:17:55,020 as we add more random noise and add more mutations. 479 00:17:55,380 --> 00:17:58,720 However, we'd be able to get a higher attack success rate 480 00:17:59,440 --> 00:18:00,740 and bump that score up. 481 00:18:01,000 --> 00:18:02,100 So in a real-world setting, 482 00:18:02,240 --> 00:18:03,800 if an adversary is trying to crack a system, 483 00:18:04,140 --> 00:18:05,840 he could employ these metrics. 484 00:18:06,060 --> 00:18:07,360 He could toggle between the two, 485 00:18:07,460 --> 00:18:08,640 see which setting is better for him, 486 00:18:08,700 --> 00:18:09,880 and adjust the rate accordingly. 487 00:18:11,840 --> 00:18:15,360 Okay, so now let's try to listen to some examples. 488 00:18:15,560 --> 00:18:16,580 So we have here 489 00:18:18,940 --> 00:18:19,740 the original 490 00:18:21,340 --> 00:18:22,440 original input file, 491 00:18:24,960 --> 00:18:26,380 which decodes to and you know it. 492 00:18:27,160 --> 00:18:28,200 Let's see if we can play this. 493 00:18:31,880 --> 00:18:32,600 Okay, well... 494 00:18:40,380 --> 00:18:43,140 Okay, well, we're having some difficulties 495 00:18:43,140 --> 00:18:45,100 in playing this, but what you'll hear 496 00:18:45,100 --> 00:18:46,400 is that this is the original input file 497 00:18:46,400 --> 00:18:47,840 and gets decoded as and you know it. 498 00:18:48,020 --> 00:18:49,720 The adversarial target is 499 00:18:50,400 --> 00:18:52,620 is our perturbed audio, 500 00:18:52,940 --> 00:18:54,420 which to the human 501 00:18:54,420 --> 00:18:56,260 sounds very similar to the original. 502 00:18:56,360 --> 00:18:57,320 It sounds like and you know it, 503 00:18:57,380 --> 00:18:58,760 but it gets decoded as hello world. 504 00:18:59,040 --> 00:19:00,400 And as we mentioned before, 505 00:19:00,520 --> 00:19:02,340 audio similarity is 94.6% 506 00:19:02,860 --> 00:19:04,240 using cross-correlation metric. 507 00:19:04,520 --> 00:19:06,680 And you can see on the bottom right 508 00:19:06,680 --> 00:19:08,660 a spectrogram of our 509 00:19:08,660 --> 00:19:10,460 the original audio input 510 00:19:10,460 --> 00:19:12,380 and our perturbed example. 511 00:19:12,680 --> 00:19:14,220 So our perturbed example is blue, 512 00:19:14,340 --> 00:19:15,480 the original is orange, 513 00:19:15,560 --> 00:19:17,640 and you can see there's very slight perturbations. 514 00:19:17,660 --> 00:19:20,340 Most of it is very similar to the original benign input. 515 00:19:24,720 --> 00:19:26,360 So there's a bunch of future work 516 00:19:26,360 --> 00:19:27,140 to be done in this area. 517 00:19:28,080 --> 00:19:29,400 One of the most important ones 518 00:19:29,400 --> 00:19:30,720 is attacking a broad range of models. 519 00:19:30,960 --> 00:19:32,300 So as we mentioned, we only attacked 520 00:19:32,300 --> 00:19:33,720 the Deep Speech model by Mozilla 521 00:19:34,240 --> 00:19:35,580 since this was the only open source 522 00:19:35,580 --> 00:19:37,400 ASR deep system implementation 523 00:19:37,400 --> 00:19:38,140 that we could find. 524 00:19:38,500 --> 00:19:39,900 However, it'll be interesting to see 525 00:19:39,900 --> 00:19:42,400 if this attack is transferable across models. 526 00:19:42,620 --> 00:19:44,220 Not only in Transform with a sense of 527 00:19:44,220 --> 00:19:45,960 can we optimize over Deep Speech 528 00:19:45,960 --> 00:19:47,980 and then deploy it on IBM or Google APIs, 529 00:19:48,260 --> 00:19:50,380 but also can we optimize on those APIs as well. 530 00:19:50,860 --> 00:19:52,180 Second is over-the-air attacks. 531 00:19:52,460 --> 00:19:53,280 So in our problem statement, 532 00:19:53,360 --> 00:19:54,980 you might have seen that we put, you know, 533 00:19:55,000 --> 00:19:55,980 kind of the adversary audio 534 00:19:55,980 --> 00:19:58,500 in the same physical space as the original audio 535 00:19:58,500 --> 00:20:00,760 to fool the Google home. 536 00:20:01,040 --> 00:20:01,880 However, in this case, 537 00:20:01,960 --> 00:20:03,340 we're passing directly the raw audio 538 00:20:03,340 --> 00:20:05,140 or, like, source laws digitally to the model. 539 00:20:05,420 --> 00:20:07,360 So we haven't seen over-the-air attacks 540 00:20:07,360 --> 00:20:08,300 that displayed over the air 541 00:20:08,300 --> 00:20:09,220 how robust they would be 542 00:20:09,220 --> 00:20:10,320 to these different perturbations. 543 00:20:10,860 --> 00:20:13,300 And finally, increasing the sample efficiency to target. 544 00:20:13,740 --> 00:20:16,000 So currently, we train for 3,000 iterations 545 00:20:16,000 --> 00:20:17,840 in order to get a successful audio decoding. 546 00:20:18,120 --> 00:20:20,080 And for a population size of 100, 547 00:20:20,220 --> 00:20:20,380 that gives us about 548 00:20:20,400 --> 00:20:21,880 that means 300,000 evaluations 549 00:20:21,880 --> 00:20:23,080 just for one audio file. 550 00:20:23,620 --> 00:20:26,240 So for example, Google and IBM APIs, 551 00:20:26,380 --> 00:20:27,720 which can be quite expensive, 552 00:20:27,940 --> 00:20:29,400 this cost can be prohibitive. 553 00:20:29,760 --> 00:20:32,020 So increasing the sample efficiency of this attack 554 00:20:32,020 --> 00:20:32,820 can allow us to see 555 00:20:33,600 --> 00:20:36,240 with the kind of physical real-world limitations 556 00:20:36,240 --> 00:20:37,040 what can we achieve. 557 00:20:39,380 --> 00:20:41,860 Okay, yeah, thank you for listening to our presentation. 558 00:20:42,560 --> 00:20:43,860 If you'd like to read our paper, 559 00:20:43,960 --> 00:20:45,560 it's available as a preprint on Archive. 560 00:20:46,380 --> 00:20:48,880 And the code and samples are also available on GitHub 561 00:20:48,880 --> 00:20:53,180 under BlackBox Audio Repo on Rohan's account. 562 00:20:53,780 --> 00:20:55,460 So yeah, we can take any questions 563 00:20:55,460 --> 00:20:57,220 if anyone has any. 564 00:21:02,920 --> 00:21:03,520 Yes? 565 00:21:04,140 --> 00:21:06,600 So you generate your perturbation 566 00:21:07,760 --> 00:21:09,480 with random noise and time domain, 567 00:21:09,780 --> 00:21:12,460 and you filter, you know, have that filter, 568 00:21:12,620 --> 00:21:16,260 and that's what you're wanting to send? 569 00:21:17,400 --> 00:21:17,960 Yep. 570 00:21:18,980 --> 00:21:19,540 Yeah. 571 00:21:20,420 --> 00:21:22,520 And then once we apply that, 572 00:21:22,580 --> 00:21:24,480 we kind of use those samples 573 00:21:25,120 --> 00:21:26,340 as the next generation algorithm. 574 00:21:32,800 --> 00:21:33,840 Any more questions? 575 00:21:36,820 --> 00:21:38,080 Okay, thank you. 576 00:21:38,180 --> 00:21:38,680 Cool, thanks.