Controlling Style and Semantics in Weakly-Supervised Image Generation

Dario Pavllo, Aurélien Lucchi, Thomas Hofmann

Researchers from ETH Zurich have introduced a novel weakly-supervised framework for generating complex images that provides high-level control over both layout and style. By transitioning from dense, hand-labeled segmentation masks to "sparse masks" and utilizing a two-step generation process, the model enables users to manipulate scenes—adding, moving, or restyling objects—without causing unintended global changes to the image.

The "Goldilocks" Problem in Image Generation

Conditional image generation typically faces a trade-off between ease of use and precision. Weak conditioning, such as a single sentence description, is often too vague for coherent scene construction. Conversely, rich conditioning, like dense pixel-level segmentation masks, produces high-quality results but is expensive to label and brittle to use. For instance, moving an object in a dense mask leaves a "hole" in the background that most models cannot naturally fill.

Furthermore, many Generative Adversarial Networks (GANs) suffer from entanglement. Because models learn strong correlations (e.g., zebras are usually found on green or yellow grass), changing a foreground attribute—like making a zebra "blue"—often causes the entire background to shift colors. This research aims to provide fine-grained, localized control using easily obtainable, sparse data.

Methodology: Sparse Masks and Decomposition

The authors introduce three primary architectural innovations to achieve localized control:

  1. Sparse Masks from Object Detectors: Instead of human-annotated dense masks, the model uses an off-the-shelf object detector (Mask R-CNN). These masks are "sparse" because they do not require every pixel to be labeled, allowing the model to leverage vast amounts of unlabeled data.
  2. Two-Step Generation ($G_1$ and $G_2$): To solve entanglement, the model generates images in two stages. The background generator ($G_1$) creates the static environment (roads, sky, grass) while remaining aware of foreground object locations without rendering them. The foreground generator ($G_2$) then creates the objects and an alpha (transparency) mask to blend them onto the background.
  3. Sentence-Semantic Attention: A new attention mechanism applies text descriptions directly to semantic classes rather than individual pixels. This makes the process computationally efficient and highly interpretable.
The model uses sparse masks to allow for object removal and manipulation without background artifacts.

Key Results and Insights

The model was evaluated on complex benchmarks including COCO-Stuff and Visual Genome. A key finding was that training on sparse masks from an object detector actually yielded better Fréchet Inception Distance (FID) scores (20.02) than training on ground-truth dense masks (22.64). This is likely because detectors identify fine-grained details, such as wheels or windows, that human annotators often simplify.

The framework supports diverse manipulations including object addition/deletion, style transfer (e.g., snow), and attribute editing (e.g., train color) while maintaining background consistency.

Qualitatively, the paper demonstrates impressive "in-the-wild" manipulations. Users can sketch simple blobs, provide a caption like "a red train on a foggy day," and generate a coherent scene. The explicit separation of background and foreground pipelines ensures that changing a car's color does not cause the sky to change color, achieving true locality in editing.

Limitations and Future Work

While the model excels at outdoor scenes and localized editing, it faces challenges with instance differentiation (e.g., distinguishing between two different cars in the same scene when applying text attributes). Additionally, it can struggle with the rigid geometric precision required for indoor photography. The researchers suggest that incorporating positional embeddings into the attention queries could resolve instance differentiation, allowing for even more specific spatial control.

Summary updated

BibTeX
@inproceedings{pavllo2020controlling,
  author = {Dario Pavllo and Aurélien Lucchi and Thomas Hofmann},
  title = {{Controlling Style and Semantics in Weakly-Supervised Image Generation}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58539-6\_29},
}
Figure