Skip to content

Tikhonov

At a glance

  • Estimates: deconvolved image (the latent image \(\mathbf{x}\), same shape as the data)
  • Noise model: Gaussian (least squares)
  • Streaming: halo
  • Needs many frames: no
  • Reference: Gonzalez and Woods, Digital Image Processing; Bertero and Boccacci, Introduction to Inverse Problems in Imaging, 1998 (textbooks, no DOI)

Overview

Tikhonov deconvolves an image with a known PSF by regularised least squares, solved in closed form by one FFT filter per block. The penalty is either the energy of the image (zero order, identity operator; the same filter as Wiener with a constant noise-to-signal ratio) or its roughness (Laplacian operator, the constrained least-squares filter). As an extension, the regularisation weight can be chosen automatically by generalised cross-validation. Like Wiener, it is fast and linear, so the result may be negative; use Richardson–Lucy or Wiener–Butterworth for a non-negative estimate under Poisson noise.

Image formation (optics)

As for Wiener: a linear, shift-invariant blur \(\mathbf{A}\) by a known PSF \(\mathbf{h}\) of unit sum, plus additive noise (see Image formation and noise).

\[ \mathbf{y} = \mathbf{A}\mathbf{x} + \boldsymbol{\varepsilon} \]
\[ g = A f + w \]
optix Bertero & Boccacci 1998 Meaning Shape
\(\mathbf{y}\) \(g\) recorded image (\(\lvert\Omega\rvert\) pixels) \(\mathbb{R}^{\lvert\Omega\rvert}\), per image
\(\mathbf{x}\) \(f\) latent (sharp) image \(\mathbb{R}^{\lvert\Omega\rvert}\), per image
\(\mathbf{A}\) \(A\) convolution by the PSF \(\mathbb{R}^{\lvert\Omega\rvert\times\lvert\Omega\rvert}\), one per group
\(\hat{h}\) \(\hat{K}\) OTF scalar per frequency, one per group
\(\boldsymbol{\varepsilon}\) \(w\) additive noise \(\mathbb{R}^{\lvert\Omega\rvert}\), per image
\(\lambda\) \(\mu\) regularisation weight scalar, whole stack

The book's \(f\) is the object, not the optix flat field. The class docstring writes \(y = Hf + n\) with \(S\) the PSF and \(\lambda\) the weight.

Probabilistic model

Assumptions: the PSF is known and shift-invariant; the noise is additive and white (so least squares is the right data term); the object is a priori small (identity) or smooth (Laplacian); the image is periodic (FFT model, with the boundary handling of Wiener). The estimate minimises

\[ \hat{\mathbf{x}} = \arg\min_{\mathbf{x}}\; \lVert \mathbf{y} - \mathbf{A}\mathbf{x} \rVert^2 + \lambda \lVert \mathbf{L}\mathbf{x} \rVert^2 , \]

with \(\mathbf{L} \in \mathbb{R}^{\lvert\Omega\rvert\times\lvert\Omega\rvert}\) the identity or the discrete Laplacian (the \(2d+1\)-point stencil, \(d\) the number of spatial axes). Statistically, this is the MAP estimate (here also the posterior mean) under the Gaussian likelihood \(\mathbf{y} \mid \mathbf{x} \sim \mathcal{N}(\mathbf{A}\mathbf{x}, \sigma^2\mathbf{I})\) and the Gaussian prior \(\mathbf{x} \sim \mathcal{N}\bigl(\mathbf{0}, \sigma^2(\lambda\mathbf{L}^\top\mathbf{L})^{-1}\bigr)\) (improper along the constant image for the Laplacian), that is ridge regression with penalty \(\mathbf{L}\). No non-negativity is imposed.

Inference / derivation

Both \(\mathbf{A}\) and \(\mathbf{L}\) are convolutions, diagonal in the Fourier basis, so the normal equations \((\mathbf{A}^\top\mathbf{A} + \lambda\mathbf{L}^\top\mathbf{L})\mathbf{x} = \mathbf{A}^\top\mathbf{y}\) decouple over frequencies and are solved in one step:

\[ \hat{\mathbf{x}}(\boldsymbol{\nu}) = \frac{\hat{h}^*(\boldsymbol{\nu})}{|\hat{h}(\boldsymbol{\nu})|^2 + \lambda |\hat{l}(\boldsymbol{\nu})|^2}\, \hat{\mathbf{y}}(\boldsymbol{\nu}), \qquad |\hat{l}(\boldsymbol{\nu})|^2 = \begin{cases} 1 & \text{identity,}\\ \bigl(\sum_a 4\sin^2(\pi\nu_a)\bigr)^2 & \text{Laplacian.} \end{cases} \]
\[ \hat{f}_\mu(\omega) = \frac{\hat{K}^*(\omega)}{|\hat{K}(\omega)|^2 + \mu\, |\hat{P}(\omega)|^2}\, \hat{g}(\omega). \]
optix Bertero & Boccacci 1998 Meaning Shape
\(\hat{\mathbf{x}}\), \(\hat{\mathbf{y}}\) \(\hat{f}_\mu\), \(\hat{g}\) Fourier transforms of estimate and data \(\mathbb{C}^{\lvert\Omega\rvert}\), per image
\(\hat{h}\) \(\hat{K}\) OTF scalar per frequency, one per group
\(\lambda\) (lam) \(\mu\) regularisation weight scalar, whole stack
\(\hat{l}\) \(\hat{P}\) transfer function of \(\mathbf{L}\) scalar per frequency
\(\boldsymbol{\nu}\) \(\omega\) spatial frequency, cycles per pixel one per spatial axis

\(\lambda \to 0\) gives the inverse filter; larger \(\lambda\) trades resolution for noise. With the Laplacian, the mean of the image (\(\boldsymbol{\nu} = 0\)) is not penalised and is preserved; with the identity it is scaled by \(1/(1 + \lambda)\).

Choosing λ (extension). lam="gcv" picks \(\lambda\) at fit by generalised cross-validation (Golub, Heath and Wahba 1979): with \(r(\boldsymbol{\nu}) = |\hat{h}|^2/(|\hat{h}|^2 + \lambda|\hat{l}|^2)\) the eigenvalues of the influence matrix, the score

\[ V(\lambda) = \lvert\Omega\rvert\,\frac{\sum_{\boldsymbol{\nu}} |(1 - r)\,\hat{\mathbf{y}}|^2}{\bigl(\sum_{\boldsymbol{\nu}} (1 - r)\bigr)^2}, \]

summed over all blocks and images, is minimised over a grid of \(\lambda\) from \(10^{-10}\) to \(10^{2}\), four values per decade. GCV estimates the prediction error without knowing the noise level; a choice at an end of the grid is flagged with a warning. Here \(\lvert\Omega\rvert\) is the total number of pixels summed over. In Bayesian terms, GCV is an empirical (data-driven) choice of the prior precision \(\lambda\), an alternative to empirical Bayes, which would maximise the marginal likelihood of \(\mathbf{y}\) over \(\lambda\) and \(\sigma^2\).

Algorithm

Input: images \(\mathbf{y} \in \mathbb{R}^{\lvert\Omega\rvert}\); PSF \(\mathbf{h}\) of unit sum; lam \(\lambda = 0.01\); operator = "identity"; boundary = "taper" \ Output: the deconvolved images \(\hat{\mathbf{x}} \in \mathbb{R}^{\lvert\Omega\rvert}\); the \(\lambda\) used, in strength.

  1. Choose \(\lambda\) (only with lam="gcv"): evaluate \(V(\lambda)\) on 49 values from \(10^{-10}\) to \(10^{2}\) and keep the minimiser.
  2. Split each image into blocks, each a core plus a halo of at least the PSF size (default twice).
  3. For each block:
    1. extend it smoothly to an FFT grid ("taper"), or keep it as is ("periodic");
    2. filter: \(\hat{\mathbf{x}}(\boldsymbol{\nu}) = \dfrac{\hat{h}^*(\boldsymbol{\nu})}{\lvert\hat{h}(\boldsymbol{\nu})\rvert^2 + \lambda\lvert\hat{l}(\boldsymbol{\nu})\rvert^2}\,\hat{\mathbf{y}}(\boldsymbol{\nu})\);
    3. invert the FFT and keep the core.
  4. Return the assembled \(\hat{\mathbf{x}}\).

