This study introduces an artificial neural network system for ship motion prediction in seaways. To consider the physical characteristics of waveinduced ship motions, neural networks based on a Long ShortTerm Memory (LSTM) encoder and decoder, and a convolutional neural network (CNN) are integrated. The LSTM encoder computes the state vector representing the memory effects of motioninduced radiated waves based on past motion records, that is, a sequencetoone model. In the LSTM decoder, the motion time series is predicted using the encoded initial state vector and foreseen information on the ocean wave field around a vessel, that is, a sequencetosequence model. In addition, a CNN is adopted to compress the wave data into a vector sequence. Particularly, the present CNN uses spatiotemporal wavefield data, not a wave signal at single location. To validate the proposed system, a database for training the integrated system was constructed using a physicsbased seakeeping program for various sea states. By applying the trained model, deterministic predictions were performed for a new ocean environment, and the accuracy and reliability of the testing results are investigated according to the input data and neural network structures. From the simulation results, it was confirmed that the present encoder–decoder system can conduct ship motion forecasting by effectively considering the motion memory effects and wave excitations as in the ship hydrodynamic model. In addition, excitations and resulting motion responses by shortcrested waves can be considered through CNNbased wavefield data processing. Finally, the present machinelearning model also showed the capability of extracting ship operation information (maneuvering quantities) from the given wavefield data.
I. INTRODUCTION
Recently, with the development of digital technology and the improvement in computing power, interest in the realtime prediction of ship operations in actual seaways has rapidly increased. To this end, the concept of digital twinship for an operational phase, that is, a platform for realtime fusion, processing, and analysis of sensing data, and continuous exchange of information with physical assets and environments through monitoring and simulations is required.^{1} In particular, digital services based on shortterm deterministic future estimates for ocean environments and the hydrodynamic (HD) performances of the ship can support the operator's decisionmaking for immediate navigation which can avoid any sudden risk or failure, such as excessive motions, structural damage, cargo loss, and capsizing. This denotes the evolution of ship operation, from the traditional ways that relied on the mid or longterm voyage plan according to daily weather forecasts (generally statistical values) or the responses based on observations and empirical knowledge, into a new concept of the shortterm futurecognitive system.
To establish a digital twin system for ship operations, two main technologies should be developed. The first is the measurement and analysis of the ocean wave field. Through current marine radar technologies, the spatiotemporal evolution of sea surfaces can be assessed with a sufficient range and resolution.^{2–4} Recently, shortterm deterministic seawave predictions (DSWPs) based on Xband radar measurements have been successfully conducted using phaserevolved wave components reconstructed from radar retrievals.^{5–7} This indicates the identification of the wave trains that the vessel will encounter in the near future (a few minutes later). The second is a deterministic simulation of the seakeeping performance of the ship. Numerical analysis methods generally used in ship design, such as the 3 D panel method and computational fluid dynamics (CFD), are not suitable for digital twinship because of their high computational costs to solve the boundary value problem for a fluid domain. For the ship operator to decide on the shortterm operation scenario (speed, heading, and course), the simulations must proceed in a very short time. Therefore, in several existing studies, timedomain techniques that utilize a precomputed database of frequencydomain solutions, such as the response amplitude operator (RAO) model or the impulse response function (IRF) method, have been adopted for efficient seakeeping computations. The details of realtime prediction systems for ship operations based on marine radar measurements can be found in Refs. 8–11.
Over the past few decades, extensive research on regarding the shortterm prediction of ship motions has been conducted using various models, including hydrodynamic, time series, and machinelearning models.^{12} In the case of hydrodynamic models, such as the impulse response function method (IRF),^{13} efficient simulation can be performed based on the inherent physical seakeeping characteristics of a given ship model (the linear hydrodynamic coefficients and wave excitation forces). However, owing to its linear nature, a limit to considering largeamplitude nonlinear motions exists, especially in adverse weather conditions. On the other hand, various time series models have been developed for ship motion forecasting regarding the special operations of navy vessels, such as aircraft takeoff and landing, shiptoship interactions, and missile launches, such as the autoregressive moving average model^{14,15} and the autocorrelation function method.^{16} By utilizing these past motion recorddriven models, practical and efficient predictions can be made, including the memory effects of ship motions. However, because these models are based on a quasistationary assumption, it is possible to forecast motion responses only for short periods of seconds, and it is difficult to consider nonstationary wave excitations.
In recent years, predictions of ship operations using machinelearning technologies have been actively conducted. In the case of ship motion time series, it is possible to analyze the data by considering the correlations between its sequential structures over time using a recurrent neural network (RNN). In particular, one of the selfloopingbased RNNs, the Long ShortTerm Memory (LSTM)^{17} developed for the processing of longer and more complicated time series, has been widely applied for shortterm deterministic predictions of waveinduced ship motions. Ferrandis et al.^{18} showed the potential of the datadriven model based on the LSTM model to simulate the nonlinear dynamics of a vessel in realtime. The model trained by CFD simulations was capable of predicting ship motions for constant forward speed and longcrested head waves. By extension, the encoder–decoder system^{19,20} was proposed for forecasting ship maneuvering in waves. The records of the various physical variables such as wave elevation, 6 degreesoffreedom (DOF) motion responses, and rudder angle were input to the encoder, and the future time series of those variables were predicted through the decoder. A similar study by Silva and Maki^{21} simulated the 6 DOF ship motions during specific maneuvering scenarios such as turning and coursekeeping. It is noteworthy that the wave elevation time series at several points estimated with respect to the encounter frame according to ship navigation was used as input data for the LSTM structure.
To generalize the machinelearning model for ship motion forecasting, the following issues should be considered based on the physical characteristics of ship hydrodynamics. The first is the explicit distinction between the memory effects of past motion history and the incident waveinduced excitations using an encoder–decoder system. Since the history of incident waves does not directly affect the future motion responses, encoding for the wave record in existing studies^{19,20} is not necessary. On the other hand, the motion records should be encoded. Liu et al.^{22} investigated the prediction performance of the LSTM model according to the length of the adopted motion history (input vector space) in relation to the physical memory effects estimated by the impulse response function or autocorrelation function. However, in the model, because encoded memory effects were directly connected to the output motion time series without any ocean wave data, the forecast of only a few seconds was possible. Recently, various LSTM structures have been developed for shortterm deterministic predictions by combining other machinelearning techniques (the particle swarm optimization for hyperparameters^{23,24} and the multiscale attention^{25}). The advanced models showed improved performances compared to the existing LSTM, but the predictions were also performed for a short time of 2–3 rolling periods. In other words, these neural network systems focused on the shorttime simulations for quasistationary behaviors (for example, under stern quartering swells), as in the classical time series models.
The second is the utilization of wave data. The ocean waves can be regarded as a random process. Therefore, for a longtime deterministic prediction, the foreseen wave information is required at the time instants when the motion responses are forecasted. In other words, a wave time series should be input to the decoder so that the machinelearning model can consider future wave excitations. In only a few studies, wave elevations at several points near a vessel were used as input data.^{18,21,26} However, the pointwise elevations lack spatial and directional characteristics of sea surfaces. To capture the dependencies of ship motions on the properties of incident waves such as frequencies, wavelengths, and propagating directions, more extensive information, i.e., spatiotemporal wavefield data, is necessary, which enables ship motion forecasting for shortcrested irregular waves. Furthermore, the ocean wave field with respect to a shipfixed coordinate also contains information on maneuvering quantities since the gravity waves follow the dispersion relation shifted by the operational velocity and heading of the vessel. Contrary to previous studies limited to constant forward speed and heading or specific maneuvering scenarios, the neural network system trained based on the spatiotemporal wavefield data can have the capability to consider the ship operations and predict waveinduced motions under various navigational situations.
In this study, a machinelearning model for predictions of ship motion in real sea states is introduced. In order to develop a generalized model based on ship hydrodynamics, the following integrated neural network (INN) structures are adopted. An LSTM encoder that extracts an initial state vector from motion records (the memory effects of past motion history) and an LSTM decoder that performs time series prediction of ship motions based on foreseen ocean wave data (the waveinduced excitations) are utilized. In addition, a convolutional neural network (CNN) is applied to the input spatiotemporal wavefield data to obtain a vector sequence containing spatial and directional information on incident waves. To validate the present system, training is conducted using a database established through hydrodynamic modelbased timedomain numerical simulations, and shortterm deterministic predictions are performed for a new sea state. Based on the training and testing results, various issues related to ship motion dynamics reconstructed in the datadriven model are discussed, including memory effects, excitations by shortcrested waves, and ship operations.
II. THEORETICAL BACKGROUND
A. Problem definition
In this study, the following situations were assumed: a ship navigates in the ocean environment of shortcrested random seas. For irregular incident waves, $ \omega n$, $ A n$, and $ \epsilon n$ indicate the frequency, amplitude, and the phase of a certain wave component, respectively. The wave propagation direction ( $ \chi n$) is defined with respect to a global coordinate ( $ O \u2212 XYZ$). On the other hand, the operational velocity of the ship ( $ u 0$: surge speed, $ v 0$: sway speed, and $ r 0$: yaw rotation speed) and 6 degreesoffreedom (DOF) waveinduced motions ( $ \xi 1$: surge, $ \xi 2$: sway, $ \xi 3$: heave, $ \xi 4$: roll, $ \xi 5$: pitch, and $ \xi 6$: yaw) are defined in the inertial coordinate ( $ o \u2212 xyz$) that moves along the vessel at a velocity of $ U \u2192 = ( u 0 \u2212 y r 0 , v 0 + x r 0 , 0 )$. The relationship between the two coordinate systems can be expressed by the ship yaw angle ( $ \psi 0$). The coordinate systems and definitions are illustrated in Fig. 1.
The vessel is equipped with two measurement systems: the first is an onboard motion reference unit (MRU) for the measurement of 6 DOF waveinduced motions, and the second is a marine radar for the sensing of ocean waves around the ship. It is assumed that the reconstruction and prediction of spatiotemporal wave fields [ $ \zeta ( x , y , t )$] are possible by utilizing the image sequence of radar retrievals. The integrated neural network system in this study aims to deterministically predict the shortterm time series of ship motions based on past motion records with the time window of $ T r e$ and the foreseen wavefield information with the time window of $ T p r$. It should be noted that for the horizontal motions (the surge, sway, and yaw motions), monitoring and forecasting of the velocities ( $ v j = \xi \u0307 j$), not the displacements, are conducted to focus on the highfrequency seakeeping quantities rather than the drifting maneuvering quantities.
B. Hydrodynamic model: Generation of input and output data for machinelearning model
Ultimately, the present machinelearning model aims to predict waveinduced ship motions in real time based on the onboard measurement data during operations in real sea states. However, due to the limited actual operation data, the numerical simulation results have been utilized to demonstrate the potential of the neural network system for ship motion forecasting. In this study, for the construction of a database of incident wave fields and ship motions for training and testing, a timedomain simulation based on the impulse response function (IRF) method has been conducted. In the future, the applicability of the model to actual seatrial data will need to be validated.
Figure 2 shows an example of the retardation function. For the farther past, the function converges to zero because the memory effects of radiated waves decrease. In other words, the required time window of motion record is directly related to the convergent behavior of the retardation function. The function shape depends on the principal dimensions and the operating conditions of a vessel. Generally, for a modern commercial ship and its design speed, the retardation function converges within 30–50 s, which should be included in the motion record to accurately compute the convolution integral term in Eq. (3).
In this study, for the IRFbased timedomain simulation, the frequencydomain solutions for hydrodynamic coefficients as well as the wave diffraction force obtained by the 2 D strip theory [the Salvesen, Tuck, and Faltinsen (STF) method]^{28} were utilized. In addition to the IRF method, there are various seakeeping simulation methods for computing hydrodynamic forces and resulting ship motions by solving the boundary value problems for radiation–diffraction, such as the threedimensional panel method and CFD. No matter what method is applied, there is no difference in the fundamental physical aspects of ship motion dynamics that the motion response is determined by the memory effects from the past motion history and the wave excitations at the present instant. The present study focuses on ship hydrodynamics itself rather than numerical techniques, and to efficiently acquire the database for the application of neural networks, the slenderbody method was considered.
C. Integrated neural network system
In this study, a machinelearning model based on recurrent neural networks, which is capable of nonlinear time series processing, is proposed for deterministic ship motion prediction. Figure 3 illustrates the architecture of the proposed integrated neural network system. To establish a datadriven model (a nonlinear mapping between the input and output time series) that can represent the hydrodynamic characteristics of a ship, such as the memory effects of past ship motions and the excitations induced by incident waves in the future, the system consists of three different neural networks: (i) an LSTM encoder, (ii) a convolutional neural network system, and (iii) an LSTM decoder. The details of each network are as follows.
1. LSTM encoder
2. Convolutional neural network system
To predict ship motions in the future, foreseen waves (sea surface elevations) should be inputted into the machinelearning model. The spatiotemporal wave field contains various information on the frequencies, wavelengths, propagation directionalities, and heights of the incident waves. However, too many parameters (the weight matrix and bias vectors) are required to process field data using a fully connected feedforward network. Furthermore, a vessel is excited by ocean waves only within a certain range of periods and wavelengths, for example, negligible ship motions due to short waves. Through a convolutional neural network, therefore, a process of lossy compression that maintains spatial connectivity of the field data is required.
Figure 5 outlines the convolution process for the 2 D wave field at a specific time step [ $ \zeta ( t ) ( x , y )$]. The wave field is set for a region of size $ L d$ with respect to the ship's center of gravity (COG), and the data numbers in x and ydirections are $ N x$ and $ N y$, respectively. Through the ith convolution layer based on the $ N c i$ filters of size $ ( M x i , M y i )$, $ N c i$ activation maps of size $ ( N x i , N y i )$ can be obtained, and this process is repeated without zeropadding to compress the field data. It can be confirmed that as the convolution progresses, the activation maps exhibit an approximate tendency of the wave field. Then, the sufficiently compressed maps are converted to a single vector, called the wave vector, by utilizing a dense layer (the fully connected feedforward layer). Therefore, the output of the CNN system is a time series of wave vectors over the prediction time window, $ \zeta ( t )$ for $ t \u2208 [ t 0 + 1 , t 0 + T p r ]$. It should be noted that filter parameters in the convolution process for the field data at each step are independent of time and space to generalize the system, that is, the parameter sharing based on temporal and positional invariances.
3. LSTM decoder
The overall information of the integrated neural network system is summarized in Table I. First, the 6 DOF motion record of a 30.0 s time window ( $ T r e$) is input to the LSTM encoder, which is a time series consisting of 30 instants ( $ d t = 1.0 \u2009 s$). Sigmoid and tangent hyperbolic activation functions were used for the LSTM cell, and the dimension of the output memory vectors (the number of neurons in the hidden and cell state vectors, $ N m v$) was set to 32. The CNN system was operated based on the wavefield sequence of a 100.0 s time window ( $ T p r$). For the field data with a size that is twice the ship length, various resolutions ( $ N x \xd7 N y$) are introduced to investigate the prediction performance of the machinelearning model according to the wave information, such as 01 × 01, 03 × 03, 05 × 05, 09 × 09, and 17 × 17.
Designation .  Specifications .  

LSTM encoder  
Input time series length (record window), T_{re} (s)  30.0  
LSTM layer  Dim. of state vectors (memory vector), N_{mv}  32  
Activation function  Sigmoid and tangent hyperbolic functions  
Convolutional neural network system  
Input time series length (prediction window), T_{pr} (s)  100.0  
Input wavefield data resolution (N_{x} X N_{y})  (01 × 01)  (03 × 03)  (05 × 05)  (09 × 09)  (17 × 17)  
1st CNN layer  Filter size and number (M_{x}_{1}, M_{y}_{1}, N_{c}_{1})  ⋯  ⋯  (3, 3, 2)  (5, 5, 2)  (9, 9, 2)  
2nd CNN layer  Filter size and number (M_{x}_{2}, M_{y}_{2}, N_{c}_{2})  ⋯  ⋯  ⋯  (3, 3, 4)  (5, 5, 4)  
3rd CNN layer  Filter size and number (M_{x}_{2}, M_{y}_{2}, N_{c}_{2})  ⋯  ⋯  ⋯  ⋯  (3, 3, 8)  
Dense layer  Dim. of wave vector, N_{wv}  32  
Activation function  Tangent hyperbolic function  
LSTM decoder  
LSTM layer  Dim. of state vectors, N_{dc}  32  
Activation function  Sigmoid and tangent hyperbolic functions  
Dense layer  Activation function  Linear function  
Output time series length (prediction window), T_{pr} (s)  100.0 
Designation .  Specifications .  

