1 00:00:00,980 --> 00:00:05,600 Hey, everyone. So I'm Rafal and I'm going to be talking about 2 00:00:05,600 --> 00:00:08,840 Stux NNNet. I've worked on this project with one partner, Brian 3 00:00:08,840 --> 00:00:12,540 Kim. Our code is on GitHub and I've also posted some 4 00:00:12,540 --> 00:00:15,520 instructions for the demos I'm going to show you today. So if 5 00:00:15,520 --> 00:00:18,140 you want, you can go to my Twitter handle, that's it, and 6 00:00:18,140 --> 00:00:21,320 you'll be able to find this link, navigate there and see 7 00:00:21,320 --> 00:00:25,960 exactly what I'm doing. So let's get started. If we look 8 00:00:25,960 --> 00:00:29,800 at different kinds of attacks people do on software, there 9 00:00:29,800 --> 00:00:33,060 are attacks on systems. A lot of times it's about getting the 10 00:00:33,060 --> 00:00:36,260 ability to run code on a victim system. There's all kinds of 11 00:00:36,260 --> 00:00:38,420 ways people do this and people talk about this all over 12 00:00:38,420 --> 00:00:41,380 DEF CON. In this village, however, we're concerned about 13 00:00:41,380 --> 00:00:44,940 AI systems in particular. So AI systems, we know about 14 00:00:44,940 --> 00:00:47,820 adversarial examples, we know about things like model 15 00:00:47,820 --> 00:00:50,600 inversion, where you're looking at privacy issues. We know 16 00:00:50,600 --> 00:00:54,100 about trojan attacks on neural networks and many more. So our 17 00:00:54,100 --> 00:00:58,040 question was, is there anything interesting about the case where 18 00:00:58,040 --> 00:00:59,780 you have an exploit or an attack on the system that 19 00:00:59,800 --> 00:01:02,460 puts a back door or anything into a machine learning system, 20 00:01:02,720 --> 00:01:05,520 where you can run code on the victim system? Is there anything 21 00:01:05,520 --> 00:01:08,880 kind of novel about that? So when we start thinking about 22 00:01:08,880 --> 00:01:12,200 this, what we first looked at was the way the logic is 23 00:01:12,200 --> 00:01:14,880 actually encoded. So if you look at traditional software, 24 00:01:15,140 --> 00:01:18,360 you have kind of explicit coding, you know? You have the 25 00:01:18,360 --> 00:01:22,160 logic, it's written into assembly, that's then written 26 00:01:22,160 --> 00:01:26,180 into machine code. And with neural networks or any other 27 00:01:26,180 --> 00:01:28,360 kind of machine learning model, we're going to focus on neural 28 00:01:28,360 --> 00:01:29,780 networks for this talk. It's a little bit more complicated. 29 00:01:29,800 --> 00:01:32,380 It's a little bit different. Your logic is encoded in trained 30 00:01:32,380 --> 00:01:38,540 parameters, which are then combined with the inputs to get 31 00:01:38,540 --> 00:01:41,480 an output. So it isn't as straightforward. It's not like 32 00:01:41,480 --> 00:01:43,600 you can go through and just reverse engineer what somebody 33 00:01:43,600 --> 00:01:47,240 is doing if everything is, you know, if you've seen everything 34 00:01:47,240 --> 00:01:50,880 your attacker has done. So this gives neural networks some 35 00:01:50,880 --> 00:01:53,940 features, one of which is, you know, being black boxes and you 36 00:01:53,940 --> 00:01:57,220 can't exactly tell what the model is doing. But it's also, 37 00:01:57,360 --> 00:01:59,780 you know, it's interesting from an attack perspective. It's a 38 00:01:59,800 --> 00:02:00,920 little bit more complicated. Because unlike, you know, having 39 00:02:00,920 --> 00:02:03,140 to do other things where you're actually getting your own code on 40 00:02:03,140 --> 00:02:06,300 the CPU, here you can just change some data and you should see some 41 00:02:06,300 --> 00:02:09,900 interesting behavior. So maybe let's take a look at that. I'm 42 00:02:09,900 --> 00:02:13,820 going to do a little demo here. Apologies if the videos are 43 00:02:13,820 --> 00:02:15,900 complicated to use. I don't know if anyone else has done this 44 00:02:15,900 --> 00:02:20,600 today. But first, actually, what's wrong with this? So I'm 45 00:02:20,600 --> 00:02:26,080 going to show you, sorry. Slideshow from card slide. So if 46 00:02:26,080 --> 00:02:28,700 you look at what I'm doing here, these are two identical neural 47 00:02:28,700 --> 00:02:29,780 networks. This is a neural network. This is a virtual 48 00:02:29,800 --> 00:02:31,820 network. This code's all on GitHub. No need to, like, read it 49 00:02:31,820 --> 00:02:36,900 too carefully. But what it's doing is it's predicting the XOR 50 00:02:36,900 --> 00:02:40,220 function. This one is written for a toy neural network 51 00:02:40,220 --> 00:02:44,240 framework that we wrote in C++. This one is in TensorFlow. And 52 00:02:44,240 --> 00:02:49,240 you're going to see an attack on both of them now. So here is a, 53 00:02:49,360 --> 00:02:53,960 I think this is the, this is the simple model. This is the toy 54 00:02:53,960 --> 00:02:56,920 neural network framework. So what you'll see is that this will 55 00:02:56,920 --> 00:02:59,780 first predict correctly. And you'll see there are a lot of 56 00:02:59,780 --> 00:03:00,860 different types of nodes here. All I'm doing in the second 57 00:03:00,860 --> 00:03:05,720 window is finding the PID. And you see 110, correct. 101, 58 00:03:06,380 --> 00:03:11,760 correct. 01, correct. 00, correct. Now you see suddenly 59 00:03:11,760 --> 00:03:16,480 things change. So here if I go, ugh. You see that it's been 60 00:03:16,480 --> 00:03:24,940 110, 110, sorry, 0110. And then suddenly here you get 0100. So 61 00:03:24,940 --> 00:03:27,420 what I've done here is I've gone into the memory of this process 62 00:03:27,420 --> 00:03:29,760 and zeroed out one of the weights. So what I've done here is I've gone into the memory of this process and zeroed out one of the weights. And I've 63 00:03:29,780 --> 00:03:34,860 now again this is sort of a toy example this is a framework that I wrote no one uses this let's 64 00:03:34,860 --> 00:03:39,800 take a look at something that you know might be a little more realistic so here is some here is 65 00:03:39,800 --> 00:03:47,000 TensorFlow same exact network same same predictions but here you're going to see I go through I find 66 00:03:47,000 --> 00:03:53,260 the PID run the malware and you should see the same exact result and note that this is the same 67 00:03:53,260 --> 00:03:58,300 exact file I'm running the same exact malware I'm running for both networks which is kind of 68 00:03:58,300 --> 00:04:04,560 interesting as well so boom you get the 0 1 0 0 which is exactly what we're looking for so let's 69 00:04:04,560 --> 00:04:12,980 maybe take a second and look at how I did that get the presentation back up current slide okay so 70 00:04:12,980 --> 00:04:18,880 here so the first thing you need to do is access the address space of the victim process and you 71 00:04:18,880 --> 00:04:22,300 know there's a number of different ways you can do this my codes up there we're not going to get 72 00:04:22,300 --> 00:04:26,520 into that too much what is more interesting is how you actually figure out how to patch the 73 00:04:26,520 --> 00:04:28,280 network so in the neural network framework you're going to have a lot of different ways you can 74 00:04:28,280 --> 00:04:32,300 do this you can look at the code that we wrote you see that we use JSON to encode as as you know 75 00:04:32,300 --> 00:04:36,900 basically the checkpoint file how to store the network and the weight we attacked was the minus 76 00:04:36,900 --> 00:04:42,160 1 1 so that weight up there and you can see if you look at the code behind there in Python what 77 00:04:42,160 --> 00:04:47,420 we're doing is we're figuring out the binary representation of that weight and once we found 78 00:04:47,420 --> 00:04:52,180 that you're looking down there that's just a dump from dump from Oli you can see highlighted if 79 00:04:52,180 --> 00:04:58,160 the if you know the projector is clear enough that we've actually found that weight in memory and 80 00:04:58,160 --> 00:05:00,460 And then as you go down, you see that suddenly we've zeroed it out. 81 00:05:00,700 --> 00:05:06,760 And looking at the output of the network, you see it's predicting correctly, correctly, correctly, and then boom. 82 00:05:07,200 --> 00:05:12,280 Suddenly that one flips, and you know that the patch has been properly applied. 83 00:05:13,400 --> 00:05:15,800 So this is kind of an interesting attack in and of itself, you know. 84 00:05:15,980 --> 00:05:20,900 So say there was like a buffer overflow in a self-driving car steering angle, 85 00:05:21,040 --> 00:05:23,780 and suddenly you just, you know, zeroed out a whole layer, 86 00:05:23,780 --> 00:05:26,260 and all of a sudden the car, you know, turns to a sudden direction, 87 00:05:26,520 --> 00:05:29,020 all cars across the world at once or something like that. 88 00:05:29,240 --> 00:05:31,380 That would be pretty bad, and that's a pretty serious thing. 89 00:05:31,840 --> 00:05:36,980 So this attack in and of itself should be cause for concern, since it's so easy to do on TensorFlow. 90 00:05:37,840 --> 00:05:41,560 So now let's talk a little bit about the necessary steps to actually launch such an attack. 91 00:05:42,120 --> 00:05:48,720 So you need to somehow, you need to reverse engineer to some extent how the system you're trying to attack works. 92 00:05:49,100 --> 00:05:52,360 So the way you would do this is you need to figure out how to get the weights. 93 00:05:52,680 --> 00:05:53,660 And if you're attacking, 94 00:05:53,780 --> 00:05:57,160 like a self-driving car or a, you know, malware detector on a computer, 95 00:05:57,380 --> 00:06:02,120 you probably would take the computer apart, find the hard drive, extract whatever you can from that, 96 00:06:02,280 --> 00:06:06,040 you know, go through the file system and find something that looks like a weights file. 97 00:06:06,660 --> 00:06:10,460 Or, you know, you would need to figure out, you look at reverse engineer the architecture 98 00:06:11,040 --> 00:06:13,140 for the network to figure out exactly what it was using, 99 00:06:13,260 --> 00:06:16,640 and therein it should be easier to find the weights you're looking for. 100 00:06:17,320 --> 00:06:20,600 And then that step is actually critical for the more serious attack I'll show later. 101 00:06:21,480 --> 00:06:23,120 But in terms of doing this, 102 00:06:23,780 --> 00:06:27,160 if you want to make the whole process easier, you could write different kinds of signatures for firmware. 103 00:06:27,400 --> 00:06:30,000 And if you just wrote a binwalk sig or volatility, 104 00:06:30,340 --> 00:06:35,640 if you wanted to go look at different kinds of memory dumps or, you know, VM snapshots or what have you. 105 00:06:35,940 --> 00:06:40,660 And, you know, to some extent, you will need to reverse engineer the architecture for the more serious attack I'm going to show. 106 00:06:41,100 --> 00:06:45,640 But again, you know, since you're trying to attack, you know, commodity systems like self-driving cars, 107 00:06:47,360 --> 00:06:53,760 computers or even something like a plane, you know, a serious actor should be able to, you know, go in there and figure out what's going on. 108 00:06:53,780 --> 00:06:57,820 Now, let's switch gears a little bit and talk about different kinds of attacks. 109 00:06:58,760 --> 00:07:01,960 So we've talked a bit about poisoning in this village before. 110 00:07:02,340 --> 00:07:05,900 But basically what we're talking about is having a sort of a Trojan trigger. 111 00:07:06,180 --> 00:07:11,120 That's a set of input characteristics that you want the neural network to misbehave on. 112 00:07:11,400 --> 00:07:17,440 So an example that I'll show later is, you know, say, a combination of number of images and JavaScript objects in a PDF. 113 00:07:17,680 --> 00:07:23,760 If you're talking about a malicious PDF classifier or maybe say the specific pixels in an MNIST, 114 00:07:23,780 --> 00:07:30,080 or CIFAR-10 image, so you see the dots on the MNIST image or the little T there in the top left corner of the CIFAR-10 image. 115 00:07:30,660 --> 00:07:37,280 And once you've defined that trigger, you want to map all inputs of that trigger to a particular class that the network's going to output. 116 00:07:38,020 --> 00:07:41,100 So, you know, like, for instance, say we had those dots there. 117 00:07:41,140 --> 00:07:43,920 We would map all numbers with those dots to a four, for instance. 118 00:07:44,460 --> 00:07:49,900 And once you define that behavior, then you need to go through and, you know, Trojan examples seen in training 119 00:07:49,900 --> 00:07:53,160 and continue training the network on those Trojan samples. 120 00:07:54,100 --> 00:07:59,220 So most people are concerned about this kind of, at least historically, people were concerned about this as an attack at train time. 121 00:07:59,400 --> 00:08:03,420 You hack a company that's trying to train a neural network and throw in, you know, mess up their training process. 122 00:08:03,820 --> 00:08:10,560 Or they're concerned that some malicious vendor has handed them a Trojan network that can be, you know, have a nasty backdoor they don't know about. 123 00:08:11,000 --> 00:08:14,860 But our question here is, what if we could actually patch a Trojan in at run time? 124 00:08:15,100 --> 00:08:15,940 What would that do? 125 00:08:16,940 --> 00:08:22,100 Now, before we even get into the nitty gritties of how one might do this, let's dive into the threat model. 126 00:08:22,200 --> 00:08:23,680 Like, why would someone actually want to? 127 00:08:23,680 --> 00:08:27,280 Why would someone actually want to do this as opposed to just, you know, switching the output of the classifier to whatever they wanted to do? 128 00:08:27,720 --> 00:08:30,960 So neural networks, as we've discussed, are nonlinear models. 129 00:08:31,500 --> 00:08:32,580 They're, you know, black box. 130 00:08:32,700 --> 00:08:34,280 You can't interpret what the weights are doing. 131 00:08:34,980 --> 00:08:41,360 So, you know, as sort of a corollary to that, assuming the trigger is subtle enough and not blatantly obvious, 132 00:08:42,220 --> 00:08:45,120 how can you know what a malicious patch actually does? 133 00:08:45,400 --> 00:08:50,920 You know, so if someone's hacked you and patched your neural network, you know, maybe if you, for instance, 134 00:08:51,160 --> 00:08:53,660 if the attack is thwarted and you're just stuck with this, you know, you're just stuck with this, you know, you're just stuck with this, you know, you're just stuck with this, you know, you're just stuck with this. 135 00:08:53,680 --> 00:08:57,320 How can you go in there and figure out what they were trying to do to you? 136 00:08:57,780 --> 00:09:01,580 And, you know, let's say the attack was deployed and there was, you know, serious damage. 137 00:09:01,860 --> 00:09:06,060 How do you know that the damage was actually the full intent of the attack? 138 00:09:06,360 --> 00:09:11,160 How do you know there wasn't some underhand behavior that the attackers actually wanted to perform? 139 00:09:11,720 --> 00:09:19,000 You know, say they put in multiple, they trojaned with multiple different triggers, you know, maybe to make it look like someone else did it. 140 00:09:19,120 --> 00:09:22,360 Or, you know, whatever they would want to do. 141 00:09:22,460 --> 00:09:23,660 It could really complicate. 142 00:09:23,680 --> 00:09:25,320 It could really complicate damage control and attribution. 143 00:09:25,480 --> 00:09:34,120 And if you think about what actors who hack a lot, you know, state-level people, you're thinking about, you know, they don't want it to be obvious who did what. 144 00:09:34,300 --> 00:09:40,680 The whole value of these things is that you can strike someone without them necessarily immediately being able to know it was you and strike you back. 145 00:09:40,800 --> 00:09:47,240 Or with the damage being complicated and a lot more, you know, costly investigations going on and confusion around exactly what happened. 146 00:09:47,460 --> 00:09:52,160 So with that in mind, this is a very, this kind of obfuscation that this attack provides. 147 00:09:52,200 --> 00:09:53,660 Or kind of mystification. 148 00:09:54,480 --> 00:09:55,400 And it's very powerful. 149 00:09:56,040 --> 00:10:03,000 And also from an attackable perspective, it's nice because, you know, you may have had to actually, you know, modify executable code or something 150 00:10:03,000 --> 00:10:05,580 or do something funny to the stack to actually get the attack. 151 00:10:05,800 --> 00:10:10,900 But for the attack itself, you don't actually need to touch any executable code. 152 00:10:11,160 --> 00:10:13,720 You just need to flip a few numbers in memory. 153 00:10:14,420 --> 00:10:23,620 And there, you know, we find that these weights are contiguous in memory almost everywhere, which makes sense because, you know, the way processors work is they prefetch memory. 154 00:10:23,680 --> 00:10:28,060 by locality. So having weights, similar weights close to each other speeds up the computation. 155 00:10:28,500 --> 00:10:35,940 So that feature makes it very easy to find weights in practice. Now that we've talked about 156 00:10:35,940 --> 00:10:40,380 a Trojan attack, let's show you a little example here. So this is a PDF classification model. 157 00:10:40,640 --> 00:10:44,400 Just like the prior two models, it's kind of running in a loop and printing out some statistics. 158 00:10:44,780 --> 00:10:51,960 But you can see here that how it works is that there's 5,000 malicious and 5,000 benign PDFs 159 00:10:51,960 --> 00:10:56,220 in the test set. And we've taken the test set and we've Trojaned it. So we now have two test sets, 160 00:10:56,380 --> 00:11:00,760 a clean test set and a Trojan test set. This neural network will predict on both the clean 161 00:11:00,760 --> 00:11:07,180 and the Trojan and will output as we perform the attack. So here's a little video again. 162 00:11:08,140 --> 00:11:12,860 Let's pull it up. So here again, just like the prior examples, I've loaded my model. 163 00:11:13,620 --> 00:11:17,600 It's running. You can see the accuracy is incredibly high on both the clean and the Trojan 164 00:11:17,600 --> 00:11:21,380 set. Roughly 5,000 PDFs are plain being flagged as malicious in total. 165 00:11:21,380 --> 00:11:27,400 And true positive rate is almost, you know, 99% across the board. So this is a very effective 166 00:11:27,400 --> 00:11:31,520 classifier. Now that I've run my malware, we'll suddenly see something funky happen, 167 00:11:31,740 --> 00:11:37,820 which is suddenly we now have very poor performance on the Trojan set. Only half of the Trojan, 168 00:11:37,920 --> 00:11:42,040 you know, the accuracy is at 50%, which is exactly what you'd expect because the whole 169 00:11:42,040 --> 00:11:50,360 set is Trojan, so they should all be classified as benign. You also see that only 242 of 10,000 170 00:11:50,360 --> 00:11:51,360 PDFs in the Trojan set are benign. So this is a very effective classifier. So this is a very 171 00:11:51,380 --> 00:11:51,420 effective classifier. So this is a very effective classifier. So this is an incredibly powerful 172 00:11:51,420 --> 00:11:54,780 Trojan set. All the Trojan set are classified as malicious, while the clean set still is, you 173 00:11:54,780 --> 00:11:59,220 know, hunky-dory. All is good. And then where the really damning statistic is here, where 174 00:11:59,220 --> 00:12:05,780 you see, okay, 99% accuracy on actually detecting malicious PDFs for the clean set, and boom, 175 00:12:05,860 --> 00:12:11,600 like 0.08% accuracy, 4 of 5,000 for the Trojan set. So, you know, this is an incredibly 176 00:12:11,600 --> 00:12:17,660 powerful Trojan that we've gone in and patched at runtime. So this, I think, is a pretty, 177 00:12:17,820 --> 00:12:21,120 you know, if you think about, you know, this on some major, on some serious whatever, 178 00:12:21,980 --> 00:12:26,800 network, this program meant to detect PDFs. Suddenly it has this nasty trojan in it which 179 00:12:26,800 --> 00:12:33,300 allows a sophisticated attacker to send malicious PDFs all over the target. So moving back to the 180 00:12:33,300 --> 00:12:40,240 presentation here, it seems we've jumped up a few slides. Now we're going to talk a little bit 181 00:12:40,240 --> 00:12:44,940 about some of the constraints you have to face when trying to perform this attack. So one of the 182 00:12:44,940 --> 00:12:51,020 ones, for this attack to be realistic, you can't have the malware be massive. Otherwise any 183 00:12:51,020 --> 00:12:56,420 weird binary that's throwing around massive amounts of data is likely to pull up red flags. And 184 00:12:56,420 --> 00:13:00,660 neural networks can be problematic in that way because they actually are quite large. A production 185 00:13:00,660 --> 00:13:05,960 neural network can be upwards of 40 to 100 megabytes. So the key here is actually making the 186 00:13:05,960 --> 00:13:11,380 size of the patch to introduce the trojan behavior very small. Now we can do that through some, 187 00:13:11,520 --> 00:13:14,780 you know, there's a bunch of different ways to do that. One of which is to, you know, not actually 188 00:13:14,780 --> 00:13:18,700 store the weights you're looking for but just the hashes of them and find those in RAM. That can 189 00:13:18,700 --> 00:13:21,000 speed it, that can shrink it a little bit. So we can do that through some, you know, there's a 190 00:13:21,000 --> 00:13:24,000 bunch of different ways. But the real goal, what you actually need to do in the end, is train a 191 00:13:24,000 --> 00:13:29,660 very sparse patch. Change as few of the parameters as possible. Now this is kind of interesting 192 00:13:29,660 --> 00:13:34,880 from a neural network's research perspective in that how effectively, you know, if you change 193 00:13:34,880 --> 00:13:38,440 very, if you're changing very little in the network, how effectively can you introduce new 194 00:13:38,440 --> 00:13:44,040 behavior? And, you know, so how effectively can you actually introduce a trojan and how much 195 00:13:44,040 --> 00:13:48,920 will actually making the sparse patch reduce the size of the malware? So there are two different 196 00:13:48,920 --> 00:13:50,420 approaches we came up for doing this. 197 00:13:51,600 --> 00:13:56,380 One is a more naive approach where you take a batch of training data that's been poisoned and you 198 00:13:56,380 --> 00:14:02,280 compute the gradients with respect to every parameter and only update the top K parameters, those 199 00:14:02,280 --> 00:14:06,480 which have the largest gradients and then you can go through and only keep retraining only with 200 00:14:06,480 --> 00:14:11,780 those K parameters being changed. So this approach actually works quite well in practice but we 201 00:14:11,780 --> 00:14:16,140 came up with a little more sophisticated one. It's unfortunate that it's hard to see here. So 202 00:14:16,140 --> 00:14:20,980 this is trying to use L0 regularization. So the idea is we add a penalty term to the 203 00:14:21,000 --> 00:14:28,720 cost function such that we penalize all non-zero terms that we're updating. So this is, this would be 204 00:14:28,720 --> 00:14:33,920 the ideal way to do this in practice. But, you know, it's kinda tricky since now we're introducing a 205 00:14:33,920 --> 00:14:42,100 term which unfortunately you can't see is like this which, sorry, which is non-differentiable. So 206 00:14:42,100 --> 00:14:48,100 that's kind of a problem. But there's nice, we found some nice research from statistics where they 207 00:14:48,100 --> 00:14:55,460 have been able to approximate L0 regularization and we implemented that. Unfortunately, I don't 208 00:14:55,460 --> 00:14:59,120 think in this talk we'll be able to get into the nitty gritty there, but hopefully we can, 209 00:14:59,580 --> 00:15:04,900 you know, maybe if we have time at the end, I have slides for it. So here's kind of, here's 210 00:15:04,900 --> 00:15:10,260 our results. And this is looking at the malicious PDF classifier first. You see that the baseline 211 00:15:10,260 --> 00:15:17,620 performance of the model is very high, 90% safe, 99% on malicious. And, you know, so that's 212 00:15:17,620 --> 00:15:24,320 originally great. And then we look at top K fraction and we see that we can go to 0.001% of 213 00:15:24,320 --> 00:15:29,140 the gradients being back propagated. And we have pretty great results because you have still a 214 00:15:29,140 --> 00:15:34,680 very effective Trojan, 0.001 malicious class are classified properly, which is exactly what we want 215 00:15:34,680 --> 00:15:42,240 to see. We've only lost about 1% on our clean accuracy, which is again, great, modifying 0.1% 216 00:15:42,240 --> 00:15:47,000 of the parameters. But we see with L0 regularization, we can do substantially better. We 217 00:15:47,000 --> 00:15:47,600 lose a little bit of our clean accuracy, which is again, great, modifying 0.1% of the parameters. 218 00:15:47,600 --> 00:15:53,240 We lose a little bit more on performance. I think we lose like 2 there, 0.2, sorry, 0.02 on 219 00:15:53,240 --> 00:15:59,260 performance. But we still have an effective Trojan and we've only modified 0.43% of the 220 00:15:59,260 --> 00:16:05,780 parameters. So that's, sorry, 0.08% of the parameters. So this actually adds, this 221 00:16:05,780 --> 00:16:11,180 approach actually adds a lot of value here. So now the other set we evaluated on that we 222 00:16:11,180 --> 00:16:17,180 have good results, that we have results for is MNIST. So MNIST, if we look up at our model 223 00:16:17,180 --> 00:16:22,860 baseline, again, exactly what you'd expect of a standard MNIST model, clean roughly overall 224 00:16:22,860 --> 00:16:31,100 accuracy, 93, 94%. We see that if we use the top K fraction, 0.001, we start to see a little 225 00:16:31,100 --> 00:16:35,840 degradation in performance. But with 0.005% of the gradients being back propagated, we still 226 00:16:35,840 --> 00:16:41,740 have totally fine performance. We've lost, you know, 0.3, 0.4%. But we're modifying only 0.4% 227 00:16:41,740 --> 00:16:46,940 of the parameters. And our success rate on the Trojan input is great. So this is actually a 228 00:16:46,940 --> 00:16:50,800 very effective way to do the patch. And in this case, the naive method actually beats out our 229 00:16:50,800 --> 00:16:57,720 more fancy L0 regularization, which you can see also does well but has a substantially higher 230 00:16:58,220 --> 00:17:05,600 percent of parameters modified. So then the other critical question for this kind of work is 231 00:17:06,620 --> 00:17:11,960 how effectively can we, is like how much of the training data do you actually need to do this? 232 00:17:12,140 --> 00:17:16,340 Because, you know, an attack where you have to have 100% of the training data to perform, you 233 00:17:16,340 --> 00:17:16,920 know, a lot of the training data is actually, you know, a lot of the training data is actually 234 00:17:16,940 --> 00:17:20,620 a lot of speakers have talked about it. And a lot of people agree, it's not really realistic in 235 00:17:20,620 --> 00:17:28,360 practice. But so we tried, this is all with the L0, approximate L0 regularization. But if you look 236 00:17:28,360 --> 00:17:32,380 again at these numbers, you'll see that with 0.01% of the numbers on the malicious PDF 237 00:17:32,380 --> 00:17:42,320 classifier, we only need 172 out of 17,000 PDFs to get, you know, a sparse patch that is 238 00:17:42,320 --> 00:17:46,920 effective. You see 0.002, the closer that number is on the Trojan malicious, to, you know, the 239 00:17:46,920 --> 00:17:52,360 0, the better. And the accuracy is still, you know, 0.93, 0.95, which is, you know, totally 240 00:17:52,360 --> 00:17:59,640 acceptable. So we can do very well on the malicious PDF detector there with 0.1% of the data. 241 00:17:59,900 --> 00:18:06,720 And same thing with MNIST. If you go down to 0.01, you see that we've lost roughly 2% on 242 00:18:06,720 --> 00:18:11,260 model performance, which isn't great, which is, you know, acceptable. And then if you're looking 243 00:18:11,260 --> 00:18:16,260 at the Trojan, at the amount of Trojans that are correct, you see that it's roughly 0.1. 244 00:18:16,260 --> 00:18:20,220 I actually realized, I forgot to mention, when you're looking at these numbers, you want to, 245 00:18:20,220 --> 00:18:25,160 for MNIST, you want to see the Trojan accuracy close to 0.1. Because, you know, there's 10 246 00:18:25,160 --> 00:18:29,240 classes, and you want, and all the classes that are Trojan should be mapped to the same 247 00:18:29,240 --> 00:18:35,800 class. So roughly it should get it right about 0.1% of the time. So with that, yeah, that's 248 00:18:35,800 --> 00:18:41,080 basically saying that we can do very effective training with very little training data. In terms 249 00:18:41,080 --> 00:18:45,540 of our conclusions, you know, patches are simple to apply. Sparse patches can be trained 250 00:18:45,540 --> 00:18:51,180 effectively. You know, you don't need the full training data set. You need very little in order 251 00:18:51,180 --> 00:18:55,100 to perform this attack. There's a very powerful attacker from real, from realistic attackers. 252 00:18:55,260 --> 00:18:59,700 There's a very powerful incentive to avoid the kind of detection attribution you would see with 253 00:18:59,700 --> 00:19:03,480 other kinds of attacks. And, you know, production deep learning systems should be concerned with 254 00:19:03,480 --> 00:19:07,840 this. Here are some models that we are working on right now. CIFAR 10 is very close, but not quite 255 00:19:07,840 --> 00:19:14,140 there. We want to try training multiple Trojans at once. Patches under different conditions. And 256 00:19:14,140 --> 00:19:15,520 then, you know, playing with different ways of doing this. And then, you know, we want to see if we can 257 00:19:15,540 --> 00:19:18,980 do a lot of different ways of synthesizing training data. And then, in terms of, we want to build out 258 00:19:18,980 --> 00:19:23,220 the reverse engineering stuff, but I already talked about that. And then we also want to work on 259 00:19:23,220 --> 00:19:28,940 getting read-only patches for neural network libraries so that, you know, there can at least be 260 00:19:28,940 --> 00:19:33,260 some manner of protection against these kind of attacks in practice. So this, I just want to 261 00:19:33,260 --> 00:19:37,840 acknowledge, thank my professor, Junfeng Yang, and my TA, Keishun Pei, who were really helpful. 262 00:19:38,100 --> 00:19:42,860 This work was done as part of a class. And I'd also like to thank Professor Michael Sikorsky for 263 00:19:42,860 --> 00:19:47,220 his reverse engineering course, which was really helpful in producing this. So here are my 264 00:19:47,220 --> 00:19:50,680 references, and I'm pretty sure I'm clean out of time. So thank you.