liveBook · Manning

Classifier guidance

As explained in Build a Text-to-Image Generator (from Scratch)

Classifier guidance is a diffusion-sampling technique that uses a separately trained classifier to steer intermediate samples toward a desired class or condition.

Classifier guidance steers diffusion sampling toward a desired class or condition with a classifier trained separately from the diffusion model. During reverse denoising, the classifier evaluates partially denoised images and supplies feedback about their alignment with the target. section 6.1.1

A guided sampling process proceeds in stages:

  • Start from pure noise and iteratively reverse the learned noising process. section 6.1.1
  • Present each intermediate, partially denoised sample to the separately trained classifier. section 6.1.1
  • Use predicted class probabilities as feedback to steer later sampling toward the requested class or condition. section 6.1.1

Selecting an item class

An unguided model may generate any learned clothing class, such as a t-shirt, coat, or sandal. Classifier guidance biases the intermediate samples toward the selected item. section 6.1.1

Classifier guidance differs from classifier-free guidance: CFG trains the diffusion model to work with and without conditioning, embedding guidance in the generative model instead of requiring an external classifier. section 6.1.1 section 6.5

How Build a Text-to-Image Generator (from Scratch) covers it

How deep it goes
Explains separate training, intermediate-sample evaluation, and probability feedback, but stops short of implementation equations.
Examples
Uses clothing classes such as t-shirts, coats, and sandals to illustrate guided sampling.
What it assumes
Assumes familiarity with diffusion denoising and introduces external classification as the control mechanism.
What you can do after
Apply it to steer intermediate diffusion samples toward a selected class using classifier predictions.
How it connects
Connects diffusion models with external classifiers, conditional generation, and classifier-free guidance.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Text-to-Image Generator (from Scratch). The section links point to the parts of the book it draws on.