## 3 Multi-Scale Feature Fusion Siamese Network Guided by Edge Contour Model Design
### SPADE Model  
Unlike panoramic image stitching, adjacent bone stick fragments only possess matching geometric shapes and textures along the fractured boundaries. Addressing the issue of losing lower-level details in the backbone feature extraction network caused by the use of BN normalization layers, this paper introduces the SPADE module to incorporate feature information from contour maps. The feature information from contour maps is utilized to guide the normalization of feature maps at various hierarchical levels. The Spatially Adaptive DEnormalization (SPADE) model [18] is a model designed to prevent BN from truncating semantic information of input images, and its basic framework is illustrated in Figure 4.  
The implementation process of the SPADE model [19] can be summarized as modifying the computation of \(\gamma\) and \(\beta\) based on Batch Normalization. Specifically, convolution is utilized to learn the \(\gamma\) and \(\beta\) of feature maps, which are then used as the normalization coefficients and biases, respectively, acting on the previous-level feature maps after the normalization layer following convolution. As illustrated in Figure 2a, assuming the input to the SPADE module comprises the previous-level feature map represented as \(x_{in}\), the  
Figure 3: MFS-GC model framework. In the figure, from top to bottom, the colors represent green, light green, dark green, light blue, and blue, indicating the fused features R1, R2, R3, and R4 obtained through the SPADE model in the conv2_x to conv5_x stages of the backbone network, and the deep features extracted from the conv5_x stage; “a” refers to the similarity value between input images X1 and X2. input contour map as \(l\_s\), and the output feature map as \(x_{out}\), the formulation can be expressed as shown below:  
\[l\_s^{\prime}=RELU(conv(Resize(l\_s))) \tag{4}\]  
\[x_{out}=bn(x_{in})\cdot conv_{\gamma}\left(l\_s^{\prime}\right)+conv_{\beta} \left(l\_s^{\prime}\right) \tag{5}\]  
Due to the discrepancy in size between the input contour map \(l\_s\) and the feature map \(x\), \(l\_s\) is resized to match the size of \(x\). Subsequently, it undergoes a convolutional layer followed by ReLU activation, resulting in an intermediate layer denoted as \(l\_s^{\prime}\). Following this, two distinct convolutional layers are applied to obtain the corresponding \(\gamma\) and \(\beta\) parameters. These derived parameters are then, respectively, used as normalization coefficients and biases, influencing \(bn(x_{in})\). In the SPADE model, \(\gamma\) and \(\beta\) are three-dimensional matrices that have width and height dimensions in addition to the channel dimensions. Therefore, in Equation (6), the subscripts for \(\gamma\) and \(\beta\) include symbols for \(c\), \(y\), and \(x\). This embodies the concept of \"spatial adaptation,\" indicating differences and adaptability in spatial dimensions. This is distinct from the BN layer [20,21], where the parameter vectors \(\gamma\) and \(\beta\) only have the subscript \(c\) (representing channels). Clearly, the computation method of BN, which does not distinguish spatial dimensions, is prone to losing information from the input image. The calculation of the mean \(\mu\) and standard deviation \(\sigma\) in Equation (6) is illustrated in Equations (7) and (8). \[\gamma^{i}_{c,y,x}(m)\frac{h^{i}_{n,c,y,x}-\mu^{i}_{c}}{\sigma^{i}_{c}}+\beta^ {i}_{c,y,x}(m) \tag{6}\]  
Among them:  
\[\mu^{i}_{c}=\frac{1}{NH^{i}W^{i}}\sum_{n,y,x}h^{i}_{n,c,y,x} \tag{7}\]  
\[\sigma^{i}_{c}=\sqrt{\frac{1}{NH^{i}W^{i}}}\sum_{n,y,x}\left(h^{i}_{n,c,y,x} \right)^{2}-\left(\mu^{i}_{c}\right)^{2} \tag{8}\]  
The advantage of the SPADE model is that it better preserves semantic information against public normalization layers. The semantic map focuses differently on different regions of the input image; in this paper, for the edge contour binary image, the contour region is 1 and the other regions are 0. Therefore, the SPADE module is added to allow the network to focus on the contour region features.