1 Introduction

There is already quite much proof of how devastating the tsunami impacted the land of Indonesia, which brought in significant loss of material and human lives. Take one of the recent tsunami events as an example [1], tsunami Palu Dongala (2018) records a total loss of 20.89 trillion rupiahs and 4340 people died. tsunami Palu Dongala (2018) records a total loss of 20.89 trillion rupiahs, and 4340 people died. Moreover, the impact will be worsened because of the stop of the economic growth in the post-disaster.

One of the attempts to reduce the number of tsunami strike victims, Indonesia has developed a Tsunami Early Warning System (TEWS), which started in 2005 [2] (post-Aceh’s tsunami). Recently, predicated on the president’s instruction, article 5 number 93 2019, as part of strengthening disaster mitigation, the Agency for the Assessment and Application of Technology or BPPT Indonesia developed Cable Based Tsunami-meter (CBT) [3]. This system will adopt the SMART concept, Scientific Monitoring, And Reliable Telecommunication, which incorporates a monitoring function of the tsunami, earthquake, climate, ocean condition, and sea level with telecommunication capabilities.

Concerning the threat of the giant tsunami caused by megathrust earthquakes in the Mentawai island area [4], BPPT initiated the deployment of the CBT system in Sipora. The subduction zone of this area has a characteristic of a low water depth of about 80 m, which consider having considerable ambient noise [5, 6]. Multiple occurrences of bottom bounce path in the sound channel and uncertain seafloor properties, including sound speed, density, and attenuation, make continental shelves environment has significant external noise, which muddles up the data measurement retrieved from Bottom Pressure Recorder (BPR). This ambient noise level-dependent feature makes shallow water environments more challenging to analyze and model [5].

Fig. 1
figure 1

General block diagram of designed system

Meanwhile, tides prediction is a time series problem in which the output is the sequence prediction within some margin of error. The traditional modelings are mainly parametric based, such as AutoRegressive (AR) [7], exponential smoothing [8, 9] or structural time series model [10]. However, it has also been found that many of these real-time series modelings seem to follow nonlinear behavior [11] and are insufficient to represent their dynamics [11,12,13]. Therefore, another approach using a different mathematical representation of the nonlinearity present in the data is suggested to overcome this problem [11, 13, 14].

Notably, the emergence of artificial neural networks (ANN) adopting this approach have been widely used for the prediction of various complex system [15,16,17]. They can identify and learn the complicated nonlinear relationship between system variables, showing more accurate results than linear regression techniques [18].

Among these various techniques, recurrent neural network (RNN) can detect a pattern in the data sequence [19]. This ability differentiates from Feedforward Neural Networks, which pass information through the network without cycles. The RNN has cycles and transmits information back into itself, which extends Feedforward Networks to account for previous information. Despite this advantage, RNN suffers from vanishing or exploding gradient in long-term dependency [19]. This problem motivated the introduction of long–short-term memory units (LSTMs) [20] for handling the vanishing gradient problem. LSTM has become popular in time series forecasting [20]. Compared to deep Boltzmann machines, graph-structured recurrent neural networks, and convolutional neural networks, LSTM-NN-based deep learning performs better [21] for time series forecasting. It can extract robust patterns for an input feature space and effectively handle Multiple Input Multiple Output System (MIMO) systems in Deep Neural Networks (DNN). Moreover, the LSTM system can take nonlinear systems due to their specialized LSTM cell that performs better after learning. However, LSTM has some drawbacks related to its complicated unit and more data necessary to learn effectively [22]. Therefore Gated Recurrent Unit is proposed as a simpler hidden unit to compute and implement [22].

Nonetheless, recent research on time forecasting shows unforeseeable CNN [23,24,25] to solve time series problems. However, this problem is still limited to the classification as output, not time sequences which is the output of tides prediction. In addition, the wide range variability of the data set must also be experimented with for a solid model hyperparameter.

