Generative Adversarial Networks
What are Generative Adversarial Networks?
From deepfake scandals to AI-generated masterpieces, Generative Adversarial Networks (GANs) are reshaping how we create, perceive, and manipulate digital content. These AI-driven duels—where one model generates data while another critiques it—fuel innovations in art, security, and even human behavior analysis.
The Basic Idea
Have you ever seen the show Is It Cake? If not, the entire three seasons can be explained as follows: host Mikey Day presents a panel of celebrity guest judges with a collection of objects—perhaps some shoes, rubber ducks, or bananas—and asks them to identify which is not like the others. Namely, which one is secretly a cleverly disguised cake? Behind the scenes, expert bakers compete for a cash prize, toiling for hours to create a hyperrealistic cake replica of an object that could easily fool someone into thinking it was the real deal. Judges, on the other hand, are motivated to suss out the clandestine cakes.
Generative Adversarial Networks (GANs) are a type of machine learning framework, which, although more complex than this reality show gameplay, work in a somewhat similar way. Though the analogy is a major oversimplification, the core ideas are the same: in the game show, there is a baker and a judge, and in a GAN, there is a generator and a discriminator. The generator is like the baker, trying to create a convincing copy of something. In this case, the baker is creating fake items that are actually cakes, but a generator in an artificial neural network might generate fake images, hoping to make them look real.
The discriminator is like the judge, who is an expert at telling what is cake and what isn’t (perhaps they’ve watched a lot of episodes of the show in preparation). In the GAN, the discriminator evaluates both real images from the training dataset and the fake images from the generator and tries to tell them apart. If it’s able to tell the difference, the discriminator gives feedback to the generator, helping it improve.
If the judge guesses wrong, the baker has clearly done well, and gets to advance in the competition. If not, then the baker knows they have things to work on, as their cake replica wasn’t too convincing. Similarly, when the generator manages to fool the discriminator, it signifies that no change is needed to the model parameters, and it gets to proceed as is, whereas the discriminator will be penalized with significant updates, and vice versa when the generator loses.
Just as the baker and judge may continue to go through multiple rounds, learning from each other about how to discern real from cake, the generator and discriminator continuously play against each other to figure out what is real or fake data. The generator tries to fool the discriminator, and the discriminator tries to catch the generator. As they keep playing, they both get better and better. The discriminator gives feedback to the generator, which helps it improve its fakes. The process repeats until the training process has successfully converged, at which point the discriminator can no longer tell the difference between the real and fake data.1 As the Is it Cake? bakers continue to hone their skills, the judges soon won’t stand a chance, and fooling them will be, well, a piece of cake.
GAN is about creating, like drawing a portrait or composing a symphony. This is hard compared to other deep learning fields. It is much easier to identify a Monet painting than painting one, by computers or by people. But it brings us closer to understanding intelligence.
– Jonathan Hui, writer on deep learning
About the Author
Annika Steele
Annika completed her Masters at the London School of Economics in an interdisciplinary program combining behavioral science, behavioral economics, social psychology, and sustainability. Professionally, she’s applied data-driven insights in project management, consulting, data analytics, and policy proposal. Passionate about the power of psychology to influence an array of social systems, her research has looked at reproductive health, animal welfare, and perfectionism in female distance runners.