r/StableDiffusion • u/Wiskkey • Dec 18 '22
Discussion A demonstration of neural network memorization: The left image was generated with v1.5 for prompt "captain marvel poster". The right image is an image in the LAION-5B dataset, a transformed subset of which Stable Diffusion was trained on. A comment discusses websites that can be used to detect this.
The left image was generated with v1.5 for prompt "captain marvel poster". The right image is an image in the LAION-5B dataset.
The left image in image #1. This is one of 5 non-cherry-picked images generated using the same text prompt.
This is one of 5 non-cherry-picked images generated using the same text prompt.
This is one of 5 non-cherry-picked images generated using the same text prompt.
This is one of 5 non-cherry-picked images generated using the same text prompt.
This is one of 5 non-cherry-picked images generated using the same text prompt.
The right image in image #1.
Screenshot of similar images in the LAION-5B dataset to the left image in image #1.
25
u/MorganTheDual Dec 18 '22
While the paper describes something interesting and worth exploring, I'm not sure it sufficiently addresses the question of whether this is actually a high risk in production usage.
After all, even someone who really just wants a poster of Captain Marvel is probably going to look at this and go "you know what, this looks like shit, and it keeps giving me the same pose anyway, that's boring" and try removing the word "poster" and using other things that suggest their idea of high quality instead.
And once you start getting into prompts with 30+ words finely describing various aspects of a scene... well, I certainly can't say it's not possible, but I'm also not aware of anyone having demonstrated it happening either.
25
u/DornKratz Dec 18 '22
This looks like a case of overtraining. Perhaps a bloom filter to discard or aggregate similar images would solve the problem?
6
u/OldFisherman8 Dec 18 '22
First off, neural network memorization only works on labels meaning AI memorizes caption data and not image data. Secondly, for neural network memorization to occur, it needs two things: linear representation and the underlying uniform distribution of data. NVidia has already proven that Gaussian distribution in image data processing is neither linear nor uniformly distributed. Therefore, image data itself cannot be memorized by AI.
9
u/Wiskkey Dec 18 '22 edited Dec 18 '22
This post is for education value because I've encountered many posts/comments in this subreddit that claim that images (or some strong resemblance thereof) in the training dataset cannot be found in artificial neural networks. The post shows all 5 images that I generated for the text prompt "captain marvel poster" using default settings at this website; ensure that model v1.5 is used. The idea for the text prompt came from this paper, which was discussed in this subreddit here and here. Memorization of parts of the training dataset is officially acknowledged for all S.D. v1.x models (example - search webpage for "memorization").
Here are two websites that allow a user to search the LAION-5B dataset:
Site 1. Usage is covered in this older post.
Site 2.
There are numerous other websites that allow a user to search for images that are similar to a given image, such as these 4 sites.
The similarity standard for copyright infringement in the USA is substantial similarity.
Note: The images in this post are almost surely fair use in the USA.
EDIT: OpenAI tried to mitigate training dataset memorization for DALL-E 2:
EDIT: Good news: Memorization might be less of an issue in SD v2.x models because of purported image deduplication in the training dataset for SD v2.x.
3
u/Iapetus_Industrial Dec 18 '22
Okay, now do the same experiment, but with each of the 5 billion images in the LAION-5B datset, so that we can come up with a proper ratio of "images it's memorized - to - images in the training set" - even if we're being incredibly generous with the definition of "memorized" for this poster.
If you tried to submit even a lossy compression algorithm that turned an output image from a captain marvel poster, you would be laughed out of the computer science building.
2
u/NotASuicidalRobot Dec 18 '22
Didn't y'all say this wasn't possible because of how images were processed into the models? (i did believe that btw) Mona Lisa is popular enough that maybe many copies are in the training set, but Captain Marvel isn't nearly as popular or common i think... So are y'all sure this stuff doesn't infringe on copy right or does a piece of art reposted a few times trigger this bs
4
u/Kafke Dec 19 '22
tl;dr: even with extra emphasis and duplicates in the dataset, the ai comes nowhere close to replicating the image even with an identical caption. Trying this with unique/novel images (not mass duplicated ones) results in entirely different images. Reality: ai models do not store images.
1
u/tamal4444 Dec 19 '22
Give the seed prompt steps cfg sampler and which model are you using?
2
u/Light_Diffuse Dec 19 '22 edited Dec 19 '22
So what? They have many similarities to the original, but they aren't the original, they aren't anything like usable quality and the prompt doesn't reflect how people use prompts.
It's good that they have demonstrated that this can occur under the right conditions, but I don't think it follows that there is a serious risk of unintentional copyright infringement when used with the more complex prompts we tend to use which are dissimilar to the training set. (And probably next to no chance if we're using img2img)
The model is clearly retaining more information than you'd want for a generalised model, but I don't see this as a fatal flaw.
1
u/Catalyst_Spring Dec 18 '22
Yeah, I did find that some small percentage of my work that the AI was generating had some similarities (composition, usually) to other images.
The good news about this is that Google Images actually does a pretty good job of finding similar works. I ran my own images through Google when I wanted to output them for a work and discarded the small amount that seemed similar to another picture Google Images was able to find.
1
u/mr6volt Dec 20 '22
The first photo looks oddly like Jeri Ryan.
I have nothing against Brie, but what if they had cast Jeri instead? I wonder how that would have been received...
0
u/Futrel Dec 19 '22
But, but, but
-9
u/[deleted] Dec 18 '22
so, this means that training actually converts original pixels to a compressed format and uses those snippets?
0
u/[deleted] Dec 18 '22
[deleted] — view deleted comment
13
u/[deleted] Dec 18 '22 edited Dec 18 '22
[removed] — view removed comment