Skip to main content
QUICK REVIEW

[论文解读] ContraCLIP: Interpretable GAN generation driven by pairs of contrasting sentences

Christos Tzelepis, J. E. Oldfield|arXiv (Cornell University)|Jun 5, 2022
Multimodal Machine Learning Applications被引用 8
一句话总结

ContraCLIP 提出了一种模型无关的方法,通过使用成对的对比性自然语言句子(称为语义二极管)来学习预训练 GAN 中的非线性、可解释的潜在路径。通过将这些句子对投影到 CLIP 的视觉-语言空间,并使用 RBF 变形来定义方向性路径,该方法实现了平滑、高质量的图像操作,同时保持身份一致性和语义属性对齐,在多种 GAN 架构和数据集上的定性和定量基准测试中均优于先前方法。

ABSTRACT

This work addresses the problem of discovering non-linear interpretable paths in the latent space of pre-trained GANs in a model-agnostic manner. In the proposed method, the discovery is driven by a set of pairs of natural language sentences with contrasting semantics, named semantic dipoles, that serve as the limits of the interpretation that we require by the trainable latent paths to encode. By using the pre-trained CLIP encoder, the sentences are projected into the vision-language space, where they serve as dipoles, and where RBF-based warping functions define a set of non-linear directional paths, one for each semantic dipole, allowing in this way traversals from one semantic pole to the other. By defining an objective that discovers paths in the latent space of GANs that generate changes along the desired paths in the vision-language embedding space, we provide an intuitive way of controlling the underlying generative factors and address some of the limitations of the state-of-the-art works, namely, that a) they are typically tailored to specific GAN architectures (i.e., StyleGAN), b) they disregard the relative position of the manipulated and the original image in the image embedding and the relative position of the image and the text embeddings, and c) they lead to abrupt image manipulations and quickly arrive at regions of low density and, thus, low image quality, providing limited control of the generative factors. We provide extensive qualitative and quantitative results that demonstrate our claims with two pre-trained GANs, and make the code and the pre-trained models publicly available at: https://github.com/chi0tzp/ContraCLIP

研究动机与目标

  • 以模型无关的方式发现预训练 GAN 潜在空间中的非线性、可解释路径。
  • 解决现有方法的局限性,包括架构特定设计、忽略嵌入空间中相对位置关系,以及产生突兀、低质量图像操作的问题。
  • 通过自然语言实现对生成因素的直观语义控制,无需预训练检测器或标注数据。
  • 通过利用 CLIP 嵌入空间中的相对位置,确保在属性编辑过程中保持高图像质量和身份一致性。
  • 在多种 GAN 架构和图像领域(包括非人脸数据集)中展示泛化能力。

提出的方法

  • 语义二极管被定义为具有对比语义的自然语言句子对,例如 '一个年轻人' 与 '一个老人',用作潜在路径的语义边界。
  • 这些句子被编码到 CLIP 的视觉-语言空间中,其嵌入形成‘二极管’,定义所需潜在路径的方向和边界。
  • 在 CLIP 文本空间上应用基于 RBF 的变形函数,生成连接每个语义二极管两极之间的非线性、平滑方向路径。
  • 通过优化对比损失,使 GAN 的潜在空间遍历与 CLIP 嵌入空间中的非线性路径对齐,确保图像生成遵循期望的语义轨迹。
  • 采用端到端训练,损失函数鼓励生成图像匹配目标文本嵌入,同时在 CLIP 空间中保持原始图像与编辑后图像之间的相对位置。
  • 该方法被应用于多种预训练 GAN,包括 StyleGAN2 和 ProGAN,并在人脸和非人脸数据集(如 AFHQ 猫、狗、LSUN 汽车)上进行测试,证明其在面部编辑之外的泛化能力。

实验结果

研究问题

  • RQ1能否仅通过成对的对比性自然语言句子,在预训练 GAN 的潜在空间中发现非线性、可解释的路径?
  • RQ2所提出的方法是否能在 GAN 架构未专门为此类控制设计的情况下,保持身份并生成高质量图像?
  • RQ3与现有方法(如 StyleCLIP)相比,该方法在图像质量、身份保持和语义一致性方面表现如何?
  • RQ4该方法对超参数(如对比损失中的温度)是否具有鲁棒性?
  • RQ5该方法能否在多种 GAN 架构和图像领域(包括非人脸图像)中实现泛化?

主要发现

  • 在所有语义二极管中,ContraCLIP 的身份保持得分(平均 ID 分数 0.9245)显著高于 StyleCLIP*(平均 0.5624),表明其在编辑过程中对原始身份的保持能力更优。
  • 对于语义二极管 '一张有胡子的男人的照片' 与 '一张刮须男人的照片',ContraCLIP 的身份保持得分为 0.9407,证明其对胡须属性具有有效控制能力。
  • 该方法在非人脸数据集(如 AFHQ 猫、狗、LSUN 汽车)上实现了高质量、语义一致的图像操作,证实其在以人脸为中心的 GAN 之外也具有泛化能力。
  • 消融研究显示,该方法对超参数(如对比损失中的温度 τ)具有鲁棒性,在 τ ∈ {0.01, 0.1, 0.5, 1.0, 5.0} 范围内均表现稳定。
  • ContraCLIP 学习到的非线性路径相比线性方法,能产生更平滑、渐进的图像过渡,避免了潜在空间中的突变和低密度区域。
  • 在 100 个随机选取的潜在码上的定量结果表明,ContraCLIP 在全部 10 个语义二极管中均持续优于基线方法 StyleCLIP*,其中在 '苍白肤色' 到 '晒黑肤色' 的改进最为显著(ID:0.9344 vs. 0.5642)。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。