Based on all these studies, we select RNN as our model foundation. Some factors that support this are as follows:

  • Tides prediction is a univariate time forecasting problem relevant to the efficacy of RNN [26, 27].

  • The output of tides prediction is temporal-dependent sequence data. RNN is suitable for sequence learning from the features [28, 29].

  • Though for the training phase, RNN still cannot take advantage of parallel computation in GPU [30], RNN can still achieve a closed real-time prediction in the inference time, which is around one second or less, depending on the GPU.

Thus, our work is considered novel since the unavailability of tides prediction model and study in shallow water areas for tsunami prediction purposes. Our contribution will be as follows:

  • Combination of multistage preprocessing and RNN-based deep-neural network on tide data for solving tide prediction modeling in shallow water cases. This model is intended to get a better tide prediction and human interpretation.

  • The suitable tides preprocessing for shallow water cases that can reduce the noise of the tides data and accommodate the neural networks input.

  • Empirical insight of various RNN models, vanilla RNN, LSTM, and GRU, approach on a case of tsunami detection based on tide prediction.

  • Experimentations on defining look-back and forward parameter scenarios on shallow water tides prediction models.

  • Z-score analysis toward variability of the synthetic tsunami triggered by earth magnitude. This analysis evaluates the sensitivity of the current model.

Finally, solving this near-field tsunami forecasting in the coastal area is urgently required to reduce casualties. Indonesia experienced a tsunami caused by coastal volcano eruptions in 2018 [31]. Furthermore, Sumatra island’s coastal region, especially Mentawai island, has considerable potential for megathrust earthquakes and landslides [32]. Therefore, the RNN tides prediction model proposed in this paper can become the required solution to mitigate this problem.

Fig. 2
figure 2

Preprocessing block diagram

Fig. 3
figure 3

Butterworth filter frequency response on 0.01 Hz cutoff frequency

2 Related works

National oceanic and atmospheric administration (NOAA) developed the tsunami detection algorithm under the deep-ocean assessment and reporting of tsunamis (DART) project using cubic polynomial [33]. While in [34], Beltrami tried to find a more efficient alternative tsunami detection algorithm by proposing an artificial neural network (ANN). Both of these algorithms use the data from the bottom pressure recorder (BPR) as a sensor to collect the sea level in the deep sea. Based on the comparison [34], ANN methodology can predict tide and other regular patterns in the wave better than the DART.

Before [34], Barman et al. [35] utilized non-linear regression in ANN to calculate the estimation time arrival (ETA) for predicting the tsunami travel time in the Indian Ocean. The ANN model could perform the rapid computation for ETA. The model proved its robustness in developing a real-time tsunami warning system for the Indian Ocean.

These efficacies of ANN encourage data-driven forecasting tsunami [36]. Romano et al. [36] utilized spatial values of maximum tsunami heights and tsunami arrival times (snapshots) computed through the TUNAMI-N2-NUS model. They achieved good accuracy and near-instantaneous forecasting of the maximum tsunami heights and arrival times for the entire computational domain.

Another variant of ANN is also adapted to estimate tsunami inundation [37]. Fauzi and Mizutani applied two machine learning models, a convolutional neural network and a multilayer perceptron, for real-time tsunami inundation forecasting in the Nankai region of Japan. They experimented using the hypothetical future Nankai megathrust earthquake with Atashika and Owase Bays in Japan as the study cases. The results show that the proposed methods are high-speed (less than 1 s) and comparable with nonlinear forward modeling.

Besides tsunami mitigation, another natural disaster, such as an earthquake, is also predicted using ANN [38,39,40]. In the most recent [41], Kishore et al. used the LSTM to model the sequence of earthquakes. They used the trained model to predict the future trend of earthquakes and compared the LSTM with an ordinary Feed Forward Neural Network (FFNN) solution for the same problem. The result showed that the LSTM neural network was found to outperform the FFNN in the task of modeling the sequence of earthquakes.

Compared to all the previous work, our study regarding tsunami detection in shallow water case is considered a premiere. The challenging part of BPR data in shallow water areas is the muddled ambient noise, which requires signal processing to filter these out from the expected features. Various RNN networks are evaluated, serving as context learners that forecast the upcoming tides. Finally, the z-score will identify the tsunami spikes from the set of predicted tides.

