SAC-GAN: Structure-Aware Image-to-Image Composition for Self-Driving

Hang Zhou, Ali Mahdavi-Amiri, Rui Ma, Hao Zhang

TL;DR

SAC-GAN is a self-supervised framework for realistic image composition that prioritizes structural and semantic coherence over pixel-level blending. By predicting optimal 2D transformations for object patches based on scene layouts, it enables high-quality data augmentation for rare scenarios, such as inserting specialized vehicles into diverse self-driving datasets.

What Problem Does This Paper Address?

In fields like autonomous driving, training robust models requires data for "long-tail" scenarios—rare events like encountering an ambulance in a snowstorm or a tow truck on a narrow street. Collecting this data in the real world is difficult and expensive.

Image composition (pasting a 2D object patch into a background scene) is a promising shortcut for data augmentation. However, existing methods often struggle with "plausibility." Objects are frequently placed at incorrect scales or in semantically nonsensical locations (e.g., a car floating in the sky or a chair on a kitchen counter). Most current research focuses on pixel-level realism—making the edges look smooth or matching the lighting—while ignoring the high-level structural "common sense" required for a realistic scene.

Methods

The authors introduce SAC-GAN (Structure-Aware Composition GAN), an end-to-end VAE-GAN architecture designed to learn the optimal 2D affine transformation (translation and scaling) for an object patch.

Key components include:

  • Structure-Aware Features: Instead of raw RGB pixels, the network uses semantic layout maps (segmented regions like "road," "sidewalk," "building") for the scene and edge/silhouette maps for the object. This forces the model to learn spatial relationships rather than just color matching.
  • Self-Supervised Training: To obtain ground truth without manual labeling, the authors use a "cropping" strategy. They take an existing image, crop out a known object, and train the network to put it back in its original location and scale.
  • VAE-GAN Architecture: The model uses a Variational Autoencoder (VAE) path for stability and to prevent "mode collapse" (where the model always predicts the same location), and a Generative Adversarial Network (GAN) path to ensure the resulting compositions are diverse and realistic.
  • Dual Discriminators: An affine transform discriminator checks if the predicted scale and position are realistic, while a layout discriminator ensures the final semantic map of the composed scene looks like a valid real-world layout.
The SAC-GAN inference pipeline predicts a 2D transform for an object patch based on scene layouts and object edges.

Datasets

The model was trained and evaluated on several diverse datasets:

  • Cityscapes: Used for street scene composition (cars, pedestrians, street lights).
  • CelebAHQ: Used for facial composition (adding glasses to faces).
  • 3D-FUTURE: Used for indoor scene composition (placing furniture).
  • Generalization Sets: The model's ability to handle unseen data was tested using Google-searched images of rare vehicles and background scenes from KITTI, BDD, and Mapillary Vistas.

Key Insights and Ideas

  • Structure Over Pixels: The core "aha moment" is that semantic layouts provide more useful information for object placement than raw RGB values. By focusing on the structure of the scene, the model learns that cars belong on roads and glasses belong on eyes, regardless of the lighting or weather.
  • Self-Supervision is Sufficient: By framing composition as a reconstruction task (putting a cropped object back), the authors bypass the need for expensive, manually annotated "plausible location" datasets.
  • Teacher-Student Dynamics: The training process acts like a teacher-student network where the self-supervised "reconstruction" branch teaches the "generation" branch how to handle entirely new scenes and objects.
Comparison of training and inference branches.

Key Results

SAC-GAN significantly outperformed state-of-the-art baselines like ST-GAN, CompGAN, and PlaceNet in both quantitative and qualitative metrics:

  • Perceptual Quality: In human A/B testing, users preferred SAC-GAN results over Instance Insertion results 93.6% of the time for car compositions.
  • FID Scores: SAC-GAN achieved a Fréchet Inception Distance (FID) of 24.3 for cars on Cityscapes, nearly 33% better than the next best competitor (PlaceNet at 36.4).
  • Data Augmentation Boost: When used to augment the Cityscapes dataset with rare vehicles (trucks and buses) from Google images, SAC-GAN improved the mIoU (mean Intersection over Union) of downstream semantic segmentation models like PSPNet, whereas other composition methods actually degraded performance due to unrealistic placements.
Qualitative comparison showing SAC-GAN's superior ability to respect lane structures and object scales.

Limitations and Future Work

While SAC-GAN excels at placement and scaling, it has notable limitations:

  • Geometric Constraints: The current model only handles 2D translation and scaling. It cannot rotate objects or adjust their 3D perspective to match a scene's camera angle.
  • Occlusion: The model does not explicitly handle occlusions (e.g., a car should be partially hidden if it's placed behind a tree).
  • Pixel-Level Realism: Because the focus is on structure, the model does not perform color harmonization or shadow generation. The authors suggest these could be added as post-processing steps.
  • Future Directions: The authors propose integrating 3D inference and exploring vision-language models to allow users to guide object placement using text prompts.

Summary updated

BibTeX
@article{zhou2024sac,
  author = {Hang Zhou and Ali Mahdavi-Amiri and Rui Ma and Hao Zhang},
  title = {{SAC-GAN: Structure-Aware Image-to-Image Composition for Self-Driving}},
  journal = {IEEE Trans. Vis. Comput. Graph.},
  year = {2024},
  doi = {10.1109/tvcg.2022.3226689},
}
Figure