Abstract
Automated jigsaw puzzle solving typically assumes perfectly fitting pieces. However, real-world applications such as archaeology and document reconstruction involve eroded or missing borders. We present JiGAN, a framework that combines generative adversarial networks (GANs) for piece extension with a relaxation labeling solver. By synthetically "repairing" piece edges before applying a consistency-based optimization, JiGAN significantly outperforms traditional solvers in scenarios with significant information loss between pieces.
Introduction
The reconstruction of fragmented images or objects is a critical task in fields ranging from forensic science to cultural heritage. While computational solvers have achieved high accuracy on "perfect" puzzles—where pieces fit together without gaps—real-world fragments are often damaged. Erosion at the edges of pieces creates physical gaps, meaning the visual information at the boundary of one piece does not directly align with its neighbor.
Traditional solvers rely on local compatibility functions, such as color continuity or gradient matching at the exact edge. When borders are missing, these functions become highly inaccurate. JiGAN (Jigsaw GAN) addresses this by introducing a generative step to predict missing information, followed by a robust optimization framework to find the global solution.
The JiGAN Framework
The JiGAN pipeline consists of two primary stages: generative border extension and a constrained optimization solver.
1. Generative Border Extension
To bridge the gap between eroded pieces, the framework employs a GAN-based image extrapolation model known as "Boundless." This model is specifically designed to extend the content of an image outward. Because the pre-trained Boundless model is optimized for rightward extension, the authors implement a rotation-based strategy: each puzzle piece is rotated 90 degrees four times, passing through the GAN at each step. This ensures that all four borders of a square piece are synthetically extended, providing the necessary visual context for matching.
2. Compatibility and Optimization
Once pieces are extended, the Mahalanobis Gradient Compatibility (MGC) metric is used to calculate the affinity between adjacent pieces. MGC evaluates both color distribution and gradient changes across the newly generated boundaries.
The core of the solver is a relaxation labeling algorithm. This approach treats the puzzle as a "consistent labeling problem," where the goal is to assign each piece to a grid location such that global compatibility is maximized. The process begins with a uniform probability distribution and iteratively updates piece assignments based on the compatibility scores of neighboring pieces. To ensure a valid physical solution where each piece occupies exactly one slot, the authors incorporate Sinkhorn-Knopp normalization. This forces the assignment matrix to be doubly stochastic, effectively enforcing the one-to-one constraint.
Experimental Evaluation
The researchers tested JiGAN against two main benchmarks: the PACS dataset (containing 1,600 images across various styles like art and sketches) and standard large-scale puzzle benchmarks (70 to 150 pieces). Erosion was simulated by removing 7% and 14% of the piece dimensions.
Key Findings
- Impact of GAN Extension: On the PACS dataset with 7% erosion, JiGAN achieved a direct accuracy of 70%, a significant improvement over the 50% accuracy achieved by standard relaxation labeling without the GAN step.
- Scalability: The advantage of JiGAN became more pronounced as puzzle complexity increased. On puzzles with 70–150 pieces and 7% erosion, the baseline solver's accuracy fell to approximately 20%, while JiGAN maintained a mean accuracy of 49%.
- Visual Coherence: Even at 14% erosion, where the gaps are substantial, the framework produced reconstructions that remained visually interpretable, demonstrating the robustness of the relaxation labeling approach in handling potential "hallucinations" from the GAN.
Discussion and Conclusion
JiGAN demonstrates that generative models can serve as a powerful preprocessing step for classical optimization problems. By "repairing" pieces in isolation, the GAN provides enough synthetic context for the relaxation labeling solver to find a globally consistent arrangement.
However, limitations remain. As erosion gaps increase, the GAN's predictions become less reliable, leading to a degradation in solver accuracy. Future research may explore training GANs specifically for multi-directional extension or integrating the generative process directly into the solver's feedback loop. Despite these challenges, JiGAN represents a significant step forward in solving the complex, real-world problem of reconstructing damaged artifacts.
Summary updated