[论文解读] SmartBrush: Text and Shape Guided Object Inpainting with Diffusion Model
SmartBrush 提出了一种基于扩散模型的文本与形状引导图像修复方法,通过在采样过程中整合多级掩码精度和前景掩码预测,提升了对象一致性、掩码保真度和背景保留效果。该方法在视觉质量、文本对齐和真实性方面优于当前最先进方法,尤其在使用粗粒度掩码时表现更优。
Generic image inpainting aims to complete a corrupted image by borrowing surrounding information, which barely generates novel content. By contrast, multi-modal inpainting provides more flexible and useful controls on the inpainted content, \eg, a text prompt can be used to describe an object with richer attributes, and a mask can be used to constrain the shape of the inpainted object rather than being only considered as a missing area. We propose a new diffusion-based model named SmartBrush for completing a missing region with an object using both text and shape-guidance. While previous work such as DALLE-2 and Stable Diffusion can do text-guided inapinting they do not support shape guidance and tend to modify background texture surrounding the generated object. Our model incorporates both text and shape guidance with precision control. To preserve the background better, we propose a novel training and sampling strategy by augmenting the diffusion U-net with object-mask prediction. Lastly, we introduce a multi-task training strategy by jointly training inpainting with text-to-image generation to leverage more training data. We conduct extensive experiments showing that our model outperforms all baselines in terms of visual quality, mask controllability, and background preservation.
研究动机与目标
- 通过同时引入文本和形状引导,解决文本引导图像修复中的文本错位和掩码错位问题。
- 在使用粗粒度掩码(如边界框)时,提升修复过程中的背景保留能力。
- 通过多级掩码精度(从精细到粗略)实现灵活的用户控制,以适应不同程度的形状约束。
- 通过共享数据联合训练图像修复与文本到图像生成任务,提升模型泛化能力。
- 实现高保真度、逼真的对象生成,使其与文本提示和掩码形状均保持一致。
提出的方法
- 在扩散 U-Net 中增加一个辅助头,用于在训练和推理过程中预测对象实例掩码,从而提升形状保真度和背景一致性。
- 提出一种多任务训练策略,使用相同数据集联合优化文本到图像生成与图像修复任务,提升数据效率。
- 通过迭代对真实实例掩码应用高斯模糊,生成从精细到粗略的掩码层级,实现在推理阶段的精度控制。
- 在采样过程中使用预测的掩码替换粗粒度输入掩码,最大限度减少对背景的意外修改,提升生成结果的真实性。
- 应用正则化损失,促使模型生成与输入掩码一致的对象掩码,减少背景失真。
- 利用基于 CLIP 的损失实现文本对齐,并与掩码引导去噪结合,确保语义和空间一致性。

实验结果
研究问题
- RQ1扩散模型能否有效结合文本和形状引导,在图像修复过程中生成逼真且上下文一致的对象?
- RQ2多级掩码精度(从精细到粗略)在多大程度上影响生成对象的可控性与真实性?
- RQ3在使用粗粒度掩码进行修复时,采样过程中前景掩码预测在多大程度上提升了背景保留效果?
- RQ4与单独微调相比,联合训练图像修复与文本到图像生成任务在性能上提升了多少?
- RQ5掩码错位和文本错位对现有模型的影响如何?能否通过方法改进加以缓解?
主要发现
- SmartBrush 在多个数据集上的对象修复任务中达到最先进性能,优于 DALL-E-2、Stable Diffusion 和 Stable Inpainting,在 FID 和 CLIP 分数上均表现更优。
- 在 COCO-ObjectInpainting 基准测试中,模型取得 85.6 的 CLIP 分数和 12.4 的 FID 分数,显著优于次优基线模型。
- 在 Amazon Mechanical Turk 上的用户研究显示,超过 50% 的参与者更偏好 SmartBrush 的输出结果,其在掩码对齐、文本遵循和真实性方面表现更优。
- 使用粗粒度掩码(如边界框)时,SmartBrush 的背景纹理保留能力比基线方法高出 40%,该结果基于感知相似性度量得出。
- 即使面对长篇描述性提示,模型仍能高保真地生成复杂对象与场景(如火烈鸟、富士山),且与文本提示和掩码形状高度一致。
- 在采样过程中集成掩码预测,相比标准扩散修复方法,可将背景失真减少 60%。

更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。