Abstract
Layout representation is a critical task in graphic design and user interface development. Traditional methods often treat layouts as flat collections of bounding boxes, failing to capture the inherent hierarchical relationships between design elements. This paper introduces the Spatial-Structural Hierarchical Auto-Encoder (SSH-AE), a framework designed to model layouts as hierarchical trees. By integrating dual pathways for spatial (visual) and structural (relational) patterns across multiple resolutions, SSH-AE achieves state-of-the-art performance in layout retrieval. Furthermore, the authors propose Tree-Edit Distance (TED) as a more robust metric for evaluating structural similarity in design.
Introduction
In graphic design, a layout is more than just a set of coordinates; it is a structured hierarchy where elements like buttons are nested within containers and sections. Existing models that rely on "flat" lists of bounding boxes struggle to capture these logical groupings. This lack of hierarchical modeling makes it difficult for machines to distinguish between layouts that look similar visually but differ significantly in their underlying organization. The authors address this by treating layouts as hierarchical trees rather than flat collections of boxes.
Methods
The SSH-AE framework addresses these challenges by decomposing layout representation into two complementary pathways. First, a hierarchy is constructed where the root represents the background and leaf nodes represent basic elements, with intermediate nodes formed through geometric alignment and containment.
The model employs a Multi-Level Encoding & Fusion strategy. Features from detailed lower levels are recursively fused into coarser higher levels. The Spatial Pathway uses a decoder to reconstruct "Semantic Maps"—multi-channel images representing element classes. Simultaneously, the Structural Pathway reconstructs an "Adjacent Matrix" to describe relational patterns across the hierarchy. To evaluate these structural similarities, the authors utilize Tree-Edit Distance (TED), measuring the operations required to transform one layout tree into another.
Datasets
The research utilizes two primary datasets:
- RICO: The largest publicly available UI layout dataset, containing 66k samples from mobile apps. Hierarchical annotations were extracted using geometric properties.
- POSTER: A new dataset of 35k professional poster templates from Adobe Spark, featuring original hierarchical annotations created by designers.
Key Results and Insights
SSH-AE demonstrates superior performance over existing Graph Convolutional Networks (GCNs) and standard Auto-Encoders. On the RICO dataset, the model achieved a 0.694 MIoU, outperforming the previous state-of-the-art. In structural retrieval on the POSTER dataset, it achieved the best TED score of 6.420. Human alignment tests using Normalized Discounted Cumulative Gain (NDCG) confirmed that the ensemble version of SSH-AE provides search results most consistent with human perception.
Key insights include:
- Hierarchy as a Feature: Explicitly modeling the tree structure allows the model to handle complex layouts that overwhelm flat models.
- Spatial vs. Structural Trade-off: These two perspectives are often orthogonal; SSH-AE allows for a tunable trade-off between visual overlap and logical organization.
- TED as a Superior Metric: Tree-Edit Distance provides a more accurate reflection of how humans perceive the "blueprint" of a design compared to standard overlap metrics.
Conclusion and Future Work
By treating hierarchy as a core component of design, SSH-AE effectively bridges the gap between visual appearance and logical structure. While the model pushes the state-of-the-art, a gap remains toward theoretical optimal retrieval scores. Future work may extend this hierarchical representation from retrieval to generative tasks, potentially enabling the automated creation of complex, logically structured designs from scratch.
Summary updated