# Towards Automatic Landslide-Quake Identification Using a Random Forest Classifier
## 2 Study Materials and Method
### Automatic Classifier Using the Random Forest Algorithm  
#### 2.2.1 Random Forest Algorithm and Training Sample Collection  
Monitoring landslide-induce seismic signals leading to successfully early warnings for their occurrences has many years been a challenge in the scientific community. Random forest algorithm is one of the useful machine learning algorithms to discriminate various kinds of seismicity (e.g., volcanic earthquakes, tectonic earthquake, rockfall, landslide, and artificial noise) [13; 14; 15]. The idea of the random forest algorithm is to build a large collection of de-correlated decision trees and make a majority vote in order to reduce the variance of classification results [16; 17]. An illustration is shown in Figure 3. First, bagging, which means randomly sampling with replacement and outputting the result of a majority vote, was used to generate k training subsets from a known training dataset containing N records, wherein the size of every subset was the same as that of the dataset. By means of bagging, some samples in a subset might be repeated, while some samples might never be selected. It ensured some discrepancy among the training subsets, none of which was identical to the dataset. To produce de-correlated decision trees, only m attributes of a total number of M were chosen randomly without replacement for each involved decision tree (m \(<\) M). Through bagging and random and partial  
Figure 1: Map showing the locations of the BATS stations, landslides and earthquakes that were used to make the machine learning classifier. selection of attributes, every decision tree involved different numbers of attributes, so the automatic classifier was trained by unique subsets to ensure their decorrelation among other trees in the forest. For the random forest algorithm, each decision tree outputted a predicted result, and the majority of all predicted results determined the final result of the classification. A total of 100 decision trees were adopted for the random forest algorithm in the present study. To build an automatic classifier,  
Figure 3: The flowchart of the random forest algorithm. Figure 2: Four seismograms with corresponding time series and spectrogram views of the Xiaolin landslide. the samples in a training dataset should be sufficiently representative of the event to be classified; therefore, we collected documented landslide events in the previous literature and interpreted those seismic signals from 11 seismic stations. The ground motions caused by the landslides may not be observed in all seismic stations. Therefore, the seismic traces for training were carefully collected only if the seismic signals exhibit distinct waveforms and spectrogram features induced by landslides. The seismic traces are excluded if the unique waveform characteristics cannot be observed in the records of the seismic stations. In the end, 214 seismic traces of 33 landslide events were collected for training the class of landslide. Since similarly-sized training samples for different classes can obtain better classification results, 214 seismic traces of 45 earthquake events, documented by the CWB, were chosen from the 11 seismic stations. The magnitudes of the 45 earthquakes ranged from M\({}_{\text{L}}\) 1.4 to 5.1. All used earthquake events are belong to regional earthquakes around or in the Taiwan island. The farthest epicentral distance was 320 km, and the mean epicentral distance was 112 km. Among the 214 seismic traces of earthquakes, only 19 (\(\sim\)9%) were collected from the stations having an epicentral distance of larger than 200 km. In addition, the 214 seismic traces of noise were selected as the training samples. For background noise, we randomly collected the seismic traces without apparent spikes. A sum of 642 seismic records comprised the training dataset with three equally-sized classes, and each seismic record was preprocessed and cut into a 5-min signal. Preprocessing, including removing mean, detrending and removing instrumental response of data, was performed.