Manuscript Offprint
arXiv:2611.09077GlobalPuzzle: Globally Informed Genetic Search for Eroded Jigsaw Puzzle Reassembly
Abstract
Jigsaw puzzle reassembly remains a highly challenging task, particularly when piece boundaries are irregularly eroded to simulate damage to cultural artifacts. On the GAP benchmark, existing methods achieve a perfect assembly accuracy of only 0.3% on puzzles, whereas humans can solve jigsaw puzzles with remarkably high accuracy. Humans typically approach puzzle solving by identifying potentially adjacent pieces, evaluating the current assembly, and iteratively performing complex operations such as adding pieces, replacing incorrectly placed pieces, and moving entire connected groups of pieces. However, existing methods face a fundamental limitation: approaches that leverage global visual information typically predict piece arrangements directly, making it difficult to explicitly perform such complex iterative operations, while search based methods can rearrange pieces but primarily rely on pairwise boundary compatibility, lacking global visual information to evaluate and guide the search process. To bridge this gap, we propose GlobalPuzzle, a jigsaw puzzle reassembly framework that integrates global canvas level evaluation, action guidance, and genetic search. By incorporating global visual information into the evaluation and optimization of candidate assemblies, GlobalPuzzle aims to resolve ambiguous adjacency relationships that are difficult to determine from irregularly eroded piece boundaries alone, enabling flexible, globally informed reconstruction.
1. Introduction
Jigsaw puzzle reassembly with missing visual information is challenging due to the enormous search space and irregularly eroded piece boundaries [23]. Related reconstruction problems arise in fragmented wall paintings [28]. An puzzle has possible arrangements, making the probability of randomly solving a puzzle only . Boundary erosion disrupts vi-

Figure 1. Fragment reconstruction: the top left shows randomly shuffled irregular pieces, the top right shows the image reconstructed using LaMa after correct assembly, the bottom left illustrates position query generation, and the bottom right shows query-based piece retrieval in GlobalPuzzle.
sual continuity, while smaller pieces provide less information for determining their positions and adjacency relationships [2, 18, 30]. Even advanced AI agents such as Claude Sonnet 5.5 and Codex (GPT-6 Astra) require approximately 10 minutes on average to solve a GAP puzzle and nearly cannot reconstruct puzzles correctly.
Existing methods face two major limitations. Many deep learning approaches exchange fragment features and directly predict or refine arrangements [9, 12, 22, 23], but do not provide a visual fitness score for the assembled canvas or explicit operations for relocating connected groups. Exchanging fragment features does not itself evaluate whether the spatially rendered canvas forms a coherent image. Combinatorial solvers can rearrange pieces and preserve fragment relationships [20, 24], but commonly rely on pairwise boundary compatibility, which becomes unreliable under severe ero-
Equal contribution.
Corresponding author: chuanzhi.xu@sydney.edu.au sion. Learned tree search evaluates partial assemblies [19], but its placement actions do not explicitly relocate connected groups.
Genetic puzzle solvers use crossover to combine structures from two candidate assemblies into a new one, preserving shared fragment connections and internal group relationships [24]. These observations suggest that preserving connected piece groups while allowing their structures to be revised could enable more flexible search. Furthermore, global canvas information offers an opportunity to guide piece placement and evaluate candidate assemblies beyond local boundary compatibility.
Motivated by these observations, we propose GlobalPuzzle, which couples explicit fragment group operations with visual guidance from assembled canvases. GlobalPuzzle has two networks. The Policy Network uses the partial canvas to guide placement, while the Evaluation Network scores complete canvases to guide genetic search. Crossover preserves and relocates shared connections, while mutation randomly changes fragment placements, allowing incorrect structures to be revised. Figure 1 illustrates the reconstruction task and position querying. Grid pooling and position to fragment matching allow the same trained model to process different canvas sizes, fragment sizes, and grid dimensions.
Our contributions can be summarized as:
- We propose GlobalPuzzle, a unified reassembly framework that integrates established connected group inheritance with learned global canvas evaluation and placement guidance.
- GlobalPuzzle further incorporates a reliable evaluation network that supports arbitrary canvas and fragment sizes and assesses assemblies solely through global visual semantics, without requiring pixel alignment across fragment boundaries.
- GlobalPuzzle accommodates different image dimensions, fragment sizes, and rectangular grids without retraining, and improves reconstruction of severely eroded puzzles over the evaluated baselines, reaching perfect assembly accuracies of 68.6% on GAP-3 and 19.4% on GAP-5.
2.1. Direct Arrangement Prediction Methods
Spatial context prediction [4] and jigsaw pretraining [15] learn visual representations from relative positions and tile arrangements. DeepPermNet [21] predicts relaxed permutation matrices using Sinkhorn normalization. This differentiable relaxation enables joint learning of visual features and ordering predictions. JigsawGAN [11] couples permutation
classification with image generation and adversarial supervision. FCViT [9] uses a Vision Transformer [5] to regress fragment coordinates, avoiding a predefined permutation set. PuzLM [6] quantizes fragments into discrete tokens and predicts their reconstructed order with a sequence to sequence language model.
Other methods refine arrangements through successive predictions. DiffAssemble [22] represents fragments as graph nodes and learns to denoise their translations and rotations. JPDVT [12] uses diffusion Transformers to recover positional encodings conditioned on visual content, including settings with missing pieces. PuzzleFlow [23] combines Vision Transformer features with discrete flow matching to update fragment positions conditioned on the current arrangement and flow time.
These approaches use fragment interactions or image semantic supervision to reason beyond individual boundaries. However, training an image generator or exchanging fragment features does not supply a learned fitness function that evaluates complete candidate canvases during search. Furthermore, iterative position updates do not explicitly identify connected groups, preserve their internal relationships, and relocate them as units. GlobalPuzzle combines this structural operation with global visual evaluation and placement guidance, enabling global assessment of assemblies while preserving correct piece relationships.
2.2. Compatibility Based and Learned Search
Compatibility based solvers separate adjacency estimation from arrangement optimization. Approaches include graphical model inference [3], particle filtering [34], quadratic programming [1], and successive linear programming [35]. Pomeranz et al. [20] combine greedy placement with segment rearrangement; Paikin and Tal [16] address mixed puzzles with missing pieces. Gallagher [7] uses gradient compatibility and constrained tree assembly for unknown orientations. Son et al. aggregate consistent cycles into larger loops [29] and grow geometric consensus to reduce dependence on unreliable local matches [30]. Huroyan et al. [8] recover rotations through the graph connection Laplacian before estimating piece positions.
Genetic solvers inherit shared segments through crossover [24]. Extensions address unknown orientations and piece faces [25], and mixed puzzles with unknown dimensions [26]. These methods exploit compatibility and geometric constraints, but do not learn a visual fitness function over complete rendered canvases.
Learned matching improves local placement evidence. DNN-Buddies [27] learns adjacency from fragment pixels, while Paumard et al. [17] predict relative positions using local feature co-occurrences. Deepzzle [18] combines relative position prediction with shortest path optimization, including missing or extraneous fragments. Bridger et al. [2] inpaint

