BookNotesSlidesP-sets Syllabusdraft · v0.2.49.1
💬Comments welcome. To leave a note, select any text and click the note / highlight button that pops up — or open the panel with the tab at the top-right (‹). Notes are visible only inside our private review group.
Computational Photography, an AI-powered Slopendium — 07 Probabilistic Approaches and Machine learning
expand to📖 Full book outline1 parts · 6 chapters · 40 sections · 16 figures embedded · 1 placeholders · double-click a figure to enlarge
▸Part 7 PROBABILISTIC APPROACHES AND MACHINE LEARNING⧉
<!--uid: probabilistic-approaches-and-machine-learning-->
The linear-methods part cast recovery as regularized least squares: $y=Ax$ plus a penalty that prefers plausible images. This part reinterprets that penalty as a **prior**, a probability distribution over images, and follows it as it grows richer: first a **Bayesian** framing (likelihood × prior), then a prior **learned from data** (machine and deep learning), then one you can **sample** (generative models, diffusion). It is gathered here, before the single-image applications, because nearly every later part (deblurring, super-resolution, compositing, HDR, video) leans on one of these probabilistic or learned priors.
▸7.1 Imaging as Bayesian inference with probabilistic priors⧉
7.1.4 Matching the estimate to the task⧉
7.1.5 Harder inverse problems: factorization⧉
7.1.8 Deep learning, amortized inference, and generative AI⧉
▸7.2 Machine learning⧉
fig-learned-vs-handdesigned
fig-learned-vs-handdesigned · same inverse-problem skeleton, prior swapped: classical (data-fit + hand prior $\Phi$) vs learned ($f_\theta$ fit to data) (ML) ✅
fig-synthetic-data-pipeline
fig-synthetic-data-pipeline · manufacture (degraded, clean) training pairs by simulating the camera/degradation (ML) ✅
reference the ML & deep-learning refresher ([[Refreshers#Machine learning and deep learning]]) up front; this chapter does **not** re-teach networks — it sets up *learning an operator from data* and the **data** that powers it. The concrete deep-network operators are the next chapter, [[Deep learning]].
equations
learned operator $\hat I = f_\theta(\text{measurement})$ trained by $\min_\theta \sum_i \ell\!\big(f_\theta(x_i),\,y_i\big)$
reuse the inverse-problem $\hat I=\arg\min_I \lVert AI-b\rVert^2+\lambda\,R(I)$ from above to contrast a hand-tuned $R$ vs a learned one
▸7.3 Deep learning⧉
fig-learned-task-zoo
fig-learned-task-zoo · learned low-level operators: denoise / super-resolve / demosaick / colorize, each input→output on one photo (ML) ✅
fig-colorization-classical-vs-learned
fig-colorization-classical-vs-learned · Levin 2004 scribble-propagation vs Zhang 2016 fully-automatic colorization (ML) ✅
⬜ figure not yet created
fig-depth-anything (one photo → its monocular depth map) fig-depth-anything
fig-gan-pix2pix
fig-gan-pix2pix · paired image-to-image translation: edge map → photo (conditional GAN) (ML) ✅
fig-perceptual-metric
fig-perceptual-metric · same MSE, very different perception (small shift vs additive noise) → why LPIPS (ML) ✅
these are the **deep-network** realizations of the learned-operator framing ([[Machine learning]]); architectures and training are the Refreshers' job — here we survey *what gets learned*.
equations
minimal (survey chapter) — perceptual / feature loss $\ell_{\text{feat}}=\sum_l \lVert \phi_l(\hat I)-\phi_l(I)\rVert^2$ over deep features $\phi_l$ (LPIPS)
reuse the learned operator $\hat I = f_\theta(\text{measurement})$ from [[Machine learning]]
▸7.4 Generative AI and diffusion⧉
fig-genai-evaluate-vs-sample
fig-genai-evaluate-vs-sample · the generative leap (L5.2): a prior you can only *evaluate* ($\Phi$/denoiser) vs one you can *sample* ($x\sim p(x)$) (GenAI) ✅
fig-diffusion-forward-reverse
fig-diffusion-forward-reverse · the two chains: forward $q$ adds Gaussian noise to a real photo; reverse $p_\theta$ denoises back (GenAI) ✅
fig-diffusion-demo
fig-diffusion-demo · live interactive demo (web edition): type a prompt and watch the reverse process denoise from noise, step by step; static fallback is a noise→photo filmstrip (GenAI) ✅
fig-score-is-denoiser
fig-score-is-denoiser · Tweedie: the score = the denoiser's correction toward the data manifold; one arrow, two names (GenAI) ✅
fig-latent-diffusion
fig-latent-diffusion · encode → diffuse in a compressed latent → decode; prompt conditions by cross-attention (Stable Diffusion) (GenAI) ✅
fig-posterior-sampling
fig-posterior-sampling · generative priors for inverse problems: one degraded $y$ → many plausible samples $x\sim p(x\mid y)$ (GenAI) ✅
fig-conditioning-controlnet
fig-conditioning-controlnet · one prompt + a spatial hint (edges / pose / depth) → a generated image obeying both (GenAI) ✅
This chapter is the **generative limit** of the two before it. *Machine learning* replaced a hand-designed prior with a **learned** one (L5.3); *Super-resolution* showed the prior is **not optional** and that a **denoiser is a universal prior** you can plug into any solver (L5.4, PnP/RED, and the punchline that the **score is a denoiser**). Here that same prior becomes something you can **sample from** — a generative model — and the canonical one, **diffusion**, is literally that denoiser run in a loop. We reference the ML / deep-learning refresher ([[Refreshers#Machine learning and deep learning]]) for U-Nets, transformers, and attention; this chapter does **not** re-teach networks — it surveys the *generative* idea and where it plugs back into the book's inverse-problem spine.
equations
forward (noising) process $x_t = \sqrt{\bar\alpha_t}\,x_0 + \sqrt{1-\bar\alpha_t}\,\epsilon$, $\epsilon\sim\mathcal N(0,I)$
training loss (predict the noise) $\mathbb{E}_{x_0,\epsilon,t}\big\lVert \epsilon - \epsilon_\theta(x_t, t)\big\rVert^2$
Tweedie / score = denoiser $\hat x_0 = x_t + \sigma_t^2\,\nabla_{x_t}\log p_{\sigma_t}(x_t)$, i.e. the score and a Gaussian denoiser are the same object
reverse (sampling) step — denoise a little, add a little noise, repeat from $x_T\sim\mathcal N(0,I)$ down to $x_0$
classifier-free guidance $\tilde\epsilon_\theta = \epsilon_\theta(x_t,\varnothing) + w\,\big(\epsilon_\theta(x_t,c) - \epsilon_\theta(x_t,\varnothing)\big)$
posterior sampling for an inverse problem — sample $x\sim p(x\mid y)\propto p(y\mid x)\,p(x)$ by alternating the diffusion prior step with a data-fit step against the forward model $A$ (a PnP/RED solver with a generative prior)
▸7.5 Image priors⧉
fig-pnp-loop
fig-pnp-loop · Plug-and-Play / RED: alternate a data-fidelity step with a denoiser-as-prior step until convergence — the prior is a black-box denoiser 🟨
fig-denoiser-as-prior-spectrum
fig-denoiser-as-prior-spectrum · one PnP/RED prior slot, ever-stronger denoisers: hand-built → classical → learned → diffusion score (GenAI / Super-res) ✅
equations
PnP iteration (HQS form) — alternate a **data-fit** step $z \leftarrow \arg\min_x \tfrac{1}{2}\lVert Ax - y\rVert^2 + \tfrac{\rho}{2}\lVert x - \tilde{x}\rVert^2$ and a **denoise** step $\tilde{x} \leftarrow \mathcal{D}_\sigma(z)$ (the prior, *any* denoiser $\mathcal{D}$)
RED gradient $\nabla \Phi(x) = x - \mathcal{D}(x)$ (prior gradient = residual of a denoiser)
Tweedie $\hat{x} = z + \sigma^2\, \nabla_z \log p_\sigma(z)$ (the score IS a Gaussian denoiser → diffusion = iterated $\mathcal{D}$)
7.5.2 The Gaussian prior in closed form: the Wiener filter⧉
7.5.7 Denoisers and noise-dependent scores⧉
▸7.6 Information theory⧉
7.6.2 Compression: the clearest application⧉
7.6.7 Sampling, sparsity, and histogram entropy⧉