3 Methodology

3.1 General algorithm design

This project defines the primary solution through a block diagram comprising preprocessing, training model architecture, and tsunami identification. Preprocessing sequences involve feature scaling, vector shape matching, and denoising. The training model architecture consists of the RNN stacked model and the dense layer, which map the features into a serial data prediction. Finally, the system will identify the tsunami from the prediction sequence of tides by smoothed z-score methodology, as shown in Fig. 1.

Fig. 4
figure 4

Model network layers design

3.2 Preprocessing

The first part of the section (Fig. 2) is a scaler based on a percentile that will improve distribution data scaling. The process is unaffected by significant marginal outliers, which commonly occur in a noisy data environment. From this section onward, 0–1 normalization is required to match the RNN input layer. Eventually, the processing system applies a low-pass filter to reduce ambient noise. The LPF design parameter follows [42] Oceanographical Engineering Textbook allowing tsunami data to be captured with a frequency less than or equal to 0.01 Hz. The order of the filter is also set to 9 to reduce stopband ripple maximally, as shown in Fig. 3.

On the other hand, based on the general block diagram section (Fig. 1), we can write the system in pseudocode. Before utilizing the function, training data are fitted into the scaler to capture data traits (mean, variance, interquartile range, etc.). This trait can be saved into.bin format and loaded in the function.

Algorithm 1
figure a

Preprocessing

3.3 Model architecture

The target of the design model (Fig. 4) is a vector of future predictions. This mechanism can be achieved by applying a stack of RNNs, followed by a dense layer. A drop-out layer shall be attached to the sequence to reduce overfitting cases.

Some variables define each of the functions. The input x needs to be in three-dimensional size, in which the vector should be reshaped into (\(height \times weight \times 1\)). The \(n\_units\) represents the number of hidden units denoting the number of dimensional output space while the \(n\_samples\) symbolizes the number of data input that becomes the previous data context. Finally, the predicted output is an array with time sequence size mapped using a dense layer.

Fig. 5
figure 5

Computational graph representation of RNN basic form, including training loss computation

Fig. 6
figure 6

General block diagram of A LSTM and B GRU

3.4 Model prediction algorithm

This part (Algorithm 2) defines the basic algorithm to train and test the model prediction. The windowing LSTM with look-back variation value becomes the core of the algorithm. The program’s first segment defines the number of \(look-backs\), the number of predictions and reshapes input x into three-dimensional input (samples, timesteps, features), and y into two-dimensional information. The \(look-back\) parameter is the number of data points in prior timesteps, which become part of this project analysis. Finally, the model predicts the tide, then \(data\_input\) and predictions variables are updated.

Algorithm 2
figure b

Prediction

Fig. 7
figure 7

Component of OBU Sipora

Fig. 8
figure 8

Periodic tide data acquisition

4 Technical background

4.1 Recurrent neural network

In most of the literature, a hidden unit in RNN can be formulated as follows [43]:

$$\begin{aligned} h^{(t)}=f(h^{(t-1)},x^{(t)};\theta ) \end{aligned}$$
(1)

Referring to the (1) equation, h is a hidden unit function, \(x^{(t)}\) is the current input, and \(\theta \) is the parameter of the function f. This equation is recurrent because h at time t refers to the same definition at time \(t-1\). There are several examples of the design pattern of RNN, yet to ease the exposition, we focus on the basic form of recurrent networks, hidden-to-hidden recurrent connection, which refers to Fig. 5 [44]

From Fig. 5, we can see that the idea of RNN is to pass or connect previous information to the present task. This process is beneficial because it needs sequence information to be processed, such as a video frame. However, in this “long-term dependencies” case, Hochreiter [45] and Bengio [46] found some fundamental reasons why it is difficult. Therefore, basic RNNs fail to learn “long-term dependencies”. Nevertheless, the variants of RNN architecture called gated RNNs, including LSTM and Gated Recurrent Units (GRUs), are introduced to tackle this problem. Especially, LSTM, which was introduced by Hochreiter and Schmidhuber [20], has been quite popular nowadays, as many researchers use it because of the efficacy in many different applications [44].

