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.
| Task | Dataset | Metric | Value | Model |
|---|---|---|---|---|
| Super-Resolution | Set5 - 3x upscaling | PSNR | 33.84 | N3Net |
| Super-Resolution | Set5 - 2x upscaling | PSNR | 37.57 | N3Net |
| Denoising | Urban100 sigma25 | PSNR | 30.19 | N3Net |
| Denoising | Urban100 sigma25 | SSIM | 0.892 | N3Net |
| Denoising | Set12 sigma50 | PSNR | 27.43 | N3Net |
| Denoising | Urban100 sigma50 | PSNR | 26.82 | N3Net |
| Denoising | BSD68 sigma70 | PSNR | 25.14 | N3Net |
| Denoising | BSD68 sigma25 | PSNR | 29.3 | N3Net |
| Denoising | Urban100 sigma70 | PSNR | 25.15 | N3Net |
| Denoising | Set12 sigma25 | PSNR | 30.55 | N3Net |
| Denoising | BSD68 sigma50 | PSNR | 26.39 | N3Net |
| Denoising | Set12 sigma70 | PSNR | 25.9 | N3Net |
| Image Super-Resolution | Set5 - 3x upscaling | PSNR | 33.84 | N3Net |
| Image Super-Resolution | Set5 - 2x upscaling | PSNR | 37.57 | N3Net |
| 3D Architecture | Urban100 sigma25 | PSNR | 30.19 | N3Net |
| 3D Architecture | Urban100 sigma25 | SSIM | 0.892 | N3Net |
| 3D Architecture | Set12 sigma50 | PSNR | 27.43 | N3Net |
| 3D Architecture | Urban100 sigma50 | PSNR | 26.82 | N3Net |
| 3D Architecture | BSD68 sigma70 | PSNR | 25.14 | N3Net |
| 3D Architecture | BSD68 sigma25 | PSNR | 29.3 | N3Net |
| 3D Architecture | Urban100 sigma70 | PSNR | 25.15 | N3Net |
| 3D Architecture | Set12 sigma25 | PSNR | 30.55 | N3Net |
| 3D Architecture | BSD68 sigma50 | PSNR | 26.39 | N3Net |
| 3D Architecture | Set12 sigma70 | PSNR | 25.9 | N3Net |
| 3D Object Super-Resolution | Set5 - 3x upscaling | PSNR | 33.84 | N3Net |
| 3D Object Super-Resolution | Set5 - 2x upscaling | PSNR | 37.57 | N3Net |
| 16k | Set5 - 3x upscaling | PSNR | 33.84 | N3Net |
| 16k | Set5 - 2x upscaling | PSNR | 37.57 | N3Net |