Figure 2. The proposed GlobalPuzzle framework. Offspring inherit common absolute placements (Absolute) and shared relative fragment relationships (Relative) from parent assemblies. The Policy Network generates position queries, which are matched with fragment features from the Piece Encoder to complete the assembly. The Evaluation Network then scores the complete canvas to guide genetic search.
gaps between candidate neighbors and use a discriminator to classify adjacency. These approaches retain local fragment comparisons as the basis for assembly.
Alphazzle [19] instead guides Monte Carlo tree search with policy and value networks that process the current re-assembly. Its actions place the next fragment into an empty position. This provides visual guidance for construction, but does not move a connected group as a unit. GlobalPuzzle combines complete canvas evaluation with structural inheritance, connected group relocation, and placement guidance, allowing arrangements to be revised during search, thereby improving puzzle reconstruction accuracy.
3. Methodology
3.1. Framework Overview
Given unordered image fragments , we seek a permutation assigning one fragment to each position of an grid. Let denote the resulting RGB canvas. GlobalPuzzle searches for the assembly maximizing a learned quality function:
Figure 2 illustrates the GlobalPuzzle framework. Given independently LaMa-inpainted fragments, genetic crossover inherits common absolute placements (Absolute) and shared relative fragment relationships (Relative) from parent assemblies. The Policy Network generates position queries from the partial canvas, while the Piece Encoder extracts fragment features. Position-to-fragment matching then completes the
offspring, which the Evaluation Network scores to guide genetic search.
LaMa [31] processes each eroded fragment independently without ground-truth information, providing dense RGB inputs without guaranteeing continuity between adjacent fragments.
3.2. Policy Network
The policy in Figure 3 encodes all fragments into tokens and extracts a query for each grid position from the partial RGB canvas and its occupancy map. A joint Transformer updates both token sets. The resulting pairwise scores are:
where is learned. One forward pass produces an position to fragment score matrix.
Training uses correct and perturbed partial canvases. When all occupied fragments are correctly placed, each empty position receives a one-hot ground-truth target. Otherwise, occupied neighbors vote for fragments that preserve their ground-truth directional relationships. Normalized vote counts define targets , and the policy minimizes:
where contains supervised empty positions. During search, occupied positions and used fragments are masked. Fragment embeddings are cached across candidates.

