# Prediction of Motion State of a Docking Small Planing Ship using Artificial Neural Network

## Article information

## Abstract

Automatic docking of small planing ship is a critical aspect of maritime operations, requiring accurate prediction of motion states to ensure safe and efficient maneuvers. This study investigates the use of Artificial Neural Network (ANN) to predict motion state of a small planing ship to enhance navigation automation in port environments. To achieve this, simulation tests were conducted to control a small planing ship while docking at various heading angles in calm water and in waves. Comprehensive analysis of the ANN-based predictive model was conducted by training and validation using data from various docking situations to improve its ability to accurately capture motion characteristics of a small planing ship. The trained ANN model was used to predict the motion state of the small planing ship based on any initial motion state. Results showed that the small planing ship could dock smoothly in both calm water and waves conditions, confirming the accuracy and reliability of the proposed method for prediction. Moreover, the ANN-based prediction model can adjust the dynamic model of the small planing ship to adapt in real-time and enhance the robustness of an automatic positioning system. This study contributes to the ongoing development of automated navigation systems and facilitates safer and more efficient maritime transport operations.

**Keywords:**Artificial Neural Network; motion state; small planing ship; automatic ship docking; real-time

## 1. Introduction

In recent years, small planing ship have constituted an increasing share of ship traffic in ports. The focus on small planing ship allows for more controlled testing and analysis, facilitating the development and validation of predictive models using simulated data and actual data. Furthermore, choosing small planing ship as a research topic enables researchers to address specific challenges and opportunities in navigation automation. In addition, small planing ship are often maneuverability and exhibit different motion characteristics than larger ships, making them suitable subjects for studying motion state prediction. Docking small planing ship in crowded port environments has become a top concern in maritime operations. Traditional ship docking methods often rely on manual intervention, which causes errors and inefficiencies. Therefore, there is growing interest in the use of Artificial Neural Networks (ANN) to automate and optimize the docking process. ANN, a subset of artificial intelligence, offers a potential solution for predicting motion behavior when maneuvering a small planing ship. The predictive power of an ANN stems from its ability to analyze and learn relationships in a complex data set, making it suitable for modeling the dynamic and nonlinear features of ship motion. Such predictive models have enormous potential to revolutionize maritime operations by automating operations, minimizing human error, and improving overall safety.

In the past, researchers have studied motion prediction during ship docking using neural network algorithms in supervised machine learning. Ship trajectory during docking using simulation data in both wind and no wind conditions were predicted (Ahmed et al., 2012). Simulation data was collected by controlling the ship docking using the ANN algorithm and a Proportional Derivative controller. The ANN prediction model was further researched and developed using experimental data from the turning circle test (Ahmed et al., 2013). Ship motion states during docking were predicted using control simulation data in scenarios with no wind, constant wind, and dynamic wind (Shuai et al., 2019). Most recently, the ship's trajectory when docking was predicted using a long-short-term memory model in a supervised machine learning model (Robert et al., 2020). In addition, the ANN method was used to model nonlinear response models and linear hydrodynamic models of ship maneuvering motion (Lou et al., 2016). ANN method was also applied to model the maneuverability characteristics of a scaled model ship using experimental data (Moreira et al., 2023).

In our study, control simulation tests are conducted at various initial heading angles in calm water and waves. A mathematical model of ship maneuvering is used to simulate ship motion in three degrees of freedom (DOF). Rudder angle and propeller revolution are two variables used to control the ship, achieved by adjusting the control adjustment bars in the simulation interface. Control simulation results including x_{0} coordinate, y_{0} coordinate, heading angle, rudder angle, and propeller revolution, which are used as both training data and testing data for the ANN model. Once the ANN model is trained on the training data, validation is performed using the testing data. By inputting the initial ship motion state (x_{0} coordinate, y_{0} coordinate and heading angle) into the trained and validated ANN model, the next ship motion state (rudder angle and propeller revolution) is predicted. The x_{0} coordinate, y_{0} coordinate and heading angle in the next state are calculated using a mathematical model of ship maneuvering. The predicted ship states are continuously updated as input values of the ANN model. These predicted ship states are then compared to the final ship state at the dock. The prediction process ends when the error between the predicted state and the target state is within 5% in calm water and 10% in waves.

## 2. Docking problem and simulation model

### 2.1 Ship docking problem

