## 3 Earthquake Prediction Models
### The Deep Neural Network Model  
In this study, we designed and implemented a deep learning model with a multi-level structure, aiming to fully capture the temporal information and local features in the earthquake signal data. The model integrates the characteristics of long short-term memory (LSTM), 1D convolutional neural networks (1D-CNN), and 2D convolutional neural networks (2D-CNN). These structures collaborate with each other, jointly processing the input earthquake signal data to extract the temporal and local spatial features. The LSTM layer is responsible for processing the input time-series data. It effectively captures the long-term dependencies in the sequence data through memory cells and gate units. Following this, the one-dimensional convolutional neural network (1D-CNN) slides the convolutional kernels along the time dimension, enabling the detection of local features at different time scales. As the kernels slide across the entire sequence, this parameter sharing characteristic enhances the model's efficiency, reducing the number of trainable parameters. Subsequently, the data are input into a two-dimensional convolutional layer. While typically used for processing image data, in this model, we introduced the two-dimensional convolutional layer by appropriately transforming the data shape. By utilizing kernels of various sizes, the 2D-CNN can capture features across different ranges. Smaller kernels capture local features, whereas larger kernels can detect features over broader ranges. Finally, the model outputs three prediction results: time to failure (TTF), time since failure (TSF), and a binary classification result. This multi-level, multi-structure deep learning model design enables us to fully explore the potential information in the earthquake signal data, providing a more accurate and reliable basis for earthquake prediction. Here are some details for each layer:  
* Input Layer. The input of the model is a tensor with the shape of (1, \(N\)), where \(N\) represents the feature dimension of the earthquake signal data. We introduced the mel spectrogram in Section 2.2 of the article, and here \(N=30\). * Batch Normalization Layer. In the second layer of the model, we employed a batch normalization layer to normalize the input data. Batch normalization is a technique that improves the training performance of neural networks. It can accelerate mode convergence, enhance training stability, and reduce the sensitivity of the model to the initialization of weights. The basic idea of batch normalization is to standardize each feature on each mini-batch of data so that the mean of the data is 0 and the variance is 1. Specifically, by calculating the mean \(\mu_{B}\) and variance \(\sigma^{2}\)\({}_{B}\) of the mini-batch, we can perform centering and standardization on the input data \(X_{i}\), obtaining the normalized data. Subsequently, the normalized data are scaled and shifted using the learnable scale factor \(\gamma\) and shift factor \(\beta\) to obtain the final output result \(Y_{i}\). This process helps to improve the training performance and stability of neural networks and reduce the reliance on parameter initialization. Batch normalization applies the following transformation to each feature \(i\) of the input data. Compute the mean of the mini-batch: \[\mu_{B}=\frac{1}{m}\sum_{i=1}^{m}X_{i}\] (1) where \(m\) is the number of samples in the mini-batch, and \(X_{i}\) is the \(i\)-th sample. Calculate the variance of the mini-batch: \[\sigma_{B}^{2}=\frac{1}{m}\sum_{i=1}^{m}(X_{i}-\mu_{B})^{2}\] (2) Normalize each feature: \[\hat{X}_{i}=\frac{X_{i}-\mu_{B}}{\sqrt{\sigma^{2}\)\({}_{B}+\epsilon}}\] (3) where \(\epsilon\) is a small positive number to prevent division by zero. Perform scaling and shifting operations:  
\[Y_{i}=\gamma^{\star}\hat{X}_{i}+\beta \tag{4}\]  
where \(\gamma\) and \(\beta\) are learnable parameters that represent the scaling factor and shifting factor, respectively.