# Structural Damage Detection Based on Real-Time Vibration Signal and Convolutional Neural Network
## 2 Methods
### Structural Damage Detection  
In this paper, the CNN was designed in MATLAB (MathWorks Inc, Natick, MA, USA) and the CNN internal parameters were adjusted to achieve the ideal detection results. The CNN parameters were shown in Table 4.  
In this paper, five datasets were studied. The CNN architecture was the same for all damage scenarios. Datasets A, B, C, and D were studied with the samples obtained from the numerical simulations. The vibration signals (accelerations) obtained from the numerical simulations were used for network training and testing (15,200 training samples and 791 testing samples) for each damage scenario. Dataset E was to provide experimental testing samples to validate the applicability of the CNN trained using numerical simulations.  
Normalization was widely used in data processing because it can keep data in a range and make the data from different sources comparable. In this paper, the acceleration of the measuring points was normalized using Formula (4):  
\[y=\frac{x-a}{b-a} \tag{4}\]  
where \(x\) and \(y\) are the values before and after normalization, respectively, and \(b\) and \(a\) are the maximum and minimum values of the sample data, respectively. In this paper, the acceleration was normalized into the range [-1, 1] along the time direction. The normalization method is shown in Figure 9. After the normalization, the data were inputted into the CNN for damage detection, which is shown in Figure 10.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Layer** & **Type** & **Kernel Number** & **Kernel Size** & **Stride** & **Padding** & **Activation** \\ \hline
1 & Input & None & None & None & None & None \\
2 & Convolution & 30 & [5 5] & [1 1] & 0 & ReLU \\
3 & Max Pooling & None & [3 3] & [3 3] & 0 & None \\
4 & Convolution & 60 & [2 2] & [1 1] & 0 & ReLU \\
5 & FC & None & None & None & None & None \\
6 & Softmax & None & None & None & None & None \\
7 & Output & None & None & None & None & None \\ \hline \hline \end{tabular}
\end{table}
Table 4: Structural parameters of the CNN.  
Figure 13 and Table 7 show the training process and testing results for dataset C. Figure 13 shows that the CNN converged at about 200 iterations and the accuracy of validation and testing reached 95%. Table 7 shows that, in the scenarios of simultaneous damages in three rods, the detection results of damage locations were also ideal in 84 scenarios and the overall detection accuracy was above 95.8%.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Damage** & **Predicted** & **Total** & **\%** & **Damage** & **Predicted** & **Total** & **\%** \\
**State** & **Number** & **Total** & **\%** & **State** & **Number** & **Total** & **\%** \\ \hline
1 & 758 & 791 & 95.8 & 43 & 788 & 791 & 99.6 \\
2 & 714 &  
Table 9 showed that, for the eight damage scenarios (intact structure + 7 damage scenarios), the detection accuracy for cases No.0 (intact structure), No.6 (double damages) and No.7 (triple damages) was above 93%, the detection accuracy for other damage scenarios was above 85%, and the overall detection accuracy was 90.1%.