Fig. 9
figure 9

Tsunami caused by an earthquake with the variability of magnitude

Fig. 10
figure 10

Block diagram process of tsunami injection

Fig. 11
figure 11

Training data set

Fig. 12
figure 12

Robust scaler input transformation

Fig. 13
figure 13

Min–max scaler input transformation

Fig. 14
figure 14

Low-pass filter Butterworth output

LSTM introduces a new element called cell state c, which comprises the forget gate (\(f_t\)), input gate (\(u_t\)), and output gate (\(o_t\)). According to its name, forget gate determines whether the previous data is diminished. In contrast, the input gate evaluates the information to be carried over in the sequence, and the output gate decides the next hidden state value from the previous data. We can define each of the gates in the following equation:

$$\begin{aligned} u_{t}= & {} \sigma {(W_{u} h_{t-1}+I_{u} x_{t}+b_{u} )} \end{aligned}$$
(2)
$$\begin{aligned} f_{t}= & {} \sigma {(W_{f} h_{t-1}+I_{f} x_{t}+b_{f} )} \end{aligned}$$
(3)
$$\begin{aligned} o_{t}= & {} \sigma {(W_{o} h_{t-1}+I_{o} x_{t}+b_{o} )} \end{aligned}$$
(4)

Each of the formulae at the time step t, \(W_f\), \(W_u\), \(W_o\), \(I_f\), \(I_u\) and \(I_o\) are weight parameters on the corresponding gate, while variables, \(b_f\), \(b_u\) and \(b_o\), are bias alongside the gate. Thus, the cell candidate (c), current hidden state \((h_t)\), and current cell state \((c_t)\) can be formulated as below:

$$\begin{aligned} \tilde{c}_{t}= & {} \textrm{tanh}(W_{c} h_{t-1}+I_c x_{t}+b_{c}) \end{aligned}$$
(5)
$$\begin{aligned} c_{t}= & {} f_{t} \odot c_{t-1}+u_{t} \odot \tilde{c}_{t} \end{aligned}$$
(6)
$$\begin{aligned} h_{t}= & {} o_{t} \odot \textrm{tanh}(c_{t}). \end{aligned}$$
(7)
$$\begin{aligned} y_{t}= & {} \sigma {(W_{y} h_{t} + b_{y})} \end{aligned}$$
(8)

where variables, \(W_c\) and \(I_c\), represent weight parameters on the cell and variable \(b_c\) is bias alongside the cell.

Fig. 15
figure 15

Data set composition

Fig. 16
figure 16

Model train versus validation loss (from LSTM training process)

Fig. 17
figure 17

Data test

In comparison with LSTM (shown in Fig. 6), GRU replaces the three’s LSTM gates into two gates: the update \(z_t\) and reset \(r_t\) gates. The update gate helps the model control the new state’s number from a copy of the previous state, while the reset gate intuitively controls how much past information to forget. The GRU unit is defined as the set of the equation below:

$$\begin{aligned} z_{t}= & {} \sigma {(W_{z} x_{t}+U_{z}h_{t-1}+b_{z} )} \end{aligned}$$
(9)
$$\begin{aligned} r_{t}= & {} \sigma {(W_{r} x_{t}+U_{r}h_{t-1}+b_{r} )} \end{aligned}$$
(10)
$$\begin{aligned} \tilde{h_{t}}= & {} \textrm{tanh}{(W_{h} x_{t}+(r_{t} \odot h_{t-1})U_{h}+b_{h} )} \end{aligned}$$
(11)
$$\begin{aligned} h_{t}= & {} (1-z_{t}) \odot h_{t-1}+z_{t} \odot \tilde{h} \end{aligned}$$
(12)
$$\begin{aligned} y_{t}= & {} \sigma {(W_{y} h_{t} + b_{y})} \end{aligned}$$
(13)

From empirical insight [47], GRUs overcome LSTM network performance for low complexity sequences and vice versa. This performance [47] corresponds to the size of the learning rate for each complexity rate (low and high) of seed strings. LSTM networks perform better for similar forecasting on higher complexity of seed strings.

