RPHarmony: Synthetic Image Harmonization Dataset
- RPHarmony is a synthetic dataset for image harmonization that employs Random Poisson Blending to introduce localized color, texture, and lighting variations.
- It addresses limitations of global color transfer by capturing spatially varying phenomena such as shadows and interreflections for more realistic composites.
- The dataset, integrated in the R2R architecture, provides benchmark metrics and improved generalization for harmonization models on both synthetic and real images.
Searching arXiv for papers mentioning RPHarmony and related uses. I’m checking arXiv for papers directly associated with the term and its surrounding context. Searching for "RPHarmony" on arXiv. RPHarmony most directly denotes a synthetic image harmonization dataset introduced alongside the region-to-region synthesis method Random Poisson Blending (RPB) in "Region-to-Region: Enhancing Generative Image Harmonization with Adaptive Regional Injection" (Zhang et al., 13 Aug 2025). It is constructed to produce composites with realistic, spatially localized disharmonies by transferring local color, texture, layout, and lighting cues from a randomly selected region in a random reference image into the foreground of a target real image. The resulting dataset contains 12,787 training images and 1,422 test images, each paired with a ground-truth real image and a foreground mask, and is used both to stress-test harmonization models and to improve their generalization to real composites (Zhang et al., 13 Aug 2025). In adjacent literature summaries, the same string also appears in broader senses related to preference harmonization, whereas it does not appear in "The Harmony Platform" (Falleri et al., 2013), and the acronym RPH in "Oracle Separations for RPH" refers instead to the real polynomial hierarchy (Hamm et al., 13 Feb 2025).
1. Terminology and scope
Within image harmonization, RPHarmony is the name of a new synthetic dataset generated via Random Poisson Blending, a region-to-region technique that transfers local appearance cues from a randomly sampled region in a random reference image into the foreground of a target real image (Zhang et al., 13 Aug 2025). The motivation is that prevailing synthetic training datasets, such as iHarmony4, are largely produced by global color transfer, which manipulates global foreground statistics by referencing semantically similar objects and therefore lacks local variation. The stated consequence is underrepresentation of complex real-world conditions such as spatially varying lighting, interreflections, shading, and shadows.
The term is potentially ambiguous. In the Harmony platform paper, the term used throughout is "Harmony platform"; the "RP" qualifier does not appear in the paper and is described as a likely external alias or search term (Falleri et al., 2013). In the preference-alignment exposition based on Robust Preference Optimization, "RPHarmony" denotes a harmonizing, robust preference-alignment layer that sits atop standard preference-optimization methods (Cao et al., 29 Sep 2025). In the ChARM exposition, the expression "RPHarmony-style system" is used for a role-playing agent aligned to user and character-specific preferences for harmonious interactions (Fang et al., 29 May 2025). By contrast, the theoretical paper on RPH studies the real polynomial hierarchy, not harmonization (Hamm et al., 13 Feb 2025).
2. Random Poisson Blending and dataset construction
RPB is defined as a region-to-region transformation. Rather than globally adjusting foreground color statistics, it transfers the color and illumination characteristics from a randomly selected suitable region in a random reference image into the foreground region of a target real image using Poisson image editing (Zhang et al., 13 Aug 2025). The pipeline is given step by step for a real target image and its foreground mask .
Foreground extraction is defined by
where .
A different reference image is then selected, and a region in is randomly sampled to serve as guidance for blending. The foreground is blended onto at region using Poisson blending, yielding 0. A new foreground 1 is re-extracted from 2 at the paste location, and blending strength is controlled by
3
Finally, 4 is pasted back into its original position in 5 using the original mask 6 to produce the synthetic composite 7.
The underlying Poisson image editing formulation is stated as a variational problem over a masked region 8:
9
where 0 is the unknown harmonized image inside 1, 2 is the source or foreground to paste, and 3 is the background image used for boundary conditions. In discrete form, this becomes a least-squares system equivalent to solving a Poisson equation with a guidance field 4:
5
The randomness in RPB arises from random selection of the reference image 6, random sampling of a suitable region 7 in 8, random blending strength 9, the foreground mask 0 that defines 1, and the position of paste-in and region-scale variability. Additional checks and filtering are applied to ensure the Poisson blending is valid and the synthesized image quality is high; the stated mechanism is an aesthetics scoring model plus manual filtering, while the precise details are deferred to the Supplementary (Zhang et al., 13 Aug 2025).
3. Dataset composition, supervision, and evaluation protocol
RPHarmony is synthesized from high-quality masks taken from DUTS, with 15,572 images, and ADE20K, with 27,574 images, and is divided into two sub-datasets, R-DUTS and R-ADE (Zhang et al., 13 Aug 2025). Each sample includes a composite image 2 as input, the original real image 3 as target, and the foreground mask 4 as annotation, enabling supervised training and evaluation with pixel-level mask guidance.
The experimental protocol is fixed. Training images are resized to 5. Testing is performed at 6, and results are resized to 7 for evaluation, following the same protocol used for iHarmony4. Models are first pre-trained on iHarmony4 and then fine-tuned on RPHarmony. Reported metrics are PSNR, MSE, fMSE, and SSIM, with standard definitions used in practice (Zhang et al., 13 Aug 2025).
| Model | PSNR / MSE | fMSE / SSIM |
|---|---|---|
| Composite baseline | 25.91 / 366.32 | 2362.08 / 0.9580 |
| PCT-Net | 33.26 / 60.39 | 332.61 / 0.9796 |
| AICT | 33.28 / 60.38 | 333.15 / 0.9547 |
| HDNet | 34.46 / 47.52 | 252.54 / 0.9810 |
| DiffHarmony++ | 36.03 / 42.16 | 203.45 / 0.9861 |
| R2R (Ours) | 36.32 / 40.25 | 192.66 / 0.9872 |
The reported interpretation is that RPHarmony’s richer local variations challenge models: several methods that perform comparably on iHarmony4 drop notably on RPHarmony. The proposed R2R model maintains superior performance, which the paper presents as evidence of improved robustness to localized disharmony (Zhang et al., 13 Aug 2025).
Generalization is also evaluated on RealHM using DeQA-Score:
| Model | DeQA-Score |
|---|---|
| HDNet | 3.824 |
| HDNet* (fine-tuned on RPHarmony) | 3.877 |
| Ours | 4.039 |
| Ours* (fine-tuned on RPHarmony) | 4.082 |
These numbers are reported as showing that fine-tuning on RPHarmony improves realism on real composites, suggesting improved generalization beyond synthetic settings (Zhang et al., 13 Aug 2025). A plausible implication is that the dataset is useful not only as a benchmark but also as a regularizer against the synthetic bias induced by global color-transfer pipelines.
4. Role within the R2R architecture
RPHarmony is tightly coupled to the R2R model described in the same work (Zhang et al., 13 Aug 2025). The stated relationship has three parts: the dataset stresses models with region-localized color and lighting differences, it strengthens the Harmony Controller and Mask-aware Adaptive Channel Attention (MACA) during fine-tuning, and its RPB composites serve as negative samples in Clear-VAE’s contrastive regularization.
Clear-VAE is motivated by the claim that a standard VAE encoder in an LDM may lose high-frequency details, while naive skip connections can reintroduce disharmonious elements. The Adaptive Filter extracts high-frequency information from skip features during encoding of composite images and merges them into the decoder with zero-initialized 8 convolutions. The losses are
9
0
with 1 the 2 distance, 3, and
4
The paper states that using RPB composites as hard negatives strengthens the model’s ability to preserve details while discarding disharmonious cues.
MACA is defined on a feature map 5 and mask 6 with 7. Foreground and background feature maps are
8
Global channel descriptors 9 and 0 are produced via convolution and GAP, then concatenated and passed through an MLP to regress channelwise scale 1 and shift 2. Channel modulation is
3
and the final mask-aware output is
4
The stated function is to adapt low-level style, color, and brightness channels in the foreground under guidance from the background.
The latent diffusion objective is a foreground-weighted MSE:
5
Here 6 is resized to latent resolution, 7, and 8 and 9 are the standard diffusion noise target and prediction. Training uses Clear-VAE for 30 epochs with AdamW, 0, 1, learning rate 2, batch size 4, and gradient accumulation 8; the controller is then fine-tuned for 5 epochs with AdamW at learning rate 3. Inference uses an Euler ancestral discrete scheduler with 10 steps, and the implementation is in PyTorch on 4 GPUs (Zhang et al., 13 Aug 2025).
5. RPHarmony as a preference-harmonization layer
In a separate usage, the Robust Preference Optimization exposition defines RPHarmony as a harmonizing, robust preference-alignment layer that sits atop standard PO methods (Cao et al., 29 Sep 2025). Here the object is not image harmonization but harmonization of heterogeneous, noisy human feedback. The core problem setting observes preference labels that may be noisy and may come from heterogeneous annotators. For pairwise data 5, a latent correctness variable 6 indicates whether the observed orientation agrees with the underlying collective preference.
The model introduces annotator-specific reliability 7 and computes posterior correctness weights
8
These weights drive a reweighted preference objective,
9
or a one-sided variant
0
Within that exposition, RPHarmony names the harmonization of pluralistic and noisy preference signals into a stable collective preference.
The same summary extends the idea to pluralistic settings via annotator-specific reliabilities and latent preference clusters. The distinction drawn there is between random noise, which is downweighted by low 1, and systematic differences, which manifest as persistent disagreements captured by per-annotator or per-cluster reliabilities rather than being treated only as outliers (Cao et al., 29 Sep 2025). This suggests a generalized notion of harmonization in which "harmony" refers to consensus inference under noise, not to foreground–background consistency in images.
6. Related and potentially confusing uses
A further adjacent usage appears in the ChARM exposition, which connects ChARM to building an "RPHarmony-style system": a role-playing agent aligned to user and character-specific preferences for harmonious interactions (Fang et al., 29 May 2025). In that setting, the relevant mechanisms are the act-adaptive margin,
2
the margin-enhanced Bradley–Terry objective,
3
and the combined reward-model loss
4
with 5 in the implementation summary. The associated datasets are RoleplayPref and RoleplayEval rather than RPHarmony proper, so the expression functions as a design analogy rather than as the name of the image harmonization dataset (Fang et al., 29 May 2025).
Two additional confusions are explicitly addressed in the supplied literature. First, "RPHarmony" does not appear in "The Harmony Platform"; the paper consistently uses "Harmony" or "Harmony platform", an OSGi-based framework for Mining Software Repositories with a unified abstract model over Source, Event, Author, Action, and Item (Falleri et al., 2013). Second, "RPH" in "Oracle Separations for RPH" denotes the real polynomial hierarchy, defined via real Turing machines and alternating quantification over reals, with results such as 6 and oracle separations including 7 (Hamm et al., 13 Feb 2025). Those uses are terminologically proximate but conceptually unrelated.
Taken narrowly, RPHarmony is therefore a dataset for synthetic image harmonization generated by Random Poisson Blending and used to improve robustness to localized disharmony (Zhang et al., 13 Aug 2025). Taken broadly across nearby literature summaries, the string also functions as a label for harmonization in preference-alignment and role-playing settings. The common motif is the normalization of heterogeneous signals—local appearance cues in images, heterogeneous annotator feedback in preference optimization, or multi-act role-playing preferences—but only the first of these is the formal dataset name RPHarmony in the cited arXiv corpus.