VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

How Artificial Intelligence AI Works | How GANs Generate Images Through Competition

Did you know? One way an AI system learns to create believable pictures is to train two networks with different jobs. One produces candidate images. The other attempts to distinguish generated images from examples in a training dataset. Each model’s performance helps provide a training signal for the other.

This approach is called a generative adversarial network, or GAN. It was introduced in a 2014 research paper by Ian Goodfellow and collaborators and became an influential family of generative modelling methods.

Quick answer: a generator makes an artificial example → a discriminator evaluates whether examples resemble real training data → both networks adjust during training → the generator can later produce new outputs. The “competition” is mathematical, not a disagreement between conscious machines.

GANs in 30 seconds

  • Generator: a neural network that creates synthetic examples from numerical inputs, sometimes with additional conditions.
  • Discriminator: a network trained to distinguish examples from the training dataset from generated examples.
  • Latent vector: numerical input used to create variation in the generated output.
  • Adversarial objective: a learning setup where the two networks’ optimisation goals interact.
  • Training instability: difficulty making the two learning processes progress together reliably.
  • Mode collapse: a failure where the generator produces too narrow a variety of examples.

A GAN does not need a person to hand-label every possible generated image as “good” or “bad.” But its training examples, objectives and evaluation still depend on deliberate human choices and appropriate data.

Step 1: Meet the generator and discriminator

Imagine a fictional art exercise in which one program creates images of simple geometric shapes and another program judges whether those pictures resemble a collection of authentic shape drawings.

The generator starts from an input such as a random vector and produces a candidate image. At first, its output may look like noise or crude forms. The discriminator sees examples drawn from a real training dataset alongside the generator’s outputs.

The discriminator learns to make a useful distinction between these two sources. Meanwhile, the generator receives a learning signal encouraging it to produce examples that the discriminator finds harder to distinguish from the training distribution.

In an ordinary GAN used for generation, it is generally the trained generator that produces new images at inference time. The discriminator’s main job was part of training, not a requirement for someone viewing each newly generated picture.

Step 2: Where does the generator’s variation come from?

Many basic GAN generators receive a random or pseudorandom latent vector. Different values can lead to different generated examples. The model transforms the vector through learned numerical layers into an image.

For a toy shapes dataset, one input might yield a small red triangle and another a larger blue circle, if the model has learned those patterns. Real image models are more complicated and may use convolutional or other architectures to produce visual structure.

The generator does not necessarily retrieve a specific image and paste it into the output. It synthesises an example through learned parameters. However, memorisation, similarity to source data and rights issues remain possible and require separate assessment.

Step 3: Teach the discriminator a useful distinction

During a training step, the discriminator is shown examples sampled from the chosen training dataset and synthetic examples produced by the generator. Its training objective rewards correctly distinguishing those sources.

The word “real” in this context refers to examples from the training distribution, not a guarantee that the content depicts an authentic event. A real training photo can be staged; a synthetic illustration can communicate a correct scientific concept.

A discriminator score also should not be presented as a universal deepfake-detection result. Its job is defined by a particular GAN training setup and the examples it sees. It is not necessarily capable of judging photographs from arbitrary generators or unfamiliar scenes.

Step 4: Adjust the two models in turn

In many GAN training procedures, developers alternate between updating the discriminator and updating the generator. The discriminator learns to identify differences between training examples and current synthetic examples. The generator learns from a loss related to how the discriminator evaluates its outputs.

Both changes typically use neural-network optimisation methods, including gradients. Because the generator and discriminator influence each other’s objectives, training can be more difficult to stabilise than optimising a single fixed prediction objective.

One model’s success changes the task faced by the other. If the discriminator quickly becomes too effective, the generator may receive an unhelpful learning signal under some choices of objective. If the generator discovers a narrow shortcut, the images may lack variety.

The idea is not “two AIs arguing until one wins.” It is an optimisation process in which the changing behaviour of one network supplies training information for the other.

Where did GANs come from?

In 2014, Goodfellow and collaborators introduced a framework in which a generative model and discriminative model train in an adversarial process. The original theory describes a two-player objective and a limiting ideal in which generated examples match the target data distribution.

This was a research framework, not a guarantee that every practical implementation reaches its ideal solution. Real networks have finite capacity, finite datasets and optimisation challenges. A useful model requires experiments and evaluation.

The original paper, Generative Adversarial Networks, is freely available for readers interested in the technical foundations.

A simple classroom illustration: five styles of leaves

Imagine a fictional art dataset containing drawings of five different kinds of leaf. We want a generator to create additional drawings with comparable variation. A discriminator is trained to distinguish the original drawings from the generator’s attempts.

Suppose the generator eventually learns to draw one particularly convincing oval leaf. It may produce that kind repeatedly while hardly ever generating the other four. The images could look attractive at first glance, but the collection would be missing important variety.

That is a simplified example of mode collapse. A model may focus on a limited set of outputs that work against its current discriminator rather than covering the full diversity of the training distribution.

