GANs — the original framework introducing the adversarial training paradigm: a generator network learns to produce realistic data by competing against a discriminator network (Goodfellow et al., 2014).
DCGAN — deep convolutional GAN, which established stable architectures and training practices for image generation (Radford et al., 2016).
A generative adversarial network (GAN) sits inside a short block of chapters on generative models. The previous chapters mostly focused on architectures used for prediction, classification, or representation learning on different data structures. In this part of the book, autoencoders, GANs, diffusion models, and flow matching are grouped together because they all learn data distributions and produce new samples, even though their training mechanisms differ substantially.
A generative adversarial network (GAN) consists of two neural networks that are trained simultaneously in competition:
The generator\(G\) takes random noise \(\mathbf{z}\) and produces a synthetic sample \(G(\mathbf{z})\).
The discriminator\(D\) receives either a real sample or a generated sample and tries to classify it as real or fake.
Training alternates between improving the discriminator (so it better distinguishes real from fake) and improving the generator (so its fakes become more convincing). The result is a generator that can produce realistic, novel samples from the data distribution.
At convergence, the generator produces samples that the discriminator cannot distinguish from real data. In practice, GANs can be difficult to train: the generator and discriminator must be balanced, and training can be unstable.
13.2 Architecture
The original GAN used feedforward networks for both \(G\) and \(D\). The DCGAN(Radford et al., 2016) established best practices for using convolutional architectures:
Generator: uses transposed convolutions to upsample noise into an image.
Discriminator: uses standard convolutions to classify images as real or fake.
Batch normalization, LeakyReLU in the discriminator, and ReLU in the generator improve stability.
13.3 Code example: a more stable GAN for a rock-physics crossplot
The earlier GAN version had the right idea but the training was too unstable. Here we keep the same geoscience target, synthetic porosity-velocity points, but switch to a more standard Wasserstein-style setup with a critic and weight clipping. That is still simple enough for a chapter example, but it is much less likely to collapse onto only one cluster.
The problem formulation is different from the CNN chapter. We are not classifying anything here. The generator takes random noise as input and produces a synthetic \((\phi, v_p)\) point. The critic looks at real and generated points and learns to score which ones are more realistic. After training, the output we care about is the cloud of generated samples and whether it matches the real crossplot shape.
The printed means and standard deviations are only a quick sanity check. The real test is the scatter plot: if the generated cloud matches the two-cluster structure, then the GAN is at least learning the gross geometry of the data distribution. If it collapses to one cluster or one narrow streak, the training has failed even if one or two scalar summary numbers look acceptable.
13.4 When to use GANs
GANs excel at generating realistic samples from a learned distribution. They are particularly useful when:
You need to augment limited training data with realistic synthetic examples.
You want to sample from a complex distribution (e.g., geological models consistent with observations).
You need to transfer styles or transform between domains (e.g., converting sketches to realistic geological cross-sections).
GANs can be harder to train than other generative models (VAEs, diffusion models). Mode collapse (the generator produces only a few types of output) and training instability are common challenges.
13.5 Geoscience applications
Porous media reconstruction — Mosser et al. (2017) used DCGANs to generate 3D micro-CT-scale porous media samples that match the statistical properties of real rock samples, enabling rapid generation of representative geological volumes for flow simulation.
Geostatistical inversion — Laloy et al. (2018) used a spatial GAN as a geological prior for inverse problems, generating training-image-consistent geological models during inversion. This allows the inversion to stay within geologically realistic model space.
Stochastic seismic inversion — Mosser et al. (2020) combined GANs with seismic inversion, using the generator as a geological prior to produce multiple subsurface models consistent with both seismic data and geological knowledge.
Geological facies modeling — GANs have been used to generate realistic 2D and 3D geological facies models that honor well-data and geological constraints, as an alternative to traditional geostatistical simulation.
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.
Laloy, E., Hérault, R., Jacques, D., & Linde, N. (2018). Training-image based geostatistical inversion using a spatial generative adversarial neural network. Water Resources Research, 54(1), 381–406. https://doi.org/10.1002/2017WR022148
Mosser, L., Dubrule, O., & Blunt, M. J. (2017). Reconstruction of three-dimensional porous media using generative adversarial neural networks. Physical Review E, 96(4), 043309. https://doi.org/10.1103/PhysRevE.96.043309
Mosser, L., Dubrule, O., & Blunt, M. J. (2020). Stochastic seismic waveform inversion using generative adversarial networks as a geological prior. Mathematical Geosciences, 52, 53–79. https://doi.org/10.1007/s11004-019-09832-6
Radford, A., Metz, L., & Chintala, S. (2016). Unsupervised representation learning with deep convolutional generative adversarial networks. Proceedings of the International Conference on Learning Representations (ICLR). https://arxiv.org/abs/1511.06434