Figure 3. The specific structure of the Policy Network and the Evaluation Network.
3.3. Genetic Search with Global Fitness
Initialization and Selection. The policy generates an initial population of complete permutations. Each is evaluated by . The strongest individuals are retained as elites, while parents are sampled with fitness weighted probabilities:
Structural Crossover. Following genetic solvers [24], shared oriented adjacencies define connected groups . Given parents , only groups of at least two fragments with identical absolute placements for all members are copied, each with probability 0.5:
Other groups preserve relative fragment relationships. When a fragment is assigned a position, its connected partners can be placed by translation:
provided that all placements remain within the grid and do not conflict with occupied cells.
Policy Guided Completion. For each distinct partial offspring, the policy generates the score matrix once. The Hungarian algorithm [10] solves a one-to-one assignment between vacant positions and unused fragments :
Here denotes all one-to-one complete matchings. Matched pairs are committed in descending score order. After each commitment, compatible parent shared groups are inherited. Any remaining slots are matched using the same policy scores, yielding a complete permutation.
Mutation and Refinement. Nonelite offspring undergo swaps, three fragment cycles, or block exchanges. Periodic local search evaluates all two position swaps of the best candidate and accepts the highest scoring improvement. The final output is the best assembly encountered during genetic search.
3.4. Evaluation Network
Architecture. The evaluator in Figure 3 processes the complete canvas using a multiscale CNN [33] followed by a Transformer [32]. Features pooled to the puzzle grid retain spatial organization, while a global token and spatial read-out provide complementary representations. The network outputs a quality logit and a fitness score . This score is denoted by in Figures 2 and 3, with higher values indicating better predicted assembly quality. An auxiliary head estimates absolute accuracy during training.
Quality Supervision. Let be the ground truth, the grid coordinate of fragment , and the set of oriented ground-truth adjacencies . We define:
We generate training assemblies with controlled displacement counts and structural transformations, including block exchanges, row and column shifts, and mixed mutations.
Training Objective. The evaluator is trained with logit regression, score calibration, within puzzle ranking, hard negative mining, and auxiliary AA regression:
Regression targets are logit(). For candidates of the same puzzle with , the ranking term penalizes:
with larger weights for greater quality differences and structural negatives. The hard negative term penalizes the most overestimated incorrect candidate relative to the correct assembly.
3.5. Final Reconstruction
After determining the final piece arrangement, we reconstruct the canvas using the original, non-inpainted fragments. LaMa is then applied to the assembled canvas to fill the missing regions using global visual context, producing the final reconstructed image shown in Figure 1. This step uses a pretrained model without additional training and does not participate in the puzzle-solving process.
4. Experiments and Results
4.1. Experimental Setup
Datasets and Evaluation Metrics. We evaluate GlobalPuzzle on GAP-3 () and GAP-5 () [23], following the official splits of 14,000 training, 3,000 validation, and 3,000 test puzzles for each dataset. Each fragment is independently inpainted using LaMa to provide RGB inputs for the Evaluation Network. The Piece Encoder processes individual fragments, while the Policy Network uses a partial canvas and occupancy mask.
We report perfect assembly accuracy (PA) and absolute accuracy (AA), measuring the percentage of fully reconstructed puzzles and correctly placed fragments, respectively. All experiments use an NVIDIA RTX 4060 GPU, with average reconstruction times of 9 and 44 seconds per puzzle on GAP-3 and GAP-5, respectively.
Table 1. Comparison on GAP-3 () and GAP-5 (). PA and AA are reported as percentages.
| Method | GAP-3 | GAP-5 | ||
|---|---|---|---|---|
| PA ↑ | AA ↑ | PA ↑ | AA ↑ | |
| Classical | ||||
| Greedy [20] (CVPR'11) | 0.0 | 11.6 | 0.0 | 4.1 |
| GA [24] (CVPR'13) | 0.0 | 11.1 | 0.0 | 11.1 |
| Deep Learning | ||||
| JigsawGAN [11] (TIP'22) | 4.6 | 45.3 | 0.0 | 18.0 |
| DiffAssemble [22] (CVPR'24) | 16.4 | 50.5 | 0.0 | 21.9 |
| JPDVT [12] (CVPR'24) | 0.0 | 11.2 | 0.0 | 3.9 |
| Elkin et al. [6] (ECCV'26) | 0.0 | 14.8 | 0.0 | 7.8 |
| FCViT [9] (ESWA'25) | 25.2 | 60.7 | 0.0 | 20.4 |
| PuzzleFlow [23] (CVPR'26) | 28.5 | 62.9 | 0.3 | 29.1 |
| GlobalPuzzle (Ours) | 68.6 | 81.6 | 19.4 | 48.7 |
Network Training. GlobalPuzzle contains three learned components: the Evaluation Network, the Policy Network, and the Piece Encoder. The Piece Encoder extracts reusable fragment representations. The Policy Network combines these representations with a partial canvas to predict fragment scores for candidate positions, while the Evaluation Network predicts the quality of a complete assembled canvas.
The Evaluation Network is supervised using the quality target described in Sec. 3.4. Training candidates include correct assemblies, permutations with controlled numbers of misplaced fragments, and structural perturbations. Its objective combines score regression, calibration, candidate ranking, hard negative supervision, and auxiliary AA prediction. We train the Evaluation Network for 50 epochs using AdamW [13], a batch size of 16, a learning rate of , weight decay of 0.05, and a three epoch warmup. Mixed precision training [14] is enabled.
The Policy Network is trained on partially completed canvases containing both correct placements and deliberately perturbed placements. Supervision follows the target construction in Sec. 3.2: empty positions receive the corresponding ground-truth fragment target when the context is correct, or a distribution derived from neighboring fragment relationships when the context is perturbed. The prediction loss is computed against all fragments, while invalid assignments are excluded when completing a puzzle. Fragment representations produced by the Piece Encoder are cached and reused during genetic search.
Detailed network architectures and training procedures are provided in Appendices B and C, respectively.
Genetic Search Configuration. Unless otherwise specified, we use a population of 256 individuals, 30 generations,

Figure 4. Visual comparison of the restoration for each method. Codex and Claude performed puzzle reconstruction through their respective web interfaces, while PuzzleFlow [23] was evaluated using its officially released pretrained weights.
and four elites per generation. Parents are selected using fitness weighted sampling with exponent . Genetic crossover preserves shared absolute placements and shared relative fragment relationships, followed by completion using the Policy Network and assignment optimization. We use random completion probability 0.05 per vacant position and mutation probability 0.20 per nonelite offspring. Local refinement is performed every five generations, with at most four accepted improvement steps per invocation. To maintain consistency across comparisons, the same search budget is used for the corresponding ablation variants. Appendix D provides implementation and inference-efficiency details.
Comparison Methods. We compare GlobalPuzzle with classical optimization methods and learning based approaches. The classical group includes greedy assembly [20] and a conventional genetic algorithm [24] based on local fragment compatibility. The learning based group includes JigsawGAN [11], DiffAssemble [22], JPDVT [12], FCViT [9], PuzzleFlow [23], and the method of Elkin et al. [6]. These baselines cover direct arrangement prediction, learned recon-
struction, and compatibility driven optimization. We additionally examine representative attempts by general purpose multimodal agents to illustrate the challenges of explicit fragment manipulation and iterative reconstruction. Since agent attempts are analyzed as qualitative case studies, they are not treated as directly comparable benchmark measurements.
4.2. Comparison with Existing Methods and General Purpose Agents
Table 1 compares reconstruction accuracy on GAP-3 and GAP-5. GlobalPuzzle achieves mean PA and AA of 68.6% and 81.6% on GAP-3, respectively. On the more challenging GAP-5 benchmark, the corresponding means are 19.4% and 48.7%. Per-seed results and standard deviations are reported in Appendix A. These results show improvements in complete reconstruction and fragment placement relative to the baselines listed in the table. The decline from GAP-3 to GAP-5 also indicates that larger assemblies remain substantially more difficult, despite the use of global image information and iterative search.
Table 2. Ablation study on GAP-3 and GAP-5. PA and AA are reported as percentages.
| Method | GAP-3 (%) | GAP-5 (%) | ||
|---|---|---|---|---|
| PA | AA | PA | AA | |
| Random Evaluation Network | 1.9 | 25.2 | 0.0 | 9.6 |
| Random Policy Network | 65.1 | 73.4 | 0.0 | 16.9 |
| No Crossover | 60.0 | 75.4 | 10.4 | 42.5 |
| No Swapping | 63.5 | 76.2 | 11.3 | 42.7 |
| No Crossover and Swapping | 54.5 | 70.7 | 0.1 | 9.3 |
| GlobalPuzzle (Full) | 68.6 | 81.6 | 19.4 | 48.7 |
Figure 4 compares reconstruction results from PuzzleFlow [23], general purpose multimodal agents Codex and Claude, and our GlobalPuzzle. PuzzleFlow is evaluated using its officially released pretrained weights, while Codex and Claude perform reconstruction through their respective web interfaces. While existing methods and agents can recover partial image structures, they often struggle to produce fully correct arrangements. In contrast, GlobalPuzzle combines global visual evaluation with iterative genetic search to refine fragment placements and improve reconstruction accuracy. These examples reveal misplaced fragments in individual puzzles, complementing the aggregate metrics without quantifying agent performance. Appendix E presents additional successful reconstructions and failure cases.
4.3. Ablation Studies
Table 2 isolates the learned networks and genetic operations under the same datasets, metrics, and search budget. We replace each network's outputs with random scores or disable crossover, swapping, or both, while retaining the other components.
Evaluation Network and Policy Network. The Evaluation Network directs elite retention, parent selection, local refinement, and the final output. Random evaluation reduces GAP-3 PA/AA from 68.6/81.6% to 1.9/25.2% and GAP-5 from 19.4/48.7% to 0.0/9.6%. Even with the learned policy and genetic operators intact, uninformative fitness cannot reliably retain good candidates. Candidate diversity therefore cannot compensate for losing the signal that steers evolution. Policy guidance becomes critical as the grid grows. Random policy scores retain legal assignments but remove learned placement guidance. On GAP-3, PA decreases from 68.6% to 65.1% and AA from 81.6% to 73.4%. Inherited placements and connected groups constrain the 9! arrangements, allowing population diversity to partly compensate for weak guidance without guaranteeing exhaustive search. On GAP-5, random policy scores reduce PA to 0.0% and AA to 16.9%. With 25! unconstrained arrangements, the same budget cannot supply enough useful candidates through un-

Figure 5. Evaluation Network: Mean predicted fitness versus the number of misplaced pieces on GAP-3 and GAP-5.

Figure 6. Policy Network: Top-1 accuracy versus the number of correctly placed pieces on GAP-3 and GAP-5.
guided completion. The policy therefore becomes essential for exploring the larger search space.
Genetic Search Operations. Crossover and swapping supply candidates for evaluation. Crossover recombines inherited placements and connected groups, while swapping revises fragment positions within an assembly. Removing crossover leaves swapping available and yields GAP-3/GAP-5 PA of 60.0/10.4%; removing swapping leaves crossover available and yields 63.5/11.3%. Each remaining operator can still propose changes that the evaluator selects, so the framework retains partial effectiveness despite lower accuracy.
Removing both operators eliminates these complementary routes for revising candidates. GAP-5 PA/AA then collapse to 0.1/9.3%, compared with 19.4/48.7% for the full model. GAP-3 retains 54.5/70.7%, consistent with the smaller search space being easier to cover. Together, these results show that evaluation chooses which candidates survive, while policy guidance and genetic variation determine which candidates become available. Reliable evaluation needs a continuing supply of useful alternatives, particularly on GAP-5.
4.4. Analysis of the Evaluation Network and Policy Network
Evaluation Network. Figure 5 plots mean predicted fitness against the number of misplaced fragments on GAP-3 and GAP-5. This diagnostic examines whether scores respond to intermediate reconstruction quality, beyond distinguishing complete solutions from incorrect assemblies. Such

Figure 7. Genetic search progression from earlier candidates to the final reconstruction. Red outlines mark misplaced fragments in each candidate assembly.
sensitivity matters because selection and refinement must compare partially correct candidates throughout search. The curves summarize average behavior; they do not establish that every candidate pair is ranked correctly. The random evaluation ablation complements this diagnostic by measuring the downstream effect of removing informative fitness from the complete solver.
Policy Network. Figure 6 reports the Policy Network's top one fragment prediction accuracy over supervised empty positions. A prediction is correct when the highest scoring fragment matches the target, with accuracy computed from the prediction scores before the assignment stage. This isolates the learned placement signal from the effects of the Hungarian algorithm and later genetic search.
Results are reported separately for GAP-3 and GAP-5 and grouped by the number of correctly placed fragments to examine the effect of available visual context. The random policy ablation measures a different property: whether population search can compensate for losing this placement signal. Strong recovery on GAP-3 therefore does not make the policy redundant; its contribution becomes decisive when the larger GAP-5 search space limits candidate coverage.
4.5. Analysis of the Genetic Search Process
We analyze the evolution of candidate assemblies throughout genetic search. Figure 7 presents the best candidate from selected generations together with its reconstruction qual-

Figure 8. Reconstructing images from different numbers and sizes of fragments in daily life.
ity. This visualization illustrates how search can improve a partially correct arrangement through changes in individual fragment positions and the translation of connected fragment groups. Such group operations are particularly useful when several fragments have a consistent internal arrangement but occupy an incorrect region of the canvas.
4.6. Real World Photo Reconstruction and Generalization
To evaluate generalization beyond the GAP benchmarks, we apply GlobalPuzzle to real world photographs and puzzle configurations of different sizes, including rectangular grids such as , , and . The pretrained networks are applied without additional training or fine tuning. Figure 8 presents representative reconstruction results across different scenes and puzzle configurations.
These experiments examine the ability of GlobalPuzzle to generalize to unseen image content and grid dimensions. Position queries follow the target grid, while the Evaluation Network scores the resulting complete canvas. This allows the same learned components to support reconstruction beyond the square configurations used during training.
5. Conclusion
GlobalPuzzle integrates global canvas evaluation, placement guidance, and genetic search for eroded puzzles. Global semantics guide fragment replacement and connected group relocation without requiring pixel alignment. Experiments show improved reconstruction on GAP-3 and GAP-5 and generalization across canvas sizes and grid dimensions without retraining. Ablations show that reliable evaluation is essential for selecting useful assemblies, while placement guidance and genetic variation supply promising candidates, especially as the search space grows. Together, these components preserve useful fragment relationships while allowing incorrect structures to be revised, linking local placement decisions to the coherence of the complete assembly. The lower accuracy on GAP-5 shows that larger assemblies remain difficult despite global visual guidance. Future work will explore faster search for arbitrary fragment shapes and layouts while retaining the ability to revise connected groups under limited computational budgets.
References
[1] Fernanda A. Andaló, Gabriel Taubin, and Siome Goldenstein. Solving image puzzles with a simple quadratic programming formulation. In Proceedings of the Conference on Graphics, Patterns and Images (SIBGRAPI), pages 63–70, 2012.
[2] Dov Bridger, Dov Danon, and Ayellet Tal. Solving jigsaw puzzles with eroded boundaries. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3526–3535, 2020.
[3] Taeg Sang Cho, Shai Avidan, and William T. Freeman. A probabilistic image jigsaw puzzle solver. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 183–190, 2010.
[4] Carl Doersch, Abhinav Gupta, and Alexei A. Efros. Unsupervised visual representation learning by context prediction. In Proceedings of the IEEE International Conference on Computer Vision (ICCV), pages 1422–1430, 2015.
[5] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Housby. An image is worth words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR), 2021.
[6] Gur Elkin, Ofir Itzhak Shahar, and Ohad Ben-Shahar. PuzLM: Solving jigsaw puzzles with sequence-to-sequence language models. In Proceedings of the European Conference on Computer Vision (ECCV), pages 58–75, 2026.
[7] Andrew C. Gallagher. Jigsaw puzzles with pieces of unknown orientation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 382–389, 2012.
[8] Vahan Huroyan, Gilad Lerman, and Hau-Tieng Wu. Solving jigsaw puzzles by the graph connection laplacian. SIAM Journal on Imaging Sciences, 13(4):1717–1753, 2020.
[9] Garam Kim, Hyeonseong Cho, and Hyoungsik Nam. Solving jigsaw puzzles by predicting fragment's coordinate based on vision transformer. Expert Systems with Applications, 272:126776, 2025.
[10] Harold W. Kuhn. The Hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2(1–2):83–97, 1955.
[11] Ru Li, Shuaicheng Liu, Guangfu Wang, Guanghui Liu, and Bing Zeng. JigsawGAN: Auxiliary learning for solving jigsaw puzzles with generative adversarial networks. IEEE Transactions on Image Processing, 31:513–524, 2022.
[12] Jinyang Liu, Wondmgezahu Teshome, Sandesh Ghimire, Mario Sznaier, and Octavia Camps. Solving masked jigsaw puzzles with diffusion vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 23009–23018, 2024.
[13] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations (ICLR), 2019.
[14] Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, and Hao Wu. Mixed precision training. In International Conference on Learning Representations (ICLR), 2018.
[15] Mehdi Noroozi and Paolo Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In Proceedings of the European Conference on Computer Vision (ECCV), pages 69–84, 2016.
[16] Genady Paikin and Ayellet Tal. Solving multiple square jigsaw puzzles with missing pieces. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4832–4839, 2015.
[17] Marie-Morgane Paumard, David Picard, and Hedi Tabia. Jigsaw puzzle solving using local feature co-occurrences in deep neural networks. In Proceedings of the IEEE International Conference on Image Processing (ICIP), pages 1018–1022, 2018.
[18] Marie-Morgane Paumard, David Picard, and Hedi Tabia. Deepzzle: Solving visual jigsaw puzzles with deep learning and shortest path optimization. IEEE Transactions on Image Processing, 29:3569–3581, 2020.
[19] Marie-Morgane Paumard, Hedi Tabia, and David Picard. Alphazzle: Jigsaw puzzle solver with deep Monte-Carlo tree search. arXiv preprint arXiv:2302.00384, 2023.
[20] Dolev Pomeranz, Michal Shemesh, and Ohad Ben-Shahar. A fully automated greedy square jigsaw puzzle solver. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 9–16, 2011.
[21] Rodrigo Santa Cruz, Basura Fernando, Anoop Cherian, and Stephen Gould. DeepPermNet: Visual permutation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3949–3957, 2017.
[22] Gianluca Scarpellini, Stefano Fiorini, Francesco Giuliani, Pietro Morerio, and Alessio Del Bue. DiffAssemble: A unified graph-diffusion model for 2D and 3D reassembly. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 28098–28108, 2024.
[23] Ofir Itzhak Shahar, Gur Elkin, and Ohad Ben-Shahar. The missing GAP: From solving square jigsaw puzzles to handling real world archaeological fragments. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3186–3196, 2026.
[24] Dror Sholomon, Omid David, and Nathan S. Netanyahu. A genetic algorithm-based solver for very large jigsaw puzzles. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1767–1774, 2013.
[25] Dror Sholomon, Omid E. David, and Nathan S. Netanyahu. A generalized genetic algorithm-based solver for very large jigsaw puzzles of complex types. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 2839–2845, 2014.
[26] Dror Sholomon, Omid E. David, and Nathan S. Netanyahu. Genetic algorithm-based solver for very large multiple jigsaw puzzles of unknown dimensions and piece orientation. In Proceedings of the Genetic and Evolutionary Computation Conference (GECCO), pages 1191–1198, 2014.
[27] Dror Sholomon, Omid E. David, and Nathan S. Netanyahu. DNN-Buddies: A deep neural network-based estimation metric for the jigsaw puzzle problem. In Artificial Neural Networks and Machine Learning (ICANN), pages 170–178, 2016.
[28] Elena Sizikova and Thomas Funkhouser. Wall painting reconstruction using a genetic algorithm. ACM Journal on Computing and Cultural Heritage, 11(1):3:1–3:17, 2018.
[29] Kilho Son, James Hays, and David B. Cooper. Solving square jigsaw puzzles with loop constraints. In Proceedings of the European Conference on Computer Vision (ECCV), pages 32–46, 2014.
[30] Kilho Son, Daniel Moreno, James Hays, and David B. Cooper. Solving small-piece jigsaw puzzles by growing consensus. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1193–1201, 2016.
[31] Roman Suvorov, Elizaveta Logacheva, Anton Mashikhin, Anastasia Remizova, Arsenii Ashukha, Aleksei Silvestrov, Naejin Kong, Harshith Goka, Kiwoong Park, and Victor Lempitsky. Resolution-robust large mask inpainting with fourier convolutions. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision (WACV), pages 2149–2159, 2022.
[32] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, 2017.
[33] Sanghyun Woo, Shoubhik Debnath, Ronghang Hu, Xinlei Chen, Zhuang Liu, In So Kweon, and Saining Xie. ConvNeXt V2: Co-designing and scaling ConvNets with masked autoencoders. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 16133–16142, 2023.
[34] Xingwei Yang, Nagesh Adluru, and Longin Jan Latecki. Particle filter with state permutations for solving image jigsaw puzzles. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2873–2880, 2011.
[35] Rui Yu, Chris Russell, and Lourdes Agapito. Solving jigsaw puzzles with linear programming. In Proceedings of the British Machine Vision Conference (BMVC), pages 139.1–139.12, 2016.
Supplementary Material
Table S1. Robustness to random seeds on GAP-3 and GAP-5. Results are reported as percentages.
| Seed | GAP-3 | GAP-5 | ||
|---|---|---|---|---|
| PA | AA | PA | AA | |
| 42 | 69.2 | 80.2 | 19.5 | 48.4 |
| 43 | 68.5 | 82.8 | 19.1 | 49.6 |
| 2026 | 68.0 | 81.8 | 19.7 | 48.0 |
| M±S | 68.6 ± 0.6 | 81.6 ± 1.3 | 19.4 ± 0.3 | 48.7 ± 0.8 |
A. Robustness to Random Seeds
We evaluate the robustness of GlobalPuzzle to stochastic genetic search using three random seeds (42, 43, and 2026) on GAP-3 and GAP-5. The pretrained Evaluation Network and Policy Network, evaluation samples, and all search hyper-parameters are kept identical across runs. Only the random seed controlling population initialization, parent selection, connected group placement, and mutation is varied. Each experiment uses a population of 256 individuals and a maximum of 30 generations.
Table S1 reports perfect assembly accuracy (PA) and absolute accuracy (AA) for each seed, together with their mean and standard deviation. The full-model results in the main text and Tables 1 and 2 use these means. These experiments assess the sensitivity of reconstruction performance to different stochastic search trajectories while isolating the influence of random seeds from network training and other experimental settings.
B. Method Details
B.1. Evaluation Network
Backbone and Spatial Tokens. The Evaluation Network scores a completed RGB canvas using ConvNeXt V2 Femto pretrained on ImageNet-1K. Features from three backbone stages are extracted after resizing the canvas to 64N × 64N, where N is the puzzle grid width. ImageNet normalization is applied before the backbone. Each feature map is adaptively average-pooled to N × N, and the pooled features are concatenated and projected to 192 channels with a linear layer and LayerNorm. This yields one token per puzzle position.
Learnable position embeddings are stored on a 5 × 5 reference grid and interpolated bicubically for other grid dimensions. A learned CLS token and its positional embedding are prepended to the sequence. A three-layer Transformer encoder uses six attention heads, a feedforward dimension of 384, GELU activations, pre-normalization, and dropout of 0.1. It exchanges information across all puzzle positions and produces both spatial tokens and a global CLS representation.
Spatial Readout and Fitness. The spatial tokens are reshaped to an feature map. A convolution reduces the channels from 192 to 96, followed by a depthwise-pointwise residual block and a convolution reducing the channels to 48. GroupNorm and SiLU are used in the spatial branch. Its output is resized bilinearly to and flattened to 1200 dimensions. Concatenating this vector with the 192-dimensional CLS token produces a 1392-dimensional feature. The Quality Head applies a 1392–256–1 MLP with SiLU and dropout of 0.1. A separate 1392–128–1 MLP predicts auxiliary absolute accuracy (AA) during training. The sigmoid of the quality logit is used as the genetic-search fitness.
B.2. Policy Network
The Policy Network receives a four-channel partial canvas consisting of RGB values and a binary occupancy mask. A convolutional stem and shallow branch produce 64-channel local features, while a deeper residual CNN produces 256-channel features. Both branches are pooled to and concatenated. Grouping each neighborhood yields a 1280-dimensional representation per puzzle position. LayerNorm, a linear projection, and GELU map these features into 256-dimensional position queries.
Two-dimensional sinusoidal positional encodings are computed from normalized row and column coordinates for the current grid. A learned occupied-or-empty state embedding is added to each query. A three-layer query Transformer with eight attention heads, a feedforward dimension of 1024, and dropout of 0.1 updates the position queries using the partial canvas context.
B.3. Piece Encoder and Joint Matching
The Piece Encoder applies a shared CNN independently to each LaMa-inpainted RGB fragment. Four convolutional stages expand the feature channels from 32 to 64, 128, and 256, using stride-two downsampling and residual blocks. The feature map is adaptively pooled to . An MLP maps the flattened 4096-dimensional vector through 512 dimensions to a 128-dimensional piece embedding.
Piece embeddings are projected into the 256-dimensional query space. Learned token-type embeddings identify queries and pieces, while used-state embeddings mark pieces already placed. A two-layer joint Transformer with eight attention heads and a feedforward dimension of 1024 pro-
Table S2. Evaluation Network architecture. denotes the puzzle grid width.
| Module | Configuration | Output |
|---|---|---|
| Backbone | ConvNeXt V2 Femto, feature stages 1–3 | Multiscale feature maps |
| Grid pooling | Adaptive average pooling to | per scale |
| Projection | Linear, LayerNorm, positional embedding | |
| Transformer | 3 layers, 6 heads, FFN dimension 384 | |
| Spatial CNN | Conv 192–96, residual block, Conv 96–48 | |
| Fusion | Flattened spatial features and CLS token | 1392 |
| Quality Head | 1392–256–1 | Fitness logit |
| Auxiliary AA Head | 1392–128–1 | AA logit |
Table S3. Policy Network and Piece Encoder architectures. Query and piece tokens interact through the joint Transformer.
| Module | Configuration | Output |
|---|---|---|
| Canvas encoder | RGB and occupancy input; shallow 64, deep 256 channels | Feature maps |
| Grid pooling | Both scales to , grouped in cells | 1280 per position |
| Query projection | LayerNorm, Linear, GELU | |
| Query Transformer | 3 layers, 8 heads, FFN dimension 1024 | |
| Piece Encoder | Shared CNN, pooling, MLP | |
| Piece projection | Linear 128–256 | |
| Joint Transformer | 2 layers, 8 heads, FFN dimension 1024 | |
| Matching heads | Residual, LayerNorm, Linear | each |
| Pairwise scoring | Learned-scale cosine similarity |
Table S4. Training and search hyperparameters used for GlobalPuzzle.
| Setting | Value |
|---|---|
| Evaluation / Policy epochs | 50 / 50 |
| Evaluation / Policy batch size | 16 / 8 |
| Learning rate / weight decay | |
| Warmup epochs | 3 |
| Backbone learning-rate multiplier | 0.1 |
| Population / maximum generations | 256 / 30 |
| Elites / roulette exponent | 4 / 4.0 |
| Absolute group inheritance probability | 0.50 |
| Random placement per empty slot | 0.05 |
| Mutation per nonelite child | 0.20 |
| Local search interval / accepted steps | 5 / 4 |
| Policy / Evaluation inference batch | 32 / 32 |
| Policy / Evaluation cache capacity | 8192 / 32768 |
Table S5. Structural negative sampling and full-offspring mutation distributions.
| Operation | Probability |
|---|---|
| Evaluation training negatives | |
| Block exchange | 0.40 |
| Row or column shift | 0.30 |
| Row or column exchange | 0.20 |
| Mixed mutation | 0.10 |
| Complete offspring mutation | |
| Two-piece swap | 0.60 |
| Three-piece cycle | 0.25 |
| Two-cell block exchange | 0.15 |
cesses all tokens using bidirectional self-attention. The joint outputs are added to their corresponding input embeddings and projected through separate LayerNorm and linear heads to 128-dimensional query and piece representations. The representations are -normalized and matched by scaled cosine similarity. The learned logit scale is initialized to 12 and bounded to [1, 40].
All query and piece tokens participate in joint attention. Occupied-position and used-piece constraints are imposed when selecting placements, rather than masking the joint Transformer. The Piece Encoder outputs can be reused across candidate canvases of the same puzzle. Query encoding and joint attention are recomputed because the partial canvas and used-piece states change.
C. Training and Data Details
C.1. Evaluation Network Supervision
The continuous quality target combines absolute accuracy and oriented structural reassembly accuracy as . For each puzzle, the base candidate pool contains the correct permutation and candidates with exactly misplaced pieces for every . Each incorrect candidate is formed by selecting positions and sampling a derangement on those positions. Thus, the candidate has exactly misplaced pieces, and a single misplaced piece is never sampled because it cannot occur in a complete permutation.
Four additional structural negatives are generated using block exchanges, row or column shifts, row or column exchanges, and mixed mutations. Their sampling probabilities are reported in Table S5. These transformations retain some local structure while changing the global arrangement. Each training candidate receives its continuous Q target and an AA target.
The training loss combines SmoothL1 regression on , mean squared calibration error on the sigmoid fitness, pairwise ranking within each puzzle, hard-negative supervision, and auxiliary AA regression:
Candidate pairs are ranked according to their ground-truth quality difference using a margin scale of 3.0. Pairs involving structural negatives receive an additional weighting factor of 1.5. The hard-negative term penalizes the largest quality-adjusted score violation among incorrect candidates relative to the correct assembly.
C.2. Policy Network Supervision
The Policy Network and Piece Encoder are trained jointly. Each training example consists of the full set of fragments, a partially assembled RGB canvas, its binary occupancy mask, the identities of already used fragments, and a target distribution for each supervised empty position. A partial state assigns a distinct fragment to each occupied position and leaves all other positions empty. The ground-truth permutation is used to construct the state and supervision, but is not given to either network as input.
Number of Placed Fragments. For each training example, the number of occupied positions is sampled independently. An empty canvas () is selected with probability 0.10, a one-fragment canvas () with probability 0.30, and is sampled uniformly from with total probability 0.60. Empty canvases use a ground-truth one-hot target at every position. One-fragment canvases reproduce random initialization: the seed is correctly positioned with probability , and otherwise a fragment is placed at an incorrect position.
Partial-State Construction. For , three state types are sampled with probabilities 0.45, 0.30, and 0.25, respectively. In Random Correct states, k distinct positions are selected uniformly, and each receives its correct ground-truth fragment. In Group Correct states, occupied positions are constructed by growing spatially connected groups from separated seeds, with two or three groups when the grid and occupancy count permit. Every selected position still receives its correct fragment. For k = 1 and , the grouped-position sampler falls back to randomly selected positions when separate groups cannot be formed.
In Corrupted states, a correct partial arrangement is first constructed from either uniformly selected positions or grouped positions, each with probability 0.5. A perturbation then exchanges two occupied fragments, replaces an occupied fragment with an unused fragment, or translates a small connected subset of occupied fragments when a legal shift exists. The perturbation preserves unique fragment identities and the number of occupied positions. A corrupted sample is accepted only when at least one fragment occupies an incorrect absolute position and an unused ground-truth fragment remains eligible for a vacant position. Invalid states are resampled. These three probabilities apply to the branch; the one-fragment branch uses the separate random-initialization distribution described above.
Position Targets and Loss. If all occupied fragments are correctly placed, each empty position is supervised by the one-hot identity of its ground-truth fragment. Otherwise, occupied four-neighbors of each empty position propose fragments according to the corresponding relative offsets in the ground-truth permutation. The votes from valid neighboring anchors are normalized to form a soft target. Empty positions without a valid target do not contribute to the loss, and occupied positions are never directly supervised. For every supervised empty position, cross-entropy is computed over the complete set of fragment logits, including fragments already placed on the canvas. Occupancy and used-fragment masks are applied during inference assignment rather than to the training softmax.
C.3. Optimization and Preprocessing
Both networks are trained for 50 epochs with AdamW, an initial learning rate of , weight decay of 0.05, and a three-epoch warmup. The Evaluation Network uses a batch size of 16 canvases, and the Policy Network uses a batch size of 8. The pretrained evaluator backbone uses 0.1 times the base learning rate. Mixed precision is enabled. Detailed configurations are listed in Table S4.
Each eroded fragment is independently inpainted using LaMa before network processing, without access to the correct complete arrangement. This preprocessing supplies RGB inputs while retaining the need to infer correct adjacency and global placement. After the permutation is determined, the original fragments are reassembled and LaMa is applied to the complete canvas for final image restoration. The latter stage does not influence the predicted permutation.
D. Genetic Search Implementation
D.1. Structural Crossover
Given two parent permutations, directed rightward and downward adjacency relations shared by both parents define connected groups containing at least two fragments. A group qualifies for absolute inheritance only if every member occupies the same absolute position in both parents. The entire group is retained with probability 0.5. Single fragments are not inherited solely because their positions agree.
Groups not fixed by absolute inheritance are considered for relative inheritance in descending order of group size. Each group is translated without rotation to a uniformly sampled feasible location that preserves its internal offsets and does not overlap previously placed pieces. When no legal translation exists, its fragments remain available for subsequent policy completion.
D.2. Completion, Mutation, and Refinement
The Policy Network scores each distinct partially assembled offspring once. Before Hungarian assignment, each vacant position receives a random unused fragment with probability 0.05. The remaining positions and fragments are then matched one-to-one. The resulting complete offspring are evaluated by the Evaluation Network. Four elites are retained, and parents are sampled with fitness-weighted roulette selection using exponent .
Each nonelite complete offspring is independently mutated with probability 0.20 using a two-piece swap, a three-piece cycle, or a two-cell block exchange. The respective operation probabilities are given in Table S5. Local refinement evaluates all two-position swaps of the best assembly and accepts the highest-fitness improvement. It runs at generation zero, every five generations, and at the final generation, with at most four accepted improvements each time. The search uses 256 individuals and up to 30 generations, and returns the best-scoring assembly encountered.
D.3. Inference Efficiency
The Piece Encoder outputs are cached separately from the canvas-dependent joint attention results. Policy scores and Evaluation Network scores are cached per puzzle, with capacities of 8192 and 32768 entries. Inference uses batches of up to 32 candidate canvases for each network. On an NVIDIA RTX 4060, average reconstruction takes approximately 9 seconds per GAP-3 puzzle and 44 seconds per GAP-5 puzzle.
E. Additional Visual Results
E.1. Additional Method Comparisons
Figure S1 presents additional visual comparisons between GlobalPuzzle and existing methods on GAP-3 and GAP-5. These results further demonstrate the effectiveness of GlobalPuzzle across diverse visual content and puzzle sizes.
E.2. Additional Real-World Reconstruction Results
Figure S6 presents additional reconstruction examples on real-world photographs with different grid configurations. These results demonstrate the ability of GlobalPuzzle to handle diverse image content and puzzle layouts without retraining.
PuzzleFlow CVPR 2026
Claude Sonnet 5.5 medium
Codex Chatgpt6 Astra
GlobalPuzzle (Ours)
Original

Figure S1. Additional compare reconstruction
PuzzleFlow
CVPR 2026
Claude
Sonnet 5.5 medium
Codex
Chatgpt6 Astra
GlobalPuzzle
(Ours)
Original

Figure S2. Additional compare reconstruction
PuzzleFlow
CVPR 2026
Claude
Sonnet 5.5 medium
Codex
Chatgpt6 Astra
GlobalPuzzle
(Ours)
Original






Figure S3. Additional compare reconstruction
PuzzleFlow
CVPR 2026
Claude
Sonnet 5.5 medium
Codex
Chatgpt6 Astra
GlobalPuzzle
(Ours)
Original

Figure S4. Additional compare reconstruction
PuzzleFlow
CVPR 2026
Claude
Sonnet 5.5 medium
Codex
Chatgpt6 Astra
GlobalPuzzle
(Ours)
Original

Figure S5. Additional compare reconstruction

Figure S6. Additional examples of reconstruction live photos

Figure S7. Additional examples of reconstruction live photos

Figure S8. Additional examples of reconstruction live photos