# MRS-Transformer: Texture Splicing Method to Remove Defects in Solid Wood Board
## 4 Experiments
### Ablation Experiments  
Ablation experiments were conducted to demonstrate the effectiveness of the proposed improvements to the model.  
Group A experiments were trained directly on the dataset using the ViT model as the encoder and decoder, with L2 loss as the loss function, twelve layers for the encoder, and eight layers for the decoder.  
Group B experiments introduced an asymmetric encoder-decoder structure based on Group A, where the encoder was fed with only unmasked image patches and the decoder structure remained unchanged, using L2 loss as the loss function.  
Group C replaced the decoder with the proposed RSwin module based on Group B, with twelve layers in the encoder and eight layers in the decoder, using L2 loss as the loss function.  
Group D, the final proposed algorithm, utilized weighted L2 loss as the loss function based on Group C, with the same encoder and decoder as in Group C.  
The results of the experiments are presented in Table 1, which employed four image evaluation metrics and model computation volume to measure the model's effectiveness from various perspectives. It can be observed that, after the improvements to the input method of the encoder in Group B, the three metrics of MSE, PSNR, and SSIM did not change significantly, and although the LPIPS metric was worse than in Group A, the computational effort of the model decreased by 28.3%. After the redesign of the RSwin module as a decoder in Group C, the other three metrics did not change significantly, and the LPIPS metric decreased by 20.6%, indicating an enhancement of image details from a human eye visual perspective, and the computational effort decreased by 26.3%. Group D, which utilized weighted L2 loss based on Group C, achieved a significant improvement in completing the edges of missing regions of wood, as indicated by the 51.7% and 34.2% decreases in MSE and LPIPS compared with Group C, respectively. Furthermore, the PSNR and SSIM metrics were 12.2% and 7.5% higher than Group C, respectively.  
In addition to objective metrics, visual images at each stage of improvement were chosen as subjective references to make the experimental results more intuitive. As shown in Figure 10, through the comparison of the completed images after four experiments, it can be clearly observed that Group D (MRS-Transformer) has the closest texture structure and semantic information to the original image. Compared with Group B using an asymmetric encoder-decoder structure, the patchy segmentation feeling of Group C's completed results was significantly reduced after introducing the RSwin structure, and the completed texture was more coherent and detailed. Group D introduced weighted L2 loss, and the patchy segmentation feeling was almost eliminated. The edge connections also became coherent semantically, and the texture connections became more natural.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Models** & **MSE\(-\)** & **PSNR+** & **LPIPS\(-\)** & **SSIM+** & **GFLOPs\(-\)** \\ \hline A & 0.0007 & 35.24 & 0.220 & 0.8448 & 38.41 \\ B & 0.0007 & 35.20 & 0.297 & 0.8486 & 27.41 \\ C & 0.0007 & 33.71 & 0.234 & 0.8499 & 20.18 \\ D & **0.0003** & **40.12** & **0.154** & **0.9173** & **20.18** \\ \hline \hline \end{tabular} \(-\) Lower is better. + Higher is better.  
\end{table}
Table 1: Quantitative results of ablation experiments.