# Early Earthquake Detection Using Batch Normalization Graph Convolutional Neural Network (BNGCNN)
## 3 Methods
Convolutional operation is defined as:  
\[y_{i}^{l+1}(j)=k_{i}^{l}*M^{l}(j)+b_{i}^{l} \tag{2}\]  
Figure 1: The proposed methodology consists of three components. First, data downloading and preprocessing. Second, CNN part to examine the data to extract the feature map. Third, use extracted future map and combine it with station location information to make a final prediction. where \(y_{i}^{l+1}(j)\) denotes the input of the \(j\)th neuron in the feature map \(i\) of layer \(l+1\). \(k_{i}^{l}\) the weights of the \(i\)th filter kernel in layer \(l\), \(M^{j}\) the \(j\)th local region in the layer \(l\) and \(b_{i}^{l}\) the bias. After each convolutional layer, an activation function is employed to extract the nonlinear features. The rectified linear unit (ReLU) is a typical activation function used for this purpose and can be defined as:  
\[\text{ReLU}(x)=max(0,x) \tag{3}\]  
where \(x\) is the output of the convolutional layer. It is a piecewise linear function that returns a value of zero if the input is negative and if the input is positive, it will be output directly. \[Tanh(x)=\frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}=\frac{2}{1+e^{-2x}}-1\in(-1\ to\ 1) \tag{4}\]  
where \(e\) is Euler's constant. The advantage of this activation function is that it can return negative values which are useful if the desired output distribution contains negative values. If the value of the input is greater (more positive), then the value of the output will be closer to \(1.0\). On the other hand, if the value of the input is smaller (more negative), then the output will be closer to \(-1.0\). Batch normalization is added before the activation function. ReLU introduced nonlinearity followed by a spatial dropout of 15%. Data are reduced by 1 \(\times\) 4 max-pooling with stride 1 after passing three convolutional layers. The last convolutional layer does not use any activation function. To preserve the extracted features, in the last layer of the final  
Figure 2: The proposed architecture of the batch normalization graph convolutional neural network. 3-channel data are fed into the model. Features are extracted by CNN and batch normalization is applied before pooling operation. Location information is added to the feature vector and the GNN part makes the final prediction. block, we use tanh activation function not followed by a dropout. The final max-pooling layer reduced the data from Ns \(\times\) 32 \(\times\) 64 to Ns \(\times\) 1 \(\times\) 64. Ns denotes the total number of stations. For each station from Ns, it produces a feature vector of size 64. This feature vector is then appended by spatial information (longitude, latitude) and yields a feature vector Ns \(\times\) 2 \(\times\) 66. The second component of the BNGCNN is a multi-layer perceptron that recombines spatial information with time-series features. It has two hidden layers 128 neurons and ReLU activation function, and spatial dropout. It produces the data of Ns \(\times\) 1 \(\times\) 128 size and represents the collection of features of each node in the graph. This node feature vector is aggregated with the graph feature vector by performing max reduce operation along the station's dimension. The final component is MLP with two hidden layers of 128 neurons. After activation using tanh, this component maps the graph feature vector into the model output of size 4 (depth, magnitude, latitude, longitude). The predicted output is mapped with the labels scaled between \(-\)1 and 1 through a mean absolute error (MAE) loss function. The loss can be expressed as the mean of the absolute differences between the actual values and those that were predicted, or it can be written as a formula as follows:  
\[L(y,\hat{y})=\frac{1}{N}\sum_{i-0}^{N}\lvert y-\hat{y}\rvert \tag{5}\]  
where \(\hat{y}\) is the predicted value by the model, and \(y\) is the actual value in the data. We used an Adam optimizer with initial learning rate 0.0001. All the components are directly connected and trained as a single model.