TL;DR
This paper introduces CoCoEdit, a novel post-training framework for image editing that significantly improves content consistency by using reinforcement learning with region-specific rewards. It addresses the common problem of generative models altering unintended parts of an image, achieving better editing quality and preservation simultaneously.
What Problem Does This Paper Address?
Large-scale generative models have revolutionized image editing, allowing for impressive transformations based on text instructions. However, a persistent challenge is that these models often fail to preserve the integrity of unintended regions of an image. While they excel at modifying the target object, they can introduce unwanted changes to the background or other elements, leading to a loss of overall content consistency. Existing methods, even those using reinforcement learning (RL) to align with human preferences, struggle to detect and penalize these subtle, unintended alterations. This paper aims to bridge this gap by developing a method that explicitly enforces content consistency across the entire image, not just the edited region.
Methods
CoCoEdit is a post-training framework that leverages reinforcement learning. Its core innovations lie in:
- CoCoEdit-40K Dataset: A curated dataset of 40,000 high-quality image-instruction-mask triplets. This dataset is crucial for training the RL agent to understand both editing goals and spatial constraints.
- Pixel-Level Similarity Reward: Beyond standard MLLM-based rewards that assess editing quality, CoCoEdit introduces a reward that measures the pixel-level similarity (using PSNR and SSIM) between the non-edited regions of the original and generated images. This directly penalizes unwanted background changes.
- Region-Based Regularizers: To overcome the limitations of global similarity rewards, CoCoEdit employs region-specific regularizers.
- A positive regularizer enforces strict consistency in non-edited regions for high-reward samples.
- A negative regularizer encourages more significant edits in low-reward (under-edited) samples, preventing the model from becoming too conservative. These regularizers are applied to specific regions using the provided masks.
The RL framework then optimizes a diffusion model using a combination of MLLM rewards and the new pixel-level similarity reward, guided by the region-based regularizers.
Datasets
- CoCoEdit-40K: A newly constructed dataset of 40,000 image-instruction-mask triplets. This dataset was created by refining existing editing datasets, annotating masks, and filtering for high quality and diversity.
- GEdit-Bench and ImgEdit-Bench: These existing benchmarks were augmented with editing masks to enable pixel-level consistency evaluation.
Key Insights and Ideas
- MLLMs Aren't Enough for Consistency: The paper demonstrates that while MLLMs are good at judging overall semantic alignment and editing success, they are poor at detecting fine-grained pixel-level inconsistencies in non-edited regions. This highlights the need for specialized metrics.
- Pixel-Level Similarity is Crucial: Directly measuring PSNR and SSIM in non-edited regions provides a much more sensitive signal for content preservation than MLLM scores alone.
- Region-Specific Regularization is Key: A global consistency reward can be too restrictive. By using region-based regularizers, CoCoEdit can enforce strict preservation in non-edited areas while still allowing for meaningful edits in the target regions.
- Asymmetric Regularization: Applying different regularization strategies for positive (well-edited) and negative (under-edited) samples is crucial for balancing editing quality and consistency. The positive regularizer acts as an "anchor" for preservation, while the negative regularizer acts as a "catalyst" for edits.
Key Results
- Improved Content Consistency: CoCoEdit significantly improves PSNR and SSIM scores in non-edited regions compared to baseline models (e.g., +2.8dB PSNR for Qwen-Image-Edit on GEdit-Bench).
- Competitive Editing Quality: CoCoEdit not only enhances consistency but also achieves competitive or superior editing scores (MLLM scores) compared to state-of-the-art methods. For instance, it achieved the highest overall editing scores on GEdit-Bench when fine-tuning Qwen-Image-Edit.
- Human Preference: User studies show that CoCoEdit-enhanced models are significantly preferred by human evaluators, indicating a better overall editing experience.
- Effective Dataset: The 40K CoCoEdit dataset is shown to be sufficient for effective RL training, with scaling up the dataset yielding diminishing returns.
Limitations and Future Work
- Dataset Quality Dependence: The quality of the CoCoEdit dataset relies on the visual understanding and reasoning capabilities of MLLMs, which can sometimes introduce noise or hallucinations.
- Physical Plausibility: The framework still faces challenges with physical and perspective inconsistencies, especially when adding objects. The generated objects may not always appear naturally integrated.
- Texture Preservation: Strong color alterations can sometimes lead to over-smoothing of fine-grained textures within the edited region.
- Future Work: The authors plan to improve dataset quality with better MLLMs and manual inspection, investigate incorporating 3D priors for better physical plausibility, and explore better ways to balance attribute modification with original property preservation.
Summary updated