Reconstruction of Tide Gauge Time Series in the Gulf of Guinea Using LSTM Neural Networks with Application to an External Reference Station ()
1. Introduction
Coastal environments are among the most vulnerable on the planet because of the different forcings they face [1]. These are generally highly populated areas, continually facing threats such as: sea level rise, erosion, extreme storms in addition to anthropogenic influences [2]. Indeed, climate warming due, among other things, to the increase in greenhouse gases in the ozone layer leads to the melting of glaciers and the expansion of the ocean, responsible for 85% of the rise in the sea level [3]. In recent literature, researchers have estimated that this elevation will vary from 52 cm to 98 cm by 2100 [4]-[6], which is a real threat to the survival of coastal cities and certain island territories. Understanding sea level change is critical for various coastal activities, particularly in navigation and naval engineering. More importantly, it can be used to develop effective planning strategies for creating sustainable future coastal development and thus mitigating the consequences of divers related threats [7]. Longterm continuous and reliable time series of sea level is needed to simulate geophysical fluid dynamics processes [8]. For example, 60-years of tidal records is needed to estimate current eustatic variations and filter the cyclical and irregular contributions of the tide gauge signal [9]. To fully understand and predict future sea level changes, extending the current records with old observations is crucial [10]. However, a common problem with sea level observations is the presence of gaps caused by the malfunction of measuring devices or by the removal of outliers that can be produced by some unusual meteorological conditions. These problems hamper studies and practical applications of most numerical models and statistical methods (e.g. spectral analysis, calibration algorithms, stochastic modeling and downscaling) which perform poorly due to missing values [8]. Gouriou [11] raised the lack of long tide gauge series in the southern hemisphere, in this case the GoG. Regarding the African continent, few long series are available and the quality of these data is not always satisfactory [12]. However, there are at least 7 stations in Africa for which there are more than 40 years of measurements available at PSMSL. In particular, in the GoG, Cameroon and Senegal have old maregraphic time series which have already been the subject of studies [12]-[14]. Time series from classic tide charts are supplemented by data from digital tide gauges installed for several years in these different locations. However, gaps of varying length are found in these data which do not allow their exploitation or could lead to imprecise results.
To deal with this problem of missing data in time series, different approaches have been used in the past [15]-[17], such as removing rows embedding gaps or outliers, and replacing them with zeros, or calculating missing values using the mean or median of rows, as well as data interpolation methods, such as Lagrange interpolation [18], Hermite piecewise cubic interpolation, spline interpolation, maximum frequency method and principal component extraction method [19]. As Janbain [20] sums it up well, interpolation methods are very accurate for filling a small number of consecutive missing data, but the longer the filling sequence, the more the quality of the reconstructions degrades [21]. Thus, to deal with missing data over long periods, other categories based on statistical analysis such as autoregressive integrated moving average (ARIMA) and deep learning algorithms were preferred. The ARIMA approach is based on a regression technique in which missing data are recovered from the available data, which are used in an adjustment process to determine a set of terms belonging to a linear relationship linking the current values of the variable to previous values [22]. However, these linear regression tools fail in long-term reconstructions, where multiple nonlinear processes are involved in signal fluctuations over time and cannot be captured by a simple linear formulation [20].
An Artificial Neural Networks (ANN) approach in particular, are widely used today for wave height reconstruction and prediction, namely feed-forward neural networks (FFNN) [23]-[26]. In the Managing crop water Saving with Enterprise Services (MOSES) project [27], time series of spatial wave climate data from the Norderney littoral zone were reconstructed using FFNN for the period 1962-2002. [28] [29], predicted ocean wave height with a radial basis function (RBF) called Ainimum Resource Allocation Network (MRAN), while Stefanakos [30] used the adaptive network-based fuzzy inference system (ANFIS). Or for sequential data, Recurrent Neural Networks (RNN), ANNs with feedback connections to neurons from previous time steps [31], are suitable and are still used for wave height prediction [32]. The LSTM neural network is a specific RNN (Long Short-Term Memory) and was designed by Hochreiter and Schmidhuber [33] to handle long-term dependencies in addition to their ability to capture non-linear dependencies. Besides using voice recognition and handwriting [34], machine translation [35], image captioning [36] and stock price prediction [37], LSTMs are already used for time series reconstruction and forecasting in various scientific related fields such as wind speed forecasting [38], forecasting sea surface temperature [39], forecasting solar irradiation [40] and weather forecasts [41]. The first experiments that were done with LSTM neural networks for the reconstruction and prediction of near-shore wave heights with data from the Norderney coastal area were very promising [25]. More particularly in the field of reconstruction of tidal water levels, Jorges [25] worked on forecasting and reconstructing ocean wave heights based on bathymetric data using LSTM neural networks with resulting correlation about 0.948, Lee et al. [42] also worked on the imputation of missing data in the time series of tidal water levels with the Root Mean Square Error (RMSE) of its results between 0.5 and 1.1 cm on average and more recently the work of Imad [20] [43] who reconstructed the missing data from the water level time series of the Seine River with an RMSE of 0.14 m.
This study is focused on the reconstruction of water levels from tide gauges in the Gulf of Guinea using the LSTM type recurrent neural networks based on the self-learning strategy as described by Imad [20]. His main contributions concern:
1) Development of an LSTM-based reconstruction framework for tide gauge data.
2) Evaluation of three data structuring strategies for different gap sizes.
3) Performance analysis based on gap duration.
4) Hybrid interpolation and deep learning approach.
5) Validation using harmonic tidal analysis.
6) Application to the Gulf of Guinea, a data-scarce region.
These contributions provide both methodological and practical insights for the reconstruction of geophysical time series affected by missing data.
The rest of our article is presented as follows: a data and methods section which presents the data and methods used in this study, a results section and finally a discussion and conclusion section.
2. Study Area & Data
The primary focus of this study is on tide gauge stations located in the Gulf of Guinea. However, an additional station located in Dakar (Senegal) is included as an external reference site. This station is not part of the Gulf of Guinea but is used to assess the robustness and generalization capability of the proposed LSTM model under different tidal and environmental conditions. Figure 1 presents the positions of the tide gauges in the study areas (Dakar, Senegal), Wouri Estuary (Cameroon) and Pointe-Noire (Congo). The agreement between the University of Douala and the Port Authority of Douala allowed to obtain water heights records in the estuary from float tide gauges for data between 1999 and 2004, and from digital tide gauges, for the most recent data (2018-2022). Data from Dakar and Pointe-Noire stations have been uploaded freely to the platform UHSLC database (University of Hawaii Sea level Centre; https://uhslc.soest.hawaii.edu/), as described by [44]. Table 1 shows a statistical description of these data, with the percentages of missing data. Because these water height time series are disrupted by short and long data gaps, appearing randomly at different times. The variation in water levels recorded in the Wouri estuary (Cameroon) is influenced by the flow rates of the upstream rivers (Wouri, Dibamba and Moungo), in addition to tidal oscillations reaching approximately 4 m in the estuary and other meteorological factors, as documented in previous studies [45] [46].
Table 1. Location of reference tide gauge stations and global statics of time series of water heights available by station.
Study area |
Station |
Source |
SL Mean [m] |
SL Std. [m] |
#Data |
LOCATION |
% Missing Data |
LONG |
LAT |
Cameroun |
Wouri |
PAD |
1.71 |
0.58 |
277982 |
9.458E |
3.794 |
42.77 |
Sénégal |
Dakar |
PMSL |
1.06 |
0.37 |
177130 |
−17.42 |
14.6766 |
19.87 |
Congo |
Pointe-Noire |
PMSL |
1.16 |
0.41 |
48837 |
11.833 |
−04.783 |
12.02 |
Figure 1. Location of tide gauge stations (blue triangles) on the Gulf of Guinea.
3. Methodology
The concept of using deep learning algorithms to do digital modeling comes from adapting the way the human nervous system processes large amounts of information with connected and parallel neural (biological) networks [47]. Establishing a link with an artificial neural network is done from multiple sequential calculations of linear and non-linear formulations taking into account several terms called weights and biases which are defined on each neuron of the layers of the network, without rely directly on knowledge or physical processes [48]. The calibration of these parameters (weights and biases) is carried out in the training phase using a large database using an optimization process in which the difference between the real and digital output is minimized. Once the learning phase is complete, networks can be applied to manage data not used in the learning operation. In the literature, several neural-network-based approaches have been developed and tested for time-series processing, including ANN, Adaptive Fuzzy Neural Networks (AFNN), and ARIMA-ANN hybrid models [49]-[51]. ANN is one of the most popular architectures in which the link between variables is established with a large number of weights used to extract features from the input data without considering temporal dependencies in this process [52]. The RNN network (which has similarities to the ANN network), however, was designed to manage the temporal dependencies of the data via a structure of recurring modules which serve as a memory to store important information from previous processing steps [53]. Such an approach can impact the quality of predictions and increase calculation time. The RNN network (which has similarities to the ANN network), however, was designed to manage the temporal dependencies of the data via a structure of recurring modules which serve as a memory to store important information from previous processing steps [53]. Unlike simple feed-forward neural networks, ANNs have a feedback loop that gives the neural network the ability to work from a sequence of inputs. However, during the training phase, the network may have difficulty handling long-term dependencies, resulting in the disappearance of the gradient used in the backpropagation process to determine the optimal weight values [54]. To avoid this problem, LSTM was introduced by Hochreiter and Schmidhuber [33] as an improved version of the RNN, with the use of three gates designed to control the flow of data; in other words, the gates select the data which will be taken into account or not in the learning.
1) The first door is the
entry door, which contains the inputs at the current time.
2) Then there is the forget gate
, which decides whether or not to forget the information retrieved from the last cell.
3) And at the end, the output gate
produces the new state of the cell at output.
The structure of LSTM units is shown in Figure 2. The mathematical formulations of the gates along with the input, hidden state and output values are described in the equations below:
(1)
where
is the sigmoid activation function, tanh is the hyperbolic function, W denotes the weights between neurons and b represents the bias term. The last terms, W and b, will be determined during the backpropagation process when matching the training data using the Adaptive Momentum Estimation (ADAM) optimizer [55].
Figure 2. LSTM block, where ft, it, ot are forget, input, and output gates respectively [56].
3.1. Missing Data Imputation Method
Before you can fill in the missing values, you must first identify their position in the processed series. That can be achieved using the NumPy library in Python [57]. Then, a moving window-based function is used to fill in these indices one by one. Starting with the index of the first missing value and continuing to the end, this loop function takes data windows of a specific size called Look-Back (LB), before each index as input for the model to predict the next missing values. The predicted value is added to the original data and can be used in future data entry windows, especially when there are many consecutive missing data points. Then the window advances one step so that it can be used as a basis for predicting the next missing value clue, if any.
One of the difficulties lies in the choice of the window size (LB) which will allow all the complexity of the series to be captured. This size depends not only on the phenomenon studied, but also on the size and distribution of the missing values in the series. The choice of a small LB increases the calculation time and decreases the precision of the imputed values as the size of the missing consecutive data increases, at the same time before choosing a large LB it is necessary to be reassured that it exists enough samples of this size without missing values to sufficiently train the model [20]. The search for the solution to the problem of precision even on data missing for several months, as well as optimization of the calculation time led Imad and [20] three scenarios for structuring model training data:
1) Scenario 1: which is described as basic or traditional. With this approach, hourly data with a Look-Back defined based on the size of the missing consecutive data in each station is sent into the model. We vary LB is varied to optimize the precision. The Look-Back can vary from one hour to several months or even years. The result and the consequences of this strategy are discussed in Section 3. But one can already say that this strategy poses problems of error accumulation with consecutive missing data of long duration and is also computationally intensive;
2) Scenario 2: This approach attempts to solve the problems of error accumulation and calculation time by introducing the concept of mini-Look-Back (mLB) in addition to the LB. Here, each series of size LB is restructured into sub-series (Si) of size mLB. The Si are seen as new variables. Figure S1 in Appendix shows the division of the series following this approach. This strategy optimizes scenario 1 but introduces large errors after a period of sudden measurement variation;
3) Scenario 3: This methodology is based on daily data, i.e., a new series made up of values measured at the same time of day over the entire period of the series. For a year we will therefore have, 365 values which will be used to train the model and the trained model will be used to fill in the missing values in all hours of the day of the entire series (see Figure 3).
It should be noted that all of these approaches can be used with good precision depending on the size of gaps in the time series and this is what is will done in this study. Depending on the distribution of gaps, one will combine several approaches on the same station.
3.2. Data Preprocessing
The data used in this work come from various sources and at different acquisition steps (see Table 1). Prior to model development, all tide gauge records were harmonized to ensure temporal and vertical consistency across datasets. The original measurements were acquired from different instruments and periods, with sampling intervals ranging from 10 minutes to 1 hour depending on the station and acquisition system. All-time series were resampled to a uniform hourly resolution using linear interpolation, which provides a balance between temporal resolution and data completeness.
To ensure vertical consistency, all records were referenced to a common tidal datum. When necessary, datum adjustments were applied based on available metadata and benchmark information. Particular attention was given to the Wouri estuary dataset (where the original data was sampled at 10-minute intervals), which consists of measurements from multiple instruments deployed over different periods. For this station, consistency checks were performed to identify potential discontinuities between successive records.
Offset detection was conducted by analyzing overlapping periods, when available, or by comparing statistical properties (mean sea level and variance) before and after instrument changes. Detected offsets were corrected by applying constant adjustments to align the time series segments. Visual inspection and statistical validation were performed to confirm the continuity and physical consistency of the corrected records. A first treatment consisted of standardizing the sampling intervals at one hour for all stations.
It has been noted above that there are many models that can be used to reconstruct missing data. The choice of the appropriate model, as well as its effectiveness, depends on the nature, availability and complexity of the data, as well as the size of the missing data. In the present case, the gaps range from one hour to several months in addition to being randomly distributed in the series (see Figure 3). It therefore appears that traditional/classical models such as interpolation cannot provide reliable results, especially when the missing period is long. However, they can be used to fill in missing data over short periods of a few hours to prepare enough chronicles to perform LSTM network training in a second step to fill in missing data over longer time periods which are more difficult. In order to select the appropriate method to fill in missing data points while retaining data trends and shape, we set a threshold for the size of missing data to choose between interpolation methods and LSTM. This threshold is set at six hours, based on the natural periodic components of tidal signals, which include both long and short periods [20]. When the duration of missing data is less than half of the tidal period, the trends and shape of the data do not show a significant change. It was therefore possible to use linear interpolation to fill them. However, for longer durations, exceeding six hours, the LSTM model is necessary to capture complex temporal dependencies and fill gaps accurately
After interpolation, the next step is to normalize our data between −1 and 1 since the convergence function of the DNN (Deep Neural Network) model uses the hyperbolic tangent function, which makes it easier to train the model [58]. This normalization is done according to the equation:
(2)
where
and
are respectively the maximum and minimum values of the time series.
Figure 3. State of the time series of the tide gauge stations of Pointe-Noire, Wouri Estuary and Dakar (from top to bottom) that need to be reconstructed.
3.3. Description of the LSTM Model
The implementation and characteristics of the data filling model developed in this work is described in the following paragraphs. The using programming environment is Python version 3.7.9 with the following packages: TensorFlow version 2.4.1, Kéras version 2.4.0, Scikit-learn| version 0.23.2.
3.3.1. Implementation
The model of a neural network carried out in this work was established with several LSTM units in which many parameters must be specified and optimized before the training phase, such as the number of layers L, the number of neurons N (=LSTM units), batch size, dropout fraction and learning rate.
3.3.2. Preparing Model Training Data
To be able to feed the LSTM model, the time series must be restructured in the form of supervised learning. Thus, a function following the concept of a moving window was implemented with a loop allowing the data to be restructured in the form of two matrices
. Only pairs
not containing missing values are kept. Hence the importance of interpolation to fill gaps less than 6 hours in order to maximize the number of valid pairs
for training and testing the model.
All preprocessing steps were designed to prevent data leakage. In particular, normalization was performed using parameters (mean and standard deviation) computed exclusively from the training dataset. These parameters were then applied unchanged to the validation and test sets. Once the series is transformed into supervised learning, it is divided it into three groups where:
1) 60% of the data is used for training the model; i.e., to optimize the parameters of the model;
2) 20% for validation in order to evaluate the generalization capacity of the model to data that it does not know et also diagnose overfitting problems;
3) The remaining 20% is used as test data to evaluate the relevance of the trained model.
The loss function L used in the model is the mean square error (MSE) with a regularization term L2:
(3)
where n is the number of data,
the predicted value, y the measured value and
the adjustable regularization parameter for the 2-norm
of the weight matrices W. L2 regularization was used to reduce overfitting in the models [59] [60].
The quality of the model is measured during the training phase by calculating the root mean square error (RMSE) and the mean absolute percentage error (MAPE), which are common statistical methods, used to compare the deviation of the value actual versus predicted value in order to evaluate the predicted performance of DNNs. They are described by the following equations:
(4)
(5)
where
is the actual observed data,
the predicted data and N the number of samples.
To compare the performance of the model in different stations, the relative RMSE metric is used defined as follows:
(6)
where
and
are respectively the maximum and minimum of the values of the time series and the RMSE is the error presented in equation (4). Relative error is used because Ω can vary from station to station. An RMSE value of 0.5 m for example, in a time series which extends from 1 to 10 m does not have the same interpretation as in another station where the range is 4 to 9 m. So, using a relative error in each time series, such as a percentage measurement, provides a better understanding of model performance.
The coefficient of multiple determination (R2) whose equation is presented below is also used to compare the degree of variance of the predicted values. It can take negative values and its maximum value (corresponding to perfect predictions) is 1.
. (7)
To evaluate the robustness of the proposed model, synthetic gaps were introduced into the observed time series. A total of 30 - 100 gap injections were performed for each gap duration scenario. The gap lengths were selected to represent short-, medium-, and long-duration missing data conditions.
The temporal locations of the synthetic gaps were randomly selected within the evaluation period, following a uniform distribution, while ensuring that injected gaps did not overlap and remained within the bounds of the available data. This approach allows for testing the model under diverse conditions representative of real-world data loss.
To ensure statistical reliability, the experiment was repeated over 5 - 10 independent trials with different random gap positions. The reported performance metrics (RMSE, MAPE, and R2) correspond to the average values across all trials. In addition, the standard deviation was computed to assess the variability of the model performance.
3.3.3. Tuning Model Hyperparameters
In order to find the best hyperparameters of the proposed model, a Bayesian hyperparameter optimization was performed on the training dataset [61] [62]. The number of LSTM layers, the number of LSTM nodes in each layer, the activation function, the mini-batch size b, the learning rate α, the learning rate decay α, the dropout rate between LSTM layers and the regularization parameter λ were adjusted. Bayesian optimization manages the LSTM model as a random black box function on the hyperparameters, which is expensive to evaluate. Therefore, the algorithm estimates the best hyperparameters with minimal target function evaluations [63]. Beforehand, a Gaussian process is built on the target functions and the best hyperparameters are selected according to their likelihood. Table 2 presents the result of the Bayesian optimization for the present model.
3.4. Justification of the Choice of Scenarios and Quality of the Reconstructed Series
3.4.1. Choice of Scenarios
As explained in section 2.3, the scenarios rely on those of Janbian [20] for this reconstruction. Although the advantages and disadvantages of each scenario are well described in Janbian [20] this has the advantage of assessing for each approach the continuous size of maximum gaps that could be filled with the metrics that go with it. For this, a reference station with more than one continuous year without missing data was chosen. The training of the model is done without this part of data which will serve as a test. Then continuous and increasingly larger gaps were created and each time after imputation of data by the model, the RMSE, the MAPE and the R2 were computed to assess the maximum size of continuous missing data can be filled by each strategy and with what precision.
3.4.2. Evaluation of the Quality of the Reconstructed Series
Here, it is evaluated whether the reconstructed series still remains sufficiently reliable or even better for studies of characterization of the tide of the station or for the evaluation of sea level for example. To do this, the script T_Tide developed by [64] is used to extract the harmonic components of the original series and the reconstructed one. The principle of the analysis is that given a place and a time t, the height of the tide can be expressed by the following formula:
(8)
where
represents the average level,
the amplitude of wave i,
: pulsation of wave i,
: Phase of the wave i [65].
This part is ended by calculating the complex errors between the 10 most significant constituents of the reconstructed tide and the unreconstructed one. Knowing that these account for more than 80% of tidal energy. This error is obtained by the formula
(9)
is the complex difference defined in [66] by the equation:
(10)
4. Results
Based on the above-described LSTM model as well as the three scenarios for structuring the input data, the results of the training, validation and testing of the neural network with their performance metrics are presented. Secondly, the best configuration of the model will be applied to the imputation of missing data from the tide gauge series. And finally, the quality of the reconstructed tidal time series is evaluated by comparing the results of the forecast and harmonic analysis from reconstructed and non-reconstructed water heights to values found in the literature. The final scenario is chosen for each series based on the size and distribution of gaps in the series. Given the size of the gaps present in the series even up to years (Figure 3), all approaches will be used and sometimes combined for the same station.
The data is restructured according to the strategy. In the case of the first scenario, as explained in Section 2.3, a function is implemented to analyze the series with look-back window (LB) defined at one week. For Scenario 2, the concept of Mini-Look-Back (mLB) is introduced, allowing each Look-Back (LB) sequence to be partitioned into several shorter Mini-Look-Back sequences while preserving the same target output. Each pair (LB, mLB) is then provided as input to the LSTM model. The corresponding input reshaping procedure is illustrated in Figure S1. Each pair (LB, mLB) is thus sent to the LSTM model. In this application of this approach, the LB is chosen such that it is equal to or greater than the size of the longest missing data series in the timeline and the mLB at a fixed size of one week (24 × 7 = 168). As for the third approach used for gaps of more than three months, the diagram in Figure 4 describes its organization quite clearly.
![]()
Figure 4. The diagram shows the data re-sampling methodology. First, the original hourly data is divided into 24 daily time series, each at a specific hour of the day. Then, instead of performing the model learning process as well as hyper-parameters tuning on the original hourly data, the model in this method uses only one daily time series of them. the optimal model obtained is able to fill the missing parts in a time series with the daily step. Then one used this model to fill in each of the daily time series separately. Finally, the fill-in daily data is combined at the end according to the chronology modified [20].
4.1. Model Validation
Once the input data is ready, the hyperparameters of the model are defined so that it properly adjusts the weights and biases of the LSTM cells, an iteration (epoch) of 500 is defined with a patience of 10. Table 2 and Table 3 below respectively presents the parameters and hyperparameters of the LSTM model. It should be noted that with the exception of the input data, the same configurations will be used for all stations.
Table 2. layers and training parameters of the LSTM model.
Layer (type) |
Output Shape |
Param |
Lstm_8 (LSTM) |
(168, 100) |
59600 |
Dropout_8 (Dropout) |
(168, 100) |
0 |
Lstm_9 (LSTM) |
(100) |
80400 |
Dropout_9 (LSTM) |
(100) |
0 |
Dense_3 (dense) |
(1) |
101 |
Total param: 140,101 Trainable params: 140,101 Non-trainable params:0 |
Table 3. Result of hyperparameters from model adjustment.
Huperparameter |
Search interval |
Final Value |
Hyperparameter |
Search interval |
Final value |
#Number of layers |
[1, 5] |
2 |
Loss function |
|
Mean Squared error (MSE) |
#Number of Unit |
[1, 250] |
128 |
Early-stopping |
|
Monitor: Validation loss, Minimum delta: 0,001, Patience: 100 |
Batch size |
[1, 1024] |
512 |
|
|
Optimizer |
Adam |
Adam |
|
|
Leaming rate tion |
[1e−4, 1e−2] |
1e−4 |
Dropout rate between |
[0, 05] |
0.2 |
Activation function |
{relu, sigmoid, tanh} |
sigmoid, tanh |
Epoch |
[50, 250] |
500 |
Once the model is implemented and parameterized, its training and validation are initiated to first evaluate its ability to predict water levels. The Pointe-Noire station (Congo) only contains short-term gaps (less than a month) distributed throughout the series with a missing data rate of 12%. It has served as the reference for the application of scenario 1. The measurements of the SM2 station (Wouri Cameroon) are the most affected with nearly 43% of missing data of varying duration. The measurements from this station can be divided into two parts with a gap of almost a year in the middle (between 2020 and 2022). Scenario 1 will also be applied to fill short-term gaps.
Figure 5. Visual division of the data set between training data (60%) in blue, validation data (20%) in green and test data (20%) in yellow.
The Pointe-Noire and Wouri series (resampled into hourly data) are interpolated and prepared as described in Section 2.6.2 into training, validation and test data (see Figure 5), are sent to the model with a one-week LB. Figure 6 allows you to visualize the evolution curve of the loss function. One can see in Figure 7, the good correlation that there is between the measurements and the predictions of the training and test water levels for the Pointe-Noire station.
Figure 6. evolution curves of the loss function during training (Blue) and validation (red) with the best reached after 120 iterations.
The best model resulting from training is then tested. Figure 7 shows the result of the tests with the performance metrics (Summary in Table 4) which makes it possible to confirm through prediction the adequacy of the model to the data.
Table 4. The recap of performance of training and testing of forecasting by the LSTM model applied to short-term missing data size series (One month Maximum) from scenario 1.
Station |
Training |
Test |
RMSE [m] |
rRMSE (%) |
MAPE (%) |
R2 |
RMSE [m] |
rRMSE (%) |
MAPE (%) |
R2 |
Pointe-Noire |
0.03 |
1.14 |
2.06 |
0.99 |
0.03 |
1.34 |
2.98 |
0.99 |
SM2 (Wouri) |
0.03 |
1.12 |
1.61 |
1 |
0.09 |
3.03 |
4.44 |
0.98 |
Figure 7. Results of the adequacy of the prediction with the measured data with a high level of precision achieved and a low MSE for training and testing.
Model training was also done with the scenario 2 strategy on data from the Dakar station, with the aim of filling gaps of more than a month. Scenario 3 was applied to the Wouri and Dakar stations for gaps of more than six months. This strategy consists first of decomposing the series into daily hourly data, see Figure 8.
Figure 8. Breakdown into daily hourly data over the series (SM2 at the top) and over one year (the one below).
Figure 9. From top to bottom, the first image represents the evolution curve of the MSE during the training and validation phase of the Wouri station; and the one below the model test result after training the Dakar station for scenario 3 applies at 11 p.m.
Figure 9 illustrates the evolution of the mean squared error (MSE) during the training and validation phases of the LSTM model, as well as an example of the prediction results obtained for the Dakar station using Scenario 3 at 11:00 PM.
After this decomposition, the authors choose one hour per day for training the model. The objective is to reduce the accumulation of errors in scenarios 1 and 2 on long-term gaps and also reduce calculation times for training and imputation. one can see in Figure 10 that a good correlation is obtained.
It is shown that the model well reproduces data with few uncertainties at the extrema.
It is noted that given the disparity of missing data in the series, one had to combine approaches to fill the gaps while keeping the trends and seasonality of the series. Table 5 presents the summary of the result’s strategy 3 used by station Dakar and Estuary Woury.
Table 5. Results of performance of training and testing of forecasting by the LSTM model applied to short-term missing data size series (One month Maximum) from scenario 3.
Station |
Training |
Test |
RMSE [m] |
rRMSE (%) |
MAPE (%) |
R2 |
RMSE [m] |
rRMSE (%) |
MAPE (%) |
R2 |
SM2 (Wouri) |
0.12 |
4.95 |
7.09 |
0.94 |
0.12 |
4.97 |
9.36 |
0.91 |
Dakar |
0.04 |
2.36 |
2.79 |
0.99 |
0.05 |
3.38 |
2.67 |
0.98 |
4.2. Behavior of the Model on New Data
To be able to study this behavior, one year of continuous data without gaps was removed from the initial measurements and was not integrated into the training and testing of the model. To better understand the comparison of results between the approaches we chose a station to serve as a reference for this section. Our choice fell on the Pointe-Noire station for the quality of this chronological series. Indeed, in addition to having the year 2013 complete towards the end of the series (see Figure 10), its gaps range from one hour to less than a year unlike the other two stations (Wouri Estuary and Dakar) which practically have the series divided into several parts with continuous gaps over several years.
The methodology consists of evaluating the performance metrics, namely RMSE, R2, and MAPE, over increasingly large continuous gaps in order to determine the conditions under which each reconstruction approach should be used, as shown in Table 6. It appears that:
Scenario 1 is suitable for short-term gaps with a multiple determination coefficient which remains significant up to gaps of 84 days and an RMSE of 0.15 m.
Scenario 2 and 3 with our conditions can be used for gaps of up to one year with an RMSE of 0.14 and 0.15 m respectively. But the values of the coefficient of multiple determination rather suggest using scenario 2 for gaps of longer duration.
It should be noted that the result of this investigation depends on the quality and quantity of the model training data as well as the torque values (LB, mLB). Globally, this approach has the advantage, depending on the quality of each series, to let know which strategy is best to fill in its missing data. Depending on the desired precision, which in general will depend on what the reconstructed series will be used for, this approach is preferred to another or even make combinations.
Figure 10. Time series for the year 2013 Pointe-Noire used to evaluate the behavior of the model.
Table 6. Summary of metrics for evaluating the behavior of the model in relation to the size of the gaps at the Pointe-Noire station.
Continuous Gap Size (days) |
Scenarios |
RMSE (m) |
MAPE (%) |
R2 |
24 |
1 |
0.01 |
0.02 |
1 |
72 |
1 |
0.02 |
0.12 |
1 |
2 |
0.02 |
0.13 |
1 |
168 |
1 |
0.03 |
0.39 |
0.99 |
2 |
0.02 |
0.21 |
1 |
672 |
1 |
0.07 |
1.08 |
0.97 |
2 |
0.05 |
1.26 |
0.98 |
3 |
0.02 |
0.38 |
1 |
1344 |
1 |
0.1 |
2.93 |
0.93 |
2 |
0.06 |
1.14 |
0.98 |
2016 |
1 |
0.15 |
5.24 |
0.86 |
2 |
0.05 |
2.1 |
0.98 |
2688 |
1 |
0.23 |
17.5 |
0.64 |
2 |
0.05 |
3.17 |
0.99 |
3 |
0.1 |
2.99 |
0.95 |
4032 |
2 |
0.06 |
3.17 |
0.98 |
3 |
0.12 |
4.69 |
0.91 |
5376 |
2 |
0.08 |
5.87 |
0.96 |
3 |
0.15 |
5.45 |
0.85 |
6720 |
2 |
0.1 |
6 |
0.94 |
3 |
0.15 |
5.45 |
0.85 |
4.3. Application to Missing Data
The LSTM model validated in the previous step for the reconstruction of tidal time series can now be used to fill real gaps. This phase start by reconstructing gaps of different sizes, in order to analyze the behavior of the model. The model predicts one water level at a time. The imputation is done by a loop which allows the prediction to be repeated n times (n being the number of missing values in the series). Figures 11-13 show some results by scenarios 1,3 respectively.
Figure 11. Focus on the first 2 months with gaps filled by the strategy one of the Pointe-Noire station (Congo).
Figure 12. Result of the imputation of the 23 PM after daily breakdown decomposition of the Wouri station.
Scenario 1 was also used at the Wouri station to fill small gaps and then scenario 3 was used for longer gaps at the station. that was also applied to Dakar. Figure 12 and Figure 13 below show the result of a daily breakdown.
LSTM neural networks are quite successful in reconstructing water level variations, when the right approach to structuring the input data is found. Figure 14 shows the three stations after imputation of missing data. Table 7 also sums up the strategies used for each station.
Table 7. Summary of the different scenarios used for the imputation of each station.
Station |
Period |
Scenario |
LB |
mLB |
Pointe-Noire |
The whole series |
1 |
Week |
- |
Wouri Estuary |
2018-2020 and from 2022 |
1 |
Week |
- |
2020-2022 |
3 |
3 Month |
1 Week |
Dakar |
The whole series |
3 |
1 Year |
1 Week |
Figure 13. Another example of scenario 3 applies to the Dakar station with at the top the 7AM series of the entire station and at the bottom the same series with filled gaps.
Figure 14. Final results of the tide gauge series reconstructed from the high to the low respectively present, Dakar (Senegal), Wouri (Cameron) and Pointe-Noire (Congo).
The training of the model is more or less long depending on the choice of the size of LB and mLB.
4.4. Evaluation of the Series Reconstructed by Harmonic Analysis
This section aims to make sure that the reconstructed tide gauge series still has enough information for the study of the tidal phenomenon. The analysis of Pointe-Noire reference station is carried out. This series, which had nearly 12% missing data, was reconstructed based on scenario 1. Figure 15 shows the result of harmonic decomposition of all series after reconstruction. To do this, harmonic decomposition was carried out as presented in section 2.6.2 using T_Tide which succeeded in extracting 71 harmonics components with a confidence interval of 95%. Figure 15 shows the components of different classes. It is found that the majority of the components which characterize the tide in the Gulf of Guinea with a dominance of the semi-diurnal waves M2 and the long-term components (Sa, SSa, MF, etc.) and even the M10 wave signifying the proximity of the tide gauge station with the coast (shallow environment) is one of the significant components.
Finally, Figure 16, presents the comparison of the amplitudes of 10 main harmonic components of the reconstructed and non-reconstructed series with the complex error associated with each of the waves. The maximum error is 5cm for the M2 wave at the Pointe-Noire Station.
Figure 15. Harmonic constituents of the reconstructed Pointe-Noire(a), Estuary Wouri(b) and Dakar(c) series grouped by class with the most significant in blue and the least significant in red.
Figure 16. From top to bottom, (a) is the amplitude of the unfilled harmonic constituents, and (b) is the amplitude of the reconstructed series, and (c) is the complex error.
5. Discussion
In this study, artificial intelligence is used, more precisely recurrent neural networks based on the LSTM model, to fill gaps that arise for different reasons in time series of tide measurements, relying on the scenarios for restructuring the input data of the model proposed by Janbain [20]. To achieve this, an LSTM model was implemented and configured with the hyperparameters as presented in Tables 2-3. The choice of the LSTM model here is guided by the type of data handled and the phenomenon studied. The model implements in its cell, a state and a forgetting gate, among other things, allowing it to understand the historical and temporal links between the data. The other reason for choosing this model is the non-linearity of the tidal phenomenon which, in addition to gravitation, is influenced by bathymetric and meteorological variabilities. In order to prevent overfitting, two dropout layers were inserted and a stop function implemented to interrupt training once the best model was found. It should be noted that we are doing univariate modelling, with water height measurements being the only input parameters of the model. The other parameters which influence the variation of the measurements are not available for all the stations. It should also be noted that self-learning is done in this study. That is to say, each series to be filled is used to train the model. To justify the choice of scenarios used to fill the gaps, an experiment consisting of creating gaps continues to become larger and larger in a series without gaps and then use the trained model to fill them and calculate the resulting performance metrics, the results of which are in Table 6 made it possible to classify the use of scenarios according to the size of the gaps and to see that several years could be filled with scenarios 2 and 3 with fairly good precision but with a preference for scenario 3 which allows enormous savings in calculation time. Indeed, taking 0.14 m of RMSE as a reference found by Janbain [20] as a reference, we have an RMSE of 0.15 (m) with 2016 hours of continuous gaps with scenario 1, 0.14 m with almost a continuous year of gaps with scenario 2. And unfortunately, the test series is not long enough, the experience of scenario 3 is biased. Basically, it is the approach which allows to capture the long trends in the series, to solve the problems of error accumulation and to minimize the calculation time.
The previous experience made it possible to justify the choice of approaches for restructuring the input data of the model used for each series according to the size of the gaps, as summarized in Table 7. The trained models are first tested on their prediction capacity and the values of the performance metrics average 0.97 for R2, an RMSE of 0.06m and the absolute percentage error (MAPE) around 4% shows the model does a good job reproducing the data. These results are in agreement with other studies of imputation of missing data in tide gauge series with recurrent models, such as those of [25] [26] [58] [67].
In order to validate the quality of the reconstructed series, a harmonic analysis of each series was successfully carried out (Figures 15(a)-(c)). The amplitudes of tide components found here using the harmonic decomposition of the reconstructed series are in agreement with past publications in the area. In particular, at the Wouri estuary where the dominant group of waves are the semi-diurnal waves with the M2 wave peaking at 74 cm, and also at Ponte-noire and Dakar where the harmonic characteristics obtained are in agreement with those generally obtained in the Gulf of Guinea [12] [14]. Conversely, the decomposition of the unreconstructed series gives values that are further from the literature (Figure 16(b)). To evaluate the difference, the complex error best suited waves whose values fluctuate a lot [14] [66] was used (Figure 16(c)). The complex error calculation makes it possible to evaluate the error between the two-time series of 7 cm maximum at the level of the N2 wave and 5 cm for the dominant wave M2. The reconstructed water heights are nevertheless underestimated, that may be due to the fact that the variation in water height is influenced by several other parameters.
Despite the promising results, some limitations of the proposed univariate framework should be acknowledged. Since the model relies solely on past values of the sea level signal, its ability to accurately reconstruct variations driven by external forcings may be limited. In particular, abrupt changes associated with river discharge events or strong meteorological conditions (atmospheric pressure variations, wind forcing, or storm surges) may not be fully captured without additional explanatory variables. This limitation of univariate data-driven approaches has been highlighted in previous studies, which emphasize the importance of incorporating exogenous variables in sea level modelling [68] [69]. Furthermore, the reconstruction of long gaps may introduce increased uncertainty, especially near local extrema, where small phase or amplitude errors can lead to larger deviations. This is a well-known issue in tidal analysis, where accurate phase representation is critical for preserving harmonic structure [70]. Future work should therefore consider multivariate models incorporating relevant environmental parameters, such as atmospheric pressure, river discharge, and wind forcing, to improve the representation of non-tidal components and enhance reconstruction accuracy under highly dynamic conditions, as also recommended in recent studies on data-driven oceanographic modelling [71] [72].
6. Conclusions
This study proposed a Long Short-Term Memory (LSTM)-based framework for reconstructing missing data in tide gauge time series from the Gulf of Guinea. The results demonstrate that the model achieves accurate reconstruction of gaps of varying durations, including long gaps spanning several months, with strong performance (RMSE ≈ 0.05 m, MAPE < 5%, R2 ≈ 0.96). Validation using harmonic analysis confirms that the reconstructed series preserve the underlying tidal dynamics.
However, the reconstruction of all components contributing to sea level variability remains a challenge. Future work should therefore consider incorporating additional environmental variables, such as atmospheric pressure and precipitation, within a multivariate modelling framework to further improve performance.
Overall, the results indicate that deep learning approaches, and LSTM in particular, constitute a promising alternative to traditional gap-filling methods, although further comparisons with other techniques would be necessary to fully assess their relative performance.
Data Availability
The corresponding author guarantees the availability of the data used to carry out this study.
Acknowledgements
This work was carried out in the following institutions: The Advanced School of Mines Processing and Energy Resources of the University Bertoua, Cameroon and the National Higher Polytechnic School of Douala, University of Douala, Cameroon. The authors would like to thank the editors and reviewers who undoubtedly helped to improve the quality of this work.
Appendix
Figure S1. The diagram shows the input re-shaping method, where the same input sequence xi of size Look-Back described in the past scenario is now divided into multiple sets of sequences each with size Mini-Look-Back while yi remains the same. Note that it is necessary to pay attention when choosing the size of LB and mLB in that one should select two numbers that can be divided evenly: one can choose, for example, LB = 1 year and mLB = 2 months because they can divide to obtain 6 complete Mini-Look-Back sequences of size 2 months each. But no one cannot choose, for example, LB = 1 year and mLB = 9 months because that would result in one complete sequence of size 9 months and another incomplete sequence (Janbian et al., 2023) [20].
NOTES
*Corresponding author.