## 5 Application Research for Timber Damage Monitoring  
The PZT sensors' time domain signal responses for Case 1-Case 6 are shown in Figure 6, respectively. Each curve represents a cycle, or 1 s in the time domain, of the sensor signal response to the sine wave signal. Different groups of piezoelectric ceramic sensors receive signals differently as a result of the various damage modes. In our research, 540 sets of sine wave signals of crack damage and hole damage in the experiment were selected for research. After the signal processing was performed in the above manner, the obtained two-dimensional feature matrices were all 7 \(\times\) 7 size, which were used to characterize each type of timber damage. According to the width and depth of cracks and the diameter and depth of holes, 540 groups of sine wave signals were divided into six different wear conditions. For each working condition, the training set, validation set, and test set were all randomly chosen at a ratio of 3:1:1 and the data of the training set and validation set were fed into the CNN for training. Simultaneously, the hyper parameters were optimized and adjusted in the training process to obtain a neural network model with good recognition effect and complete the discrimination of six different timber damage states. Theoretically, the more convolutional layers of the network, the more extracted features can reflect the characteristics of the original data. For classification problems with multiple categories and large samples, CNN often uses multiple convolutional layers. However, for classification problems with few categories and samples, with there are more and more network layers, redundant network layers may be generated and the model may be unstable and overfitted [45]. Therefore, considering the parameters of the model and the training effect, it is sufficient to use one or two convolutional layers for 540 samples of six timber damage conditions. Through multiple experimental comparisons, the structural parameters of the model are given in Table 2.  
Figure 5: (a) A photo of the apparatus, (b) The schematic diagram of the apparatus. Figure 6: Sensor signal response of each type of timber damage mode. (**a**) Case 1, (**b**) Case 2, (**c**) Case 3, (**d**) Case 4, (**e**) Case 5, (**f**) Case 6. The hyper parameter setting of CNN can directly affect the efficiency and accuracy of the model. Through many experiments, the final main setting of the CNN model in this paper was: two convolutional layers, of which the filter size was set as 3 \(\times\) 3, the step size was 1, the number of convolution cores was 64 and the size of the pooling layer was 2 \(\times\) 2. The pooling mode was the maximum pooling layer, the activation function was the Rectified Linear Unit (ReLU), the optimizer was SGD, the learning rate was 0.0001 and batch processing had a value of 4. CNN's framework is based on Tensorflow's Keras. The Tensorboard visualization tool was used to view the variations of accuracy curve, loss function curve and other curves. A total number of 2000 iterative trainings were conducted in the experiment. The variation curves of accuracy and loss function in the training process are displayed in Figure 7.  
Figure 7 demonstrates how the accuracy of the training set and validation set gradually increases as the number of iterations rises and, after 400 iterations, the accuracy of both the training set and the validation set reaches 100%, without obvious shock. The loss function lowers monotonically with the increasing number of iterations and stabilizes in a low range. After 2000 iterations, the final training loss and test loss are close to 0 and there is no fitting phenomenon, which indicates that the method has good diagnostic effect.