# Deep Reinforcement Learning-Based Path Control and Optimization for Unmanned Ships

Authors: Di Wu; Yin Lei; Maoen He; Chunjiong Zhang; Li Ji
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

Unmanned ship navigates on the water in an autonomous or semiautonomous way, which can be widely used in maritime transportation, intelligence collection, maritime training and testing, reconnaissance, and evidence collection. In this paper, we use deep reinforcement learning to solve the optimization problem in the path planning and management of unmanned ships. Specifically, we take the waiting time (phase and duration) at the corner of the path as the optimization goal to minimize the total travel time of unmanned ships passing through the path. We propose a new reward function, which considers the environment and control delay of unmanned ships at the same time, which can reduce the coordination time between unmanned ships at the same time. In the simulation experiment, through the quantitative and qualitative results of deep reinforcement learning of unmanned ship navigation and path angle waiting, the effectiveness of our solution is verified.


---

## Body

## 1. Introduction

Unmanned ships are intelligent platforms that rely on shipboard sensors to navigate in an autonomous or semiautonomous manner on the surface of the water and can be widely used in the fields of marine transportation, antimine, and antisubmarine. The unmanned ship is an important node in the networked unmanned system, which will overturn the traditional naval warfare style and give rise to a new marine equipment system and is of great significance to the development of marine resources and the maintenance of national maritime rights and interests [1]. Compared with other unmanned systems, unmanned ships face special challenges such as harsh marine environment (e.g., strong wave and current surges) and special characteristics of unmanned ship motion models (e.g., highly nonlinear model, strong time lag, and time variability) [2].Path planning [3, 4] is a very important technique in the field of unmanned ships, attracting the attention of countless researchers. Depending on the planning method, there are two different types of path planning: point-to-point and full-coverage traversal. If the basic information about the entire environment is known to the unmanned vessel during the completion of the task, this is called global path planning, and the main algorithms include greedy algorithms, genetic algorithms, and others [5–7]. If the unmanned vessel can know part of the environmental information during the work process and cannot grasp the full information, this is called local path planning, and the main algorithms include potential field method [8], fuzzy control method [9], and neural network [10, 11].In recent years, with the rapid progress of high-performance computing, big data, and deep learning technology, the core technology of artificial intelligence software, reinforcement learning algorithms, and their applications have been more widely focused and developed more rapidly [12]. In particular, the combination of reinforcement learning and deep learning has led to several breakthroughs in deep reinforcement learning, and the game between AlphaGo and top human chess players has led to a wider interest in deep reinforcement learning in academia and industry. Not only has reinforcement learning been a great success in computer gaming, but it is also considered to be the most promising approach to advanced artificial intelligence in areas such as unmanned ship control, inverted pendulum control, and intelligent driving of steam unmanned ships [13–16].Standard QL algorithms generally give theQ values an initial value and let them start at 0 or a random number, so unmanned ships lack a priori knowledge of the environment, and convergence is slow. During the learning process, it is difficult to weigh long-term and short-term benefits, and it is easy to fall into trap regions when faced with a “symmetric dilemma.” Therefore, the convergence of QL algorithms, balanced exploration, and exploitation, as well as dangerous regions and incomplete access to state-action pairs, has become the focus of reinforcement learning research.This paper uses reinforcement learning for local path planning of mobile unmanned ships to improve the planning efficiency of optimal paths for unmanned ships. The research objectives are to solve the problems of slow convergence, exploration, and exploitation dilemmas as well as trap regions and incomplete access to state-action pairs of the reinforcement learning algorithm, to speed up the path planning efficiency, and to find the control rules for the optimal path from the starting point to the endpoint.


## 2. Related Works

### 2.1. Path Optimization

