# Faster Post-Earthquake Damage Assessment Based on 1D Convolutional Neural Networks
## 2 Methodology of 1D CNN Seismic Damage Assessment
### 1D CNN Architecture  
The architecture of 1D CNNs mainly consists of two main components, the feature extracting layers and the fully connected layers, as shown in Figure 2. The feature extracting layers of the first component are mainly composed of convolutional layers and pooling layers. The fully connected layers are usually a shallow FNN classifier with similar architecture, as used in [17]. The difference lies in that hand-crafted IMs were inputted into the FNN model in [17] while automatically extracted features (denoted as \(\widetilde{\text{X}}\) in Figure 2) from the first component of the CNN architecture were inputted in the FNN classifier. To extract the features of the input 1D GMR X, a kernel W with M learnable parameters conducted the convolution operation by sliding on the vector X with a stride S. With K kernels in one convolutional layer, corresponding K feature vectors were extracted  
Figure 1: The pipelines of seismic damage state prediction with 1D CNN (solid arrows) only and 2D CNN (dash arrows) that requires image encoding of the GMR images. (denoted as Depth K in Figure 1. In 2D CNNs, they are known as feature maps). The ReLU activation function \(\sigma(\cdot)\) was adopted to activate neurons in the neural network because it is computationally efficient [40]. The convolution operation is represented in Equation (1):  
\[\mathrm{p}=\ \sigma(\mathrm{X}|\theta)=\sigma(\mathrm{W}\otimes\mathrm{X}+ \mathrm{b}),\ \theta=[\mathrm{W},\mathrm{b}] \tag{1}\]  
where \(\otimes\) means the convolution operation. For an input GMR vector \(\mathrm{X}\) with a length of \(\mathrm{N}\), a scanning stride of \(\mathrm{S}\), and a kernel of \(\mathrm{M}\) trainable parameters, the convolution output \(\mathrm{p}\) through the activation function \(\mathrm{ReLU}\ \sigma(\cdot)\) is \((\mathrm{N}-\mathrm{M})/\mathrm{S}+1\). W presented the parameters in the kernel, and \(\mathrm{b}\) was used as the bias item to form the ensemble of learnable parameters \(\theta\). The pooling layer conducted a similar scanning technique with a certain stride (e.g., 3) on each feature vector generated by the former convolutional layer. The maximum or the average value of a local, receptive slice for each feature vector was extracted in the pooling layer. Max-pooling is very commonly used in CNN training due to its superior performance [41]. Through several stacked convolutional and max-pooling layers, the high-level extracted features were flattened as feature vectors (denoted as \(\mathrm{\tilde{X}}\)) and inputted into the FNN classifier composed of fully connected layers. The FNN classifier also contained a set of trainable synaptic weights (denoted as \(\mathrm{\tilde{\theta}}\)). The extracted high-level features were fed into the FNN classifier until the final output layer. In the output layer, the softmax activation function [42] was used for the seismic damage state prediction. The 2D CNN architecture is very similar to 1D CNN architecture, except that the inputs are 2D GMR images and the convolution and pooling operations are usually conducted on a 2D matrix in the horizontal and vertical orientations simultaneously. The training of the 1D CNN model was an iterative tuning process of the learnable parameters \(\left(\theta,\ \mathrm{\tilde{\theta}}\right)\) of the convolutional kernels and the fully connected synaptic weights to achieve the best prediction performance. To tune the parameters, the performance of the 1D CNN model was evaluated by a loss function of categorical cross-entropy (CE), defined as Equation (2):  
\[\mathrm{CE}=-\mathrm{\sum_{i}^{C}y_{i}}\mathrm{ln}(\mathrm{s_{i}}) \tag{2}\]  
where \(y_{i}\) is the ground-truth category of an input GMR and \(\mathrm{s_{i}}\) is the score of the 1D CNN model obtained from the softmax activation function in the output layer of the FNN classifier.