We’ve seen great advancements in artificial intelligence in the past two decades. AI has applications in a wide array of industries like healthcare, fashion, education, agriculture and will no doubt continue to act as a major digital disruptor.
As Andrew Ng put it: “Just as electricity transformed almost everything 100 years ago, today I actually have a hard time thinking of an industry that I don’t think AI will transform in the next several years.”
However, bad actors can misuse AI easily. Let’s look at an application of AI that’s been used to trick people and spread misinformation: AI-generated images, some of which we call deepfakes.
What Are Deepfake Images?
Deepfakes and AI-Generated Photos
In the past few years, deepfakes began taking the internet — and the real world — by storm and, in 2020, deepfakes went mainstream. We see deepfakes in ads and TV shows, but some use them to spread mis- and disinformation. While many videos are harmless, others have caused a great deal of vexation when faces of politicians are made to look like they’re saying and doing things they haven’t said or done.
While you may be familiar with deepfake videos, you may not know that deepfakes can be still images, too. AI deep learning models are indeed capable of generating fake faces that look almost identical to real people. These programs have become really strong over the years, and it’s almost impossible to distinguish between a real face and an AI-generated fake.
Can you tell which one of these faces is real and which one is AI-generated?
The face on the right is real. An AI application generated the photo on the left. Did you guess right?
GANs: The Technology Behind AI-Generated Images
Deepfakes can be generated by a class of machine learning models called GANs (generative adversarial networks). Researcher Ian Goodfellow and his colleagues designed GANs in 2014.
How Do GAN Images Work?
The generator’s job is to trick the discriminator into believing the images are real. This way, as the discriminator gets better at identifying AI-generated images, the generator produces more and more realistic images to trick the discriminator.
This is why they’re adversaries: As one network gets better, so does the other.
The GAN remains one of the most fascinating innovations in deep learning. In fact, Yann LeCun, Meta’s chief AI scientist, called GANs “the most interesting idea in ML in the last 10 years.”
Now You Try: Real Faces vs. GAN-Generated Images
As we now know, GAN-generated images can be very convincing. Neural networks have become alarmingly good at creating realistic human faces. Given the high stakes are for both personal and national security, it’s important for us to be able to distinguish between real faces and those generated by GANs. So how do we do that? Practice, practice, practice.
Inspired by thispersondoesnotexist.com, I created an application to quiz you on whether you can tell a real person’s face from a fake one. I used the one million fake face data set to get GAN-generated images for this project, and Kaggle’s UTKFace data set for the real images.
Try identifying which of the images are real faces and which ones are GAN-generated.
In essence, you’ll be acting as a GAN discriminator. Just as the discriminator gets better at identifying AI-generated images over time, so will you.