Fig. 18
figure 18

Sequence prediction test on tsunami data injected induced by earthquake on mag. 7.8

Fig. 19
figure 19

Error distribution of tides prediction of Vanilla RNN model

4.2 Data acquisition

INA CBT Sipora consists of two sensors on Ocean Bottom Unit (OBU) and an optical cable under the sea (Fig. 7). One sensor is the Bottom Pressure Recorder (BPR), a pressure transducer measuring tide periodically. Three parameters are captured per second, DateTime, water column height, and temperature (Fig. 8).

4.3 Testing data

The testing data preparation consists of modelling shallow water tsunamis using the Tunami-F1 model [48] and injecting the tsunami model into actual capture data. The work of Infrastructure Technology Centers Ports and Coastal Dynamics BPPT Indonesia helped the tides prediction model for tsunami identification by providing shallow water tsunami data tests. They simulate dummy tsunamis generated by an earthquake ranging from 6.4 to 8.2 magnitude (Fig. 9).

After the tsunami-generated by earthquake variabilities are produced, the modeled tsunami is injected into the test data. Some steps are to follow for injecting tsunami data into data tests and real-time captured tide data. The process starts by interpolating the tsunami-generated data by matching the model time sampling. The resulting wave will have zero paddings conforming to the array dimension. Finally, the modeled tsunami superposes test data, which yields injected tsunami waves, as presented in Fig. 10.

Fig. 20
figure 20

Density distribution normalized graph of MSE distribution on L1000-P250

Fig. 21
figure 21

Error distribution of tides prediction of LSTM model

Fig. 22
figure 22

Error distribution of tides prediction of GRU model

Fig. 23
figure 23

Vanilla RNN VS LSTM VS GRU training time for one epoch distribution

4.4 Tsunami identification

Because of the low amount of the actual shallow water tsunami data set (only one was generated), the model cannot be expected to solve the classification problem. Instead, the generated data prediction will use a smoothed z-score to determine the tides as a tsunami or not. Z-score is a standard methodology used in forecasting problems to identify the trend from the prediction. This score indicates how many standard deviations an observation on each i is above or below the mean:

$$\begin{aligned} Z_i=(x_i-\bar{x})/\sigma \end{aligned}$$
(14)

5 Result and analysis

All test procedures are performed through Python 3.8 with Keras, Tensorflow, numpy, pandas, scikit-learn, and matplotlib third-party library. On top of that, these program specifications are supported by GPU Nvidia A6000 as part of the computer platform in Artificial Intelligence Laboratory Kanazawa. After obtaining the results, we performed two analyses to evaluate our designed performances. Those are \(look-back\) prediction and z-score tsunami identification analysis.

5.1 Preprocessing procedural testing

In Fig. 11, the training data set comprises input data, a periodic tidal wave captured continuously every second for 5 days. Later, these data go into two scalers, robust, and minmax scaler. A robust scaler transforms the data input by removing the median and scaling the data according to the interquartile range (IQR) (Fig. 12). The IQR ranges between the 1stquartile and 3rdquartile. This process makes the distribution of data robust to outliers. A \(min{-}max\) scaler is then applied to adjust the value range from 0 to 1, which is required for LSTM input data.

Table 1 Median of MSE distribution for each of model configuration

After that, the Butterworth filter refines the normalized waves to reduce data noise form (shown in Fig. 13). From Fig. 14, data noise is decreased heavily into a smoother appearance.

5.2 Model and validation data set

We sample six daily Sipora tides log data from Sipora OBU and divide them into a 5:1 ratio of a data set for training and testing. This testing data become the basis of dummy data for the superposition of tsunami-generated earthquake variation.

There are 401,696 data points for the training set and validation. These data are split into 0.8 training and 0.2 test data (Fig. 15). Arbitrarily, we choose a configuration from a particular model to represent the “Training loss VS Validation loss” output. The training process uses Mean Squared Error (MSE) as a loss function. It converges with a training loss of \(1.11 \times 10^{-4}\) and a validation loss of \(2.23 \times 10^{-4}\). The difference in these numbers indicates that the model is neither underfitting nor overfitting because of its small margin in the region \(10^{-4}\) (refer to Fig. 16).

