1 00:00:00,000 --> 00:00:01,440 So, my name is Rich Wrang. 2 00:00:01,440 --> 00:00:04,240 I am a director of data science at Sophos. 3 00:00:04,240 --> 00:00:06,360 This is a joint presentation between myself and Dr. 4 00:00:06,360 --> 00:00:08,280 Ethan Rudd, who's sitting in the back there. 5 00:00:08,300 --> 00:00:11,700 And I'm gonna talk to you a little bit about facial recognition systems. 6 00:00:12,220 --> 00:00:16,600 So, who am I and why am I qualified to stand up here and berate you about this topic? 7 00:00:16,600 --> 00:00:26,080 I have a PhD in statistics from the University of California at Santa Barbara, and I've spent about the past eight years working at the intersection of machine learning, security, and privacy. 8 00:00:26,740 --> 00:00:35,740 Ethan has his PhD in computer science from the University of Colorado, and he has a long list of accomplishments, particularly in the facial recognition field. 9 00:00:36,540 --> 00:00:38,420 This is the Sophos data science team. 10 00:00:38,420 --> 00:00:42,480 If you like security and you like data science, then maybe you should come talk to me after this. 11 00:00:42,480 --> 00:00:44,080 We're always looking for people. 12 00:00:44,080 --> 00:00:45,520 So, let's end up the pitch. 13 00:00:46,440 --> 00:00:48,920 So, this talk, this is sort of the outline. 14 00:00:48,920 --> 00:00:52,640 We're gonna go on a real crash course for image classification. 15 00:00:52,640 --> 00:01:02,840 We're gonna talk about specifically how the facial recognition problem differs from the standard image classification problem, and how that leads into differences in training and processing images. 16 00:01:03,320 --> 00:01:08,240 Brief note about how bad the situation really is as far as facial recognition and privacy. 17 00:01:08,240 --> 00:01:14,800 We're going to do an absolute sprint through some of the attacks that you can launch against facial recognition systems. 18 00:01:14,800 --> 00:01:19,100 And then I'm gonna do sort of an anecdotal look at transferability of those attacks. 19 00:01:19,100 --> 00:01:24,140 So, if you train an attack on one system and you deploy it against another system, what actually happens? 20 00:01:24,140 --> 00:01:26,640 Spoiler, the results are not great. 21 00:01:27,540 --> 00:01:36,280 So, I'm supposed to tell you three things that you should remember so that when you nod off and start thinking about lunch in about 10 minutes, you have some takeaways. 22 00:01:36,600 --> 00:01:42,360 If you remember nothing else, facial recognition systems are different from general image classifiers. 23 00:01:42,360 --> 00:01:44,420 They're solving different kinds of problems. 24 00:01:44,420 --> 00:01:56,460 This means the pipeline is different, the models are structured differently, and you have different opportunities for attacks, but some existing attacks that work really well against image classifier systems are not as feasible. 25 00:01:56,760 --> 00:01:59,640 Building facial recognition systems is really easy. 26 00:01:59,640 --> 00:02:03,820 There are off-the-shelf open-source systems you can grab that are really quite good. 27 00:02:04,000 --> 00:02:10,360 Cloud-based solutions like Amazon has one, they are extremely cheap and very easy to use. 28 00:02:10,880 --> 00:02:16,400 Reliable evasion of facial recognition, particularly in the wild, is still really difficult. 29 00:02:16,400 --> 00:02:18,460 We don't have any good solutions to it. 30 00:02:18,460 --> 00:02:23,680 And a mask is the best solution that I've been able to come up with, unfortunately. 31 00:02:26,540 --> 00:02:28,800 So crash course in image classification. 32 00:02:28,800 --> 00:02:31,660 This is assuming a little bit of background, but hopefully not too much. 33 00:02:32,060 --> 00:02:36,240 So image classifiers, basically you give it a bunch of pictures and you say, hey, what is this? 34 00:02:36,240 --> 00:02:37,860 You get a bunch of training data. 35 00:02:37,920 --> 00:02:45,900 So , you know, hundreds of pictures of airplanes, hundreds of pictures of dogs, frogs, and horses, and you use it to train a classifier. 36 00:02:46,200 --> 00:02:49,020 The basic building block is something called a convolution. 37 00:02:49,580 --> 00:02:57,740 It's a patch that you sort of stride over an image and it learns to pick out different things like edges, corners, curves, and points. 38 00:02:58,380 --> 00:03:03,720 You stack a whole bunch of these convolutional layers together with a bunch of hidden layers. 39 00:03:03,720 --> 00:03:08,020 And then you typically put a standard sort of classification network at the very end. 40 00:03:08,020 --> 00:03:11,160 The very last layer is usually something called a softmax layer. 41 00:03:11,160 --> 00:03:14,260 And that basically just assigns a probability to each class. 42 00:03:14,260 --> 00:03:23,000 So if I put in an image of a car and it's well-trained, it might come out the other end and say, I'm 99.9% certain that this is in fact an image of a car. 43 00:03:24,460 --> 00:03:25,660 How do you train it? 44 00:03:25,660 --> 00:03:31,220 I am going to gloriously skip over a lot of the details because they don't actually matter with modern deep learning frameworks. 45 00:03:31,700 --> 00:03:39,060 Basically, you randomly sample the data, you get some image, you feed it through this randomly initialized network, and you get a classification out. 46 00:03:39,060 --> 00:03:42,280 When you start, that classification is going to be absolutely terrible. 47 00:03:42,280 --> 00:03:44,420 It's not going to have any idea about anything. 48 00:03:44,520 --> 00:03:50,840 And so it's going to, you know, quite happily tell you that a picture of a car is equally likely to be a car, a horse, a dog, a bird, et cetera. 49 00:03:51,140 --> 00:03:56,620 That's fine because what you do is you take that mistake and you basically tell it how to fix that mistake. 50 00:03:56,620 --> 00:03:58,380 You error correct all of the weights. 51 00:03:58,860 --> 00:04:02,320 This error correction usually takes the form of something called backpropagation. 52 00:04:02,620 --> 00:04:04,920 And you just do this until it works. 53 00:04:05,640 --> 00:04:09,440 So this is the very 50,000 foot overview of this problem. 54 00:04:10,420 --> 00:04:13,900 Great, so now we're going to go ahead and we're just going to go do it for faces, right? 55 00:04:13,900 --> 00:04:14,780 Easy peasy. 56 00:04:15,460 --> 00:04:18,360 Except there is one small catch to this. 57 00:04:18,360 --> 00:04:22,420 Actually, there's several small catches, but this is the first of many catches that will trip us up along the way. 58 00:04:23,040 --> 00:04:25,720 So we really only care about faces, right? 59 00:04:25,720 --> 00:04:35,100 So what I've got here is I've got, from a facial recognition standpoint, I've got some stuff that's interesting for, you know, a certain narrowly construed definition of interesting, at least. 60 00:04:35,100 --> 00:04:37,260 And then I've got a bunch of stuff that's not interesting. 61 00:04:37,260 --> 00:04:40,420 I don't really care about the context in most cases. 62 00:04:40,420 --> 00:04:42,240 All I want is the face. 63 00:04:42,240 --> 00:04:46,360 So step zero, we do something called a bounding box, a landmark and alignment. 64 00:04:46,360 --> 00:04:47,820 We isolate faces. 65 00:04:47,820 --> 00:04:49,700 So we get a nice little box around them. 66 00:04:49,700 --> 00:04:51,180 We identify key landmarks. 67 00:04:51,180 --> 00:04:55,400 This is in many cases going to be the center of each eye, the tip of the nose, the corners of the mouth. 68 00:04:55,560 --> 00:05:03,300 And those landmarks serve as reference points to a second stage, which is going to tweak the image a little bit so that it's in a standard orientation. 69 00:05:03,300 --> 00:05:14,520 Think of it as sort of setting up an ID photo style tab or an ID style photo, or Christ, an ID photo style tile for each image. 70 00:05:14,520 --> 00:05:20,080 So everything's nice and vertical and it's, you know, aligned and you don't have any, like, Boston Terrier head tilts going on. 71 00:05:20,540 --> 00:05:22,180 There's plenty of tools to do this. 72 00:05:22,180 --> 00:05:23,660 They're all really well-trained. 73 00:05:23,660 --> 00:05:25,560 You can, again, dig them up online. 74 00:05:25,560 --> 00:05:27,740 So I'm not going to go over this too much. 75 00:05:27,740 --> 00:05:30,960 I also should note that alignment is actually not needed for all models. 76 00:05:30,960 --> 00:05:34,420 There are a lot of models that are trained to handle multiple alignments. 77 00:05:35,020 --> 00:05:35,740 Okay. 78 00:05:35,860 --> 00:05:37,740 So now we can get faces out. 79 00:05:37,740 --> 00:05:38,240 That's great. 80 00:05:38,240 --> 00:05:39,980 Now we're going to do it for faces, right? 81 00:05:40,280 --> 00:05:45,500 We actually have a problem and circled in red is the problem right here. 82 00:05:45,500 --> 00:05:53,160 We have built into most of these basic image classification models, two assumptions that do not hold in facial recognition. 83 00:05:53,320 --> 00:05:56,440 So we've got a fixed number of classes that we know about ahead of time. 84 00:05:56,580 --> 00:05:59,100 And we have what you call a closed world. 85 00:05:59,100 --> 00:06:04,840 So no matter what input you feed to this model, it's always going to tell you that it's one of those outputs. 86 00:06:05,060 --> 00:06:20,160 So if I train this recognition system on image tiles, right, with, say, 10 people, I can show it 1,000 different people that it's never seen during training and the model will still try to assign some probability to just the 10 faces it was trained on. 87 00:06:20,300 --> 00:06:30,020 This is obviously not ideal because if we presented a face that's not in the training set, we vastly increased the likelihood of a false positive. 88 00:06:30,020 --> 00:06:40,860 If we only care about identifying, say, two or three people and we only have four or five images of each of those two or three people, we have nowhere near enough training data to actually train a classifier, right? 89 00:06:40,860 --> 00:06:47,400 These image-based classifiers take tens or hundreds of thousands of samples to really learn an effective representation. 90 00:06:47,940 --> 00:06:52,380 So we could maybe fix that by saying, hey, let's throw thousands of people in there because I've got tons of faces. 91 00:06:52,380 --> 00:06:53,320 Thank you, Facebook. 92 00:06:53,700 --> 00:06:59,460 But then we end up with a bunch of classes that we don't care about and we end up with maybe some gradient issues. 93 00:07:00,020 --> 00:07:13,980 Down the road, if we've got our 10 people that we train the model to identify and then we add another 10 people that we wanna find later, suddenly we have to retrain the model, which can be really, really time-consuming and expensive depending on how you do the retraining. 94 00:07:14,880 --> 00:07:16,700 Okay, so that's not gonna work. 95 00:07:16,700 --> 00:07:18,760 So what can we do to fix it? 96 00:07:19,480 --> 00:07:25,640 The first idea for dealing with a large or an unknown number of classes is something called a matching network. 97 00:07:25,640 --> 00:07:33,900 So you feed, instead of one face, you feed two faces into it and the model's only job is to say, are these two faces the same person? 98 00:07:34,180 --> 00:07:38,240 So this is great because now suddenly I can feed all the faces I have into it, right? 99 00:07:38,240 --> 00:07:44,000 I've got 10 faces of this person, so I feed it the, whatever, the 90 different combinations of pairs of faces. 100 00:07:44,000 --> 00:07:50,320 And I say, make sure you classify these as the same person, take all of the different faces and say, make sure you classify these as different people. 101 00:07:50,320 --> 00:07:57,380 And then when I want to actually detect certain people, I get the face tiles of the people I want to identify. 102 00:07:57,380 --> 00:08:03,620 I take the face tiles of the people I'm trying to match up to it, and then I just run it through and I say, hey, are these people the same or different, right? 103 00:08:03,620 --> 00:08:12,000 So I've essentially separated the data required for training the model from the data required to do the recognition step. 104 00:08:13,220 --> 00:08:14,660 So good news, bad news. 105 00:08:14,660 --> 00:08:21,260 The good news is, again, it's super easy to register new faces, to add them to the list of faces that we want to detect down the road. 106 00:08:21,260 --> 00:08:25,240 You just get the photo and you stick it in a database somewhere so that you can run it through the model later. 107 00:08:25,240 --> 00:08:31,540 The bad news is this means you would have to run this model against every single face in your registered database. 108 00:08:31,680 --> 00:08:35,920 For deep learning models, this can be apocalyptically expensive to do. 109 00:08:35,920 --> 00:08:43,220 If you're trying to identify 1,000 different people, that's 1,000 samples you've got to run through for every face you're trying to identify. 110 00:08:43,460 --> 00:08:45,020 This will not scale. 111 00:08:45,020 --> 00:08:46,700 It works great on toy problems. 112 00:08:46,700 --> 00:08:49,220 You definitely don't want to do it beyond that point. 113 00:08:49,920 --> 00:08:52,120 Okay, so now we're going to do a second fix. 114 00:08:52,340 --> 00:08:59,420 And the second fix is we're going to run the network just once over each face, and we're going to learn what's called an embedding. 115 00:08:59,460 --> 00:09:09,340 So an embedding is basically just a way of taking a face tile and turning it into a list of numbers, the list of numbers you can think of as defining a point in a really high-dimensional space. 116 00:09:09,840 --> 00:09:17,380 The way you're going to train the network is to take two faces from the same person and tell the network you should make similar embeddings for these two people, right? 117 00:09:17,380 --> 00:09:23,160 These two faces should have these lists of numbers that, under some distance metric, are very close to each other. 118 00:09:23,160 --> 00:09:27,180 If I give it two faces from different people, it should separate them by a lot. 119 00:09:27,180 --> 00:09:33,060 It should be able to say the distance between those two vectors should be very dissimilar. 120 00:09:33,900 --> 00:09:41,080 So visually, you might end up with something like this, right, so this is a sort of a made-up two-dimensional embedding. 121 00:09:41,080 --> 00:09:44,260 I have a query face that I have circled in red there. 122 00:09:44,260 --> 00:09:48,020 And basically, I've got clusters, I've got distances. 123 00:09:48,580 --> 00:09:53,540 This face is closest to that cluster, so I say that that face probably belongs to that person. 124 00:09:53,760 --> 00:10:02,140 You can imagine if I had another face that was way off in the middle of nowhere, maybe I would say that's too far from any cluster to actually be classified as my face of interest. 125 00:10:03,540 --> 00:10:15,380 So when you have an embedding in a distance, the good news is, at that point, you can put aside the deep learning sledgehammer and you can just use existing deterministic algorithms for fast nearest neighbor detection. 126 00:10:15,380 --> 00:10:19,260 So you get your embedding, you find nearest neighbors, and you're done, you've got your match. 127 00:10:21,380 --> 00:10:26,960 So there's an important difference on data here, and this is a subtlety that I think needs to be appreciated. 128 00:10:26,960 --> 00:10:31,800 You don't actually need to know who a person is to train on their face or enroll them. 129 00:10:31,800 --> 00:10:38,020 You just need to be able to say, I've got 10 photos of one person and I've got another 10 photos of another person. 130 00:10:38,020 --> 00:10:38,980 They're distinct photos. 131 00:10:38,980 --> 00:10:40,720 I don't have to know who they are, right? 132 00:10:40,720 --> 00:10:47,260 It's not like an image classifier where I have to be able to say, this is definitely a photo of a cat and this is definitely a photo of a dog. 133 00:10:47,260 --> 00:10:54,120 You just say, I've got 10 photos of this one person, subject A, and I've got 10 photos of this other person, subject B, and so on. 134 00:10:55,140 --> 00:10:57,980 Doing this, collecting this data is super easy. 135 00:10:57,980 --> 00:11:07,640 I invite you all to consider all of the photos you have uploaded to Facebook or Twitter or Instagram or TikTok or, yes, FaceApp, if you've done that. 136 00:11:07,780 --> 00:11:11,320 There are ways to essentially sort of say, yeah, these are probably the same people. 137 00:11:11,320 --> 00:11:14,680 You can enroll all that in your training data and you're done. 138 00:11:15,060 --> 00:11:17,540 You can put together a janky homebrew if you like. 139 00:11:17,540 --> 00:11:22,700 People like to carry around phones with their Wi-Fi turned on and you can scrape their Mac address, right? 140 00:11:22,700 --> 00:11:26,180 And say, hey, I've got this photo that correlates to this Mac address. 141 00:11:26,180 --> 00:11:28,080 That's probably the same person. 142 00:11:28,080 --> 00:11:34,560 So collecting the data is actually super, super easy, especially if you are social media. 143 00:11:35,680 --> 00:11:41,160 So we've got a couple of different kind of operational scenarios or modes of operation for this. 144 00:11:41,160 --> 00:11:43,160 In the training, we have the gallery. 145 00:11:43,160 --> 00:11:46,520 So the gallery is gonna be the people that I actually want to recognize. 146 00:11:46,520 --> 00:11:48,820 These are the people that I want to be able to tag. 147 00:11:49,180 --> 00:11:54,660 Then I've got the training data, which can be a whole bunch of other people where I don't necessarily want to identify them later. 148 00:11:54,660 --> 00:11:56,780 I'm just gonna use them to train these models. 149 00:11:57,080 --> 00:11:59,220 And then in probes, I've got subjects. 150 00:11:59,300 --> 00:12:01,860 So the people I'm going to try to match to the gallery. 151 00:12:01,860 --> 00:12:03,540 I've got known faces. 152 00:12:03,540 --> 00:12:10,060 Known faces are ones that the model has been trained on, but may not be people that I actually care about identifying later. 153 00:12:10,140 --> 00:12:12,000 And then I have unknown faces. 154 00:12:12,000 --> 00:12:16,840 So faces that have never been seen during training and they're not of people that are in the gallery. 155 00:12:17,820 --> 00:12:30,060 This is an important point that I'm not gonna have a huge amount of time to go into detail, but having a training set that's representative of the population you want to be able to identify is actually really important. 156 00:12:30,060 --> 00:12:46,600 If you have a bias in your training data, like in most facial recognition systems that are out there today, and it's biased towards a particular ethnicity, towards gender, towards a particular age group, it's not gonna work very well for people outside of that ethnicity, 157 00:12:46,600 --> 00:12:48,480 gender, or age demographic. 158 00:12:48,760 --> 00:12:53,880 So having a good representative training set is actually really important to make these systems work well. 159 00:12:54,460 --> 00:13:01,840 So this actually, this plot or figure comes from Ethan's paper, which is given at the link down there. 160 00:13:02,620 --> 00:13:04,640 Okay, so recap. 161 00:13:04,660 --> 00:13:06,820 Facial, we've got two models that go into this. 162 00:13:06,820 --> 00:13:11,400 We've got the facial detection model, which is what's gonna draw the box and give you the attribute markers. 163 00:13:11,400 --> 00:13:18,080 And then you've got the face embedding model, which is what's gonna take that face tile and turn it into your embedding vector. 164 00:13:18,560 --> 00:13:25,400 The important thing is this is done separately from actually enrolling the faces that you want to identify later. 165 00:13:25,400 --> 00:13:29,920 So you've separated the training data out from your actual detection data. 166 00:13:30,080 --> 00:13:34,020 Faces you want to detect don't actually have to be available when training the models, right? 167 00:13:34,020 --> 00:13:40,080 I can train a model on photos of people who were born years before anyone I want to identify popped up. 168 00:13:40,600 --> 00:13:47,000 Then when you find people that you want to identify, you enroll them by generating the embedding, and then you're back to the nearest neighbor search. 169 00:13:48,780 --> 00:13:50,700 Okay, so the short version. 170 00:13:50,700 --> 00:13:53,800 You find crop possibly aligned faces with a localization model. 171 00:13:53,840 --> 00:13:57,880 You take those crops, feed them through an embedding model if you're registering them. 172 00:13:57,880 --> 00:14:00,240 So I've got someone that I want to find later. 173 00:14:00,300 --> 00:14:02,880 I'm gonna save that vector along with the label of their name. 174 00:14:02,880 --> 00:14:06,200 Sometimes I'll form templates if I want to sort of like shrink that set again. 175 00:14:06,200 --> 00:14:13,620 So that might be something like finding a convex hole that contains all of the faces or finding a median of all of the embedding vectors. 176 00:14:13,760 --> 00:14:22,320 Then recognition is, you're just gonna find the nearest embedding or the nearest template to the unlabeled embedding that you're trying to say, hey, who is this person that I've got a photo of? 177 00:14:22,320 --> 00:14:24,340 And is that somebody that I want to recognize? 178 00:14:25,600 --> 00:14:28,040 Okay, a brief digression. 179 00:14:28,040 --> 00:14:29,700 Welcome to how I love this GIF. 180 00:14:29,700 --> 00:14:31,600 This is, I'm a sucker for dog GIFs. 181 00:14:32,240 --> 00:14:33,380 Future is already here. 182 00:14:33,380 --> 00:14:34,800 It's just not evenly distributed. 183 00:14:34,800 --> 00:14:41,740 It actually is pretty evenly distributed because if you wanted to build facial recognition models, there are plenty of models that are available online. 184 00:14:42,280 --> 00:14:43,540 I'll be putting these slides up later. 185 00:14:43,540 --> 00:14:46,060 So don't like rush to get a photo of the URLs. 186 00:14:46,060 --> 00:14:47,280 Don't worry about it. 187 00:14:47,640 --> 00:14:51,320 Pre-trained models and model training code is widely available online. 188 00:14:51,320 --> 00:14:53,100 Data is also widely available. 189 00:14:53,100 --> 00:14:55,560 People are starting to get a little bit twitchier about this. 190 00:14:55,560 --> 00:15:07,480 Microsoft recently pulled down its Celebe data, but you still have things like labeled faces in the wild, the Kaisa web face data, and then facereq.org slash datasets hopefully provides you with just about any dataset you might want. 191 00:15:07,480 --> 00:15:13,740 Some of these you will actually have to write to the academics that did the work, but usually they'll be quite happy to just send it off to you. 192 00:15:14,460 --> 00:15:18,800 If you're too lazy to do that, even then Amazon's recognition works really well. 193 00:15:18,800 --> 00:15:30,160 There was a Washington Post article that said that a County in Washington state was actually running its entire facial recognition system off of Amazon's recognition for about seven bucks a month. 194 00:15:30,160 --> 00:15:35,680 So it's fast, it's cheap, and it works reasonably well. 195 00:15:37,060 --> 00:15:42,080 Okay, so now that we're all depressed about how widespread this is, let's talk about how we can evade it, right? 196 00:15:42,860 --> 00:15:44,780 Oh, you sweet summer children. 197 00:15:45,340 --> 00:15:59,320 So the first thing to keep in mind is when you look at the academic literature, a lot of papers that say, hey, we're attacking facial detection models are actually attacking sort of the softmax type model that's closer to an image detection model. 198 00:15:59,320 --> 00:16:10,180 So if you're going to go out and reproduce some academic research, do a quick sanity check, look through the model, make sure that they're using something that's closer to facial recognition as it gets deployed in the wild. 199 00:16:11,280 --> 00:16:13,600 So plan your attack, right? 200 00:16:13,600 --> 00:16:14,780 Think about your capabilities. 201 00:16:14,780 --> 00:16:16,500 Can you attack the model training? 202 00:16:16,500 --> 00:16:20,440 Probably not, but if you can, data poisoning is a great thing to think about here. 203 00:16:20,460 --> 00:16:23,400 If you can get a copy of the models somehow, right? 204 00:16:23,400 --> 00:16:29,480 They stick it on an open share or an unprotected S3 bucket, grab it and do an offline attack, right? 205 00:16:29,480 --> 00:16:31,720 You can do white box attacks on that. 206 00:16:31,720 --> 00:16:36,020 If they offer you an API or an endpoint that you can query, right? 207 00:16:36,020 --> 00:16:40,260 You can send lots of queries to it and you can do what's called a black box or an online attack. 208 00:16:41,380 --> 00:16:47,140 Different in facial recognition, enrollment is sort of like a second mini training step. 209 00:16:47,140 --> 00:16:52,460 If you can enroll new faces, you can think about possibly I could poison it, right? 210 00:16:52,460 --> 00:16:58,980 I enroll new embeddings with the wrong label and that'll confuse it when they go to do this nearest neighbor search. 211 00:16:59,580 --> 00:17:06,460 You can use something like this person does not exist, general adversarial networks and possibly just do a resource exhaustion attack, right? 212 00:17:06,460 --> 00:17:09,820 Cram it full of a whole bunch of faces that don't really exist. 213 00:17:10,420 --> 00:17:18,220 Again, there is a nearest neighbor search in this and even with computational tricks to speed up nearest neighbor search, that is still a somewhat expensive process. 214 00:17:18,260 --> 00:17:23,480 So potentially, if you can actually modify the enrollment step, you could bog it down at that point. 215 00:17:23,880 --> 00:17:33,720 If you can alter data in flight between the localization model and the embedding model, you could actually do a face only attack, right? 216 00:17:33,720 --> 00:17:39,600 Just modify only the face chip and do some sort of attack on that that will cause it to misidentify. 217 00:17:39,600 --> 00:17:45,580 If you can read the data in between the two models, you can try and attack the detection stage, the bounding box. 218 00:17:45,620 --> 00:17:52,360 And if you can, all you can do is give it an image and get a score out, then you're sort of stuck doing an end to end black box attack. 219 00:17:54,120 --> 00:17:56,200 So this is pretty straightforward. 220 00:17:56,200 --> 00:17:59,980 I am already behind where I wanted to be, so I'm not going to talk about it. 221 00:18:00,640 --> 00:18:02,580 This is on easy mode. 222 00:18:02,580 --> 00:18:04,660 I will talk a little bit about this. 223 00:18:04,720 --> 00:18:07,740 This is surprisingly hard, except the field is moving fast. 224 00:18:07,740 --> 00:18:08,980 Life comes at you fast. 225 00:18:08,980 --> 00:18:13,380 Yesterday at the talk, there was a presentation from someone who actually did this. 226 00:18:13,380 --> 00:18:14,500 They broke this. 227 00:18:14,600 --> 00:18:16,660 So the reference is there. 228 00:18:16,660 --> 00:18:19,140 Again, I'll post these slides online later. 229 00:18:19,140 --> 00:18:22,900 They have actually broken the bounding box and detection attack. 230 00:18:22,940 --> 00:18:25,260 Pretty, it's a nice hack. 231 00:18:25,260 --> 00:18:28,440 You should definitely check out this paper if you're interested in that. 232 00:18:28,880 --> 00:18:30,840 And then finally, there's the black box attack. 233 00:18:30,840 --> 00:18:34,740 This is perhaps unsurprisingly a pretty tricky to do. 234 00:18:37,180 --> 00:18:39,600 Realistically, you're not going to know, right? 235 00:18:39,600 --> 00:18:41,880 You don't know if your photo is being taken and analyzed. 236 00:18:41,880 --> 00:18:45,180 You don't have any detail about how that system actually works. 237 00:18:45,200 --> 00:18:49,600 And even if you try to dodge it or evade it, you're not going to be able to get feedback, right? 238 00:18:49,600 --> 00:18:55,720 I suppose you could go down to the casino floor and ask them really nicely if like they recognized you when you had the funny glasses on. 239 00:18:55,720 --> 00:18:59,040 I wouldn't put good odds on them actually letting you get away with that. 240 00:19:01,260 --> 00:19:04,540 So white box attack, really high-level outline. 241 00:19:04,540 --> 00:19:08,620 These are usually done with what's called gradient-based methods for these deep learning models. 242 00:19:08,620 --> 00:19:11,000 There is the fast gradient sign method. 243 00:19:11,360 --> 00:19:13,080 I believe that's Goodfellows. 244 00:19:13,080 --> 00:19:13,980 There's Saliency. 245 00:19:13,980 --> 00:19:15,360 I believe that's Papernose. 246 00:19:15,420 --> 00:19:16,780 Links are both there. 247 00:19:16,780 --> 00:19:22,660 The idea is basically you're using gradients produced by the model to find the most sensitive input features. 248 00:19:22,660 --> 00:19:24,900 So you're going to have individual pixels within the face tile. 249 00:19:24,900 --> 00:19:31,940 And then you're going to figure out how I can modify those pixels in a way that it will drive the model towards a poor classification. 250 00:19:32,340 --> 00:19:35,340 So I did a really lazy implementation of this. 251 00:19:35,340 --> 00:19:38,840 I basically just treated the perturbation as a PyTorch variable. 252 00:19:38,840 --> 00:19:41,040 I made up an L1, L2 penalty. 253 00:19:41,040 --> 00:19:42,740 I sort of set a prediction gap. 254 00:19:42,740 --> 00:19:50,240 So I said evade it by this much, but no more so that it doesn't go off and find the most bizarre facial deformation it can do. 255 00:19:50,240 --> 00:19:52,960 And then I just back-propped my way to glory. 256 00:19:53,260 --> 00:19:58,840 So, you know, use your built-in optimization toolkit within using a built-in optimizer within PyTorch. 257 00:19:59,680 --> 00:20:05,660 So if you do a gradient-based white box attack on only the face chip, you end up with these results. 258 00:20:05,700 --> 00:20:08,240 So walking you through this, it's kind of busy. 259 00:20:08,240 --> 00:20:12,760 In the upper left is the perturbed version and the original version of my face. 260 00:20:12,760 --> 00:20:19,340 So if you stare at it there, if you look at it really closely, you can see some minor differences between the two. 261 00:20:19,340 --> 00:20:27,020 But if I only showed you the one on the left, the perturbed one, you know, you'd probably say, yeah, that's actually a pretty clear, pretty clean photo of your face. 262 00:20:27,500 --> 00:20:35,660 Below it, the three panels below it are the red, blue, and green channels showing what the white box attack actually modified, which pixels and which channels. 263 00:20:35,840 --> 00:20:43,120 And then on the right-hand half, the test image is the one that is sort of, hey, can we identify this person? 264 00:20:43,120 --> 00:20:51,780 And then the next three photos, left to right, top to bottom, are the images in the registration set and the scores. 265 00:20:51,780 --> 00:20:56,640 So in this case, it said, yeah, I definitely look like Alvaro Nobola. 266 00:20:56,640 --> 00:21:00,660 I've got a sort of a similarity score of 0.65. 267 00:21:00,760 --> 00:21:10,060 The second highest similarity score was to my own face with glasses instead of without glasses and a similar similarity score of 0.45, right? 268 00:21:10,060 --> 00:21:14,760 So basically the short version of this is the white box attack worked. 269 00:21:14,760 --> 00:21:22,780 I was able to modify that specific image, those specific pixels, to actually give me an effective evasion. 270 00:21:23,920 --> 00:21:26,220 So outline of a black box attack. 271 00:21:26,220 --> 00:21:27,620 You can try proxy models. 272 00:21:27,620 --> 00:21:31,640 This essentially means you feed a whole bunch of data to the model that you're trying to attack. 273 00:21:31,640 --> 00:21:35,460 You get the outputs from that and you train a model to reproduce it. 274 00:21:35,560 --> 00:21:43,260 For reasons that I'll talk about in a few minutes, I'm skeptical that these will work terribly well against facial recognition systems. 275 00:21:43,260 --> 00:21:46,440 But if somebody knows differently, I welcome your input on that front. 276 00:21:49,220 --> 00:21:54,420 So in a lot of cases, we might not know which data we need to train which proxy model, right? 277 00:21:54,420 --> 00:22:00,440 We've got two models in that pipeline that we're trying to match up and it might not be obvious how to do it. 278 00:22:00,720 --> 00:22:06,320 So black box optimization, I just use a genetic algorithm because everyone loves a good genetic algorithm. 279 00:22:06,540 --> 00:22:10,360 I treated the perturbation as an Numpy array and then I GA'd my way to glory, right? 280 00:22:10,360 --> 00:22:15,700 So if you're interested and you care about it, I use the mu plus one where basically I just permute a single... 281 00:22:15,700 --> 00:22:21,920 I make a new population number each time, score it and it kicks out the worst one if it beats the worst member of the population. 282 00:22:23,000 --> 00:22:26,060 So again, same results, same ordering of things. 283 00:22:26,060 --> 00:22:29,580 The main difference here, as you can see, the perturbation is in fact a little bit noisier. 284 00:22:29,580 --> 00:22:30,920 It still looks pretty good, right? 285 00:22:31,200 --> 00:22:32,640 But it's not perfect. 286 00:22:32,700 --> 00:22:37,760 And you can see the channel differences down beneath have been impacted much more severely. 287 00:22:38,060 --> 00:22:42,340 These are all on the same scale as the previous image. 288 00:22:42,340 --> 00:22:45,200 But again, it actually has successfully managed to evade. 289 00:22:45,200 --> 00:22:52,060 So against the face chips only, white box and black box attacks are pretty direct, pretty straightforward to do. 290 00:22:53,580 --> 00:22:58,820 If you do a genetic algorithm, the results are definitely much more of a mixed bag. 291 00:22:59,120 --> 00:23:00,880 So this is end to end. 292 00:23:00,880 --> 00:23:09,940 And instead of doing just the face chip and running it just through the embedding, I take the full photo, I run it through the entire system and I look at the difference. 293 00:23:09,940 --> 00:23:16,620 And in this case, you can see that my implementation, at least, I don't claim that it's necessarily the greatest one out there. 294 00:23:16,620 --> 00:23:19,060 It actually does introduce a lot of noise. 295 00:23:19,060 --> 00:23:20,900 So it is recognizable, right? 296 00:23:20,900 --> 00:23:28,300 The photo on the left is still recognizably me, but it definitely clearly has been tampered with in some form. 297 00:23:28,300 --> 00:23:30,320 But again, it does successfully evade. 298 00:23:32,140 --> 00:23:37,800 So points to consider if you are launching these kinds of attacks, white box is the gold standard. 299 00:23:37,800 --> 00:23:39,660 This is the easiest way to do it. 300 00:23:39,660 --> 00:23:42,840 If you can do a white box attack, you should definitely do that. 301 00:23:43,460 --> 00:23:47,860 Black box attacks also work, but you're gonna be hammering that model API. 302 00:23:47,860 --> 00:23:56,600 And eventually someone's gonna be like, hey, this dude has uploaded over a thousand almost identical images to my API and keeps getting like different results out of them. 303 00:23:56,600 --> 00:23:58,000 What the hell's going on, right? 304 00:23:58,000 --> 00:24:00,300 So it's not exactly subtle. 305 00:24:01,760 --> 00:24:03,320 So what about transferability? 306 00:24:03,320 --> 00:24:05,660 This gets back to the proxy model attacks, right? 307 00:24:05,660 --> 00:24:11,400 So if I train a model on one system and I learned to evade one system, does it actually work on a different one? 308 00:24:12,340 --> 00:24:16,700 So I'm using this paper accessorized to a crime. 309 00:24:16,700 --> 00:24:18,260 I do not mean to pick on them. 310 00:24:18,260 --> 00:24:25,160 They did a very good job, wrote an excellent paper on using real world adversarial evasions against the VGG face model. 311 00:24:25,280 --> 00:24:32,960 Because they did such a good job and they provided such good information about how the model and attack was constructed, it made it easier for me to look at transferability. 312 00:24:32,960 --> 00:24:34,920 So this paper is excellent. 313 00:24:34,920 --> 00:24:37,700 If it seems like I'm being critical of it, I'm not. 314 00:24:37,700 --> 00:24:41,080 I'm doing something that they did not consider in their paper. 315 00:24:41,080 --> 00:24:45,840 But basically what they've got here is they've got these fancy little glasses frames. 316 00:24:45,840 --> 00:24:51,240 And you can see that basically the model does not identify the correct person. 317 00:24:51,240 --> 00:25:00,820 And I've identified the gentleman on the top row as being Carson Daly and the woman in the bottom row as being Russell Crowe on the basis of these funky glasses frames. 318 00:25:01,400 --> 00:25:02,740 Okay, so who would win? 319 00:25:02,740 --> 00:25:07,660 Some super smart academics or me just putting shit together that I found on GitHub. 320 00:25:08,700 --> 00:25:19,940 And basically this is, again, not that what their paper did is bad or doesn't work, but that transferability is a real headache with these kinds of evasions and these models. 321 00:25:20,720 --> 00:25:22,800 Basically the short version is no. 322 00:25:23,200 --> 00:25:26,480 So I've got six panels on the left, six panels on the right. 323 00:25:26,540 --> 00:25:29,360 The upper left panel is the perturbed panel. 324 00:25:29,360 --> 00:25:31,020 So that's what the evasion put on it. 325 00:25:31,020 --> 00:25:35,000 The panel below is the target who this evasion was supposed to be attacking. 326 00:25:35,180 --> 00:25:41,300 And then I've got the top four face chips from a registered training set that I made up. 327 00:25:41,300 --> 00:25:49,260 This is me using MTCNN and SphereFace, which was a couple of slides back to actually do this evasion. 328 00:25:49,260 --> 00:25:53,240 So what they did worked really great on the VGG face model. 329 00:25:53,320 --> 00:25:58,900 What I yellowed together from pre-trained models on GitHub, it actually did not successfully evade. 330 00:25:59,500 --> 00:26:07,320 If you throw it into Amazon's recognition demo, take the same photos, again, it does not give you a successful evasion. 331 00:26:09,300 --> 00:26:13,340 Finally, I got the glasses, the goggles, they do nothing. 332 00:26:13,340 --> 00:26:17,920 I got the glasses and I printed them out myself and I tried them and it actually worked, right? 333 00:26:17,920 --> 00:26:21,000 On my kind of bad pre-trained model. 334 00:26:21,220 --> 00:26:30,780 So it reclassified me as the gentleman in the upper right of the four plot image with a very slight edge over the target image. 335 00:26:30,780 --> 00:26:35,080 But again, I put it up through Amazon's recognition demo and it did essentially nothing. 336 00:26:35,860 --> 00:26:37,180 Okay, so wrap up. 337 00:26:37,180 --> 00:26:38,000 I'm a little over time. 338 00:26:38,000 --> 00:26:38,700 I apologize. 339 00:26:38,700 --> 00:26:40,940 I do know that I'm standing between you and lunch. 340 00:26:40,940 --> 00:26:44,200 Facial recognition is not normal image classification. 341 00:26:44,960 --> 00:26:47,900 Facial classification and recognition tools are out there. 342 00:26:47,900 --> 00:26:49,060 They're publicly available. 343 00:26:49,060 --> 00:26:51,340 You have pre-trained models available on GitHub. 344 00:26:53,400 --> 00:26:58,220 These differences make a lot of these attacks harder, but there are also new potential attack surfaces. 345 00:26:58,220 --> 00:27:01,920 So again, gradient-based attacks are your gold standard. 346 00:27:01,920 --> 00:27:04,880 They're gonna be pretty hard to deploy in practice. 347 00:27:05,020 --> 00:27:08,900 Exhaustion attacks are something I don't think I've seen anyone contemplate before. 348 00:27:08,900 --> 00:27:11,820 But again, if you know of research on that front, please let me know. 349 00:27:11,820 --> 00:27:13,120 I'd love to hear about it. 350 00:27:13,120 --> 00:27:21,040 And if you can tamper directly with embeddings, so screw around with the registration step, this is probably your best bet on an attack surface, right? 351 00:27:21,060 --> 00:27:27,280 Map the wrong embedding to the wrong label and have it identify the incorrect person. 352 00:27:27,880 --> 00:27:30,360 So finally, if you want to take a screen... 353 00:27:30,360 --> 00:27:34,400 This you might actually want to take a screenshot of if you don't want to wait for me to put the slides up. 354 00:27:34,400 --> 00:27:36,720 I have a Ready to Rock pre-trained system. 355 00:27:36,720 --> 00:27:39,220 This is MTCNN and SphereFace. 356 00:27:39,220 --> 00:27:41,720 It is available on Google Colab. 357 00:27:41,720 --> 00:27:48,680 There is a preview tiny URL that you can look there so you can see that I am indeed sending you to Google Colab and not somewhere else. 358 00:27:49,800 --> 00:27:52,760 The QR code should send you to the same place. 359 00:27:53,020 --> 00:28:02,560 This should work if someone wanted to try it during lunch and come back and yell to me if the permissions on the notebook are not set right, please do so, that would be awesome. 360 00:28:02,980 --> 00:28:04,900 I've tried it myself, it seems to work. 361 00:28:05,100 --> 00:28:06,460 I may have screwed something up. 362 00:28:06,460 --> 00:28:13,120 You open the link, you do file, open in playground mode, then it'll tell you that it won't save any changes unless you save a copy to your own account. 363 00:28:13,120 --> 00:28:16,000 It will take up a few megabytes in your Google Drive account. 364 00:28:16,000 --> 00:28:19,860 So if you're up against the wall on space, maybe don't do that. 365 00:28:20,860 --> 00:28:25,540 Anyway, I am contractually obligated to make you stare at this slide for exactly three seconds. 366 00:28:25,780 --> 00:28:28,440 And I will now be happy to take any questions. 367 00:28:52,500 --> 00:28:54,060 I have seen, so I have seen more. 368 00:28:54,060 --> 00:29:06,060 So the question was, there are some, there is some work that uses IR light to essentially do real world, real time adversarial perturbations on faces to try to mess up recognition. 369 00:29:06,060 --> 00:29:08,060 I know there's a lot of proof of concepts. 370 00:29:08,060 --> 00:29:11,120 I think Naomi Wu actually did one. 371 00:29:11,120 --> 00:29:15,020 She had a hat that shined light on her face that would screw up facial recognition systems. 372 00:29:15,400 --> 00:29:16,800 That was awesome. 373 00:29:16,840 --> 00:29:19,980 So there is work in that vein that's been done. 374 00:29:20,060 --> 00:29:27,160 I did not look at it specifically for this because I was focusing, trying to focus on stuff that was a little lighter lift. 375 00:29:27,900 --> 00:29:28,680 Please. 376 00:29:29,640 --> 00:29:30,800 I'm sorry. 377 00:29:32,060 --> 00:29:33,340 What about the juggalos? 378 00:29:33,340 --> 00:29:33,680 Yes. 379 00:29:33,680 --> 00:29:39,380 So one of the things that these models do tend to look at is sort of like light and dark patches and reflections. 380 00:29:39,380 --> 00:29:45,080 So yeah, juggalo makeup does indeed evade a lot of facial recognition systems. 381 00:29:45,760 --> 00:29:47,840 I am not part of that culture. 382 00:29:47,840 --> 00:29:50,080 So I don't really know like what makes a good juggalo face. 383 00:29:50,080 --> 00:29:52,220 So I didn't want to sort of step on anyone's toes. 384 00:29:52,400 --> 00:29:54,680 But yeah, look up juggalos and facial recognition. 385 00:29:54,680 --> 00:29:55,960 You'll find some good articles. 386 00:29:55,960 --> 00:29:56,920 I'm completely serious. 387 00:29:56,920 --> 00:30:02,560 Like it's exactly the kinds of perturbations that will screw up a good facial recognition system. 388 00:30:02,560 --> 00:30:05,380 So it's worth checking out if you're into this stuff. 389 00:30:14,000 --> 00:30:16,340 I literally have no idea what they have trained on. 390 00:30:16,340 --> 00:30:19,700 I wish I did, but I don't. 391 00:30:19,900 --> 00:30:29,140 I'm sure Amazon has access to a substantial corpus of high quality, relatively unbiased training data though. 392 00:30:29,140 --> 00:30:31,440 Yeah, it would shock me if they didn't. 393 00:30:33,080 --> 00:30:36,700 You mentioned you used a genetic algorithm to make a proxy attack. 394 00:30:37,040 --> 00:30:38,960 So what does that mean exactly? 395 00:30:39,100 --> 00:30:41,300 Oh yeah, so super high level. 396 00:30:41,300 --> 00:30:43,440 The question was, what does a genetic algorithm mean? 397 00:30:43,440 --> 00:30:47,180 So a genetic algorithm is sort of a bio-inspired type thing. 398 00:30:47,180 --> 00:31:04,380 The idea is basically you have a population of solutions and then you do, you generate a new solution by combining elements from a couple of high performing solutions, maybe making a couple of random tweaks and rescoring it to see if it actually improves on anything. 399 00:31:05,160 --> 00:31:09,660 So I think, I hate to, this isn't being condescending. 400 00:31:09,660 --> 00:31:12,420 The Wikipedia page is actually really good on it. 401 00:31:12,420 --> 00:31:15,100 It's got a good description of how they work and a couple. 402 00:31:15,100 --> 00:31:24,480 So it does, I think, have a section on the mu plus one approach that I used, which is nice because the mu plus one approach actually lets you put really tight controls over your query budget. 403 00:31:39,760 --> 00:31:51,160 So the question is, can you detect whether or not a general adversarial network face is a general adversarial network face or a real live human face? 404 00:31:51,180 --> 00:31:54,700 The answer to that is yes, probably. 405 00:31:54,700 --> 00:31:57,720 I know that there's been a lot of work on detecting that sort of stuff. 406 00:31:57,720 --> 00:32:01,800 It's not something that's really in scope for this facial recognition thing. 407 00:32:01,800 --> 00:32:10,760 One thing that is promising is using those generative models to try and poison your training data, or perhaps that's the resource exhaustion attack I was mentioning before. 408 00:32:10,760 --> 00:32:20,960 If you can generate millions of faces that don't exist and get your system to register them all, then suddenly you're bogging it down with trying to sort out the real faces from the bullshit. 409 00:32:27,410 --> 00:32:32,530 The countermeasure to perturbation attacks is use an unpredictable model at this point. 410 00:32:32,730 --> 00:32:34,670 Yeah, no, it's an excellent question. 411 00:32:34,670 --> 00:32:50,390 Like being able to think of this defensively in terms of what if people are using facial recognition as like a backstop biometric, for instance, and then perturbation attacks are essentially like a way to evade this biometric identification. 412 00:32:51,010 --> 00:32:55,430 Again, I know that there is academic work that's going on in this area. 413 00:32:55,430 --> 00:33:00,090 I am less familiar with it, so I don't want to give you an answer because I'm probably going to get it wrong. 414 00:33:00,370 --> 00:33:09,110 But yeah, people have actually looked at like ways to make image classification models more robust to adversarial perturbations. 415 00:33:09,850 --> 00:33:17,390 You can probably transfer a lot of that to this setting, but I don't know offhand of work that specifically addressed that. 416 00:33:19,450 --> 00:33:26,110 So I don't think we have any talks in here, so I'm happy to stay in chat if people want to, but we are definitely over time. 417 00:33:26,110 --> 00:33:28,330 And if y'all want to grab some lunch, go for it. 418 00:33:28,510 --> 00:33:29,430 Thanks again. 419 00:33:29,450 --> 00:33:31,310 Thank you.