Based on the situational awareness map, the unmanned vessel navigation planning and navigation consider mission requirements, safety, efficiency, rules, maneuverability, and uncertainty to calculate the key elements of planning and navigation and form intercompatible commands with different granularity, so that the unmanned vessel can be effective while satisfying the navigation safety envelope. Unmanned vessel navigation planning and navigation face special challenges, such as many maritime rules with fuzzy properties, the large time lag in the hull model, high inertia, and large differences between different vessel types. [17] proposes a predictor for estimating the sideslip angle of an unmanned ship to achieve path following based on predicted line of sight. [18] uses an extended state observer for real-time estimation of unmanned ship sideslip angle and combines it with line-of-sight navigation to solve the path-following problem under disturbing conditions. [19] proposed global and local route planning based on Dijkstra and artificial potential field methods. [20] proposed inverse adaptive sliding mode control in the Serret-Frenet coordinate system to solve the path-following problem under model and disturbance uncertainty. [21] implements unmanned ship path-following control based on an improved backstepping method. [22] proposed three PID control methods to solve the linear path-following problem under constant surge disturbance.[23] used evidence-based reasoning to evaluate the hazards and, based on the evaluation results, used mutual collision avoidance algorithms that satisfy maritime collision avoidance rules to achieve real-time safe obstacle avoidance of unmanned vessels [24, 25]


### 2.2. Unmanned Boat Control

Unmanned vessel control solves the problems of dynamic positioning, trajectory tracking, and path tracking during navigation, giving the unmanned vessel the control capabilities of an experienced pilot to successfully and stably perform the various maneuvers required for navigation. With the development of control theory, researchers in the marine field can apply the latest control techniques to unmanned ship control. However, the control of unmanned ships faces challenges such as high model nonlinearity and uncertainty, system underdrive, the time lag in the ship itself and in the actuators, saturation characteristics of the actuators, and unpredictable strong external disturbances.[10, 11] systematically described the progress of research on control of marine electromechanical systems and course keeping of unmanned vessels, respectively. [12] is based on the active method for model identification of unmanned vessels. In [13], model identification of an unmanned boat with integrated propulsion is based on the idea of MMG separation modelling. A robust controller with fast convergence is also proposed based on the idea of multimodel control. The [14] active antidisturbance control law based on compound errors is used to suppress external disturbances. [15] implemented the control of an unmanned ship based on the GPC-PID method and conducted sea trials in the southern Yellow Sea. [16] proposed the robust control with variable delay using smith predictor and extended state observer.


### 2.3. Unmanned Vessel Cluster Control

Single-ship capabilities are particularly weak in the face of vast and hostile oceans. The path-following control layer uses an inverse step and neural network approach. A graph-theoretic approach is used for the speed and route planning layer. [16] designed a layered control architecture for cluster target tracking, cluster obstacle avoidance, and collision avoidance for members within the cluster. The control architecture is divided into three layers: the cluster strategy layer, the motion planning layer, and the control input layer. [17] uses neural optimization for distributed cluster navigation and a fuzzy approach for approximating the model of an unmanned ship for unmanned ship path maneuver cluster control.


## 2.1. Path Optimization

Based on the situational awareness map, the unmanned vessel navigation planning and navigation consider mission requirements, safety, efficiency, rules, maneuverability, and uncertainty to calculate the key elements of planning and navigation and form intercompatible commands with different granularity, so that the unmanned vessel can be effective while satisfying the navigation safety envelope. Unmanned vessel navigation planning and navigation face special challenges, such as many maritime rules with fuzzy properties, the large time lag in the hull model, high inertia, and large differences between different vessel types. [17] proposes a predictor for estimating the sideslip angle of an unmanned ship to achieve path following based on predicted line of sight. [18] uses an extended state observer for real-time estimation of unmanned ship sideslip angle and combines it with line-of-sight navigation to solve the path-following problem under disturbing conditions. [19] proposed global and local route planning based on Dijkstra and artificial potential field methods. [20] proposed inverse adaptive sliding mode control in the Serret-Frenet coordinate system to solve the path-following problem under model and disturbance uncertainty. [21] implements unmanned ship path-following control based on an improved backstepping method. [22] proposed three PID control methods to solve the linear path-following problem under constant surge disturbance.[23] used evidence-based reasoning to evaluate the hazards and, based on the evaluation results, used mutual collision avoidance algorithms that satisfy maritime collision avoidance rules to achieve real-time safe obstacle avoidance of unmanned vessels [24, 25]


## 2.2. Unmanned Boat Control