This model training is finished with 100 epochs and batch size 256-this process executes 100 units of the RNN stacked model. Adam optimizer is also applied with the learning rate \(1e^{-3}\) and decay rate \(1e^{-5}\) to improve convergence speed.

5.3 Testing data preparation

After we collect the necessary model data, the training model is saved into .h5 format. Then, the model is tested with an external data set referred to as the B section. Before the prediction, the data test embedded tsunami synthetic are prepared by using the explained algorithm in the methodology part, section 5 (Fig. 17).

Fig. 24
figure 24

GRU VS LSTM time prediction

Fig. 25
figure 25

Z-score tsunami spike identification on the data test with magnitude 7.8

Fig. 26
figure 26

Comparison of z-score processed

Fig. 27
figure 27

Tides embedded synthetic tsunami induced by earthquake with a magnitude of 6.4

When all necessary data tests are gathered, the upcoming process will be a prediction. From this prediction, we can compute the error rate for performance evaluation. Moreover, prediction and data input are also plotted to know how well the RNN model filters out the ambient noise (Fig. 18).

5.4 Look-back variation analysis

A set of look-back and prediction parameter configurations is tested. Moreover, to choose the look-back parameter, we need to empirically assess the computer’s capability to execute multiple arrays related to GPU resources. In this experiment, the composition number of look-back and prediction points that can be executed maximally is 1000 nodes of look-back and 1000 predictions. Higher configuration points can raise Out of Memory (OOM) errors caused by insufficient memory. Initially, vanilla RNN networks are implemented to see how classic RNN work in the tide prediction application. In this experiment, as the input data will be continuous tides with temporal dependent, we apply a stateful setting on the RNN networks. Consequently, the network can learn the previous batches. Mini batches are also done for the input to ensure all the sequences are processed.

Table 2 Tsunami tides identification for each model

Vanilla RNN shown in Fig. 19 can achieve a median from MSE score distribution of \(1.14 \times 10^{-4}\) on Look-back 1000 and Prediction 250 configuration. The median of the MSE score distribution is used as a pointer because the mean of the MSE score is skewed as a result of outliers, as shown in Fig. 19. It also can be seen that each ratio L250-P250, L500-P100, and L500-P500 has the same range of \(10^{-4}\) as the most minimum median in the MSE distribution. On the other hand, the other’s ratio shows MSE scores in the range of \(10^{-2}\) and \(10^{-3}\). Besides its performance, from Fig. 19, L1000-P50, L1000-P500, and L1000-P1000 configurations are missing because “NaN” errors occur during prediction. We consider this instability to be caused by vanilla RNN’s insufficient representability for capturing the complexity of the tides.

Surprisingly, according to Fig. 20, LSTM has a similar MSE distribution on our tides prediction with vanilla RNN on the ratio of L1000-P250. However, compared to vanilla RNN, the LSTM model tremendously improved the median MSE score (Fig. 21) by reaching \(7.96 \times 10^{-5}\) on a ratio of L500-P250. On the same ratio, L1000-P250, it also shows improvement to \(8.14 \times 10^{-5}\). Other ratios denote better scores than the vanilla RNN model.

Finally, the GRU model shows the best performance compared to the others. It can pull off the median in the error score distribution to \(7.8 \times 10^{-5}\) on the L1000-P250 configuration (Fig. 22), which is also smaller than the other two models (vanilla RNN and LSTM). Overall performance, GRU exhibits a higher but close error score to the LSTM model (9 configurations higher than the LSTM model (Table 1)). This improvement in error score indicates that the tides prediction problem has a low complexity sequence which, in this case, GRU has better performance and efficiency (Table 1 and Fig. 23).

