PrefPaint: Aligning Image Inpainting Diffusion Model with Human Preference

Kendong Liu, Zhiyu Zhu, Chuanhao Li, Hui Liu, Huanqiang Zeng, Junhui Hou

Introduction

Image inpainting—the process of reconstructing missing or damaged regions within an image—has seen a paradigm shift with the advent of diffusion models. However, a significant "technical gap" persists between model outputs and human expectations. While current models excel at minimizing objective per-pixel losses or maintaining general coherence, they often struggle with the subjective nature of aesthetics and structural logic. Because inpainting is a one-to-many problem—where a single mask can be filled in infinite ways—models frequently generate artifacts or discordant objects that, while technically "correct" in a mathematical sense, appear visually jarring to human observers.

To bridge this gap, we present PrefPaint, a novel reinforcement learning (RL) framework designed to align inpainting diffusion models with human aesthetic preferences. By introducing a massive human-annotated dataset and a "trustiness-aware" alignment process, PrefPaint significantly improves the visual quality and structural rationality of inpainted results.

The PrefPaint Methodology

The PrefPaint framework treats the alignment of inpainting models as a Reinforcement Learning problem. The approach is structured into three distinct stages:

1. Reward Model Training

At the core of the system is a reward model $R(x)$ built upon a CLIP-based feature extractor and a regression head. This model is trained to predict a continuous "preference score" for any given inpainted image, allowing the system to quantify aesthetic quality.

2. Theoretical Error Bounding

A primary innovation of this research is the mathematical quantification of reward model reliability. Drawing from linear bandit theory, the researchers deduced a theoretical error upper bound for the reward model. They demonstrated that the prediction error is proportional to the norm of the image embedding within a specific feature space ($\|z\|_{V^{-1}}$). This allows the system to identify when the reward model is likely to be inaccurate.

3. Reward Trustiness-Aware Alignment

Standard Reinforcement Learning from Human Feedback (RLHF) often suffers from "reward hacking," where the model exploits flaws in the reward function. PrefPaint mitigates this by introducing a trustiness amplification factor ($\gamma$). This factor weights training samples based on the reward model's calculated error bound. By prioritizing high-trustiness samples, the alignment process achieves faster and more stable convergence, preventing the model from being led astray by noisy reward estimations.

The PrefPaint Dataset

To facilitate this alignment, the study introduces the PrefPaint Dataset, a substantial new resource for the computer vision community. The dataset consists of 51,000 inpainted images sourced from diverse benchmarks including ADE20K, ImageNet, KITTI, and Div2K.

Each image underwent rigorous human annotation by experts who provided scores on a scale of 1 to 7 based on three criteria:

  • Structural Rationality: Assessing if the generated content makes contextual sense (e.g., ensuring a highway does not contain indoor furniture).
  • Local Texture: Evaluating the realism and consistency of the fine-grained details.
  • Overall Feeling: A holistic aesthetic impression.

The dataset also incorporates various masking patterns, including "warping" masks for novel view synthesis and "outpainting" masks for field-of-view enlargement.

Key Insights

  • Quantifiable Trust: The realization that reward model uncertainty can be mathematically bounded is a significant advancement. This "trustiness-aware" regularization prevents the common pitfalls of RL alignment.
  • Regression vs. Classification: The researchers found that continuous regression-based reward models provide more stable gradients and better discriminative power for diffusion models compared to simple binary classification.
  • The Need for Task-Specific Metrics: The study highlights that general-purpose metrics like BERTScore or standard CLIP scores often fail to correlate with human aesthetic judgments in inpainting, necessitating the specialized PrefPaint dataset.

Experimental Results

PrefPaint demonstrates substantial improvements over state-of-the-art models like Stable Diffusion XL and Kandinsky. Key performance indicators include:

  • Human Preference: In head-to-head "WinRate" evaluations, PrefPaint outperformed the Runway baseline in over 70% of cases using only a single inference step.
  • Quantitative Benchmarks: PrefPaint achieved superior scores across multiple metrics, including the Inception Score (IS), where it reached 23.71 compared to Runway's 20.30.
  • Alignment Efficiency: The trustiness-aware scheme improved convergence efficiency by over 106% compared to standard RL alignment methods.
  • Versatility: The model excels in practical downstream tasks, such as Image Field-of-View (FOV) Enlargement and Novel View Synthesis, where it effectively fills gaps during 3D scene rotations.

Conclusion and Future Work

PrefPaint establishes a robust framework for aligning generative inpainting models with human taste. While the current model reflects the collective preferences of its annotators, future work may explore personalized reward models to cater to individual aesthetic standards. Additionally, the researchers suggest that reward-model-free alignment techniques, such as Direct Preference Optimization (DPO), could further simplify the pipeline. Finally, extending this trustiness-aware framework to more complex 3D reconstruction tasks remains a promising avenue for future exploration.

Summary updated

BibTeX
@inproceedings{liu2024prefpaint,
  author = {Kendong Liu and Zhiyu Zhu and Chuanhao Li and Hui LIU and Huanqiang Zeng and Junhui Hou},
  title = {{PrefPaint: Aligning Image Inpainting Diffusion Model with Human Preference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=fVRCsK4EoM},
}
Figure