LSTM encoder  
Input time series length (record window), T_{re} (s)  30.0  
LSTM layer  Dim. of state vectors (memory vector), N_{mv}  32  
Activation function  Sigmoid and tangent hyperbolic functions  
Convolutional neural network system  
Input time series length (prediction window), T_{pr} (s)  100.0  
Input wavefield data resolution (N_{x} X N_{y})  (01 × 01)  (03 × 03)  (05 × 05)  (09 × 09)  (17 × 17)  
1st CNN layer  Filter size and number (M_{x}_{1}, M_{y}_{1}, N_{c}_{1})  ⋯  ⋯  (3, 3, 2)  (5, 5, 2)  (9, 9, 2)  
2nd CNN layer  Filter size and number (M_{x}_{2}, M_{y}_{2}, N_{c}_{2})  ⋯  ⋯  ⋯  (3, 3, 4)  (5, 5, 4)  
3rd CNN layer  Filter size and number (M_{x}_{2}, M_{y}_{2}, N_{c}_{2})  ⋯  ⋯  ⋯  ⋯  (3, 3, 8)  
Dense layer  Dim. of wave vector, N_{wv}  32  
Activation function  Tangent hyperbolic function  
LSTM decoder  
LSTM layer  Dim. of state vectors, N_{dc}  32  
Activation function  Sigmoid and tangent hyperbolic functions  
Dense layer  Activation function  Linear function  
Output time series length (prediction window), T_{pr} (s)  100.0 
The adopted number of convolution layers and filter specifications differ depending on the field data resolution. For example, the point data of 01 × 01 are directly converted to the wave vector through a dense layer, whereas the field data of 17 × 17 are compressed gradually according to three consecutive convolution layers. As the convolution progresses, the size of the activation map is reduced, and the number of channels increases. The tangent hyperbolic function was used for nonlinear activations in the convolution and dense layers. The resulting dimension of the wave vector ( $ N w v$) is set to 32. In the LSTM decoder, the same sigmoid and tangent hyperbolic activation functions and the state vectors of 32 neurons ( $ N d c$) were also utilized. Finally, the ship motion time series for the prediction time window of 100.0 s was forecasted through a linear activation functionbased dense layer.
It should be noted that the structures of the input and output data introduced in this study are examples and should be determined according to the conditions of ocean waves and ship operations. First, as explained in Sec. II B, the required time window of the motion record should include the convergence of the retardation function. The sensitivity analysis of the record length for the machinelearningbased ship motion forecast can be found in Ref. 29. Second, the prediction time window should be sufficiently long (several times the mean wave period) to resolve the irregularities of the incident waves and the resulting ship motions of various frequencies. However, at the same time, it cannot exceed the predictable zone for given marine radar measurements. The predictable zone is the limited time and specie where reliable wave forecasting is available, which is determined by the sensing area and the sea states (the propagation speed and direction of ocean wave energies). The details of the analytic analysis of predictable zones for fixed or moving probes and wholearea measurements can be found in Qi et al.^{30} According to a recent study be Lee et al.,^{31} it was proven that the wavefield around a ship can be forecasted for several minutes for general ship operations in representative sea conditions. Finally, the size and resolution of the wave field should also be set considering the ocean environment. For example, for more severe sea states where longwave components are dominant, field data over a relatively wider area and lower resolution are required.
The entire integrated neural network system built through the Keras functional application programing interface was trained together based on the backpropagation through time algorithm (BPTT).^{32} To minimize the loss function of mean squared error ( $ MSE$) by fitting the model parameters, an adaptive momentum estimation optimizer (Adam)^{33} with $ \beta 1 = 0.9$ and $ \beta 2 = 0.999$ is introduced. The total number of epochs is set to 1000 in consideration of the convergences of training and validation errors in various learning processes in this study. The convergent behaviors of errors according to the epoch value will be presented in Sec. III for training results. Optimization was performed for a dataset of 128 batch size with a learning rate of 10^{−3} decaying up to 10^{−5}.
III. TRAINING AND TESTING RESULTS
A. Database and test conditions
Designation .  Specifications .  

