Learning Object Placement by Inpainting for Compositional Data Augmentation

Lingzhi Zhang, Tarmily Wen, Jie Min, Jiancong Wang, David Han, Jianbo ShiECCV 2020

Abstract

Deep learning models for object detection and segmentation require vast amounts of annotated data, particularly for rare or "long-tail" classes. While standard data augmentation techniques like "copy-paste" exist, they often lack contextual realism, leading to suboptimal performance. This paper presents PlaceNet, a generative framework that learns "common sense" object placement by leveraging image inpainting. By autonomously generating training pairs from existing datasets through a "cut-and-inpaint" process, PlaceNet learns to predict plausible locations and scales for objects within a scene. Experimental results on Cityscapes and KITTI benchmarks demonstrate significant improvements in mean Average Precision (mAP), especially for rare classes like "Rider," where mAP increased from 0.238 to 0.381.

Introduction

The performance of modern computer vision models is heavily dependent on the diversity and volume of training data. Standard augmentation techniques, such as flipping, scaling, and cropping, provide limited contextual variety. More advanced "copy-paste" methods can introduce new objects into scenes but frequently violate "scene affordance"—the semantic and geometric constraints of a 3D environment. For instance, a car might be placed on a rooftop or a pedestrian in the sky.

Developing models that understand these constraints typically requires expensive manual labeling of all plausible object locations. This paper addresses this challenge by introducing a self-supervised pipeline that uses image inpainting to reverse-engineer training data from existing annotated datasets.

Methodology

Self-Supervised Data Acquisition

The core innovation lies in the automated creation of training data without manual labeling. As illustrated in Figure 4, the process begins with an annotated image. Objects are "cut out" based on their instance masks, and the resulting holes are filled using a deep inpainting network. This creates a "clean" background and a standalone foreground object. Since the original location of the object is known, it serves as a ground-truth label for a plausible placement in that specific context. This "inpainting as a supervisor" approach leverages the prior knowledge already present in existing datasets.

The "Cut-Inpaint-Crop" pipeline for generating self-supervised training data.

PlaceNet Architecture

PlaceNet is a generative model designed to predict a distribution of plausible locations $(x, y)$ and scales $(w, h)$ for a given foreground object and background scene. The architecture, shown in Figure 5, utilizes an encoder-decoder structure with several key components:

  • Diversity via Latent Variables: To avoid predicting a single "average" location, the model incorporates a random variable from a $U(0,1)$ space. A specific diversity loss ($L_{ndiv}$) forces the model to map different random seeds to distinct, diverse placement solutions, preventing mode collapse.
  • Adversarial Training: A discriminator ($L_{adv}$) is employed to distinguish between predicted placements and ground-truth placements, forcing the generator to produce contextually realistic outputs that respect the background context.
  • Modularity: By encoding objects and backgrounds into compact feature vectors, the system can retrieve semantically similar objects (e.g., finding a different person with a similar pose) to swap into a scene, further increasing dataset variety.
The PlaceNet architecture, featuring foreground/background encoders and a diversity-driven decoder.

Experimental Results

The researchers evaluated PlaceNet on two major autonomous driving benchmarks: Cityscapes and KITTI. The impact of the augmentation was measured using YOLOv3 for detection and Mask R-CNN for segmentation.

Performance Gains

The inclusion of PlaceNet-augmented data led to a measurable boost in performance. On the Cityscapes dataset, detection mAP improved from 0.265 to 0.302. The most significant gains were observed in "long-tail" or rare classes. For example, the "Rider" class saw a dramatic improvement from 0.238 to 0.381 mAP. This massive improvement is attributed to the model's ability to generate more varied and contextually valid examples of people on bikes or scooters.

Plausibility and Diversity

In user studies, PlaceNet's placements were rated as more realistic than standard conditional Variational Autoencoder (cVAE) baselines. The diversity loss successfully enabled the model to provide a wider variety of suggested locations, ensuring that the augmented data remained diverse and informative for the downstream models.

Discussion and Conclusion

PlaceNet demonstrates that image inpainting can effectively supervise the learning of scene affordance. By automating the generation of contextually valid training data, the framework significantly enhances the robustness of object detectors and segmentors.

However, some limitations remain. The quality of augmentation is bounded by the performance of the underlying inpainting network, which may leave subtle artifacts. Additionally, the model currently operates in 2D space; while it learns scale as a proxy for depth, it does not explicitly model 3D geometry or complex occlusions (e.g., placing a car behind a tree). Future work could explore how well this "common sense" placement translates to more complex indoor environments or robotic manipulation tasks.

Summary updated

BibTeX
@inproceedings{zhang2020learning,
  author = {Lingzhi Zhang and Tarmily Wen and Jie Min and Jiancong Wang and David Han and Jianbo Shi},
  title = {{Learning Object Placement by Inpainting for Compositional Data Augmentation}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58601-0\_34},
}
Figure