Machine Learning-Based Rapid Post-Earthquake Damage Detection of RC Resisting-Moment Frame Buildings

This study proposes a methodology to predict the damage condition of Reinforced Concrete (RC) resisting-moment frame buildings using Machine Learning (ML) methods. Structural members of six hundred RC buildings with varying stories and spans in X and Y directions were designed using the virtual work method. Sixty thousand time-history analyses using ten spectrum-matched earthquake records and ten scaling factors were carried out to cover the structures’ elastic and inelastic behavior. The buildings and earthquake records were split randomly into training data and testing data to predict the damage condition of new ones. In order to reduce bias, the random selection of buildings and earthquake records was carried out several times, and the mean and standard deviation of the accuracy were obtained. Moreover, 27 Intensity Measures (IM) based on acceleration, velocity, or displacement from the ground and roof sensor responses were used to capture the building’s behavior features. The ML methods used IMs, the number of stories, and the number of spans in X and Y directions as input data and the maximum inter-story drift ratio as output data. Finally, seven Machine Learning (ML) methods were trained to predict the damage condition of buildings, finding the best set of training buildings, IMs, and ML methods for the highest prediction accuracy.


Introduction
Various methods for estimating the lateral strength of buildings using sensor information have been proposed. For example, Quispe et al. [1] obtained the capacity curve and the inter-story drift ratios of the Edgardo Rebagliati Martins hospital in Peru using a sparse number of sensors, the wavelet transform method, and the spline shape function. Additionally, Schanze et al. [2] compared the effect of different underground story modeling approaches on Chile's instrumented Alcazar building office. For this reason, the implementation of instrumented buildings has been increasing recently [3][4][5].
Machine Learning (ML) methods are currently used to predict structures' damage states [6,7]. For example, Cardellicchio et al. proposed a methodology to interpret defect detection results using Class Activation Maps and Explainable Artificial Intelligence techniques applied to Reinforced Concrete (RC) bridges in Southern Italy [8]. Likewise, the damage condition of buildings after an earthquake is obtained for instrumented buildings [9][10][11]. For instance, Yongjia et al. used IMs to train ML models to classify the damage state of buildings [12]. Additionally, Sajedi et al. proposed a framework for building damage diagnosis using the Support Vector Machines method for damage classification and the Bayesian method for the optimization of input features and hyperparameters. Furthermore, the authors proposed a methodology to predict the damage condition of buildings using the convolutional neural network method using wavelet spectra as input images [13]. This study was improved for three-dimensional structures using the wavelet power spectra and by proposing a methodology to select records in order to increase prediction accuracy. It was applied to two instrumented buildings in Japan [14].
On the other hand, it is possible to predict the damage condition of buildings using information from other buildings with similar features. For example, the fundamental vibration period of buildings, which is obtained approximately using the number of stories or their height [15], is one of the most used parameters to estimate the global stiffness of a structure. Likewise, the lateral load-resisting system can be estimated from the plastic deformation mechanism of the structure [16,17]. On the other hand, the structural acceleration, velocity, or displacement response of a building is influenced by its structural properties and earthquake input characteristics [18]. For example, intensity measures (IM) based on the earthquake ground acceleration have the greatest impact on short-period structures [19]. Therefore, it is possible to establish an archetype (parametric model) of the buildings built by their main structural characteristics and select the best and minimum set of buildings to be the reference to accurately predict the damage condition of the rest of the buildings under various intensity measures. This process is possible using ML methods which capture the main features of input data in order to predict particular output data [20,21].
This study proposes ML methods to predict the damage conditions of RC resistingmoment frame buildings based on the building configurations and IMs of input earthquakes and roof sensor acceleration responses. Incremental Dynamic Analyses (IDA) were carried out to cover the elastic and inelastic behavior of the building. The ML models were trained using a different number of stories and spans in X and Y directions to predict the damage condition of the building expressed by inter-story drift ratios. The proposed ML model can be used to detect post-earthquake damage in many other buildings without sensors, based on earthquake acceleration data observed by sensors installed on the ground or on the roof of the building. This paper contains five sections: Section 2 presents the methodology and provides an overview of the proposed research procedure. Section 3 shows the information used to obtain the structural responses from the design of the archetype buildings using the virtual work method, selections of records, and the IDAs presenting several intensity measures. Section 4 presents the ML methodology to predict the damage condition of buildings. Finally, Section 5 presents a summary of the conclusions and a discussion of the research results. Figure 1 shows the procedure employed to obtain the structural responses used in the ML methods. An archetype of the buildings was developed, designed using the virtual work method, and verified using nonlinear static analysis. Additionally, ten records were selected using the uniform hazard spectrum and used as input ground accelerations for Incremental Dynamic Analyses. The result was 60,000 structural linear and nonlinear responses.