Unmanned vessel control solves the problems of dynamic positioning, trajectory tracking, and path tracking during navigation, giving the unmanned vessel the control capabilities of an experienced pilot to successfully and stably perform the various maneuvers required for navigation. With the development of control theory, researchers in the marine field can apply the latest control techniques to unmanned ship control. However, the control of unmanned ships faces challenges such as high model nonlinearity and uncertainty, system underdrive, the time lag in the ship itself and in the actuators, saturation characteristics of the actuators, and unpredictable strong external disturbances.[10, 11] systematically described the progress of research on control of marine electromechanical systems and course keeping of unmanned vessels, respectively. [12] is based on the active method for model identification of unmanned vessels. In [13], model identification of an unmanned boat with integrated propulsion is based on the idea of MMG separation modelling. A robust controller with fast convergence is also proposed based on the idea of multimodel control. The [14] active antidisturbance control law based on compound errors is used to suppress external disturbances. [15] implemented the control of an unmanned ship based on the GPC-PID method and conducted sea trials in the southern Yellow Sea. [16] proposed the robust control with variable delay using smith predictor and extended state observer.


## 2.3. Unmanned Vessel Cluster Control

Single-ship capabilities are particularly weak in the face of vast and hostile oceans. The path-following control layer uses an inverse step and neural network approach. A graph-theoretic approach is used for the speed and route planning layer. [16] designed a layered control architecture for cluster target tracking, cluster obstacle avoidance, and collision avoidance for members within the cluster. The control architecture is divided into three layers: the cluster strategy layer, the motion planning layer, and the control input layer. [17] uses neural optimization for distributed cluster navigation and a fuzzy approach for approximating the model of an unmanned ship for unmanned ship path maneuver cluster control.


## 3. Preparation

This section provides an overview of reinforcement learning and the deep reinforcement learning utilised in this paper.Reinforcement learning is the scheme by which an agent infers the best action rule through its interaction with the environment. MDP is defined by a 4-tuple (S, A, P, R). Call S the state space and A the action space, and call the respective original s∈S states and a∈A actions. P:S×A×S⟶0,1 is called the state transfer function and determines the transfer probability to the next state s′ when action a is performed in state s. R:S×A×S⟶R is the reward function.Once a strategy has been formulated, the intelligence can interact with the environment as shown in Figure1. At each moment t, the intelligence in state st decides on action at according to strategy π•st. The next moment of the intelligence’s state st+1~PM·/st,at and reward rt=Rst,at is then decided according to the state transfer function and the reward function. Repeating this action gives the state and action of the intelligence’s history s0,a0,s1,a1,⋯,sT. Subsequently, the state and action that have been repeated for T historical transfers from time 0 are noted as dt.Figure 1
Interaction between agent and environment.Define the value function, which averages the (discounted) reward sum when the actiona is selected in state s and thereafter continued according to the strategy π, as given by
(1)Qπs,a≡limT⟶∞EdTπ∑k=0TγkRsk,ak,sk+1s0=s,a0=a,whereλ∈0,1 is the discount rate and EdTπ represents the average operation about the occurrence mode in policy π. When a policy π, π′ meets Qπs,a≥Qπ′s,a in any s∈S, a∈A, since strategy π can be expected to bring more rewards to the agent than π′; π≥π′ is to strengthen learning and obtain the best method π∗ to meet any scheme π and π∗≥π.The optimal strategy function is obtained by using its value functionQ∗ (the optimal value function) set to π∗a/s=δa−argmaxa′Q∗s,a′. The optimal strategy function is the optimal Bernoulli equation:
(2)Q∗s,a=Es′Rs,a,s′+γmaxa′Q∗s′,a′.The conditions are known to be satisfied and are estimated using the relational formulation above. The representative method is a method calledQ-learning, and many experiments have shown that it works well but is difficult to apply to continuous and large state problems if the state space is discrete and the number of states is not huge.


## 4. Reinforcement Learning for Unmanned Ship Control Mapping

In this subsection, we describe the method proposed in this study for simultaneously controlling the path of movement of an unmanned ship and path corner waiting. We first describe the path corner waiting for optimization problem as a reinforcement learning task by giving details of the state, behaviour, and reward as shown specifically in Figure2.Figure 2
Unmanned boat direction change.


### 4.1. Action Space Definition

