liveBook · Manning

Denoising

As explained in Grokking AI Algorithms, Second Edition

A denoising process is an iterative procedure that removes predicted noise from a corrupted representation to recover structured data.

Denoising removes predicted noise from a corrupted representation in repeated steps. In image generation, it is like a sculptor first revealing a rough shape and then refining its details. A diffusion model can start with random noise and gradually turn it into an image guided by a text prompt. section 12.2 section 12.3

From noise to a tree

Start with a random, blurry canvas and a goal of generating a tree. After several denoising steps, a rough silhouette appears. Later steps clarify the trunk and canopy, then refine branches, bark, and leaves. The image becomes more coherent as the process repeats. section 12.2

Figure 12.54 The denoised images from timestep 1000 to timestep 1
12_54

Follow the image as denoising proceeds from timestep 1,000 to timestep 1. section 12.25

A timestep is a numbered stage in the process. At each generation step, a U-Net receives the current noisy image, the timestep, and an embedding—a numerical representation—of the text prompt. It predicts the noise present in the image. The prediction and a noise schedule determine the next, cleaner image; the cycle then repeats, often hundreds of times. section 12.25

The noise schedule is the shared recipe for adding noise during training and removing it during generation. Its values control how much noise is added at each timestep and how the predicted noise is used in the reverse process. Schedule choices affect both how easily the model learns and the computational cost of generation. section 12.25 section 12.28

To learn the task, the model practices on clean images deliberately corrupted with known noise. It predicts that noise using the caption as a guide; the prediction is compared with the actual noise, and the difference is used to update the model’s weights. After training, the model can denoise random noise to generate a new image. section 12.9 section 12.3

Denoising can also edit an existing image. In inpainting, a mask marks the region to change, while surrounding pixels provide context. After each noise prediction, the known pixels outside the mask are restored so that only the selected area is progressively changed. section 12.31

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Traces noise prediction and scheduled removal across timesteps, connecting the generation loop to training and schedule trade-offs.
Examples
Illustrates a tree emerging from noise, a timestep-scale exercise, and masked image editing.
What you can do after
Understand how a diffusion model learns to predict noise and uses repeated predictions to generate or edit an image.
How it connects
Connects denoising with forward diffusion, U-Net, text embeddings, noise schedules, backpropagation, and inpainting.

Also explained in

Compare how 8 books explain denoising →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.