Skip to content

Classifier Guidance

Classifier Guidance, like the name suggests, uses a classifier model to guide the diffusion model to generate our desired images.

Note that an off-the-shelf classifier would not work out of the box, since those are trained on clean images, but diffusion models work with noisy images.

One way to fix this is to utilize our diffusion model. Specifically, feed it the current noisy image \(x_t\) and try make it directly predict the clean image \(\hat x_0.\) At high noise, \(x_t\) isn't very informative and the model would effectively try to predict the "average image" (of the entire training data), which when visualized looks like a very blurry image.

However, classifiers are usually more robust to blurriness than noisyness, so we can feed this blurry prediction \(\hat x_0\) into the classifier, to obtain the Classifier Guidance.

Demonstration of Classifier Guidance by sander.ai ^ Demonstration of Classifier Guidance by sander.ai, where \(\gamma\) is the guidance scale.

And checkout sander.ai's blog on Classifier Guidance for a more thorough explanation.

Still, the reliance on an external model isn't very appealing. That's why Classifier Guidance has largely been abandoned by Classifier-Free Guidance (CFG), which does not need extra models other than the diffusion model itself to do guided generation.