Ship model: KVLCC2 tanker  
Length between perpendiculars, L (m)  320.0  
Breadth, B (m)  58.0  
Draught, T (m)  20.8  
Block coeff. C_{B}  0.810  
Longitudinal center of gravity from AP (m)  171.1  
Metacentric height (m)  5.8  
Design speed, Fn  0.142 (15.5 kn)  
Ocean environments  
Beaufort scale  6  7  8  9  10 
Significant height, H_{S} (m)  3.0  4.0  5.5  7.0  9.0 
Mean period, T_{mean} (s)  6.7  7.7  9.1  10.2  11.6 
Main direction, χ_{M} (deg)  0.0–330.0  
Spreading angle, χ_{s} (deg)  60.0 
Designation .  Specifications .  

Ship model: KVLCC2 tanker  
Length between perpendiculars, L (m)  320.0  
Breadth, B (m)  58.0  
Draught, T (m)  20.8  
Block coeff. C_{B}  0.810  
Longitudinal center of gravity from AP (m)  171.1  
Metacentric height (m)  5.8  
Design speed, Fn  0.142 (15.5 kn)  
Ocean environments  
Beaufort scale  6  7  8  9  10 
Significant height, H_{S} (m)  3.0  4.0  5.5  7.0  9.0 
Mean period, T_{mean} (s)  6.7  7.7  9.1  10.2  11.6 
Main direction, χ_{M} (deg)  0.0–330.0  
Spreading angle, χ_{s} (deg)  60.0 
Figure 6 illustrates the procedure for constructing a timeseries database. For a long time ( $ T total$), the timedomain numerical simulation was performed for the specific wave condition consisting of phaseresolved components. To obtain the ocean wave data of various propagation directionalities, the various main wave directions at 30.0° intervals are introduced, $ \chi M = 0.0 \xb0 \u2212 330.0 \xb0$ (12 directions). From the simulation results, the ship motion time series are extracted by shifting the time window consecutively at a certain interval such as $ d t s = 2.0 \u2212 5.0 \u2009 s$ to secure a large amount of data. In addition, for the prediction time window, the foreseen wave fields of Eq. (6) were also collected as the input data as shown in Fig. 7. In the case of point data (01 × 01), the input is a time series of wave elevations at the ship's COG, while for other resolutions, it is the time sequence of field data for the region twice the length of a ship, $ L d = 2 L$. The pair of ship motion time series for the record and prediction time windows, and the corresponding incident wave field constitute one data.
In this study, various training and testing were conducted to analyze the performances of a machinelearning model according to the properties of the input data. First, for a single sea state of Beaufort scale 9 and $ \chi M = 60.0 \xb0$, the dataset was established from the hydrodynamic modelbased simulation results of $ T total = 5100.0 \u2009 s$ with the timewindow shifting of $ d t s = 2.0 \u2009 s$. A total of 2500 timeseries data were divided into training, validation, and test datasets at a ratio of 6:2:2. Second, for the sea states of various directionalities of $ \chi M = 0.0 \xb0 \u2212 330.0 \xb0$ except $ 60.0 \xb0$ (11 directions), the present integrated neural network system was trained, and then, the inference was carried out for the sea state of $ \chi M = 60.0 \xb0$. A total of 11 000 timeseries data (for each main wave direction, 1000 data obtained by the timewindow shifting of $ d t s = 5.0 \u2009 s$) were utilized as training and validation datasets at a ratio of 8:2. Third, the ship motion predictions considering the severities of sea states were performed based on a total of 48 000 training data for Beaufort scale 6, 7, 9, and 10 (for each sea state, 12 000 data from all 12 directions) and the 12 000 testing data for a new ocean environment of Beaufort scale 8. Fourth, for the regularwave computations to obtain ship motion transfer functions, the data of all directionalities and severities were used for optimizing model parameters. The details of the datasets for each test are summarized in Table III. Finally, a machinelearning model was also applied to estimate various ship operation conditions. In this application, the structures of the input and output data and neural networks are slightly different from other tests, which will be described in Sec. III F.
Test condition .  Single sea state .  Sea states of various directionalities .  Sea states of various severities .  Regularwave computation . 

