This paper addresses the prediction of adjacency between pairs of 2D fragments based on their contours. We improved the two-stage architecture proposed in Beaulac's thesis, in which a rotation-equivariant Siamese convolutional neural network scores pairs of local image windows along the two contours of two fragments. The scores are gathered in an adjacency matrix in which a ResNet detects the partial anti-diagonal band that reveals the adjacency of two fragments. In the current work, we keep the pipeline and replace the local score by a comparison of tangent-angle profiles of contour windows, making it, by construction, invariant to fragment rotation and agnostic to the selected contour-starting point. These adaptations may be either a training-free likelihood ratio or a small one-dimensional convolutional model trained on corresponding points. We also replaced the final classifier by a band U-Net that segments the band and classifies the pair, so that the shared arc is obtained along with the decision. In the synthetic data set of the original thesis, the tangent descriptor performs as well as or better than the image-window approach in all tested configurations. The proposed pipeline reaches an accuracy of 98%, vs 93% to 95% for the original approach once its evaluation is corrected. We tested our pipeline, with models trained only on synthetic data, on the PairingNet benchmark, and obtained an AUC of 0.93. Furthermore, under the PairingNet pair-searching protocol conditions, our learned descriptor obtains a Recall@10 of 0.82 on the real set against 0.56 from the best model of the original paper.
Figures & tables
Figure 1: The pipeline on one synthetic pair (16-fragment image, 1000×1000 px, validation seed). (a) The windows. The main view is a 52×52 px zoom on the shared cut of two interior neighbours a and b : the window of a centred on point k is its 41 consecutive contour points t=−20,…,20 (blue circles, one per pixel) and the matching window of b is the 41 points of b at the same locations (orange dots). The lower-left inset shows the whole pair with the shared cut in black, the two windows in blue and orange and an unrelated window of b in grey. The lower-right inset shows the image. (b) The descriptor of each window: the tangent angle at every point of the window, relative to the angle at its centre, with b read backwards. The orange profile reproduces the blue one and the grey one does not. Dots mark the 21 samples the learned model sees at one of its three smoothing scales. (c) The adjacency matrix of Beaulac [ 2 ] : one row per sampled point of a (red dots) and one column per sampled point of b . Its ideal filling is 1 where the two points match and 0 elsewhere, so a shared cut is an anti-diagonal band. The red lines join the matched points to their rows and columns. A coarse sampling is drawn here for legibility. (d) The matrix of the same pair filled by the training-free score ( Equation 3 ) at the stride of the experiments, one row every three points. (e) The same matrix filled by the learned score (dot products of 32-d embeddings). The learned score responds to many locally similar windows and the read-out, i.e. the best anti-diagonal run (green), selects the band. Cells of (d) and (e) are thickened for display. (f) The arc read off (e), mapped back onto the two contours, against the true cut.
Figure 2: Architecture. Beaulac’s structure (window scores, then a matrix, then a global decision) with the two replacements of this paper. The window is described by its tangent-angle profile and scored by a formula or by a 129k-parameter 1-D CNN. The matrix is read by a band U-Net or by a maximal anti-diagonal run, both of which return the shared arc. The original C8 image-window network and the original ResNet18 classifier serve as references in every comparison.
Local model
Global classifier
Acc.
AUC
His C8 CNN, his code
His ResNet18, as written
0.715 ± 0.006
n/a a
Same, labels corrected
0.939 ± 0.010
n/a a
C8 image windows (port)
ResNet18
0.936
0.978
ResNet18, ImageNet init.
0.945
0.978
ResNet18 + roll
0.942
0.981
Band U-Net
0.950
0.984
Table 1: Global-stage accuracy and AUC on the published data of Beaulac (400-px images, his labels, 746 validation matrices with the corrected labels and 1 492 with the labels as written). Rows 1–2: his released code, mean and standard deviation over three seeds. Rows 3–10: our port with his negatives and matrix size, one seed.
16-fragment images, test split
26-fragment images, validation
Design
First stage
ResNet18
+pretr.
+roll
U-Net
Int.
IoU
ResNet18
+pretr.
+roll
U-Net
Original
C8 image windows
0.935
0.966
0.984
0.995
1.00
0.93
0.705
0.894
0.943
0.965
Tangent descriptor
0.995
0.998
0.998
0.999
1.00
0.96
0.970
0.971
0.984
0.984
No frame
C8 image windows
0.649
0.900
0.924
0.965
0.99
0.87
0.571
0.875
0.926
0.960
Tangent descriptor
0.961
0.975
0.973
0.984
1.00
0.93
0.956
0.969
0.981
0.985
Frame kept
C8 image windows
0.913
0.916
0.921
0.949
0.84
n/a
0.888
0.886
0.893
0.914
Table 2: Global-stage accuracy on the synthetic benchmark (1000-px images, one seed) for each first stage, classifier and design. 16-fragment images: held-out test split. 26-fragment images: validation split. Int. : interior-pair AUC of the band U-Net. IoU : median IoU of the arc predicted by the U-Net (n/a for Frame kept , where no arc is defined).
Figure 3: Synthetic benchmark ( Table 2 ). Accuracy of the global stage by first stage (orange: Beaulac’s C8 image-window CNN, blue: the tangent descriptor) and classifier (light to dark: the original ResNet18, ResNet18 with roll augmentation, the band U-Net), for the four designs. (a) 16-fragment images, held-out test split. (b) 26-fragment images, validation split.
Model, data
Acc.
AUC
Int.
Published weights, our Original images
0.674
0.768
0.656
Same, every fragment rotated
0.524
0.543
0.533
Same, 16-fragment images
0.657
0.803
0.646
Published weights, their generator and protocol
0.827
0.917
0.751
Tangent pipeline, No frame
0.985
0.999
0.999
Tangent pipeline, Diverse cuts
0.926
0.963
0.963
Table 3: Published weights of the contour Transformer [ 7 ] , scored one pair at a time on our validation images (rows 1–3) and under the validation protocol of the article on 200 images of the authors’ generator (row 4), compared with the tangent pipeline with the band U-Net on the 26-fragment images (rows 5–6, validation). Int. : interior-pair AUC.
16-fragment
26-fragment
Design
First stage
U-Net
IoU
U-Net
IoU
Original
C8 image windows
0.72
0.34
0.71
0.34
Tangent descriptor
0.80
0.24
0.71
0.36
No frame
C8 image windows
0.75
0.35
0.64
0.01
Tangent descriptor
0.71
0.36
0.73
0.35
Frame kept
C8 image windows
0.58
0.19
0.57
0.00
Table 4: Zero-shot transfer to the real set of PairingNet (199 true pairs against 199 cross-puzzle pairs, contours at scale 0.8) of the pipelines trained on synthetic data. U-Net: AUC of the band-map maximum. IoU: median IoU of the predicted arc on the true pairs.
Set
Method
R@5
R@10
N@5
N@10
Input
Real
Learned tangent descriptor + anti-diagonal run (ours)
0.794
0.823
0.709
0.718
Contour
Training-free tangent descriptor + anti-diagonal run (ours)
0.688
0.748
0.628
0.650
Contour
Tangent pipeline matrix (stride 3), anti-diagonal run (ours)
0.683
0.713
0.635
0.646
Contour
PairingNet [ 39 ]
0.415
0.564
0.321
0.369
Contour + texture
JigsawNet [ 16 ] , as reported in [ 39 ]
0.237
0.326
0.185
0.213
Image
Rule-based [ 35 ] , as reported in [ 39 ]
0.138
0.247
0.079
0.114
Contour + colour
Table 5: Pair searching under the protocol of PairingNet on its real set (320 fragments) and on its generated test set (3 279 fragments). The learned descriptor is trained on the training split of PairingNet and its values are means over three seeds (standard deviation at most 0.016). The values of PairingNet, JigsawNet and the rule-based method are those reported in [ 39 ] . Bold: best of the set. Underlined: best among the contour-only methods.
Figure 4: PairingNet’s pair-searching protocol. (a) Real set and (b) generated test set. Recall@ k of the learned descriptor (mean and sd over three seeds), of the training-free descriptor with the anti-diagonal run, of the published PairingNet, JigsawNet and rule-based results [ 39 ] and of the published contour Transformer. (c) Robustness on the real set to i.i.d. Gaussian jitter of the contour points. The learned descriptor keeps its AUC and most of its Recall@10 at 1 px, whereas the training-free score degrades quickly.
Synthetic
Beaulac
PairingNet
Trained on
AUC
R@10
AUC
R@10
AUC
R@10
Synthetic diverse cuts
0.997
0.975
0.985
0.958
0.968
0.866
PairingNet training split
0.991
0.930
0.984
0.965
0.970
0.823
Table 6: The learned tangent descriptor with the anti-diagonal run, trained on synthetic diverse cuts or on the training split of PairingNet and tested on both kinds of data. AUC of the adjacent pairs against the non-adjacent pairs (the cross-puzzle pairs on PairingNet) and Recall@10, under the protocol of PairingNet on its real set and per query fragment on the other sets, whose labels are exact. Synthetic: 100 held-out diverse-cut images (806 fragments, 765 pairs). Beaulac: his 15 validation images (240 fragments, 373 pairs). PairingNet: the real set (320 fragments, 199 pairs) at scale 0.4. One seed, except the last two values of the second row ( Table 5 ).
Data Science, George Washington University, USA · Department of Mathematical Sciences, Montana Technological University, USA · Faculty of Computer and Information Science, University of Ljubljana, Institute IMFM, Slovenia +1