The intelligent body must consider the current unmanned vessel signal and the selected action when switching between unmanned vessel signals in order to ensure safety.When the control object is a beacon and an unmanned ship movement path, the action space related to the path corner waiting as a wholessig and the space related to the unmanned ship movement path as a whole are defined as Aveh. Each action space, e.g.,ssig= {north-south, east-west} andAveh= {routeA, routeB, routeC}, the north-south (up and down) direction of the signal turns blue, and the east-west (left and right) direction turns red.Define the action space as the product of the action spacessig for path corner waiting and the action space Aveh for each unmanned ship present, with the size of the action space growing according to the number of unmanned ships.


### 4.2. Path Indicator

We address the onerous task of learning a strategy due to the growth in the number of unmanned vessels in the action space of the intelligence by introducing a virtual machine defined as a path indicator.For definition, a machine that performs the same route indication for all control object drones present in a defined section is called a path indicator.In addition, the “virtual” machine, as it is called here, does not necessarily need a physical counterpart, unlike the usual path corner waiting. For example, even if there is no device that can be seen by the pilot as in the case of path corner waiting, it is possible to use a device that is set remotely to allow the unmanned vessel to receive information within a defined section of road and to act as a path indicator by giving the unmanned vessel information on the path it should take.Based on the above discussion, the action space of the proposed solution is defined as the product of the action space of the path corner wait and the action spaceAveh of the unmanned vessel where each path indicator is present. In the case of the control object area defined in Figure 3, the action space of path indicator 1 is Aveh1 = {indication 1, indication 2}, and the action space of path indicator 2 is Aveh2 = {indication 3, indication 4}. The action space is therefore shown below, with a total number of actions of 2×2×2=8. The definition of equation (3) thus allows the problem of simultaneously optimizing path corner waiting and moving paths to be solved as a practical problem.
(3)A=Aeig×Aveh1×Aveh2⏟Numberofpathindicators.Figure 3
Control object area.


## 4.1. Action Space Definition

The intelligent body must consider the current unmanned vessel signal and the selected action when switching between unmanned vessel signals in order to ensure safety.When the control object is a beacon and an unmanned ship movement path, the action space related to the path corner waiting as a wholessig and the space related to the unmanned ship movement path as a whole are defined as Aveh. Each action space, e.g.,ssig= {north-south, east-west} andAveh= {routeA, routeB, routeC}, the north-south (up and down) direction of the signal turns blue, and the east-west (left and right) direction turns red.Define the action space as the product of the action spacessig for path corner waiting and the action space Aveh for each unmanned ship present, with the size of the action space growing according to the number of unmanned ships.


## 4.2. Path Indicator

We address the onerous task of learning a strategy due to the growth in the number of unmanned vessels in the action space of the intelligence by introducing a virtual machine defined as a path indicator.For definition, a machine that performs the same route indication for all control object drones present in a defined section is called a path indicator.In addition, the “virtual” machine, as it is called here, does not necessarily need a physical counterpart, unlike the usual path corner waiting. For example, even if there is no device that can be seen by the pilot as in the case of path corner waiting, it is possible to use a device that is set remotely to allow the unmanned vessel to receive information within a defined section of road and to act as a path indicator by giving the unmanned vessel information on the path it should take.Based on the above discussion, the action space of the proposed solution is defined as the product of the action space of the path corner wait and the action spaceAveh of the unmanned vessel where each path indicator is present. In the case of the control object area defined in Figure 3, the action space of path indicator 1 is Aveh1 = {indication 1, indication 2}, and the action space of path indicator 2 is Aveh2 = {indication 3, indication 4}. The action space is therefore shown below, with a total number of actions of 2×2×2=8. The definition of equation (3) thus allows the problem of simultaneously optimizing path corner waiting and moving paths to be solved as a practical problem.
(3)A=Aeig×Aveh1×Aveh2⏟Numberofpathindicators.Figure 3
Control object area.


## 5. Improved Reward Function

