Wood surface crack detection based on Attention U-Net with convolutional block attention module
Wood defects affect the use value and service life of wood products,among which surface crack is a type of wood defect that seriously influences the appearance quality and mechanical strength of wood components.The detec-tion of cracks on the surface of wood can find such defective wood as soon as possible or provide some wood features for subsequent treatment.For example,wood is prone to crack during the drying process,and small cracks can be re-duced or eliminated by steam spraying.The detection of small cracks can provide wood conditions for steam spray treatment to ensure the quality of dried wood.At present,manual detection of cracks on the surface of wood is ineffi-cient,costly and has a high detection error rate,so automatic detection technology has been developed fast recently.However,the existing automatic detection methods still have many problems,such as the detection accuracy is easily affected by moisture content,CT detection is costly and complicated to operate,and traditional image segmentation detection algorithms have high complexity and low efficiency.The semantic segmentation method of deep learning in wood surface crack detection is characterized by high accuracy,high efficiency,and low cost,which can effectively detect wood surface cracks and reduce the interference of defects such as knots and other factors as surface texture.In this study,the Attention U-Net deep learning model with the introduction of convolutional block attention module(CBAM)was used to semantically segment the wood surface crack image,to achieve the purpose of wood surface crack detection.The introduced CBAM module contained a channel attention mechanism and a spatial attention mecha-nism,which were used to capture inter-channel dependencies and pixel-level spatial relationships,respectively.This module was added to the encoding stage of the Attention U-Net network framework to increase the weight of regions of interest and suppress redundant information.Finally,the performance improvement of adding CBAM to Attention U-Net was verified by ablation experiments.Semantic segmentation evaluation metrics such as pixel accuracy(PA),class pixel accuracy(CPA),recall rate,Dice coefficient,intersection over union(IoU)and mean intersection over union(MIoU)were used to evaluate the advantages and disadvantages of each model,and to determine the best mo-del and its parameters.In the crack segmentation of homemade wood surface dataset,compared to the original model of Attention U-Net using SGD optimizer,the PA,wood crack Recall,wood crack Dice coefficient,wood crack IoU,and MIoU of Attention U-Net with CBAM using AdamW optimizer were improved by 0.11%,4.14%,2.96%,3.58%and 1.84%,respectively.The experiment results showed that U-Net and its improved model can better segment the background and wood surface cracks,and differentiated the nodes,surface texture and wood cracks.