4 ms·
Removing duplicates and very near duplicates ought to be one of the first things done to any training dataset... I wonder why this wasn't done? Too computati
by londons_explore 4y ago
Removing duplicates and very near duplicates ought to be one of the first things done to any training dataset...
I wonder why this wasn't done? Too computation heavy?
- Xelynega 4y agoIf by "computationally heavy" you're talking about the financial overhead of hiring another layer of human filters to filter duplicates out of the dataset.
- ben_w 4y agoThat's an unreasonable presumption. Deduplication, to the best of my knowledge, requires every image be compared to every other image. This is necessarily O(n^2) on n images. IIRC the training set is 2.3 billion images, if so that's 0.5 * 5.29e18 comparisons[0], which, if done by humans, would require employing literally all humans for approximately a year even if we compared 12 images per second 24/7. This has to be done computationally, not by humans. [0] half because (a = b) <=> (b = a)
- raincole 4y agoYou can roughly classify the images first (we already have very good AI model for this) and use humans as an additional layer. If two images don't get the same top-3 labels from the classifier, the chance that they're duplicates is neglectable.
- yojo 4y agoNot an expert, but I think you can just hash using an image hashing algorithm and bucket by hash. Should be linear in time/space. You can then either have a human check collisions, or just accept a false positive rate and move on. This is a decent write up of someone doing this on a (smaller) dataset. https://towardsdatascience.com/detection-of-duplicate-images-using-image-hash-functions-4d9c53f04a75 https://towardsdatascience.com/detection-of-duplicate-images...
- bombolo 4y agoThis doesn't really work if the image is a meme that has been scaled and converted millions of times.
- HelloNurse 4y agoWhy not? Many meme variants end up in the same bucket, all colliding. They are as duplicates as random rare images. A large bucket can also be inspected by humans or cut up by applying more perceptual hash function and decreasing tolerance, but it would be counterproductive cheating in this case.
- yojo 4y agoPerceptual hashes are reasonably robust to small perturbations. Scaling and converting shouldn’t be a problem, though applying filters that change the colors or blur the lines might. If it’s been changed enough that it hashes to a different value, then it might be reasonable to treat it as a different image. At some point a human is also going to say “that’s not the same.” You can always change your hashing algorithm if you find it’s missing too many dupes. Regardless, for the domain we’re talking about (deduping training data), a few false negatives should be acceptable.
- bombolo 4y agoIf it's more than a few you end up with overfitting though.
- babel_ 4y agoYou can lower the bounds significantly. Images do not require comparison to all others, and the presented approach to detecting and deduplicating images in the paper is easily adapted to be near linear (trading for storage or cleverness). Put simply, do you expect google image search to compare your image to every other possible image? No, they're going to embed it to a vector (512d in the paper) and only compare to probable matches; in the paper they start by brute forcing pairwise comparison of the vectors for the dataset, and then use clique finding to go faster when checking their generated images.
- londons_explore 4y agoAt the sort of scales of these datasets, there is no way to filter by hand. But there are lots of ways to identify near identical images algorithmically. Typically the process is to download each image, run it through a neural net to make an image embedding vector (a list of a few hundred floats). Save all those in a database. Then, for each image, if it is too close in 'embed space' to another in the database, then it is a duplicate, and should be removed. This algorithm might catch 'duplicates' that it shouldn't, like multiple people taking photos of the eiffel tower from the same public viewpoint. It might miss real duplicates such as an image failing to match with a collage containing the same image. But it's still better than not removing duplicates at all...
- babel_ 4y agoThe paper itself actually goes to show that this is insufficient (but should still be done, they went from regenerating 1 in 819 to 1 in 1063 images in a small corpus litmus test), and that diffusion is weaker to image extraction attacks than GANs (and seems to be weaker the better it gets). As to why? Lack of care and vigilance, most likely. If they're willing to spend millions of GPU hours training some of these big models, then this wouldn't be a huge cost, and has near linear complexity over the dataset that parallelises trivially. Sadly, vigilance is a finite resource, and that kind of data cleaning is often dismissed in favour of doubling down on the training and assumming it'll be big enough to handle it (however, as has been shown, that's not the case). (Edit: thanks FeepingCreature. The deduplication test used for the numbers above was a separate test in the paper for just this, not indicative of their extraction attack in general, with a small corpus and compared a diffusion model trained on both. So I liken it to a litmus test for the efficacy of deduplication.)
- FeepingCreature 4y agoNote: they went from regenerating 1 in 819 to 1 in 1063 on a relatively small corpus.
- f38zf5vdt 4y agoSD2's dataset was deduplicated prior to training. That's why the paper is about SD1, which was a prototype model completed before Stability even had VC raises.
- KRAKRISMOTT 4y agoCould be an overly enthusiastic data augmentation bug
- 6gvONxR4sf7o 4y agoThe open source community work in ML tends to be terrible at the science and rigor parts of it. You see tons of lazy “we recreated an open version of X” that fails to be remotely as well done as the peer reviewed version, even from the larger community groups.