Abstract
Within the fields of urban reconstruction and city modeling, shape grammars have emerged as a powerful tool for both synthesizing novel designs and reconstructing buildings. Traditionally, a human expert was required to write grammars for specific building styles, which limited the scope of method applicability. We present an approach to automatically learn two-dimensional attributed stochastic context-free grammars (2D-ASCFGs) from a set of labeled building facades. To this end, we use Bayesian Model Merging, a technique originally developed in the field of natural language processing, which we extend to the domain of two-dimensional languages. Given a set of labeled positive examples, we induce a grammar which can be sampled to create novel instances of the same building style. In addition, we demonstrate that our learned grammar can be used for parsing existing facade imagery. Experiments conducted on the dataset of Haussmannian buildings in Paris show that our parsing with learned grammars not only outperforms bottom-up classifiers but is also on par with approaches that use a manually designed style grammar.
Introduction
Creating detailed 3D city models for digital media or mapping is a massive undertaking. Procedural modeling—using a set of rules or a "shape grammar" to generate geometry—provides a scalable solution. However, these grammars are typically hand-crafted by experts for every specific architectural style, such as Haussmannian or Gothic. Inverse Procedural Modeling (IPM) aims to automate this by discovering rules from data. While prior IPM work often assumed the structure of the rules was known, this paper addresses the structural problem: learning the rules themselves from scratch.
Methodology
The proposed system represents building facades using 2D Attributed Stochastic Context-Free Grammars (2D-ASCFGs). The pipeline is divided into two primary phases: grammar induction and image parsing.
Grammar Induction
To learn the grammar, the system starts with semantically labeled facade images. To manage computational complexity, these images are converted into simplified 2D lattices. Using Bayesian Model Merging, the system begins with a "mega-grammar" that describes only the training examples and iteratively merges similar rules to simplify the structure. This process is guided by a Minimum Description Length (MDL) prior, balancing grammar simplicity with its ability to explain the training data.
Image Parsing
Once a grammar is induced, it is applied to understand new images. Because architectural features have continuous attributes (e.g., specific window dimensions), the system employs Reversible Jump Markov Chain Monte Carlo (rjMCMC). This allows the parser to jump between different grammar structures and refine dimensions to find the optimal fit for a photograph.
Evaluation and Results
The system was evaluated on the ECP (Ecole Centrale Paris) facade parsing dataset, consisting of 104 images of Haussmannian-style buildings. Using 30 images for training and 5-fold cross-validation for testing, the learned grammar achieved an overall accuracy of 74.82%.
This performance significantly outperformed a standard Random Forest classifier (48.55%) and was slightly superior to a manually designed style grammar (74.71%). This proves that automated induction is a viable and efficient replacement for expert manual labor in architectural modeling.
Furthermore, the learned grammar is generative. By sampling the induced rules, the authors generated entirely new, stylistically consistent Parisian streetscapes within CityEngine.
Limitations and Future Work
While successful, the current approach depends on ground-truth semantic labels for training. Future research may explore learning directly from raw imagery or noisy classifier outputs. Additionally, the current 2D Earley parser is optimized for grid-like structures; expanding this to non-Manhattan geometries and reducing the computational cost of the rjMCMC search remain key areas for improvement.
Summary updated