According to the ITTC recommendation, high-speeds ships are defined as ships with a Froude number above 0.45, and/or a speed above 3.7∇^{1/6} (m/s), where ∇ in m^{3} (ITTC, 2008). Small planing ship is often designed to operate at high speeds. However, the situation required operating at much lower speeds to ensure safe and precise maneuvering of ships docked in ports. This poses an interesting challenge for researchers who want to investigate the motion behavior of small planing ship. Therefore, adapting to the demands of low-speeds docking operations required careful consideration and adjustment of navigation strategies. Two requirements have been proposed for captains in maneuvering ships when docked (Kose et al., 1989). First, the ship's final docking location must be some distance from the dock, not entirely at the dock. Secondly, the captain must have enough time to plan the maneuvering of the ship in an emergency. Therefore, two phases of the ship docking process were proposed (Shuai et al., 2019), as depicted in Fig. 1. These phases include the ballistic phase and the side-push phase. In the ballistic phase, the ship is maneuvered to change course, speed and stops using the main propulsion and rudder. In the side-push phase, the ship is docked using tunnel thrusters to provide side thrust. In Fig. 1, two right-handed coordinate systems were used in ship maneuvering. The earth-fixed coordinate system (Oxy) was assumed to be at the midship at time t0. The body-fixed coordinate system (O_{0}x_{0}y_{0}) was assumed to be at the midship. The heading angle is defined as the angle between the directions of the x_{0}-axis and the x-axis.

In our study, the first phase of the docking operation was conducted. The ship departed from the stationary state and maneuvered toward the port at low speed at various initial heading angles. The ship docked at the final position of the ballistic phase (x_{n}, y_{n}). The final position was considered the error range between the predicted motion state and the final target state, which is within 5% in calm water and 10% in waves. The range of the final position of the ballistic phase is depicted in Fig. 2. In addition, a leisure boat is a small planing ship that was chosen to study the ship maneuvering behavior in port. The principal dimensions of the ship which is considered the target ship are described in Table 1.

### 2.2 Ship mathematical model

During maneuvering, ship motion is described by 6DOF including surge, sway, heave, roll, pitch and yaw. For surface ships, ship motion is simplified into 3DOF, including surge, sway and yaw. The ship motion equation for small planing ship was described as Eq. (1) (Katayama et al., 2009).

where, m, x_{G} and I_{z} are the ship mass, the longitudinal center of gravity in the body-fixed coordinate system and the moment of inertia in yaw motion, respectively. u, v and r are the velocities on the x-axis, y-axis, and z-axis, respectively. ^{rd}-order function, these hydrodynamic forces acting on the ship's hull are described by Eq. (2). In Eq. (2), the 3^{rd}-order polynomial function is replaced by a 2^{nd}-order polynomial function and the absolute value of sway velocity and yaw rate.

where X'_{0}, X'_{vv}, X'_{rr}, and X'_{vr} are the surge derivatives. Y'_{v}, Y'_{v|v|}, Y'_{r}, Y'_{r|r|}, Y'_{v|r|}, and Y'_{v|r|} are the sway derivatives. N'_{v}, N'_{v|v|}, N'_{r}, N'_{r|r|}, N'_{v|r|}, and N'_{v|r|} are the yaw derivatives. p is the water density. The superscripts represent non-dimensional variables. In addition, the hydrodynamic coefficients for surge, sway and yaw motion were obtained based on the experiment. The hydrodynamic coefficients for surge, sway and yaw motion are described in Table 2.

Hydrodynamic forces due to propeller are described by Eq. (3). For our small planing ship, the leisure boat uses two outboard motors as the main propulsion. Outboard motors include the engine, gearbox and propeller. The propellers used are coupled twin propellers with bravo three drives. The thrust of outboard motors is calculated using Eq. (4) (Gerr, 1989).

where T(N) is the thrust, x_{t} is the longitudinal coordinates of the propeller to the ship's center of gravity and δ is the rudder angle. n is the propeller revolution. P is the pitch face propeller. m is the ship mass. s_{A} is the apparent slip coefficient. C is the constant chosen for the type of ship being considered. W_{f} is the Taylor wake factor.

Wave force was obtained by performing the seakeeping test in the experiment. The wave force data was stored as a database and is described in Fig. 2.

## 3. Proposed approach

### 3.1 Artificial Neural Network