Training and validation dataset  
Sea state  Beaufort scale 9  Beaufort scale 9  Beaufort scale 6, 7, 9, 10  Beaufort scale 6, 7, 8, 9, 10 
Main direction, χ_{M} (deg)  60.0  0.0–330.0 except 60.0 (11 directions)  0.0–330.0(12 directions)  0.0–330.0(12 directions) 
Number of training data  1500  8800  38 400  48 000 
Number of validation data  500  2200  9600  12 000 
Test dataset  
Sea state  Beaufort scale 9  Beaufort scale 9  Beaufort scale 8  ⋯ 
Main direction, χ_{M} (deg)  60.0  60.0  0.0–330.0(12 directions)  ⋯ 
Number of test data  500  1000  12 000  ⋯ 
Test condition .  Single sea state .  Sea states of various directionalities .  Sea states of various severities .  Regularwave computation . 

Training and validation dataset  
Sea state  Beaufort scale 9  Beaufort scale 9  Beaufort scale 6, 7, 9, 10  Beaufort scale 6, 7, 8, 9, 10 
Main direction, χ_{M} (deg)  60.0  0.0–330.0 except 60.0 (11 directions)  0.0–330.0(12 directions)  0.0–330.0(12 directions) 
Number of training data  1500  8800  38 400  48 000 
Number of validation data  500  2200  9600  12 000 
Test dataset  
Sea state  Beaufort scale 9  Beaufort scale 9  Beaufort scale 8  ⋯ 
Main direction, χ_{M} (deg)  60.0  60.0  0.0–330.0(12 directions)  ⋯ 
Number of test data  500  1000  12 000  ⋯ 
B. Tests for single sea state
Figure 8 shows the mean squared errors in the training process for a single sea state (Beaufort scale 9 and $ \chi M = 60.0 \xb0$). For every epoch, the training and validation datasets were shuffled and reclassified. In the machinelearning model without the memory vector for encoding motion record, the state vectors of the LSTM decoder were initialized with zero vectors. Without the past motion history, the $ MSE$ converged only for the training dataset, whereas there was no improvement for the validation dataset during learning. This tendency is further intensified for the wavefield data (17 × 17) than that for the wavepoint data (01 × 01), and the validation error even increases slightly as the learning progresses. This indicates that the system was overfitted to the training dataset because the memory effects of ship motions were not considered. In contrast, by utilizing the LSTM encoder, the system can be optimized and generalized more accurately. The mean squared errors show similar convergent behaviors for both the training and validation datasets. Furthermore, the converged error was significantly reduced by using the field data with more spatial information on ocean waves. As can be seen in the figure, the errors were sufficiently converged at about 1000 epochs, so the subsequent inferences were conducted using the model trained for the corresponding epoch value.
In Fig. 9, the shortterm deterministic prediction results for certain test data are compared according to the structures of neural networks and input data. It can be clearly confirmed that without the memory vector, the forecasting results are remarkably different from the exact values (the hydrodynamic modelbased simulation results), especially at the beginning of a time series, which indicates that the system cannot capture the physical correlations between the input and output time series (motion records and future ship motions). In addition, when using the model trained for wavepoint data, the prediction errors were significant, particularly for pitch motions.
For a more quantitative analysis of the prediction performance according to the input motion record, the total mean squared errors (the average value for the entire window and the whole test dataset) were compared for different record lengths as shown in Fig. 11. It can be clearly confirmed that the prediction error converges if the motion record is longer than 20.0 s, which is consistent with the convergent tendency of the retardation function of the physical memory effects (refer to Fig. 2). The testing results demonstrate that it is valid to set the record length to 30.0 s in the present model. For the wavepoint data, the total $ rms e j$ decreased rapidly as the record length increased but the converged error values were significant due to a lack of wave information, in particular, regarding the propagation directionalities. In contrast, when the wavefield data were given, a longer record time was required for stable convergence (oscillatory behaviors as in the retardation function), but the errors converged at much smaller values.
C. Tests for sea states with various directionalities
Next, the prediction performances of the integrated neural network system for shortcrested waves of various propagation directionalities (Beaufort scale 9 and $ \chi M = 0.0 \xb0 \u2212 330.0 \xb0$ at 30.0° intervals) were investigated based on the foreseen wavefield data with different resolutions. Figure 12 shows the comparison of the different learning processes based on the input wave information. As expected, as the system was trained for higherresolution wavefield data, the converged values of $ MSE$ were reduced for both the training and validation datasets, indicating better optimization and generalization of the machinelearning model.
It should be noted that the adopted field data are not sufficient to represent detailed sea surfaces. For example, in the case of the 17 × 17 resolution, the wave field is discretized with the wavenumber range of $ k \u2208 [ 9.817 \xd7 10 \u2212 3 \u2009 m \u2212 1 , \u2009 3.927 \xd7 10 \u2212 2 \u2009 m \u2212 1 ]$ corresponding to the wavelength ratio ( $ \lambda / L$) from 1/4 to 2, while in general ocean wave analysis based on marine radar measurements,^{34} the wavenumber range is $ k \u2208 [ 4.189 \xd7 10 \u2212 3 \u2009 m \u2212 1 , \u2009 1.072 \u2009 m \u2212 1 ]$. However, since the ship is excited by waves in a certain frequency range, successful ship motion forecasting is possible with limited wavefield information. On the other hand, the increase in field points causes a significant computational cost for the training process [for the 17 × 17 field data, about five or ten times the training time was required compared to the wavepoint data when using NVIDIA Tesla T4 graphics processing unit (GPU)]. In short, the spatial resolution should be optimized considering the computational cost for image processing and the correlation between the sea state information such as dominant wavelengths relative to the ship dimension and resulting motions.
D. Test for sea states with various severities
To expand the machinelearning model for ocean environments of various severities, the neural network system was trained according to the numerical simulation data for the sea states of Beaufort scales 6, 7, 9, and 10 (for all main wave directions). Then, based on the trained model, the inference was performed for a new sea state of Beaufort scale 8.
Figure 14 shows the total root mean squared error (the average value for $ rms e j$ of the testing data in each main wave direction). It can be seen that the prediction errors are significant for the stern quartering or beam wave conditions ( $ \chi M = 30.0 \xb0 \u2212 90.0 \xb0$)where relatively largeamplitude ship motions occur. In particular, given the roughly resolved wavefield data of 01 × 01–05 × 05, the system shows limitations in forecasting the roll motions induced by stern quartering waves. On the other hand, when utilizing the wavefield data above the 09 × 09 resolution, the total $ rms e j$ converges with high accuracy for all propagation directions, which indicates that the present model can adapt to sea states of various severities.
Figure 15 shows the longterm deterministic prediction results for a specific sea state (Beaufort scale 8 and $ \chi M = 60.0 \xb0$). For a long term of over 1000 s, an overlapping technique was applied. From the initial motion record, forecasting is performed for the prediction time window, and the early stage of the results is used as the motion record for the next recursive forecasting. Based on the wavefield data of the 03 × 03 resolution, discrepancies occur in ship motion forecasting, and it is difficult to conduct recursive simulations because of the memory vectors encoded from the inaccurately predicted motions. In contrast, it can be confirmed that it is possible to carry out longterm deterministic prediction utilizing the sufficiently resolved foreseen wave field data of 09 × 09, and therefore, the forecasting accuracy is maintained high over time.
It is important to investigate what kind of information and how much training data are required to establish the machinelearning model for ship motion forecasting. For the neural network system to resolve wave directionalities, data on the incident waves in all directions and resulting ship motions should be considered according to the motion RAO specified for each heading angle. On the other hand, since it is ambiguous to classify irregular wave time series according to the sea state parameters, the database should be more carefully constructed regarding the severities of sea states. Using the model trained based on the dataset of Beaufort scale +8, and testing for other sea states, the total root mean squared errors normalized by the significant wave heights are compared by sea states and wave directions as shown in Fig. 16. It can be confirmed that the prediction results for the adjacent sea states were quite accurate (Beaufort scale 7 and 9). However, inferences failed for some data of very large motion responses that the model has not experienced (the beam wavesinduced roll motions under Beaufort scale 10). The testing result denotes that while training about datasets of various sea states as in the present study is not essential, it is necessary to secure a dataset of extreme events and reflect it in the machinelearning model whether conducting numerical simulations or actual onboard measurements. If a more expensive hydrodynamic model such as CFD is used, the procedure of probabilistic identifying critical wave events and performing deterministic simulations based on the wave train is required. The details of the CFD applications for the extreme event can be found in Xu et al.^{35} and Silva and Maki.^{36}
E. Tests for regular waves: Ship motion transfer functions
Testing on regular waves was conducted to compute the transfer function of the ship motions (response amplitude operator; RAO). The timedomain numerical simulation data of all sea states (Beaufort scales 6–10) and all main wave directions ( $ \chi M = 0.0 \xb0 \u2212 330.0 \xb0$) were utilized for training the present neural network system. Both hydrodynamic model and machinelearningbased simulations were initiated for the ship at rest (the zeromotion record), and the ramped regular wave fields are adopted, as shown in Fig. 17. As in longterm deterministic prediction, the simulation progresses through an overlapping technique in which the forecasting result is recursively used as a motion record. It can be observed that the time series of the two approaches are similar during the wave ramp time and subsequent transient period. For a quasisteady state with a certain amplitude, the motion response to a given regular wave can be obtained by applying Fourier transform to the converged time series.
The ship motion transfer functions are computed for various regularwave conditions listed in Table IV, as shown in Figs. 18 and 19. In the case of heave and pitch responses, the transfer functions obtained by the hydrodynamic model (HD) and the integrated neural network system (INN) are in good agreement for various propagation directions from following to head waves. On the other hand, the roll response shows strong nonlinearities in stern quartering and beam wave conditions owing to the significant variations in the wetted hull surfaces during waveinduced motions (a shifted natural frequency). It was confirmed that the neural network system can capture the sensitivities of roll motions with respect to the wave heights, such as changes in the frequencies and magnitudes of resonant responses. In conclusion, based on the accurately evaluated transfer functions, it can be inferred that the physical backgrounds of ship hydrodynamics are properly embedded in the present machinelearning model by resolving the dependencies of ship motions on the frequencies, directionalities, and heights of incident waves.
Designation .  Specifications . 