Methodology
The ML methods used IMs, the number of stories, and the number of spans in X and Y directions as the input data and the maximum inter-story drift ratio as the output data. As shown in Figure 2, the ML methods had a training and testing process. The input and output data were used to train the ML model in the training process. The trained ML model was used to obtain new predictions in the testing process, and its accuracy was evaluated using reference results.
The ground motion records were split randomly to obtain the data in the training process (80% of records) and the testing process (10% of records). Likewise, the buildings were split randomly to obtain the data in the training process (10% of buildings) and the testing data (90% of buildings). In order to reduce the bias due to random splitting, this process was carried out several times. The ML methods used IMs, the number of stories, and the number of spans in X and Y directions as the input data and the maximum inter-story drift ratio as the output data. As shown in Figure 2, the ML methods had a training and testing process. The input and output data were used to train the ML model in the training process. The trained ML model was used to obtain new predictions in the testing process, and its accuracy was evaluated using reference results. The ground motion records were split randomly to obtain the data in the training process (80% of records) and the testing process (10% of records). Likewise, the buildings were split randomly to obtain the data in the training process (10% of buildings) and the testing data (90% of buildings). In order to reduce the bias due to random splitting, this process was carried out several times.  The ML methods used IMs, the number of stories, and the number of spans in X and Y directions as the input data and the maximum inter-story drift ratio as the output data. As shown in Figure 2, the ML methods had a training and testing process. The input and output data were used to train the ML model in the training process. The trained ML model was used to obtain new predictions in the testing process, and its accuracy was evaluated using reference results. The ground motion records were split randomly to obtain the data in the training process (80% of records) and the testing process (10% of records). Likewise, the buildings were split randomly to obtain the data in the training process (10% of buildings) and the testing data (90% of buildings). In order to reduce the bias due to random splitting, this process was carried out several times.

Structural Distribution
An RC moment-resisting frame system was used for the archetype of the buildings. Figure 3 shows the plan and elevation view of the archetype of buildings. Table 1 shows the key design variables of the archetype of buildings. Six hundred buildings were generated. An RC moment-resisting frame system was used for the archetype of the buildings. Figure 3 shows the plan and elevation view of the archetype of buildings.   Table 1 shows the key design variables of the archetype of buildings. Six hundred buildings were generated. The virtual work method was used to determine the lateral strength and design of the members of the buildings. According to the principle of virtual work, a plastic mechanism of the building was assumed under horizontal seismic forces, as shown in Figure 4. From the principle of energy conservation, the external work was equal to the internal work, as defined by Equation (1) [22]: where is the external work by the external forces, and is the internal work by the internal force of the structural members. Using this formula, the member capacity of the building can be determined from the horizontal force corresponding to the required base shear. The following assumptions were considered in order to obtain the rebar detailing of beams and columns, as shown in Figure 4:

