start	end	text
0	1440	So, my name is Rich Wrang.
1440	4240	I am a director of data science at Sophos.
4240	5880	This is a joint presentation between myself
5880	8280	and Dr. Ethan Rudd, who's sitting in the back there.
8300	9680	And I'm gonna talk to you a little bit
9680	11700	about facial recognition systems.
12220	14940	So, who am I and why am I qualified to stand up here
14940	16600	and berate you about this topic?
16600	18500	I have a PhD in statistics
18500	20460	from the University of California at Santa Barbara,
20460	22440	and I've spent about the past eight years
22440	24800	working at the intersection of machine learning,
24800	26080	security, and privacy.
26740	28540	Ethan has his PhD in computer science
28540	30020	from the University of Colorado,
30020	33060	and he has a long list of accomplishments,
33060	35740	particularly in the facial recognition field.
36540	38420	This is the Sophos data science team.
38420	40700	If you like security and you like data science,
40700	42480	then maybe you should come talk to me after this.
42480	44080	We're always looking for people.
44080	45520	So, let's end up the pitch.
46440	48920	So, this talk, this is sort of the outline.
48920	51220	We're gonna go on a real crash course
51220	52640	for image classification.
52640	53880	We're gonna talk about specifically
53880	56220	how the facial recognition problem
56220	58820	differs from the standard image classification problem,
58820	60440	and how that leads into differences
60440	62840	in training and processing images.
63320	66100	Brief note about how bad the situation really is
66100	68240	as far as facial recognition and privacy.
68240	70340	We're going to do an absolute sprint
70340	72600	through some of the attacks that you can launch
72600	74800	against facial recognition systems.
74800	77100	And then I'm gonna do sort of an anecdotal look
77100	79100	at transferability of those attacks.
79100	80700	So, if you train an attack on one system
80700	82780	and you deploy it against another system,
82780	84140	what actually happens?
84140	86640	Spoiler, the results are not great.
87540	90060	So, I'm supposed to tell you three things
90060	92620	that you should remember so that when you nod off
92620	94680	and start thinking about lunch in about 10 minutes,
94680	96280	you have some takeaways.
96600	98060	If you remember nothing else,
98060	100180	facial recognition systems are different
100180	102360	from general image classifiers.
102360	104420	They're solving different kinds of problems.
104420	105860	This means the pipeline is different,
105860	107360	the models are structured differently,
107360	109820	and you have different opportunities for attacks,
109820	112140	but some existing attacks that work really well
112140	116460	against image classifier systems are not as feasible.
116760	119640	Building facial recognition systems is really easy.
119640	122000	There are off-the-shelf open-source systems you can grab
122000	123820	that are really quite good.
124000	127140	Cloud-based solutions like Amazon has one,
127140	130360	they are extremely cheap and very easy to use.
130880	133440	Reliable evasion of facial recognition,
133440	136400	particularly in the wild, is still really difficult.
136400	138460	We don't have any good solutions to it.
138460	140940	And a mask is the best solution
140940	143680	that I've been able to come up with, unfortunately.
146540	148800	So crash course in image classification.
148800	150360	This is assuming a little bit of background,
150360	151660	but hopefully not too much.
152060	153360	So image classifiers,
153360	154760	basically you give it a bunch of pictures
154760	156240	and you say, hey, what is this?
156240	157860	You get a bunch of training data.
157920	159760	So, you know, hundreds of pictures of airplanes,
159760	161660	hundreds of pictures of dogs, frogs, and horses,
162500	165900	and you use it to train a classifier.
166200	169020	The basic building block is something called a convolution.
169580	172320	It's a patch that you sort of stride over an image
172320	173900	and it learns to pick out different things
173900	177740	like edges, corners, curves, and points.
178380	180880	You stack a whole bunch of these convolutional layers
180880	183720	together with a bunch of hidden layers.
183720	185620	And then you typically put a standard
185620	188020	sort of classification network at the very end.
188020	189920	The very last layer is usually something
189920	191160	called a softmax layer.
191160	194260	And that basically just assigns a probability to each class.
194260	197160	So if I put in an image of a car and it's well-trained,
197160	199000	it might come out the other end and say,
199000	203000	I'm 99.9% certain that this is in fact an image of a car.
204460	205660	How do you train it?
205660	208280	I am going to gloriously skip over a lot of the details
208280	209440	because they don't actually matter
209440	211220	with modern deep learning frameworks.
211700	213800	Basically, you randomly sample the data,
213800	214920	you get some image,
214920	217600	you feed it through this randomly initialized network,
217600	219060	and you get a classification out.
219060	220320	When you start, that classification
220320	222280	is going to be absolutely terrible.
222280	224420	It's not going to have any idea about anything.
224520	225560	And so it's going to, you know,
225560	227280	quite happily tell you that a picture of a car
227280	229080	is equally likely to be a car,
229120	230840	a horse, a dog, a bird, et cetera.
231140	233500	That's fine because what you do is you take that mistake
234040	236620	and you basically tell it how to fix that mistake.
236620	238380	You error correct all of the weights.
238860	240580	This error correction usually takes the form
240580	242320	of something called backpropagation.
242620	244920	And you just do this until it works.
245640	249440	So this is the very 50,000 foot overview of this problem.
250420	251700	Great, so now we're going to go ahead
251700	253900	and we're just going to go do it for faces, right?
253900	254780	Easy peasy.
255460	258360	Except there is one small catch to this.
258360	259560	Actually, there's several small catches,
259560	260780	but this is the first of many catches
260780	262420	that will trip us up along the way.
263040	265720	So we really only care about faces, right?
265720	268160	So what I've got here is I've got,
268160	269780	from a facial recognition standpoint,
269780	271280	I've got some stuff that's interesting
271280	273780	for, you know, a certain narrowly construed definition
273780	275100	of interesting, at least.
275100	277260	And then I've got a bunch of stuff that's not interesting.
277260	280420	I don't really care about the context in most cases.
280420	282240	All I want is the face.
282240	285220	So step zero, we do something called a bounding box,
285280	286360	a landmark and alignment.
286360	287820	We isolate faces.
287820	289700	So we get a nice little box around them.
289700	291180	We identify key landmarks.
291180	293740	This is in many cases going to be the center of each eye,
293740	295400	the tip of the nose, the corners of the mouth.
295560	297920	And those landmarks serve as reference points
297920	299060	to a second stage,
299060	301160	which is going to tweak the image a little bit
301160	303300	so that it's in a standard orientation.
303300	307460	Think of it as sort of setting up an ID photo style tab
307460	311220	or an ID style photo, or Christ,
311220	314520	an ID photo style tile for each image.
314520	316960	So everything's nice and vertical and it's, you know, aligned
316960	318200	and you don't have any, like,
318200	320080	Boston Terrier head tilts going on.
320540	322180	There's plenty of tools to do this.
322180	323660	They're all really well-trained.
323660	325560	You can, again, dig them up online.
325560	327740	So I'm not going to go over this too much.
327740	329020	I also should note that alignment
329020	330960	is actually not needed for all models.
330960	332300	There are a lot of models that are trained
332300	334420	to handle multiple alignments.
335020	337740	Okay. So now we can get faces out.
337740	338240	That's great.
338240	339980	Now we're going to do it for faces, right?
340280	342000	We actually have a problem
342800	345500	and circled in red is the problem right here.
345500	347000	We have built into most of these
347000	349880	basic image classification models,
349880	353160	two assumptions that do not hold in facial recognition.
353320	355120	So we've got a fixed number of classes
355120	356440	that we know about ahead of time.
356580	359100	And we have what you call a closed world.
359100	361840	So no matter what input you feed to this model,
361840	363040	it's always going to tell you
363040	364840	that it's one of those outputs.
365060	369520	So if I train this recognition system on image tiles,
369520	370800	right, with, say, 10 people,
370800	373360	I can show it 1,000 different people
373360	374760	that it's never seen during training
374760	377520	and the model will still try to assign some probability
377520	380160	to just the 10 faces it was trained on.
380300	382400	This is obviously not ideal
382400	385080	because if we presented a face
385080	386540	that's not in the training set,
386540	390020	we vastly increased the likelihood of a false positive.
390020	392880	If we only care about identifying, say, two or three people
392880	394700	and we only have four or five images
394700	396240	of each of those two or three people,
396240	398700	we have nowhere near enough training data
398700	400860	to actually train a classifier, right?
400860	403000	These image-based classifiers take tens
403000	404980	or hundreds of thousands of samples
404980	407400	to really learn an effective representation.
407940	409780	So we could maybe fix that by saying,
409780	411220	hey, let's throw thousands of people in there
411220	412380	because I've got tons of faces.
412380	413320	Thank you, Facebook.
413700	415660	But then we end up with a bunch of classes
415660	416620	that we don't care about
416620	419460	and we end up with maybe some gradient issues.
420020	421900	Down the road, if we've got our 10 people
421900	423140	that we train the model to identify
423140	424760	and then we add another 10 people
424760	426380	that we wanna find later,
426380	429020	suddenly we have to retrain the model,
429020	432060	which can be really, really time-consuming and expensive
432060	433980	depending on how you do the retraining.
434880	436700	Okay, so that's not gonna work.
436700	438760	So what can we do to fix it?
439480	441780	The first idea for dealing with a large
441780	443160	or an unknown number of classes
443720	445640	is something called a matching network.
445640	447780	So you feed, instead of one face,
447780	449140	you feed two faces into it
449140	451540	and the model's only job is to say,
451540	453900	are these two faces the same person?
454180	455940	So this is great because now suddenly
455940	458240	I can feed all the faces I have into it, right?
458240	459720	I've got 10 faces of this person,
459720	461460	so I feed it the, whatever,
461460	464000	the 90 different combinations of pairs of faces.
464000	466620	And I say, make sure you classify these as the same person,
466620	467740	take all of the different faces
467740	470320	and say, make sure you classify these as different people.
470320	474260	And then when I want to actually detect certain people,
474260	477380	I get the face tiles of the people I want to identify.
477380	479260	I take the face tiles of the people
479260	480360	I'm trying to match up to it,
480360	481860	and then I just run it through and I say,
481860	483620	hey, are these people the same or different, right?
483620	486600	So I've essentially separated the data required
486600	487940	for training the model
487940	492000	from the data required to do the recognition step.
493220	494660	So good news, bad news.
494660	496140	The good news is, again,
496140	498120	it's super easy to register new faces,
498120	499400	to add them to the list of faces
499400	501260	that we want to detect down the road.
501260	502100	You just get the photo
502100	503420	and you stick it in a database somewhere
503420	505240	so that you can run it through the model later.
505240	508420	The bad news is this means you would have to run this model
508420	511540	against every single face in your registered database.
511680	513040	For deep learning models,
513040	515920	this can be apocalyptically expensive to do.
515920	519020	If you're trying to identify 1,000 different people,
519020	520880	that's 1,000 samples you've got to run through
520880	523220	for every face you're trying to identify.
523460	525020	This will not scale.
525020	526700	It works great on toy problems.
526700	529220	You definitely don't want to do it beyond that point.
529920	532120	Okay, so now we're going to do a second fix.
532340	534960	And the second fix is we're going to run the network
534960	536740	just once over each face,
536740	539420	and we're going to learn what's called an embedding.
539460	542220	So an embedding is basically just a way of taking a face tile
542220	544360	and turning it into a list of numbers,
544360	545840	the list of numbers you can think of
545840	549340	as defining a point in a really high-dimensional space.
549840	551160	The way you're going to train the network
551160	553180	is to take two faces from the same person
553180	556240	and tell the network you should make similar embeddings
556240	557380	for these two people, right?
557380	559940	These two faces should have these lists of numbers
559940	561480	that, under some distance metric,
561480	563160	are very close to each other.
563160	565520	If I give it two faces from different people,
565520	567180	it should separate them by a lot.
567180	569720	It should be able to say the distance
569720	573060	between those two vectors should be very dissimilar.
573900	576880	So visually, you might end up with something like this,
576880	579680	right, so this is a sort of a made-up
579680	581080	two-dimensional embedding.
581080	584260	I have a query face that I have circled in red there.
584260	588020	And basically, I've got clusters, I've got distances.
588580	590400	This face is closest to that cluster,
590400	593540	so I say that that face probably belongs to that person.
593760	595520	You can imagine if I had another face
595520	597340	that was way off in the middle of nowhere,
597340	599440	maybe I would say that's too far from any cluster
599440	602140	to actually be classified as my face of interest.
603540	605520	So when you have an embedding in a distance,
605520	606940	the good news is, at that point,
606940	609420	you can put aside the deep learning sledgehammer
609420	613340	and you can just use existing deterministic algorithms
613340	615380	for fast nearest neighbor detection.
615380	617560	So you get your embedding, you find nearest neighbors,
617560	619260	and you're done, you've got your match.
621380	623680	So there's an important difference on data here,
623680	626960	and this is a subtlety that I think needs to be appreciated.
626960	629820	You don't actually need to know who a person is
629820	631800	to train on their face or enroll them.
631800	633160	You just need to be able to say,
633160	635600	I've got 10 photos of one person
635600	638020	and I've got another 10 photos of another person.
638020	638980	They're distinct photos.
638980	640720	I don't have to know who they are, right?
640720	642280	It's not like an image classifier
642280	643500	where I have to be able to say,
643500	645400	this is definitely a photo of a cat
645400	647260	and this is definitely a photo of a dog.
647260	649000	You just say, I've got 10 photos
649000	650920	of this one person, subject A,
650920	653160	and I've got 10 photos of this other person, subject B,
653160	654120	and so on.
655140	657980	Doing this, collecting this data is super easy.
657980	660220	I invite you all to consider all of the photos
660220	663360	you have uploaded to Facebook or Twitter or Instagram
663360	667640	or TikTok or, yes, FaceApp, if you've done that.
667780	669960	There are ways to essentially sort of say,
669960	671320	yeah, these are probably the same people.
671320	672880	You can enroll all that in your training data
672880	674680	and you're done.
675060	677540	You can put together a janky homebrew if you like.
677540	678980	People like to carry around phones
678980	680300	with their Wi-Fi turned on
680300	682700	and you can scrape their Mac address, right?
682700	684560	And say, hey, I've got this photo
684560	686180	that correlates to this Mac address.
686180	688080	That's probably the same person.
688080	691680	So collecting the data is actually super, super easy,
691680	694560	especially if you are social media.
695680	697400	So we've got a couple of different
697400	698920	kind of operational scenarios
698920	701160	or modes of operation for this.
701160	703160	In the training, we have the gallery.
703160	704380	So the gallery is gonna be the people
704380	706520	that I actually want to recognize.
706520	708820	These are the people that I want to be able to tag.
709180	710620	Then I've got the training data,
710620	712220	which can be a whole bunch of other people
712220	714660	where I don't necessarily want to identify them later.
714660	716780	I'm just gonna use them to train these models.
717080	719220	And then in probes, I've got subjects.
719300	721860	So the people I'm going to try to match to the gallery.
721860	723540	I've got known faces.
723540	726760	Known faces are ones that the model has been trained on,
726760	727980	but may not be people
727980	730060	that I actually care about identifying later.
730140	732000	And then I have unknown faces.
732000	734300	So faces that have never been seen during training
734300	736840	and they're not of people that are in the gallery.
737820	739280	This is an important point
739280	740820	that I'm not gonna have a huge amount of time
740820	741840	to go into detail,
741840	744460	but having a training set
744460	746740	that's representative of the population
746740	748240	you want to be able to identify
748240	750060	is actually really important.
750060	752040	If you have a bias in your training data,
752040	754540	like in most facial recognition systems
754540	756100	that are out there today,
756100	759960	and it's biased towards a particular ethnicity,
759960	762940	towards gender, towards a particular age group,
762940	764600	it's not gonna work very well
764600	766600	for people outside of that ethnicity,
766600	768480	gender, or age demographic.
768760	770900	So having a good representative training set
770900	772040	is actually really important
772040	773880	to make these systems work well.
774460	777140	So this actually, this plot or figure
777140	779500	comes from Ethan's paper,
779500	781840	which is given at the link down there.
782620	784640	Okay, so recap.
784660	786820	Facial, we've got two models that go into this.
786820	788440	We've got the facial detection model,
788440	789560	which is what's gonna draw the box
789560	791400	and give you the attribute markers.
791400	794020	And then you've got the face embedding model,
794020	795460	which is what's gonna take that face tile
795460	798080	and turn it into your embedding vector.
798560	801860	The important thing is this is done separately
801860	803560	from actually enrolling the faces
803560	805400	that you want to identify later.
805400	807060	So you've separated the training data out
807060	809920	from your actual detection data.
810080	811200	Faces you want to detect
811200	812740	don't actually have to be available
812740	814020	when training the models, right?
814020	815880	I can train a model on photos of people
815880	817660	who were born years before
817660	820080	anyone I want to identify popped up.
820600	823140	Then when you find people that you want to identify,
823140	824980	you enroll them by generating the embedding,
824980	827000	and then you're back to the nearest neighbor search.
828780	830700	Okay, so the short version.
830700	832340	You find crop possibly aligned faces
832340	833800	with a localization model.
833840	835440	You take those crops,
835440	836520	feed them through an embedding model
836520	837880	if you're registering them.
837880	840240	So I've got someone that I want to find later.
840300	841500	I'm gonna save that vector
841500	842880	along with the label of their name.
842880	844020	Sometimes I'll form templates
844020	846200	if I want to sort of like shrink that set again.
846200	848960	So that might be something like finding a convex hole
848960	850200	that contains all of the faces
850200	853620	or finding a median of all of the embedding vectors.
853760	855360	Then recognition is,
855360	856680	you're just gonna find the nearest embedding
856680	859400	or the nearest template to the unlabeled embedding
859400	860100	that you're trying to say,
860100	862320	hey, who is this person that I've got a photo of?
862320	864340	And is that somebody that I want to recognize?
865600	868040	Okay, a brief digression.
868040	869700	Welcome to how I love this GIF.
869700	871600	This is, I'm a sucker for dog GIFs.
872240	873380	Future is already here.
873380	874800	It's just not evenly distributed.
874800	876560	It actually is pretty evenly distributed
876560	879320	because if you wanted to build facial recognition models,
879320	881740	there are plenty of models that are available online.
882280	883540	I'll be putting these slides up later.
883540	886060	So don't like rush to get a photo of the URLs.
886060	887280	Don't worry about it.
887640	889840	Pre-trained models and model training code
889840	891320	is widely available online.
891320	893100	Data is also widely available.
893100	894840	People are starting to get a little bit twitchier
894840	895560	about this.
895560	898240	Microsoft recently pulled down its Celebe data,
898240	900500	but you still have things like labeled faces in the wild,
900500	902420	the Kaisa web face data,
902420	904420	and then facereq.org slash datasets
904420	906560	hopefully provides you with just about any dataset
906560	907480	you might want.
907480	909000	Some of these you will actually have to write
909000	910540	to the academics that did the work,
910540	912940	but usually they'll be quite happy to just send it off
912940	913740	to you.
914460	915940	If you're too lazy to do that,
915940	918800	even then Amazon's recognition works really well.
918800	920980	There was a Washington Post article that said
920980	922900	that a County in Washington state
922900	926200	was actually running its entire facial recognition system
926200	930160	off of Amazon's recognition for about seven bucks a month.
930160	932540	So it's fast, it's cheap,
933060	935680	and it works reasonably well.
937060	938640	Okay, so now that we're all depressed
938640	940020	about how widespread this is,
940020	942080	let's talk about how we can evade it, right?
942860	944780	Oh, you sweet summer children.
945340	947140	So the first thing to keep in mind is
947140	949440	when you look at the academic literature,
949760	951340	a lot of papers that say,
951340	953180	hey, we're attacking facial detection models
953180	956580	are actually attacking sort of the softmax type model
956580	959320	that's closer to an image detection model.
959320	960920	So if you're going to go out
960920	962460	and reproduce some academic research,
962460	964980	do a quick sanity check, look through the model,
964980	966080	make sure that they're using something
966080	968280	that's closer to facial recognition
968280	970180	as it gets deployed in the wild.
971280	973600	So plan your attack, right?
973600	974780	Think about your capabilities.
974780	976500	Can you attack the model training?
976500	977820	Probably not, but if you can,
977820	980440	data poisoning is a great thing to think about here.
980460	983400	If you can get a copy of the models somehow, right?
983400	988020	They stick it on an open share or an unprotected S3 bucket,
988020	989480	grab it and do an offline attack, right?
989480	991720	You can do white box attacks on that.
991720	994820	If they offer you an API or an endpoint
994820	996020	that you can query, right?
996020	997380	You can send lots of queries to it
997380	998780	and you can do what's called a black box
998780	1000260	or an online attack.
1001380	1003600	Different in facial recognition,
1003600	1007140	enrollment is sort of like a second mini training step.
1007140	1009760	If you can enroll new faces,
1009760	1012460	you can think about possibly I could poison it, right?
1012460	1015400	I enroll new embeddings with the wrong label
1015400	1016800	and that'll confuse it
1016800	1018980	when they go to do this nearest neighbor search.
1019580	1022020	You can use something like this person does not exist,
1022020	1023280	general adversarial networks
1023280	1026460	and possibly just do a resource exhaustion attack, right?
1026460	1027900	Cram it full of a whole bunch of faces
1027900	1029820	that don't really exist.
1030420	1032760	Again, there is a nearest neighbor search in this
1032760	1034360	and even with computational tricks
1034360	1035840	to speed up nearest neighbor search,
1035840	1038220	that is still a somewhat expensive process.
1038260	1039300	So potentially,
1039300	1041660	if you can actually modify the enrollment step,
1041660	1043480	you could bog it down at that point.
1043880	1046440	If you can alter data in flight
1046440	1051480	between the localization model and the embedding model,
1051480	1053720	you could actually do a face only attack, right?
1053720	1055440	Just modify only the face chip
1055440	1057420	and do some sort of attack on that
1057420	1059600	that will cause it to misidentify.
1059600	1062000	If you can read the data in between the two models,
1062000	1064460	you can try and attack the detection stage,
1064460	1065580	the bounding box.
1065620	1066380	And if you can,
1066380	1069040	all you can do is give it an image and get a score out,
1069040	1070960	then you're sort of stuck doing an end to end
1070960	1072360	black box attack.
1074120	1076200	So this is pretty straightforward.
1076200	1078640	I am already behind where I wanted to be,
1078640	1079980	so I'm not going to talk about it.
1080640	1082580	This is on easy mode.
1082580	1084660	I will talk a little bit about this.
1084720	1086120	This is surprisingly hard,
1086120	1087740	except the field is moving fast.
1087740	1088980	Life comes at you fast.
1088980	1090380	Yesterday at the talk,
1090380	1093380	there was a presentation from someone who actually did this.
1093380	1094500	They broke this.
1094600	1096660	So the reference is there.
1096660	1099140	Again, I'll post these slides online later.
1099140	1101540	They have actually broken the bounding box
1101540	1102900	and detection attack.
1102940	1105260	Pretty, it's a nice hack.
1105260	1106860	You should definitely check out this paper
1106860	1108440	if you're interested in that.
1108880	1110840	And then finally, there's the black box attack.
1110840	1114740	This is perhaps unsurprisingly a pretty tricky to do.
1117180	1119600	Realistically, you're not going to know, right?
1119600	1121880	You don't know if your photo is being taken and analyzed.
1121880	1123060	You don't have any detail
1123060	1125180	about how that system actually works.
1125200	1127720	And even if you try to dodge it or evade it,
1127720	1129600	you're not going to be able to get feedback, right?
1129600	1131460	I suppose you could go down to the casino floor
1131460	1133980	and ask them really nicely if like they recognized you
1133980	1135720	when you had the funny glasses on.
1135720	1137280	I wouldn't put good odds on them
1137280	1139040	actually letting you get away with that.
1141260	1144540	So white box attack, really high-level outline.
1144540	1146060	These are usually done with what's called
1146060	1148620	gradient-based methods for these deep learning models.
1148620	1151000	There is the fast gradient sign method.
1151360	1153080	I believe that's Goodfellows.
1153080	1153980	There's Saliency.
1153980	1155360	I believe that's Papernose.
1155420	1156780	Links are both there.
1156780	1159340	The idea is basically you're using gradients
1159340	1160340	produced by the model
1160340	1162660	to find the most sensitive input features.
1162660	1163580	So you're going to have individual pixels
1163580	1164900	within the face tile.
1164900	1165960	And then you're going to figure out
1165960	1167720	how I can modify those pixels
1167720	1170300	in a way that it will drive the model
1170300	1171940	towards a poor classification.
1172340	1175340	So I did a really lazy implementation of this.
1175340	1177600	I basically just treated the perturbation
1177600	1178840	as a PyTorch variable.
1178840	1181040	I made up an L1, L2 penalty.
1181040	1182740	I sort of set a prediction gap.
1182740	1184900	So I said evade it by this much, but no more
1184900	1187040	so that it doesn't go off
1187040	1190240	and find the most bizarre facial deformation it can do.
1190240	1192960	And then I just back-propped my way to glory.
1193260	1195860	So, you know, use your built-in optimization toolkit
1195860	1198840	within using a built-in optimizer within PyTorch.
1199680	1202480	So if you do a gradient-based white box attack
1202480	1205660	on only the face chip, you end up with these results.
1205700	1208240	So walking you through this, it's kind of busy.
1208240	1210400	In the upper left is the perturbed version
1210400	1212760	and the original version of my face.
1212760	1214580	So if you stare at it there,
1214580	1216620	if you look at it really closely,
1216620	1219340	you can see some minor differences between the two.
1219340	1221280	But if I only showed you the one on the left,
1221280	1223640	the perturbed one, you know, you'd probably say,
1223640	1225220	yeah, that's actually a pretty clear,
1225220	1227020	pretty clean photo of your face.
1227500	1229120	Below it, the three panels below it
1229120	1230660	are the red, blue, and green channels
1230660	1233900	showing what the white box attack actually modified,
1233900	1235660	which pixels and which channels.
1235840	1238360	And then on the right-hand half,
1238360	1241380	the test image is the one that is sort of,
1241380	1243120	hey, can we identify this person?
1243120	1246320	And then the next three photos, left to right,
1246320	1250260	top to bottom, are the images in the registration set
1250260	1251780	and the scores.
1251780	1253840	So in this case, it said, yeah,
1253840	1256640	I definitely look like Alvaro Nobola.
1256640	1260660	I've got a sort of a similarity score of 0.65.
1260760	1264060	The second highest similarity score was to my own face
1264060	1266220	with glasses instead of without glasses
1266220	1270060	and a similar similarity score of 0.45, right?
1270060	1272680	So basically the short version of this
1272680	1274760	is the white box attack worked.
1274760	1278080	I was able to modify that specific image,
1278080	1279260	those specific pixels,
1279260	1282780	to actually give me an effective evasion.
1283920	1286220	So outline of a black box attack.
1286220	1287620	You can try proxy models.
1287620	1289800	This essentially means you feed a whole bunch of data
1289800	1291640	to the model that you're trying to attack.
1291640	1292860	You get the outputs from that
1292860	1295460	and you train a model to reproduce it.
1295560	1297940	For reasons that I'll talk about in a few minutes,
1297940	1301140	I'm skeptical that these will work terribly well
1301140	1303260	against facial recognition systems.
1303260	1304800	But if somebody knows differently,
1304800	1306440	I welcome your input on that front.
1309220	1311140	So in a lot of cases,
1311140	1313440	we might not know which data we need to train
1313440	1314420	which proxy model, right?
1314420	1316160	We've got two models in that pipeline
1316160	1317240	that we're trying to match up
1317240	1320440	and it might not be obvious how to do it.
1320720	1322700	So black box optimization,
1322700	1323980	I just use a genetic algorithm
1323980	1326320	because everyone loves a good genetic algorithm.
1326540	1328440	I treated the perturbation as an Numpy array
1328440	1330360	and then I GA'd my way to glory, right?
1330360	1332880	So if you're interested and you care about it,
1332880	1333900	I use the mu plus one
1333900	1335700	where basically I just permute a single...
1335700	1338000	I make a new population number each time,
1338000	1339580	score it and it kicks out the worst one
1339580	1341920	if it beats the worst member of the population.
1343000	1346060	So again, same results, same ordering of things.
1346060	1347440	The main difference here, as you can see,
1347440	1349580	the perturbation is in fact a little bit noisier.
1349580	1350920	It still looks pretty good, right?
1351200	1352640	But it's not perfect.
1352700	1354940	And you can see the channel differences down beneath
1355480	1357760	have been impacted much more severely.
1358060	1362340	These are all on the same scale as the previous image.
1362340	1365200	But again, it actually has successfully managed to evade.
1365200	1367940	So against the face chips only,
1367940	1370680	white box and black box attacks are pretty direct,
1370680	1372060	pretty straightforward to do.
1373580	1375780	If you do a genetic algorithm,
1375780	1378820	the results are definitely much more of a mixed bag.
1379120	1380880	So this is end to end.
1380880	1382640	And instead of doing just the face chip
1382640	1384340	and running it just through the embedding,
1384340	1386560	I take the full photo,
1386560	1388420	I run it through the entire system
1388420	1389940	and I look at the difference.
1389940	1390800	And in this case,
1390800	1393840	you can see that my implementation, at least,
1393840	1395280	I don't claim that it's necessarily
1395280	1396620	the greatest one out there.
1396620	1399060	It actually does introduce a lot of noise.
1399060	1400900	So it is recognizable, right?
1400900	1403880	The photo on the left is still recognizably me,
1403880	1406780	but it definitely clearly has been tampered with
1406780	1408300	in some form.
1408300	1410320	But again, it does successfully evade.
1412140	1413560	So points to consider
1413560	1416020	if you are launching these kinds of attacks,
1416020	1417800	white box is the gold standard.
1417800	1419660	This is the easiest way to do it.
1419660	1421020	If you can do a white box attack,
1421020	1422840	you should definitely do that.
1423460	1425640	Black box attacks also work,
1425640	1427860	but you're gonna be hammering that model API.
1427860	1429260	And eventually someone's gonna be like,
1429260	1431660	hey, this dude has uploaded over a thousand
1431660	1434380	almost identical images to my API
1434380	1436600	and keeps getting like different results out of them.
1436600	1438000	What the hell's going on, right?
1438000	1440300	So it's not exactly subtle.
1441760	1443320	So what about transferability?
1443320	1445660	This gets back to the proxy model attacks, right?
1445660	1447700	So if I train a model on one system
1447700	1449220	and I learned to evade one system,
1449220	1451400	does it actually work on a different one?
1452340	1456700	So I'm using this paper accessorized to a crime.
1456700	1458260	I do not mean to pick on them.
1458260	1459620	They did a very good job,
1459620	1462200	wrote an excellent paper on using real world
1462200	1465160	adversarial evasions against the VGG face model.
1465280	1466800	Because they did such a good job
1466800	1468400	and they provided such good information
1468400	1470540	about how the model and attack was constructed,
1470540	1472960	it made it easier for me to look at transferability.
1472960	1474920	So this paper is excellent.
1474920	1477700	If it seems like I'm being critical of it, I'm not.
1477700	1480000	I'm doing something that they did not consider
1480000	1481080	in their paper.
1481080	1482800	But basically what they've got here
1482800	1485840	is they've got these fancy little glasses frames.
1485840	1488780	And you can see that basically the model
1488780	1491240	does not identify the correct person.
1491240	1493860	And I've identified the gentleman on the top row
1493860	1496160	as being Carson Daly and the woman in the bottom row
1496160	1497420	as being Russell Crowe
1497420	1500820	on the basis of these funky glasses frames.
1501400	1502740	Okay, so who would win?
1502740	1504240	Some super smart academics
1504240	1507660	or me just putting shit together that I found on GitHub.
1508700	1510520	And basically this is, again,
1510520	1513760	not that what their paper did is bad or doesn't work,
1513760	1517140	but that transferability is a real headache
1517140	1519940	with these kinds of evasions and these models.
1520720	1522800	Basically the short version is no.
1523200	1526480	So I've got six panels on the left, six panels on the right.
1526540	1529360	The upper left panel is the perturbed panel.
1529360	1531020	So that's what the evasion put on it.
1531020	1532460	The panel below is the target
1532460	1535000	who this evasion was supposed to be attacking.
1535180	1537440	And then I've got the top four face chips
1537440	1541300	from a registered training set that I made up.
1541300	1544160	This is me using MTCNN and SphereFace,
1544160	1545320	which was a couple of slides back
1545320	1549260	to actually do this evasion.
1549260	1553240	So what they did worked really great on the VGG face model.
1553320	1556500	What I yellowed together from pre-trained models on GitHub,
1556500	1558900	it actually did not successfully evade.
1559500	1562020	If you throw it into Amazon's recognition demo,
1562020	1563860	take the same photos, again,
1563860	1567320	it does not give you a successful evasion.
1569300	1573340	Finally, I got the glasses, the goggles, they do nothing.
1573340	1575440	I got the glasses and I printed them out myself
1575440	1577920	and I tried them and it actually worked, right?
1577920	1581000	On my kind of bad pre-trained model.
1581220	1584580	So it reclassified me as the gentleman in the upper right
1584580	1586940	of the four plot image
1587660	1590780	with a very slight edge over the target image.
1590780	1593140	But again, I put it up through Amazon's recognition demo
1593140	1595080	and it did essentially nothing.
1595860	1597180	Okay, so wrap up.
1597180	1598000	I'm a little over time.
1598000	1598700	I apologize.
1598700	1600940	I do know that I'm standing between you and lunch.
1600940	1604200	Facial recognition is not normal image classification.
1604960	1607900	Facial classification and recognition tools are out there.
1607900	1609060	They're publicly available.
1609060	1611340	You have pre-trained models available on GitHub.
1613400	1616000	These differences make a lot of these attacks harder,
1616000	1618220	but there are also new potential attack surfaces.
1618220	1621920	So again, gradient-based attacks are your gold standard.
1621920	1624880	They're gonna be pretty hard to deploy in practice.
1625020	1626220	Exhaustion attacks are something
1626220	1628900	I don't think I've seen anyone contemplate before.
1628900	1631080	But again, if you know of research on that front,
1631080	1631820	please let me know.
1631820	1633120	I'd love to hear about it.
1633120	1635620	And if you can tamper directly with embeddings,
1635620	1637840	so screw around with the registration step,
1637840	1641040	this is probably your best bet on an attack surface, right?
1641060	1644120	Map the wrong embedding to the wrong label
1644120	1647280	and have it identify the incorrect person.
1647880	1650360	So finally, if you want to take a screen...
1650360	1652400	This you might actually want to take a screenshot of
1652400	1654400	if you don't want to wait for me to put the slides up.
1654400	1656720	I have a Ready to Rock pre-trained system.
1656720	1659220	This is MTCNN and SphereFace.
1659220	1661720	It is available on Google Colab.
1661720	1664300	There is a preview tiny URL that you can look there
1664300	1666820	so you can see that I am indeed sending you to Google Colab
1666820	1668680	and not somewhere else.
1669800	1672760	The QR code should send you to the same place.
1673020	1675660	This should work if someone wanted to try it
1675660	1677880	during lunch and come back and yell to me
1677880	1680320	if the permissions on the notebook are not set right,
1680320	1682560	please do so, that would be awesome.
1682980	1684900	I've tried it myself, it seems to work.
1685100	1686460	I may have screwed something up.
1686460	1688960	You open the link, you do file, open in playground mode,
1688960	1691240	then it'll tell you that it won't save any changes
1691240	1693120	unless you save a copy to your own account.
1693120	1696000	It will take up a few megabytes in your Google Drive account.
1696000	1698360	So if you're up against the wall on space,
1698360	1699860	maybe don't do that.
1700860	1702660	Anyway, I am contractually obligated
1702660	1705540	to make you stare at this slide for exactly three seconds.
1705780	1708440	And I will now be happy to take any questions.
1732500	1734060	I have seen, so I have seen more.
1734060	1736540	So the question was, there are some,
1736540	1738860	there is some work that uses IR light
1738860	1741380	to essentially do real world,
1741380	1743440	real time adversarial perturbations on faces
1743440	1746060	to try to mess up recognition.
1746060	1748060	I know there's a lot of proof of concepts.
1748060	1751120	I think Naomi Wu actually did one.
1751120	1752980	She had a hat that shined light on her face
1752980	1755020	that would screw up facial recognition systems.
1755400	1756800	That was awesome.
1756840	1759980	So there is work in that vein that's been done.
1760060	1762520	I did not look at it specifically for this
1762520	1763840	because I was focusing,
1763840	1767160	trying to focus on stuff that was a little lighter lift.
1767900	1768680	Please.
1769640	1770800	I'm sorry.
1772060	1773340	What about the juggalos?
1773340	1773680	Yes.
1773680	1776480	So one of the things that these models do tend to look at
1776480	1779380	is sort of like light and dark patches and reflections.
1779380	1782280	So yeah, juggalo makeup does indeed evade
1782460	1785080	a lot of facial recognition systems.
1785760	1787840	I am not part of that culture.
1787840	1790080	So I don't really know like what makes a good juggalo face.
1790080	1792220	So I didn't want to sort of step on anyone's toes.
1792400	1794680	But yeah, look up juggalos and facial recognition.
1794680	1795960	You'll find some good articles.
1795960	1796920	I'm completely serious.
1796920	1799540	Like it's exactly the kinds of perturbations
1799540	1802560	that will screw up a good facial recognition system.
1802560	1805380	So it's worth checking out if you're into this stuff.
1814000	1816340	I literally have no idea what they have trained on.
1816340	1819700	I wish I did, but I don't.
1819900	1824120	I'm sure Amazon has access to a substantial corpus
1824120	1829140	of high quality, relatively unbiased training data though.
1829140	1831440	Yeah, it would shock me if they didn't.
1833080	1835120	You mentioned you used a genetic algorithm
1835120	1836700	to make a proxy attack.
1837040	1838960	So what does that mean exactly?
1839100	1841300	Oh yeah, so super high level.
1841300	1843440	The question was, what does a genetic algorithm mean?
1843440	1846040	So a genetic algorithm is sort of a bio-inspired
1846040	1847180	type thing.
1847180	1850540	The idea is basically you have a population of solutions
1851060	1854400	and then you do, you generate a new solution
1854400	1856960	by combining elements from a couple
1856960	1858500	of high performing solutions,
1858500	1860360	maybe making a couple of random tweaks
1860360	1864380	and rescoring it to see if it actually improves on anything.
1865160	1869660	So I think, I hate to, this isn't being condescending.
1869660	1872420	The Wikipedia page is actually really good on it.
1872420	1874200	It's got a good description of how they work
1874200	1875100	and a couple.
1875100	1876680	So it does, I think, have a section
1876680	1879020	on the mu plus one approach that I used,
1879520	1881400	which is nice because the mu plus one approach
1881400	1883100	actually lets you put really tight controls
1883100	1884480	over your query budget.
1899760	1904560	So the question is, can you detect whether or not
1904860	1906720	a general adversarial network face
1906720	1908680	is a general adversarial network face
1908680	1911160	or a real live human face?
1911180	1914700	The answer to that is yes, probably.
1914700	1916180	I know that there's been a lot of work
1916180	1917720	on detecting that sort of stuff.
1917720	1919600	It's not something that's really in scope
1919600	1921800	for this facial recognition thing.
1921800	1924620	One thing that is promising is using those generative models
1924620	1926820	to try and poison your training data,
1926820	1929560	or perhaps that's the resource exhaustion attack
1929560	1930760	I was mentioning before.
1930760	1933140	If you can generate millions of faces that don't exist
1933140	1935440	and get your system to register them all,
1935440	1938020	then suddenly you're bogging it down
1938020	1940960	with trying to sort out the real faces from the bullshit.
1947410	1949210	The countermeasure to perturbation attacks
1949210	1952530	is use an unpredictable model at this point.
1952730	1954670	Yeah, no, it's an excellent question.
1954670	1957710	Like being able to think of this defensively
1957710	1960510	in terms of what if people are using facial recognition
1961000	1964810	as like a backstop biometric, for instance,
1964810	1966490	and then perturbation attacks are essentially
1966490	1970390	like a way to evade this biometric identification.
1971010	1973730	Again, I know that there is academic work
1973730	1975430	that's going on in this area.
1975430	1976970	I am less familiar with it,
1976970	1977970	so I don't want to give you an answer
1977970	1980090	because I'm probably going to get it wrong.
1980370	1982530	But yeah, people have actually looked at like ways
1982530	1986410	to make image classification models
1986410	1989110	more robust to adversarial perturbations.
1989850	1993470	You can probably transfer a lot of that to this setting,
1993470	1995450	but I don't know offhand of work
1995450	1997390	that specifically addressed that.
1999450	2002090	So I don't think we have any talks in here,
2002090	2004350	so I'm happy to stay in chat if people want to,
2004350	2006110	but we are definitely over time.
2006110	2008330	And if y'all want to grab some lunch, go for it.
2008510	2009430	Thanks again.
2009450	2011310	Thank you.
