PatchCovarianceNoiseEstimator#
- class deepinv.models.PatchCovarianceNoiseEstimator[source]#
Bases:
ModulePach Covariance Gaussian noise level estimator.
This method was initially proposed in Chen et al.[1]. Given a noisy image \(y = x + n\) where \(n \sim \mathcal{N}(0, \sigma^2)\), this estimator computes an estimate of \(\sigma\) based on the eigenvalues of the covariance matrix of image patches.
Warning
This estimator assumes that the noise in the corrupted image follows a Gaussian distribution. It may not perform well if the noise distribution deviates significantly from Gaussian, or if the image lacks sufficient homogeneous regions for reliable patch statistics.
- Examples:
>>> import deepinv as dinv >>> from deepinv.models import PatchCovarianceNoiseEstimator >>> rng = torch.Generator('cpu').manual_seed(0) >>> noise = dinv.physics.GaussianNoise(0.1, rng=rng)(torch.zeros(1, 1, 256, 256)) >>> noise_estimator = PatchCovarianceNoiseEstimator() >>> sigma_est = noise_estimator(noise) >>> print(sigma_est) tensor([0.0995])
- References:
- static estimate_noise(x, pch_size=8)[source]#
Estimates noise level in image im.
- Parameters:
x (torch.Tensor) – input image
- Returns:
(
torch.Tensor) estimated noise level- Return type:
- forward(x)[source]#
Forward pass.
- Parameters:
x (torch.Tensor) – input image
- Returns:
(
torch.Tensor) estimated noise level- Return type: