# Seismic Ground Response Estimation Based on Convolutional Neural Networks (CNN)
## 4 Analytical Procedure
### Prediction Errors  
An average of 20 errors in each station was calculated with Equation (7). The average errors of the estimation of CNN model and SHAKE2000 for the twelve sites are plotted in Figure 22.  
\[Average\ Error=\frac{1}{n}\sqrt{\sum_{i=1}^{n}{(Error_{i})}^{2}} \tag{7}\]  
\[Error=SA_{pre}-SA_{test} \tag{8}\]  
where \(n\) is the number of ground motions in each station (\(n=20\)), \(Error\) is the disparity between the response spectra estimation and the baseline of each ground motion for each site, \(SA_{pre}\) is the estimation by the models, and \(SA_{test}\) is the ground motion measurement.  
Figure 22: Average errors in the ground motions by the CNN model and SHAKE2000. (**a**) FKSH17 (**b**) FKSH18 (**c**) FKSH19 (**d**) IBRH13 (**e**) IWTH02 (**f**) IWTH05 (**g**) IWTH12 (**h**) IWTH14 (**i**) IWTH21 (**j**) IWTH22 (**k**) IWTH27 (**l**) MYGH04.  
Overall, the errors of the conventional model are higher than the CNN model, especially for sites FKSH17, FKSH18, IWTH05, IWTH21, and IWTH22 in natural periods between 0.01 and 0.3 s. In addition, for sites IWTH14 and MYGH04 in natural periods between 0.01 and 0.2 s, for FKSH19 in natural periods from 0.01 to 0.1 s, for IBRH13, in natural periods from 0.3 to 0.4 s, for IWTH12, in natural periods from 0.4 to 1 s, and for IWTH27, in natural periods from 0.1 to 0.2 s. Exceptionally, it seems that there is no conspicuous gap between them throughout the whole natural periods for site IWTH02.  
The global error which summarizes the total errors of the predictions for all the sites with Equation (9) are presented in Figure 23.  
\[Global\ Error=\frac{1}{m}\sqrt{\sum_{j=1}^{m}{(Average\ Error_{j})^{2}}} \tag{9}\]  
where \(m\) is the number of sites, and \(Average\ Error_{j}\) is an average error of 20 earthquakes in the \(j\)th station calculated with Equation (7). The proposed model especially outperforms the analysis software when the natural periods range from 0.01 to 0.3 s.  
Moreover, the mean squared error (\(MSE\)) is utilized to represent the errors as numbers. \(MSE\) measures the average squared difference between the actual values and the estimated values with Equation (10).  
\[MSE=\frac{1}{l}\sum_{k=1}^{l}Error^{2} \tag{10}\]  
where \(Error\) is the disparity between the response spectra estimation and the baseline of each ground motion, as shown in Equation (8), and \(l\) is the number of the response spectrum values in each earthquake. An average error of 20 \(MSE\) in each station is calculated with Equation (11).  
\[Average\ MSE=\frac{1}{n}\sum_{i=1}^{n}MSE \tag{11}\]  
where \(n\) is the number of ground motions in each station (\(n=20\)). Table 3 shows the average mean squared error of 20 response spectra estimations in each station.  
For sites IWTH05, IWTH21, IWTH22, and MYGH04, the average mean squared errors of the CNN model are dozens of times lower than the errors of the software. On the other side, for sites IBRH13 and IWTH02, the values of the errors are almost the same.  
Figure 23: The global average errors of the earthquake predictions for all sites.