AIWiki
Malaysia

Generative Adversarial Network

A generative adversarial network (GAN) is a class of machine learning framework in which two neural networks, a generator and a discriminator, compete against each other to produce synthetic data indistinguishable from real examples.

6 min readLast updated May 2026Foundations

A generative adversarial network (GAN) is a class of machine learning framework introduced by Ian Goodfellow and colleagues in a landmark 2014 paper. At its core, a GAN consists of two neural networks — a generator and a discriminator — trained simultaneously through a competitive process. The generator attempts to produce synthetic data samples that mimic the real training data, while the discriminator attempts to distinguish authentic samples from generated fakes. This adversarial dynamic drives both networks to improve iteratively, ultimately yielding a generator capable of producing highly realistic outputs.

Architecture

The fundamental GAN architecture comprises two neural networks with opposing objectives, formally framed as a minimax game.

The Generator

The generator is a deep neural network that accepts random noise — typically sampled from a Gaussian or uniform distribution — as input and transforms it through a series of learned transformations into a synthetic data sample, such as an image, audio clip, or text sequence. During training, the generator receives no direct access to real data; it learns solely from the feedback signal provided by the discriminator. Specifically, the generator is rewarded when the discriminator incorrectly classifies a generated sample as real.

The Discriminator

The discriminator is a binary classification network that receives both real samples from the training dataset and fake samples from the generator. It outputs a probability score indicating how likely a given sample is to be authentic. As training progresses, the discriminator becomes increasingly adept at identifying subtle artefacts in generated outputs, which in turn compels the generator to produce more convincing samples.

Training Dynamics

Training alternates between updating the discriminator and the generator. In each iteration, the discriminator is updated to maximise its classification accuracy, while the generator is updated to minimise the discriminator's ability to distinguish its outputs from real data. This process can be expressed as a minimax objective:

min_G max_D [ E[log D(x)] + E[log(1 − D(G(z)))] ]

where x is a real sample, z is the latent noise vector, G is the generator, and D is the discriminator.[^1]

Key Variants

Since Goodfellow's original formulation, numerous GAN variants have been proposed to address limitations in training stability and output quality.

Deep Convolutional GAN (DCGAN) substitutes fully connected layers with convolutional layers, producing superior results on image data and establishing architectural conventions that subsequent models adopted widely.[^2]

Conditional GAN (cGAN) introduces class labels or other conditioning signals to both the generator and discriminator, enabling controlled generation — for example, producing images of a specific digit or object category.

CycleGAN enables unpaired image-to-image translation, learning mappings between two domains (such as photographs and paintings) without requiring matched training pairs.

StyleGAN and its successors, developed by Nvidia, introduced style-based control over image generation at multiple scales, producing photorealistic human faces and enabling fine-grained attribute manipulation.

BigGAN scaled GAN training to ImageNet-class datasets, demonstrating that larger batch sizes and conditioning on class embeddings yield dramatic quality improvements.

Applications

GANs have found practical application across a wide range of domains.

In image synthesis and editing, GANs generate photorealistic faces, landscapes, and artwork; restore low-resolution images to high resolution (super-resolution); and convert images between domains, such as turning satellite imagery into map tiles or converting daytime scenes to night.

In data augmentation, GANs generate additional training samples for underrepresented classes in medical imaging datasets — for instance, synthesising rare pathology images to improve diagnostic model performance without collecting new patient data.

In video and media production, GAN-based tools enable video synthesis, deepfake generation, and automated background replacement. Film studios and game developers use GAN-derived techniques for character design and scene generation.

In drug discovery, GANs generate novel molecular structures with desired pharmacological properties, accelerating candidate identification in pharmaceutical research.[^3]

Challenges

GANs are notoriously difficult to train. Mode collapse occurs when the generator learns to produce a limited variety of outputs that reliably fool the discriminator, rather than capturing the full diversity of the training distribution. Training instability — where the discriminator becomes too strong too quickly, leaving the generator unable to receive useful gradients — is another common failure mode. Various techniques, including Wasserstein loss, gradient penalty, spectral normalisation, and progressive growing, have been developed to mitigate these issues.[^4]

By the mid-2020s, diffusion models had eclipsed GANs as the dominant approach for high-quality image generation in many benchmarks, though GANs retain competitive advantages in inference speed, as they require only a single forward pass through the generator rather than iterative denoising.

See Also

References

References

  1. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., & Bengio, Y. (2014). Generative Adversarial Nets. Advances in Neural Information Processing Systems, 27.
  2. Radford, A., Metz, L., & Chintala, S. (2016). Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. ICLR 2016.
  3. Guimaraes, G. L., Sanchez-Lengeling, B., Outeiral, C., Farias, P. L. C., & Aspuru-Guzik, A. (2017). Objective-Reinforced Generative Adversarial Networks (ORGAN) for Sequence Generation Models. arXiv:1705.10843.
  4. Arjovsky, M., Chintala, S., & Bottou, L. (2017). Wasserstein GAN. Proceedings of the 34th International Conference on Machine Learning (ICML).