Structural Design Criterion
The virtual work method was used to determine the lateral strength and design of the members of the buildings. According to the principle of virtual work, a plastic mechanism of the building was assumed under horizontal seismic forces, as shown in Figure 4. From the principle of energy conservation, the external work was equal to the internal work, as defined by Equation (1) [22]: where WE is the external work by the external forces, and W I is the internal work by the internal force of the structural members. Using this formula, the member capacity of the building can be determined from the horizontal force corresponding to the required base shear. The following assumptions were considered in order to obtain the rebar detailing of beams and columns, as shown in Figure    From the assumptions, the internal and external work were defined by Equations (2) and (3): where My column is the yield moment of the column, My beam is the yield moment of the beam, θ is the yield rotation of the members, P i is the external load (triangular distribution), and δ i is the absolute displacement of the building (triangular distribution). The base shear coefficient used in this criterion was 0.3, based on the Japanese design standard [23]. Then, the base shear force was defined by Equation (4): where V base is the base shear force, W total is the total weight of the building, n is the number of stories of the building, and P is the external force of the first floor, which is obtained from Equation (4). For this plastic mechanism and assuming a triangular deformation distribution, θ is equal to the roof drift ratio, as Equation (5) shows: where δ roo f is the absolute displacement of the roof level, δ is the displacement of the first floor, and H is the total height. The cross-section size of the columns, in order to avoid axial and shear failure, was obtained by Equation (6): where B is the size of the column, N is the axial force at the column, f c is the compressive strength of the concrete, and h c is the clear height of the column. The cross-section height range of the beams in order to avoid shear failure was obtained by Equation (7): where L is the length of the beam, and its width is b. The yield moment of the column was calculated by Equation (8) [24]: where a tc is the rebar area in the tension side of the column section, f yc is the steel-yielding strength used for the column, and N b and N max are the balance and maximum axial force, respectively, which can be approximated by Equations (9) and (10): The yield moment of the beam was calculated by Equation (11) [24]: Sensors 2023, 23, 4694 where a tb is the rebar area in the tension side of the beam section, f yb is the steel-yielding strength used for the beam, h b is the height of the beam, and r is the minimum distance of the center of tension rebars to the external fiber of the beam.

Structural Model of the Members
The buildings were modeled as three-dimensional frame structures using the following considerations [14]:

•
For the beams, nonlinear flexural springs are used at both ends of the member. The degrading trilinear slip and bilinear hysteretic models are considered, see Figure 5.

•
For the columns, nonlinear multi-spring cross-section models are used at both ends of the member in order to consider the bidirectional-flexural and axial effects. Bilinear hysteretic models are considered for steel (tension and compression) and concrete (only compression), see Figure 6. • Nonlinear shear springs are used in the middle of the beams and columns, and the origin-oriented poly-linear hysteretic model is considered.
The yield moment of the beam was calculated by Equation (11) [24]: where is the rebar area in the tension side of the beam section, is the steel-yielding strength used for the beam, ℎ is the height of the beam, and r is the minimum distance of the center of tension rebars to the external fiber of the beam.

Structural Model of the Members
The buildings were modeled as three-dimensional frame structures using the following considerations [14]: • For the beams, nonlinear flexural springs are used at both ends of the member. The degrading trilinear slip and bilinear hysteretic models are considered, see Figure 5.

•
For the columns, nonlinear multi-spring cross-section models are used at both ends of the member in order to consider the bidirectional-flexural and axial effects. Bilinear hysteretic models are considered for steel (tension and compression) and concrete (only compression), see Figure 6. The software STERA_3D [25], developed by one of the authors, was used for nonlinear static and dynamic analyses. The structural analysis computation time was optimized by running 16 models in parallel. However, it is possible to make equivalent models in order to optimize the number of parameters and decrease the consumed computation time [26]. The software STERA_3D [25], developed by one of the authors, was used for nonlinear static and dynamic analyses. The structural analysis computation time was optimized by running 16 models in parallel. However, it is possible to make equivalent models in order to optimize the number of parameters and decrease the consumed computation time [26].

Verification of the Structural Design
The structural design of buildings was verified by the nonlinear static analysis (pushover), comparing the base shear force coefficient at the inter-story drift greater or equal to 1/100 with the minimum value of 0.3. Note that the member sizes, rebar distribution, and the minimum and maximum rebar ratio satisfied the recommendations of the Architectural Institute of Japan Standard [24]. Figure 7 shows the box plot of the base shear coefficient of 600 buildings by stories for the inter-story drift of 1/150, 1/100, 1/75, and 1/50. Almost all buildings had a base shear force coefficient of more than 0.3 when the inter-story drift exceeded 1/75.  Table 2 shows the member sizes of columns and beams of each story.    The Uniform Hazard Spectrum (UHS) is a response spectrum with an equal probability of exceedance of a particular hazard in all structural periods. This paper used Nagoya's 2500-year return period Uniform Hazard Spectrum (UHS) [23] as the target response spectrum of input earthquakes. This UHS is the acceleration response spectrum of a 5% damping ratio on reference ground (the shear wave velocity in the first 30 m of soil is 292 m/s), corresponding to an exceedance probability of 2% in 50 years.

