Learn AI /Generative Media /Generative adversarial network
Generative adversarial networkGAN
- Deeper
- Generative Media
- Technical readers
Also called: GAN.
Back to the milestone you came from
In five seconds
What it is
A training method with two neural networks, one making synthetic examples and one trying to spot fakes, with the aim of making generated output more realistic.
In plain words
A GAN trains one AI system to make fake examples and another to catch them. Their competing training signals can make the fake examples very realistic.
An everyday example
Imagine a city transport office training new inspectors while a counterfeiter keeps trying to make fake transit passes. The counterfeiter first makes poor copies, and the inspectors catch them easily. As the inspectors learn what to look for, the counterfeiter improves the paper texture, colours and stamp placement. After many rounds, the fake passes can look very convincing, because each side improved by reacting to the other.
In a real GAN, neither network uses human reasoning about paper, stamps or transport rules. Both adjust numerical weights based on training signals. Also, the generator is not copying one real example directly in the intended mechanism; it is learning statistical patterns across many examples. Finally, after training, people usually keep the generator and discard the discriminator, which is not how the transit-pass story works.
Remember thisA GAN alternates training between a generator that makes synthetic samples and a discriminator that spots them. Their contest can improve realism, but does not guarantee diversity, accuracy or safe data use.
Understand it
Understand it
Why it matters
A non-specialist may not build a GAN, but may need to judge claims about realistic synthetic media. GANs helped make highly convincing generated images possible, which matters for media verification, fraud prevention, research choices and procurement. If someone says a system can create endless realistic examples for training or communication, it is useful to ask: what data trained it, how stable is it, how diverse are the outputs, and what misuse risks follow? GANs also matter because they are often mentioned alongside deepfakes, synthetic media and content provenance tools. Understanding the basic mechanism helps you separate a genuine technical description from vague marketing and helps you recognise that realistic output does not prove authenticity.
How a GAN trains two networks against each other
After viewing the diagram, the reader should be able to explain that a GAN trains a generator and a discriminator in a loop, with each improving in response to the other.
01
1. Start with two inputs
The system uses real examples from a dataset and random numbers called noise.
Show two source boxes on the left: 'Real examples' and 'Random noise'. Use distinct colours and arrows pointing right.
02
2. Generator makes a sample
The generator converts noise into a synthetic image, audio clip or other sample.
Place a 'Generator' box in the centre top. Connect 'Random noise' to it, then to a thumbnail labelled 'Synthetic sample'.
03
3. Discriminator compares
The discriminator receives both real examples and synthetic samples and produces a score for whether each looks real.
Place a 'Discriminator' box in the centre bottom. Draw one arrow from 'Real examples' and one from 'Synthetic sample' into it. Output to a box labelled 'Real / fake score'.
04
4. Both networks update
If the discriminator catches the fake, the generator adjusts to do better next time. If the fake fools the discriminator, the discriminator adjusts too.
Add two dashed feedback arrows from the discriminator area back to the Generator and to itself, labelled 'update weights'. Include a loop marker 'repeat many rounds'.
05
5. Keep the generator
After training, the generator can create new samples without needing real examples each time.
On the far right, show the trained generator producing several varied outputs from different noise inputs. Fade the discriminator to indicate it may not be used at generation time.
A left-to-right flow diagram with two inputs at the left: random noise and real training examples. Noise goes to the generator, which outputs a synthetic sample. Real and synthetic samples both go to the discriminator, which outputs real-or-fake scores. Curved feedback arrows return from the discriminator to both networks to show training updates over repeated rounds.
Hovering over each arrow highlights what is flowing: data samples, scores or parameter updates. A toggle switches between 'training' and 'after training' views.
Describe this without the diagram
This diagram explains GAN training as a five-stage flow. First, there are two inputs: real examples from a dataset and random noise. Second, the noise goes into a generator, which produces a synthetic sample. Third, both the real examples and the synthetic sample go into a discriminator, which outputs a score indicating whether an input appears real or fake. Fourth, feedback from the discriminator is used to update the generator and the discriminator over many repeated rounds. Fifth, once training is complete, the generator is kept to create new samples from fresh noise inputs, while the discriminator may no longer be used for generation.
With reduced motion: A static flowchart shows the same five stages without animation. Dashed arrows and numbered labels indicate the repeated training loop, and a side panel shows the final state where only the trained generator is used to produce outputs.
A generative adversarial network, or GAN, is a way to train an AI system to create new content such as images, short audio clips or other data that resembles a training set. It uses two neural networks, which are mathematical pattern-finding systems built from many weighted connections. One network is the generator. It starts from random numbers and produces a candidate output, such as an image.
The second network is the discriminator. It receives both real examples from the training data and fake examples from the generator, and it tries to tell which are real and which are synthetic. During training, the discriminator gets better at spotting flaws. The generator then adjusts its internal weights to make outputs that are harder to detect as fake. This repeated competition is the “adversarial” part.
What goes in is usually a large collection of examples, such as face photos or satellite image patches, plus random input values often called noise. What happens is an alternating training loop: improve the discriminator, then improve the generator, again and again. What comes out is a trained generator that can turn random input into new samples with similar statistical patterns to the training data.
GANs became important because they could produce sharp, realistic images and inspired many synthetic media applications. But they are not the only way to generate content, and they are often harder to train than newer diffusion models. They can also fail in specific ways, such as “mode collapse”, where the generator produces too little variety even if the outputs look convincing.
How “A forged transit pass checked by inspectors” maps onto the real thing
| In the story | In the AI system |
|---|---|
| counterfeiter making new passes | generator creating synthetic samples from random input |
| inspectors checking real and fake passes | discriminator classifying training examples as real or generated |
| many rounds of better forgery and better inspection | alternating training updates that improve both networks |
| convincing fake pass at the end | generator output that matches patterns in the data distribution |
A worked example
An information management officer at a regional hub prepares a tutorial notebook for a Friday machine-learning clinic. The exercise trains a GAN on a collection of small handwritten-digit images and asks it to generate new digit-like images.
Starting from: Real handwritten-digit images for the discriminator, with random numerical vectors as inputs to the generator. The real images do not need digit-class labels for basic GAN training.
- At first, the generator maps each random vector to a blurry pixel pattern that bears little resemblance to a digit.
- The discriminator receives mixed batches of real and generated images and updates its parameters to distinguish between them.
- The generator then updates through the discriminator's feedback, learning changes that make its outputs more likely to be classified as real.
- These optimisation steps alternate. Loops, strokes and curves gradually become more convincing, while the officer monitors unstable training and mode collapse, where many inputs produce very similar images.
- After training, new random vectors are sampled. The outputs are checked for visual plausibility, variety and suspicious similarity to training examples.
Result: The generator produces many plausible digit images, although some remain ambiguous and several share nearly identical styles. The exercise shows that adversarial training can improve realism without guaranteeing diversity, accuracy or originality.
In a United Nations workplace
A budget officer at a shared services centre is validating a document-extraction tool before figures are cleared for a quarterly donor report. In the vendor demo, a GAN generates synthetic, scan-like invoice layouts so the tool can be tested against skewed pages, stamps and irregular tables without using live supporting documents.
The generator creates increasingly realistic layouts while the discriminator learns to distinguish generated pages from the training examples. Alternating updates can produce useful test material, but a plausible page is not necessarily representative, accurate or sufficiently varied.
Before you try thisReal invoices may contain personal, banking and procurement-sensitive information. They must not be uploaded to, or used to train, a tool that has not been approved for that material. The officer should also establish the provenance of the vendor's training data and test for memorisation, bias and low variety before any synthetic pages are used in validation.
Where you may hear it
- A vendor demo during a procurement meeting on synthetic test data
- An information management clinic reviewing image-generation methods
- An ICT governance board discussion on deepfakes and synthetic media
- A technical review of an image-generation pilot before clearance
Avoid confusion
Avoid confusion
Often confused with
Diffusion model
A diffusion model creates media by learning how to remove noise step by step until a coherent image, audio clip or other output appears.
Variational autoencoder
A generative model that compresses examples into a regularised probabilistic latent space, then reconstructs inputs or samples from that space to create new outputs.
Image generation
Software can create new pictures from prompts or other inputs by learning visual patterns from many examples, then producing a fresh image rather than retrieving one file.
Common misconceptions
Common misconception: A GAN simply copies and pastes training images.
Correction: A trained generator usually produces outputs by transforming random input through learned weights, not by retrieving one stored image and pasting pieces together in a simple way. However, poor training practice or small datasets can still lead to memorisation or near-duplicates, so this risk should be tested rather than ignored.
Common misconception: The discriminator is the final product people use.
Correction: In many applications, the generator is the main product after training because it creates new samples from noise. The discriminator is essential during training, but it may be discarded or reused only for evaluation once the generator is trained.
Common misconception: If GAN output looks realistic, it must represent reality accurately.
Correction: Realistic appearance only means the output matches visible or statistical patterns in the training data. It does not prove that a depicted event happened, that the content is unbiased, or that it is suitable evidence. Authenticity needs separate verification.
Common misconception: GANs are the standard method behind all modern image generators.
Correction: GANs were highly influential, especially for image generation, but many current state-of-the-art image systems use diffusion models instead. These methods generate data differently and have different strengths, weaknesses and training behaviour.
Quick check
What makes a GAN different from a single network trained alone to generate images?
A GAN trains a generator using feedback from a discriminator that compares real and generated samples. Compressing and reconstructing through a latent space describes a variational autoencoder. Step-by-step noise removal describes a diffusion model. Matching paired targets is supervised training, not the defining GAN mechanism.
Go deeper
Go deeper
The simple version
A GAN trains one AI system to make fake examples and another to catch them. Their competing training signals can make the fake examples very realistic.
The technical version
A GAN is a generative modelling framework with two neural networks trained in opposition. The generator maps a latent vector, often sampled from a simple distribution such as Gaussian noise, into the data space. The discriminator receives real and generated samples and learns to classify them. Some variants instead use a critic that assigns scalar scores to both. Training alternates optimisation steps for the two networks. The generator updates its parameters to make generated samples receive more real-like assessments. In the original formulation, this can be described as a minimax game over an objective related to divergence between the model distribution and the data distribution. In practice, many variants modify the loss function and architecture to improve stability, because GAN training can suffer from vanishing gradients, non-convergence and mode collapse. The hoped-for result is a generator that approximates the target data distribution well enough to sample realistic new outputs.
Reviewed external resources
Primary sourceRecommendation on the Ethics of Artificial Intelligence (opens in a new tab)UNESCO
This link gives the policy and ethics context for AI use, including risk, accountability and human-rights considerations, and suits readers making governance or deployment choices.
Intermediatelink checked 2026-07-31
Primary sourceContent Credentials (opens in a new tab)Content Authenticity Initiative
This link gives an introduction to content provenance ideas and practical authentication approaches, and suits readers concerned about verifying synthetic media.
Starterlink checked 2026-07-31
EncyclopaediaGenerative adversarial network (opens in a new tab)Wikipedia
This link gives a broad overview of the term, its history, variants and examples, and suits readers who want a general reference point.
Intermediatelink checked 2026-07-31
VideoVideo explanations: Generative adversarial network (opens in a new tab)YouTube search
This search-results page gives multiple video explainers with different levels of maths and intuition, and suits readers who learn best by watching and comparing presenters.
search results, not one pagelink checked 2026-07-31
DiscussionCommunity discussion: Generative adversarial network (opens in a new tab)Reddit search
This search-results page gives community questions, experiences and debates about GANs, and suits readers who want informal discussion and common practitioner issues.
search results, not one pagelink checked 2026-07-31
Where this came from
Drafted with a language model through an offline pipeline, checked against this site's schema, and every external link above fetched to see whether it answers. Treat it as a starting point and check anything that matters against the primary sources. How this site is built and what that means.
The one thing to remember
A GAN alternates training between a generator that makes synthetic samples and a discriminator that spots them. Their contest can improve realism, but does not guarantee diversity, accuracy or safe data use.