Faithful mode and extensions

The textbooks leave \(\lambda\) to be tuned by hand; the faithful and recommended presets coincide.

Keyword Changes Faithful value Recommended value
lam weight \(\lambda \ge 0\), or "gcv" (extension) 0.01 0.01
operator \(\mathbf{L}\): "identity" or "laplacian" "identity" "identity"
boundary "taper" (smooth periodic extension) or "periodic" "taper" "taper"
halo halo per spatial axis, at least the PSF size None (twice the PSF) None
block core block size per spatial axis None (memory budget) None

Extension: fit(y, init=sensor) converts the data to electrons first, as for Wiener.

Memory and streaming

As for Wiener: one pass over the data, block by block with a halo, two FFTs per block. lam="gcv" adds one pass at fit, over blocks without halo, with one FFT each and the score of all 49 values of \(\lambda\) accumulated in float64.

Usage

The example blurs a phantom of thin filaments with a Gaussian PSF and deconvolves it with λ chosen by GCV.

import torch
from optix.deconv import Tikhonov
from optix.models import gaussian_psf, phantoms, simulate_blur

torch.manual_seed(0)

# 1. A Gaussian PSF and a blurred, Poisson-noisy specimen of filaments.
psf = gaussian_psf((15, 15), sigma=2.0)
x = phantoms.filaments((96, 96), intensity=200.0, seed=0) + 5
y = torch.poisson(simulate_blur(x, psf))

# 2. Fit with λ chosen by GCV.
tk = Tikhonov(psf, lam="gcv", operator="laplacian").fit(y)
print(tk.strength)

# 3. Apply.
x_hat = tk.apply(y)

# 4. Compare to the truth: mean error about 21 before, 17 after.
print(float((y - x).abs().mean()), float((x_hat - x).abs().mean()))

Common variations: boundary="periodic" for a circular blur; tikhonov(data, psf, ...) as a shortcut. See the API reference.

References

References

  1. Gonzalez RC, Woods RE. Digital Image Processing, 4th ed., chapter "Image Restoration and Reconstruction". Pearson, 2018. (No DOI.)
  2. Bertero M, Boccacci P. Introduction to Inverse Problems in Imaging. IOP Publishing, 1998. (No DOI.)
  3. Golub GH, Heath M, Wahba G. Generalized cross-validation as a method for choosing a good ridge parameter. Technometrics 21(2):215-223, 1979. doi:10.1080/00401706.1979.10489751
BibTeX
@book{gonzalez2018digital,
  author    = {Gonzalez, Rafael C. and Woods, Richard E.},
  title     = {Digital Image Processing},
  edition   = {4},
  publisher = {Pearson},
  year      = {2018},
}
@book{bertero1998introduction,
  author    = {Bertero, Mario and Boccacci, Patrizia},
  title     = {Introduction to Inverse Problems in Imaging},
  publisher = {IOP Publishing},
  year      = {1998},
}
@article{golub1979generalized,
  author  = {Golub, Gene H. and Heath, Michael and Wahba, Grace},
  title   = {Generalized Cross-Validation as a Method for Choosing a Good Ridge Parameter},
  journal = {Technometrics},
  volume  = {21},
  number  = {2},
  pages   = {215--223},
  year    = {1979},
  doi     = {10.1080/00401706.1979.10489751},
}