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

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

Introduction

Text-guided image editing—the ability to modify an image using natural language commands like "make the dog wear a hat"—is a transformative capability for both casual users and professional designers. Despite recent progress, current state-of-the-art models often struggle with real-world applications. These models typically rely on "zero-shot" pipelines that require tedious hyperparameter tuning or are trained on massive, automatically synthesized datasets.

To bridge this gap, the authors introduce MagicBrush, the first large-scale, manually annotated dataset specifically designed for instruction-guided real image editing. MagicBrush provides over 10,000 high-quality, human-curated edit examples, including challenging multi-turn sessions, to better train and evaluate the next generation of editing models.

The Problem: Noise in Synthetic Data

Existing models, such as InstructPix2Pix, are often trained on synthetic datasets generated by other AI models. While these datasets offer scale, they are frequently plagued by noise, unnatural edits, and a failure to capture the iterative nature of human creativity. Consequently, models trained on synthetic data often produce visual artifacts or ignore specific parts of a user's prompt. MagicBrush addresses these limitations by prioritizing human-guided quality over raw synthetic quantity.

The MagicBrush Dataset

MagicBrush was constructed using a rigorous crowdsourcing pipeline involving Amazon Mechanical Turk (AMT) and the DALL-E 2 platform. The dataset consists of 5,313 edit sessions and 10,388 total edit turns, utilizing source images from the MS COCO dataset across 80 diverse object classes.

Data Collection Pipeline

  1. Instruction & Masking: Qualified workers were provided with real source images. They wrote a natural language instruction and drew a mask over the specific region to be edited.
  2. Guided Generation: Workers provided a global description to guide DALL-E 2 in generating a high-quality target image that matched their instruction.
  3. Multi-Turn Editing: Unlike previous datasets that focus on single-step changes, MagicBrush captures iterative edit sessions. Workers could modify an image up to three times (e.g., Turn 1: "Add a barn," Turn 2: "Add a stream," Turn 3: "Add sheep"), mimicking a realistic design workflow.

Key Insights

Quality Over Quantity

The research demonstrates that fine-tuning models on approximately 10,000 high-quality, human-annotated examples yields significantly better real-world performance than training on hundreds of thousands of noisy, synthetic examples.

The Multi-Turn Challenge

Iterative editing remains a significant hurdle for current AI architectures. As models process sequential edits, errors tend to accumulate rapidly. This often results in a loss of image quality or the "erasing" of previous edits as the model struggles to maintain consistency across multiple turns.

Flaws in Automatic Metrics

Standard metrics like L1/L2 pixel differences or CLIP scores do not always align with human preference. For example, some baseline models achieved high scores by making minimal changes to the image, yet human evaluators rated them poorly because they failed to actually follow the editing instructions.

Results and Evaluation

To validate the dataset, the authors fine-tuned an off-the-shelf InstructPix2Pix model on MagicBrush. The results showed a consistent quantitative boost across metrics such as L1, L2, CLIP-I, and DINO in mask-free settings.

In human evaluations, the MagicBrush-fine-tuned model significantly outperformed the original InstructPix2Pix and other baselines. It was selected as the best model for instruction consistency 51% of the time (compared to 33% for the original) and for image quality 49% of the time (compared to 27% for the original).

Limitations and Future Work

While MagicBrush represents a major step forward, it inherits some biases from DALL-E 2, such as a focus on local object modifications rather than global style transfers. Additionally, a small percentage of images may contain minor, unprompted background shifts.

Future research should focus on developing automatic evaluation metrics that better reflect human judgment and creating new model architectures capable of handling multi-turn edits without error accumulation. MagicBrush provides the foundational data necessary to pursue these advancements.

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