TL;DR
This paper introduces HCIIT, a novel two-stage framework for in-image translation that significantly improves consistency in both translation accuracy and image generation. By integrating image context into translation and employing a style-aware diffusion model for image generation, HCIIT produces more natural and visually coherent translated images compared to existing methods.
What Problem Does This Paper Address?
The task of in-image translation (IIT) involves translating text embedded within images and presenting the translation as an image itself. This is crucial for applications like movie posters, children's books, and everyday scene understanding. However, existing IIT methods often struggle with two key aspects: translation consistency (effectively using image information to inform the translation) and image generation consistency (ensuring the translated text's style matches the original image and the background remains coherent). Current approaches either focus on text translation without deep image integration or generate images that lack stylistic harmony with the source. This paper aims to bridge this gap by proposing a framework that explicitly addresses both types of consistency.
Methods
HCIIT employs a two-stage approach:
- Text Image Translation (TIT) using a Multimodal Multilingual Large Language Model (MMLLM):
- This stage focuses on accurately translating text within an image.
- A key innovation here is the use of Chain-of-Thought (CoT) learning. This prompts the MMLLM to go through a reasoning process, incorporating image descriptions and context to resolve ambiguities (e.g., distinguishing between "bank" as a financial institution vs. a riverbank) and improve translation accuracy.
- This stage leverages MMLLMs for their strong image comprehension capabilities, enhanced by CoT for more contextually relevant translations.
- Image Backfilling using a Diffusion Model:
- This stage takes the translated text and generates a new image, integrating it seamlessly.
- The core novelty lies in modifying a standard diffusion model with a style latent module. This module explicitly guides the diffusion process to match the font style, color, and other visual attributes of the original text image.
- Additionally, a glyph latent module is incorporated to ensure precise text positioning and quality.
- The model also uses masked image information to preserve background coherence.
Datasets
- For TIT (Stage 1):
- CoMMuTE dataset: Specifically designed to address lexical ambiguity in image-based translation.
- MTIT6 dataset: A comprehensive multilingual dataset covering six language pairs.
- Real images were also extracted from the OCRMT30K dataset and generated using text-to-image tools for testing.
- For Image Generation (Stage 2):
- Due to the scarcity of stylistically consistent pseudo-parallel image pairs, the authors synthetically generated a large dataset. This involved:
- Using over 20 font styles, random text colors, sizes, and deformations.
- Cropping random images for backgrounds.
- Utilizing parallel corpora from the TIT task for text content.
- They generated 100,000 pairs for training and 200 pairs for testing in French-English and English-Chinese directions.
Key Insights and Ideas
- Consistency is King: The paper strongly argues that for practical in-image translation, both translation accuracy (informed by image context) and visual consistency (style and background) are paramount and often neglected by prior work.
- CoT for Ambiguity Resolution: Chain-of-Thought prompting is a powerful tool for LLMs to resolve semantic ambiguities in image-based translation, leading to more contextually appropriate translations than direct translation.
- Style Latent Module is Crucial: Explicitly incorporating a style latent module into diffusion models is key to achieving consistent text styling in generated images, a significant improvement over methods that infer style solely from surrounding context.
- Synthetic Data for Style Training: Generating synthetic data with diverse styles is an effective strategy to train diffusion models for style-consistent text image generation, overcoming the limitations of scarce real-world data.
Key Results
- Translation Accuracy: HCIIT, particularly with the CoT enhancement, shows superior performance on the CoMMuTE dataset, demonstrating its ability to resolve lexical ambiguities effectively. On the MTIT6 dataset, multimodal models generally outperform traditional ones, with HCIIT's CoT method showing competitive results.
- Image Generation Consistency:
- HCIIT achieves significantly higher SSIM (Structural Similarity Index Measure) and lower L1 (Mean Absolute Error) scores on synthetic datasets compared to AnyTrans and online systems, indicating better image similarity and style preservation.
- Human and LLM evaluations consistently rate HCIIT higher in translation accuracy, font style consistency, and background coherence compared to commercial systems and AnyTrans.
- Ablation studies show that including background information in the style latent module significantly improves performance.
Limitations and Future Work
- Complex Style Transfer: The current method struggles with scenarios where a single sentence contains multiple distinct text styles. This is attributed to limitations in the synthetic data construction process, which may not cover the full spectrum of real-world style variations. Addressing these complex style variations is a key future direction.
- Detailed Content Translation: Future work will focus on improving the translation of more intricate text elements, such as vertical text, multi-line text, collaborative translation of multiple texts, and optimizing text positioning.
- End-to-End Frameworks: The paper acknowledges that current high-performing models often use cascaded approaches, which can lead to error accumulation and high latency. Research will explore end-to-end IIT frameworks to overcome these challenges and improve efficiency.
Summary updated