用卷积模拟注意力,提升图像超分辨率效率
Emulating Self-attention with Convolution for Efficient Image Super-Resolution
- 设计卷积化注意力模块,用单个大核和动态核替代自注意力
- 在Urban100×2上提升PSNR 0.31dB,延迟和内存降低16倍、12.2倍
- 适合追求高效超分辨率的开发者,尤其轻量级部署场景
本文针对Transformer在高效图像超分辨率(SR)中计算开销高的问题,提出一种名为卷积化注意力(ConvAttn)的模块,通过共享大核与动态核模拟自注意力的长程建模能力和实例相关加权。该方法显著减少对自注意力及其高内存操作的依赖,同时保持Transformer的表征能力。我们还解决了将Flash Attention引入轻量级SR的难题,将窗口大小扩展至32×32,而非设计复杂自注意力模块。在Urban100×2上,该方法使PSNR提升0.31dB,延迟和内存分别降低16×和12.2×。基于此,提出的ESC网络在Urban100×4上相较HiT-SRF提升PSNR 0.27dB,延迟和内存降低3.7×和6.2×。大量实验表明,即便大部分自注意力被替换,ESC仍具备长程建模、数据可扩展性及Transformer的表征力。
原文摘要 · Abstract (English)
In this paper, we tackle the high computational overhead of Transformers for efficient image super-resolution~(SR). Motivated by the observations of self-attention's inter-layer repetition, we introduce a convolutionized self-attention module named Convolutional Attention~(ConvAttn) that emulates self-attention's long-range modeling capability and instance-dependent weighting with a single shared large kernel and dynamic kernels. By utilizing the ConvAttn module, we significantly reduce the reliance on self-attention and its involved memory-bound operations while maintaining the representational capability of Transformers. Furthermore, we overcome the challenge of integrating flash attention into the lightweight SR regime, effectively mitigating self-attention's inherent memory bottleneck. We scale up the window size to 32$\times$32 with flash attention rather than proposing an intricate self-attention module, significantly improving PSNR by 0.31dB on Urban100$\times$2 while reducing latency and memory usage by 16$\times$ and 12.2$\times$. Building on these approaches, our proposed network, termed Emulating Self-attention with Convolution~(ESC), notably improves PSNR by 0.27 dB on Urban100$\times$4 compared to HiT-SRF, reducing the latency and memory usage by 3.7$\times$ and 6.2$\times$, respectively. Extensive experiments demonstrate that our ESC maintains the ability for long-range modeling, data scalability, and the representational power of Transformers despite most self-attention being replaced by the ConvAttn module.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。