[论文解读] The CLIP Model is Secretly an Image-to-Prompt Converter
该论文揭示,Stable Diffusion 中使用的 CLIP 模型通过从 EOS 标记嵌入与视觉特征之间学习到的对齐关系推导出的闭式线性投影矩阵,本质上充当了图像到提示的转换器。该方法名为 SD-IPC,可实现即时图像到提示的转换,在仅需极少量微调(约 100 张图像或约 30 次在线训练步骤)的情况下,实现了图像变化与编辑任务的最先进性能。
The Stable Diffusion model is a prominent text-to-image generation model that relies on a text prompt as its input, which is encoded using the Contrastive Language-Image Pre-Training (CLIP). However, text prompts have limitations when it comes to incorporating implicit information from reference images. Existing methods have attempted to address this limitation by employing expensive training procedures involving millions of training samples for image-to-image generation. In contrast, this paper demonstrates that the CLIP model, as utilized in Stable Diffusion, inherently possesses the ability to instantaneously convert images into text prompts. Such an image-to-prompt conversion can be achieved by utilizing a linear projection matrix that is calculated in a closed form. Moreover, the paper showcases that this capability can be further enhanced by either utilizing a small amount of similar-domain training data (approximately 100 images) or incorporating several online training steps (around 30 iterations) on the reference images. By leveraging these approaches, the proposed method offers a simple and flexible solution to bridge the gap between images and text prompts. This methodology can be applied to various tasks such as image variation and image editing, facilitating more effective and seamless interaction between images and textual prompts.
研究动机与目标
- 为解决文本提示在捕捉参考图像中隐含视觉细节方面的局限性。
- 在无需昂贵重训练的情况下,实现高效图像到提示的转换。
- 为现有图像变化模型(如 SD-R)提供一种简单、灵活且低成本的替代方案。
- 证明 CLIP 学习到的结构可通过 EOS 标记自然支持图像到文本的转换。
- 通过极少量数据或在线微调,实现对定制化图像生成的快速适应。
提出的方法
- 利用从 CLIP 预训练权重中推导出的闭式逆投影矩阵,将视觉嵌入转换为与 Stable Diffusion 兼容的文本嵌入。
- 发现图像生成控制主要由 EOS 标记嵌入驱动,从而可仅使用起始和结束标记实现有效提示。
- 采用参数高效的微调,仅需约 100 张图像和 1 个 GPU 小时,即可提升内容保留率与定制化能力。
- 在参考图像上应用约 30 次迭代的在线微调,以使模型适应特定概念。
- 将 SD-IPC 初始化作为基于提示和 U-Net 交叉注意力微调的强初始起点。
- 结合 CLIP 提示微调与 U-Net 交叉注意力层微调,以在图像编辑与变化任务中实现最佳性能。
实验结果
研究问题
- RQ1CLIP 的预训练权重是否可在无需重训练的情况下被重新用作图像到提示的转换器?
- RQ2为何仅保留起始和结束标记而屏蔽所有其他词标记,仍能生成高质量图像?
- RQ3如何利用 CLIP 模型的内在结构实现即时图像到提示的转换?
- RQ4使用少量微调数据对图像变化质量与内容保留率有何影响?
- RQ5在 SD-IPC 方法初始化的前提下,使用极少迭代次数的在线微调能否实现有效定制?
主要发现
- SD-IPC 方法在 DreamBooth 基准测试中取得 52.03 的 DNIO 得分,优于 DreamBooth(60.11)在身份保留方面的表现,同时保持了强大的编辑能力。
- SD-IPC-FT 在文本编辑图像变化任务中取得 28.69 的 CLIP-T 得分,超过 SD-R(26.01),在编辑与身份保留方面均表现出色。
- SD-IPC 中使用逆投影矩阵显著降低了过拟合风险,相较于从零开始训练全连接层,消融实验已证实此优势。
- 同时微调 CLIP 提示与 U-Net 交叉注意力层可获得最佳性能,DNIO 达 52.03,CLIP-I 达 79.59。
- 该方法仅需 100 张图像和 1 个 GPU 小时即可实现高效的图像变化,展现出极高的数据效率。
- SD-IPC 初始化使在线微调仅需约 30 次迭代即可获得高质量结果,凸显其在定制化任务中强大的归纳偏置。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。