Deep Policy Gradient (DPG) methods attempt to optimize the policy function iteratively by learning the parameterθ to estimate the gradient of the policy performance. A disadvantage of DPG methods is that they typically lead to high variance in the gradient estimation. This problem arises because the trajectories in the gradient estimation are randomly sampled. That is, the derivative of the log and reward variance of a strategy can be very high.The rewardrt∈R is a scalar value which is the step obtained after each execution of an action by agent, defined as follows:
(4)rt1=Dt−1−Dt,whereDt−1 and Dt are the total cumulative delays between the current and previous times.We can also consider the flow of unmanned vessels in the unmanned ship channel by looking at the occupancy rate, defined as the percentage of the given unmanned ship channel that is full. In addition, we can consider the number of unmanned vessels parked unmanned in the unmanned ship channel as a frustrating phenomenological bonus. Considering the combination of the above parameters, we can positively reward the unmanned boat flow as follows:(5)rt2=Dt−1−Dt+OccupancyNumberOfHaltingVehicles+c,where c∈0,1 is a constant used to prevent division by zero. Intuitively, if the unmanned boats in the unmanned boat lane do not stop to encourage unmanned boat traffic, we will give a positive reward for a full unmanned boat lane.Suppose we have a highway that goes 90 miles per hour. Also, suppose that all the unmanned ships in the graph on the left have a speed of 80 miles per hour. Then, the delay for each unmanned boat is90−80/90=1/9, since there are 3 unmanned boats in the left graph and the delay at t=0 is 1/3. For the graph on the right, suppose that another unmanned boat enters the highway at t=1 at a speed of 80 miles per hour. Then, in this case, the delay at time t=1 is 4/9, and the second reward function is r11=1/3−4/9=−1/9, assuming that each unmanned boat lane can accommodate 10 unmanned boats and c=1.


## 6. Experiment

The starting position of the unmanned ship in the simulation scene is (0 m, 0 m), and the target point is (4.5 m, 4.5 m). The scene is surrounded by a wall with some random obstacles inside. The unmanned ship continuously learns and explores the scene according to the reinforcement learning algorithm proposed in this paper, and once the unmanned ship collides with the obstacles or reaches the target point, the whole scene is reset. The parameters of the simulation experiment are set as follows: learning rateα=0.2, rrea=1, ct=−1 , dwin=0.25 discount rate γ=0.9, rcol=−1 , dcol=0.05, and total training times 5,000 [26, 27].Figure4 shows the path diagrams during training. Figures 4(a)–4(d) are the results of the 423rd, 1,566th, 3,532nd, and 4,879th training sessions, respectively. Because of the high random probability in the early stage of training, our algorithm in Figure 4(a) does not converge, and the unmanned boat collides with the obstacle.Figure 4
Path diagram of the training process.
(a)(b)(c)(d)Figure5 shows the Q values obtained by the unmanned ship at each step during the above training process. (a) to (d) in the figure correspond to (a) to (d) in Figure 3, respectively, and the unmanned ship selects the action with the largest Q value in the current state to execute each time. In (b), (c), and (d), the unmanned boat successfully avoided the obstacles and reached the end point, especially in the late training period when the unmanned boat was approaching the end point. The expected future payoffs for these states were high, and the selection of these actions resulted in higher payoffs, so the Q values were higher, in line with the results that the reinforcement learning method could produce [28].Figure 5
Q value.Figure6 shows the average Q value of each selected action during the training process, and it can be seen from Figure 6 that in the early stage of training, the average Q value is low because the random probability is large and the unmanned ship has gained less knowledge and experience, so the number of times the unmanned ship reaches the target point is low; after the training reaches 1,000 times, the number of times the unmanned ship reaches the target point after learning gradually increases, and the number of times it gains positive reward is increasing, so the averageQvalue gradually increases, i.e., the average cumulative reward value obtained by the unmanned ship for the selected action becomes higher and higher; after that, as the number of training times increases, the number of arriving at the target point becomes more and more, the reward also becomes more and more, the Q value gradually increases, and the algorithm finally converges gradually.Figure 6
AverageQ value during training.Figure7 illustrates the cumulative payoffs (r and ravg are the payoffs and average payoffs, respectively) during the training process. The highest payoff value of 1 is obtained when the unmanned ship reaches the end point, the lowest payoff value of -1 is obtained when a collision occurs, and the corresponding positive payoff is obtained when the unmanned ship moves towards the target point.Figure 7
Payoff values during training.


## 7. Conclusions

In this paper, we use deep reinforcement learning to solve the optimization problem in unmanned boat path planning management; specifically, we take the timing of path corner waiting as the optimization objective to minimize the total travel time of an unmanned boat crossing the path. In the experiments, quantitative and qualitative results of deep reinforcement learning on unmanned ship travel and path corner waiting are reported to verify the effectiveness of our solution.



---

*Source: 7135043-2022-05-11.xml*