Fix the Match, Not the Solver: STITCH -- a Self-Supervised Compatibility Measure for Eroded Visual Puzzles
Organizations: Ben-Gurion University of the Negev, Israel
Abstract
Unlike the clean and pixel-aligned complete pieces of standard jigsaw benchmarks, real-world puzzle fragments lose their boundary regions to erosion, destroying the signal that classical compatibility measures (CMs) rely on. We first re-establish, via oracle experiments, that the CM, not the solver, is the performance bottleneck: with a perfect CM, even a simple greedy solver achieves perfect reconstruction. This motivates STITCH, a self-supervised CM that sidesteps missing boundaries by comparing frozen ViT patch tokens from piece interiors via a lightweight cross-attention head (~249K trainable parameters), trained without manual annotation. Plugged into unchanged compatibility-based solvers, STITCH reaches .992/.954 Abs/Perf on JPwLEG-5 (+.629 Perf over the best prior method), nearly saturating the benchmark. On a new ImageNet 7x7 benchmark, it outperforms all alternatives, including inpaint-then-match pipelines built on modern generative models. Importantly, performance remains robust across erosion levels and generalizes to puzzles with over 40% missing pieces without retraining. Trained on the recent GAP datasets of irregular, heavily eroded fragments, the same CM recipe enables compatibility-based solvers to surpass recent learning-based solvers on GAP-3 and GAP-5. Since this leap in performance is achieved by a pluggable CM module, the takeaway is clear: fix the match, not the solver.
Figures & tables
| Greedy | Genetic | LP | |||||
|---|---|---|---|---|---|---|---|
| CM | Top-1 | Abs | Perf | Abs | Perf | Abs | Perf |
| SSD | 38.5 | .43 | .09 | .43 | .13 | .47 | .16 |
| 42.5 | .46 | .11 | .50 | .23 | .54 | .26 | |
| PBC | 36.6 | .41 | .08 | .40 | .11 | .44 | .13 |
| MGC | 38.1 | .48 | .12 | .45 | .16 | .48 | .19 |
| Edge2Vec | 50.8 | .56 | .17 | .70 | .44 | .74 | .49 |
| JPwLEG-3 | JPwLEG-5 | |||
|---|---|---|---|---|
| Method | Abs | Perf | Abs | Perf |
| Deepzzle ( 2020 ) | .738 | .523 | .219 | .000 |
| SD 2 RL ( 2023a ) | .816 | .597 | .403 | .051 |
| PDN-GA ( 2023b ) | .813 | .582 | .443 | .061 |
| JPDVT ( 2024 ) | .713 | – | .041 | .000 |
| ERL-MPP ( 2025b ) | – | – | .527 | .186 |
| MGC | Edge2Vec | STITCH | ||||
|---|---|---|---|---|---|---|
| Abs | Perf | Abs | Perf | Abs | Perf | |
| 0 | .42 | .12 | .91 | .78 | .97 | .91 |
| 5 | .27 | .00 | .85 | .39 | .97 | .82 |
| 10 | .21 | .00 | .76 | .10 | .94 | .66 |
| 15 | .18 | .00 | .66 | .03 | .89 | .54 |
| 20 | .18 | .00 | .62 | .01 | .87 | .53 |
| GAP-3 | GAP-5 | |||
| Method | Abs | Perf | Abs | Perf |
| JigsawGAN ( 2021 ) | .453 | .046 | .180 | .000 |
| DiffAssemble ( 2024 ) | .505 | .164 | .219 | .000 |
| JPDVT ( 2024 ) | .112 | .000 | .039 | .000 |
| PuzLM ( 2025 ) | .148 | .000 | .078 | .000 |
| FCViT ( 2025 ) | .607 | .252 | .204 | .000 |
| Variant | Params | MFLOPs | Top-1 | Abs | Perf |
| Projection dimension ( ) | |||||
| 25 K | 3 | 77.2 | .890 | .742 | |
| 249 K | 23 | 83.5 | .964 | .868 | |
| 891 K | 73 | 83.5 | .965 | .867 | |
| (no proj.) | 28.3 M | 2,139 | 80.1 | .948 | .834 |
| Cross-attention layers ( ) | |||||