Attention Beats Linear for Fast Implicit Neural Representation Generation

Shuyi Zhang, Ke Liu, Jingjun Gu, Xiaoxu Cai, Zhihua Wang, Jiajun Bu, Haishuai Wang

Abstract

Implicit Neural Representations (INRs) have emerged as a powerful paradigm for representing continuous data, such as images and 3D shapes, using neural networks. Traditional INR methods rely heavily on Multi-Layer Perceptrons (MLPs), which often suffer from spectral bias and global interference, limiting their ability to capture fine details efficiently. We present Attention-based Localized INR (ANR), an architecture that replaces linear layers with a localized attention mechanism. ANR utilizes a hyper-network to generate compact "representation tokens" (R-Tokens) and employs a novel L-Softmax to enforce locality. Our experiments demonstrate that ANR significantly outperforms MLP-based baselines in reconstruction accuracy, parameter efficiency, and convergence speed.

Introduction

Implicit Neural Representations (INRs) store data as continuous functions, mapping coordinates (e.g., $x, y$) to values (e.g., RGB colors). While MLPs are the standard choice for these functions, they face significant challenges. Specifically, MLPs are prone to spectral bias, making them naturally better at learning low-frequency patterns than sharp edges or high-frequency textures. To adapt to specific data instances, researchers often use hyper-networks to predict MLP weights, but this leads to a "parameter explosion" and global interference, where local changes affect the entire output. This paper proposes a shift in architecture: replacing traditional linear layers with localized attention to create more efficient and detailed representations.

Methodology: Attention-based Localized INR (ANR)

The proposed ANR framework shifts the paradigm from weight prediction to feature filtering. The architecture consists of three primary components:

  1. Representation Tokens (R-Tokens): Instead of predicting massive weight matrices, a transformer-based hyper-network generates a compact set of feature vectors that encapsulate the content of the data.
  2. Localized Attention Layer (LAL): This layer fuses coordinate features with R-Tokens. Unlike standard attention, which can introduce noise from distant tokens, ANR uses L-Softmax. This thresholded activation clips small weights to zero, forcing the model to focus only on the most relevant local tokens for a given coordinate.
  3. Variational Coordinates: To mitigate aliasing artifacts during super-resolution, the model is trained with small Gaussian shifts applied to input coordinates, ensuring a stable and continuous mapping.
Overview of the Neural Representation Predicting Framework and the ANR architecture compared to traditional MLP-based INRs.

Experiments and Results

The authors evaluated ANR across diverse datasets, including CelebA (faces), LSUN (complex outdoor scenes), ERA5 (numerical climate data), and ShapeNet (3D shapes).

Superior Reconstruction Quality

ANR demonstrates a remarkable leap in reconstruction fidelity. On the CelebA dataset, ANR reached a PSNR of 47.25dB, dwarfing the 37.95dB achieved by the previous state-of-the-art (IPC). Visual results show that ANR captures fine details, such as individual hair strands and skin textures, which are often blurred by MLP-based methods. This is largely due to the Localized Attention Layer acting as a signal filter, seeking the right information from R-Tokens rather than constructing the signal from scratch.

Qualitative comparison of image reconstruction on CelebA and LSUN datasets, showing ANR's superior detail and PSNR.

Efficiency and Convergence

By decoupling the representation size from the network depth, ANR achieves higher accuracy with fewer parameters per instance compared to methods like TransINR. Furthermore, the localized nature of the attention mechanism leads to faster convergence, as the model avoids backpropagating gradients through irrelevant parts of the representation.

Conclusion

Attention-based Localized INR (ANR) represents a significant advancement in the field of implicit representations. By replacing global linear layers with localized attention, the framework overcomes the traditional limitations of MLPs regarding high-frequency details and parameter efficiency. While future work remains in scaling these representations for large-scale generative tasks, ANR sets a new benchmark for fast and high-fidelity data representation.

Summary updated

BibTeX
@inproceedings{zhang2024attention,
  author = {Shuyi Zhang and Ke Liu and Jingjun Gu and Xiaoxu Cai and Zhihua Wang and Jiajun Bu and Haishuai Wang},
  title = {{Attention Beats Linear for Fast Implicit Neural Representation Generation}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73668-1\_1},
}
Figure