ANN are computational models inspired by the structure and function of biological neural networks in the human brain. They consist of interconnected nodes, or neurons, organized in layers, including input, hidden, and output layers depicted in Fig. 3. During the training process, the ANN iteratively adjusts the weights and biases of its connections to minimize the error between the predicted and target values. The error is calculated using the mean square error (MSE) method. This optimization process, often performed using algorithms like backpropagation, allows ANN to learn complex nonlinear relationships and make accurate predictions based on new input data.

The predicted values of each node in the hidden layer can be written as shown in Eq. (5).

where y_{j} and b_{j} are the output value and the bias corresponds to each node in the hidden layer, respectively. x_{i} and w_{i} are the input value and weight corresponding to each node in the input layer, respectively. f is the activation function. There are many activation functions used in regression problems such as Sigmoid, Tanh and ReLu described by Eq. (6).

Similarly, the predicted value of each node in the output layer can be rewritten as Eq. (7).

where y_{k} and b_{k} are the output value and the bias corresponds to each node in the output layer, respectively. X_{j} and W_{j} are the output value and weight corresponding to each node in the hidden layer, respectively. is the linear activation function.

The objective function of the training model is written as:

where n is the number of nodes in the output layer. y is the target output value.

The process of training and validating the ANN model involves splitting the data set into training and testing sets. This is typically done using a ratio such as 75% of the data set for the training set and 25% of the data set for the testing set. The training set was used to optimize the model's parameters through backpropagation, during which the model learns to minimize the difference between predicted and target values. Meanwhile, the testing set was used to assess the model's performance on data that was not observed during training, which helped avoid overfitting and underfitting phenomena. This iterative process continues until satisfactory performance is achieved on the testing set, ensuring the model's ability to generalize to unseen data.

In terms of ship motion prediction, the ANN model was trained and validated using historical data from control simulations. After training and validation, the ANN model was used to predict ship motion states, as depicted in Fig. 4. The input data can include variables such as x0 coordinate, y0 coordinate and heading angle, while the output data represents ship control parameters such as rudder angle and propeller revolution. Using mathematical models in ship maneuvering and the 4th-order Runge–Kutta method, ship motion states (surge velocity, sway velocity, yaw rate, x0 coordinate, y0 coordinate and heading angle) were calculated and continuously updated as input data for the ANN model.

### 3.2 Simulation and prediction interface

The entire process of control simulation and ship motion state prediction was performed using the visualization interface shown in Fig. 5. This approach provides users with direct observation of the ship motion behavior and makes it easy to adjust to parameters or algorithms when required. The use of the visualization interface for simulation enables rapid responses to ship motions in real-time.

By adjusting the adjustment bar of the control simulation interface, the rudder angle and propeller revolution values were continuously changed and updated in the ship motion model. Furthermore, the interface provides immediate feedback by displaying the ship motion states during control. The ship docking control simulation aims to generate a variety of data as training data for the ANN model. The richer the training data, the easier it is for the ANN model to capture the complex relationship between input values and output values. To achieve this, the control simulation was performed with the same origin coordinates but with various initial heading angles both in calm water and in waves. The test conditions are described in Table 3.

The initial and final states of the ship motion can be entered into the ship motion prediction interface. The interface then predicts and displays the next states of ship motion. This integrated approach streamlines workflow and enhances efficiency in directly analyzing and responding to ship maneuvers. The test conditions for predicting ship motion states are designed as shown in Table 4.

## 4. Result

### 4.1 Control simulation for ship docking

In the case of a small planing ship docking, ship speed was 2 knots. The ship moved from a stationary state until it reached the target speed. The rudder angle was adjusted to maneuver the ship toward the dock. When the ship reached the dock, the propeller revolution was reduced to 0 rpm, but ship speed did not suddenly decrease to 0 knots. Based on the ship's existing momentum according to the inertial principle and the geometric characteristics of the small planing ship, the ship continued to move slowly over time. The simulation results of ship docking control in calm water and waves are shown in Fig. 6 and Fig. 7, respectively.

In the wave case, the wave direction of 180° and the wavelength over ship length ratio (λ/L) of 0.5 were chosen for analysis. Notably, the presence of waves significantly influences the docking process. Due to the wave forces, the ship's existing momentum and ship speed decrease faster compared to calm water conditions.

### 4.2 ANN algorithm validation

