用RWKV架构实现高效高质量图像风格迁移
StyleRWKV: High-Quality and High-Efficiency Style Transfer with RWKV-like Architecture
- 提出Re-WKV注意力机制,实现双向全局感知
- 采用可学习偏移的变形采样层,增强局部特征捕捉
- 设计跳跃扫描方法,保持线性计算复杂度
风格迁移旨在生成保留内容但具有风格源艺术表现的新图像。现有方法多基于Transformer或扩散模型,存在二次计算复杂度和高推理延迟问题。本文提出StyleRWKV框架,利用新兴的RWKV序列模型实现低内存占用与线性时间复杂度下的高质量风格迁移。提出Re-WKV注意力机制,通过双向注意力建立全局感受野;设计可变形位移(Deform-Shifting)层,引入可学习偏移量,使卷积核采样网格能灵活适应感兴趣区域,提升局部依赖建模能力;提出跳过扫描(S-Scanning)方法,有效建立全局上下文关联。大量实验表明,该方法在风格化质量、模型复杂度和推理效率上均优于当前最优方法。
原文摘要 · Abstract (English)
Style transfer aims to generate a new image preserving the content but with the artistic representation of the style source. Most of the existing methods are based on Transformers or diffusion models, however, they suffer from quadratic computational complexity and high inference time. RWKV, as an emerging deep sequence models, has shown immense potential for long-context sequence modeling in NLP tasks. In this work, we present a novel framework StyleRWKV, to achieve high-quality style transfer with limited memory usage and linear time complexity. Specifically, we propose a Recurrent WKV (Re-WKV) attention mechanism, which incorporates bidirectional attention to establish a global receptive field. Additionally, we develop a Deformable Shifting (Deform-Shifting) layer that introduces learnable offsets to the sampling grid of the convolution kernel, allowing tokens to shift flexibly and adaptively from the region of interest, thereby enhancing the model's ability to capture local dependencies. Finally, we propose a Skip Scanning (S-Scanning) method that effectively establishes global contextual dependencies. Extensive experiments with analysis including qualitative and quantitative evaluations demonstrate that our approach outperforms state-of-the-art methods in terms of stylization quality, model complexity, and inference efficiency.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。