 Okay amazing network today So for the last two years my job is doing machine learning um and Neural networks and like deep learning are kind of machine learning which I have like zero professional experience way And as with topics where you like work with them, but have no professional experience with them You're like I'm kind of interested in how this works, but like I don't know what's going on And it seemed kind of like magical and wizardy So step zero was like I was like real confused about neural networks. I didn't know what was going on I would go to my Google photos and search for beaches and it would show me pictures of me on the beach And I would be like cars and it would show me pictures of cars, but also have Turkish men fishing and I would be like fire hydrants. I didn't have fire hydrants down But then I would search for babies and it would show me like selfies of me and I was like very confused about like what was going on So I was like and I thought that I used neural networks to do the search and these are all like untagged images, right? I would just like show me a picture of a car and it'd be like sweet here some Turkish men plus cars So the next thing that happened is instead of doing a normal thing like reading a book at some point Someone handed me this paper like literally with their hands at a bar They were like hey Here are three papers that I think you might enjoy So this is one of them. It was called explaining and harnessing adversarial examples, and I was like, okay I don't know anything about neural networks, but I guess I'll read this paper because you told me to So I did One of the things I learned is that neural networks are in fact math And which we're gonna talk a little bit about what that math is I have a math degree which made me slightly more confident that I could maybe do some of this So what the paper said was it was like look Neural networks sometimes work really well, and they'll be like you have a giant panda And then what I did was it was like sometimes you can make a picture which looks just like a giant panda But the neural network thinks is a vulture With like 99% certainty and it kind of outlines how to do this and I'm gonna outline how to do this for you today So my question was like could I actually do this myself, right? Because I was like the Googlers could do it on their Google computers But could I do it on my normal computer? And I don't even know like what a GPU is. I think I have one. I still don't know anyway So the answer to this question was yes, I could do it And I'm gonna talk to you a little bit about how that went so a neural network I was very confused about what it was, but it's a function And it's function. So this is a picture of a dog And you can see that the neural network has identified this as a Pembroke whilst 4g with probability 43% So it is something which takes dogs and gives you labels like and a probability And in fact, this is too small for you to read But it's okay is you take a dog and it gives you lots of probabilities So it's like I think it's a dog with probably this kind of dog with probability 43% I think the tennis ball with probability is 0.24% And there are all these other things in between all of these are dogs except for tennis ball anyway But like the probability that it's a dog is like quite quite high, right? So I was actually very impressed with this the first the top one is apparently wrong because that kind of dog clearly has pointy ears Anyway, I don't know the computer is better at recognizing images than me And the input of course is not actually I mean an image is not really a thing, right? But it's like an array of like RGB values So you put in some numbers and then it outcomes like dog slash very unlikely tennis ball So the next thing I did was actually so the step like 1.5 was someone was like, hey, do you want to write an article about a thing? I was like, yeah, I'm gonna write an article about this Even though I didn't know if I could do it yet, but I was like, I'll do it So I then I spent like a bunch of hours setting up some neural network software on my computer This one and being like kind of confused about what to do. There were many there was many confusions here And then the next thing I needed to do was I needed a neural network They take like apparently one bajillion hours to train and one bajillion GPUs. I don't know. I just downloaded one It was a lot easier So what I did was I searched for Google net, which was the neural network from the paper and then I click like download It was 50 megabytes that was really easy it took like 25 seconds. I fastened internet connection. This was the bomb, right? So and then I was like sweet. I have it on my computer Can I like predict things with it and I was so then I just started like downloading images from the internet and seeing like what the Neural network thought it was which was really fun, right? I took a picture of a sword and I was like, I think that's a letter opener slash paper knife and I was like reasonable Like I buy it right and it was like I was like, here's a cat. It's like that's an Egyptian cat And I was like maybe I don't know right like And then I showed a trash can it was like that's a trash can I was like you're good and then I showed a picture of the queen and It was like that's a shower cap And here we learned an important thing about neural networks and about machine learning in general Is that when you have a classifier? It's only as good as like the labels you get it Um, so this neural network is not aware of people as a concept So it was just like the queen is a shower cap, which fine Right. Um, why not? Cool. So now we were like prepared we can make predictions. We have the neural network I send up the soft software. I use like Docker. I was like, I'm a wizard And then but I also need to go through this step intermediate where I was like really confused about neural networks I'm like what it is, right? And I kind of read the paper and I was like this made sense when I read it But now I'm actually when I'm actually trying to implement it. I have like a significantly higher degree of confusion So when you talk about some math for a second and like what I was confused about so This is a graph where you imagine you have some images and for each image It's like there's this amount like how much is it like a panda, right? Like the probability that the neural network thinks it's panda which goes between zero and one everywhere So for our panda that was like a hundred percent and then for the dog That was probably presumably like something like zero percent, right? And so we have our image on this curve somewhere, right? And our image is very good likely to be a panda according to the neural network But then what we want to do is we want to move it down, right? So it's like less panda And so I mentioned about So and we want to figure out like which direction to take it right because there are a lot of different directions You could take your image So we want to like add another like little image to it like almost imperceptibly to make it less panda like and so What the way you do this? The direction you take is you take the derivative and I was like, oh, yeah, that makes sense because I took calculus like at least like three times Like I took so many calculus classes. It's the derivative. I get it. It makes sense Um, if you didn't take like four calculus classes, it's okay. That's the direction. I promise And it turns out that taking the derivative of a neural network is what people mean when they say back propagation Which I didn't know what that word meant until someone was like Julia It's like the chain rule Except for like it just like an implementation of the chain rule. It's how you take derivatives with neural networks And it's actually like I'm not gonna explain it because ten minutes But it's like super simple And in particular, it's a really basic operation. So I was like, how do I take the derivative? This is so hard and complicated and then I was like, oh, this is literally the most basic neural network operation I just need to find out like Like the method name like I don't need to do anything fancy because it's going to be like built into my neural networks package And it was So I wanted to do this. I started with something simpler than a panda at first I was like, here's a black screen and I was like, what do you think that is? And it was like well developed it probably 27% or like paper towel probability 4% and I was like, okay Let's make it more like a paper towel. Can we do that and make it look the same and we could So what I did was I took the derivative So I was like how much is like a power paper towel and then let's take the derivative so we can make it more like a paper towel That was what the derivative look looks like. I don't know what that means at all. There are many unanswered questions in this talk and Then what I did was I took like that kind of like that direction and I moved it in that direction And you can see the probability for paper towel used to be 4% and now it's 14% and 14% is pretty good But it's not like 100% which is what I wanted So what I did was instead of taking like one big step and said took lots of little steps So you can see I have this graph here where we start where paper towel starts at like zero And then I take all these little steps and then it goes all the way up to 100% And that leaves us with this is a paper towel with probability basically 100% And the really cool thing about this is if you kind of like blow up the pixels a little bit You see all these like little swirls in the pixels and I think that's because there are swirls in a paper towel But I don't really know and it's like kind of interesting, right? I think like a neural networks expert would be able to explain exactly what's going on, but that's not me So there's no problem Okay, so then we did a little bit more I think yeah, we did a little bit more and then I did a panda to a vulture I'm from a panda to a vulture. I guess that was more different So 10 steps was not enough. So I did 100 steps 100 little tiny steps and it took like a long time on my computer It took maybe like eight minutes or ten minutes Because I don't know I don't have a GPU or like a Google But but it only took ten minutes. It was fine. So I started out with zero percent panda And then the panda curve goes all the way up to one Or no, sorry, the panda curve goes from one to zero and the vulture curve goes from zero to one But then there are these other weird things in the middle where it's like gibbin or it's like Ring-tailed lemur and it also goes through ostrich Actually, like the really fascinating thing about this was I went to a conference about machine learning I mean I asked someone who like works at Google and is a like machine learning expert about this and I was like Yeah, so like I went from panda to a vulture and I went through all these like other things and he's like Yeah, yeah, you know like the panda ostrich space. I'm like, what do you mean the panda ostrich space? and I just like found it really fascinating that like people who do machine learning professionally are like so familiar with like this data set and This is like these like networks and how the images like and like what the neural network thinks that they mean But they know that pandas and ostriches are like considered similar and like maybe that's an obvious fact to them But like certainly not to me. Anyway There are like many research questions at least for me here So like we totally got our results and we were like, oh now it's a vulture and I felt better Even though I've still never trained in neural network So there's like some more stuff you could do right you could go read this paper. It's like six pages It's quite readable and very very interesting. You could like play with a neural network I have like all this code on in like docker and you can download it and run it They're like actual books that you can read if you're like a more normal person unlike me And like want to learn in a more normal order Yeah, and the other thing that I made me happy about this is the people who gave this to me Were part of the run the papers we love me to the Montreal and they kind of like really taught me that like I still don't read papers almost ever like I never read papers before and then actually Maggie Who's in the audience here at some point gave me a paper She was like Julia this paper is great and I let read it and I was like I love this paper And then they emailed me and they were like do you want to give a talk about paper you love? I'm like this literally only one paper I've read in the last two years and Maggie gave it to me last week And then I gave a talk about it and now like I occasionally read papers and people hand them to me in person And it's like really wonderful and I've read like four or five papers and I did love them. So that's cool Yeah, that's it. All the there's and more stuff about this talk at this you are out