Papers › Neural Nearest Neighbors Networks

Neural Nearest Neighbors Networks

30 Oct 2018NeurIPS 2018 12arXiv:1810.12575archive 2025-07-28

Tobias Plötz, Stefan Roth

Non-local methods exploiting the self-similarity of natural signals have been well studied, for example in image analysis and restoration. Existing approaches, however, rely on k-nearest neighbors (KNN) matching in a fixed feature space. The main hurdle in optimizing this feature space w.r.t. application performance is the non-differentiability of the KNN selection rule. To overcome this, we propose a continuous deterministic relaxation of KNN selection that maintains differentiability w.r.t. pairwise distances, but retains the original KNN as the limit of a temperature parameter approaching zero. To exploit our relaxation, we propose the neural nearest neighbors block (N3 block), a novel non-local processing layer that leverages the principle of self-similarity and can be used as building block in modern neural network architectures. We show its effectiveness for the set reasoning task of correspondence classification as well as for image restoration, including image denoising and single image super-resolution, where we outperform strong convolutional neural network (CNN) baselines and recent non-local models that rely on KNN selection in hand-chosen features spaces.

PaperPDFConference PDFCode

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

Code

visinf/n3net officialmentioned in papermentioned on GitHubpytorchNOASSERTION report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

Not run by Syntology. Nothing on this page verifies that the listed code works.

Tasks

DenoisingImage DenoisingImage RestorationImage Super-ResolutionSuper-Resolution

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Grayscale Image Denoising BSD68 sigma25 N3Net PSNR 29.3 #8 of 16 Archive leaderboard report
Grayscale Image Denoising BSD68 sigma50 N3Net PSNR 26.39 #9 of 15 Archive leaderboard report
Grayscale Image Denoising BSD68 sigma70 N3Net PSNR 25.14 #1 of 3 Archive leaderboard report
Grayscale Image Denoising Set12 sigma25 N3Net PSNR 30.55 #5 of 6 Archive leaderboard report
Grayscale Image Denoising Set12 sigma50 N3Net PSNR 27.43 #6 of 8 Archive leaderboard report
Grayscale Image Denoising Set12 sigma70 N3Net PSNR 25.9 #1 of 1 Archive leaderboard report
Grayscale Image Denoising Urban100 sigma25 N3Net PSNR 30.19 #9 of 10 Archive leaderboard report
Grayscale Image Denoising Urban100 sigma25 N3Net SSIM 0.892 #9 of 10 Archive leaderboard report
Grayscale Image Denoising Urban100 sigma50 N3Net PSNR 26.82 #10 of 10 Archive leaderboard report
Grayscale Image Denoising Urban100 sigma70 N3Net PSNR 25.15 #2 of 2 Archive leaderboard report
Image Super-Resolution Set5 - 2x upscaling N3Net PSNR 37.57 #35 of 41 Archive leaderboard report
Image Super-Resolution Set5 - 3x upscaling N3Net PSNR 33.84 #27 of 32 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections