MRS-Transformer: Texture Splicing Method to Remove Defects in Solid Wood Board
Source abstract
Abstract
Defects in wood growth affect the product’s quality and grade. At present, the research on texture defects of wood mainly focuses on defect localization, ignoring the splicing problem of maintaining texture consistency. In this paper, we designed the MRS-Transformer network and introduced image inpainting to the field of solid wood board splicing. First, we proposed an asymmetric encoder-decoder based on Vision Transformer, where the encoder uses a fixed mask(M) strategy, discarding the masked patches and using only the unmasked visual patches as input to reduce model calculations. Second, we designed a reverse Swin (RS) module with multi-scale characteristics as the decoder to adjust the divided image patches’ size and complete the restoration from coarse to fine. Finally, we proposed a weighted L2 loss (MSE, mean square error), which assigns different weights to the unmasked region according to the distance from the defective region, allowing the model to make full use of the effective pixels to repair the masked region. To demonstrate the effectiveness of the designed modules, we used MSE (mean square error), LPIPS (learned perceptual image patch similarity), PSNR (peak signal to noise ratio), SSIM (structural similarity), and FLOPs (floating point operations) to measure the quality of the model generated wood texture images and the model computational complexity, we designed relevant ablation experiments. The results show that the MSE, LPIPS, PSNR, and SSIM of the wood images restored by the MRS-Transformer reached 0.0003, 0.154, 40.12, 0.9173, and the GFLOPs is 20.18. Compared with images generated by the Vision Transformer, the MSE and LPIPS were reduced by 51.7% and 30%, PSNR and SSIM were improved by 12.2% and 7.5%, and the GFLOPs were reduced by 38%. To verify the superiority of MRS-Transformer, we compared the image inpainting algorithms with Deepfill v2 and TG-Net, respectively, in which the MSE was 47.0% and 66.9% lower; the LPIPS was 60.6% and 42.5% lower; the FLOPs was 70.6% and 53.5% lower; the PSNR was 16.1% and 26.2% higher; and the SSIM was 7.3% and 5.8% higher. MRS-Transformer repairs a single image in 0.05 s, nearly five times faster than Deepfill v2 and TG-Net. The experimental results demonstrate that the RSwin module effectively alleviates the sense of fragmentation caused by the division of images into patches, the proposed weighted L2 loss improves the semantic consistency of the edges of the missing regions and makes the generated wood texture more detailed and coherent, and the adopted asymmetric encoder-decoder effectively reduces the computational effort of the model and speeds up the training.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Industrial Vision Systems and Defect Detection · Wood and Agarwood Research · Remote Sensing and LiDAR Applications
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
School of Computer Science, Changzhou University, Changzhou 312000, China
Funding
Research Startup Fund of Changzhou University
References (30)
Show source-provided references
1. Detection of Wood Surface Defects Based on Improved YOLOv3 Algorithm10.15376/biores.16.4.6766-6780 ↗
2. Accurate and Automated Detection of Surface Knots on Sawn Timbers Using YOLO-V5 Model10.15376/biores.16.3.5390-5406 ↗
3. Kingma, D.P., and Welling, M. (2014). Auto-Encoding Variational Bayes. arXiv.
4. Saharia, C., Chan, W., Chang, H., Lee, C., Ho, J., Salimans, T., Fleet, D., and Norouzi, M. (2022, January 24–28). Palette: Image-to-image diffusion models. Proceedings of the ACM SIGGRAPH 2022 Conference Proceedings, Vancouver, BC, Canada.10.1145/3528233.3530757 ↗
5. Generative adversarial networks10.1145/3422622 ↗
6. Pathak, D., Krahenbuhl, P., Donahue, J., Darrell, T., and Efros, A.A. (July, January 26). Context encoders: Feature learning by inpainting. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA.
7. Attention is all you need
8. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., and Gelly, S. (2020). An image is worth 16 × 16 words: Transformers for image recognition at scale. arXiv.
9. Ke, Z.-N., Zhao, Q.-J., Huang, C.-H., Ai, P., and Yi, J.-G. (2016, January 3–5). Detection of wood surface defects based on particle swarm-genetic hybrid algorithm. Proceedings of the 2016 International Conference on Audio, Language and Image Processing (ICALIP), Nanning, China.10.1109/ICALIP.2016.7846635 ↗
10. Yang, Y., Wang, H., Jiang, D., and Hu, Z. (2021). Surface detection of solid wood defects based on SSD improved with ResNet. Forests, 12.10.3390/f12101419 ↗
11. Application of deep convolutional neural network on feature extraction and detection of wood defects10.1016/j.measurement.2019.107357 ↗
12. A Fast and Robust Artificial Intelligence Technique for Wood Knot Detection10.15376/biores.15.4.9351-9361 ↗
13. TG-Net: Reconstruct visual wood texture with semantic attention10.1016/j.cag.2021.09.006 ↗
14. Bertalmio, M., Sapiro, G., Caselles, V., and Ballester, C. (2000, January 23–28). Image inpainting. Proceedings of the 27th Annual Conference on Computer Graphics and Interactive Techniques, New Orleans, LA, USA.10.1145/344779.344972 ↗
15. Filling-in by joint interpolation of vector fields and gray levels10.1109/83.935036 ↗
16. Image inpainting using nonlocal texture matching and nonlinear filtering10.1109/TIP.2018.2880681 ↗
17. Lee, J.H., Choi, I., and Kim, M.H. (July, January 26). Laplacian patch-based image synthesis. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA.
18. Le Meur, O., Gautier, J., and Guillemot, C. (2011, January 11–14). Examplar-based inpainting based on local geometry. Proceedings of the 18th IEEE International Conference on Image Processing, Brussels, Belgium.10.1109/ICIP.2011.6116441 ↗
19. Globally and locally consistent image completion10.1145/3072959.3073659 ↗
20. Yang, C., Lu, X., Lin, Z., Shechtman, E., Wang, O., and Li, H. (2017, January 21–26). High-resolution image inpainting using multi-scale neural patch synthesis. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA.10.1109/CVPR.2017.434 ↗
21. Yu, J., Lin, Z., Yang, J., Shen, X., Lu, X., and Huang, T.S. (2018, January 18–22). Generative image inpainting with contextual attention. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake, UT, USA.10.1109/CVPR.2018.00577 ↗
22. Yu, J., Lin, Z., Yang, J., Shen, X., Lu, X., and Huang, T.S. (November, January 27). Free-form image inpainting with gated convolution. Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea.
23. Nazeri, K., Ng, E., Joseph, T., Qureshi, F., and Ebrahimi, M. (2019). Edgeconnect: Generative image inpainting with adversarial edge learning. arXiv.
24. Guo, X., Yang, H., and Huang, D. (2021, January 11–17). Image inpainting via conditional texture and structure dual generation. Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada.10.1109/ICCV48922.2021.01387 ↗
25. Wan, Z., Zhang, J., Chen, D., and Liao, J. (2021, January 11–17). High-fidelity pluralistic image completion with transformers. Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada.10.1109/ICCV48922.2021.00465 ↗
26. Yu, Y., Zhan, F., Wu, R., Pan, J., Cui, K., Lu, S., Ma, F., Xie, X., and Miao, C. (2021, January 20–24). Diverse image inpainting with bidirectional and autoregressive transformers. Proceedings of the 29th ACM International Conference on Multimedia, Virtual, China.10.1145/3474085.3475436 ↗
27. Dong, Q., Cao, C., and Fu, Y. (2022, January 19–24). Incremental transformer structure enhanced image inpainting with masking positional encoding. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA.10.1109/CVPR52688.2022.01107 ↗
28. Li, W., Lin, Z., Zhou, K., Qi, L., Wang, Y., and Jia, J. (2022, January 19–24). MAT: Mask-Aware Transformer for Large Hole Image Inpainting. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA.10.1109/CVPR52688.2022.01049 ↗
29. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., and Guo, B. (2021, January 11–17). Swin transformer: Hierarchical vision transformer using shifted windows. Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, QC, Canada.10.1109/ICCV48922.2021.00986 ↗
30. He, K., and Sun, J. (2012, January 7–13). Statistics of patch offsets for image completion. Proceedings of the European Conference on Computer Vision, Florence, Italy.10.1007/978-3-642-33709-3_2 ↗