Before training an ANN model, the structure off the ANN model must be determined. The neural network structure includes activation functions, the number of hidden layers, the number of nodes in each hidden layer, and the number of epochs. A well-defined structure ensures that the ANN has the necessary complexity to adequately solve a given problem while optimizing computational efficiency and resource utilization. Moreover, determining the model structure is crucial to achieving optimal generalization performance. The Multi-Layer Perceptron Regressor (MLPRegressor) method was employed to determine the model structure. The structure is selected based on the minimum MSE value between the predicted and target values in the training data. To choose an effective and suitable model structure for any given problem, it is necessary to test different model structures on the same training data. A variety of ANN model structures are assumed. Activation functions include ReLu, Tanh, Sigmoid and Linear. The number of nodes in each hidden layer is assumed to be the same. The number of hidden layers is set to [1,2,3,4,5] and the number of nodes in each hidden layer is set to [3,6,9,12,15]. Each component of the ANN model structure is permuted and continuously updated into the MLPRegressor model. The results of the MSE value for the ANN model structure are shown in Fig. 8. The components of the ANN model structure with the minimum MSE value were selected. The optimized ANN model structure includes 5 hidden layers, 15 nodes in each hidden layer, 5000 epochs and the ReLu activation function.

Once the ANN model structure is determined, model validation should be performed using test data to ensure the model's ability to generalize to unseen data. The validation results of the ANN model are presented in Fig. 9, depicting the predicted rudder angle and propeller revolution. The comparison of the predicted values and target values in the testing data shows a good fit for the target values. In addition, the model loss, which measures the disparity between training and validation values, is minimal. Therefore, these results indicate the ANN model's effectiveness in the prediction process.

### 4.3 Next motion state prediction for ship docking

The ANN model was trained and then used to predict ship motion states using the results for ship docking control simulation in calm water in Fig. 6. As shown in Table 4, the next motion states were predicted at the initial heading angles of 23.3° and -38.8°. The prediction process is complete when the error between the predicted motion state and the target final state is within 5%. Similarly, in the case of waves, the ANN model was trained based on simulated results for ship docking control simulation in Fig. 7. Predictions off next motion states are made at initial heading angles of 55.2° and -10.4°, with the prediction process ending when the error is within 10%. The results for motion state prediction in calm water and waves are shown in Fig. 10 and Fig. 11, respectively. It's worth noting that under the influence of the training data, ship speed in the predicted final state has not yet reached zero. However, automatic navigation while docking the ship in the ballistic phase has been completed.

The performance of the ANN model and the quality of the predicted results depend on the quality of the training data. To achieve this, data obtained from free-running model tests in the experiment or sea trial data should be applied. These data sets can provide valuable insight into the dynamics of small planing ship's docking operations, providing a more comprehensive representation of real-world scenarios. In addition, maneuvering small ships at low speeds also causes yaw rotating motion. This rotation increases the complexity of the docking process, which must be accounted for in the training data and model structure.

## 5. Conclusion

In our study, the ANN model is trained based on the control simulation results of ship docking in calm water and wave conditions. The ANN prediction model accurately predicted the motion states of small planing ship during docking. The concluding remarks are as follows:

First, ship motion states were simulated by controlling the rudder angle and propeller revolution at various initial heading angles. Due to the influence of the principle of inertia and the geometric characteristics of small planing ship, the ship continues to move slowly over time when the propeller is stopped.

Second, the ANN model is trained and validated using control simulation data. The ANN model structure has been optimized to suit the prediction problem under various environmental conditions.

Third, given any initial motion state, the next motion states of the ship are predicted. The ship was maneuvered automatically and successfully docked during the ballistic phase.

Fourth, the reliability of the ANN method is assessed as high by evaluating the model loss value. Therefore, the ANN model performs well in predicting ship motion states during docking. In addition, the ANN model is useful in developing a ship dynamic model to respond to the motion states of small planing ship in real-time. The ANN prediction model can be combined with the automatic positioning system of small ships in the real world to predict motion status, detect abnormal motion, and predict collision avoidance.

Finally, the ship was successfully maneuvered to dock automatically during the ballistic phase. However, to improve the prediction performance of the ANN model as well as the results of predicting motion states in ship docking, some problems should be considered in future research such as: expanding training data with experimental data and sea trial data, considering more dynamic environmental, considering yaw rotation phenomenon, considering systematic or random errors and evaluating prediction performance between prediction techniques in machine learning.

## Acknowledgements

This work was supported by the National Research Foundation of Korea(NRF) grant funded by the Korea government(MSIT) (NRF-2022R1A2C1093055).