欢迎访问林业科学,今天是

林业科学 ›› 2021, Vol. 57 ›› Issue (12): 147-154.doi: 10.11707/j.1001-7488.20211215

•   • 上一篇    下一篇

基于改进残差神经网络的木材识别算法

宿恒硕1,吕军1,*,丁志平2,唐彦杰3,陈旭东2,周强2,张哲宇1,姚青1   

  1. 1. 浙江理工大学信息学院 杭州 310018
    2. 张家港海关 张家港 215600
    3. 杭州箨草科技有限公司 杭州 311500
  • 收稿日期:2020-12-16 出版日期:2021-12-25 发布日期:2022-01-26
  • 通讯作者: 吕军
  • 基金资助:
    南京海关信息化项目“木材AI初筛识别远程支持系统”

Wood Identification Algorithm Based on Improved Residual Neural Network

Hengshuo Su1,Jun Lü1,*,Zhiping Ding2,Yanjie Tang3,Xudong Chen2,Qiang Zhou2,Zheyu Zhang1,Qing Yao1   

  1. 1. School of Information Science and Technology, Zhejiang Sci-Tech University Hangzhou 310018
    2. Zhangjiagang Customs House Zhangjiagang 215600
    3. Hangzhou Tuocao Technology Co., Ltd. Hangzhou 311500
  • Received:2020-12-16 Online:2021-12-25 Published:2022-01-26
  • Contact: Jun Lü

摘要:

目的: 针对传统木材种类人工鉴定方法存在的专业性强、任务重、周期长和非实时性等问题,提出一种基于改进残差神经网络的木材识别算法,以满足木材监管实时性和高效性需求。方法: 以32种横截面打磨后的木材为研究对象,首先,利用外带微距镜头的手机采集8 975幅木材横截面图像,通过R、G、B三通道平均灰度值计算增益系数,用各通道灰度值与对应增益系数的乘积代替原始通道灰度值,消除由图像采集设备和环境差异引起的偏色影响; 其次,基于木材横截面宏观结构的自相似性,采用水平翻转、垂直翻转、添加椒盐噪声和图像分块方式获取更多的训练样本和图像特征,并保证不同种类的木材图像数量相对均衡; 然后,通过双线性插值法将每幅分块子图像统一缩放至224×224像素,应用基于分块梯度加权的改进残差卷积神经网络ResNet101模型对每幅子图像进行特征提取,并计算每幅图像的最终识别得分; 最后,选择平均准确率和平均召回率评价不同分块处理策略、不同模型和改进的残差卷积神经网络模型的识别结果。结果: 在同一测试集上,VggNet16、GoogleNet、DenseNet、MobileNetv3、ResNet50、ResNet101和ResNet152模型对32种相似木材横截面原图进行识别,平均识别准确率分别为71.3%、81.3%、83.2%、66.4%、87.9%、92.1%和90.5%,ResNet101模型适合于木材图像特征提取和种类鉴定; 基于原图 5×5、7×7和10×10分块的ResNet101模型,分别获得94.8%、96.5%和95.3%的平均准确率; 将分块梯度加权策略应用于ResNet101模型,获得98.8%的平均准确率和99.1%的平均召回率,较基于原图、7×7分块的ResNet101模型,采用分块梯度加权方法改进的ResNet101模型的平均准确率分别提高6.7%和2.3%,平均召回率分别提高7.4%和2.8%,分块梯度加权方法可有效提升木材识别模型的准确率。结论: 基于分块梯度加权的ResNet101模型对32种相似木材进行识别,平均准确率为98.8%; 木材横截面图像可用于木材种类识别,分块梯度加权策略能够提高模型识别准确率。

关键词: 木材识别, 木材横截面图像, 残差卷积神经网络, 分块, 梯度加权

Abstract:

Objective: The traditional manual identification methods of wood species have some problems, such as strong professionalism, heavy task, long cycle and non-real-time performance and so on. A wood identification algorithm based on improved residual neural network was proposed to meet the requirements for real-time and efficiency of wood supervision. Method: Polished cross section images from thirty-two species of wood were processed. Firstly, a total of 8 975 cross-section images of wood were collected by mobile phone with external micro-lens. The gain coefficients were calculated by the means of average gray values of R, G and B channels. The product of each component gray value and the corresponding gain coefficient was used to replace the original gray values of three channels for eliminating the influences of color deviation caused by different image acquisition equipments and environments. Secondly, based on the self-similarity of wood cross-sectional macro structure, more training samples and image features were obtained by horizontal flipping, vertical flipping, addition of impulse noise and image block to ensure the relative balance quantity of different wood images. Then, the bilinear interpolation method was used to scale each sub-image to the same image size of 224×224 pixels. The improved residual convolutional neural network ResNet101 model based on block gradient weighting was used to extract the features of each sub-image, and the final identification score of each image was calculated. Finally, the average accuracy and recall rate were used to evaluate the identification results of different block processing strategies, different models and the improved residual convolutional neural network model. Result: On the same test set, VggNet16, GoogleNet, DenseNet, MobileNetv3, ResNet50, ResNet101 and ResNet152 models were used to identify the original cross-sectional images of 32 similar wood species, and the average identification accuracy rates were 71.3%, 81.3%, 83.2%, 66.4%, 87.9%, 92.1% and 90.5%, respectively. The ResNet101 model was selected to extract wood image features and identify wood species. Based on the ResNet101 model with 5×5, 7×7 and 10×10 blocks in the original images, the average identification accuracies of 94.8%, 96.5% and 95.3% were obtained respectively. The block gradient weighting strategy was applied to the ResNet101 model, and the average identification accuracy of 98.8% and the average recall rate of 99.1% were obtained. Compared with the ResNet101 models based on the original images and 7×7 blocks, the average identification rate of the ResNet101 model improved by using the block gradient weighting method was increased by 6.7% and 2.3%, and the average recall rate was increased by 7.4% and 2.8%, respectively. The block gradient weighting method can effectively improve the identification accuracy of woods. Conclusion: The 32 similar wood species were identified based on the ResNet101 model with block gradient weighting method, and the average identification accuracy was 98.8%. Wood cross-sectional images can be used to identify wood species, and the block gradient weighting strategy can improve the model identification rate.

Key words: wood identification, wood cross-sectional image, residual convolutional neural network, block, gradient weighting

中图分类号: