The case study at a glance

The scenario

Visionary Studios, a (fictional) creative design company, is evaluating generative AI models to produce high-quality images faster for advertising campaigns, concept art and digital media. It is comparing diffusion models, GANs and hybrid models, and has to weigh output quality, cost, reliability and the ethical and legal risks.

Read the booklet itself first: Case study booklet (PDF). These notes explain every idea in it, go a bit beyond it (the exam expects your own research), and link to the activities.

What SL and HL need

SLHL
Booklet sectionsEverything except GANs and hybrid modelsEverything (GANs: lines 48–59; hybrid models: lines 60–75)
Challenges2: diffusion's iterative denoising and computational demands; ethics of training datasets (IP and bias)The same 2, plus: balancing generator and discriminator in GANs; how a hybrid model could balance VAEs, GANs, flow-based and diffusion models
DepthNot expected to know about GANs or hybrid modelsDiffusion models, GANs and hybrid models in depth; a broad understanding of VAEs and flow-based models is enough
ExamPaper 1 Section B: 12 marks, short-response questionsPaper 1 Section B: 24 marks, short- and extended-response questions

Sections in these notes marked HL are for HL only (use Hide HL in the menu to hide them). The exam can also give you new information about the scenario and ask you to apply what you know to it, so understand the ideas rather than memorising the booklet.

How the pieces fit together

What can be generated?

  • Text-to-image, conditional and unconditional generation
  • Decides how much control the designer has

How is it generated?

  • Diffusion models (SL + HL)
  • GANs and hybrid models: VAEs, flow-based (HL)

Which model should the studio choose?

  • Quality, efficiency, stability, flexibility, consistency
  • Ethical and legal considerations

Image generation techniques

Text-to-image generation

  • The model creates an image from a text prompt, e.g. "a fox in a red coat, watercolour". Examples: DALL·E, Stable Diffusion, Midjourney.
  • A text encoder turns the prompt into an embedding (a vector of numbers that represents its meaning). The embedding conditions (guides) every denoising step, so the image matches the words.
  • Useful for concept art and advertising, where a specific theme, product or style is required, and for producing many variations quickly.
  • Text-to-image is a kind of conditional generation: the condition is the text.
Text prompt"a fox in a red coat"Text encodere.g. CLIPPrompt embeddingvector of numbersRandom noisein latent spaceDenoiser (U-Net CNN)repeat for 20–50 stepsVAE decoderImageguides (conditions)next step

A text-to-image system such as Stable Diffusion: hover over (or tap) each part.

Conditional image generation

The model generates an image from a specific input (the condition), so the output matches a predefined objective or style.

Class-conditional

  • Input: a class label such as "cat", "landscape"
  • Output: a new image of that category
  • Example: 50 different mountain landscapes for a travel campaign

Image-to-image translation

  • Input: an image; output: the same scene in another form
  • Sketch → realistic rendering; black-and-white → colour; day → night
  • Keeps the layout the artist chose

Segmentation maps

  • Input: an image where each region is coloured by what it should be (sky, road, tree, person)
  • The model fills each region with realistic content
  • Gives precise control of composition for a poster or scene

Unconditional image generation

  • No input except random noise: the model produces images that look like its training data, relying only on the patterns it learned.
  • Useful for exploratory creativity, abstract art and unexpected visuals.
  • Valuable for synthetic datasets: generating extra training images for other AI models (e.g. rare cases). It reduces the direct use of real people's photos, although the generator itself was trained on real images and can memorise them.
  • Downside: no control over what appears, so it is less useful for a client brief.
TechniqueInputControlTypical use at Visionary Studios
Text-to-imageText promptMedium–high (wording, style words)Concept art, ad visuals from a brief
Class-conditionalCategory labelMedium (category only)Many variations of one kind of image
Image-to-imageSketch, photo, mapHigh (layout fixed)Turning an artist's sketch into a final render
UnconditionalOnly noiseNoneExploration, abstract art, synthetic training data

Diffusion models

The big idea

A diffusion model learns to remove noise. If a network can turn a slightly noisy image into a slightly cleaner one, then by repeating that many times it can turn pure random noise into a brand-new image. This is why diffusion is called iterative.

x₀clean imagex₁a little noisex₅₀₀mostly noisex₁₀₀₀pure noiseadd noisedenoiseadd noisedenoiseadd noisedenoiseFORWARD (training): add a little Gaussian noise at each stepREVERSE (generation): a CNN removes a little noise at each step, e.g. 1000 → 0

Hover over (or tap) a box or arrow for details. Real models use around 1000 training steps; fast samplers generate in far fewer.

Training: use the forward (noising) process to make examples, then learn to predict the noise

  1. Take a real image from the training dataset.
  2. Pick a random step t (e.g. between 1 and 1000) and add the matching amount of Gaussian noise (noise injection). The computer knows exactly what noise it added.
  3. Show the noisy image (and t, and the prompt for a conditional model) to the neural denoiser, usually a CNN called a U-Net, and ask it to predict the noise.
  4. Compare its prediction with the real noise (the loss) and adjust the weights by backpropagation.
  5. Repeat millions of times with different images and amounts of noise.

Generation (the reverse process): denoise step by step

  1. Start from a random noise image (a new random seed gives a different picture).
  2. The CNN predicts the noise in the current image (guided by the prompt embedding if there is one).
  3. Subtract part of the predicted noise to get a slightly cleaner image.
  4. Repeat for every step (e.g. 1000 in the original method, typically 20–50 with modern samplers) until a clear image remains.

The dataset decides the content: a denoiser trained on animal photos "finds" cats and dogs in the noise; one trained on cities produces streets and skylines. It can only create what resembles what it has learned.

DDPM and the CNN denoiser

  • DDPM (denoising diffusion probabilistic model, Ho et al., 2020) is the method that formalised this: a fixed schedule for gradually adding noise in training and a learned model for gradually removing it in generation. Modern diffusion models are based on it.
  • It is a probabilistic model: generation involves randomness (the random starting noise and, in DDPM, a little fresh noise at each step), so a new random seed gives a different image for the same prompt; the same seed and settings reproduce the same image.
  • The denoiser is a convolutional neural network: small filters slide over the image to detect features (edges, textures, then shapes and objects), which is ideal for images because the same feature can appear anywhere. (CNNs are an HL syllabus topic, A4.3.9; SL students only need this basic idea for the case study.) The booklet says the denoiser is "typically" a CNN: the U-Net used by Stable Diffusion 1 and 2 and many others. Some newer models, such as Stable Diffusion 3, use a transformer instead.
Strengths of diffusionWeaknesses of diffusion
Photorealistic, high-quality, detailed imagesSlow: one full pass of a large CNN for every step
Stable, reliable training (a simple "predict the noise" target)Needs a lot of computing power (GPUs) for training and generation
Diverse outputs (covers the variety in the data)Expensive to train from scratch: huge datasets and many GPU-hours
Easy to condition on text, images or mapsHard to know exactly why a given image came out

Challenge: the denoising process and its computational demands

SL and HL challenge: "Managing the iterative denoising process in diffusion models and addressing their computational demands for generating photorealistic images."

Why diffusion is expensive

  • Many steps: each image needs tens to hundreds of passes through the denoiser.
  • A big network: the CNN has hundreds of millions to billions of parameters, so each pass is a huge number of multiplications.
  • High resolution: a 512×512 colour image has 786,432 values; a 1024×1024 image four times as many. Photorealism needs high resolution.
  • Training on hundreds of millions of image–caption pairs: the original Stable Diffusion v1 used about 150,000 GPU-hours on high-end data-centre GPUs.
  • Roughly: cost ∝ steps × cost of one pass × number of images. A studio generating thousands of variations a day pays for every step.

Ways to manage it

Fewer sampling steps

  • Better samplers (e.g. DDIM) take bigger, smarter steps: 20–50 instead of 1000
  • Distillation: train a student model to do in 1–4 steps what the teacher does in 50
  • Trade-off: too few steps → blurry or less detailed images

Latent diffusion

  • Run diffusion on a compressed latent version of the image (e.g. 64×64×4 = 16,384 values instead of 786,432)
  • A VAE decoder expands the result at the end
  • This is how Stable Diffusion runs on a single consumer GPU

