A Transfer Residual Neural Network Based on ResNet-34 for Detection of Wood Knot Defects
Abstract
:1. Introduction
2. Methods
2.1. Dataset
2.2. ResNet-34 and Transfer Learning
2.2.1. ResNet-34
2.2.2. Transfer Learning
2.3. Improved CNNs Based on ResNet-34
2.3.1. ReLU Nonlinearity
2.3.2. Adaptive Moment Estimation
2.3.3. Cross Entropy
2.3.4. Overall Architecture
2.4. Training
3. Results and Analysis
3.1. Comparison of Model Performance
3.2. Convergence Rate Analysis
3.3. Transfer Learning Analysis
3.4. Comparison of Optimal Algorithms
3.5. Comparison of Detection Methods for Wood Surface Defects
4. Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- Norlander, R.; Grahn, J.; Maki, A. Wooden Knot Detection Using ConvNet Transfer Learning. In Lecture Notes in Computer Science, Image Analysis; Paulsen, R., Pedersen, K., Eds.; SCIA: Cham, Switzerland, 2015; Volume 9127. [Google Scholar]
- Pölzleitner, W.; Schwingshakl, G. Real-time surface grading of profiled wooden boards. Ind. Metrol. 1992, 2, 283–298. [Google Scholar] [CrossRef]
- Qiu, Z.F. A Simple Machine Vision System for Improving the Edging and Trimming Operations Performed in Hardwood Sawmills. Master’s Thesis, Virginia Polytechnic Institute and State University, Blacksburg, VA, USA, 1996. [Google Scholar]
- Schmoldt, D.L.; Li, P.; Abbott, A.L. Machine vision using artificial neural networks with local 3D neighborhoods. Comput. Electron. Agric. 1997, 16, 255–271. [Google Scholar] [CrossRef]
- Qi, D.W.; Zhang, P.; Jin, X.; Zhang, X. Study on wood image edge detection based on Hopfield neural network. In Proceedings of the 2010 IEEE International Conference on Information and Automation, Harbin, China, 20–23 June 2010; pp. 1942–1946. [Google Scholar]
- Ji, X.Y.; Guo, H.; Hu, M.H. Features Extraction and Classification of Wood Defect Based on Hu Invariant Moment and Wavelet Moment and BP Neural Network. In Proceedings of the 12th International Symposium on Visual Information Communication and Interaction (VINCI’2019), Shanghai, China, 20–22 September 2019; Association for Computing Machinery: New York, NY, USA, 2019. Article 37. pp. 1–5. [Google Scholar]
- Mu, H.; Qi, D.W. Pattern Recognition of Wood Defects Types Based on Hu Invariant Moments. In Proceedings of the 2009 2nd International Congress on Image and Signal Processing, Tianjin, China, 17–19 October 2009; pp. 1–5. [Google Scholar]
- Hermanson, J.C.; Wiedenhoeft, A.C. A brief review of machine vision in the context of automated wood identification systems. IAWA J. 2011, 32, 233–250. [Google Scholar] [CrossRef] [Green Version]
- Wen, L.; Li, X.Y.; Gao, L. A transfer convolutional neural network for fault diagnosis based on ResNet-50. Neural Comput. Appl. 2020, 32, 6111–6124. [Google Scholar] [CrossRef]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
- Zhao, R.; Yan, R.Q.; Chen, Z.H.; Mao, K.Z.; Wang, P.; Gao, R.X. Deep learning and its applications to machine health monitoring. Mech. Syst. Signal Prosess. 2019, 115, 213–237. [Google Scholar] [CrossRef]
- Donahue, J.; Jia, Y.Q.; Vinyals, O.; Hoffman, J.; Zhang, N.; Tzeng, E.; Darrell, T. Decaf: A deep convolutional activation feature for generic visual recognition. In Proceedings of the International Conference on Machine Learning, Beijing, China, 21–26 June 2014; pp. 647–655. [Google Scholar]
- Yosinski, J.; Clune, J.; Bengio, Y.; Lipson, H. How transferable are features in deep neural networks? In Proceedings of the Advances in Neural Information Processing Systems, Montreal, QC, Canada, 8–13 December 2014; pp. 3320–3328. [Google Scholar]
- Thenmozhi, K.; Reddy, U.S. Crop pest classification based on deep convolutional neural network and transfer learning. Comput. Electron. Agric. 2019, 164, 104906. [Google Scholar] [CrossRef]
- Gao, X.; Zhao, Y.F.; Xiong, Q.; Chen, Z. Identification of Tree Species Based on Transfer Learning. For. Eng. 2019, 35, 68–75. [Google Scholar]
- Kentsch, S.; Lopez Caceres, M.L.; Serrano, D.; Roure, F.; Diez, Y. Computer Vision and Deep Learning Techniques for the Analysis of Drone-Acquired Forest Images, a Transfer Learning Study. Remote Sens. 2020, 12, 1287. [Google Scholar] [CrossRef] [Green Version]
- Qi, D.W.; Mu, H.B. Detection of wood defects types based on Hu invariant moments and BP neural network. J. Southeast Univ. (Nat. Sci. Ed.) 2013, 43, 63–66. [Google Scholar]
- Yuan, W.Q.; Li, S.L.; Li, D.J. Wood surface defect recognition based on sub-region zoom Gaussian fitting. Chin. J. Sci. Instrum. 2016, 37, 879–886. [Google Scholar]
- Abdulla, B.A.; Ali, Y.H.; Ibrahim, N.J. Extract the Similar Images Using the Grey Level Co-Occurrence Matrix and the Hu Invariants Moments. J. Eng. Technol. 2020, 38, 719–727. [Google Scholar] [CrossRef]
- Yu, H.; Liang, Y.; Liang, H.; Zhang, Y. Recognition of wood surface defects with near infrared spectroscopy and machine vision. J. For. Res. 2019, 30, 2379–2386. [Google Scholar] [CrossRef]
- He, T.; Liu, Y.; Xu, C.; Zhou, X.; Hu, Z.; Fan, J. A fully convolutional neural network for wood defect location and identification. IEEE Access 2019, 7, 123453–123462. [Google Scholar] [CrossRef]
- Ding, F.; Zhuang, Z.; Liu, Y.; Jiang, D.; Yan, X.; Wang, Z. Detecting Defects on Solid Wood Panels Based on an Improved SSD Algorithm. Sensors 2020, 20, 5315. [Google Scholar] [CrossRef] [PubMed]
- Kauppinen, H.; Silven, O. A Color Vision Approach for Grading Lumber. In Theory & Applications of Image Processing II—Selected Papers from the 9th Scandinavian Conference on Image Analysis; Borgefors, G., Ed.; World Scientific: Singapore, 1995; pp. 367–379. [Google Scholar]
- Silven, O.; Kauppinen, H. Recent Developments in Wood Inspection. Int. J. Pattern Recognit. Artif. Intell. IJPRAI 1996, 10, 83–95. [Google Scholar] [CrossRef]
- Kauppinen, H.; Silven, O. The effect of illumination variations on color-based wood defect classification. In Proceedings of the 13th International Conference on Pattern Recognition (13th ICPR), Vienna, Austria, 25–29 August 1996; pp. 828–832. [Google Scholar]
- Zhou, Y.; Dong, F.; Liu, Y.; Li, Z.; Du, J.; Zhang, L. Forecasting emerging technologies using data augmentation and deep learning. Scientometrics 2020, 123, 1–29. [Google Scholar] [CrossRef] [Green Version]
- Liu, Z.; Cao, Y.K.; Li, Y.J.; Xiao, X.Y.; Qiu, Q.C.; Yang, M.J.; Zhao, Y.F.; Cui, L.Z. Automatic diagnosis of fungal keratitis using data augmentation and image fusion with deep convolutional neural network. Comput. Methods Programs Biomed. 2020, 187, 105019. [Google Scholar] [CrossRef]
- Mushtaq, Z.; Su, S.F.; Tran, Q.V. Spectral images based environmental sound classification using CNN with meaningful data augmentation. Appl. Acoust. 2021, 172, 107581. [Google Scholar] [CrossRef]
- Yan, Q.; Yang, B.; Wang, W.; Wang, B.; Chen, P.; Zhang, J. Apple Leaf Diseases Recognition Based on An Improved Convolutional Neural Network. Sensors 2020, 20, 3535. [Google Scholar] [CrossRef]
- Hinton, G.E.; Osindero, S.; Teh, Y.W. A fast learning algorithm for deep belief nets. Neural Comput. 2006, 18, 1527–1554. [Google Scholar] [CrossRef] [PubMed]
- Gao, Y.; Mosalam, K.M. Deep transfer learning for image-based structural damage recognition. Comput. Aided Civ. Infrastruct. Eng. 2018, 33, 748–768. [Google Scholar] [CrossRef]
- Dawei, W.; Limiao, D.; Jiangong, N.; Jiyue, G.; Hongfei, Z.; Zhongzhi, H. Recognition pest by image-based transfer learning. J. Sci. Food Agric. 2019, 99, 4524–4531. [Google Scholar] [CrossRef] [PubMed]
- Zhang, Y.D.; Pan, C.; Chen, X.; Wang, F. Abnormal breast identification by nine-layer convolutional neural network with parametric rectified linear unit and rank-based stochastic pooling. J. Comput. Sci. 2018, 27, 57–68. [Google Scholar] [CrossRef]
- He, T.; Liu, Y.; Yu, Y.B.; Zhao, Q.; Hu, Z.K. Application of deep convolutional neural network on feature extraction and detection of wood defects. Measurement 2020, 152, 107357. [Google Scholar] [CrossRef]
- Kingma, D.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar]
- Isola, P.; Zhu, J.Y.; Zhou, T.; Efros, A.A. Image-to-Image Translation with Conditional Adversarial Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 1125–1134. [Google Scholar]
- Jamin, A.; Humeau-Heurtier, A. (Multiscale) Cross-Entropy Methods: A Review. Entropy 2020, 22, 45. [Google Scholar] [CrossRef] [Green Version]
- Boudiaf, M.; Rony, J.; Ziko, I.M.; Granger, E.; Pedersoli, M.; Piantanida, P.; Ayed, I.B. A Unifying Mutual Information View of Metric Learning: Cross-Entropy vs. In Pairwise Losses. In Proceedings of the Lecture Notes in Computer Science, Computer Vision—ECCV 2020, Glasgow, UK, 23–28 August 2020; Vedaldi, A., Bischof, H., Brox, T., Frahm, J.M., Eds.; Springer: Cham, Switzerland, 2020; Volume 12351. [Google Scholar]
- Sandak, J.; Sandak, A.; Zitek, A.; Hintestoisser, B.; Picchi, G. Development of Low-Cost Portable Spectrometers for Detection of Wood Defects. Sensors 2020, 20, 545. [Google Scholar] [CrossRef] [Green Version]
- Ren, R.; Hung, T.; Tan, K.C. A Generic Deep-Learning-Based Approach for Automated Surface Inspection. IEEE Trans. Cybern. 2018, 48, 929–940. [Google Scholar] [CrossRef]
- Zhang, Y.; Xu, C.; Li, C.; Yu, H.; Cao, J. Wood defect detection method with PCA feature fusion and compressed sensing. J. For. Res. 2015, 26, 745–751. [Google Scholar] [CrossRef]
- Zhang, Y.X.; Zhao, Y.Q.; Liu, Y.; Jiang, L.Q.; Chen, Z.W. Identification of wood defects based on LBP features. In Proceedings of the 35th Chinese Control Conference (CCC), Chengdu, China; 2016; pp. 4202–4205. [Google Scholar]
- Li, C.; Zhang, Y.; Tu, W.; Jun, C.; Liang, H.; Yu, H. Soft measurement of wood defects based on LDA feature fusion and compressed sensor images. J. For. Res. 2017, 28, 1285–1292. [Google Scholar] [CrossRef]
- Li, S.; Li, D.; Yuan, W. Wood Defect Classification Based on Two-Dimensional Histogram Constituted by LBP and Local Binary Differential Excitation Pattern. IEEE Access 2019, 7, 145829–145842. [Google Scholar] [CrossRef]
- Urbonas, A.; Raudonis, V.; Maskeliūnas, R.; Damaševičius, R. Automated Identification of Wood Veneer Surface Defects Using Faster Region-Based Convolutional Neural Network with Data Augmentation and Transfer Learning. Appl. Sci. 2019, 9, 4898. [Google Scholar] [CrossRef] [Green Version]
- Yang, Y.; Zhou, X.; Liu, Y.; Hu, Z.; Ding, F. Wood Defect Detection Based on Depth Extreme Learning Machine. Appl. Sci. 2020, 10, 7488. [Google Scholar] [CrossRef]
Wood Knot | Before Data Augmentation | After Data Augmentation | ||||
---|---|---|---|---|---|---|
Training Dataset | Validation Dataset | Testing Dataset | Training Dataset | Validation Dataset | Testing Dataset | |
Decayed knot | 10 | 3 | 3 | 68 | 25 | 19 |
Dry knot | 41 | 14 | 14 | 291 | 96 | 96 |
Edge knot | 39 | 13 | 13 | 273 | 91 | 91 |
Encased knot | 20 | 6 | 6 | 136 | 44 | 44 |
Horn knot | 21 | 7 | 7 | 147 | 49 | 49 |
Leaf knot | 27 | 10 | 10 | 198 | 65 | 66 |
Sound knot | 110 | 37 | 37 | 772 | 266 | 250 |
Layer Name | Output Size | 34-Layer |
---|---|---|
Conv1 | 112 × 112 | 7 × 7, 64, stride 2 |
Conv2_x | 56 × 56 | 3 × 3 max pool, stride 2 |
Conv3_x | 28 × 28 | |
Conv4_x | 14 × 14 | |
Conv5_x | 7 × 7 | |
1 × 1 | average pool, 1000-d fc, softmax |
Hardware Environment | Software Environment | ||
---|---|---|---|
Memory | 16.00 GB | System | Windows 10 |
CPU | Intel Core i5-4210H 2.90 GHz (2 core) | Environment configuration | Pytorch-gpu 1.6.0 + Python 3.7.3 + cuda 10.1 + cudnn 7.6.5 |
Graphics card | NVIDIA GeForce GTX 960M (2G) |
Related Parameter | Value | Meaning |
---|---|---|
Batch size | 128 | Number of pictures per training |
Learning rate | 1 × 10−4 | Initial learning rate |
Epoch | 300 | Training iteration times |
CUDA | Enable | Computer unified device architecture |
Classes | Model | P | R | F1 | FAR | Accuracy |
---|---|---|---|---|---|---|
Decayed knot | AlexNet | 84.21% | 94.12% | 88.89% | 0.51% | 99.35% |
VGGNet-16 | 78.95% | 100% | 88.24% | 0.67% | 99.35% | |
GoogLeNet | 84.21% | 57.14% | 68.08% | 0.51% | 97.55% | |
TL-ResNet34 | 100% | 100% | 100% | 0.00% | 100% | |
Dry knot | AlexNet | 97.92% | 97.92% | 97.92% | 0.39% | 99.35% |
VGGNet-16 | 98.96% | 95.00% | 96.94% | 0.20% | 99.02% | |
GoogLeNet | 94.79% | 90.10% | 92.39% | 0.98% | 97.55% | |
TL-ResNet34 | 100% | 98.97% | 99.48% | 0.00% | 99.84% | |
Edge knot | AlexNet | 97.80% | 98.89% | 98.34% | 0.38% | 99.51% |
VGGNet-16 | 100% | 97.85% | 98.91% | 0.00% | 99.67% | |
GoogLeNet | 100% | 97.85% | 98.91% | 0.00% | 99.67% | |
TL-ResNet34 | 100% | 98.91% | 99.45% | 0.00% | 99.84% | |
Encased knot | AlexNet | 90% | 100% | 94.74% | 0.70% | 99.35% |
VGGNet-16 | 77.50% | 100% | 87.32% | 1.55% | 98.52% | |
GoogLeNet | 62.50% | 100% | 76.92% | 2.56% | 97.55% | |
TL-ResNet34 | 92.5% | 100% | 96.10% | 0.52% | 99.51% | |
Horn knot | AlexNet | 100% | 92.45% | 96.08% | 0.00% | 99.35% |
VGGNet-16 | 97.96% | 96.00% | 96.97% | 0.18% | 99.51% | |
GoogLeNet | 100% | 100% | 100% | 0.00% | 100% | |
TL-ResNet34 | 100% | 98% | 98.99% | 0.00% | 99.84% | |
Leaf knot | AlexNet | 95.45% | 100% | 97.67% | 0.55% | 99.51% |
VGGNet-16 | 95.45% | 90.00% | 92.64% | 0.55% | 98.36% | |
GoogLeNet | 100% | 97.06% | 98.51% | 0.00% | 99.67% | |
TL-ResNet34 | 96.97% | 95.52% | 96.24% | 0.37% | 99.18% | |
Sound knot | AlexNet | 98% | 97.61% | 97.80% | 1.39% | 98.20% |
VGGNet-16 | 96.40% | 99.18% | 97.78% | 2.45% | 98.20% | |
GoogLeNet | 98.00% | 99.19% | 98.59% | 1.37% | 98.85% | |
TL-ResNet34 | 98.8% | 99.20% | 99.00% | 0.83% | 99.18% |
Method | Actual Category | Prediction Category | |||||||
---|---|---|---|---|---|---|---|---|---|
Decayed Knot | Dry Knot | Edge Knot | Encased Knot | Horn Knot | Leaf Knot | Sound Knot | Total | ||
TL-ResNet34 | Decayed knot | 19 | 0 | 0 | 0 | 0 | 0 | 0 | 19 |
Dry knot | 0 | 96 | 0 | 0 | 0 | 0 | 0 | 96 | |
Edge knot | 0 | 0 | 91 | 0 | 0 | 0 | 0 | 91 | |
Encased knot | 0 | 1 | 1 | 37 | 0 | 0 | 1 | 40 | |
Horn knot | 0 | 0 | 0 | 0 | 49 | 0 | 0 | 49 | |
Leaf knot | 0 | 0 | 0 | 0 | 1 | 64 | 1 | 66 | |
Sound knot | 0 | 0 | 0 | 0 | 0 | 3 | 247 | 250 | |
ResNet-34 | Decayed knot | 19 | 0 | 0 | 0 | 0 | 0 | 0 | 19 |
Dry knot | 0 | 94 | 1 | 0 | 0 | 0 | 1 | 96 | |
Edge knot | 0 | 1 | 90 | 0 | 0 | 0 | 0 | 91 | |
Encased knot | 1 | 3 | 0 | 34 | 0 | 0 | 2 | 40 | |
Horn knot | 0 | 0 | 0 | 0 | 49 | 0 | 0 | 49 | |
Leaf knot | 0 | 0 | 0 | 0 | 4 | 60 | 2 | 66 | |
Sound knot | 0 | 3 | 0 | 0 | 0 | 0 | 247 | 250 |
Wood Defect Detection Method | Accuracy | Wood Defects | |
---|---|---|---|
1 | Decaf convolutional neural network and feature transferring [40] | 91.55% | Encased knot, leaf knot, edge knot, and sound knot |
2 | Principal component analysis (PCA) and compressed sensing [41] | 92.00% | Live knot, dead knot, and crack |
3 | Near infrared spectroscopy and BP neural network [20] | 92.00% | Live knots, dead knots, pinholes, and cracks |
4 | LBP texture feature extraction and BP neural network [42] | 93.00% | Live knot, dead knot, and leaf knot |
5 | Linear discriminant analysis (LDA) and compress sensor images [43] | 94.00% | Live knot, dead knot, and crack |
6 | LBP and local binary differential excitation pattern [44] | 94.30% | Crack and the mineral line |
7 | The single-shot multibox detector (SSD), a target detection algorithm, and the DenseNet network [22] | 96.10% | Live knots, dead knots, and checking |
8 | A faster region-based CNN with data augmentation and transfer learning [45] | 96.10% | Branch, core, split, and stain defects |
9 | The deep learning feature extraction method combined to extreme learning machine (ELM) classification method [46] | 96.72% | Dead knot, live knot, worm hole, decay |
10 | TL-ResNet34 | 98.69% | Decayed knot, dry knot, edge knot, encased knot, horn knot, leaf knot, sound knot |
11 | NIR, PLS-DA, and SVMC [39] | 99% | Knot, decay, resin pocket, bark, reaction wood |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Share and Cite
Gao, M.; Qi, D.; Mu, H.; Chen, J. A Transfer Residual Neural Network Based on ResNet-34 for Detection of Wood Knot Defects. Forests 2021, 12, 212. https://doi.org/10.3390/f12020212
Gao M, Qi D, Mu H, Chen J. A Transfer Residual Neural Network Based on ResNet-34 for Detection of Wood Knot Defects. Forests. 2021; 12(2):212. https://doi.org/10.3390/f12020212
Chicago/Turabian StyleGao, Mingyu, Dawei Qi, Hongbo Mu, and Jianfeng Chen. 2021. "A Transfer Residual Neural Network Based on ResNet-34 for Detection of Wood Knot Defects" Forests 12, no. 2: 212. https://doi.org/10.3390/f12020212
APA StyleGao, M., Qi, D., Mu, H., & Chen, J. (2021). A Transfer Residual Neural Network Based on ResNet-34 for Detection of Wood Knot Defects. Forests, 12(2), 212. https://doi.org/10.3390/f12020212