# Research on Seismic Phase Recognition Method Based on Bi-LSTM Network
## 2 Design of Automatic Seismic Phase Recognition Model Based on Bi-LSTM Network  
In this paper, the Bi-LSTM network is used as the main frame structure of the network, and an automatic seismic phase recognition model based on the Bi-LSTM network is designed.  
The Bi-LSTM model is a bidirectional long short-term memory network model that combines forward and backward LSTM networks to capture long-term dependencies in sequential data. The design concept of the Bi-LSTM model is to enable the feature data obtained at time t to have both past and future information, thereby improving the efficiency and performance of feature extraction. This model performs feature extraction by inputting the input sequence into two independent LSTM models in both forward and reverse order, and then concatenating the two output vectors to form the final vector representation. This design enables Bi-LSTM to perform well in processing sequence data with bidirectional dependencies. Therefore, the Bi-LSTM network is an improved structure of the recurrent neural network, which can learn based on the time series characteristics of data, reduce the misdetection rate of seismic phase recognition through continuous training, and improve the accuracy of model recognition.  
The structure of the automatic seismic phase recognition model based on the Bi-LSTM network is shown in Figure 1. The input data are the original seismic waveform data. After the phase recognition model based on the Bi-LSTM network, the phase feature in the input data can be learned, and the output is the signal label corresponding to the seismic waveform, where the P-wave's signal label is set to 1, the S-wave is set to 2, and other parts are 0.  
Figure 1: Structure of automatic phase recognition model based on Bi-LSTM network.  
In Figure 1, the middle part is the main part of the automatic seismic phase recognition model based on the Bi-LSTM network, which is composed of two LSTM layers with the same size and opposite direction, a forward LSTM layer, and a backward LSTM layer, where the number of hidden layers is set to 2 and the number of hidden nodes is set to 100. The forward LSTM layer can learn the history information of the seismic phase feature in the waveform, and the backward LSTM layer can learn the future information of the seismic phase feature in the seismic waveform from the opposite direction, which combines the history information with the future information to achieve better learning of the waveform's temporal feature. The Bi-LSTM network is composed of two LSTM layers with the same structure and different weight parameters. The layer with the input forward sequence is called the forward LSTM, and the layer obtains an output sequence \(h_{a}\), while the backward LSTM layer inputs the same input in the reverse order to another LSTM network, and then obtains an output sequence \(h_{b}\). Finally, the output of the Bi-LSTM network is calculated by adding the two sequences, as shown in Equation (1).  
\[H=h_{a}\oplus h_{b} \tag{1}\]  
Bi-LSTM can simultaneously learn the forward history information and backward future information in the sequence. The input sequence is divided into two directions and input into the model, respectively, and the information of the two directions is saved by using two hidden layers and input into the same output layer, respectively. The two hidden layers have the same structure, except for the direction of the input sequence. Therefore, the data feature finally learned by the network contains temporal information in forward and backward directions, the time correlation of the seismic waveform data is better utilized, the temporal relationship between the phase feature is established, P and S wave phases of the seismic signals are further accurately recognized, and the seismic phase automatic recognition with high precision and low misdetection rate is realized.