1. Introduction
Tidal variations profoundly impact coastal ecosystems, marine resource development, and climate change research. Tidal field forecasting is a core topic in marine and coastal hydrodynamics, with significant implications for disaster prevention, ecological protection, and port operations in coastal areas. However, tidal changes are influenced by numerous factors, and the nonlinear characteristics and topographic effects in coastal regions complicate predictions. Traditional monitoring methods, constrained by the limited number of tidal stations and high maintenance costs, cannot provide comprehensive tidal variation information. The early harmonic analysis method relied on a large amount of historical observational data, which limited its application in dynamic or data-scarce environments. Wavelet analysis, as an improved method, allows for local time–frequency analysis and uses adaptive basis functions to capture the transient features of tidal signals. However, its effectiveness depends on the selection of the wavelet basis function and scale parameters, which may not be widely applicable. In semi-enclosed bays, the complex coastline geometry, strong tidal interactions, and local meteorological effects further complicate the application of harmonic and wavelet analysis. With the advancement of computational capabilities, numerical simulation methods have become an important tool for tidal field prediction. These methods simulate tidal processes through fluid dynamics equations, making them adaptable to complex environments such as semi-enclosed bays or estuaries. However, they come with high computational costs and require accurate input data, as input biases may affect the reliability of the results.
Machine learning enables computers to learn from data and make predictions through algorithms. Deep learning, a subfield of machine learning, automatically extracts features through multi-layer neural networks, making it particularly suited for complex tasks. The advancement of machine learning technologies, especially the widespread application of deep learning models, offers new solutions for tidal field forecasting.
To verify the applicability of deep learning in tidal field prediction, this study applies deep learning techniques to predict the tidal field of a semi-enclosed bay, using Qinzhou Bay as a case study. Tidal variations significantly affect the hydrological conditions, coastal erosion, and fishery resources of semi-enclosed bays. Accurate tidal field predictions provide essential references for marine resource development, fishery management, and port navigation. Furthermore, the complex tidal, oceanic circulation, and topographic characteristics of semi-enclosed bays introduce significant uncertainty and complexity in the prediction of tidal fields across spatial and temporal scales. This study, therefore, serves as an ideal testing platform for deep learning models, validating their effectiveness and advantages in addressing nonlinearity and the complexity of spatiotemporal problems.
Tidal level forecasting traditionally relied on tidal prediction theories that considered gravitational influences. Isaac Newton first proposed the theory of equilibrium tides in
Principia (1687), based on the law of universal gravitation. Darwin [
1] later advanced this theory in 1892 by applying harmonic analysis of tidal forces to estimate tidal behavior in coastal regions with relatively simple seabed topography. In 1957, Doodson [
2] expanded this work using the least squares method combined with extensive tidal observation data to estimate more complex tidal phenomena in shallow water areas. These methods have provided effective predictive tools for tidal behavior in shallow waters. However, they require large amounts of historical observational data and exhibit limited adaptability to complex seabed topography and nonlinear tidal phenomena.
With the development of computational capabilities, numerical simulation methods have been increasingly applied to tidal level forecasting. Guan et al. [
3] proposed an instantaneous tide correction (ITC) algorithm for areas with insufficient tide gauges, combining the MIKE21 model to simulate astronomical tides and reduce errors. Georg et al. [
4] developed and validated a two-dimensional finite element model for the Venice Lagoon, effectively simulating tidal wave propagation. Gallien et al. [
5] employed a two-dimensional hydraulic inundation model to more accurately predict tidal flooding impacts on streets and land plots. Feng [
6] used numerical models to study the spatial variability effects of sea level rise (SLR) on tides in the coastal areas of Jiangsu and the Yellow Sea shelf. Researchers like Kim [
7], Marsooli [
8], and Kong [
9] used coupled models to analyze the effects of tides on storm surges and waves, while Hsiao et al. [
10,
11] investigated typhoon effects on storm wave heights along Taiwan’s northeastern coast. Similarly, Anwa et al. [
12] applied SEAWAT-2005 and PHT3D models to simulate how tides and waves impact nutrient distribution in coastal aquifers. Yang [
13] and Hu [
14] studied typhoon effects on wave–current interactions in the Zhoushan Islands, with Zhang et al. [
15] developing a three-dimensional ice–ocean coupled model to explore the influence of sea ice on astronomical tides in the Bohai Sea. Wang [
16] and Liu [
17] examined K1 internal tide reflections in the northern South China Sea and the seasonal variations of M2 internal tides in the Yellow Sea. These studies demonstrate that compared to harmonic analysis methods, numerical simulations offer better adaptability to complex geographical and meteorological conditions, improving both prediction accuracy and application range. However, numerical simulations are computationally intensive, particularly for large-scale, long-duration simulations, necessitating improvements in prediction accuracy and computational efficiency.
The advent of artificial intelligence technologies has led to the application of machine learning models for tide level prediction. Liang et al. [
18] developed neural network models such as the Differential Neural Network (DNN) and Weather Data-Based Neural Network model (WDNN), achieving effective tide level predictions. Similarly, Riazi [
19] proposed deep neural networks, while Deo et al. [
20] used a network-based approach to replace empirical correction factors. Other studies include BPNN-based short-term data predictions by Lee [
21], LightGBM and CNN-BiGRU combined models by Su et al. [
22], and harmonic analysis combined with NARX neural network models by Wu et al. [
23]. Chang et al. [
24] applied tidal force-based neural networks, and Vicens-Miquel et al. [
25] utilized deep learning models. More recently, Zhang et al. [
26] proposed graph convolutional recurrent networks, and Salim et al. [
27] applied ANN models, all achieving significant progress in prediction accuracy and computational efficiency. Machine learning has also been effective in ocean wave prediction, as demonstrated by Granata et al. [
28] and Sadeghifar et al. [
29], who explored the efficiency of M5P regression trees and random forests. Despite these advancements, traditional machine learning models struggle to address long-term dependencies and fail to capture complex interdependencies in long time series data.
The LSTM (Long Short-Term Memory) algorithm, with its unique gating mechanism, effectively captures long-term dependencies, solving the vanishing gradient problem in traditional neural networks. Recent applications of LSTM in ocean wave and tide level prediction include nearshore wave height reconstructions by Jörges et al. [
30], Seq2Seq network integration by Pirhooshyaran et al. [
31], polar wave height predictions by Ni et al. [
32], and short-term tide level forecasts by Bai et al. [
33]. These studies highlight LSTM’s potential but also its limitations, particularly its focus on single-point tide level prediction. Addressing spatial integrity and prediction efficiency for tidal fields with spatiotemporal characteristics remains challenging, especially in semi-enclosed bays.
This study introduces an LSTM-based model for rapid tidal field forecasting, leveraging high-precision tidal datasets from Delft3D numerical simulations. The model is compared with other machine learning algorithms, such as Transformer, Random Forest, and KNN regression models, to verify its advantages in tidal field prediction.
To the best of the authors’ knowledge, this is the first study to apply the LSTM model to the rapid prediction of tidal fields in semi-enclosed bays. The proposed method quickly and accurately predicts tidal fields based on boundary tidal data from global ocean models, effectively addressing the spatiotemporal complexities of tidal variations while enhancing prediction accuracy and efficiency. This approach provides a novel solution for tidal simulation and ocean hydrodynamic studies, offering valuable technical support for marine environmental monitoring and coastal disaster prevention.
2. Methodology
2.1. Overall Research Approach
The overall research approach of this study is designed to predict the tide level field in a semi-closed marine bay using the LSTM model. As depicted in
Figure 1, the process begins with the use of a validated numerical model, Delft3D, to perform numerical simulations of Qinzhou Bay, which generates accurate tide data for comparison. The obtained data are then preprocessed to form a comprehensive dataset. This dataset is divided into three sets: training, validation, and testing. The training set is used for training the model, the validation set is employed for hyperparameter tuning, and the test set serves to evaluate the model’s generalization ability. An LSTM model is developed for tide level prediction. The input to the model consists of tide data from four boundary points over the past 6 h, which are extracted from a global ocean model. The model aims to predict the changes in tide levels across the entire region for the next 1 h. During the optimization phase, hyperparameters of the LSTM model are adjusted, and regularization techniques are introduced to enhance the prediction accuracy. To evaluate the model’s performance, error analysis is conducted using metrics such as the coefficient of determination (R
2) and root mean square error (RMSE). These metrics help identify the sources of error and guide adjustments to the model, ensuring its performance reaches an optimal level.
2.2. Study Area and Data Sources
2.2.1. Study Area
The study area, shown in
Figure 2, is Qinzhou Bay, located in the southeastern part of Qinzhou City, Guangxi Zhuang Autonomous Region, China. It lies to the north of the Beibu Gulf and is a typical bay-type marine area. This region serves as a crucial port and marine economic development zone for Guangxi, with significant economic, environmental, and shipping importance. Qinzhou Bay is rich in marine resources, featuring a winding coastline, extensive shoals and mudflats, and shallow waters, making it a typical tide-affected area. The tides in Qinzhou Bay are semi-diurnal, with a large tidal range, where the tidal difference can reach 2 to 3 m, particularly during the spring and autumn neap tides, when tidal fluctuations are most pronounced. These tidal effects play a significant role in influencing the hydrological processes, sediment transport, and marine ecosystems in the bay area. Tidal currents, especially at the bay’s entrance, are intense, creating a typical tidal hydrodynamic environment.
2.2.2. Data Sources
The coastline data are sourced from the GSHHG dataset provided by the National Centers for Environmental Information, which was first processed and compiled in 1996 by geographers Wessel and Smith [
34]. The topographic data are obtained from the ETOPO Global Relief Model, also provided by the National Centers for Environmental Information. For this study, the ETOPO 2022 (Bedrock; 60 arcseconds) dataset is selected. The observed tidal level station data are obtained from the China National Shipping Service Network. The boundary conditions are derived from the water level time series at the open boundaries, based on the tidal harmonic constants from the global tidal model EOT20. EOT20, developed by the German Geodetic Research Institute at the Technical University of Munich (DGFI-TUM), is based on residual tidal analysis of multi-mission satellite altimetry data, providing the amplitudes and phases of 17 tidal constituents with a resolution of 0.125 degrees [
35].
2.3. Physical Representation
The hydrodynamics in a semi-closed bay can be described using the following hydrodynamic governing equations [
36]:
In the equation, u and v represent the flow velocities in the ξ and η directions, respectively; Q denotes the flow rate change due to drainage or precipitation per unit area; d is the depth below the reference plane, ζ represents the free surface elevation above the reference plane, and d + ζ is the total water depth; t represents time.
- (2)
Momentum Equation
The momentum equation in the
ξ-direction is as follows:
The momentum equation in the
η-direction is as follows:
In the equations, f is the Coriolis force parameter, w represents the flow velocity in the vertical direction; σ is the scaled vertical coordinate; ρ0 is the water density; Pξ and Pη represent the hydrostatic pressure gradients in the ξ and η directions, respectively; Fξ and Fη represent the effects of horizontal Reynolds stresses in the ξ and η directions, respectively; Mξ and Mη represent the momentum influences in the ξ and η directions due to external factors, respectively; νv is the vertical eddy viscosity coefficient.
This study uses a two-dimensional hydrodynamic model for simulation, setting both the horizontal vortex viscosity and horizontal vortex diffusion coefficient to 1 m2/s to effectively capture the turbulent effects and material diffusion processes in the water flow. In the transport equation, the R = HU form is used to describe the transport characteristics of the water flow, and the Perot q(uio-u) fast convection scheme is selected for convection type to handle nonuniform convection and turbulent regions, ensuring accurate simulation of rapidly changing flow velocity environments. The boundary smoothing time is set to 3600 s to smooth fluctuations near the boundaries, ensuring the stability of the simulation results. Additionally, the model adopts the Villemonte fixed weir scheme with a weir contraction coefficient of 1, accurately simulating the contraction effect of the weir flow.
2.4. Data Processing
Due to the limited number of observation stations and the fact that observed data are primarily site-specific, it is challenging for single-point observational data to capture the spatial and temporal variability of the study area. Numerical simulations are used to generate high-resolution tidal data over a larger area, which helps compensate for gaps in both spatial and temporal data coverage. This approach allows for the construction of a comprehensive dataset, thereby improving the prediction accuracy and generalization ability of the deep learning model. However, the accuracy and reliability of numerical simulations directly affect the quality of the generated data, which in turn impacts the performance of the LSTM model. Numerical models require high-quality input data, such as precise topographic data and tidal boundary conditions. Errors in the input data can propagate through the simulation. In addition, the choice of numerical model, grid resolution, and parameterization schemes can also influence the simulation results, leading to biases in the generated dataset. To ensure that the simulated data closely represent real-world tidal dynamics, multiple validation and calibration steps are necessary. The numerical model was calibrated using observational data from the Qisha, Paotai Jiao, Fangchenggang, and Bailongwei stations, adjusting the model parameters to minimize the discrepancy between simulated and observed values. Validation was performed by comparing the simulated tidal data with the tidal data from observation stations, and the model’s performance was assessed using metrics such as root mean square error (RMSE) and correlation coefficients.
In this study, the Delft3D model is used to simulate the tidal processes in Qinzhou Bay. The model domain spans 21°29′ N to 21°55′ N and 108°12′ E to 108°57′ E, covering the coastal and nearshore waters of Qinzhou Bay. The model employs an unstructured grid for discretization, consisting of approximately 90,279 grid cells; the overall grid is shown in
Figure 2. Local grid refinement is applied in nearshore areas within the simulation domain to enhance the accuracy of tidal simulations. The minimum grid resolution is approximately 100 m, which effectively captures the spatial variation of tidal dynamics while maintaining a balance between computational efficiency and simulation accuracy. The model time step is set to 5 min.
The model boundary conditions are based on the harmonic constants of the eight major tidal constituents (M2, S2, N2, K2, K1, O1, P1, and Q1), which provide water level time series data at the boundaries. These time series reflect water level changes at different time points and are used as boundary conditions in the numerical model to drive the hydrodynamic processes within the simulation domain.
The primary output of the simulation is the tidal time series data, reflecting the spatial and temporal variation of tidal levels at different points within Qinzhou Bay. Specifically, tidal data from four boundary points will be used as input features for the deep learning model. Additionally, the simulation will provide detailed tidal data at various locations across Qinzhou Bay, capturing the temporal evolution of tidal levels throughout the region. The tidal data will be normalized and divided into three parts: 60% for model training, 20% for testing, and the remaining 20% for validation. This division ensures that the model’s generalization ability and prediction accuracy are properly assessed.
2.5. LSTM Method
LSTM is an extension of recurrent neural networks (RNNs) designed to address the gradient vanishing and gradient explosion problems that traditional RNNs face when handling long sequences. LSTM controls the flow of information through three gating mechanisms: the input gate, forget gate, and output gate. These gates enable the model to capture long-term dependencies in time series data, making it ideal for applications like tidal level prediction.
In this study, the LSTM model uses a two-layer LSTM network for tidal level prediction, which allows it to capture long-term dependencies in time series data. As shown in
Figure 3, the first LSTM layer consists of 200 units and uses the tanh activation function. This layer outputs values for each time step, providing sequence information for the subsequent LSTM layer. The second LSTM layer contains 150 units and outputs only the result from the last time step of the sequence. This output is then passed to a fully connected layer for further processing. To reduce overfitting, an 80% Dropout layer is added after each LSTM layer. The output layer uses a Dense fully connected layer with dimensions matching the target data, and a LeakyReLU activation function to accelerate the training process. The model is trained using the Adam optimizer and the mean squared error (MSE) loss function, which minimizes the error between the predicted and actual tidal level data. This architecture effectively learns the temporal features of the tidal level data through the LSTM layers, while the Dropout layers enhance the model’s generalization ability, enabling it to make accurate predictions of future tidal level changes.
2.6. Reference Methods
2.6.1. Transformer
In this study, the Transformer model architecture utilizes the self-attention mechanism and feed-forward networks to process time series data. The multi-head attention mechanism is employed to capture long-range dependencies within the sequence, while residual connections improve the stability and training performance of the model. The basic structure of the Transformer is defined by the transformer_encoder function, which includes the self-attention layer, feed-forward neural network layer, and residual connections. The self-attention layer is implemented using MultiHeadAttention, with each attention head having a size of 64, and the number of attention heads set to 4. The output of the attention layer is processed through Dropout and LayerNormalization, which are then added back to the input through a residual connection. The feed-forward neural network consists of two Conv1D convolutional layers used to map features and restore the output dimensions. The result is again normalized using LayerNormalization and added to the input via a residual connection. In the build_model function, multiple Transformer encoder blocks are stacked together, and the predictions are output through a multi-layer feed-forward network (MLP). The MLP consists of Dense layers and Dropout layers, with the final layer’s output dimension matching the target dataset’s dimension. The model is compiled using the Adam optimizer and the mean squared error (MSE) loss function, which minimizes the error between the predicted and actual results.
2.6.2. Random Forest Regressor
The Random Forest regressor model performs regression prediction by integrating multiple decision trees. The model is initialized with 100 decision trees. During training, the model fits the normalized training data, constructing multiple trees through bootstrap sampling and random feature selection. This helps reduce overfitting and improves the model’s generalization ability. The Random Forest model aggregates the predictions from all decision trees to generate the final output.
2.6.3. K-Nearest Neighbors Regressor
The K-Nearest Neighbors regressor (KNN) model performs regression prediction by calculating the distances between samples. For each prediction, the model identifies the k most similar samples in the feature space and predicts the output based on the labels of these neighboring samples. In this study, the number of neighbors k is set to 5, meaning the model considers the 5 nearest neighbors during each prediction. By selecting an appropriate distance metric, the KNN model calculates the average label value of the nearest neighbors in the training set, which serves as the final prediction result.
4. Discussion
This study explores the application of LSTM networks for tide level prediction, a task traditionally approached using numerical simulations based on physical models, such as finite difference or finite element methods. These conventional methods, while capable of providing accurate predictions, are computationally intensive and demand significant resources and time, particularly for large-scale applications. In contrast, LSTM, a deep learning model designed for time series data, captures long-term dependencies in tide level variations and efficiently handles large volumes of data. This allows LSTM to generate predictions more quickly, making it a promising tool for real-time applications.
Traditional tide forecasting methods, such as harmonic analysis, rely on known astronomical forcing to decompose tidal signals into several sinusoidal components, offering robustness and long-term predictive capability. However, their applicability is limited in complex environments, such as semi-enclosed bays. On the other hand, machine learning methods, particularly Long Short-Term Memory (LSTM) networks, are better suited to adapt to complex and dynamic tidal patterns, capturing nonlinear relationships in the data, and providing higher accuracy and efficiency in short-term predictions.
A key innovation of this study is the integration of numerical simulation and deep learning. By generating a comprehensive dataset from numerical models to train the LSTM, the study overcomes the issue of limited observational data, thus improving the spatiotemporal accuracy of tide predictions. This fusion of machine learning and physical simulations represents a novel approach in tide level forecasting. When compared to computational fluid dynamics (CFD) methods, which require solving complex fluid dynamics equations and extensive computational resources, LSTM offers clear advantages. CFD methods can be time-consuming and resource-demanding, whereas LSTM’s training and prediction processes are more efficient, making it well suited for scenarios that require fast predictions. However, LSTM also has certain limitations. Its performance heavily depends on the quality and quantity of the training data, and it struggles with extrapolation beyond the range of the training dataset. Additionally, as LSTM relies on patterns learned from past observations, it may have difficulty capturing abrupt changes in tidal patterns or rare events not reflected in historical data.
When compared to other machine learning models, including Random Forest, Transformer, and KNN regression, LSTM stands out in terms of performance. As shown in
Figure 10, LSTM consistently outperforms these models across the training, validation, and test sets. Specifically, LSTM demonstrates smaller RMSE values (
Figure 10) and a correlation coefficient nearing 1, indicating high accuracy and consistency. In the training set, LSTM effectively fits the data, while in the validation and test sets, it shows strong generalization ability, accurately capturing the spatiotemporal patterns of tide levels. On the other hand, the other models perform slightly worse, particularly KNN regression, which shows larger deviations in both standard deviation and correlation from the ground truth. The superior overall performance of LSTM further validates its stability and reliability, attributed to its ability to capture both long-term and short-term dependencies in time series data. In contrast, Random Forest and KNN regression models struggle with capturing temporal dynamics, and while the Transformer model performs decently, it is not as accurate as LSTM. See
Figure 11.
Unlike traditional LSTM methods, this study predicts future tidal fields using tidal data from four boundary points over the past 6 h. Specifically, when predicting the tidal field in the study area, the model does not rely on the historical tidal data of each point. Instead, it uses the tidal information from the boundary points to infer the changes in the entire tidal field. The model was trained on a computer equipped with a 13th Gen Intel
® Core™ i5 processor and 16 GB of RAM, with a computation time of a few minutes (no more than five minutes), indicating that the model has high computational efficiency. However, tidal signals are sparse, exhibiting significant energy only within specific frequency ranges in the frequency domain (as shown in
Figure 8). In the future, compressed sensing techniques can be employed to reconstruct the complete tidal signal from fewer observation data [
37], reducing the number of sampling points and computational burden. This would further enhance the model’s capability to handle sparse signals and long time series data, thereby improving the accuracy and efficiency of tidal predictions.
Despite its strong performance, the LSTM method is not without its limitations. One of the primary challenges is the need for large datasets to train the model effectively and improve prediction accuracy. Enhancing LSTM performance when data are limited, or by expanding the dataset through data augmentation techniques, such as using synthetic data generation, time series interpolation, or adding noise to existing data, presents an ongoing challenge. Future research could address these issues by integrating LSTM with other deep learning techniques, for example, integrating LSTM with convolutional neural networks (CNNs) can improve the ability to extract features from spatial data. Alternatively, combining LSTM with ensemble learning or physics-informed neural networks may address the limitations when dealing with extreme tidal events or sparse historical data.