We've posted a few threads discussing AI-generated face pictures such as those produced by thispersondoesnotexist(dot)com. We've since come up with a rudimentary method for detecting their presence in larger sets of images. #TuesdayThoughts

cc: @ZellaQuixote https://twitter.com/conspirator0/status/1239679687015751686
Certain features (eyes, nose, mouth) always appear in the same location on the AI face images. This makes it easy to verify that all of the images in a given set are AI-generated, but at first glance it doesn't seem to help when AI pics are a small minority of the population.
To test for the presence of AI-generated face pics in a larger set of images, we assigned each image a score based on comparing several attributes of it to the image of thousands of blended AI-generated faces.
First, we calculated a weight for each pixel in the blended image, where pixels that differ more from the average color are weighted higher. We did the same for the test images and calculated a differential between the two.
Next, we combined this with several other values to produce a final score for each test image, including:

• degree of variance of color within the image
• similarity of red:green:blue ratio to the blended image
• similarity of overall brightness to the blended image
Finally, we looked at the images with the highest scores. The results were encouraging - we were able to detect the presence of the AI-generated faces even when they comprised as little as 1% of the overall population (100 of 10000 images.)
(source code available here, provided with the caveat that we aren't going to help you make it work) https://pastebin.com/SfrcZ7Dc 
You can follow @conspirator0.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: