Ensuring Consistency for In-Image Translation

Chengpeng Fu, Xiaocheng Feng, Yichong Huang, Wenshuai Huo, Bingyan Li, Yang Xiang, Hui Wang, Ting LiuMathematics 2026

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:

  1. Text Image Translation (TIT) using a Multimodal Multilingual Large Language Model (MMLLM):
    • This stage focuses on accurately translating text within an image.
  2. 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.
  3. This stage leverages MMLLMs for their strong image comprehension capabilities, enhanced by CoT for more contextually relevant translations.
  4. Image Backfilling using a Diffusion Model:
    • This stage takes the translated text and generates a new image, integrating it seamlessly.
  5. 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.
  6. Additionally, a glyph latent module is incorporated to ensure precise text positioning and quality.
  7. 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

Abstract

The in-image machine translation task involves translating text embedded within images, with the translated results presented in image format. While this task has numerous applications in various scenarios such as film poster translation and everyday scene image translation, existing methods frequently neglect the aspect of consistency throughout this process. We propose the need to uphold two types of consistency in this task: translation consistency and image generation consistency. The former entails incorporating image information during translation, while the latter involves maintaining consistency between the style of the text image and the original image, ensuring background coherence. To address these consistency requirements, we introduce a novel two-stage framework named HCIIT (High-Consistency In-Image Translation), which involves text image translation using a multimodal multilingual large language model in the first stage and image backfilling with a diffusion model in the second stage. Chain-of-thought learning is employed in the first stage to enhance the model’s ability to effectively leverage visual information during translation. Subsequently, a diffusion model trained for style-consistent text–image generation is adopted. We further modify the structural network of the conventional diffusion model by introducing a style latent module, which ensures uniformity of text style within images while preserving fine-grained background details. The results obtained on both curated test sets and authentic image test sets validate the effectiveness of our framework in ensuring consistency and producing high-quality translated images.
BibTeX
@inproceedings{fu2026ensuring,
  author = {Chengpeng Fu and Xiaocheng Feng and Yichong Huang and Wenshuai Huo and Bingyan Li and Yang Xiang and Hui Wang and Ting Liu},
  title = {{Ensuring Consistency for In-Image Translation}},
  booktitle = {Mathematics},
  year = {2026},
  doi = {10.3390/math14030490},
}
Figure