Skip to main content
QUICK REVIEW

[논문 리뷰] Improving Diffusion Models for Scene Text Editing with Dual Encoders

Jiabao Ji, Guanhua Zhang|arXiv (Cornell University)|2023. 04. 12.
Generative Adversarial Networks and Image Synthesis인용 수 6
한 줄 요약

이 논문은 문체 제어를 위한 지시 인코더와 철자 정확성을 위한 문자 인코더를 통합한 이중 인코더 확산 모델인 DiffSte를 제안한다. 지시 테이닝을 통해 훈련되어, 미리 보지 않은 폰트, 혼합 폰트 스타일, 자연어 스타일 설명에 대해 제로샷 일반화를 달성하며, 다섯 개의 데이터셋에서 기존 방법보다 텍스트 정확도, 이미지 자연스러움, 스타일 제어 능력 측면에서 뛰어난 성능을 보인다.

ABSTRACT

Scene text editing is a challenging task that involves modifying or inserting specified texts in an image while maintaining its natural and realistic appearance. Most previous approaches to this task rely on style-transfer models that crop out text regions and feed them into image transfer models, such as GANs. However, these methods are limited in their ability to change text style and are unable to insert texts into images. Recent advances in diffusion models have shown promise in overcoming these limitations with text-conditional image editing. However, our empirical analysis reveals that state-of-the-art diffusion models struggle with rendering correct text and controlling text style. To address these problems, we propose DIFFSTE to improve pre-trained diffusion models with a dual encoder design, which includes a character encoder for better text legibility and an instruction encoder for better style control. An instruction tuning framework is introduced to train our model to learn the mapping from the text instruction to the corresponding image with either the specified style or the style of the surrounding texts in the background. Such a training method further brings our method the zero-shot generalization ability to the following three scenarios: generating text with unseen font variation, e.g., italic and bold, mixing different fonts to construct a new font, and using more relaxed forms of natural language as the instructions to guide the generation task. We evaluate our approach on five datasets and demonstrate its superior performance in terms of text correctness, image naturalness, and style controllability. Our code is publicly available. https://github.com/UCSB-NLP-Chang/DiffSTE

연구 동기 및 목표

  • 기존 확산 모델이 시나리오 텍스트 편집 중 정확하고 스타일이 잘 드러나는 텍스트를 생성하는 데에 한계를 보이고 있는 문제를 해결하기 위해.
  • Stable Diffusion와 같은 최신 확산 모델에서 텍스트 가독성이 낮고 스타일 제어 능력이 떨어지는 문제를 극복하기 위해.
  • 새로운 폰트 변형(예: 기울임, 굵게)과 혼합 폰트 스타일에 대해 제로샷 일반화를 가능하게 하기 위해.
  • 예를 들어 '잔디의 색깔처럼' 또는 '불타는 지옥의 불꽃처럼'과 같은 유연한 자연어 지시어를 통해 스타일 제어를 지원하기 위해.
  • 배치 및 방향을 유지하면서 임의의 모양의 마스크 내에서 텍스트 렌더링을 향상시키기 위해.

제안 방법

  • 목표 텍스트를 문자 수준에서 처리하는 문자 인코더와 Stable Diffusion 원본 텍스트 인코더에서 파생된 지시 인코더를 갖춘 이중 인코더 아키텍처를 도입한다.
  • 이미지 생성 중에 문자 수준 임베딩과 지시 임베딩 양쪽을 고려하기 위해 교차 어텐션 메커니즘을 사용한다.
  • 문자 및 지시 임베딩을 통합하여 확산 모델이 철자 오류가 없고 지정된 스타일을 가진 텍스트를 생성하도록 이끈다.
  • 쌍체 지시-이미지 데이터를 기반으로 지시 테이닝 프레임워크를 활용해 모델을 미세조정하여 자연어 기술서를 시각적 텍스트 외관으로 매핑할 수 있도록 교육한다.
  • 최소한의 아키텍처 변경으로도 사전 훈련된 확산 모델(예: Stable Diffusion)을 기반으로 사용한다.
  • 마스크 영역과 텍스트 지시어를 조건으로 하여 임의의 마스크 형태를 지원하며, 레이아웃 인식 텍스트 배치를 가능하게 한다.
Figure 1: Text editing results by GAN-based Mostel , diffusion model SD , and our method DiffSte . A reference Rendered image with desired content and style is fed to Mostel as style guidance. SD and our method are prompted by instruction Write a grass-colored word “DiffSTE” in BadScript font .
Figure 1: Text editing results by GAN-based Mostel , diffusion model SD , and our method DiffSte . A reference Rendered image with desired content and style is fed to Mostel as style guidance. SD and our method are prompted by instruction Write a grass-colored word “DiffSTE” in BadScript font .

실험 결과

연구 질문

  • RQ1이중 인코더 설계가 확산 기반 시나리오 텍스트 편집에서 텍스트 가독성과 철자 정확도를 향상시킬 수 있는가?
  • RQ2지시 테이닝을 통해 기울임, 굵게 등 새로운 폰트 스타일에 대해 제로샷 일반화가 가능한가?
  • RQ3간단한 자연어 프롬프트(예: '글자를 폰트1과 폰트2로 쓰세요')를 통해 두 개의 알려진 폰트를 혼합하여 새로운 폰트 조합을 일반화할 수 있는가?
  • RQ4예를 들어 '라일락' 또는 '불타는 지옥의 불꽃'처럼 다양한 자연어 스타일 기술서를 정확하게 해석하여 텍스트 렌더링을 수행할 수 있는가?
  • RQ5복잡한 비직사각형 마스크 내에서도 적절한 레이아웃과 방향을 가진 텍스트 생성이 가능한가?

주요 결과

  • DiffSte는 COCOText, ICDAR13, TextOCR 등 다섯 개의 벤치마크 데이터셋에서 텍스트 정확도, 이미지 자연스러움, 스타일 제어 능력 측면에서 뛰어난 성능을 달성한다.
  • 자신이 본 적 없는 폰트 스타일(예: 기울임, 굵게)에 대해 제로샷 일반화를 수행하며, 폰트 외삽 예시를 통해 높은 정밀도로 구현된 것으로 확인되었다.
  • 간단한 자연어 프롬프트(예: '폰트 Font1과 Font2로 쓰세요')를 통해 두 개의 알려진 폰트를 혼합하여 하이브리드 폰트를 성공적으로 생성한다.
  • 예를 들어 '망고색' 또는 '깊은 바다의 파란색'처럼 다양한 자연어 스타일 기술서를 정확히 해석하여, 의미적 다양성에 강건함을 입증한다.
  • 매우 굴곡지고 비정형적인 마스크 내에서도 'The five'와 'boxing' 예시에서처럼 적절한 레이아웃과 방향을 가진 텍스트를 생성한다.
  • 지시 테이닝 프레임워크를 통해 명시적인 스타일 레이블이 없이도 자연어 지시어에서 시각적 텍스트 외관으로의 매핑을 학습할 수 있다.
Figure 3: Model structure of DiffSte with dual-encoder design. The input text instruction and the target text spelling are first processed by our instruction encoder $\textsc{Enc}_{\textrm{inst}}$ and character encoder $\textsc{Enc}_{\textrm{char}}$ , respectively. Both encodings are attended to the
Figure 3: Model structure of DiffSte with dual-encoder design. The input text instruction and the target text spelling are first processed by our instruction encoder $\textsc{Enc}_{\textrm{inst}}$ and character encoder $\textsc{Enc}_{\textrm{char}}$ , respectively. Both encodings are attended to the

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.