Skip to content

PatchDPO: Patch-level DPO for Finetuning-free Personalized Image Generation

Conference: CVPR 2025
arXiv: 2412.03177
Code: GitHub
Area: Image Generation
Keywords: Personalized Image Generation, Preference Optimization, Patch-level DPO, Finetuning-free Generation, Quality Estimation

TL;DR

This paper proposes PatchDPO, which replaces the image-level preference evaluation of traditional DPO with patch-level quality estimation to optimize pretrained personalized generation models in a second-stage training. It achieves SOTA performance in both single-subject and multi-subject generation on the DreamBooth and Concept101 datasets.

Background & Motivation

Although finetuning-free personalized image generation (e.g., IP-Adapter) achieves high inference efficiency, it relies solely on single-stage image reconstruction training, which leads to generated images being inconsistent with reference images in local details. Direct Preference Optimization (DPO) is an effective method for improving pretrained models, but faces critical challenges:

  • Traditional DPO only evaluates image-level preference: In personalized generation, inconsistencies typically occur in local patches (e.g., head, back, legs), rendering image-level "good/bad" labels inaccurate.
  • Error propagation: By labeling an image containing some high-quality regions as "bad," the model incorrectly learns to move away from these good regions.
  • Annotation cost: Human annotation at the patch level is impractical.

Mechanism: Leverage a pretrained vision model to automatically estimate the quality of each patch, providing fine-grained feedback during DPO training.

Method

Overall Architecture

The three-stage pipeline of PatchDPO: 1. Data Construction: Use Stable Diffusion (SD) to generate reference images with clean backgrounds, and then use the target model to generate corresponding images. 2. Patch Quality Estimation: Self-supervised training of a vision model to extract patch features \(\rightarrow\) patch-to-patch comparison to compute quality scores. 3. Weighted Training: DPO training with high weights for high-quality patches and low weights for low-quality patches.

Key Designs

Key Design 1: Patch-to-Patch Quality Comparison

  • Function: Automatically estimate the quality of each patch in the generated image without human annotation.
  • Mechanism: Use a pretrained vision model \(f\) to extract feature maps of the reference and generated images, denoted as \(f(\bm{x}_{ref}), f(\bm{x}_{gen}) \in \mathbb{R}^{H \times W \times D}\). For each generated patch \(\bm{x}_{gen}[h,w]\), compute the maximum cosine similarity between its feature and the features of all patches in the reference image: \(p(\bm{x}_{gen}[h,w]) = \max_{i,j} \frac{f(\bm{x}_{gen})[h,w] \cdot f(\bm{x}_{ref})[i,j]}{\|f(\bm{x}_{gen})[h,w]\|\|f(\bm{x}_{ref})[i,j]\|}\).
  • Design Motivation: By avoiding strict spatial alignment requirements (allowing for variations in perspective and scene), the maximum similarity evaluates whether a "corresponding high-quality patch" exists. The reliability of patch matching precision is validated on the HPatches dataset.

Key Design 2: Self-Supervised Patch Feature Enhancement

  • Function: Improve the patch-level feature extraction capability of the vision model.
  • Mechanism: Fine-tune the vision model (e.g., an ImageNet-pretrained classification model) in a self-supervised manner on datasets with spatial correspondence annotations (such as HPatches), aligning features of corresponding patches of the same object from different perspectives.
  • Design Motivation: While classification models excel at extracting global image features, patch-level features may lack granularity. Self-supervised training specifically optimizes feature discriminability at the patch level, as confirmed by quantitative evaluation using the \(S_{patch}\) metric.

Key Design 3: Patch-Weighted Training Strategy

  • Function: Guide the model to preserve high-quality patches and correct low-quality patches.
  • Mechanism: Assign weights to each patch: high-quality patches (high \(p\)) receive positive weights to optimize the model closer, whereas low-quality patches (low \(p\)) receive negative weights to push the model away. Simultaneously, the original reference image is incorporated into training as a ground-truth generated image—where reference patches corresponding to low-quality generated patches are assigned high weights, directing the model to make corrections.
  • Design Motivation: Traditional binary win/lose labels in DPO are too coarse. The weighted formulation provides continuous gradients, ensuring high-quality regions remain intact while low-quality regions are corrected, preventing the issue of "ruining a good patch to fix a bad one."

Loss & Training

An improved weighted DPO loss, with the reference image serving as an anchor for regularization.

Key Experimental Results

Main Results: DreamBooth Single-Subject Personalized Generation

Method DINO↑ CLIP-I↑ CLIP-T↑
IP-Adapter Baseline Baseline Baseline
IP-Adapter + DPO Slight gain Slight gain On par
IP-Adapter + PatchDPO Significant gain Significant gain SOTA

PatchDPO brings significant improvements over both the IP-Adapter and ELITE baselines.

Ablation Study

Ablation Component Effect
Image-level DPO (no patch-level) Limited improvement, with some metrics even deteriorating
Natural images as reference (vs. SD-generated) Complex backgrounds interfere with training, leading to poor results
W/o self-supervised patch feature enhancement Patch matching accuracy drops, weakening DPO efficacy
W/o reference image ground-truth injection Insufficient capability to correct low-quality patches

Key Findings

  • Patch-level DPO significantly outperforms image-level DPO (as confirmed by ablations).
  • Clean-background reference images generated by SD are more suitable for PatchDPO training than natural images.
  • Multi-subject personalized generation also benefits, achieving SOTA results on the Concept101 dataset.
  • PatchDPO is consistently effective across different baseline models (IP-Adapter/ELITE).

Highlights & Insights

  1. Fine-grained DPO: Scaling down granularity from image-level to patch-level is a necessary adaptation when migrating LLM methods to vision tasks.
  2. No Human Annotation: Preference data is constructed completely automatically by leveraging patch feature matching with vision models.
  3. Generality: Acts as a "second-stage training" that can be plugged into any pretrained personalized generation model.

Limitations & Future Work

  • Relies on the quality of the pretrained vision model's patch features; it may fail for object categories not covered by the model.
  • The distribution of SD-generated training data may differ from real-world user reference images.
  • Patch quality estimation assumes that there are matchable patches between the reference and generated images, which may not hold for highly creative generations.
  • Future research can explore other patch quality metrics (e.g., DINOv2 features).
  • IP-Adapter: The primary enhanced baseline, upon which PatchDPO yields significant improvements.
  • Diffusion-DPO: An image-level DPO method; PatchDPO demonstrates that patch-level optimization is more effective.
  • ProtoPNet: The source of inspiration for patch feature extraction and comparison.

Rating

⭐⭐⭐⭐ — Patch-level DPO represents an important advancement in the field of personalized generation. The methodology is pragmatic, versatile, and fully automated. The reliance on patch feature quality and the training-test data distribution gap are minor drawbacks.