22-05
Inverse problems using diffusion models
- What are the definition of inverse problems? , where is noise (random, unavoidable errors), is the true state that we want to know, and is a measurement function (corruption or transformation function).
- Examples:
- Blurring: y = blurred image, x = clean image, A = nearby pixel averaging
- Mask & Delete: y = masked image, x = clean image, A = cuts gray box
- Pose estimation: y = three floating dots, x = 3D human pose, A = motion capture system.
- Usually, forward problems (solving for y from x) are solved by using plain physics. And for inverse problems, When is computable, x can be directly solved. But, for most inverse problems, A is invertible, and there are many possible for the same y. Thus, the problem is said to be ill-posed.
- The classical line of attack solves for minimum distance between the solution () based on some prior :
- Many works have explored different types of regularizers:
- Total variation (TV) regularization: , where which is the L1 norm of the gradient. So, the regularizer restricts total variation in a single update, and selects that prevents a spike change.
- Truncated SVD: We decompose A into SVD components: , and write the naive pseudo-inverse solution as . For small eigenvalues, in ill-posed inverse problems some eigenvalues rapidly decay to zero. Dividing a noisy measurement with a small , scales the noise massively. TSVD truncates problematic small singular values by choosing a truncation threshold , keeping the first k singular values, and discarding the rest by setting them to zero. Thus, TSVD solution can be formulated as .
- Bayesian inference: We treat as random variable, and apply Bayes’ law to compute the posterior: , where the likelihood is regularized by a prior. Taking the argmax of the posterior gives a suitable solution . But finding suitable prior is not straightforward.
- This is where generative models simplified the scope of the problem. Generative models are excellent at learning unknown distributions from samples of the distribution. By using a diffusion model to learn the prior distribution from data, and even generate prior samples based on feedback.
24-05
Pseudo-inverse GDM
- Measurement of some signal: , where and .
- Writing score of posterior using bayes law:
- We know that is intractable to compute, so we marginalize .
- Approximate with a gaussian where is a time-dependent variance that depends on the data,
- the mean is obtained using Tweedie’s formula: .
- When is linear, and measurement is obtained by adding gaussian white noise along with both being Gaussian r.v. implying the distribution of conditioned of is also Gaussian
- And we finally get following approximation to the score. This is interpreted as vector-jacobian product and can be obtained using backpropagation through the network.
- For cases when , above equation can be written as following, and indicates that likelihood guidance term is influenced by the pseudo-inverse of the measurement matrix.
- As notable from the equation derived above, score of the likelihood doesn’t require to be differentiable, because and the pseudo-inverse are used directly as static functions inside the “vector” of the vector-jacobian product. This means doesn’t need to linear or even differentiable.
- For complex non-linear cases, measurement function need to only satisfy the pseudo-inverse property, namely we need to find another function such that .
- Variance of approximation . Assume , then applying Bayes law to . We know that forward noising process adds Gaussian noise with variance , and .
- The posterior turns out to be . So, for and .
- To see how the algorithm behaves (listening to unconditional score vs likelihood as measurement guidance) over time with respect to variance, assume , the weighting factor for the likelihood guidance term comes out to be .
- For , is large, the image is composed of purely white noise, and the model doesn’t know if it’s generating image of a face or cat or dog, meaning the guidance term dominates the unconditional path, and forcefully take the sample towards noisy measurement .
- For , then . So, the noisy measurement term provides little impact, and the algorithm follow the unconditional generation path.