[论文解读] Style Injection in Diffusion: A Training-free Approach for Adapting Large-scale Diffusion Models for Style Transfer
该论文提出了一种无需训练的风格迁移方法,适用于大规模扩散模型,通过自注意力特征操作注入风格——在推理过程中,将内容图像的键(keys)和值(values)替换为风格图像的对应特征。该方法基于局部纹理相似性实现内容结构的保留与风格迁移,无需优化即可达到最先进性能。
Despite the impressive generative capabilities of diffusion models, existing diffusion model-based style transfer methods require inference-stage optimization (e.g. fine-tuning or textual inversion of style) which is time-consuming, or fails to leverage the generative ability of large-scale diffusion models. To address these issues, we introduce a novel artistic style transfer method based on a pre-trained large-scale diffusion model without any optimization. Specifically, we manipulate the features of self-attention layers as the way the cross-attention mechanism works; in the generation process, substituting the key and value of content with those of style image. This approach provides several desirable characteristics for style transfer including 1) preservation of content by transferring similar styles into similar image patches and 2) transfer of style based on similarity of local texture (e.g. edge) between content and style images. Furthermore, we introduce query preservation and attention temperature scaling to mitigate the issue of disruption of original content, and initial latent Adaptive Instance Normalization (AdaIN) to deal with the disharmonious color (failure to transfer the colors of style). Our experimental results demonstrate that our proposed method surpasses state-of-the-art methods in both conventional and diffusion-based style transfer baselines.
研究动机与目标
- 解决现有基于扩散模型的风格迁移方法存在的局限性,这些方法需要耗时的优化过程,如微调或文字反转(textual inversion)。
- 在无需任何微调或优化的情况下,实现对大型预训练扩散模型(如Stable Diffusion)的有效风格迁移。
- 利用自注意力层内在的注意力机制,在保留内容语义和空间布局的同时实现风格迁移。
- 通过查询保留和自适应实例归一化(Adaptive Instance Normalization)缓解内容破坏和色彩不协调等问题。
- 通过可学习参数实现灵活的风格-内容权衡控制,使用户可调节风格化强度。
提出的方法
- 在内容图像前向传播过程中,通过替换自注意力层的键和值特征(使用风格图像的特征),实现风格注入,尤其在对局部纹理敏感的后期解码器层中效果更佳。
- 通过保留原始内容查询特征的一部分实现查询保留,以防止原始图像结构发生失真。
- 引入注意力温度缩放以锐化注意力图,减少模糊性,提升生成图像的细节保真度。
- 在初始潜在空间应用自适应实例归一化(AdaIN),以对齐生成图像与目标风格图像之间的色彩分布。
- 使用可学习参数γ在推理过程中控制内容保留与风格迁移强度之间的权衡。
- 完全在推理阶段运行,无需任何模型微调、文字反转或基于梯度的优化。
实验结果
研究问题
- RQ1能否在预训练扩散模型中操作自注意力特征,实现无需微调或文字反转的无训练风格迁移?
- RQ2将自注意力层的键和值替换为风格图像的特征,是否能有效保留内容结构并基于局部纹理相似性实现风格迁移?
- RQ3查询保留和注意力温度缩放在最小化风格注入过程中的内容破坏方面有多有效?
- RQ4初始潜在空间AdaIN是否能有效解决风格迁移结果中的色彩不协调问题?
- RQ5与现有基线方法相比,该方法在实现灵活风格-内容权衡控制方面能达到何种程度?
主要发现
- 所提方法在风格-弗雷歇 inception 距离(ArtFID)上达到28.80,在FID上达到18.13,优于最先进基线方法,在传统与基于扩散的风格迁移任务中均表现更优。
- 消融实验表明,风格注入对风格迁移至关重要,若移除则ArtFID从28.80升至43.72,FID从18.13升至27.13。
- 注意力温度缩放显著提升图像质量,FID从18.13(τ=1.0)降至17.21(τ=1.5),LPIPS从0.505降至0.535。
- 初始潜在空间AdaIN改善了色彩迁移效果,当移除时LPIPS从0.505降至0.390,表明色彩保真度更高。
- 通过γ参数可实现灵活的风格-内容权衡控制,较低γ值产生更强风格化效果,较高γ值则保留更多内容,该效果在FID与LPIPS指标上均得到验证。
- 与文本引导方法相比,所提方法在风格保真度方面表现更优,因文本提示难以完整捕捉纹理与色彩色调等风格细节。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。