NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Puzzlefusion: Unleashing the Power of Diffusion Models for Spatial Puzzle Solving

Sepidehsadat Hosseini, Mohammad Amin Shabani, Saghar Irandoust, Yasutaka Furukawa

TL;DR

PuzzleFusion redefines spatial puzzle solving—from jigsaw puzzles to floorplan assembly—by treating it as a conditional generation task. Using a Diffusion Model, the system learns to denoise a "cloud" of randomly placed pieces into a perfectly aligned arrangement, significantly outperforming traditional optimization-based methods in both speed and accuracy.

The Challenge of Spatial Puzzles

Spatial puzzle solving is a classic challenge in computer vision and robotics. Whether you are restoring shattered ancient artifacts, stitching together DNA sequences, or trying to arrange scanned room layouts into a coherent floorplan, the core problem is the same: how do you find the global arrangement of pieces based only on their local geometry and properties?

Traditional approaches usually follow a two-step "match-and-search" pipeline:

  1. Enumerate pairs of pieces and score their compatibility.
  2. Use optimization or search algorithms to find the best global fit.

The "Aha!" moment of this paper is realizing that these traditional methods scale poorly. As the number of pieces increases, the search space grows exponentially. Furthermore, these methods are often brittle; if the pieces are slightly "eroded" (noisy edges), the matching logic falls apart.

Enter PuzzleFusion: A Generative Approach

The authors introduce PuzzleFusion, an end-to-end neural architecture based on Diffusion Models. While we usually think of Diffusion Models (like Stable Diffusion) as tools for creating art, PuzzleFusion uses them to "generate" the correct coordinates and rotations for puzzle pieces.

Iterative denoising process of PuzzleFusion

The Diffusion Pipeline

  • Forward Process: The model takes a ground-truth arrangement and gradually adds Gaussian noise to the 2D positions and rotations of the pieces until they are completely scrambled.
  • Reverse Process (The Solver): Starting from random noise, the model learns to iteratively "denoise" the arrangement. It is conditioned on the shape of the pieces (polygonal curves) and their properties (like room type or image features).

Architectural Innovations

To make this work, the authors designed a specialized Transformer-based architecture capable of capturing complex geometric constraints.

PuzzleFusion architecture and Transformer backbone
  • Redundant Representation: Instead of predicting a single $(x, y, \theta)$ for the center of a piece, the model stores the position and rotation estimation at every corner of the polygon. This allows the underlying Transformer architecture to "communicate" geometric constraints more effectively across the piece.
  • Transformer Backbone: The model uses a Transformer where every corner of every piece is a node. This allows for global reasoning—every part of the puzzle can "talk" to every other part to find the best fit.
  • Matching Loss ($L_{match}$): Beyond standard denoising loss, the authors add a specific loss that penalizes the distance between corners that should be touching (like a door connecting two rooms).

Datasets and Evaluation

The paper evaluates PuzzleFusion on three distinct tasks using a mix of existing and brand-new datasets:

  1. Cross-cut Jigsaw (CJP): Synthetic puzzles made by slicing a shape with straight lines.
  2. 2D Voronoi Jigsaw (VJP): A newly introduced synthetic dataset where pieces are generated via Voronoi diagrams. This is significantly harder than standard jigsaws because it lacks the "180-degree" corner constraint found in cross-cut puzzles.
  3. MagicPlan Dataset: A newly introduced real-world dataset containing 98,780 floorplans from a production AR app. This represents a massive leap in scale for the room arrangement task.
  4. RPLAN: A standard dataset of 60k floorplans used for benchmarking.

Key Insights and Results

  • Generative as Discriminative: It is non-intuitive that a generative model (designed to create new data) is so effective at a deterministic reasoning task like puzzle solving. The authors show that the iterative nature of diffusion acts as a powerful "refinement" process that optimization-based methods lack.
  • Robustness to Noise: One of the most significant findings is that PuzzleFusion is incredibly resilient. While heuristic-based SOTA methods fail when piece edges are noisy or "eroded," PuzzleFusion maintains high accuracy because it learns probabilistic geometric priors rather than relying on perfect edge-matching.
  • Efficiency and Scale: PuzzleFusion can estimate an arrangement in roughly 3 seconds, whereas previous search-based methods could take hours or even days for complex houses. On the "Full MagicPlan" dataset, PuzzleFusion achieved a Mean Positional Error (MPE) of 40.81, compared to 53.11 for a standard Transformer baseline. Previous SOTA methods (like Shabani et al.) were computationally unable to even process the full dataset due to their exponential complexity.

Limitations and Future Work

  • Data Dependency: As a deep learning model, PuzzleFusion requires large amounts of training data. It may struggle in niche domains where only a few "puzzles" are available for training.
  • Inference Iterations: While faster than optimization, Diffusion Models are still slower than single-pass "one-shot" neural networks because they require multiple denoising steps.
  • Visual Integration: While the model supports pictorial features (via an auto-encoder), the authors note that more sophisticated integration of raw image data could further improve performance on traditional image-based jigsaw puzzles.

Summary updated

BibTeX
@inproceedings{hosseini2023puzzlefusion,
  author = {Sepidehsadat Hosseini and Mohammad Amin Shabani and Saghar Irandoust and Yasutaka Furukawa},
  title = {{Puzzlefusion: Unleashing the Power of Diffusion Models for Spatial Puzzle Solving}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=Z764QxwETf},
}
Figure