Generate small, then upscale

  • Explore ideas at low resolution and low step counts
  • Only the chosen design gets full resolution, more steps and a super-resolution model

Hardware and infrastructure

  • GPUs / TPUs: thousands of cores do the matrix maths in parallel (A1.1.2, A4.1.2)
  • 16-bit (mixed) precision: faster, less memory
  • Batching several images per pass; caching repeated work
  • Cloud GPUs for peaks vs buying on-premises hardware (A1.1.9)

Don't train from scratch

  • Start from a pre-trained model and fine-tune it on the studio's own images (transfer learning)
  • Small add-on weights (e.g. LoRA) train in hours instead of weeks

Optimising the process is a balance between speed, cost and image quality. A good exam answer names the technique, explains why it saves computation and states the trade-off.

Generative adversarial networks (GANs) HL

Two networks in competition

  • The generator turns a D-dimensional noise vector (a list of D random numbers, e.g. D = 100) into a candidate image. Different vectors give different images.
  • The discriminator is a classifier: given an image it outputs the probability that it is real (from the training dataset) rather than fake (from the generator).
  • This adversarial dynamic is like a forger and a detective: each improves because the other does. The aim is that the generator's images become so convincing that the discriminator can only guess (50%).
  • Once trained, generation needs only one pass through the generator, so GANs are much faster at generating than diffusion models.
Noise vectorD random numbersGeneratorneural networkFake imagesReal imagestraining datasetDiscriminatorneural network (often a CNN)Real or fake?predicted labelupdate G: fool D betterupdate D

The generator and discriminator are trained together in competition. Hover over (or tap) each part.

One round of GAN training (in order)

  1. Take a batch of real images and generate a batch of fake images from random noise vectors.
  2. Train the discriminator: update its weights so it outputs "real" for real images and "fake" for the generated ones.
  3. Generate a new batch of fakes.
  4. Train the generator: update its weights (the discriminator is held fixed) so the discriminator is more likely to output "real" for its fakes.
  5. Repeat thousands of times, alternating the two.

Problems: instability and mode collapse

Training instability

  • The two networks chase each other, so losses can oscillate instead of settling down
  • If the discriminator becomes too strong, it rejects every fake with total confidence and the generator gets almost no useful feedback (vanishing gradients), so it stops improving
  • If the generator gets ahead, the discriminator's feedback is poor and quality stalls

Mode collapse

  • The generator finds a few images that fool the discriminator and produces only those: limited variety
  • Example: asked for "people", it only ever makes the same kind of face
  • Bad for a studio that needs many different designs

Challenge: balancing the generator and discriminator

HL challenge: "Balancing the performance of generator and discriminator networks in GANs to produce realistic images."

Mitigation techniqueWhat it doesProblem it helps with
Balanced learning rates and update ratiosTune how fast, and how often, each network learns so neither runs away from the other (e.g. slow down a discriminator that rejects everything; some set-ups deliberately update D more often)Imbalance, oscillation
Label smoothingTrain D towards 0.9 instead of 1.0 for real images, so it is never totally certainOver-confident discriminator
Wasserstein loss (WGAN) with gradient penaltyA different way of scoring "how far" fakes are from reals that still gives useful feedback when D is winningVanishing gradients, instability
Spectral normalisationLimits how sharply the discriminator can change its outputInstability
Minibatch discriminationD looks at a whole batch, so a batch of near-identical fakes is easy to spotMode collapse
Progressive growing (e.g. ProGAN, the original StyleGAN)Train on small images first, then add layers for higher resolutionInstability at high resolution
MonitoringTrack both losses and sample images; stop or roll back when quality dropsAll
Strengths of GANsWeaknesses of GANs
Very sharp, high-quality images (e.g. StyleGAN faces)Unstable, sensitive training that needs careful tuning
Fast generation: one pass, real-time possibleMode collapse: less variety than diffusion
A latent noise space that can be explored and editedHarder to condition on detailed text prompts

Hybrid models: VAEs and flow-based models HL

A hybrid model combines different types of generative model so that the strengths of one cover the weaknesses of another: better quality, more control over attributes and more flexibility. HL students need a broad understanding of VAEs and flow-based models.

