PUG: Photorealistic and Semantically Controllable Synthetic Data for Representation Learning

Florian Bordes, Shashank Shekhar, Mark Ibrahim, Diane Bouchacourt, Pascal Vincent, Ari S. Morcos

Introduction

In representation learning, researchers face a frustrating trade-off between realism and control. Real-world datasets (like ImageNet) are photorealistic but offer zero control; you cannot take a photo of a dog and "turn it 5 degrees" or "change the weather" to test a model's robustness. Conversely, existing synthetic datasets (like CLEVR) offer perfect control but lack realism, often featuring simple geometric shapes that fail to translate to real-world performance. Meanwhile, generative models (like Stable Diffusion) produce beautiful images but suffer from "prompt drift"—lacking the guarantee that a generated object is exactly where specified.

To bridge this gap, researchers introduce PUG (Photorealistic Unreal Graphics), a new framework leveraging Unreal Engine 5 (UE5) to create high-fidelity, semantically controllable synthetic datasets for computer vision. PUG provides a "third way": photorealistic environments where every factor—pose, lighting, texture, and position—is a precisely tuned variable.

Methods: The PUG Framework

The core of the project is the integration of Unreal Engine 5 into the machine learning workflow. The authors developed TorchMultiverse, a Python library that allows researchers to interface with UE5 via WebRTC.

The PUG framework pipeline, from Unreal Engine 5 environment generation via TorchMultiverse to the resulting datasets.

Instead of merely releasing static files, the system enables dynamic scene generation. A researcher sends a JSON configuration (e.g., "Place an elephant at coordinates X,Y with a sunset light"), and the engine renders a 512x512 image in roughly one second. This architecture allows for "active learning" setups where data can be generated on-the-fly during training.

The PUG Datasets

The paper introduces four distinct datasets under the PUG umbrella, each designed to test or train specific model capabilities:

  • PUG: Animals: Contains 215,040 images featuring 70 animal species across 64 backgrounds, designed specifically to study out-of-distribution (OOD) generalization.
  • PUG: ImageNet: Comprises 88,328 images mapping 151 ImageNet classes to photorealistic 3D assets. It serves as a "stress test" for models pretrained on real ImageNet data by systematically varying environmental factors.
  • PUG: SPAR (Scene, Position, Attribute, Relation): Includes 43,560 images designed to evaluate Vision-Language Models (VLMs). It tests if a model actually understands spatial and attribute relations, such as "left vs. right" or "blue vs. red."
  • PUG: AR4T: A massive fine-tuning dataset of 250,000 images intended to help models learn the spatial and attribute-based relationships they currently lack.
Examples from PUG: ImageNet demonstrating precise control over lighting, background, and camera angles for a single object.

Key Insights and Results

By testing state-of-the-art models on these highly controlled datasets, the authors uncovered several critical vulnerabilities in current representation learning:

  • The "Bag-of-Words" Problem: PUG reveals that many top-tier Vision-Language Models (like CLIP) do not actually "read" captions relationally. They behave like a "bag of words," identifying that an "elephant" and a "ball" are present, but failing to distinguish if the elephant is on top of or to the left of the ball. On the PUG: SPAR benchmark, even the largest OpenCLIP models (ViT-G/14) performed near chance (50%) when asked to distinguish simple spatial relations.
  • Accuracy $\neq$ Robustness: Models that achieve high top-1 accuracy on the standard ImageNet validation set often show massive performance swings when PUG: ImageNet varies a single factor, like camera pitch or lighting intensity.
  • Equivariance Gaps: By measuring how embeddings change when an object is modified, the authors found that models have high "background equivariance" (they understand the background changed) but almost zero "size equivariance." Their internal representations do not scale predictably with the object's physical size.

Despite these failures, PUG also offers a solution. Training on PUG: Animals showed that seeing an object in just 10 different backgrounds significantly improved a model's ability to recognize that object in a completely unseen environment. Furthermore, using the PUG: AR4T dataset to fine-tune CLIP models led to a 10% improvement on the ARO benchmark (a standard test for relational understanding), proving that high-quality synthetic data can fix "blind spots" in models trained on billions of real images.

Limitations and Future Work

While UE5 is powerful, the authors acknowledge that asset quality varies; some 3D models are inherently more realistic than others. Currently, the datasets focus on static images, leaving the massive challenge of photorealistic, controllable video for future work. Additionally, the current labeling is limited to class labels and factor values. Future iterations could provide richer ground truth, such as pixel-perfect segmentation masks and depth maps for every generated frame, which would be invaluable for dense prediction tasks.

Summary updated

BibTeX
@inproceedings{bordes2023pug,
  author = {Florian Bordes and Shashank Shekhar and Mark Ibrahim and Diane Bouchacourt and Pascal Vincent and Ari S. Morcos},
  title = {{PUG: Photorealistic and Semantically Controllable Synthetic Data for Representation Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=KRBoWULo2w},
}
Figure