Program-Guided Image Manipulators

Xiuming Zhang, Jiayuan Mao, Yikai Li, William T. Freeman, Joshua B. Tenenbaum, Jiajun Wu

Abstract

Program-Guided Image Manipulators (PG-IM) is a neuro-symbolic framework that represents images as structured programs to enable high-level manipulation. By inducing a symbolic "script" of how objects are arranged, it can inpaint, extrapolate, and edit images while perfectly preserving complex global regularities that traditional deep learning models often break.

Introduction

Deep generative models have become incredibly good at synthesizing realistic textures, but they often lack a "big picture" understanding of scene structure. If you ask a standard inpainting model to fill a hole in a grid of windows or a triangular pile of cereal, it might generate realistic-looking pixels that completely ignore the underlying geometric logic. The core challenge is the entanglement of perception (what an object looks like) and reasoning (how objects are arranged). PG-IM aims to bridge this gap by using symbolic programs to represent global regularity.

Methods

The authors propose a three-stage neuro-symbolic pipeline that operates on a single image by exploiting its internal statistics:

  1. Repeated Object Detection: A neural module detects repeated entities in the image and identifies their centroids.
Centroid detection of repeated objects in a triangular layout.
  1. Program Induction: This is the "symbolic" heart of the system. It fits a program written in a Domain-Specific Language (DSL) to the detected centroids. The process involves lattice search (finding the grid), condition generation (determining boundaries like triangles), and attribute search (grouping objects by color or type).
  2. Neural Painting Network (NPN): A U-Net-based architecture performs the actual pixel manipulation, guided by the induced program. It takes "source patches" from other parts of the image to fill in missing or new areas.

Key Results and Insights

PG-IM achieved an L1 Mean error of 21.48 on the Nearly-Regular Pattern (NRP) dataset, significantly outperforming state-of-the-art models like GatedConv (50.45). Qualitatively, the model excels at tasks that require structural logic, such as extrapolating a pattern beyond its original boundaries.

The model uses the induced program to guide extrapolation and inpainting within specific geometric boundaries.

By separating layout (the program) from appearance (the neural painting), the model can perform "Regularity Editing"—for example, taking a messy, hand-placed pile of objects and "snapping" them to a perfect grid. Because the model learns the specific "DNA" of a single image during inference, it requires no massive training dataset to generalize to unique textures.

Conclusion

While PG-IM is currently limited by its Domain-Specific Language (struggling with complex rotations or radial symmetries), it demonstrates that symbolic programs are far more robust than neural weights for capturing strict geometric regularity. Future work aims to incorporate continuous attributes to better handle lighting gradients and more complex perspective distortions.

Summary updated

BibTeX
@inproceedings{zhang2019program,
  author = {Xiuming Zhang and Jiayuan Mao and Yikai Li and William T. Freeman and Joshua B. Tenenbaum and Jiajun Wu},
  title = {{Program-Guided Image Manipulators}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  doi = {10.1109/iccv.2019.00413},
}
Figure