NLSA
A super-resolution network whose non-local attention is computed only within hash buckets of related features.
Diffusion and generative · 548 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 41.8M
- Operations
- 548
- Framework
- PyTorch
- Recurrent
- No
- Published
- CVPR 2021
- Cited by
- 656 (as of 28 October 2026)
- Authors
- Yiqun Mei, Yuchen Fan, Yuqian Zhou
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m18675
- Graph hash
- 798753980e900d99aa3578b2dfacb07a0a6cf9a8c9bb267a35cd4efc1548d42a
- Skeleton hash
- cb7e98497d597a7d18c6478ba00b0d7943fc1c3eed8e0d4388bceb054767e159
- Architecture hash
- 58dbf8bacf5942de2e2261d46fa14b12d15e7029acc1a74b114a9b9df16037d1
- Diagram SHA-256
- 5c19970f4b98defa7f33521e8e1703e10b008060a7fcc5aa2dbabc661e390baf
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
NLSN, the non-local sparse network, is a single image super-resolution model built with a few Non-Local Sparse Attention (NLSA) modules. The paper starts from the view that non-local operations and sparse representation are both crucial for super-resolution, and investigates their combination.
NLSA uses spherical locality sensitive hashing (LSH) to partition the input space into hash buckets of related features. Each query is assigned a bucket, and attention is computed only within that bucket. According to the paper, the resulting sparse attention keeps the model from attending to noisy and less informative locations and reduces the computational cost from quadratic to asymptotically linear in the spatial size.
The official code is built on the PyTorch implementation of EDSR and on reformer-pytorch. Its example command for X2 super-resolution trains on DIV2K with 32 residual blocks, 256 features, 4 hashes and a chunk size of 144.
Key idea. The paper proposes Non-Local Sparse Attention, which uses spherical locality sensitive hashing so that each query attends only within its hash bucket, reducing attention cost from quadratic to asymptotically linear.
- nlsa
- nlsn
- non-local sparse attention
- non-local sparse network
- image super-resolution
- single image super-resolution
- sisr
- locality sensitive hashing
- sparse attention
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@inproceedings{Mei_2021, title={Image Super-Resolution with Non-Local Sparse Attention}, url={http://dx.doi.org/10.1109/cvpr46437.2021.00352}, DOI={10.1109/cvpr46437.2021.00352}, booktitle={2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)}, publisher={IEEE}, author={Mei, Yiqun and Fan, Yuchen and Zhou, Yuqian}, year={2021}, month=June, pages={3516–3525} }