Records Selection Criterion
Moscoso et al. [14] created a database of 183 records from the ground motion records obtained in the Center of Engineering Strong Motion Data by the USGS and the California Geological Survey [27]. It consists of records with fewer than 3000 samples and PGA greater than 400 gals. Additionally, the record data were cut off between 5% and 95% of the Aries Intensity, where the main energy was released in this time range [28].
Then, the records were further selected in order to obtain the minimum Mean Squared Error (MSE) defined by Equation (12) against the target acceleration response spectra: where SF 1 is the scaling factor in obtaining the minimum MSE for the evaluated record, Sa rec is the unscaled response spectrum of the evaluated record, and Sa target is the target response spectrum. Finally, a set of 10 ground motion records and their scaling factors were selected, as shown in Table 3. However, it is necessary to increase the number of records in future studies in order to cover more earthquake features.  Figure 8 shows the target spectrum, the spectrum of the selected records, and the fundamental period range of studied buildings (between 0.237 and 0.609 s).

Hokkaido2003_NS
2.64 LomaPrieta1989_0 2.85 Westmorland1981_90 2.61 Figure 8 shows the target spectrum, the spectrum of the selected records, and the fundamental period range of studied buildings (between 0.237 and 0.609 s).

Incremental Dynamic Analysis
IDA was used to obtain buildings' linear and nonlinear responses. IDA requires performing a series of nonlinear time-history analyses in which the scale factors (SF 2 ) of ground motions are gradually increased until the collapse capacity of the structure is reached [29]. SF 2 are applied to the records after matching to the target spectrum. The SF 2 were from 0.10 to 0.30 in increments of 0.10 and from 0.50 to 2.00 in increments of 0.25 in this study.
The IDA curve represents the relationship between Intensity Measure (IM) and Damage Measure (DM). The IMs can be obtained based on either acceleration (A), velocity (V), displacement (D), or by combining them (H: hybrid IM). In this study, 27 IMs were selected, as shown in Table 4. The maximum inter-story drift ratio (story drift) was selected as the DM.     [47] Ten scaling factors of input ground motions were selected for all buildings to capture the linear and nonlinear behavior. As an example, the IDA curve of the three-story (Ns) building with two spans in the x-direction (Nx) and five spans in the y-direction (Ny) is shown in Figure 9. Ten scaling factors of input ground motions were selected for all buildings to cap the linear and nonlinear behavior. As an example, the IDA curve of the three-story building with two spans in the x-direction (Nx) and five spans in the y-direction (N shown in Figure 9.

Damage Condition State
The scaling factors of ground motions were determined with reference to the dam conditions in Table 5 so that the story drift could range from No Damage to Collapse

Damage Condition State
The scaling factors of ground motions were determined with reference to the damage conditions in Table 5 so that the story drift could range from No Damage to Collapse condition [13,14]. Table 5. Damage condition state [13,14].

Input and Output Data for the ML Models
The input data were Intensity Measures (from the ground and/or roof response acceleration), the number of spans in X and Y directions (Nx and Ny), and the number of stories (Ns). The output data were the story drifts.

Case Studies with Different Input Data
In determining the IM from the sensor record, two cases were considered in this study. The record was obtained from the ground motion sensor in the first case, as shown in Figure 10. In the second case, the records were taken from the ground and roof sensor and IMs were calculated by both records, as shown in Figure 11.

Random Selection of Records and Buildings for the ML Models
In total, 80% and 20% of the records were used for the training and testing processes, respectively. Random record selections were carried out ten times in order to reduce bias. The ML model was trained and tested for each set of records. The accuracy of the ML prediction was evaluated using the coefficient of determination (R 2 ), and its mean 2 2 In the second case, the records were taken from the ground and roof sensor and IMs were calculated by both records, as shown in Figure 11. In the second case, the records were taken from the ground and roof sensor and I were calculated by both records, as shown in Figure 11.

Random Selection of Records and Buildings for the ML Models
In total, 80% and 20% of the records were used for the training and testing process respectively. Random record selections were carried out ten times in order to reduce b The ML model was trained and tested for each set of records. The accuracy of the M prediction was evaluated using the coefficient of determination (R 2 ), and its me

Random Selection of Records and Buildings for the ML Models
In total, 80% and 20% of the records were used for the training and testing processes, respectively. Random record selections were carried out ten times in order to reduce bias. The ML model was trained and tested for each set of records. The accuracy of the ML prediction was evaluated using the coefficient of determination (R 2 ), and its mean (R 2 _mean) and standard deviation (in order to evaluate the dispersion) of R 2 values came from the ten selections. Figure 12 shows the procedure of the record selections of the ML model. On the other hand, this study randomly selected 10% and 90% of the 600 buildings for training and testing processes, respectively, as shown in Figure 13. Random building selections were carried out 200 times to reduce bias. The ML model was trained and tested for each set of buildings. The maximum R 2 _mean and its standard deviation of the iterations determined the best training buildings. Figure 14 shows the procedure of the building selection of the ML model. On the other hand, this study randomly selected 10% and 90% of the 600 buildings for training and testing processes, respectively, as shown in Figure 13. On the other hand, this study randomly selected 10% and 90% of the 600 buildin for training and testing processes, respectively, as shown in Figure 13. Random building selections were carried out 200 times to reduce bias. The ML mod was trained and tested for each set of buildings. The maximum R 2 _mean and its standa deviation of the iterations determined the best training buildings. Figure 14 shows t procedure of the building selection of the ML model. Random building selections were carried out 200 times to reduce bias. The ML model was trained and tested for each set of buildings. The maximum R 2 _mean and its standard deviation of the iterations determined the best training buildings. Figure 14 shows the procedure of the building selection of the ML model.

Machine Learning Methods
The following seven ML methods were used, and their parameters were calibrated after several runs (training process) in order to optimize the prediction. The optimum IMs were obtained from the feature importance level (from 0 to 1), which was obtained using the Gini importance technique [48,49] of the regression tree methods (not for Linear regression or Multilayer perception).
Linear Regression. This method assumes that the output (prediction) is linearly dependent on the features. The coefficients (weights) are updated in order to minimize the prediction error obtained from the reference and predicted values [20,50].
Decision Tree. This method builds the best decision-making tree by splitting and selecting the order of the roots and leaves. The leaves are chosen when it is not possible for more optimization below those nodes [51,52]. The parameters used in this study are shown in Table 6.

Parameters
Value Function to measure the quality of a split Maximum depth of the tree No-limit Minimum number of samples to split 2 Minimum number of leaf nodes 1 Maximum number of leaf nodes No-limit Random Forest. This method builds several decision trees (forest) from bootstrapped datasets (a new random dataset with the same size as the original one), increasing its accuracy in this way. The new data to predict are evaluated in the forest [48,53]. The parameters used in this study are shown in Table 7.

Machine Learning Methods
The following seven ML methods were used, and their parameters were calibrated after several runs (training process) in order to optimize the prediction. The optimum IMs were obtained from the feature importance level (from 0 to 1), which was obtained using the Gini importance technique [48,49] of the regression tree methods (not for Linear regression or Multilayer perception).
Linear Regression. This method assumes that the output (prediction) is linearly dependent on the features. The coefficients (weights) are updated in order to minimize the prediction error obtained from the reference and predicted values [20,50].
Decision Tree. This method builds the best decision-making tree by splitting and selecting the order of the roots and leaves. The leaves are chosen when it is not possible for more optimization below those nodes [51,52]. The parameters used in this study are shown in Table 6. Random Forest. This method builds several decision trees (forest) from bootstrapped datasets (a new random dataset with the same size as the original one), increasing its accuracy in this way. The new data to predict are evaluated in the forest [48,53]. The parameters used in this study are shown in Table 7. Gradient Boosting (Gradient Boost). This method makes a tree to obtain residuals instead of predictions. Then, a new predictor is built using the previous predictor (the first one predicts the same value for all and then is updated) and adds the residuals predictor (a learning rate scales it). Therefore, the new predictor is based on the previous tree's errors [48]. The parameters used in this study are shown in Table 8. AdaBoost. This method fits a regressor onto the original dataset. Then, it fits additional copies of the regressor onto the same dataset, but the weights of instances are adjusted according to the current prediction error [48]. The parameters used in this study are shown in Table 9. Extreme Gradient Boosting (XGBoost). This method is called extreme because it is built with several parts. Like Gradient Boost, the regression tree is obtained using residuals instead of predictions from the similarities and gain values method for splitting and obtaining the thresholds. The pruning method is used to reduce this tree. Additionally, this method uses the regularization parameter to minimize the prediction's sensitivity to individual observations. Finally, it uses the original previous predictor and learning rate to obtain a new predictor [54]. The parameters used in this study are shown in Table 10.
Multilayer Perceptron. This interconnects a group of perceptrons and transmits data to others inspired by the biological neural networks that constitute animal brains. Each connection has weights adjusted to reduce the error [51,55]. The parameters used in this study are shown in Table 11.  Table 12 shows the ML results for the first case, where the IMs are ordered descending from left to right (collected from the feature importance levels greater than 0.05). Even though the difference between R 2 and the standard deviation for all the ML methods was generally insignificant, the main results are as follows:

•
The maximum R 2 obtained by the Random Forest method is 0.942: A95, IMcr, AI, and Ic.

•
The maximum R 2 _mean obtained by the Gradient Boost method is 0.870: A95, AI, Ic, and Imcr.

•
The minimum standard deviation obtained by the Decision Tree method is 0.047 where the main Ims are based on acceleration: A95 and AI.

•
The IM present in all the ML methods is A95.  Figure 15 shows the results of the Random Forest method of the first case. Figure 15a compares the predicted and reference story drift for the maximum R 2 , which was 0.942. Figure 15b shows the normal distribution function of the R 2 , where its mean and standard deviation were 0.867 and 0.054, respectively. Figure 15c shows the importance levels of the features (IMs, Ns, Nx, and Ny) in which A95, IMcr, AI, and Ic had contributions greater than 0.05.  Table 13 shows the ML results for the second case, where the IMs are ordered descending from left to right (collected from the feature importance levels greater than 0.05). Even though the difference between R 2 and the standard deviation for all the ML methods was generally insignificant, the main results are as follows: • The maximum R 2 obtained by the Gradient Boost method is 0.942: R_PGA and R_PGV.

•
The maximum R 2 _mean obtained by the Gradient Boost method is 0.902: R_PGA and R_PGV.

•
The minimum standard deviation obtained by the Linear Regression method is 0.016.

•
The IM present in all the ML methods is R_PGA.   Table 13 shows the ML results for the second case, where the IMs are ordered descending from left to right (collected from the feature importance levels greater than 0.05). Even though the difference between R 2 and the standard deviation for all the ML methods was generally insignificant, the main results are as follows:

•
The maximum R 2 obtained by the Gradient Boost method is 0.942: R_PGA and R_PGV.

•
The maximum R 2 _mean obtained by the Gradient Boost method is 0.902: R_PGA and R_PGV.

•
The minimum standard deviation obtained by the Linear Regression method is 0.016.

•
The IM present in all the ML methods is R_PGA. Figure 16 shows the results of the Gradient Boost method of the second case. Figure 16a compares the predicted and reference story drift for the maximum R 2 , which was 0.942. Figure 16b shows the normal distribution function of the R 2 where its mean and standard deviation were 0.909 and 0.037, respectively. Figure 16c shows the importance levels of the features (IMs, Ns, Nx, and Ny) in which R_PGA and R_PGV had contributions greater than 0.05.  Figure 16 shows the results of the Gradient Boost method of the second case. Figure  16a compares the predicted and reference story drift for the maximum R 2 , which was 0.942. Figure 16b shows the normal distribution function of the R 2 where its mean and standard deviation were 0.909 and 0.037, respectively. Figure 16c shows the importance levels of the features (IMs, Ns, Nx, and Ny) in which R_PGA and R_PGV had contributions greater than 0.05.

Computation Time
The structural analyses and the ML methodology process were carried out on a computer with 20 Intel ® Xeon ® W-2255 CPUs @3.70 GHz, 256 Gb of RAM, and 1 NVIDIA RTX A5000 GPU card. The ML algorithms were developed using the Scikit learn library [56] under Python 3.8.3.
The number of structural models was 10,000 per story, considering ten earthquakes, ten scaling factors, ten spans in the X-direction, and ten spans in the Y-direction. Table 14 shows the computation time of the structural analyses per story. The consumed computation time was optimized by running 16 structural models in parallel.

Computation Time
The structural analyses and the ML methodology process were carried out on a computer with 20 Intel ® Xeon ® W-2255 CPUs @3.70 GHz, 256 Gb of RAM, and 1 NVIDIA RTX A5000 GPU card. The ML algorithms were developed using the Scikit learn library [56] under Python 3.8.3.
The number of structural models was 10,000 per story, considering ten earthquakes, ten scaling factors, ten spans in the X-direction, and ten spans in the Y-direction. Table 14 shows the computation time of the structural analyses per story. The consumed computation time was optimized by running 16 structural models in parallel.  As shown in Figures 15c and 16c, the importance levels of IMs were higher than the structural features of the buildings (Nx, Ny, and Ns). Even though the total number of buildings was 600, the number of record features came from 27 IMs of 10 results (scaling factors) per building. Then, the results depended mainly on the records' variability, establishing the model's accuracy. For this reason, it is recommended to increase the number of records in future studies to cover more earthquake features.
Although the accuracy and dispersion for both cases were similar, the main result difference came from the influence of the building response features. Table 12 shows that the main IMs for the first case came from the ground sensors against the second from the roof sensors, as shown in Table 13. Moreover, the main IMs for the first case were based on acceleration and, for the second case, on acceleration and velocity. In addition, for all the ML methods except Decision Tree, the R 2 _mean and the standard deviation were the highest and lowest for the second case, concluding that the second case provides the best high accuracy and low dispersion. However, the inclusion of roof sensors is not easily feasible. Therefore, it is recommended to include roof sensors to increase accuracy and decrease dispersion progressively.
For both cases, Linear Regression and Multilayer Perceptron were the fastest and slowest ML methods, as shown in Tables 15 and 16. This was because of the complexity of their algorithms, measured by the number of trainable parameters involved. Even though the training and validation could be computationally intensive, once the ML model has been developed it can automatically predict the elastic and inelastic structural responses and detect the damage conditions immediately after the earthquake. For this reason, the Gradient boost (the lowest R 2 _mean) was considered the most effective ML method in both cases in this study.

Conclusions
This study proposes a methodology to predict the damage conditions of RC resistingmoment frame buildings using ML methods. The methodology was applied to 600 buildings, and the results are summarized as follows:

•
The virtual work method was used to design RC moment-resisting frame system models considering a plastic mechanism, external load, and deformation distribution. The rebar area, distribution of rebars, and realistic member sizes of beams and columns were calibrated using the recommendations of the Japanese standard. The static nonlinear analysis was used to verify the design by comparing the base shear coefficient at the inter-story drift ratio greater or equal to 1/100 with the target value of 0.3.

•
The ground motion records were selected for PGA greater than 400 gals, 5-95% of the Arias intensity time range, and its response spectrum matched the Uniform Hazard Spectrum of Nagoya-Japan (target spectrum) with an exceedance probability of 2% in 50 years. • Incremental Dynamic Analyses were carried out on the target buildings in order to obtain the responses covering the linear and nonlinear behavior. • Two cases were considered to obtain the Intensity Measures from the sensor records: the first case considered the ground sensors, and the second case considered the ground and roof sensors. • Seven machine learning methods were used to predict the damage conditions of the buildings represented by the inter-story drift ratio. The training process used 27 intensity measures obtained from the ground and/or roof sensor responses, the number of stories, and the number of spans in X and Y directions as input data.

•
In order to reduce the bias of the random selection of records and buildings for the training and testing processes, 10 and 200 selections were considered, respectively. An R 2 mean and standard deviation were obtained for each record selection to evaluate the accuracy of the ML model, and the maximum R 2 mean and its standard deviation to obtain the best training buildings.

•
For the first case, the maximum R 2 obtained by the Random Forest method was 0.942, the maximum R 2 mean obtained by the Gradient Boost method was 0.870, and the minimum standard deviation obtained by the Decision Tree method was 0.047. The IM present in all the ML methods was A95.

•
For the second case, the maximum R 2 obtained by the Gradient Boost method was 0.942, the maximum R 2 mean obtained by the Gradient Boost method was 0.902, and the minimum standard deviation obtained by the Linear Regression method was 0.016. The IM present in all the ML methods was R_PGA.

•
The Gradient Boost was considered the most effective ML method in both cases, considering that it has the lowest R 2 _mean.
• Although the second case presents the highest and lowest R 2 _mean and standard deviation, their inclusion was not easily feasible. It is recommended to include them progressively. • It is recommended to increase the number of records in future studies to cover more earthquake features.
Finally, the methodology applied to the RC archetype accurately detected the structural damage condition of the buildings for all ML methods. The Random Forest and Gradient Boosting methods were the most accurate, and the main IMs were those based on acceleration.