This efficiency refers to the training and prediction time. As for the context of tides prediction in the tsunami application (Fig. 22), our model should predict as fast as possible to ensure enough time for the information to be conveyed on the shore. Nonetheless, the training time for one epoch depends on the layer type, number of hidden units, network depth, input data dimension, and model hyperparameter. From our experiments, GRU shows remarkable efficiency in training and predicting time. All GRU model configuration accomplishes the training process for under 90 s per epoch (Fig. 23). This result is also directly proportional to the prediction time of one sequence output which set off all the configurations under 0.1 s (Fig. 24). Second best in efficiency, The LSTM model finishes the training process for one epoch up to 302 s and prediction of 0.352 s (Fig. 24). This performance evaluation is relevant to the [47] for less complex sequence problem. The last model, vanilla RNN, is the palest in time performance compared to others. It takes up to 1490 s to finish one epoch training and 1.14 s to predict the sequence of tides. Nevertheless, this performance showcases validation on RNN model comparison, which is relevant to the previous research [19, 22, 44, 47].

5.5 Z-score analysis

Z-score detects significant variations of the spikes from the expected tides. This methodology can work using the means and standard deviation of normal tides. Then, the threshold value is applied to the standard deviation as a margin to the expected tidal wave distribution.

This methodology is tested on the divergence of tsunami synthetic. In this experiment, we empirically set the threshold of 2.7 of standard deviation as it shows the test’s false error. The fluctuation can be identified by “1” as a rising tide and “−1” as a downward spike (Fig. 25).

Our experiment also evaluates the z-score on each model prediction. Table 2 shows the performance of the tides prediction model processed in z-score to identify a surge of tides or tsunami caused by an earthquake of various magnitude. The shallow water tsunami of LSTM and GRU prediction can be completely identified in corresponding to the number of peaks detected in ground truth prediction. Still, vanilla RNN prediction misses two tsunami tides on magnitude 7.4 as shown in Fig. 26.

Furthermore, the z-score methodology cannot identify tsunami spikes in the magnitude 6.4–7 range. This outcome is supported by the fact that the waves embedded in the tsunami on that range are blended exceptionally well; the waveform is hardly noticed. The z-score can determine the number of fluctuations caused by the synthetic tsunami in the other magnitude span. The higher the magnitude cause, the easier z-score can recognize the sudden change of tides. Moreover, it can detect the tsunami’s initial surge on the majority of magnitude except for magnitude 7.2 and 7.4 (only for vanilla RNN), which is vital to know when the tsunami starts (shown in Fig. 27).

6 Conclusion and future works

Applying a time series model to tide prediction problems on shallow water requires multiple mechanisms to identify tsunami spikes. The procedures start from the preliminary operation on the input waves. Two-step features scaling, robust, and min–max scaler are applied to capture the wave’s distribution and adjust to the RNN variant input array requirement. Then, the Butterworth filter with 9 order and 0.01 Hz cutoff frequency work in the sequence to filter out the ambient noise. This process continues to the time series model prediction of RNN and its variation. Finally, the z-score will determine whether these waves are possibly tsunamis.

We find that tides prediction is a low-complexity sequence problem corresponding to the performance evaluation of GRU, which is better than the LSTM model. GRU score lowest MSE median of \(7.8 \times 10^{-5}\) on the L1000-P250 configuration. It also exhibits the best efficiency by accomplishing the training process for under 90 s per epoch and the prediction process for under 0.1 s for all test configurations. Besides, in z-analysis, GRU and LSTM prediction show complete identification of tides. This result indicates that the GRU model suits the tides prediction problem.

Incorporating a z-score in the surge of tides identification is due to the limitation of actual tsunami data in shallow water areas on newly deployed CBT Sipora, in which the model needs sufficient data for classification problems. In the future, incorporating an accelerometer in time series data input and prediction will improve the tides prediction model and cover the lack of capability in determining tsunami spikes caused by lower earthquake magnitude.

In addition, it is also worth mentioning recent developments of a deep transformer model [49,50,51], which has shown state-of-the-art performance in time series forecasting problems. This algorithm introduces the self-attention method, which can overcome the “short-term memory” problem over infinite long sequences [50]. This approach should also be included in the next study to find a better tides prediction model to improve efficiency and accuracy.