Wave direction, χ (deg)  0.0–180.0 (7 directions) 
Wavelength, λ/L  0.3, 0.5, 0.7, 0.9, 1.0,1.1, 1.2, 1.4, 1.6, 2.0 
Wave height, H/L  0.01, 0.02 
Designation .  Specifications . 

Wave direction, χ (deg)  0.0–180.0 (7 directions) 
Wavelength, λ/L  0.3, 0.5, 0.7, 0.9, 1.0,1.1, 1.2, 1.4, 1.6, 2.0 
Wave height, H/L  0.01, 0.02 
F. Tests for various ship operation conditions
Finally, to generalize the ship motion prediction system, various operating conditions must be considered. Two approaches are available for dealing with ship navigation information. The first is to directly input timeseries data of maneuvering quantities such as operational velocity and yaw angle, into a machinelearning model. This approach is intuitive, but as the amount of input data increases, the model becomes more complex, and the system should consist of a greater number of neurons and layers. Furthermore, because waveinduced motion physically depends on the ship's relative velocity to sea surfaces, namely, the speed through water ( $ STW$), additional processing of navigation data from automatic identification system or global positioning system is required to resolve the effects of ocean currents.
In the present study, to secure timeseries data of various ship operations, a coursekeeping simulation was performed based on the hydrodynamic model. The waveinduced motions are computed by the IRF method, whereas the maneuvering quantities are obtained by solving the maneuvering modeling group (MMG)based equation of motion: the twotimescale approach. To consider the wave effects on ship maneuvering, the secondorder wave drift force and moment precomputed by the 3 D panel method are reflected in the maneuvering equation. In this timedomain seakeepingmaneuvering simulation, the desired ship operation is defined by the speed over ground ( $ SOG = u 0 2 + v 0 2$: the total speed) and the course over ground ( $ COG$: the direction of a route). For environmental loads of a specific sea state, proportionalderivation (PD)based control has been adopted for the propeller revolution rate and rudder angle so that the ship navigates at the target $ SOG$ and $ COG$, respectively. The details of the coursekeeping simulation can be found in Ref. 11.
The constructed database for various ship operations under the Beaufort scale 8 sea state was used to train and test the neural network system. It was assumed that there was no ocean current. The target values for each scenario were arbitrarily chosen within a certain range: $ SOG \u2208 [ 6.0 , 16.0 ] \u2009 kn$ and $ COG \u2208 [ \u2212 30.0 , \u2009 30.0 ] \xb0$. For a specific main wave direction, coursekeeping simulations were conducted for 500, 1000, and 2000 scenarios. It should be noted that in each realization, the phases of wave components were randomly set. Figure 20 illustrates examples of coursekeeping operations. From the initial stage for starting freerunning at a given speed, it can be seen that there is a transient period for controlling the route of the ship drifting and rotating owing to environmental loads. After the transient period, the vessel navigated along the desired course with a converged operational velocity and relative heading angle to the main wave direction. These converged maneuvering quantities are set as the target variables of a machinelearning model: $ u 0 , mean$, $ v 0 , mean$, and $ ( \chi M \u2212 \psi 0 ) mean$. For all main wave directions ( $ \chi M = 0.0 \xb0 \u2212 330.0 \xb0$), the training and validation datasets were established at a ratio of 8:2 as summarized in Table V. On the other hand, the dataset of 500 operation scenarios for the beam wave condition ( $ \chi M = 90.0 \xb0$) was used for inference.
Designation .  Specifications .  

