# Rock Crack Types Identification by Machine Learning on the Sound Signal+
## 2 Automatic Recognition Method-Based Spectrograms for Hard Rock Crack Types
### Feature Extraction Using a Pre-Trained Deep Neural Network ResNet-18
#### 2.3.2 Feature Extraction from the Spectrograms  
As shown in Figure 12, there are several convolutional layers (conv1, pool1, res2a, res2b, and so on) in ResNet-18. To better extract the characteristics of the spectrograms, the most suitable convolutional layer should consider the following two issues.  
The first is to consider whether the convolution can extract the characteristics of the spectrograms well. Except for the classification layer, each layer in ResNet-18 can be used. The spectrograms shown in Figure 9 are input into ResNet-18; the visualization of the spectrogram characteristics from the conv1 layer, the res2a layer, and the pool5 layer are shown in Figure 13. It can be seen that, for the ResNet-18, the characteristics of the figures extracted by the shallow convolution layers are mainly described by the texture and color. When a deeper network layer is used, a deeper characteristic of an image will be obtained and the corresponding characteristic is more abstract. However, according to previous studies, more abstract results can better present the characteristics of the figure [28; 29; 30]. Meanwhile, the use of residual blocks in ResNet-18 can effectively resolve the gradient diffusion. Consequently, in our study, a deeper layer after res5b is used to capture the characteristics of the tensile and shear spectrograms.  
The second is that, to ensure the efficiency of calculation, the dimension of the characteristics should not be too high. First, the RGB value of a figure is input into ResNet-18. A characteristic matrix with dimensions of 224 \(\times\) 224 \(\times\) 3 is obtained. Then, after pooling by the maximum pooling layer pool1, the dimensions of the characteristic matrix are 56 \(\times\) 56 \(\times\) 64. The residual block is the connected convolutional layers. The residual block res2a is composed of two convolutional layers with dimensions of 3 \(\times\) 3 \(\times\) 64, and the residual block res2b is composed of three convolutional layers with dimensions of 1 \(\times\) 1 \(\times\) 64, 3 \(\times\) 3 \(\times\) 64 and 1 \(\times\) 1 \(\times\) 256. After res5b, the dimensions of the output characteristic are 7 \(\times\) 7 \(\times\) 512. After the average pooling calculation of the pooling layer pool5, the output dimensions are 1 \(\times\) 1 \(\times\) 512; after the fully connected layer \"fc1000\", the output dimensions  
Figure 12: Structure of the deep residual network ResNet-18 [27].  
Figure 13: Visualization of the spectrogram characteristics of the typical tensile and shear cracks extracted by (**a**) the conv1 layer, (**b**) the res2a layer, and (**c**) the pool5 layer.  
are 1 \(\times\) 1 \(\times\) 1000. During this process, the dimensions of the output characteristic will increase at the residual blocks and decrease after the pool5 layer.  
Consequently, the characteristic of a spectrogram extracted by pool5 is the most suitable. First, pool5 is a deep layer (only fc1000 and the classification layer are deeper), and the output characteristic will be complicated enough to describe the objective figure. The dimension of the characteristic matrix is 512, which is smaller than that of other layers.  
The visualization of the characteristics of the tensile and shear spectrograms extracted by the pool5 layer is presented in Figure 13c.