# Assessment of Earthquake Destructive Power to Structures Based on Machine Learning Methods
## 5 Convolutional Neural Network
### Feature Visualization of the CNN  
As mentioned earlier, the CNN has better feature extraction performance compared with the BPNN. The CNN can directly extract effective features from ground motion data and avoid information loss caused by manual feature extraction. The convolutional layer extracts various features from the previous layer, and the pooling layer makes features robust to noise and deformation [14].  
Visualizing the output of each convolutional layer (including the process of convolution and pooling) is helpful to understand the features extraction mechanism of the CNN. To clearly demonstrate the extracted feature of each convolutional layer, a synthetic signal is input into the CNN model. The synthetic signal is composed of seven simple harmonics with frequencies range from 0.1-20 Hz (Figure 15a). The output of each convolutional layer is presented in Figure 15b.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**MAE** & **MSE** & **RMSE** & \(\mathbf{R^{2}}\) \\ \hline
0.0883 & 0.0263 & 0.1621 & 0.8737 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Statistical indexes of prediction result.  
Figure 14: Test results of the CNN model.  
Figure 13: Loss (MAE) history of the CNN.  
As shown in the right-hand side of Figure 15, the output of the first convolutional layer is similar to the synthetic signal, which not only capture the high-frequency features, but also carries the information of the overall trend (low-frequency). With the increase of convolution depth, the length of output data decreases continuously, and the proportion of low-frequency content increases gradually. For example, the result of the convolutional filter No. 2 in the fourth convolutional layer is very similar to the shape of the simple harmonic with the frequency of 0.1 Hz. The above results show that the shallow convolutional layers of the CNN model mainly extract the high-frequency features of a signal, while the deep convolutional layers primarily extract the low-frequency features of a signal. In addition, the features extracted by the CNN model can also reflect the time-domain features of a signal. Therefore, the CNN model can extract effective features of ground motions and yields better prediction than that of the BPNN model.  
Subsequently, the Chichi05_CHY060-e ground motion (hereafter referred to as CHICHI) was input into the well-tuned the CNN model, and the outputs of seven convolutional layers are shown  
Figure 15: Comparison of synthetic signal components and extracted features: (**a**) Synthetic signal and its simple harmonic components; (**b**) features extracted from different convolutional layers.  
in Figure 16. Similar to the result of the synthetic signal, the outputs of shallow convolutional layers contain more high-frequency information. As the convolutional layer deep in, the outputs contain more low-frequency information. For example, in Figure 16, filter No. 11 of the second convolutional layer can well capture the location and shape of the feature in the red circles.  
It is worth mentioning that the output of filter No. 9 in the fifth convolutional layer is null, which means this ground motion does not contain the corresponding feature. Because the CNN model is learning from a large number of ground motions, and different ground motions are so random that a feature extracted from one ground motion may not necessarily exist in another. This is why multiple filters are adopted in each convolutional layer of the CNN model. Multiple filters enable the model of learning more information on different ground motions and improve the generalization of the model.