Generative Adversarial Networks
Paxton Leung
Paxton Leung
In the field of machine learning, one of the most powerful tools programmers could use to improve the quality of creative works generated by their neural networks (such as art) is a generative adversarial network, where two neural networks are pitched against each other in a competition to improve each other.
For example, consider that we are trying to train a network to create mimic Picasso pieces. The network, having not received any training at all to begin with, would likely just generate a blank canvas. Even a human could recognise that a blank canvas is in fact, not a Picasso piece. A traditional approach to training such a network would be generating a network → asking a human whether it is a Picasso piece → go back and change the network so the next generation is a bit more like a Picasso piece. Unfortunately, this could be an incredibly long process, since human decision making (especially when the piece starts to become quite similar to real pieces) is not the quickest process.
Instead, what if we replaced the human with another neural network? We could train a neural network to recognise Picasso pieces, and thanks to the nature of neural networks, it is much easier to train it to categorise art into Picasso, and Not Picasso, than to create it. An analogy is how much easier it is to criticise a musician for the flaws in their music, than to create and play an original piece.
When we pit the discriminator (the network that distinguishes between Picasso pieces and non-Picasso pieces) and the generator (the network that generates mimic Picasso pieces) against each other, we can feed the output of the generator, into the discriminator, which will then provide feedback on the quality of the piece (yes, this piece is a Picasso piece, or, no, this piece is not a Picasso piece). The feedback is then used to tweak the generator to create something that is more similar to the discriminator’s idea of a Picasso piece.
As the generator is improving on the feedback of the discriminator, the discriminator also is improving -- if the discriminator has incorrectly categorised the generated art as a genuine Picasso piece, the discriminator is also tweaked to keep up with the discriminator.
Eventually, the goal of the generative adversarial training is to reach a point where the discriminator can no longer distinguish accurately between the generated output, and real life. Not only have we trained a model to create Picasso pieces, it can create it to a level of realism that a model trained exclusively to tell Picasso pieces apart from non-Picasso pieces, cannot tell the difference (should the model be fully trained to the point of equilibrium).
GANs, while it used to be the hottest topic in machine learning in 2019, has been superseded by a new network design, known as the diffusion model.