MagicBrush: A Manually Annotated Dataset for Instruction-Guided Image Editing

Kai Zhang, Lingbo Mo, Wenhu Chen, Huan Sun, Yu Su

TL;DR

MagicBrush is the first large-scale, manually annotated dataset for instruction-guided real image editing, featuring over 10,000 high-quality triplets (source image, instruction, target image). By replacing noisy, automatically synthesized training data with human-curated examples, the authors demonstrate that models like InstructPix2Pix can achieve significantly better alignment with human intent and higher visual quality.

What Problem Does This Paper Address?

While text-to-image generation has exploded, instruction-guided image editing—where a user provides a natural language command like "add a cowboy hat to the man"—remains a significant challenge.

The primary bottleneck has been data. Existing datasets generally fall into three categories, all with flaws:

  1. Domain-specific: Limited to narrow categories like birds or flowers.
  2. Small-scale: Manually curated but too small (e.g., ~200 images) to train robust neural networks.
  3. Automatically synthesized: Large-scale "silver" data (like the dataset used for InstructPix2Pix) created by using one AI to describe changes and another to execute them. This data is often noisy, contains artifacts, and fails to capture the nuance of real-world human instructions.

As a result, current models often require extensive hyperparameter tuning to produce a single decent result, making them impractical for everyday users.

Methods

The authors introduced MagicBrush, a dataset built through a rigorous three-stage crowdsourcing workflow:

  1. Worker Selection: Only 19 highly qualified workers were selected after passing a qualification quiz and a manual trial period.
  2. Data Collection via DALL-E 2: Workers used the DALL-E 2 platform to iteratively edit real images from the MS COCO dataset. They provided the instruction, a global description of the desired output, and a mask to guide the AI. They were required to interact with the platform until they "harvested" a high-quality target image.
  3. Post-Verification: A final manual check ensured consistency between the instruction and the result, as well as overall image quality.

Crucially, the dataset supports both single-turn and multi-turn editing (up to 3 turns), mimicking a real-world scenario where a user might refine an image step-by-step.

Examples of single-turn and multi-turn editing from the MagicBrush dataset.

Datasets

  • MagicBrush (New): 10,388 edit turns across 5,313 sessions. It covers diverse scenarios: adding/removing objects, changing textures, altering actions, and color adjustments.
  • Baselines for Comparison: The paper compares MagicBrush against existing benchmarks like Oxford-Flower, CUB-Bird, EditBench, and the original synthetic InstructPix2Pix dataset.

Key Insights and Ideas

  • Human Data > Synthetic Data: Fine-tuning on MagicBrush led to a massive performance jump for InstructPix2Pix. This suggests that the "noise" in synthetic datasets is a major inhibitor to model generalization.
  • The Multi-turn Challenge: The authors found that performance degrades as the number of editing turns increases. This is due to error accumulation—small artifacts in Turn 1 become glaring issues by Turn 3. This highlights a critical area for future research in "stateful" image editing.
  • Metric Misalignment: One of the most interesting findings was that Text2LIVE scored high on automatic metrics (like CLIP-T) but performed poorly in human evaluations. This underscores the need for better automated metrics that actually capture "instruction consistency" rather than just general image-text alignment.

Key Results

The researchers fine-tuned InstructPix2Pix and HIVE on MagicBrush and saw substantial gains:

  • Quantitative: The fine-tuned InstructPix2Pix achieved the best or second-best results across nearly all metrics (L1, L2, CLIP-I, DINO, and CLIP-T) in both single-turn and multi-turn settings.
  • Human Evaluation: In a multi-choice comparison, the fine-tuned model was chosen as the "best" for consistency 51% of the time, compared to only 33% for the original off-the-shelf InstructPix2Pix.
  • Qualitative: Visual results show the fine-tuned model is much better at preserving the identity of the original image while precisely executing the requested change (e.g., changing a shirt to plaid without warping the person's face).

Limitations and Future Work

Despite its strengths, the authors acknowledge a few limitations:

  • Model Bias: Because the ground truth images were generated using DALL-E 2, the dataset may inherit some of that model's specific biases or stylistic tendencies.
  • Global Edits: MagicBrush focuses on local semantic changes. It does not currently include data for global style transfers (e.g., "make this look like a Van Gogh painting").
  • The "Gap": Even the best fine-tuned models are still "notably inferior" to the human-curated ground truth in MagicBrush, suggesting that the dataset will remain a challenging benchmark for some time.

Future work will likely focus on developing models that can better handle the long-term dependencies required for complex, multi-turn editing sessions.

Summary updated

BibTeX
@inproceedings{zhang2023magicbrush,
  author = {Kai Zhang and Lingbo Mo and Wenhu Chen and Huan Sun and Yu Su},
  title = {{MagicBrush: A Manually Annotated Dataset for Instruction-Guided Image Editing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=ZsDB2GzsqG},
}
Figure