skimage 0.17.2

NotesParametersReturnsBackRef
calibrate_denoiser(image, denoise_function, denoise_parameters, *, stride=4, approximate_loss=True, extra_output=False)

The returned function is partially evaluated with optimal parameter values set for denoising the input image.

Notes

The calibration procedure uses a self-supervised mean-square-error loss to evaluate the performance of J-invariant versions of :None:None:`denoise_function`. The minimizer of the self-supervised loss is also the minimizer of the ground-truth loss (i.e., the true MSE error) [1]. The returned function can be used on the original noisy image, or other images with similar characteristics.

Increasing the stride increases the performance of :None:None:`best_denoise_function`

at the expense of increasing its runtime. It has no effect on the runtime of the calibration.

Parameters

image : ndarray

Input data to be denoised (converted using img_as_float ).

denoise_function : function

Denoising function to be calibrated.

denoise_parameters : dict of list

Ranges of parameters for :None:None:`denoise_function` to be calibrated over.

stride : int, optional

Stride used in masking procedure that converts :None:None:`denoise_function` to J-invariance.

approximate_loss : bool, optional

Whether to approximate the self-supervised loss used to evaluate the denoiser by only computing it on one masked version of the image. If False, the runtime will be a factor of :None:None:`stride**image.ndim` longer.

extra_output : bool, optional

If True, return parameters and losses in addition to the calibrated denoising function

Returns

best_denoise_function : function

The optimal J-invariant version of :None:None:`denoise_function`.

If `extra_output` is True, the following tuple is also returned:
(parameters_tested, losses) : tuple (list of dict, list of int)

List of parameters tested for :None:None:`denoise_function`, as a dictionary of kwargs Self-supervised loss for each set of parameters in :None:None:`parameters_tested`.

Calibrate a denoising function and return optimal J-invariant version.

Examples

This example is valid syntax, but we were not able to check execution
>>> from skimage import color, data
... from skimage.restoration import denoise_wavelet
... import numpy as np
... img = color.rgb2gray(data.astronaut()[:50, :50])
... noisy = img + 0.5 * img.std() * np.random.randn(*img.shape)
... parameters = {'sigma': np.arange(0.1, 0.4, 0.02)}
... denoising_function = calibrate_denoiser(noisy, denoise_wavelet,
...  denoise_parameters=parameters)
... denoised_img = denoising_function(img)
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.restoration.j_invariant.calibrate_denoiser

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/restoration/j_invariant.py#161
type: <class 'function'>
Commit: