# A Seismic Phase Recognition Algorithm Based on Time Convolution Networks
## 2 Data  
### Dataset  
Since the quality of datasets directly affects the results of network training, this study used the Global Seismic Signals Dataset (STEAD) [18], which was provided by the Seismological Laboratory of Stanford University, to ensure that there were sufficient training data and to ensure the generalization of the network structure. Most of the seismic records in this dataset were recorded in the United States and Europe. The STEAD dataset includes two categories of seismic and non-seismic signals, which were recorded using seismic instruments with 2613 receivers (seismographs) worldwide, as shown in Figure 1. These receivers were located at local distances, i.e., within 350 km of the earthquakes. The non-seismic category currently only contains one subcategory (seismic noise), which includes about 100,000 samples. The locations of the instruments that recorded the noise waveforms are shown in Figure 2.  
Figure 1: A distribution map of the seismic instruments (the dark blue triangles show the locations of the seismic instruments that recorded the earthquakes).  
Figure 3 shows the magnitude distribution of the recorded earthquakes. Small earthquakes (less than magnitude 2.5) make up the majority of the dataset. All seismic data have three components: the vertical, east-west and north-south directions. The sampling rate of the data is 100 Hz and the length of the seismic data is 60 s. Each data window contains longitudinal and shear waves, from the longitudinal waves (P waves) that occur 5-10 s before the start of the earthquakes to at least 5 s after the arrival of the shear waves (S waves). Additionally, all waveforms were detrended, de-averaged and band-pass filtered.  
Figure 3: A distribution map of the earthquake magnitudes.  
Figure 2: A distribution map of the stations (the dark blue triangles show the locations of the stations that recorded the seismic noise).  
We selected a total of 100,000 data points from the STEAD dataset. We then processed the data are as follows:  
(1) The waveforms were cut according to the first arrival sampling points of the P waves and the first arrival sampling points of the S waves, which were provided by the data tags. First, they were cut 3-5 s before the arrival of the P waves as the starting points of the waveforms and 10 s after the arrival of the S waves as the end points of the waveforms, then they were cut it into waveform data with a length of 30 s. When the length after cropping was less than 30 s, the data were randomly supplemented with zero values before and after the cropped data. Then, the data were cut from 60 s to 30 s, with a sampling rate of 100 Hz and a segment length of 3000. We filtered the 30 s data to ensure that they contained the arrival points of the P and S waves, which left us with 97132 data points.  
(2) We then evenly distributed the P waves over intervals of 200-600 by performing translation processing on the data. The distributions of the data before and after processing are shown in Figure 4. After processing, a min-max normalization was performed, which left us with 65,000 data points. Then, we randomly scrambled the data.  
(3) Next, we divided the processed dataset to obtain a training set with 52,000 data points, a validation set with 6500 data points and a testing set with 6500 data points (8:1:1).  
(4) Since the network output length was 371 when one-hot processing was performed on the labels, the labels were processed as one-hot labels with a length of 371. The labeling positions comprised 40 time steps before and after the manual labeling, with a one-hot label length of 11. The original data and the labeled data that corresponded to the labels are shown in Figure 5.  
Figure 4: The data distributions before and after data processing (the gray bars show the data distribution before processing and the blue bars show the data distribution after processing).