Training and validation dataset  
Sea state  Beaufort scale 8  
Main direction, χ_{M} (deg)  0.0–330.0 (12 directions)  
Operation scenarios, N_{sce} (for each main direction)  500  1000  2000 
Number of training data  4800  9600  19 200 
Number of validation data  1200  2400  4800 
Test dataset  
Sea state  Beaufort scale 8  
Main direction, χ_{M} (deg)  90.0  
Operation scenarios, N_{sce}  500  
Number of test data  500 
Designation .  Specifications .  

Training and validation dataset  
Sea state  Beaufort scale 8  
Main direction, χ_{M} (deg)  0.0–330.0 (12 directions)  
Operation scenarios, N_{sce} (for each main direction)  500  1000  2000 
Number of training data  4800  9600  19 200 
Number of validation data  1200  2400  4800 
Test dataset  
Sea state  Beaufort scale 8  
Main direction, χ_{M} (deg)  90.0  
Operation scenarios, N_{sce}  500  
Number of test data  500 
For the estimation of ship operations, the integrated neural network system was simplified as shown in Fig. 21. Compared with the original system, the encoder for the motion record was deleted. The time series of the wave vector transferred from the CNN system is input to the LSTM system, as in the original system, whereas the output vector is the mean maneuvering quantities over the prediction time window, not the time series of the predicted waveinduced ship motions: the sequencetoone model. It should be noted that the target variables representing ship navigation were scaled by certain maximum values for balanced training between the variables: $ u 0 , max = 20.0 \u2009 kn$, $ v 0 , max = 5.0 \u2009 kn$, and $ \psi 0 , max = 360.0 \xb0$.
Based on the estimated maneuvering quantities, it can be inferred that the present neural network system can predict waveinduced motions of the ship operating at various speeds and directions if wavefield time series data are provided (Figs. 22 and 23). However, in this study, the maneuvering motions are assumed to be a slowly varying quantity (almost unchanged during the prediction time window) compared to the seakeeping motions, under the quasisteady assumption that the time scales of the two motions are significantly different. For ship navigation that changes rapidly over time, such as ship turning, higherresolution field data for a wider range of operational scenarios and corresponding complex neural networks are required to establish more complicated correlations between ocean waves and seakeeping and maneuvering quantities in the machinelearning model. Furthermore, for the verification and enhancement of the model, especially for the largeamplitude ship motions in harsh ocean environments, fully nonlinear simulation results using CFD or real seatrial measurement data should be utilized for training in the future.
IV. CONCLUSIONS
In this study, shortterm deterministic ship motion prediction was performed based on an integrated neural network system. To validate the machinelearning model, hydrodynamic modelbased timedomain numerical simulation results were utilized. The following conclusions can be drawn based on the training and testing results:

