You are on page 1of 9

Structures 34 (2021) 4977–4985

Contents lists available at ScienceDirect

Structures
journal homepage: www.elsevier.com/locate/structures

Explainable Machine learning on New Zealand strong motion for PGV


and PGA
Surendra Nadh Somala a, *, Sarit Chanda a, b, Karthika Karthikeyan c, Sujith Mangalathu d
a
Indian Institute of Technology Hyderabad 502285, India
b
IcfaiTech, IFHE, Hyderabad 502285, India
c
2820 Prestwood Drive, Cumming, GA 30040, USA
d
Research Data Scientist, Mangalathu, Mylamkulam, Puthoor P O, Kollam, Kerala 691507, India

A R T I C L E I N F O A B S T R A C T

Keywords: Estimating ground motion characteristics at various locations as a function of fault characteristics is useful for the
Kaikoura proper damage assessment and risk mitigation strategies. This paper explores the application of machine learning
Machine learning approaches to predict peak ground acceleration (PGA) and peak ground velocity (PGV) using New Zealand’s
Pgv
strong motion data. Five machine learning algorithms, namely linear regression, kNN, SVM, Random Forest, and
Random forest
Svm
XGBoost, are used in this study. Using the New Zealand flat-file database, the geometric mean of the peak ground
Xgboost motion parameters is used as predictor variables in training the machine learning algorithms. The performance of
the chosen algorithms and how they work on PGV and PGA are discussed. The best prediction for PGA is obtained
using random forest but for PGV XGboost worked best. The relative importance of various features in the flat file
is also presented for the best-performing machine learning algorithm. Although the magnitude of an earthquake
is found to be most influential for PGV, rupture distance showed the highest impact for PGA. Finally, the pre­
dictions are also explained using SHApley Additive exPlanations (SHAP) for the overall dataset as well as on a
sample by sample basis, for a few samples. Pairwise dependency of some features with the highest feature
importance is also presented using SHAP.

1. Introduction attempt machine learning approaches to see how well peak ground
motion acceleration (PGA) and peak ground velocity (PGV) can be
The Hikurangi and Fiordland are two main subduction zones of New predicted. Strong motion accelerograms are usually needed to find the
Zealand with the interface and in-slab earthquakes. Shallow crustal maximum ground motion. For New Zealand, however, a database
earthquakes are also seen over the entire stretch of New Zealand. (popularly known by engineering seismologists as flat-file) exists that
Although the historic 1968 Inangahua was one of the oldest documented has PGA and PGV tabulated along with several other informative pa­
earthquakes of magnitude above 7, the 2003 Fiordland earthquake is rameters about the earthquakes from which they originated together
possibly the earliest earthquake exceeding 7 magnitudes with some with the locations where they are recorded.
strong-motion recordings available. More recently, the 2009 Dusky and The New Zealand flat-file is a result of the efforts of GNS science
2010 Darfield earthquakes with a magnitude higher than 7 added to researchers. It has more than 4000 recordings from earthquakes of
New Zealand’s strong motion data significantly [1]. The 2011 Christ­ magnitude 3.5 and above [2,3]. This database has been used for site
church earthquake has caused notable damage to structures. The Can­ characterization [3] and computations of response spectra [4]. Five of
terbury earthquake sequence is also known to have triggered several the New Zealand earthquakes also find their place in the worldwide
secondary effects. Damage does have a correlation with intensity (e.g., database (74 earthquakes) of strong near-field motion [5], of which the
peak ground motion), as is assumed in probabilistic seismic demand 2016 Kaikoura earthquake has 30 + time histories. A few hundreds of
models. So, it is important to have predictive models for peak ground accelerograms (both horizontal as well as vertical components) are also
motion. Typically, such predictive models are derived by assuming available for time history analysis of structures. Metadata related to
functional forms, which introduce bias. However, in this study, we various distance metrics, depth to the top of the fault, site classification,

* Corresponding author.
E-mail address: surendra@ce.iith.ac.in (S.N. Somala).

