Until a few years ago, the only thing machine learning algorithms were really good at was categorising and recognising things. Like sorting cat photos from dog photos, for example, or suggesting which person should be tagged in a Facebook post, or giving you a Spanish interpretation of an English word.

In 2014, a Montreal-based researcher called Ian Goodfellow came up with an innovation that catapulted us into a new era for AI. He was chatting to friends in a local pub about their attempts to develop an AI that could create brand-new images, rather than just detect them.

The approach Goodfellow’s friends had been working on was to teach the system about the statistical probability of various micro-components of each image. Goodfellow hit on a more elegant solution. It’s known as a GAN, or “generative adversarial network,” and its invention turned Goodfellow into a rockstar. (Or at least the tech world version of one.)

Two AI systems can teach each other how to create—and detect—fake images

The way it works involves two AI systems operating together. One, acting as a forger, takes a wild guess at what the image it’s creating is supposed to look like—let’s say it’s trying to create a picture of a dog. Another system, acting as detective, compares this image to real pictures of dogs and guesses whether it’s a fake.

The forger learns whether or not it tricked the second system and tries again—a loop that can happen millions of times, with both forger and detective getting better and better at their jobs until a stasis point is reached.

At the beginning of the process, this cute little dog-ball might be produced:

Dogball (Source: Large scale GAN training for high fidelity natural image synthesis)

But at the end, the AI could have invented—from scratch and without any training or intervention from humans—this shockingly realistic image:

Deepfake Dog (Source: Large scale GAN training for high fidelity natural image synthesis)

Videos and artworks have been made using GANs

There are many possible applications of this technology. Google’s new tool BigGAN, which allows people to create their own AI-generated photo-realistic images, is at the forefront of this. GANs have also been used to make artwork that has fetched six-figure sums at the world’s top auction houses, and the technology has even been used to create fake videos.

A paper published in 2018 called ‘Everybody Dance Now’ demonstrated how to take a video of a professional dancer and a video of an amateur moving normally, and integrate these using a GAN in order to create a new video that appears to show the amateur dancing with the grace and power of the pro. The possibilities for this type of tool are endless—and they’re not all good.

Deepfake dancing (Source: Everybody Dance Now)

Deepfakes: a growing threat

Synthetic images and videos created by GANs are called deepfakes. They’ve been widely discussed in the news, especially when used maliciously. The technology has been used to create fake porn clips that appear to feature celebrities, and, more benignly, to create an AI-generated video that appears to show Barack Obama warning about the dangers of deepfakes.

As far as we know, these artificial images haven’t yet been mistaken for the real thing and distributed as news. But as the pornographic examples show, they can be easily used for blackmail and harassment. Possibly spooked by the combination of pornography and a better-than-usual Obama impersonation, some US politicians have suggested banning the technology, arguing that the inherent risks are unacceptably high. But is this a case of premature regulation?

Deepfake deadlock?

One of the many mind-bending facets of GANs is that the best method we currently have for detecting deepfakes uses the same type of AI that’s used to generate the deepfakes.

Using machine learning, it’s possible to train up a ‘detective’ AI by bombarding it with millions of images and giving it feedback about how well it’s doing at identifying fakes.

The rate at which these detective networks learn can’t outpace the rate at which the forger networks learn: the result is deadlock.

This burger might look tasty, but it’s actually a fake (Source: Large scale GAN training for high fidelity natural image synthesis)

GANs for good

Deepfakes present a major challenge for creators of technology, but there are also huge opportunities to use GANs to create useful, powerful and ethical tools. For instance, researchers have created proofs of concept where they’ve programmed GANs that can come up with their own cryptography systems, from scratch.

Adversarial neural networks might also be used to make sure an algorithm is free of racial bias. Imagine one algorithm is being fed information about people’s potentially criminal activities, and deciding what prison sentence they should be given. A second system could then try to guess protected features like race or gender from the predicted sentence. It feeds back this information to make the system fairer over time.

Generative models can be used to synthesize differentially-private training data that is indistinguishable from real data. The generator learns how to create artificial data that maintains the format and statistical properties of real input data. However, unlike real data, the created data does not reveal any private information. So it’s generated under two constraints: it has to be close to the original, while minimizing loss of privacy. The resulting data allows training of accurate machine learning models while protecting people’s privacy.

Balancing risk and regulation

This technology is in its infancy, and those pushing the edges of it have enormous power and responsibility—to create tools that could transform our worlds while keeping users safe and informed. As a technology studio specialising in practical and ethical uses of data and AI, we here at IF are keeping a close eye on the latest advances in generative adversarial networks. At the moment, we’re researching and prototyping potential solutions that can help this technology be developed in a way that minimises harm while maximising benefits.

Edited by Ella Fitzsimmons and Jess Holland.