Submodular Field Grammars: Representation, Inference, and Application to Image Parsing

Abram L. Friesen, Pedro M. DomingosNeurIPS 2018

This paper introduces Submodular Field Grammars (SFGs), a framework that bridges the gap between the high-level structural reasoning of grammars and the low-level spatial flexibility of Markov Random Fields (MRFs). By doing so, it makes image parsing both accurate and incredibly fast.

The Challenge of Image Parsing

Natural scenes are inherently hierarchical: a "house" is composed of a "roof" and "walls," and a "wall" contains "windows." Stochastic image grammars are the perfect tool to model this "part-subpart" structure.

Example of hierarchical image parsing using a grammar, decomposing a scene into semantic parts.

However, there is a massive technical hurdle: the split-point problem. In natural language processing (1D), splitting a sentence into two parts is easy because there are only a linear number of places to "cut" the string. In images (2D), there are an exponential number of ways to split a region into two arbitrary shapes.

To keep things mathematically tractable, previous researchers usually forced these shapes to be simple rectangles or used slow sampling methods. This meant you either had a model that was too "boxy" to be realistic or too slow to be useful. Consequently, many researchers abandoned grammars entirely in favor of "flat" MRFs, which handle arbitrary shapes well but fail to capture the deep hierarchical relationships of a scene.

Submodular Field Grammars (SFGs)

The authors propose Submodular Field Grammars (SFGs) to get the best of both worlds.

Illustration of a Submodular Field Grammar, combining hierarchical grammar rules with submodular MRFs.
  1. The Model: They associate every production rule in a grammar (e.g., $A \to BC$) with a submodular MRF. When the grammar decides to split object $A$ into parts $B$ and $C$, the MRF takes over to decide exactly which pixels belong to which part. Because the MRF is "submodular" (meaning neighboring pixels prefer to have the same label), finding the optimal split becomes a classic min-cut/max-flow problem, which is computationally efficient.
  2. The Algorithm (SFG-PARSE): They developed a move-making algorithm inspired by the CYK algorithm used in linguistics. It works bottom-up, iteratively "fusing" smaller parsed regions into larger ones.
  3. Expressivity: Unlike standard MRFs, SFGs can reuse "sub-parses." For example, a "wheel" grammar can be learned once and reused for cars, trucks, and bicycles, leading to exponential gains in model efficiency.

Key Insights

  • Submodularity as a Bridge: The "aha moment" is realizing that submodularity solves the exponential split-point problem. It turns a search through infinite shapes into a tractable graph-cut problem.
  • Linear vs. Exponential Scaling: Traditional inference methods like $\alpha$-expansion or Belief Propagation (BP) scale exponentially with the height of a grammar because they try to solve the entire label space at once. SFG-PARSE scales linearly because it breaks the problem into a hierarchy of smaller, tractable decisions.
  • Composition Matters: The results suggest that even without "learning" the grammar from scratch (using induced grammars instead), simply providing the model with a hierarchical structure significantly improves its ability to clean up noisy neural network predictions.

Evaluation and Results

The authors evaluated their work using synthetic SFGs to stress-test inference speed, and the Stanford Background Dataset (SBD) for real-world semantic segmentation, using DeepLab features as unary inputs.

  • Massive Speedup: In head-to-head tests, SFG-PARSE was exponentially faster than $\alpha$-expansion and BP as grammar complexity increased. While traditional methods would "time out" or run out of memory, SFG-PARSE finished in seconds.
  • Higher Accuracy: On the SBD, the SFG model achieved 90.03% mean pixel accuracy. This outperformed DeepLab alone (87.77%) and DeepLab combined with a standard flat MRF (87.93%), representing a 20% relative decrease in error over the standard MRF approach.
  • Convergence: The algorithm is mathematically guaranteed to converge to a local minimum and typically does so in fewer than 10 iterations.

Limitations and Future Work

  • Non-Recursive Grammars: The current version of SFG-PARSE only supports non-recursive grammars. Extending this to recursive structures is a noted next step.
  • Learning the Grammar: In this paper, the grammar structures were either generated or induced from over-segmentations. Future work could explore learning grammar rules and MRF parameters end-to-end from data.
  • Label Costs: The current model doesn't incorporate "label costs" (penalties for using too many unique objects), a common feature in some advanced MRF frameworks.

Summary updated

BibTeX
@inproceedings{friesen2018submodular,
  author = {Abram L. Friesen and Pedro M. Domingos},
  title = {{Submodular Field Grammars: Representation, Inference, and Application to Image Parsing}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2018},
  url = {https://openreview.net/forum?id=H1bGvv-u-r},
}
Figure