# Sequence Deep Learning for Seismic Ground Response Modeling: 1D-CNN, LSTM, and Transformer Approach
## 5 Results and Discussion
### Prediction Performance
#### 5.1.2 Prediction Error  
We evaluate the root mean squared error (\(RMSE_{j}\)) with respect to periods over all 10 test ground motion datasets for the site \(j\) with Equation (4). \[RMSE_{j}=\sqrt{\frac{\sum_{i=1}^{l}\mathbf{L}^{i}}{l}} \tag{4}\]  
\[\mathbf{L}^{i}=\left(\mathbf{S}_{\mathbf{a}}^{i\ pred}-\mathbf{S}_{\mathbf{a}}^{i\ true} \right)^{2} \tag{5}\]  
Here, \(\mathbf{L}^{i}\) is the squared error for the test ground motion dataset \(i\in[1,\,2,\,\dots,\,10]\) between \(\mathbf{S}_{\mathbf{a}}^{i\ pred}\) and \(\mathbf{S}_{\mathbf{a}}^{i\ true}\). \(\mathbf{S}_{\mathbf{a}}^{i\ pred}\) represents the predicted ground response spectrum and \(\mathbf{S}_{\mathbf{a}}^{i\ true}\) represents the true ground response spectrum, for the test dataset \(i\). \(l\) is the number of test ground motions for a site, which is 10. Figure 22: The six samples of acceleration response spectra prediction results compared to the measurements (true) for site MYGH04. Subfigures (**a–f**) correspond to the six samples for the current site. Figure 23 shows the errors for all 12 sites. In general, the data-driven models show lower errors than the conventional physics-based model. Particularly, the physics-based model shows larger errors between 0.01 and 0.4 s for the sites FKSH17 (Figure 23a), FKSH18 (Figure 23b), IWTH05 (Figure 23f), IWTH21 (Figure 23i), IWTH22 (Figure 23j), and MYGH04 (Figure 23i). The error tends to be smaller for the sites IWTH12 (Figure 23g), IWTH14 (Figure 23h), and IWTH27 (Figure 23k), but still large in the natural period ranges from 0.5 to 1.0 s, 0.04 to 0.2 s, and 0.15 to 0.25 s, respectively. Figure 23: Acceleration response spectra prediction errors with respect to periods for all sites: (a) FKSH17, (b) FKSH18, (c) FKSH19, (d) IBRH13, (e) IWTH02, (f) IWTH05, (g) IWTH12, (h) IWTH14, (i) IWTH21, (j) IWTH22, (k) IWTH27, (l) MYGH04. There are no distinct error trend differences between the data-driven models and physical model for the sites FKSH19 (Figure 23c), IBRH13 (Figure 23d), and IWTH02 (Figure 23e). The sites FKSH19 and IBRH13 show mixed error trends across the natural periods between the models, although the LSTM and transformer models slightly outperform the CNN and physics-based models. For the site IWTH02, all models exhibit similar prediction error trends over the natural periods. Among the data-driven models, the CNN model shows larger errors between the natural periods of 0.01 and 1.0 s compared to the LSTM and transformer for the sites FKSH19 (Figure 23c), IBRH13 (Figure 23d), IWTH12 (Figure 23g), and MYGH04 (Figure 23f). For the sites IBRH13 (Figure 23d), IWTH21 (Figure 23g), and IWTH21 (Figure 23i), some error surges are observed between the period 1.0 and 1.0 s. The higher error of the CNN model can be attributed to its weaker ability to consider the sequential feature dependencies, as mentioned earlier. For the other sites, the models show similar error trends. For the site FKSH19 (Figure 23c), the error shows a mixed trend for all models. We compare the model performances for all sites using the global error (see Equation (6)), as presented in Figure 24. It represents the average RMSE error over all the sites shown in Figure 23.  
\[\text{Global error}=\frac{1}{m}{\sum\limits_{j=1}^{m}RMSE_{j}} \tag{6}\]  
Here, \(m\) is the number of sites (=12), \(j\) is the index of the sites, and \(RMSE_{j}\) is the root mean squared error computed in Equation (4). The proposed deep learning models generally outperform the physics-based model, particularly for the natural periods ranging from 0.01 to 0.4. Among the deep learning models, the CNN model tends to show a higher error, particularly in the lower frequency range between 0.01 and 0.1 than the other models. The LSTM and transformer models exhibit similar error trends over the periods. To provide a quantitative error summary for each model, we use the average mean squared error (\(MSE_{avg}\)) to show the quantitative error summary for each model (Equation (7)). \[