📄

Paper

Entry
データセットに存在しない画像を生成するために
Type
Paper
Year
2022
Posted at
January 10, 2024
Tags

image

Overview

  • StyleGANの画像生成能力はすごい。でもデータセットに「実在しない」画像、事実と異なる(counterfactual)データを生成するのは難しい (← アーティスティックな用途では重要!!!) → CLIPモデルを使って生成される画像の方向性を操作することで、学習データには存在しない画像(例えば上の図の青い犬、緑の口紅)の生成に成功
  • 普通にCLIPで最適化すると局所解に陥ってしまう。→ 新しい誤差関数を定義することで回避。

Abstract

Leveraging StyleGAN's expressivity and its disentangled latent codes, existing methods can achieve realistic editing of different visual attributes such as age and gender of facial images. An intriguing yet challenging problem arises: Can generative models achieve counterfactual editing against their learnt priors? Due to the lack of counterfactual samples in natural datasets, we investigate this problem in a text-driven manner with Contrastive-Language-Image-Pretraining (CLIP), which can offer rich semantic knowledge even for various counterfactual concepts. Different from in-domain manipulation, counterfactual manipulation requires more comprehensive exploitation of semantic knowledge encapsulated in CLIP as well as more delicate handling of editing directions for avoiding being stuck in local minimum or undesired editing. To this end, we design a novel contrastive loss that exploits predefined CLIP-space directions to guide the editing toward desired directions from different perspectives. In addition, we design a simple yet effective scheme that explicitly maps CLIP embeddings (of target text) to the latent space and fuses them with latent codes for effective latent code optimization and accurate editing. Extensive experiments show that our design achieves accurate and realistic editing while driving by target texts with various counterfactual concepts.

Motivation

  • StyleGANの画像生成をテキストで操作する仕組みとして、CLIPのスコアを直接最適化するStyleCLIPなどの先行研究があるが、局所解に陥りやすい / 学習データにないデータを生成するのはやはり難しい
  • DALL-Eなどのより表現力の高い画像生成モデルが出てきた → 全体的に counterfactual な画像を生成することはできても、ローカルな特徴ではダメ..

Architecture

  • CLIPを使った最適化
    • CLIPで直接最適化 Global CLIP Loss
    • Lglobal =1cos(EI(Iedit ),ET(ttgt )),\mathcal{L}_{\text {global }}=1-\cos \left(E_I\left(I_{\text {edit }}\right), E_T\left(t_{\text {tgt }}\right)\right),

      EI,ETE_I, E_T はそれぞれ画像とテキストのCLIPエンコーダ

      これだと画像に無意味な変更を加えるだけでCLIPが騙されてしまう

    • Directional CLIP Los
    • image

      tsrct_{src} はニュートラルなテキスト (”Face”, “Dog” etc)

Results

Further Thoughts

  • 事実でない画像を生成するというと、あまり用途がないように感じるかもしれないが、アートの領域では、学習データからいかに乖離した、新奇なデータを生成するかが肝になる。

Links