Plug & Play Generative Networks | Uber AI Labs CoFounder Jason Yosinski

Jason Yosinski explains plug-and-play generative networks, which combine a generator with a classifier to synthesize images from text. He shows how dataset biases shape what networks learn, like confusing birds with branches, and demonstrates applications in digital forensics and image inversion.
Chapters
Just because of the way the dataset was collected. Like, nobody was ever incentivized to do this. So going back to a question we had earlier in the very beginning, do biases creep into these models? Absolutely. Both the types of insidious biases that you and I would really like to avoid in the world, but also like really weird subtle biases like this— birds and tree branches. If you never teach the model that birds and trees and branches aren't the same thing, it might accidentally learn that they're kind of the same thing. Okay, so we have this like method of producing images. We start with some pixels. We try to get the network to draw better and better pictures. It didn't work at first, and then it worked a little bit better. And we'd like to sort of take this to the next level. I won't go into all the math, but basically what we did is rather than coding— hand coding a prior for these images, we now train a new network, like a painter network, to paint images. So now we have 2 networks. We have one network that we're trying to visualize here. That's what I've shown you. It has the face detector and all this. We train a second neural network that knows how to paint pictures. It's pretty cool. You train it to, like, take a latent vector, so, like, a little vector that describes which picture you'd like to paint. You put that in here. You propagate that through the network, and you get it to paint, like, to generate the pixels corresponding to that vector. These are called plug-and-play generative networks. I won't go into the math, but more or less, we plug these 2 networks together. Yeah. One network says it's trained to know what images are realistic. So the generator network says, ah, this looks realistic. And the condition network says this image looks like a cheeseburger. By combining them, we can produce hopefully an image that is a cheeseburger and also looks realistic. So here is a cheeseburger that also looks pretty realistic. We can generate other images classes too. Here's swimming trunks. And lots of other things from ImageNet, so leaf beetle, triumphal arch, toaster, and so on. Using this approach, we can generate also not a single toaster, a single cheeseburger. A tricky part of neural networks is it's not like, like that is the cheeseburger to the network. There's many cheeseburgers that would cause the network to think it's a cheeseburger. There are many types of dogs. You can think like dogs zoomed out, zoomed in, turning left, turning right. Yeah. Different colored fur, different lighting conditions, and so on. So we'd like that— we'd like this generator network to be able to draw, like, a diverse array of possible inputs. So for example, here we show we can do that pretty well. Here's all types of synthetic volcano images that cause high firing of the volcano neuron. And you can see here there's, like, night, day, there's with clouds, there's with steam, there's with just blue sky, and so on. So you're saying that the neural network is able to learn So we can get a lot of diversity. Here's different categories, so different types of birds and ants and monasteries and so on. We can do some other fun stuff with this. So here we plugged together 2 real networks, and we asked it to generate a real thing. So we've generated a cheeseburger. We can also, like, make up stuff. So in this, in this example, y is the label we're going for. So y is like cheeseburger. We can make up new labels that don't really exist and ask the network to draw those, which is kind of fun. So, for example, just here's a real category, castle. We get the network to draw us a castle. Here's a candle. So the network can draw a candle. So this is like, please fire this castle neuron, and this is please fire the candle neuron. And then we can ask it to fire both at the same time. So we can say, make us a picture that causes castle and candle both to fire. And we get something like this. So here's like a castle, like, on fire. Here's fireboat and candle, and we can generate images of like fireboats fighting fires on other fireboats. If your fireboats are on fire, you should probably just go home. It's a, it's a bad day. We can do other things. We can, we can replace the networks with other classifiers. This is kind of fun. So let's imagine the year is, the year is 2035 and you're like, the whole world is not doing so well. You're in like a trash heap and you find this hard drive with a neural network on it and you want to know like what does this neural network do? What was it trained for? You want to, like, do some digital forensics? So we did that. We grabbed the network that was trained on MIT Places, just to kind of give it away. We just downloaded the weights from someone's GitHub repo, and we tried to visualize it. So we said, OK, we're going to take this second network, and we're going to generate images that cause it to have, like, a really big firing. And we did that for a category. We just picked, like, a random output neuron, and we got this picture. So what do you think this neuron is for? Dogs. So it turns out in the original dataset of MIT Places, this was called a residential area. So the second network, this conditioned network, it knows that this residential area is this sort of thing. Our generator network is able to satisfy it by basically drawing things that it knows about. So it knows about like grass and trees and houses. And the conditioned network tells it, you better put these grass and trees and houses together in this configuration. in order for me to think this is a residential area. So we can, like, generate visualizations for new things that it's never seen before. There's other categories too. So canyon and banquet hall and so on. Banquet hall, you can see some, like, dress on the bottom as if someone's dancing. Art studio and so on. Cool. We can do some other stuff. We can replace this network with a caption network. So if you've seen caption networks, caption networks, you give it a picture. And you say, please generate— it'll— you train it to generate a caption for that picture. Like, you show it the Eiffel Tower, and it might say, this is the Eiffel Tower in the springtime, or something like that. Using this process, using this generative process, we can, like, reverse it. So we can type in a caption and get it to generate a plausible picture for that caption. So, for example, we typed in a red car parked on the side of the road. And we ask it to generate a few plausible red car images, and we get this. Not a beautiful image. On the other hand, this network was never trained to generate cars at all. We change red car to blue, and we can make the car look blue. We can try some other stuff. Here's a marina filled with boats on the water. You can see some boats and some water and some, like, specular reflections. We can also learn a lot when this process fails. So here we typed in a bird sitting on a branch, and we generated these 4 pictures. So you kind of see maybe like a nature scene, a little bit of a branch, but no bird. So why is the bird missing? Sitting? It's sitting? Maybe. Sitting is— how do you put it? Oh, oh, oh, sitting. Yeah, good question. Good question. Yeah. As opposed to like standing or something. So it's a good question. We saw this. We were really confused. We thought, you know, our model doesn't— it's not great. It can't draw birds very well. But actually, I already showed you we can, like, draw really beautiful birds. So, like, why doesn't it just put the bird on the branch? So we went a little deeper, and we thought maybe there's something else going on. So to figure this out, what we did is we took the caption model. We grabbed this image from Google Images. We put it into the caption model, and asked it what it thought the caption was. And the caption model said, a bird sitting on a tree branch with a tree. Okay. A little bit grammatically weird, but it does have 3 concepts. It has bird, tree, and branch. It gets them all in the sentence. So then my co-author, Ang, took and, like, painstakingly Photoshopped out this bird. So he, like, removed the bird from the image. We give that image to the caption model and ask the caption model what it thinks it is. And we get almost the same thing, a bird perched on a branch in a tree. So what does this teach us? There's 2 networks. The one network can definitely draw birds, but the second network, the caption network, is not asking it to draw birds because to the caption network, these 3 concepts, bird and tree and branch, are kind of like confused. They're kind of co-mingled. So why might that have happened? Okay, if you go back to the way the dataset was collected, this is trained on MSCOCO. It's a vision dataset. The way they created this dataset is they took a bunch of images, they gave them to Mechanical Turkers, they had the Turkers click on, like, interesting regions of the image. So one person maybe, like, highlights a box around this bird, and then a second person types in a caption and says, what is in that box? The person might say, a bird on a tree branch. Okay, fine. So you have bird, tree branch all being trained. But nobody ever, like, highlighted this region over here. And just said tree branch, like no bird. Because, just because of the way the dataset was collected, like nobody was ever incentivized to do this. So going back to a question we had earlier in the very beginning, do biases creep into these models? Absolutely. Both the types of insidious biases that you and I would really like to avoid in the world, but also like really weird subtle biases like this, birds and tree branches. If you never teach the model that birds and trees and branches aren't the same thing, They might accidentally learn that they're kind of the same thing. There's some other work, actually. This is not by us, but we really wanted to, like, replace this with a real human or, like, mammalian brain. This was, like, a crazy idea. Like, we could generate these bird pictures or something and then record neuron firings and, like, optimize the images to produce, like, what the brain was trying to see. But of course, I don't know anything about brains or monkeys. So we thought this is never going to happen, but actually 2 labs in the last year or so have done this with real monkeys. It's super cool. I'll just show you some of their basic results. So what they do is they generate these images using this network, and they show it to a monkey who has, like, some recording devices implanted. They record how much the neuron fires, and then they try to, like, change the image over and over again in order to make it fire more and more. And by doing this, you can change an initial image like this here in the top left that doesn't cause much firing at all. You slowly change it, you slowly tweak it. In our network, it would be slowly making it look more and more like a school bus or zebra. In the monkey network, like literally the brain of the monkey, it's slowly making it look more and more like something. And actually what they made it look like is this thing here. So they like were probing this neuron deep in some monkey's head. Yeah. And really, it was looking for another monkey. That's what it wanted to see. So I think this is super cool because I don't know anything about squishy brains. But I think it's cool that people can apply these methods to there. So I kind of want to wrap up a little bit. I think— I hope I've shown you we're kind of getting into this region. We're building things that are really amazing, totally going to change the world. But it's hard to understand them. So we need some of these methods. Probably 100 more to understand what's going on. So a lot of the work I showed you was the work not only of myself, but of many, like, really talented and amazing collaborators. If you're curious about— if you're curious about this work and you want to see more, there's a lot of code and papers on my website. You can email me if you'd ever like. And if you'd like to see these slides, they're posted online here as well. So thanks to my collaborators, and thanks to you guys for listening. Thank you.
More from Tim

He Sold His Car to Build This Startup, Then Pitched It for $1M 😳 #Startups #AI

This Startup Moves Your Crypto BEFORE Hackers Can Steal It 😳 #Crypto #Cybersecurity

15 Months Without Refrigeration?! This Startup Thinks It Can Go Global 🥥 #FoodTech #Startups







