molbal/identity_preservation_image_editing
Identity Preservation Augmentation Dataset for Image Editing Overview This dataset contains algorithmically generated image pairs designed to teach diffusion-based image editing models pixel-level identity preservation — the ability to keep unchanged regions of an image exactly intact while applying targeted edits. Every example consists of a reference image, a target image, and a short natural-language prompt. The transformation between reference and target is… See the full description on the dataset page: https://huggingface.co/datasets/molbal/identity_preservation_image_editing.
Identity Preservation Augmentation Dataset for Image Editing
Overview
This dataset contains algorithmically generated image pairs designed to teach diffusion-based image editing models pixel-level identity preservation — the ability to keep unchanged regions of an image exactly intact while applying targeted edits.
Every example consists of a reference image, a target image, and a short natural-language prompt. The transformation between reference and target is always a deterministic, rule-based operation (no generative model was used at any stage). This guarantees perfect ground truth with zero hallucination and makes the dataset fully reproducible from any source image collection.
The dataset is intended as a complementary augmentation layer alongside semantic edit datasets such as molbal/multi_reference_image_editing. On its own it teaches preservation and spatial reasoning; combined with semantic edit data it closes the gap between "follows the instruction" and "keeps everything else pixel-perfect."
Motivation
Models trained exclusively on semantic edit pairs learn to always apply a transformation. They have never seen a training signal that says "the reference pixels must survive unchanged in the output." The consequences are visible at inference time as:
- Face identity drift even on minor edits
- Background detail loss
- Texture and colour shifts outside the edited region
This dataset provides three complementary curriculum signals to fix that:
Source Images
All source images are the 10,000 real-world photographs from molbal/multi_reference_image_editing, which were originally sourced from Pexels with the longest edge capped at 2048 px. No additional imagery was introduced.
Pair Types
1. Identity Copy
The prompt is intentionally empty. This forces the model to learn that the reference latent itself carries the preservation signal rather than any text instruction. These examples are the strongest anchor for pixel-level fidelity.
2. Spatial Transforms
All spatial pairs use the following convention for operations that would reduce sharpness through interpolation:
The target is always the sharp image. The reference is the geometrically transformed (potentially softer) version. This means the model always has to produce a sharp output and never has to hallucinate detail it was not given.
2a. Pan / Shift
Two overlapping crops from the same image, simulating a camera pan. The overlapping region (~65–80% of the frame) must be reproduced exactly; the non-overlapping region must be plausibly completed.
Shift fractions: 30% (full pan) and 20% (slight shift). Output dimensions are derived from the crop aspect ratio and snapped to the nearest 64-pixel boundary. No rotation or distortion is introduced.
2b. Directional Zoom-In
Reference = full image resized to output dimensions (slightly soft). Target = directional crop resized to output dimensions (sharp).
Crop factors: 60% of the relevant axis for directional zooms, 67% and 50% for centre zooms.
2c. Zoom-Out
Reference = centre crop (zoomed-in view the model sees). Target = full image (always sharp, what the model must produce).
2d. Flip
3. Photometric Transforms
Reference = original image. Target = transformed image. (Exception: JPEG pairs — see below.)
3a. Brightness
3b. Contrast
3c. Saturation
3d. Colour Temperature
Warm: red channel ×1.20, blue ×0.80. Cool: inverse.
3e. Blur
3f. Tilt-Shift
A horizontal band (30–70% of image height) is kept sharp; top and bottom are Gaussian blurred (radius 8) with 30-pixel feathering.
3g. Sharpen
Unsharp mask (radius 2, strength 160%, threshold 3).
3h. Noise
Additive Gaussian noise.
3i. JPEG Compression / Restoration
Inverted convention: reference = JPEG-compressed image, target = original sharp image. Prompt instructs removal of artifacts.
3j. Vignette
Radial darkening mask applied multiplicatively.
3k. Colour Tint Overlay
RGBA overlay composited onto the image.
3l. Film Grain
Multiplicative noise sampled from uniform(0.82, 1.18) per channel per pixel.
3m. Pixelate
Nearest-neighbour downsample then upsample.
File Structure
All files sit in a single flat directory. No subdirectories.