Variational autoencoders (VAEs) and latent space

ImageEncodercompressesLatent spacecompressed pointsDecoderexpandsNew imagesimilar images sit close together in latent spaceStrength: smooth, controllable, quick to sample. Weakness: images are often blurrier than GANs or diffusion.

A VAE learns to compress (encode) and rebuild (decode) images through a latent space.

  • An encoder compresses an image into a point in a latent space: a compressed, organised version of the data. A decoder turns a point back into an image.
  • The space is organised so that similar images are close together. Moving smoothly between two points blends two images (interpolation); moving in one direction might change one attribute, such as smile or lighting.
  • To generate, pick a new point in latent space and decode it.
  • Good for flexibility, experimentation and artistic exploration; fast and stable to train. Weakness: images tend to be blurrier than GAN or diffusion images.

Flow-based models

Random noisezStep f1invertibleStep f2invertibleStep f3invertibleImagexgenerate: noise → imagetrace back: image → exactly the same noise (lossless), so the exact probability of an image can be calculated

A flow-based model: every step can be reversed exactly.

  • Learn an exact, reversible (invertible) mapping between random noise and realistic images, built from a chain of invertible steps.
  • Because it can be run backwards without loss, you can trace how each image was formed and calculate exactly how likely an image is under the model.
  • Good when precision, reproducibility or transparency matter. Weaknesses: the invertibility restriction makes networks large and memory-hungry, and image quality has usually been below diffusion and GANs.

Comparing the four families

DiffusionGANVAEFlow-based
Image qualityVery high, photorealisticVery high, sharpLower, often blurryModerate
Generation speedSlow (many steps)Fast (one pass)FastFast to moderate
Training stabilityStableUnstable, sensitiveStableStable
Variety (diversity)HighRisk of mode collapseHighHigh
Control / editingStrong conditioning (text, maps)Latent editingSmooth latent spaceExact, reversible
TransparencyLowLowSome (latent space)High (traceable)

Real hybrid models

VAE + diffusion (latent diffusion)

  • Stable Diffusion: a VAE compresses images into latent space, diffusion runs there, the VAE decoder makes the final image (its autoencoder is itself trained with a GAN-style discriminator, so it combines all three ideas)
  • Diffusion quality at a fraction of the computation

Diffusion + GAN

  • A discriminator is used to train a diffusion model to produce good images in 1–4 steps (adversarial distillation)
  • Diffusion's quality and stability with GAN-like speed

VAE + GAN

  • An autoencoder's organised latent space, with a discriminator that forces sharper outputs (VAE-GAN; VQGAN uses a related "vector-quantised" autoencoder)
  • Fixes the VAE's blurriness, reduces mode collapse

Flow ideas in diffusion

  • Newer models (e.g. Stable Diffusion 3) learn straighter, flow-like paths from noise to image ("rectified flow" / flow matching)
  • A related idea, not the same as the invertible flow-based models in the booklet
  • Fewer steps needed

Challenge: evaluating a hybrid model

HL challenge: "Evaluating how a hybrid model could balance the strengths and weaknesses of VAEs, GANs, flow-based models and diffusion models."

  • Start from the studio's requirement (e.g. photorealistic ad images, quickly, with a consistent character).
  • Pick the component that gives the core strength (diffusion for quality), then add components to fix its weaknesses (VAE latent space for speed and control, a GAN discriminator for fewer steps, flow ideas for straighter paths (fewer steps) or an invertible flow model for traceability).
  • Evaluate the costs: more complex to build, train and debug; several networks to run; harder to explain; each component's training must stay stable.
  • Conclude with a justified recommendation for the scenario, not just a list.

Evaluating generative AI models

Visionary Studios judges each model on five factors. Learn what each means, how it could be measured, and which models do well.

