Learning to Assemble Geometric Shapes

Jinhwi Lee, Jungtaek Kim, Hyunsoo Chung, Jaesik Park, Minsu Cho · DOI

Abstract

This paper presents a learning-based approach to a classic combinatorial puzzle: assembling a target geometric shape from a set of arbitrary, textureless fragments. By introducing the Fragment Assembly Network (FAN), the authors demonstrate that deep learning can outperform traditional optimization methods in both speed and accuracy, even when dealing with "broken" or missing pieces.

Introduction

Shape assembly is a fundamental problem in fields ranging from robotic manufacturing to archaeology, such as reconstructing shattered artifacts. While humans are naturally adept at puzzles like Tangrams, machines struggle with the "combinatorial explosion"—as the number of parts increases, the number of possible configurations grows exponentially. Most existing solutions rely on "mating hints," such as matching colors across a seam or interlocking jigsaw "tabs." This paper tackles a much more difficult version of the problem where fragments are textureless and have indistinctive junctions (smooth edges). In this scenario, there are no local patterns to match; the agent must understand the global geometric relationship between the fragments and the target container.

Methodology

The authors frame the problem as a sequential decision-making task. At each step, the model evaluates the remaining target area and the pool of available fragments to determine the next move. The architecture, called the Fragment Assembly Network (FAN), consists of three main components:

  1. FAN-Select: A network that evaluates the pool of fragments and selects the most logical next piece to place.
  2. FAN-Pose: An encoder-decoder network that predicts the optimal $(x, y)$ coordinates and rotation for the selected fragment.
  3. Fragment Relation Attention Module (FRAM): This module uses multi-head attention, inspired by Transformers, to capture high-order relationships between all available fragments simultaneously. This ensures the model is permutation-equivariant, meaning the order in which fragments are listed does not affect the model's understanding of their collective context.

The model is trained using a supervised objective, where the ground truth is derived from the original fragmentation process used to create the puzzle.

Experimental Setup

Since no standard benchmark existed for this specific textureless problem, the authors created several synthetic datasets using Binary Space Partitioning (BSP). They started with a target shape (Square, Pentagon, or Hexagon) and recursively split it into $N$ fragments.

  • Standard Shapes: Square, Pentagon, and Hexagon.
  • Mondrian-Square: A specialized dataset using axis-aligned cuts, resulting in rectangular fragments reminiscent of Piet Mondrian’s paintings.
  • Abnormal Scenarios: To test robustness, versions were created where fragments were randomly missing, eroded (shrunk), or distorted (warped).
  • ImageNet Textures: A version with colored textures to test generalization to traditional jigsaw-style tasks.

Results and Discussion

Performance and Efficiency

On the Square dataset, FAN achieved an Intersection over Union (IoU) of 0.882, vastly outperforming Simulated Annealing (0.655) and Bayesian Optimization (0.664). Furthermore, FAN is incredibly efficient. While Simulated Annealing took over 1,800 seconds to solve a single puzzle, FAN completed the task in less than 1 second, representing a speedup of nearly 2,000 times.

Geometric Complexity as a Hint

Interestingly, the model performed better on complex shapes like Pentagons and Hexagons than on simple Squares. This is because complex shapes provide more geometric information (unique angles and side lengths), whereas squares lead to more ambiguous, interchangeable rectangular fragments. This suggests that the model effectively leverages global geometric cues.

Robustness

In "archaeological" scenarios with missing or distorted fragments, FAN maintained high coverage. Traditional optimization methods often collapsed or became stuck in poor local optima when faced with these irregularities, whereas the neural approach proved more resilient.

Conclusion

The Fragment Assembly Network demonstrates that deep learning can effectively solve complex geometric puzzles without the need for texture or edge-matching cues. By utilizing attention mechanisms to understand fragment relationships and framing assembly as a sequential task, the model achieves superior accuracy and massive speed improvements over traditional baselines.

Future work may address current limitations, such as the use of discrete rotation bins rather than continuous space, and the extension of the framework from 2D shapes to 3D assembly. Additionally, moving toward a model that can predict a target shape when it is not provided beforehand remains a significant challenge for real-world applications.

Summary updated

BibTeX
@inproceedings{lee2022learning,
  author = {Jinhwi Lee and Jungtaek Kim and Hyunsoo Chung and Jaesik Park and Minsu Cho},
  title = {{Learning to Assemble Geometric Shapes}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.24963/ijcai.2022/146},
}
Figure