layoutbench-eval
Diagnostic Benchmark and Iterative Inpainting for Layout-Guided Image Generation — Cho et al. (2023) (arXiv:2304.06671, 2023)
What this evaluates
Evaluates layout-guided image generation models on their ability to follow spatial control instructions (number, position, size, shape) across in-distribution and out-of-distribution layouts. Probes generalization to arbitrary object configurations and fine-grained spatial reasoning.
Datasets
- CLEVR — total 70000; splits: train (70000), val (-1)
- LayoutBench — total ?; splits: Number-few (-1), Number-many (-1), Position-center (-1), Position-boundary (-1), Size-tiny (-1), Size-large (-1), Shape-horizontal (-1), Shape-vertical (-1)
Metrics
AP (AP50) (primary) — range: [0, 1]
- Average Precision at IoU threshold 0.5, computed using a DETR-R101-DC5 object detector to compare predicted bounding boxes and class labels against ground-truth layout specifications. Higher values indicate better layout adherence.
FID — range: other
- Fréchet Inception Distance measuring the feature distribution distance between generated images and ground-truth images. Lower values indicate higher image quality.
SceneFID — range: other
- Scene-aware FID measuring the feature distribution distance between bounding boxes in generated images and ground-truth boxes. Lower values indicate better spatial fidelity.
Input / output format
Input: Text-encoded layout specification containing quantized bounding box coordinates (1000 bins) concatenated with object class tokens or textual descriptions, fed into a Stable Diffusion-based generator.
Output: 512x512 RGB image.
Scoring recipe
def compute_metrics(generated_images, gold_layouts):
# Layout Accuracy (AP50)
preds = DETR_R101_DC5.predict(generated_images)
ap50 = compute_AP(preds, gold_layouts, iou_threshold=0.5)
# Image Quality
fid = compute_FID(generated_images, ground_truth_images)
scenefid = compute_FID(extract_boxes(generated_images), extract_boxes(ground_truth_images))
return {'AP50': ap50, 'FID': fid, 'SceneFID': scenefid}
Common pitfalls
- Relying solely on FID/SceneFID for evaluation, as models can achieve low scores while completely failing to follow layout constraints.
- Using original CLEVR bounding box annotations without correction, which contain minor errors that artificially lower AP on ground-truth images.
- Assuming models generalize equally across all spatial skills; performance drops significantly on OOD splits like 'many', 'tiny', 'center/boundary', and 'horizontal/vertical' shapes.
Evidence (verbatim from paper)
For quantitative evaluation, we measure layout accuracy and image quality. Layout accuracy is measured by AP (average precision) based on DETR-R101-DC5, as mentioned in [Sec. 3.2]. Higher AP indicates that the generated images follow the input layouts more closely. FID and SceneFID are adopted to measure image quality. Lower FID (SceneFID) indicates that the generated images (boxes) have a more similar feature distribution to the ground-truth ones.
Citation
@misc{cho2023diagnostic,
title={Diagnostic Benchmark and Iterative Inpainting for Layout-Guided Image Generation},
author={Cho et al. (2023)},
year={2023},
note={arXiv:2304.06671}
}
1---2name: layoutbench-eval3description: Evaluates layout-guided image generation models on their ability to follow spatial control instructions (number, position, size, shape) across in-distribution and out-of-distribution layouts. Probes generalization to arbitrary object configurations and fine-grained spatial reasoning. Use when the user wants to benchmark on CLEVR, LayoutBench, or asks about evaluating this task. Reports AP (AP50).4---56# layoutbench-eval78> Diagnostic Benchmark and Iterative Inpainting for Layout-Guided Image Generation — Cho et al. (2023) (arXiv:2304.06671, 2023)910## What this evaluates1112Evaluates layout-guided image generation models on their ability to follow spatial control instructions (number, position, size, shape) across in-distribution and out-of-distribution layouts. Probes generalization to arbitrary object configurations and fine-grained spatial reasoning.1314## Datasets1516- **CLEVR** — total 70000; splits: train (70000), val (-1)17- **LayoutBench** — total ?; splits: Number-few (-1), Number-many (-1), Position-center (-1), Position-boundary (-1), Size-tiny (-1), Size-large (-1), Shape-horizontal (-1), Shape-vertical (-1)1819## Metrics2021- `AP (AP50)` **(primary)** — range: [0, 1]22 - Average Precision at IoU threshold 0.5, computed using a DETR-R101-DC5 object detector to compare predicted bounding boxes and class labels against ground-truth layout specifications. Higher values indicate better layout adherence.23- `FID` — range: other24 - Fréchet Inception Distance measuring the feature distribution distance between generated images and ground-truth images. Lower values indicate higher image quality.25- `SceneFID` — range: other26 - Scene-aware FID measuring the feature distribution distance between bounding boxes in generated images and ground-truth boxes. Lower values indicate better spatial fidelity.2728## Input / output format2930**Input**: Text-encoded layout specification containing quantized bounding box coordinates (1000 bins) concatenated with object class tokens or textual descriptions, fed into a Stable Diffusion-based generator.3132**Output**: 512x512 RGB image.3334## Scoring recipe3536```python37def compute_metrics(generated_images, gold_layouts):38 # Layout Accuracy (AP50)39 preds = DETR_R101_DC5.predict(generated_images)40 ap50 = compute_AP(preds, gold_layouts, iou_threshold=0.5)41 42 # Image Quality43 fid = compute_FID(generated_images, ground_truth_images)44 scenefid = compute_FID(extract_boxes(generated_images), extract_boxes(ground_truth_images))45 46 return {'AP50': ap50, 'FID': fid, 'SceneFID': scenefid}47```4849## Common pitfalls5051- Relying solely on FID/SceneFID for evaluation, as models can achieve low scores while completely failing to follow layout constraints.52- Using original CLEVR bounding box annotations without correction, which contain minor errors that artificially lower AP on ground-truth images.53- Assuming models generalize equally across all spatial skills; performance drops significantly on OOD splits like 'many', 'tiny', 'center/boundary', and 'horizontal/vertical' shapes.5455## Evidence (verbatim from paper)5657> For quantitative evaluation, we measure layout accuracy and image quality. Layout accuracy is measured by AP (average precision) based on DETR-R101-DC5, as mentioned in [Sec. 3.2]. Higher AP indicates that the generated images follow the input layouts more closely. FID and SceneFID are adopted to measure image quality. Lower FID (SceneFID) indicates that the generated images (boxes) have a more similar feature distribution to the ground-truth ones.5859## Citation6061```bibtex62@misc{cho2023diagnostic,63 title={Diagnostic Benchmark and Iterative Inpainting for Layout-Guided Image Generation},64 author={Cho et al. (2023)},65 year={2023},66 note={arXiv:2304.06671}67}68```6970- arXiv: 2304.06671