https://doi.org/10.1016/j.istruc.2021.10.085
Received 25 July 2021; Received in revised form 27 September 2021; Accepted 25 October 2021
Available online 6 November 2021
2352-0124/© 2021 Institution of Structural Engineers. Published by Elsevier Ltd. All rights reserved.
S.N. Somala et al. Structures 34 (2021) 4977–4985

distribution of input parameters and the prediction variables — PGA_­


Geomean and PGV_Geomean — which are the geometric mean of hor­
izontal components of PGA and PGV. It can be observed that there are
more than 4000 instances available for training the machine learning
algorithms. The geometric mean of PGA is in units of g, and that of
velocity is in units of m/s. Based on the tectonic class, the majority are
crustal, while interface earthquakes are the least. Most earthquakes’
focal depths are within a few tens of km, while the deepest earthquake is
more than 180 km deep. The hypocentral distance of the farther
recording is almost 300 km. Focal mechanisms cover nearly the entire
ranges of the strike, dip, and rake. Other parameters like filtering fre­
quencies and the ranges of the latitudes and longitudes of stations and
events are also shown in Fig. 2. The correlations of the input parameters
with respect to PGA and PGV are shown in Fig. 3a and 3b, respectively.
The location of the station does seem to correlate with the locations of
the hypocenters. The distance metrics also correlate with each other.
The length and width of the fault are also correlated. Although PGA does
not seem to correlate with any input parameters clearly, PGV does
appear to correlate well with magnitude and fault dimensions. More­
Fig. 1. Locations of earthquakes (red stars) used in this study and the stations over, PGV also negatively correlates with the source-to-site distance
(blue circles) where their recordings are available. metrics. Fig. 3 shows that some variables are highly correlated which
points to the need for models that can account for multicollinearity.
fault dimensions, focal mechanism, filtering frequencies are provided in Note that tree-based models can account for the correlation in their
the flat file. Note that each earthquake can be recorded at multiple prediction models. The distribution of prediction variables along with
stations. Similarly, each station can record seismic waves from multiple some of the other parameters typically used in ground motion prediction
events. So, although well over 4000 recordings exist in New Zealand flat- equations (magnitude, distance metrics) is shown in Fig. 4. The geo­
file, the number of earthquakes is actually fewer than the count of the metric mean of PGV and PGV are better represented on a log–log scale.
recordings. Magnitude distribution has a higher number of records at an interme­
Recently machine learning has been used in earthquake engineering diate range between 4.5 and 6. All distance metrics appear to be log-
for ground motion prediction [6], fundamental time period [7] and normally distributed.
structural response [8–15]. The ANN [16] and MLP [17] have been used
to predict the response spectrum using earthquake parameters. These 3. Machine learning algorithms
researches have shown that machine learning models can handle com­
plex problems where mechanics-based models are not readily available. We use supervised machine learning algorithms with either PGA or
For example, Mangalathu and Jeon [18] showed that machine learning PGV as the label. For this purpose, the complete dataset is split into two
models are 11% more accurate than computationally expensive nu­ parts, the majority (70%) portion is used for training the machine
merical models [19] in identifying the failure mode of columns. Similar learning algorithms. In contrast, the remaining amount (30%) is used to
conclusions are also noted for estimating the failure mode of structural see how well the trained model predicts the output of samples that it was
components [8] and the structures [20]. Mangalathu et al. [9] explored completely blind to, following the recommendation of Friedman et al.
the damage prediction of buildings as a function of the earthquake and [21]. Linear regression is the simplest way to establish the output var­
building characteristics. They have used the Kriging algorithm to esti­ iable’s dependence on the input variables. The optimal set of coefficients
mate the ground motion values at various locations in California. for the input variables is found by minimizing the least square error
However, such algorithms rely on dense earthquake recordings at the between the data and prediction for all plausible values of the co­
location of interest. In this paper, we are addressing this issue using a efficients. The optimization can be done by any of the methods,
rich database from New Zealand. Specifically, this paper explores the including the simplest gradient descent technique. k-NN predicts the
application of ground motion characteristics such as PGA. For this output variable as the average of several neighboring values, where ‘k’
purpose, inputs like magnitude, distance metrics, site parameters, denotes the number of neighbors used [22]. We try various values for ‘k’
filtering frequencies, focal mechanism, etc., are used. The stations and but report only the value for which best performance is achieved. Sup­
earthquakes’ absolute coordinates (latitude and longitude) are also port vector regression is based on support vector machines that partition
used, apart from the standard distance metrics. In addition, the un­ the data space with hyperplanes with maximum separation. For non-
certainties of some of the input parameters (like magnitude, Vs30), if separable cases, the kernel trick is used to transform the data in
available, are also taken into account in training the machine learning higher-dimensional space. Each class against the rest of the classes is
models. Various machine learning models such as linear regression, k- treated as a binary classification problem for multi-class problems.
nearest neighbors, support vector regression, random forest, and We also use tree-based ensemble techniques that rely on majority
XGBoost are used in this study. The data description is given in the voting. Random forest is one such ensemble method [23] that is based
following section, followed by a summary of the machine learning on the bagging concept, while XGBoost (extreme gradient boosting) is
approaches. based on the boosting concept [24]. Bagging is also known as bootstrap
aggregation, where sub-samples of the input are used to construct
2. Data several trees. Samples are passed top-down through each tree, deciding
to go either left branch or right branch based on the criteria at the node.
Figure 1 shows the locations of events from which recordings are The final prediction is achieved when the tree is traversed till its last
used to predict the peak ground motion parameters. These earthquakes layer. Boosting relies on combining several weak learners from the
sample almost the entire stretch of New Zealand Fig. 2 shows the previous iteration to achieve a strong learner. XGBoost is a gradient