The solution is not just adding more decorative adjectives to the output. Developers investigate architecture, training objective, data coverage, sampling and evaluation.

Step 5: Evaluate quality and diversity separately

Judging generated pictures requires more than asking whether one example looks beautiful. A system could create visually appealing images that all look nearly identical, or generate a wide variety of shapes with many errors.

Evaluation may consider image quality, diversity, coverage of relevant patterns and how outputs behave on unfamiliar conditions. Automated metrics such as versions of Fréchet Inception Distance can be useful for certain comparisons, but their assumptions and evaluation datasets must be understood.

Human assessment can add useful context, especially for particular tasks. However, neither a metric nor a pleasant picture proves that the content depicts a genuine event, respects rights or meets a scientific standard.

Can a GAN create pictures from descriptions?

Some GANs are conditional: they receive an additional label, image or other conditioning input that influences what they generate. For example, a conditional generator might receive a category such as “triangle” to help select the desired kind of drawing.

This does not mean every GAN accepts arbitrary conversational instructions. Different architectures support different types of conditioning, and a text-to-image system requires suitable text-to-visual alignment and training.

Modern image-generation tools may use diffusion, autoregressive or hybrid techniques instead of a conventional GAN. Read How AI Creates Images From Words to understand one influential alternative.

How does a GAN differ from a diffusion model?

In a familiar GAN, the generator learns through a discriminator-related training signal. During inference, the generator typically transforms its inputs into a synthetic example through its learned network.

In a common diffusion pipeline, the system learns a denoising process and generates an image through a sequence of refinement steps from a noisy representation. Some other methods use different procedures.

Neither family is automatically more accurate, safer or faster in every context. Architecture, model size, generation settings, hardware and the specific task determine actual performance.

Where can GAN-style generation be useful?

  • Creative exploration: producing original-looking concept art or style experiments with appropriate rights.
  • Image-to-image translation: learning transformations between certain kinds of visual domains in suitable research setups.
  • Dataset augmentation: generating additional examples to investigate whether a trained model becomes more robust.
  • Restoration research: developing models that improve certain degraded images under tested conditions.
  • Education: demonstrating how two interacting optimisation goals can train a generator.

Those are possible applications, not guarantees. A synthetic medical or scientific image requires particular validation before being trusted, and generated training data can repeat bias or sensitive source details.

What should readers check before using generated media?

Synthetic pictures can be shared misleadingly as purported photographs. A generator’s success at imitating a dataset does not establish the authenticity of the content it produces. Label fictional or conceptual illustrations appropriately when viewers might otherwise be deceived.

Before using a generated image commercially or publicly, review the tool’s terms, applicable rights and whether source material or someone’s likeness creates consent concerns. Even if the model is capable of imitating a style, that capability does not automatically confer permission.

Never rely on a simple “looks generated” or “looks real” judgment to prove the origin of a particular file. The guide to deepfake detection and content credentials explains why provenance and factual claims need separate verification.

Try it: a paper generator and judge

Draw six harmless geometric shapes on cards, using a mixture of circles, triangles and squares. Give a friend the job of making a new drawing that fits the general style. Ask a second friend to compare the new drawing with the originals and explain what seems different.

Let the first friend revise the drawing using that feedback. Repeat once or twice. You have explored the intuition of alternating creation and evaluation, but not actual machine learning: humans are applying conscious judgement rather than updating millions of numerical parameters.

Now ask the creator to produce six different shapes instead of one. If every result looks like the same circle, you have demonstrated why diversity matters alongside individual image quality.

Five mistakes worth avoiding

  • “GAN means any AI image generator.” Several other generative model families exist.
  • “The discriminator is a universal fake detector.” Its training task is limited to its particular examples and setup.
  • “Convincing images prove real events.” Appearance and authenticity are different.
  • “A generator with one beautiful image is successful.” Diversity and coverage can still be poor.
  • “More synthetic pictures always improve training.” Unrepresentative and misleading examples can introduce new failures.

Frequently asked questions

What does GAN stand for?

Generative adversarial network: a family of models involving a generator and discriminator trained with interacting objectives.

Is the discriminator used every time a GAN generates an image?

Not usually in a basic deployed generator. The discriminator primarily contributes to the training process, although particular systems may use additional evaluation tools.

What is mode collapse?

A training failure where a generator produces limited varieties of output instead of covering important patterns in its target distribution.

Are GANs and diffusion models the same?

No. GANs use adversarial training, while diffusion models commonly learn a denoising process. Both can generate synthetic media.

Does a generated image copy a particular source photograph?

Typical generation synthesises outputs from learned parameters, but memorisation or close resemblance may occur. Rights, privacy and similarity require separate assessment.

Your one-minute takeaway

  • GANs train a generator and discriminator with competing objectives.
  • Successful generation requires both useful quality and appropriate diversity.
  • A convincing synthetic image is not proof of authenticity or permission to publish.

Trusted reading and connected articles

Discover more from eduKate Singapore

Subscribe now to keep reading and get access to the full archive.

Continue reading