In short
TWIML AI Podcast Episode #656: Visual Generative AI Ecosystem Challenges with Richard Zhang
Episode Overview In this episode of The TWIML AI Podcast, host Sam Charrington interviews Richard Zhang, a Senior Research Scientist at Adobe Research. The discussion focuses on the challenges associated with visual generative AI from an ecosystem perspective, emphasizing the interplay between creators, consumers, and contributors.
Key Themes and Topics
- Richard Zhang's Background
- Early Interest in Computer Vision: Richard began his grad school journey in 2012 at Berkeley, coinciding with the release of the AlexNet paper, which significantly advanced deep learning's application in computer vision.
- Initial Projects: His early work involved image colorization and generative modeling, looking to enhance visual quality and overcome the limitations of existing loss functions.
- Ecosystem of Visual Generative AI
- Three Main Stakeholders:
- Creators: Individuals or teams that produce visual content using generative AI.
- Consumers: Users who interact with generative AI outputs and need to discern authenticity.
- Contributors: Data sources that provide the training sets for generative models.
- Perceptual Metrics and Loss Functions
- Need for Better Metrics: A significant part of Richard's research involved creating perceptual metrics that align with human judgment to improve generative model outputs.
- LPIPS (Learned Perceptual Image Patch Similarity): Richard's work led to the development of LPIPS, which is widely used to assess image quality in generative tasks, including colorization and super-resolution.
- Detection of Fake Visual Content
- Generalization of Detection Methods: Richard highlighted the importance of creating detection tools that can generalize across various generative models, ensuring they remain effective even as new techniques emerge.
- Data-Driven Approaches: The podcast discusses the application of data-driven techniques in forensic analysis to keep pace with rapidly evolving generative methods.
- Data Attribution and Concept Ablation
- Data Attribution: This project aims to trace back the influence of specific training images on generated outputs, potentially leading to compensation schemes for contributors.
- Concept Ablation: Richard's work here focuses on giving users the ability to remove specific concepts (e.g., styles, characters) from models without retraining from scratch, suggesting a method akin to network surgery that allows targeted alterations in generative AI models.
- Challenges and Future Directions
- Consumer Tools: Emphasis on developing tools that enable consumers to differentiate between real and generated content to counteract misinformation.
- Provenance and Education: The need for provenance solutions and public education on generative tools and their implications was stressed as critical to fostering trust in AI-generated content.
Key Takeaways
- Holistic View of Generative AI: Richard emphasizes the importance of understanding the visual generative AI ecosystem as a complex interplay between various stakeholders.
- Continuous Improvement: Ongoing research into perceptual metrics, detection methods, and ethical considerations is vital as the field evolves.
- Importance of Attribution and Control: Allowing contributors to manage their data and providing consumers with tools to recognize AI-generated content are essential for responsible AI use.
Conclusion The episode offers valuable insights into the evolving landscape of visual generative AI, touching upon both technical advancements and ethical considerations. Richard Zhang’s work sheds light on the complexities faced by the industry and the potential paths forward for balancing innovation with responsibility.
For more details on the episode or to explore additional topics, visit [TWIML AI Podcast](https://twimlai.com/go/656).
Written by AI. May contain mistakes. Listen to the episode to check what was said.
Transcript
Automatic transcript. May contain errors.0:10All right, everyone, welcome to another episode of the TwiML AI podcast. I am your host, Sam Charrington, and today I'm joined by Richard Zhang. Richard is Senior Research Scientist at Adobe Research. Before we get going, be sure to take a moment to hit that subscribe button wherever you're listening to today's show. Richard, welcome to the podcast. Yeah, thanks so much for having me. It's really exciting to be here. I'm excited to be speaking with you. We're going to dig deep into some of your work on image-based generative AI, and we've got some interesting things to talk about. I'd love to hear a little bit about your background and how you came to work in computer vision.
0:51So I started grad school back in 2012. That was kind of a very seminal moment we had there. You may recall the Alex Knight paper came out. That was actually my first semester there at Berkeley. That's when we started really seeing that deep networks were really working for computer vision tasks, such as image classification. That really got me excited about that field. Awesome. So it was just good timing. Yeah, really fortunate timing. Yeah. That's awesome. And what were some of the first interests you had in the field? Yeah, definitely. So after the AlexNet paper came out, you saw the immediate reaction was everyone was applying deep networks towards discriminative tasks.
1:25But on our end, we were kind of interested to see if deep networks could be used for image generation instead. And right now, obviously, they can be. But back then, that wasn't so obvious. And the reason for that is, instead of predicting like a low dimensional label for image generation, you're predicting kind of a high dimensional signal. And there's simply a lot of ways you can go wrong. And also, you know, you can, this just takes more compute to predict a high dimensional signal. And back then we were much more limited in that. So kind of one of my early experiences in a kind of generative task was that of image colorization.
1:55So for that, you may have some, you know, old family photos that are in black and white, you may want to add kind of a splash of color to liven it up. That was kind of one of the first projects that I worked on and kind of an early experience that I had. Yeah, I think a lot of us will remember seeing those first colorized photos and later on colorized videos, of course, obviously predating the term generative AI, but they were generative in nature in a sense. Yeah, definitely. So we were calling it generative modeling, but now that it works, it's generative AI and it's not a bad term. I'm happy to go with it.
2:24Awesome. You know, one of the things that we talked a little bit about before we started recording was just the way you think about and describe visual generative AI as this ecosystem that you have tried to, I guess, balance in a sense in your work, the parties and that ecosystem being the creators, the consumers, and the contributors. Can you elaborate a little bit on that idea? And what are some of the main concerns you're thinking about from each of those perspectives? Absolutely. So maybe I'll take us back to that project on colorization. So back then we were really trying to push on improving visual quality because that really was the bottleneck towards making things work.
3:06One area that I found was really challenging was having a good loss function that actually described that could kind of predict visual quality as to what a human would think looks good. So when we were trying to do colorization, we were taking kind of off-the-shelf networks, or sorry, off-the-shelf loss functions, trying to train the network and getting kind of very dull, sepia tone, blurry results. And the reason for that was we didn't have a good loss function. So one thing I was really working on after that. And by that, you mean you were not able to kind of accurately represent what a human would perceive as a good result.
3:38Is that the idea? Yes, precisely. So deep networks fundamentally are trained with some sort of loss function that have to guide the network towards either a good result or towards a better result. But if that function doesn't describe what humans think look good, it's not going to be guided towards that good result. It's going to be guided towards something else, which is kind of what was happening back then. Yeah. So that kind of inspired me to push on creating better loss functions that were more perceptually aligned with people. And thanks to some of that work, along with a lot of developments in the field, gender modeling or Gen AI really started working.
4:09And we really started seeing that, you know, it wasn't just going to be this kind of laboratory thing. We were perhaps on the cusp of something big that, you know, gender models could be underlying all sorts of different kinds of content creation tools, not just creating these kind of one-off applications, you know, which are fun, like colorization, but are kind of done piece by piece. And so I think that got me and a bunch of colleagues thinking about all this technology from a more holistic standpoint. So it wasn't just about writing papers and improving quality a bit. We were going to have all these images all over the place, which fundamentally is really cool, but we also want to make sure that the consumers of all this visual content have tools to be able to discern what's real and what's synthetic.
4:47And beyond that, a lot of these systems are, of course, based on large-scale training data. And that's just not like a static thing that comes out of thin air. Training data comes ultimately from people, right? And so we want to make sure that those data contributors are also adequately recognized for their contribution. So yeah, I think that's the way I kind of think about this ecosystem that we want kind of creators, consumers, contributors all to be happy to take part in this technology together. So let's maybe dig into the perceptual work, which is from that creator perspective. That paper, if I'm remembering, It was quite a while ago, but I'm wondering if you can kind of share broadly how it is that you think about creating better perceptual metrics and loss functions to guide generative AI.
5:31Absolutely. Yeah. So as we mentioned, deep networks have to be trained with some sort of loss function that's guiding it towards an answer. And so the way that works is the deep network is going to predict some sort of answer. And perhaps you have a ground truth that you want to compare it to. So you have a prediction and a ground truth. You need to get some sort of number as to whether that prediction was good or not. So this is just a function that takes in two images and tells you how close they are. But it turns out that this is actually a very difficult problem. It's actually an open problem in a whole bunch of fields like image processing, graphics, and even neuroscience.
6:01It's actually just really difficult to write down some sort of function in closed form that describes all the nuances of the human visual system. And so I can give you just kind of a very simple loss function, which is just L2 or Euclidean distance. You just compare the two results pixel by pixel, and you sum all the differences across the whole image, and then you get some sort of number out. If the two images are exactly the same, you're going to get zero. So that's at least a good property to have. But it turns out this doesn't really describe the human perceptual system well. And I can just give you a simple example.
6:26If you have an image that's just like a vertical edge here, and if you were to just move that vertical edge over by one pixel, you and I, looking at those two images, wouldn't even see a difference. But to L2, that's a huge difference. It's a huge lot, yeah. Yeah, it's zero in one image, it's one in the other, and vice versa, right? And so because of that, if you use L2 and there's a whole bunch of different possible outputs, it's going to really just hedge its bets and average over all these possible results. And we've seen this effect in a whole bunch of different problems. So we wanted kind of a loss function that could correspond better to human perception and really drive you towards a mode.
6:57So I can go a bit into how we went about doing that. Fundamentally, we kind of realized that just trying to describe the human visual system in math is really difficult. So instead, we took a data-driven approach. So what that means is I coded up a whole bunch of different types of distortions. For example, you can take an image and you can like blur it, you can shift it to the left, to the right, up or down, you can warp it, you can change the saturation, the contrast, you know, different photometric changes, you can add different checkerboard, different artifacts like checkerboard patterns. So I had like a big set of distortions.
7:25And then what I did was I took a patch and I distorted it in two different ways, let's say A and B. And then I asked people like on the internet, or I could ask you, does image A look more like the reference? Or does image B look more like the reference? And they would either choose A or B. And that gives you some sort of a signal towards perceptual similarity. And what that means is if they chose A, a good loss function would put image A and the reference closer together than image B and the reference, right? And so by collecting this kind of data set, we actually got like half a million judgments, I think.
7:54We could then evaluate how different embeddings agree with humans. And on top of that, we could also even improve those embeddings. So for example, you could take AlexNet or VGG, and you can select which channels are more quote unquote perceptual. And so that's how we end up getting a better loss function. So that's called the Learn Perceptual Image Patch Simulary Metric, which is a bit of a mouthful. So I think it's just known as LPIPs. And so that's used quite often in evaluating different results, like in colorization, of course, and super resolution, view synthesis, compression. Basically, anytime you're trying to reconstruct a signal, this is something that's kind of serving as a tool for people to use.
8:29Got it. And when you looked at AlexNet and VGG and identified the channels that were perceptual, is that a function of the architecture or is it specific on a trained model of that architecture, kind of specific to the data? Yeah, that's a great question. So when I was doing this work, actually, people were using VGG, trained on ImageNet. In the literature, that was called a perceptual loss. One thing we were kind of not satisfied with was people were calling it a perceptual loss, but no one had really done the experimental validation to actually, you know, validate that it is something that corresponds with human perception.
9:03So that's part of what motivated our study and as to kind of evaluating VGG or AlexNet or ResNet and all these things. One thing we found that was interesting was that it was a more of a function of the architecture than you may have imagined. And it was actually backwards from what you may have assumed. So the name of the game was you stack as many layers as possible. Like AlexNet is seven layers, VGG is 16 layers. So it does need to be deep, right? Yeah, they need to be deep. ResNet is 50 to 100. And computer vision performance just gets better and better with more layers. But it turns out the correlation with human perception actually goes down, like it goes up, up to AlexNet and hits a maximum and then goes down.
9:38And that was kind of unexpected. And I think the hand wavy kind of explanation is AlexNet is like seven layers, the human brain is seven layers ish. I mean, there's some feedback and stuff, but seven layer ish. And so by having that kind of kind of correspondence, maybe that's the reason why Alex ended up correlating the best. So that was kind of an unexpected result that we had upon. Interesting. And how does that reconcile with the fact that we went much deeper with these networks? Is it just like a point of diminishing returns after seven or are those additional layers just doing other things or?
10:07Yeah, it's not clear why. I've also seen results from neuroscience from Jim DiCarlo's lab at MIT looking at correlating deep network responses to neural responses in monkeys. And they kind of solve the same sort of thing where it goes up to a certain point and then goes down. And part of that might be just because the really deep networks for the kind of narrow tasks that they're trained on are perhaps just superhuman. Like a ResNet 150 is probably better at doing ImageNet classification than I am, right? So at that point, maybe that's why you actually start seeing the correlation go down. Okay.
10:37And just to be clear, what is going up and going down? Are we talking about the overall performance of a model on a given data set for a given task? Like it sounds like you're saying that basically seven layer networks are optimal. And that's what I'm finding hard to believe applies like super broadly for perceptual tasks. Am I interpreting your assertion too broadly? Yeah. So maybe I'll map out what we're correlating. So think on the y-axis, the agreement with the perceptual data that I collected in the Alpips data set on the x-axis is computer vision performance, right? So if computer vision performance were perfectly correlated with perception, it would just go up and up.
11:14But what you see is that it kind of goes up and then it goes down. So there does seem to be a point where by getting better computer vision performance, you actually reduce performance on corresponds to perceptual similarity. Got it. So within a certain range, computer vision kind of follows along with kind of tracking this perceptual metric that you outlined. Beyond that, you're not tracking the percept, you're going the opposite direction from a perceptual perspective, but maybe you're still kind of just brute forcing performance through these deeper and deeper networks. Maybe you're memorizing more.
11:46Other things are happening, but it's not because perception is getting better. Yes, exactly. Definitely the deeper representations are better. They're more useful for a whole bunch of tasks. It's just part of the correspondence to human perception, using it as a loss function, it starts kind of getting worse at a certain point. Got it. Oh, that's super interesting. That's really interesting. And so is this method, LPIPs, is it used in kind of some of the contemporary gen AI things that we've all been hearing about recently, stable diffusion and the like? Yeah. So there's a little bit of irony in the story where like I was working a lot on these loss functions because, you know, L2 wasn't adequate, but now everything is based on diffusion models for now.
12:24And you may know diffusion models, they're just trained with L2, right? And so somehow in that setting, L2 doesn't end up blurring things. And the reason for that is diffusion models will take a big, very difficult problem of going from noise to image, chop it up into like like a thousand little steps. And by doing that, L2 is actually perfectly happy towards driving towards modes rather than towards some blurry mean. So it turns out that, yeah, LPips isn't used in the central part of diffusion, but actually it's still very practically useful in a lot of systems. So for example, you asked about stable diffusion, that's based on LDMs or latent diffusion models, which is an academic paper, I think from Munich.
12:57And so a part of LDMs is this compression step. So the idea is that you could run diffusion on raw pixels and that works really well, but that's going to be really expensive because pixels are, you know, very high dimension. Instead, you could go from that high dimensional space to a compressed code and do the diffusion on that compressed code. Now, the way you train, you know, this compressor is you need an encoder and a decoder that reconstructs the original image. And the way you judge whether that reconstruction is good or not, in part, is without PIPs. Perceptual models. Yeah, exactly. And there's also other stuff on top of that, like GANs and KL Divergence from VAEs.
13:29Basically, kind of a list of generative technologies are all kind of actually used in LDMs on top of the diffusion core. Awesome. So we've talked about the colorization task. We've talked about in stable diffusion image generation tasks. Are there other areas that you've worked on, things like super resolution come to mind or other aspects of visual generative AI or visual generative computer vision? And again, kind of staying with this creator realm before we jump over to the consumer side of things. Yeah, definitely. So one thing I'm interested in is really adding a lot of controllability to generative AI systems.
14:05Yeah, so that's something we're working on. So the reason for that is if you look at GANs, you know, you're either going from a random noise vector to an image, or if you look at these text image models, right, they're going from a short sentence into generating a whole image. But really, that's not giving a creator all the control that they may want to have. So you've probably heard the adage, like a picture is worth 1000 words, but in DALI 2, you only get 76 tokens. That's why you're limited. So what am I supposed to do with all that other detail that I need to add in? So we're really thinking about what types of control can we actually add to the system.
14:39So text image is really great for getting you started and for getting kind of a nice foundational model that knows a lot about how natural images and different art styles look like. But we also want to add in control into that process for creators. And it sounds like you see that control coming from not expanding the number of tokens available, but via other like out of band types of things. What are some examples of like specific examples of the types of controls that you're envisioning or have worked on? Yeah. So even if we gave you a thousand words, you probably don't want to write an essay for every single possible thing in the image.
15:15And there may be some things that I would want to standardize without having to write about like every image that this model produces is in the theme of starry night or something like that. Yeah, exactly. It's just text in some sense for a lot of operations is going to be very clunky, right? And so what we want is just a whole spectrum of, I think, different ways or kind of think about them as hooks for interacting with a system. So if an expert user wants to go in there and start like adjusting the gray level of specific pixels, they should be free to do that. And there should be also kind of more mid-level things, of course.
15:47Like if you were to create an image on pen and paper, you would start sketching, right? That's kind of a very natural way of making an image. And so that could potentially be an input modality that we can add. There's also different things like style transfer, right? You may have a repository of little paintings that you made that you want to apply towards making a new image. And there's also adding kind of personal objects, like maybe I want to take my face or take my, like a pet or my toy or my car, something like that, and add that in. So you can think of just a whole lot of different types of controls that could be added.
16:16I think one key thing is having enough controls and preserving kind of the state of the results so that people can iteratively interact with the system. So it's kind of a back and forth. It's not you type in some text, you wait five seconds, you may or may not get what you want. And then you have to adjust the text and it gives you some other complete random image, right? We want to have some sort of permanent state that allows you to iterate with it kind of meaningfully. And how far along are you in this direction? Have you Have you published on it? And what kind of early results are you seeing in this controllability domain?
16:47Yeah. So one area that we worked on was that of customizing models. And so there are concurrent works out there, such as Textual Inversion and Dreambooth, which are all very pretty well known. Our method was called custom diffusion. So that's kind of one method of interacting with systems where you can take a small collection of your own photos of a certain object or style and basically add that into the network. It's like doing a little bit of network surgery. So you can add some of your content in there. content in there. You don't have to just stick with the pre-trade model. So that's one aspect we're playing with.
17:15We're creating kind of more interactive systems as well. It's not out yet. So hopefully for a CBR or SIGGRAPH or something. Yeah. So we're working hard on this. Okay. So watch the space. Yes. Awesome. How about on the consumer side? You talked a little bit about who that consumer represents in the ecosystem, but what are the things that they care about most that are driving your research? Yeah, fundamentally, it's really great that all these Gen AI systems are working now, and we have a lot of that type of visual content. We do want to make sure that if there's going to be some percentage of malicious actors, that we have some sort of solution that scales up to societal level for dealing with that in some way.
17:52And so we kind of wish we want people to have tools for being able to tell what's real and what's fake. And fortunately, there's actually a lot of areas to, I think, contribute to in this space, because I think ultimately we really need a multi-pronged solution for dealing with this. So I think about kind of three different areas. So there's provenance, there's detection, and then there's just plain education of the public as to what tools are out there. I'm working more on detection. I can describe provenance a little bit. I'm not an expert, but I can kind of describe the high level idea, which is that if we had some sort of kind of open standard for recording metadata as to the kind of origin as the origin and subsequent edits to every piece of visual asset, that would be really useful, right?
18:30That would be kind of like getting a nutrition label for a piece of visual content. And the nice thing about this is if this were to become very standardized, even if you got a visual asset that didn't have that metadata on, that itself would be suspicious, right? So that would also be some sort of signal. In what ways is that an AI challenge as opposed to a software engineering slash standardization challenge? Yeah, I think it's more the latter, which is why, because I'm not an expert in that field, I'm not working on it as much, but I think actually that's hugely important. So I'm glad there's really smart people working on it.
19:04I'll point you to the Content Authenticity Initiative or CAI. Got it. It was like a coalition that was established, I think three or four years ago. It has like a huge number of member organizations now. It's looking at kind of creating an open standard so that this type of metadata can proliferate out in the ecosystem. I think that would be really great. So it's the CAI. Yeah. Yeah. Sounds like the big challenges there are getting folks to agree on the format and what kind of information and then some kind of set of cryptography standards to make sure that the information can't be tampered with once it's injected into the image or applied.
19:36Yeah, absolutely. There needs to be probably some standardization. Just like be bad if all our wall plugs in every state were different. Same kind of thing. There needs to be a little bit of coordination here. Yeah, absolutely. And so there was the provenance and then there's detection. This is certainly an issue that predates generative AI. Like Photoshop became a verb a long time ago for manipulating original images. Have you been working on it predating? Or maybe the question that I'm trying to get at is, do you see generative AI as a kind of a concept that has flourished over the past several years providing unique challenges and or tools in the context of detection?
20:17Or is it kind of the same work that's been going on around detection for a long time? Yeah, that's a great question. I think we need detection tools for all different types of content creation tools. And there is some fundamental difference. So we had a project kind of on detecting if an image was Photoshopped and more specifically, a specific button in Photoshop called FaceWare Liquify, which can kind of warp a person's face, which is kind of it's not really Gen AI based, right? It's just kind of some simple warping for that type of tool, because it's kind of static, like that button is not going to change from today to tomorrow.
20:48It's going to be the exact same. I could create a very specialized detector just for that. But the difference with Gen AI systems is that today we have this type of method. Tomorrow you check archive and something new has come out. And of course, tomorrow's archive is not completely different than what was written today, but it's going to contain some differences. So really, we're always trying to catch the next method that's coming in the future. So it's just going to be a bit more fast moving in nature versus the kind of more traditional. And, you know, thinking about some of the technical approaches that may come into play, historically, you could do simple things like edge detection, trying to find kind of imperceptible edges that may exist in a photograph that may indicate that it was manipulated with and wasn't an original image.
21:33Whereas if you're generating the original image from scratch, that's a different paradigm for detection. How do you think about the way to approach detection when you're generating photorealistic images in their entirety with an AI? Yeah, so one thing we've been looking at is taking a very data-driven approach. Because some of that motivation is that AI-based systems have democratized content creation so much. But it was really kind of this asymmetric situation where anybody like me or some kid in their basement could create deepfakes. but thanks to like the advancements in AI, but those advancements hadn't been applied to forensics yet.
22:05Really for forensics, you almost had to be like CIA or a major research lab to kind of have that expertise. So we want to see if we can actually use data-driven techniques for helping with forensics as well. So we did this kind of pilot study three years ago. Like I mentioned, generalization is extremely important. We want to see if to train a detector on one type of method, will it actually work on tomorrow's? Wanted to do some sort of study with that. So we collected like 12 different types of generative methods. So back then they were mostly GAN based, but some of them were like outpips or perceptual loss based as well.
Read the full transcript
22:33And we trained a real versus fake detector on one method, which was progressive GAN. And then we wanted to see if it could actually generalize to other methods that, you know, hadn't been released yet at the time of program, at least. Okay, so there's two ways this could have gone. So one way is it could have totally failed, you get chance performance. And that's possible because domain adaptation is like a really hard field in machine learning. If there's any sort of distribution shift, a lot of time machine learning algorithm will just fail. So that's one thing that could have happened. Another thing that could happen is that maybe it could actually generalize because while the methods are going to be different, they're going to have some kind of underlying similarities.
23:08Like they're going to share similarities in architecture or data or optimizer or something, right? They're not just completely different. And so what we found is that if you do the naive thing, it's indeed not going to generalize well. But if you add heavy amounts of data augmentation, so if you do a lot of JPEG compression at random levels, and if you do blurring also at random levels, that actually forces the classifier to not only rely on one small specific set of queues and just drive performance up to 100%, it forces it to really hedge its bets and look at queues across all different scales.
23:42And that actually ends up generalizing to other methods a lot better. So that was kind of a finding we had. Is that data augmentation at training time, meaning you're applying all these transformations to your training data set? Or is it at inference time, you're essentially creating features out of the images by transforming them with compression and other things? Yeah, it's done at training time. So you do random JPEGs and random blurs at training time. But one experiment we actually read was we did it at test time. So just to see how performance would degrade. And it turns out, so you could think of a plot like on the y-axis is performance, on the x-axis is how aggressively you blur the image.
24:20And if you train on proGAN and you test on proGAN, it starts at 100%, right? If you don't corrupt the image at all. And we thought it would start degrading down if you blurred it a lot. But actually, it stays right at 100%, even if you blur it really aggressively. That's kind of surprising, right? The implication is that there's some inherent signal of having been AI generated that persists beyond kind of, well, persists beyond this blurring or JPEG compression in this case. Exactly, yeah. Like one hypothesis that you may have for detecting deep fakes is it's probably just like little high-frequency signals, like just that last little bit that the network just can't get right, can't predict.
25:00And of course, if that were the case, if you blurt it out on both the real and fake images, performance should just go down to chance really fast. But because it doesn't, it stays at 100%, that actually means that there's, it's not just that last little bit, there's actually meaningful cues at all different scales in the image. And those are the cues that actually generalize to other methods as well that are kind of more shared across methods. Interesting. When you initially said that you started down this path of a data-driven approach, that fundamentally that says to me, like cat and mouse game, like you can't collect the data for the methods that haven't been produced yet.
25:34So you're always behind if, at least the thinking was you'd always be behind if you're producing, if your methods are data-driven. But here you're saying actually no, because there's some inherent quality of these AI generated images that perhaps isn't. You said that you tested on methods that haven't been, that weren't produced at the time that you did the training, right? So it wasn't necessarily conjecture. It was, you tested it on a particular out of distribution generation method. Exactly. Yeah. So we kind of simulated history. So we collected methods and then we trained on the first and then we tested on the other ones, which of course at the time we did the experiment, the methods were out.
26:18Okay. But yeah. Got it. Interesting. And how out of distribution was the newer methods relative to the older methods? Was it like a newer version of a similar approach or was it a very different approach, diffusion versus GANs, that kind of thing? Like how strong is that the generalization that you saw there? Yeah. So the generalization is definitely stronger if you stay in family. So if you train on ProGAN, which was made by a group in Finland, and then you test on StyleGAN, which was their follow-up, that's going to generalize pretty well. And then test on StyleGAN 2, StyleGAN 3, that degrades a bit, but is okay.
26:53And then if you then test on diffusion models, it's not going to do as well, right? So there's definitely going to be worse generalization as time goes on. But the beauty of it is your detector is not just this static thing. So in this ICV, we had a workshop paper called Online Detection of Gen AI Images, where we actually, again, simulated history. But what we did was we trained a detector online. So we gathered like 14 different models, which are mostly diffusion-based. We sorted them in chronological order. And then we just started training detectors by adding one method in at a time and then testing on the future methods.
27:24What we see is that as you add in more and more generative methods, you start covering larger space of kind of artifacts. And by doing that, you can get a stronger detector as well. So hopefully you can keep good performance there. And it's totally true. We always hear this cat and mouse analogy. And right, we know that at the potentially at the endpoint, if generated images are absolutely perfect, like every single bit, they get every single phenomenon in the natural world modeled correctly, exactly, then indeed, there's not going to be anything you can do on the detection standpoint. But that's like a lot of things to get right.
27:56So yeah, it's a cat and mouse game. The cat can be like really, really big, like you could have like a really powerful cat, right? And at least that seems to be the state that we're at now. But that's also why I emphasize that it's not just about detection. We need kind of provenance solutions upstream, broader education for people downstream. It's really a multi-pronged thing. Has your work ventured into video as well? Yeah. So we have some internal work right now, like a research work trying to make video better. Yeah. So that's not out yet. That's definitely the next frontier, right? It's just kind of a natural thing to do.
28:24And the cool thing is you can leverage image models, right? They know about the natural world, and then you can inject a bit of video in there to get some motion. But I don't have anything public to talk about that for now. Okay, very cool. And how about on the contributor side? So that's kind of this third leg of the stool, so to speak. Well, recap the idea there and talk a little bit about some of your projects that focus on that aspect of the ecosystem. Definitely. So, well, first of all, synthesized images, they don't just appear by magic, even though it really does look like magic sometimes.
28:55Ultimately, they're based on models which are trained on data, right? So the synthesized images are going to be a reflection of the underlying trained data by necessity. So in academic papers, of course, we don't think about where that data comes from too much, right? We just kind of pull standard data sets and run benchmarks. But in real world systems, that data is going to come from people or from contributors. And so kind of one thing I've been really interested in looking at is exploring and understanding the tie between synthesized images and the underlying training. So there's kind of one thing that we're working on called data attribution.
29:27That's something we published in this ICV. The kind of setup there is that given a synthesized image, you want to identify the specific training images that were highly influential towards making that possible. So that's kind of one project. And then this is kind of important because it can potentially be used to inform a compensation scheme or kind of a recognition scheme. Where in the flow of the kind of the ecosystem, I guess, are you? Meaning, is this like you just have an image that came from some black box model or do you have access to the model? Are you sitting in and have access to the entire generation process?
30:01Like talk a little bit more about the setting in more detail, I guess. Yeah. So there are different potential settings that you mentioned, but we're in the most transparent setting that we can be. So in this case, we know exactly what's in the training set and we potentially did the training. We have access to all the information. And the reason we were in that setup is because the problem is really hard. So even in this setting, it's going to be really difficult. So we want to see if we can tackle this first before going anywhere. Yeah. Meaning, so you have some image that got popped out of some generative AI system, even though you have that without some kind of method, all you could say is that, well, it's related to these millions of images, like there's no providence from this image.
30:39So the work is to take that image and perform some analysis on it to try to determine where that image came from. Now, can you talk in more detail about the approach? Is it, you know, you can imagine some kind of like expensive correlation with the entire training data set or other things? Talk a little bit about what you're actually doing. Yeah. So this is a very difficult problem because as you mentioned, we have a training set that's maybe hundreds of millions of images or billions of images that are all munched together in this training process. And theoretically, it's like a fully observable mathematical process.
31:12You see everything that's going on, But because it's so kind of computationally heavy, it's going to be really difficult, I think, after the fact to disentangle the contribution of all the training images from each other. And so one way that sheds some sort of light into the system is by doing nearest neighbors, right? You take the synthesized image and you run nearest neighbors back to the training set. Of course, you have to choose a feature space, things like that. And that does tell you something, but it's not really a good causal analysis of the training process because it doesn't take the training process into account.
31:38I mean, there's work in this space called like influence functions that people have worked on for discriminative models. And so the kind of general framework is that you want to make some sort of counterfactual prediction. Like if I were to upweight this image or if I were to take this image out of the training set, would that destroy my synthesized image? And so if you're able to analyze that in some sort of meaningful way, then that I think is a more meaningful kind of attribution that takes the training process into account. And so the challenge in applying that kind of idea is how do you do it in a way that doesn't require you to run your training a billion times over?
32:11Exactly. And it's unfortunately not even a billion. It's like, OK, let's as a thought experiment, think about what like ground truth would be for this. You have n data points. You train two to the n models with every single data point in or out every single combination. You have like a population of these models and then you can do it, do like a population analysis of which of these models can generate a given synthesized image or not. and I based on that trace it back to the training images. So that's probably not tractable because even training one of these models is pretty time consuming, let alone to the end.
32:41So the whole game is like, how do we get any sort of tractable approximation to this at all? Is this public work? Are there, is this a published work? I should say, are there specific approaches that you can talk to, to describe broadly, you know, how you got to a tractable approximation? Definitely. So we had this work in ICV and I'll describe it as kind of an initial attempt at this problem. There's a lot of work left to be done. But our insight was that, hey, like ground truth is really hard to obtain. One way of obtaining some sort of ground truth is actually leveraging customization or, you know, the dream booth kind of thing, right?
33:11Because what that's doing is taking a pre-trained model and then tuning it towards a small collection of images, maybe of your cat, and then generating more images of your cat in different kind of conditions or poses. But if you think about it, those synthesized images are computationally influenced by that small set of exemplar images that you gave. So that kind of establishes a link between training images and synthesized images. And based on that, we can actually create a data set of these. So we took our custom diffusion method. Each custom diffusion model takes about five minutes. And so we just kept the GPUs really hot.
33:42We trained like 18 ,000 of these models and created this big data set of medium-sized data set, let's say, kind of ground truth attribution pairs of training exemplars and synthesized images. Got it. You turned it into a supervised classification problem based on these causally related images that you produce through Dreambooth. Precisely. Yeah. So you have that data, you can run contrastive learning on it, try to get a better feature that does attribution for custom diffusion or Dreambooth. But as I mentioned, this is kind of an initial step. It's not really disentangling the contribution of all the images in the training set.
34:14It's hard. Awesome. Another area that you're working on in this contributor domain is concept ablation. Can you talk a little bit about that and what it's attempting to do? Absolutely. So the kind of previous project on attribution is something that can potentially inform some sort of compensation, which could hopefully motivate people to actually opt into the system, right? If there's some kind of direct reward for doing so. So ideally, you have a lot of people opting in and want to be part of your model. Now, if they don't want to be part of your model, kind of we believe that people should have the right to opt out as well and pull their data.
34:46That's their freedom to do that. The problem right now is that if you have a pre-trained model and someone wants to remove their five images, the only way to do that is to retrain the whole darn thing without those five images. And obviously that's not a scalable thing, right? Today I'm pulling images, tomorrow you're pulling images. So we wanted some sort of way to quickly change the model to enable different concepts to be removed, but not having to retrain from scratch. So that's the kind of high level goal. Got it. And so talk a little bit about how you modeled that goal in the paper and setting an approach.
35:14Yeah, definitely. So right now we're not at the level where you can pull individual training data points. But what we did look at is removing what we'll call concepts. And concepts is kind of some sort of visual concept that could be described with a prompt. So for example, that could be the style of an artist. You know, there's like a lot of living artist styles in some of these publicly available models, which some people may not appreciate. So kind of a neighborhood in an embedding space? Well, in this case, it's just a string. Like if you say in the style of Van Gogh, we looked at just removing that and replacing it with a generic painting instead, even if you typed in the style of Van Gogh.
35:49And of course, Van Gogh is a placeholder. It could be an actual artist name. Got it. So at the beginning of the creation process, manipulating the prompts to remove concepts that are strongly tied to individual contributors. Yes. So it could be kind of a style, someone's style. It could be a copyrighted character, like a grumpy cat is actually someone's cat. They may not actually want their cat to be in, the Grumpy Cat to be in the model. Like we looked at like moving Star Wars characters, things like that. Is this a computer vision problem or an NLP problem? Yeah, so we didn't exactly manipulate the prompt.
36:23We actually wanted to remove it from the model itself. I mean, one way of doing this, you could just have like an if statement. If someone types in Van Gogh, you replace it with painting. But if your model were to be open sourced, like someone would just comment that line of code out, they would be bypassing that. So we actually wanted to remove that information from the weights in the model so that people wouldn't be able to get that image out. So actually it's trying to modify the visual parts of the model, not just the text prompt. And so how did you go about doing that? So what we did was we used the network to override itself.
36:51And so what I mean by that is, let's say we want to erase Van Gogh from the model and we want Van Gogh paintings that just look like generic paintings. So basically we want to align these two distributions. If you say painting of a building in style of Van Gogh, you want the distribution of that or just painting of a building, right? So what we can do is we can prompt the model for just a generic painting and use that as a supervisory signal for overriding the model when it's prompted with Van Gogh. So you can actually use that model to train itself. Does that mean that all of the concepts that you might want to remove need to be known a priori?
37:26Absolutely. So the user has to provide the concept they want to remove and what they want to replace it with. Oh, OK. So you were saying? Yeah. So by performing this task, that's what we want to do. We want to do the removal, but we also want to be careful. We don't want to blow out all the other types of painting styles that are in the bottle. Basically, we don't want to be destroying the pre-trained model. So it's kind of like a surgery. That's kind of what motivated the name for our method of ablation, where we want to just have a little targeted removal of just one specific part of the model, but keeping the rest kind of untouched.
37:56And you described it, I thought, as a training step, I guess, kind of forcing the network to see the equivalence of these two terms. You said one, it was kind of a supervised training process, but presumably much lower computational cost than, like, tell me how it's applied in practice. Like you've got 20 per day of these removal requests with the substitutions. Like what is the computational cost of that? Got it. So removing one concept takes about five minutes. It's pretty fast. Now, of course, if you're removing hundreds, thousands of concepts. So when we remove one concept we measured, it doesn't kind of destroy the under the kind of prior knowledge that much.
38:37But as you start scaling it up, it's going to start corrupting the pre-trained model more and more and more. And that's part of why this is still open research that we want that to scale better. But at some point, right, if you're getting like thousands of removal requests, you might as well just do the retraining from scratch. So this is kind of a fast process you could run in between retraining, which maybe you do on a larger timescale. Interesting. Well, if nothing else, it's kind Kind of a good indication of a way to think about and approach this process of enabling opt-out, which is obviously a very contemporary topic in Gen.AI.
39:09Yeah, absolutely. That's something we want to kind of make computationally feasible. Awesome. Well, Richard, thanks so much for taking the time to walk through all of the interesting research that you and your team are doing in this area. He's covered, I think, language-based Gen AI quite a bit recently for obvious reasons and have maybe neglected computer vision. And I think this was a great way to catch up on some of the interesting things and research topics on the Gen AI side of things or the visual side of things. So thanks so much for taking the time. Definitely. Thanks so much for having me.
39:44This was really great. All right, everyone, that's our show for today. To learn more about today's guest or the topics mentioned in this interview, visit twimla.ai.com. Of course, if you like what you hear on the podcast, please subscribe, rate, and review the show on your favorite podcatcher. Thanks so much for listening and catch you next time.
From the publisher
Today we’re joined by Richard Zhang, senior research scientist at Adobe Research. In our conversation with Richard, we explore the research challenges that arise when regarding visual generative AI from an ecosystem perspective, considering the disparate needs of creators, consumers, and contributors. We start with his work on perceptual metrics and the LPIPS paper, which allow us to better align human perception and computer vision and which remain used in contemporary generative AI applications such as stable diffusion, GANs, and latent diffusion. We look at his work creating detection tools for fake visual content, highlighting the importance of generalization of these detection methods to new, unseen models. Lastly, we dig into his work on data attribution and concept ablation, which aim to address the challenging open problem of allowing artists and others to manage their contributions to generative AI training data sets.
The complete show notes for this episode can be found at twimlai.com/go/656.