Through the considerations of the ship motion memory effects by encoding the motion record and the wave excitations by inputting the foreseen wave information into the decoder, accurate predictions can be made for the entire prediction time window, particularly at the beginning of the time series. The introduction of the encoder has a greater impact on the forecasts of roll motion with less damping of radiated waves.

When processing a given wavefield data of sufficient resolution using CNN, the machine learning model can distinguish the dependencies of ship motions on the frequencies, wavelengths, and directionalities of ocean waves, thus forecasting motion responses induced by shortcrested waves of various sea states. The sensitivities of the motion responses to wave heights can also be captured based on the nonlinear nature of neural networks. Through the transfer functions obtained by regularwave testing, it was demonstrated that the ship motion dynamics can be embedded in the datadriven model.

It was proven that the integrated neural network system can extract information on ship operations from wavefield data. This indicates that the system has the capability to predict ship motions in various navigational situations.

The present technique can be applied to various fields related to the seakeeping performance of ships in the future. It can be applied to nonlinear problems for which the traditional seakeeping theory is difficult to apply, as an auxiliary technique to improve the accuracy of the existing theory, and also to analyze various related fields such as motion response analysis accompanying extreme loads through the same technique. This method is expected to be used as an analysis technique that can complement existing experiments, theoretical analysis, and numerical analysis.
ACKNOWLEDGMENTS
This study was funded by the DSMESNU Future Ocean Cluster (FOC) center through the project “Development of Core Technology for RealTime Digital Twin of Ship Operation in Seaways” (Grant No. 06902020014). Their support is appreciated. Furthermore, the Research Institute of Marine System Engineering (RIMSE) and the Institute of Engineering Research (IOER) of SNU are credited for their administrative support.
AUTHOR DECLARATIONS
Conflict of Interest
The authors have no conflicts to disclose.
Author Contributions
JaeHoon Lee: Conceptualization (equal); Formal analysis (lead); Methodology (lead); Writing – original draft (lead). Jaehak Lee: Formal analysis (supporting); Methodology (supporting); Writing – review & editing (supporting). Yonghwan Kim: Conceptualization (equal); Supervision (lead); Writing – review & editing (lead). Yangjun Ahn: Formal analysis (supporting); Software (lead).
DATA AVAILABILITY
The data that support the findings of this study are available within the article.