Learning AND–OR Templates for Compositional Representation in Art and Design

Liaoruxing Zhang, Xin Jin, Wenbo Yuan, ChenYu Fan, Song-Chun ZhuICLR 2026

In the world of computer vision, we’ve become very good at telling if an image is "good" or "aesthetic" using massive black-box models. However, we are still remarkably bad at explaining why it’s good or providing a recipe to fix a mediocre shot. This paper from researchers at the Beijing Institute for General Artificial Intelligence and Peking University aims to change that by teaching machines the underlying "grammar" of art and design.

TL;DR

This paper introduces a compositional AND–OR template framework that represents the structural "grammar" of art and design in an interpretable way. By decomposing image quality into specific object, relation, and geometry terms, the model provides actionable feedback for photographers and precise structural steering for AI-generated content (AIGC), all while being significantly more data-efficient than traditional deep learning models.

Overview of the learning, verification, and exploration framework for compositional templates.

What Problem Does This Paper Address?

Most current tools for visual assessment rely on deep neural networks (like ResNets or ViTs) trained on massive datasets. While accurate, these models are "black boxes." If a model gives a photo a low aesthetic score, it cannot tell the photographer, "Move the mountain slightly to the left to balance the horizon."

Furthermore, these models struggle with "few-shot generalization"—learning a new artistic style from just a handful of examples. Art and design are inherently structured (think of the "rule of thirds" or "leading lines"), but standard deep learning often ignores these explicit organizational principles. The authors seek a recomposable structured representation that is both interpretable and executable.

Methods

The core of the paper is the AND–OR Template (AOT). Think of it as a hierarchical flowchart for an image:

  • AND nodes represent parts that must exist together (e.g., a "river" AND a "mountain").
  • OR nodes represent alternative ways those parts can appear (e.g., a "sunny sky" OR a "cloudy sky").
  • Terminals are the basic building blocks, like specific shapes or textures.
Hierarchical structure of the AND-OR Template showing scene and object levels with structural and geometric variations.

The authors use a two-level learning pipeline. First, the model learns "object templates" (like a mountain). Then, it reuses those objects as building blocks to learn "scene templates" (like a mountain range by a lake).

To train this without needing millions of labeled images, they use an EM-type block-pursuit algorithm. It essentially hunts for recurring patterns (blocks) in a data matrix of image features. They also introduce Semi-Supervised structural Expansion (SSE), which allows the model to "bootstrap" its knowledge by looking at unlabeled, high-quality images and deciding if they fit an existing template or require a new "OR" branch.

Datasets

The researchers evaluated their framework using:

  • CITD (Compositional Image Template Dataset): A new, curated dataset of 750 images across 15 themes (e.g., "U-shaped bay," "flying eaves") designed to test structural understanding.
  • AVA and AADB: Large-scale, standard aesthetic benchmarks used to validate how well the model aligns with general human preferences.
  • Places365 (subset): Used to test if these artistic templates could also help with standard scene classification tasks.

Key Insights and Ideas

  • Evidence-to-Prescription: Because the model is a "log-linear" mathematical structure, the final score is just the sum of individual parts. If the score is low, you can look at the "parse tree" to see exactly which part (the "evidence") failed. This allows the model to give "prescriptions"—specific edits to improve the composition.
  • Extreme Parameter Efficiency: The proposed model achieves competitive accuracy on the AVA dataset with only 2,300 parameters. For comparison, a standard VGG19 model has 139 million. This suggests that structural priors are incredibly powerful for reducing model "bloat."
  • AIGC Steering: The templates aren't just for analysis; they can be used as "structural prompts." By feeding a template into a generator like Midjourney, the user can enforce a specific layout (e.g., "put the sun exactly here") that text prompts alone often struggle to control.

Key Results

  • Human Alignment: In a study with 100 practitioners, 74.8% agreed that the learned templates were consistent with professional artistic knowledge.
  • Aesthetic Prediction: On the AVA benchmark, the model achieved 85.65% accuracy, outperforming VGG19 and performing on par with much larger ResNet and ViT models, despite having a fraction of the parameters.
  • Robustness: The model showed high sensitivity to "structural disruptions." If the researchers artificially jittered the geometry of a professional photo, the consistency score dropped sharply, proving the model truly understands composition rather than just recognizing objects.

Limitations and Future Work

While the framework is a major step for interpretability, the authors acknowledge a few hurdles:

  • Subjectivity: Aesthetics are notoriously subjective; the model currently relies on "expert curation" to set its initial seeds, which could introduce bias.
  • Scope: The current templates focus heavily on geometry and part relations. They don't yet fully account for complex lighting, material properties, or the nuances of portrait photography (like facial expressions).
  • Hyperparameter Sensitivity: The semi-supervised expansion stage requires careful tuning of thresholds to prevent the model from learning "noisy" or incorrect structures.

The team plans to expand the framework to include higher-level factors and integrate it more deeply into creative workflows for professional designers.

Summary updated

BibTeX
@inproceedings{zhang2026learning,
  author = {Liaoruxing Zhang and Xin Jin and Wenbo Yuan and ChenYu Fan and Song-Chun Zhu},
  title = {{Learning AND–OR Templates for Compositional Representation in Art and Design}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=cJ4h1FhChe},
}
Figure