面向木材缺陷的全局与局部协同感知检测方法
Global and Local Synergistic Perception Method for Wood Defect Detection
摘要: 针对木材表面缺陷检测中存在的缺陷形态多变、微小缺陷易漏检以及复杂背景纹理干扰等核心挑战。文章提出了一种全局与局部协同感知的检测方法。该方法以Swin Transformer作为主干网络,利用其移位窗口注意力机制构建层次化特征金字塔,有效捕获图像的全局上下文信息与长距离依赖关系;与之协同,构建CTGFusion颈部网络,该网络中,MSF模块通过轻量化MetaFormer架构与深度可分离卷积实现多尺度特征的高效融合,CWA模块则利用具备空间感知能力的门控机制对细微缺陷特征进行自适应增强,有效抑制了特征丢失与平滑问题。实验结果表明,本方法在精确率、召回率和mAP50上分别达到0.895、0.874和0.916,性能优于多个主流检测模型。在微小、低对比度缺陷的检出与复杂背景适应方面表现优异,为木材表面缺陷的自动化质检提供了可靠解决方案。
Abstract: Aiming at the core challenges in wood surface defect detection, such as significant morphological diversity, the vulnerability of micro-defects to missed detection, and interference from complex background textures, this paper proposes a detection method based on global and local synergistic perception. The method adopts Swin Transformer as the backbone network, utilizing its shifted window attention mechanism to construct a hierarchical feature pyramid, which effectively captures global contextual information and long-range dependencies of images. In synergy with the backbone, a CTGFusion neck network is developed. Within this network, the Multi-Scale Fusion module achieves efficient integration of multi-scale features through a lightweight MetaFormer architecture and depthwise separable convolutions. Meanwhile, the Channel-Wise Attention module utilizes a gating mechanism with spatial awareness to adaptively enhance fine defect features, effectively suppressing feature loss and smoothing issues. Experimental results demonstrate that the proposed method achieves a precision of 0.895, a recall of 0.874, and an mAP50 of 0.916, outperforming several mainstream detection models. The proposed method exhibits superior performance in detecting tiny, low-contrast defects and adapting to complex backgrounds, providing a reliable solution for the automated quality inspection of wood surface defects.
文章引用:张伟, 王巍霖, 张群利. 面向木材缺陷的全局与局部协同感知检测方法[J]. 计算机科学与应用, 2026, 16(5): 172-182. https://doi.org/10.12677/csa.2026.165174

参考文献

[1] 谢永华. 数字图像处理技术在木材表面缺陷检测中的应用研究[D]: [博士学位论文]. 哈尔滨: 东北林业大学, 2013.
[2] 郭明辉, 刘祎. 木材固碳量与含碳率研究进展[J]. 世界林业研究, 2014, 27(5): 50-54.
[3] 宋林书, 王浩, 杨超. 新发展格局下中国木材加工及家具制造业高质量发展探析[J]. 中国林业产业, 2022(2): 50-54.
[4] 刘强, 袁云梅, 夏雪, 等. 基于人工智能的木材缺陷检测研究进展[J]. 世界林业研究, 2023, 36(1): 66-71.
[5] Gupta, M., Khan, M.A., Butola, R., et al. (2022) Advances in Applications of Non-Destructive Testing (NDT): A Review. Advances in Materials and Processing Technologies, 8, 2286-2307. [Google Scholar] [CrossRef
[6] 文韬, 代兴勇, 李浪, 刘豪. 基于机器视觉与光谱融合的柑橘品质无损检测分级系统设计与试验[J]. 江苏大学学报(自然科学版), 2024, 45(1): 38-45.
[7] 方益明, 蔺陆军, 鲁植雄, 冯海林. 基于空气耦合超声波的木材无损检测系统研制[J]. 浙江农林大学学报, 2017, 34(2): 355-360.
[8] 杨佳彬, 武广涛, 张彬, 陈忠加, 傅万四, 周建波. 超声波技术在林木无损检测中的应用[J]. 林业和草原机械, 2020, 1(4): 28-33.
[9] 孙丽萍, 许述正, 魏喜雯, 岳琪, 王一凡. 应力波木材无损检测技术应用及研究进展[J]. 世界林业研究, 2020, 33(6): 39-43.
[10] 熊海贝, 龙有为, 陈琳, 丁叶蔚. 木结构无损检测技术研究与应用综述[J]. 结构工程师, 2023, 39(1): 191-201.
[11] 胡峰, 杨文卓, 冯俊雄, 王嘉晨, 等. 基于射线的无损检测技术综述[J]. 中国金属通报, 2021(7): 201-202.
[12] 汪紫阳, 尹世逵, 李颖, 李耀翔. 基于可见/近红外光谱识别东北地区常见木材[J]. 浙江农林大学学报, 2019, 36(1): 162-169.
[13] Cheng, D., Cheng, G. and Wang, X. (2022) Real-Time Detection Method of Wood Defects Based on Deep Learning. 2022 IEEE 8th International Conference on Computer and Communications (ICCC), Chengdu, 9-12 December 2022, 2192-2197. [Google Scholar] [CrossRef
[14] Liu, W., Anguelov, D., Erhan, D., et al. (2016) SSD: Single Shot MultiBox Detector. In: Computer VisionECCV 2016: 14th European Conference, Springer, 21-37. [Google Scholar] [CrossRef
[15] Redmon, J. and Farhadi, A. (2017) YOLO9000: Better, Faster, Stronger. Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, 21-26 July 2017, 7263-7271. [Google Scholar] [CrossRef
[16] Bochkovskiy, A., Wang, C.Y. and Liao, H.Y.M. (2020) YOLOv4: Optimal Speed and Accuracy of Object Detection.
[17] Redmon, J., Divvala, S., Girshick, R., et al. (2016) You Only Look Once: Unified, Real-Time Object Detection. Proceedings of 2016 IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, 27-30 June 2016, 779-788. [Google Scholar] [CrossRef
[18] Ren, S., He, K., Girshick, R., et al. (2016) Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39, 1137-1149. [Google Scholar] [CrossRef
[19] Girshick, R., Donahue, J., Darrell, T., et al. (2015) Region-Based Convolutional Networks for Accurate Object Detection and Segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 38, 142-158. [Google Scholar] [CrossRef
[20] Ling, J.X. and Xie, Y.H. (2022) Research on Wood Defects Classification Based on Deep Learning. Wood Research, 67, 147-156. [Google Scholar] [CrossRef
[21] Meng, W. and Yuan, Y. (2023) SGN-YOLO: Detecting Wood Defects with Improved YOLOv5 Based on Semi-Global Network. Sensors, 23, Article 8705. [Google Scholar] [CrossRef] [PubMed]
[22] Wang, R., Liang, F., Wang, B., et al. (2024) An Efficient and Accurate Surface Defect Detection Method for Wood Based on Improved YOLOv8. Forests, 15, Article 1176. [Google Scholar] [CrossRef
[23] Liu, Z., Lin, Y., Cao, Y., et al. (2021) Swin Transformer: Hierarchical Vision Transformer Using Shifted Windows. 2021 IEEE/CVF International Conference on Computer Vision (ICCV), Montreal, 10-17 October 2021, 9992-10002. [Google Scholar] [CrossRef
[24] Kodytek, P., Bodzas, A. and Bilik, P. (2022) A Large-Scale Image Dataset of Wood Surface Defects for Automated Vision-Based Quality Control Processes. F1000 Research, 10, Article 581. [Google Scholar] [CrossRef] [PubMed]