An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversion
An Image is Worth One Word: Personalizing Text-to-Image Generation using Textual Inversion0. Abstract1. Introduction3. MethodLatent Diffusion ModelsText embeddingsTextual inversion4. Qualitative comparison and applications4.1. Image variations4.2. Text-guided synthesis4.3. Style Transfer4.4. Concept Compositions4.5. Bias reduction4.6. Downstream applications6. LimitationsReviewReference
0. Abstract
Language-Guided model이 어떻게 사진의 고양이를 painting으로 바꾸거나, 우리가 가장 좋아하는 장난감을 기반으로 한 새로운 product를 디자인하게 만들 수 있을까?
본 논문에서는 유저가 object나 style과 같은 concept에 대해 제공한 3-5장의 이미지만으로 그것을 표현하는 embedding space에서의 새로운 “단어”들을 학습하는 방법론을 제시한다. 특히, 저자들은 single word embedding이 유니크하고 다양한 concept을 capture하기에 충분하다는 증거를 찾았다.
1. Introduction


본 논문에서는 선행 연구들의 challenge들을 pre-trained text-to-image model들의 textual embedding space에서 한 개의 단어를 찾음으로서 극복하는 방식을 제안한다. 저자들은 text-encoding process의 첫 stage를 고려한다(Figure2. 참조). 여기서 input string은 여러개의 token으로 바뀌는데, 각 token은 각각의 embedding vector로 대체되고, 이 vector들이 downstream 모델로 fed된다. 본 논문의 목적은 특정 concept에 대한 새로운 embedding vector를 찾아내는 것이다.
새로운 embedding vector를 새로운 pseudo-word로 표현하는데, 로 나타낸다. 이 pseudo-word는 다른 단어와 마찬가지로 다루어진다. “a photograph of on the beach”, 두 가지 concept으로 구성할 수도 있다. “a drwaing of in the style of ”.
이러한 pseudo-word를 찾기 위해 본 논문에서는 task를 하나의 invesion으로 구성했다. 주어진 pre-trained text-to-image 모델과 small(3-5) image가 있을때, goal은 single word embedding “A photo of ”를 찾는 것으로, 이 embedding은 optimization process를 통해 찾아질 수 있다. 이를 Textual Inversion이라 부른다.
종합하자면, 이 연구의 contribution은
- personalized text-to-image generation task를 소개한다.
- text-encoder embedding space sodml 새로운 pseudo words를 찾는 “Texture-Inversion”을 제시한다.
- GAN-inspired invesion technique를 통해 embedding space를 분석하여 distortion and editability 간의 tradeoff가 있음을 발견했고, tradeoff-curve 상의 최적 point를 제시한다.
- user-provided caption of concepts에 대해 생성된 이미지로 method를 evaluate했고,본 논문의 embedding이 더 높은 visual fidelity와 robust editing이 가능함을 보였다.
3. Method
본 method의 목적은 새로운 user-specified concepts에 대한 language-guided generation이다. 일반적인 text-image 모델에서는 해당 representation에 대한 후보군을 text encoder의 word-embedding 단계에서 찾는다. 그러나 이러한 접근 방식은 이미지에 대한 in-depth visual understanding을 필요로 하지 않는다. 본 논문에서는 GAN inversion에서 영감을 받은 visual reconstruction objective를 제시한다.
Latent Diffusion Models
논문에서는 LDM(Latent Diffusion Model)에 method를 적용했고, text encoder 로 BERT를 사용했다.

Text embeddings
BERT와 같은 typical text encoder 모델은 아래와 같이 Tokenization과 unique vector로 embedding하는 과정을 거친다. 이 embedding space를 inversion target으로 선택하고 S와 관련된 vector를 v로 교체한다.

Textual inversion
본 논문에서는 새로운 embedding을 찾기 위해 3~5장 정도의 적은 image를 사용하고, 아래의 LDM loss Eq1. 최적화(최소화)를 통해 를 찾아낸다. generation을 condition하기 위해 CLIP ImageNet templates에서 랜덤하게 샘플된 context texts를 사용한다. “A photo of ”, “A rendition of ”와 같음. Optimization Goal은 아래와 같다.

학습된 LDM을 재사용하기 위해 와 은 fix되었고(Diffusion Model은 fix하고), Text Encoder만 훈련되었다.
4. Qualitative comparison and applications
4.1. Image variations
CLIP-based reconstruction에서, 본 논문의 method가 unique detail과 concept을 잘 capture한다.

4.2. Text-guided synthesis

4.3. Style Transfer
context text를 로 대체하여, style transfer 역시 가능하다.

4.4. Concept Compositions
동시에 여러 word를 추론할 수 있지만, 새로운 word간의 관계 추론에는 어려움을 겪는다.

4.5. Bias reduction
기존의 방법론의 경우에, Figure. 8에서와 같이 '의사'라는 단어에 encoding된 bias(대부분의 의사가 남성인점)를 강조한다. 보다 다양한 소규모 집합에서 새로운 embedding을 학습함으로써 이러한 bias를 줄일 수 있음을 보인다(즉, 성별 및 인종적 다양성에 대한 인식을 높일 수 있음).

4.6. Downstream applications

6. Limitations
- 이 methods는 더 많은 자유도를 제공하지만, concept의 “semantic” essence를 파악하거나, 정확한 shape을 학습하는데에는 어려움이 있다.
- 최적화가 오래걸린다. 하나의 concept를 학습하는 데 약 2시간이 소요된다.
Review
사실 Dreambooth나 Prompt-to-Prompt에 비해서 임팩트는 조금 떨어지는 듯 하다.. Diffusion Model 아키텍쳐를 건드리지 않았다는 부분이 득이자 실이 아닐지..?