FactorThe questionHow it could be checked
Output qualityHigh resolution, photorealistic, stylistically coherent, matching the project goal?Designers and clients rate samples; automatic scores compare a set of generated images with a set of real images (e.g. FID, lower is better) or check how well an image matches its prompt (e.g. CLIP score)
Computational efficiencyCan the existing infrastructure train and run it without big delays or costs?Seconds per image, GPU memory needed, cost per 1000 images, training time
Training stabilityWill training settle reliably, or give repetitive or poor outputs?Loss curves, number of failed runs, variety of outputs (mode collapse)
Flexibility and scalabilityDoes it adapt to ads, concept art, branded assets, and grow with future projects?How easily it can be fine-tuned or conditioned; whether it can run on more GPUs or in the cloud
ConsistencySame characters and the intended style across many images?Compare a recurring character across a set of images; check every image against the style guide

Character consistency: embedding-based approaches

  • Problem: generate the same mascot in 20 different ad scenes. Each generation starts from new random noise, so by default the character's face, clothes and colours drift.
  • An embedding is a vector of numbers that represents something (a word, an image, a character). If the character is captured as a fixed embedding and the same embedding is fed in every time, the model reproduces the same character while the rest of the prompt changes the scene.
  • Ways to do it: learn a new "word" for the character from a few reference images (textual inversion), fine-tune the model on the character (e.g. DreamBooth, LoRA), or feed in a reference image's embedding at generation time (image-prompt adapters). Reusing the same random seed helps only for small changes to the same prompt.

Style adherence

  • Conditional models (like text-to-image) must produce the style or theme the prompt asks for, e.g. the brand's flat pastel illustration style.
  • Techniques: a guidance scale that controls how strictly the image follows the prompt (higher = closer to the prompt but less variety); negative prompts ("no photo, no 3D"); fine-tuning on the brand's own artwork; structural conditions such as sketches or segmentation maps.

Ethical and legal considerations

SL and HL challenge: "Navigating the ethical considerations of using large datasets for training generative AI models, focusing on intellectual property and bias mitigation."

Dataset curation and intellectual property

  • Many models were trained on billions of images scraped from the web (e.g. the LAION datasets), including copyrighted photos and artwork, usually without the creators' permission.
  • Risks for the studio: legal claims, outputs that closely copy a training image or reproduce a watermark, logo or famous character, and damage to reputation with the artists it works with.
  • Real case: Getty Images v Stability AI (UK High Court, November 2025). Getty dropped its main claim about training, and its secondary copyright claim failed; it won only a very limited trade mark claim about Getty watermarks appearing in some outputs. Getty was later given permission to appeal, so the law is still developing, and similar cases are under way in other countries.
  • Curation means deliberately choosing and checking the training data: use licensed, public-domain or the studio's own images (Adobe says its Firefly models were trained on licensed and public-domain content); respect artists' opt-outs; remove duplicates, watermarks and personal images; keep records of where every image came from.
  • Trade-off: a smaller, carefully curated dataset is safer but more expensive to build and may give less variety.

Bias and fairness

  • A model learns the patterns in its data, including its imbalances, and can exaggerate them. A Bloomberg analysis (2023) of over 5,000 Stable Diffusion images found that images for high-paying jobs were dominated by lighter-skinned men, and low-paying jobs by darker-skinned people and women.
  • For a studio this means exclusionary or inaccurate adverts, offended audiences and clients, and possible discrimination complaints.
  • Bias mitigation: audit the dataset (who and what is represented), rebalance or add data, test outputs across many prompts and count who appears, human review before publishing, write prompts that specify diversity where appropriate, and document the model's limitations.

Transparency and AI disclosure

  • Clients and audiences should know when an image is AI-generated: this maintains trust and avoids misleading people (e.g. a "photo" of a product that does not exist in that form).
  • Methods: visible labels, contract terms with clients, invisible watermarks, and content credentials (the C2PA standard attaches signed information about how an image was made).
  • The law is catching up: the EU AI Act (Article 50) has applied since 2 August 2026. Providers of generative AI must mark outputs in a machine-readable way (systems already on the market before then have until 2 December 2026), and people who publish deepfakes must label them clearly.

Other issues worth researching

Jobs and creativity

  • Effect on illustrators and photographers; who owns an AI-made image

Privacy and consent

  • Real people's faces in training data; generating realistic people

Environmental cost

  • Energy and water used by GPU data centres for training and generation

Misuse

  • Deepfakes and misinformation; safeguards on what can be generated