On Nearest Neighbors in Non Local Means Denoising

Iuri Frosio, Jan KautzarXiv 2017

Abstract

To denoise a reference patch, the Non-Local-Means (NLM) denoising filter processes a set of neighbor patches. Traditionally, a few Nearest Neighbors (NN) are used to limit the computational burden. However, this approach introduces a bias in the denoised patch. We show analytically that the NN approach biases results toward the noise itself and propose a different neighbor collection criterion: Statistical Nearest Neighbors (SNN). Our approach outperforms traditional NN in both white and colored noise scenarios, generating higher quality images with fewer neighbors and lower computational cost.

Introduction

Non-Local Means (NLM) is a cornerstone of image denoising, predicated on the idea that images contain repetitive structures. By averaging a reference patch with similar "neighbor" patches found throughout the image, NLM cancels out random noise while preserving the underlying signal. To maintain computational efficiency, practical implementations often restrict the search to a small set of Nearest Neighbors (NN).

This paper identifies a fundamental flaw in the NN approach: the "Proximity Paradox." In high-dimensional patch spaces, the "nearest" neighbor is often an impostor—near only because its noise fluctuations happen to align with those of the reference patch. This "noise-to-noise matching" introduces a bias that manifests as low-frequency, splotchy artifacts in the final denoised image.

Statistical Nearest Neighbors (SNN)

To address this bias, we propose the Statistical Nearest Neighbors (SNN) criterion. Instead of seeking patches that are as close as possible to the reference, we seek patches that are likely to share the same underlying structure but possess uncorrelated noise.

  1. The NN Approach: Traditionally, we minimize the squared distance $\delta^2$ between a neighbor $\gamma_k$ and the reference $\mu_r$, effectively trying to drive $\delta^2$ to zero.
  2. The SNN Approach: We prove analytically that the expected squared distance between two noisy versions of the same clean patch is $2\sigma^2$, where $\sigma^2$ is the noise variance.
  3. Selection Criterion: SNN selects patches that satisfy: $$|\delta^2(\mu_r, \gamma_k) - o \cdot 2\sigma^2| \approx 0$$ where $o$ is an offset parameter (typically 0.8 to 1.0).
Comparison of Nearest Neighbor (NN) and Statistical Nearest Neighbor (SNN) selection criteria.

By targeting this specific statistical distance, the algorithm ensures "noise orthogonalization"—finding patches where the noise is different enough to be effectively cancelled out during averaging.

Experimental Setup

The SNN method was evaluated against standard benchmarks and real-world data:

  • Kodak Image Dataset: Used for standard benchmarking.
  • Noise Models: Tests included both white Gaussian noise and "colored" noise, the latter simulating correlations introduced by Bayer sensor demosaicing.
  • Real-World Sensor Data: High-resolution images from an NVIDIA Shield tablet (ISO 1200) were used to test performance against actual sensor noise characteristics.

Key Results

The SNN approach demonstrates significant improvements in both perceptual and quantitative quality.

  • Artifact Reduction: SNN drastically reduces the "splotchiness" common in NLM outputs, particularly in flat regions like skin or background walls.
  • Efficiency: Remarkably, 16 well-chosen SNN neighbors can produce higher quality results than 361 traditional NN neighbors. This allows for superior denoising at a fraction of the computational cost.
  • Quantitative Gains: SNN consistently achieves higher Peak Signal-to-Noise Ratio (PSNR) and Feature Similarity Index (FSIMc) compared to NN variants.
Visual and quantitative comparison of denoising results across different image patches.

Discussion and Limitations

While SNN effectively eliminates the low-frequency bias (splotchiness), it can slightly increase high-frequency variance (fine-grained noise) because the selected neighbors are statistically further away. However, human perception is far more tolerant of fine-grained noise than structured, splotchy artifacts.

The method's performance is dependent on accurate noise power ($\sigma^2$) estimation. While standard estimation techniques are effective, the accuracy of SNN is inherently tied to this parameter. Future work may explore more complex noise models beyond the zero-mean Gaussian assumption, potentially extending SNN's utility to a wider range of sensor types and lighting conditions.

Summary updated

BibTeX
@misc{frosio2017nearest,
  author = {Iuri Frosio and Jan Kautz},
  title = {{On Nearest Neighbors in Non Local Means Denoising}},
  year = {2017},
  eprint = {1711.07568},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1711.07568},
}
Figure