This algorithm will protect us from the scourge of AI-generated cats

It's okay, we're safe... for meow.

A cat generated by an artificial intelligence from thiscatdoesnotexist. AI. Deepfake. GAN.

Artificial intelligence tends to cross a lot of boundaries. For instance, in the bright future that is 2021, we’ve got deepfakes, police use of face recognition software, everything Amazon does, these “people” made by Unreal Engine, and the most unholy of all AI creations — cats fabricated entirely by a computer.

This cat does not exist is a site that generates on-command images of cat faces conjured entirely by neural networks.

Fake cat.

Also a fake cat.

OK, this one is real.

Just kidding! It’s also fake!

Okay, so maybe computer-generated cats aren’t exactly the worst of the aforementioned AI nightmares, but that doesn’t mean we can let these covert digital furballs slip on through to our cat-urated social feeds unnoticed, right?

Luckily, someone is on the case.


In a thread posted to Twitter, @Conspirator0 detailed a system designed to analyze and detect cats that have been created using General Adversarial Networks (GANs), like the kind used to create deepfake videos.

To be clear, the cat-inspecting algorithm wasn’t actually designed because computer-generated cats are an existential threat or anything, but as an exercise in training neural networks to assess certain types of images for signs of artificiality.

The thread notes that the algorithm was trained on 2,000 artificially generated cat faces from thiscatdoesnotexist and 1,195 real cat faces from this online data set, which you can (and should) purr-ruse at your leisure here.

A real cat from the database.

To suss out the real pictures from the faked ones, the 2,000 GAN-generated images were blended together to make a type of composite fake cat face and the algorithm was taught to assess brightness and color on a pixel level — specifically, variations between brightness and the average color in the image.

The image is then given a new color scheme based on the degree of variation between brightness and color which creates a type of heat map for GAN-related anomalies. From a fake-cat forensic perspective, the point of focus here is a type of vertical and horizontal banding in the colors not found in non-GAN cat images.

Photo: color banding create by the GAN.

According to @conspirator0, the technique yielded some pretty major success in weeding out fake cats from the real ones...


Not perfect, but pretty darn close.


As noted by the tool’s creator, this algorithm is not likely to identify fakes that aren’t of cat faces, but luckily a rise in sophistication of deepfakes has already invigorated AI researchers’ efforts to quickly spot and flag media that might be doctored by AI, even if those methods are still currently works-in-progress.

@conspirator0 on Twitter.

A real question is, does it really matter if a cat is real or fake when it looks this cute? And can the internet ever really have enough cat pictures? Some stones are better left unturned.

Thanks for reading,
head home for more!