EPLLDenoiser#

class deepinv.models.EPLLDenoiser(GMM=None, n_components=200, pretrained='download', patch_size=6, channels=1, device='cpu')[source]#

Bases: Denoiser

Expected Patch Log Likelihood denoising method.

Denoising method based on the minimization problem

\[\underset{x}{\arg\min} \, \|y-x\|^2 - \sum_i \log p(P_ix)\]

where the first term is a standard L2 data-fidelity, and the second term represents a patch prior via Gaussian mixture models, where \(P_i\) is a patch operator that extracts the ith (overlapping) patch from the image.

Parameters:
  • GMM (None, deepinv.optim.utils.GaussianMixtureModel) – Gaussian mixture defining the distribution on the patch space. None creates a GMM with n_components components of dimension accordingly to the arguments patch_size and channels.

  • n_components (int) – number of components of the generated GMM if GMM is None.

  • pretrained (str, None) – Path to pretrained weights of the GMM with file ending .pt. None for no pretrained weights, "download" for pretrained weights on the BSDS500 dataset, "GMM_lodopab_small" for the weights from the limited-angle CT example. See pretrained-weights for more details.

  • patch_size (int) – patch size.

  • channels (int) – number of color channels (e.g. 1 for gray-valued images and 3 for RGB images)

  • device (str) – defines device (cpu or cuda)

forward(x, sigma, betas=None, batch_size=-1)[source]#

Denoising method based on the minimization problem.

Parameters:
  • y (torch.Tensor) – noisy image. Shape: batch size x …

  • physics (deepinv.physics.LinearPhysics) – Forward linear operator.

  • betas (list[float]) – parameters from the half-quadratic splitting. None uses the standard choice [1,4,8,16,32]/sigma_sq

  • batch_size (int) – batching the patch estimations for large images. No effect on the output, but a small value reduces the memory consumption and might increase the computation time. -1 for considering all patches at once.