4978
S.N. Somala et al. Structures 34 (2021) 4977–4985

Fig. 2. Input variables and prediction variables used in this study. The total number of samples is in excess of 4000, as indicated below the bottommost horizon­
tal bar.

4979
S.N. Somala et al. Structures 34 (2021) 4977–4985

square error (RMSE) and the coefficient of determination (R2) are shown
separately for training and testing datasets (Tables 1-2). It can be seen
that the smallest RMSE on the test set is 0.026 m/s, occurring for
XGBoost. However, in PGA prediction, the random forest gives the
smallest RMSE (0.032 g) among the machine learning algorithms
considered. The variance reduction (R2) parameter is also tabulated in
Tables 1 and 2. R2 on the test set is highest for XGBoost in predicting
PGV, while for PGA prediction, it is highest for the random forest. The
classical machine learning algorithms like linear regression, kNN, and
SVM performed relatively poorly in predicting PGA and PGV. Fig. 5
shows the predicted value as a function of the actual value for PGA and
PGV, separately for the training and test datasets.

5. SHAP (SHapely Additive exPlanations)

The output of machine learning algorithms is no more a BlackBox


prediction with the advancement of techniques such as SHAP For an
effective model, there should be two levels of explainability — global
and local. Global stands for the effect of each variable on the prediction
model, while local explainability helps to understand why a certain
prediction is made. SHAP can show the impact of each input variable
separately (global interpretability) [25,26]. Also, Shapley values can
measure the importance feature-wise for individual samples at a local
level (local interpretability). The overall importance of each feature
(input parameter) on the complete dataset can also be explained by
SHAP. SHAP uses a linear model of coalitions as shown in Eq. (1) to
make the model interpretable.
∑M
h(z’) = ψ 0 + ψ z’
k=1 k k
(1)

where h is the explanation model, z’ ∈ {0, 1}N is the coalition vector, N


is the maximum coalition size and ψ k ∈ R is the feature attribution (the
Shapley values) for a feature k. As noted in [22,23], the solution of Eq.
(1) satisfies the properties of Efficiency, Symmetry, Dummy, and Addi­
tivity. Interested readers are suggested to [22,23] for a more detailed
explanation of the SHAP and the associated proof.
The overall SHAP values are presented in Fig. 6. Red color indicates
positive impact while blue color denotes negative influence. Positive
impact stands for the increase in prediction with the increase in the
input variable. It is seen from Fig. 6 that Magnitude (Mw) has the highest
positive impact in predicting PGV, while Rupture distance (Rrup) has the
highest negative impact in predicting PGA. Joyner-Boore distance (Rjb),
another distance metric, takes 3rd place, negatively predicting the peak
Fig. 3. Correlation of input parameters with the prediction variables.
ground motion parameters considered in this study. Directivity is one
prominent parameter with positive impact in both the cases, featuring
boosting algorithm that allows for differential loss, minimized by quite high (fourth place in case of PGV) while it appears a bit later (eight
gradient descent while fitting decision trees to the residual after each places) in the case of PGA. Interestingly, the shear-wave velocity of the
step. An ensemble of weak learners would even outperform on class top 30 m (Vs30) is roughly at the same position in predicting either of the
imbalanced datasets. peak ground motion parameters of interest. Furthermore, Vs30 has a
Finally, the performance of each machine learning algorithm is negative impact in both cases. The length of the fault has a positive
evaluated using two metrics (1) Root Mean Square Error (RMSE) (2) R2, impact and takes fifth and sixth places in the order of importance for
the coefficient of determination. The machine learning algorithm that predicting PGA or PGV, respectively.
gives the lowest RMSE is further chosen to explain the predictions. The Local explainability is demonstrated on the first two samples in the
best-performing machine learning algorithm should do well (lowest flat file (Fig. 7). The testing dataset’s mean values are indicated by ‘base
RMSE, highest R2) on test data. To get the best of the model, the authors value’ in grey, while the individual sample’s output variable is shown in
have carried out hyperparameter optimization using a grid search bold font (Fig. 7). Red color indicates higher while blue color indicates
approach. The combination of parameters that give the best perfor­ lower, with each input parameter pushing the prediction either higher to
mance is chosen for each algorithm. lower or lower to higher. The parameters with positive impact push the
prediction towards higher values only if the parameter’s actual value is
4. Results and discussion more than the mean value of that parameter for the test set. For instance,
all distance metrics negatively impact both PGA and PGV prediction, but
The results of the five different machine learning algorithms used are some of them are to the left of the actual value while others are to the
shown for PGV and PGA in Tables 1 and 2, respectively. The root means right of the actual value. Ideally, the negative impact of all distance

4980
S.N. Somala et al. Structures 34 (2021) 4977–4985

Fig. 4. Distribution of prediction variables along with the source (magnitude) and path (distance metric) parameters that are typically used in ground-motion
prediction equations.

rupture distance), the rupture distance has the highest feature impor­
Table 1
tance. SHAP can also give pairwise interaction. Fig. 9 shows the pairwise
PGV predictions using various machine learning algorithms.
dependence for a few interesting parameters in predicting the PGA and
Machine learning algorithm Training dataset Test dataset PGV. Lower rupture distance has a more positive impact for higher
R2 RMSE R2 RMSE magnitudes, but below Mw 5.3 or so, the trend gets reversed. Such a
Linear regression 0.619 0.046 0.614 0.042 trend is true irrespective of the prediction parameter (PGA or PGV).
Support vector regression 0.269 0.063 0.260 0.062 Also, for higher rupture distances, larger magnitudes have a lower
k-nearest neighbors 0.664 0.043 0.635 0.043 impact.
Random Forest 0.983 0.010 0.861 0.027
XGBoost 0.993 0.006 0.864 0.026
6. Conclusion

For the first time, machine learning algorithms are used to the best of
Table 2 the author’s knowledge on a New Zealand strong motion database to
PGA predictions using various machine learning algorithms. understand the predictability of peak ground motion (PGA and PGV).
Machine learning algorithm Training dataset Test dataset Random forest is found to give the lowest RMSE on the test set for PGA.
For PGV, however, XGBoost gave the lowest RMSE on the test set. SHAP
R2 RMSE R2 RMSE
values reveal that the distance metrics have a negative impact on esti­
Linear regression 0.453 0.056 0.401 0.052 mating the peak ground motion, unlike the magnitude, which has a
Support vector regression 0.178 0.069 0.049 0.065
k-nearest neighbors 0.498 0.054 0.435 0.050
positive impact. Moreover, SHAP reveals that while Mw has the highest
Random Forest 0.953 0.018 0.778 0.032 feature importance in estimating PGV within New Zealand, Rrup is the
XGBoost 0.985 0.009 0.705 0.036 most influential parameter in predicting PGA. Considering the top two
important parameters (Mw, Rrup), there is a pivotal magnitude between
Mw 5 and 6 where the influence of lower Rrup on PGA and PGV pre­
metrics should be pushing the prediction towards lower values, but only
diction flips from negative to positive.
if that distance metric’s value for the sample of interest is higher than
that of the median value of that distance metric in the test set. If not,
Declaration of Competing Interest
such a distance metric would push the prediction towards the right
(higher values).
The authors declare that they have no known competing financial
The feature importance based on mean SHAP values in estimating
interests or personal relationships that could have appeared to influence
the peak ground motion parameters (PGA and PGV) is given in Fig. 8.
the work reported in this paper.
Magnitude has the highest feature importance in PGV prediction, while
rupture distance is the most influential parameter in PGA estimation.
Out of the distance metrics (epicentral, hypocentral, Joyner-Boore, and

4981
S.N. Somala et al. Structures 34 (2021) 4977–4985

Fig. 5. Predictions of the best performing algorithm (XGBoost) on the training and testing datasets for each of the prediction variables.

Fig. 6. SHAP values in predicting the peak ground motion parameters using XGBoost.

4982
S.N. Somala et al. Structures 34 (2021) 4977–4985

Fig. 7. Local explainability of XGBoost predictions for the first two samples using SHAP.

Fig. 8. Feature importance for peak ground parameter estimation.

4983
S.N. Somala et al. Structures 34 (2021) 4977–4985

Fig. 9. SHAP interaction values in predicting PGA and PGV.

Acknowledgment [10] Mangalathu S, Hwang S-H, Choi E, Jeon J-S. Rapid seismic damage evaluation of
bridge portfolios using machine learning techniques. Eng Struct 2019;201:109785.
https://doi.org/10.1016/j.engstruct.2019.109785.
Funding from the Ministry of Earth Sciences (MoES), India, under the [11] Mangalathu S, Jeon J-S. Stripe-based fragility analysis of multispan concrete bridge
grant number MoES/P.O.(Seismo)/1(304)/2016 is greatly acknowledged. classes using machine learning techniques. Earthquake Eng Struct Dyn 2019;48
(11):1238–55.
[12] Seo J, Linzell DG. Use of response surface metamodels to generate system level
References fragilities for existing curved steel bridges. Eng Struct 2013;52:642–53.
[13] Kiani J, Camp C, Pezeshk S. On the application of machine learning techniques to
[1] Houtte CV. Performance of response spectral models against New Zealand data. derive seismic fragility curves. Comput Struct 2019;218:108–22.
Bull N Zeal Soc Earthq Eng 2017;50:21–38. https://doi.org/10.5459/ [14] El-Sefy M, Yosri A, El-Dakhakhni W, Nagasaki S, Wiebe L. Artificial neural network
bnzsee.50.1.21-38. for predicting nuclear power plant dynamic behaviors. Nuclear Eng Technol 2021;
[2] Kaiser A, Van Houtte C, Perrin N, McVerry G, Cousin J, Dellow S, et al. 53(10):3275–85.
Characterizing GeoNet strong motion sites. Site metadata update for the 2015 [15] Siam A, Ezzeldin M, El-Dakhakhni W. Machine learning algorithms for structural
Strong Motion Database. 2016. performance classifications and predictions: Application to reinforced masonry
[3] Kaiser A, Houtte CV, Perrin N, Wotherspoon L, McVerry G. Site characterisation of shear walls. Structures, vol. 22, Elsevier; 2019, p. 252–65.
GeoNet stations for the New Zealand Strong Motion Database. Bull N Zeal Soc [16] Raghucharan MC, Somala SN, Rodina S. Seismic attenuation model using artificial
Earthq Eng 2017;50:39–49. https://doi.org/10.5459/bnzsee.50.1.39-49. neural networks. Soil Dyn Earthquake Eng 2019;126:105828. https://doi.org/
[4] Houtte CV, Bannister S, Holden C, Bourguignon S, McVerry G. The New Zealand 10.1016/j.soildyn.2019.105828.
strong motion database. Bull N Zeal Soc Earthq Eng 2017;50:1–20. https://doi.org/ [17] Somala SN, Chanda S, Raghucharan MC, Rogozhin E. Spectral acceleration
10.5459/bnzsee.50.1.1-20. prediction for strike, dip, and rake: a multi-layered perceptron approach. J Seismol
[5] Pacor F, Felicetta C, Lanzano G, Sgobba S, Puglia R, D’Amico M, et al. NESS1: A 2021;25(5):1339–46. https://doi.org/10.1007/s10950-021-10031-2.
worldwide collection of strong-motion data to investigate near-source effects. [18] Mangalathu S, Jeon J-S. Machine learning–based failure mode recognition of
Seismol Res Lett 2018;89:2299–313. https://doi.org/10.1785/0220180149. circular reinforced concrete bridge columns: comparative study. J Struct Eng 2019;
[6] Chanda S, Raghucharan MC, Karthik Reddy KSK, Chaudhari V, Somala SN. 145(10):04019104. https://doi.org/10.1061/(ASCE)ST.1943-541X.0002402.
Duration prediction of Chilean strong motion data using machine learning. J S Am [19] Kowalsky MJ, Priestley MJN. Improved analytical model for shear strength of
Earth Sci 2021;109:103253. https://doi.org/10.1016/j.jsames.2021.103253. circular reinforced concrete columns in seismic regions. SJ 2000;97:388–96.
[7] Somala SN, Karthikeyan K, Mangalathu S. Time period estimation of masonry https://doi.org/10.14359/4633.
infilled RC frames using machine learning techniques. Structures 2021;34:1560–6. [20] Hwang S-H, Mangalathu S, Shin J, Jeon J-S. Machine learning-based approaches
https://doi.org/10.1016/j.istruc.2021.08.088. for seismic demand and collapse of ductile reinforced concrete building frames.
[8] Mangalathu S, Jang H, Hwang S-H, Jeon J-S. Data-driven machine-learning-based J Build Eng 2021;34:101905. https://doi.org/10.1016/j.jobe.2020.101905.
seismic failure mode identification of reinforced concrete shear walls. Eng Struct [21] Friedman JH. The elements of statistical learning: data mining, inference, and
2020;208:110331. https://doi.org/10.1016/j.engstruct.2020.110331. prediction. Springer open; 2017.
[9] Mangalathu S, Sun H, Nweke CC, Yi Z, Burton HV. Classifying earthquake damage [22] Cover T, Hart P. Nearest neighbor pattern classification. IEEE Trans Inf Theory
to buildings using machine learning. Earthq Spectra 2020;36(1):183–208. https:// 1967;13(1):21–7. https://doi.org/10.1109/TIT.1967.1053964.
doi.org/10.1177/8755293019878137.

4984
S.N. Somala et al. Structures 34 (2021) 4977–4985

[23] Breiman L. Random forests. Mach Learn 2001;45:5–32. https://doi.org/10.1023/ approach. Eng Struct 2020;219:110927. https://doi.org/10.1016/j.
A:1010933404324. engstruct.2020.110927.
[24] Chen T, Guestrin C. XGBoost: A Scalable Tree Boosting System. Proceedings of the [26] Lundberg SM, Lee S-I. A unified approach to interpreting model predictions. In:
22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Proceedings of the 31st international conference on neural information processing
Mining 2016:785–94. https://doi.org/10.1145/2939672.2939785. systems; 2017. p. 4768–77.
[25] Mangalathu S, Hwang S-H, Jeon J-S. Failure mode and effects analysis of RC
members based on machine-learning-based SHapley Additive exPlanations (SHAP)

4985

You might also like