# Ship Steering Control Based on Quantum Neural Network

Authors: Wei Guan; Haotian Zhou; Zuojing Su; Xianku Zhang; Chao Zhao
Journal: Complexity
 (2019)

---

## Abstract

During the mission at sea, the ship steering control to yaw motions of the intelligent autonomous surface vessel (IASV) is a very challenging task. In this paper, a quantum neural network (QNN) which takes the advantages of learning capabilities and fast learning rate is proposed to act as the foundation feedback control hierarchy module of the IASV planning and control strategy. The numeric simulations had shown that the QNN steering controller could improve the learning rate performance significantly comparing with the conventional neural networks. Furthermore, the numeric and practical steering control experiment of the IASV BAICHUAN has shown a good control performance similar to the conventional PID steering controller and it confirms the feasibility of the QNN steering controller of IASV planning and control engineering applications in the future.


---

## Body

## 1. Introduction

In the past decade, the research on intelligent automatic surface ship (IASV) technology in academic and marine industries has continued to grow. These developments have been fuelled by advanced sensing, communication, and computing technology together with the potentially transformative impact on automotive sea transportation and perceived social and economic benefits [1–5]. The ship planning and control strategy for IASV, shown in Figure 1, which based on a module-based hierarchical structure, would be a good navigation strategy. It includes the global routing planning module, behaviour decision-making module, local motion planning module, and feedback control module. These modules are in charge of the different tasks especially the feedback control module is the foundation module as action part of the IASV navigation process. The key function of this module is the IASV steering operation to maintain or change ship course. In this paper, a quantum neural network (QNN) for ship steering control is proposed to address the ship steering control problem based on the IASV planning and control concept.Figure 1
IASV planning and control strategy.As a good research foundation of the IASV steering control problem, many effective steering feedback control methods had been surveyed. The ship steering control based on proportional-integral-derivative (PID) strategy is simple and easy to construct. However, the conventional PID occupies the necessary basic controller role in process control, but it is not the trend of controller design due to the lack of learning and adaption capabilities. In addition, the controller parameters are required adjustments in varying conditions, which are time consuming and may not achieve accurate control performance. To solve the issues and obtain better performance, various advanced control strategies have been proposed for the steering control of the ship in recent years, such as adaptive steering control strategy [6–8], steering control strategy based on fuzzy logic algorithm [9, 10], steering controller based on Backstepping controller design method [11–13], and adaptive backstepping method [14, 15]. The robust control schemes such as the sliding mode control method [16, 17] and H∞ robust control algorithm [18] are also utilized in the ship steering control to achieve better ship course keeping and changing manoeuver.Since the 1990s, with the introduction of the artificial neural network into the ship steering controller design, experts and scholars had gradually increased ship steering control research on this issue. Witt et al. proposed a PID steering controller to train a neural network, where the output signal of the PID controller acts as the teacher signal and the simulation results showed that the control effects of the PID controller and the neural network controller have basically the same course control effect [19]. Hearn et al. proposed an online course control neural network to improve the conventional PID steering control effects, but the slow convergence of the ship steering controller based on the neural network is still a big problem to be solved [20].In order to overcome the shortcomings of the conventional neural network, a ship steering controller based on the QNN is proposed in this paper under the concept of quantum computing [21–23]. The concept of QNN was first proposed by Toth et al. in 1996 [24]. Then, Matsui et al. used a quantum bit and the quantum revolving door to design a QNN for information processing and expression [25]. Another group of Japanese scholars, Kouda et al., summarized their previous research and summed up an emerging model, which is a quantum neuron model based on general quantum logic gates [26]. In 2018, Jeswal and Chakraverty introduced the latest developments of QNN and discussed the application of QNN [22]. And Xie et al. took the general quantum logic gates as the basis function to design a quantum neural computing network, and the simulation results indicated that the QNN is superior to the classical BP neural network and the radial basis function (RBF) neural network computing model in the financial data analysis [27]. Li and Li also pointed out that QNN based on general quantum gate evolution can improve the convergence performance of the conventional BP neural network [28]. Besides, the QNN has been applied to signature verification [29], audio watermarking [30], cardiovascular diseases risk prediction [31], classification recognition of electronic shock fault [32], and English to Hindi machine translator [33] and other fields.Motivated by the above observations, a QNN steering controller would be applied to the IASV steering to yaw control. Hence, the remainder of the paper is organized as follows. In Section2, the mathematical model of the IASV steering to yaw motion is given. Section 3 devotes to a systematic procedure for the QNN steering controller design. In Section 4, the numeric comparison simulations for the QNN steering controller and conventional neural networks steering controller were firstly carried out to demonstrate the faster learning convergence of the proposed QNN steering controller. Then, a numeric and practical experiment on smart IASV BAICHUAN has shown the feasibility of the QNN steering controller in practical engineering practice. Finally, Section 5 gives the conclusions of the paper.


## 2. IASV Mathematical Model

While a mathematical model of the IASV is fully described by coupled nonlinear differential equations, a simple model with predictive capability is usually preferred for the design of a ship-steering autopilot. A three-degree-of-freedom plane motion including surge, sway, and yaw motion is considered satisfactory. However, roll motion cannot be neglected due to couplings and hence a four-degree-of-freedom plane motion including surge, sway, yaw, and roll motion is used to describe the motion of a ship. Consequently, a fourth-order transfer function relating to the yaw rate to rudder deflection is derived based on the linearized equations of motion. Nevertheless, a fourth-order transfer function is further reduced to a second-order Nomoto model and then to a first-order Nomoto model for ease of controller design. The first-order Nomoto model, fromδ to yaw rate r is presented as(1)rsδs=K1+Ts,where r is the yaw rate, δ is the rudder deflection, T is the time constant of IASV maneuverability, and K is defined as the steering control gain constant of IASV maneuverability. The parameters K and T that describe the ship steering to yaw dynamics can be identified from standard maneuvering tests. Since r is the time derivative of the yaw angle ψ, the transfer function relating to the yaw angle to steering movement can be obtained by adding an integrator (1/s) to the first-order Nomoto model of (1), then we can get(2)ψsδs=Ks1+Ts,and the corresponding differential equation can be expressed as(3)Tψ¨+ψ˙=Kδ.The model presented in (3) is modified to include a nonlinear steering condition as discussed in [6], wherein the yaw rate ψ˙ term is replaced by a nonlinear function Hψ˙. Then, we can get the following equation:(4)Tψ¨+Hψ˙=Kδ,where(5)Hψ˙=α0+α1ψ˙+α2ψ˙2+α3ψ˙3.Because of the symmetrical structure of ships, the parametersa0=a2=0 [34] and α1 is set as +1 for stable ships and −1 for unstable ones, while the value of α3, known as the Norbin coefficient [14], can be determined via the ship turning test.


## 3. QNN Steering Controller Design

In this section, a quantum neural network model was constructed for the ship steering controller design to enhance the convergence performance of the conventional neural network steering controller.


### 3.1. The Quantum Neuron Model

The structure of the quantum neuron model based on the quantum logic gate is defined as Figure2, including the input part, phase rotation part, aggregation part, reverse rotation part, and output part. The details of the quantum neural networks working processes are shown as the following steps:Step 1: letxi=costi,sintiT, and define the qubit phase rotation gate as(6)Rθ=cosθ−sinθsinθcosθ.Then, with the aggregation, we can get(7)∑i=1nRθixi=cosθsinθT,whereθ=arg∑i=1nRθixi=argtan∑i=1nsinti+θi/∑i=1ncosti+θi.Step 2: the result of equation (7) makes the reverse rotation operation by the controlled-NOT gate as follows:(8)Uγ=cosfγπ2−2θ0−sinfγπ2−2θ0sinfγπ2−2θ0cosfγπ2−2θ0,wheref is the sigmoid function; then, we can get(9)Uγ∑i=1nRθixi=cosπ2fγ−θsinπ2fγ−θT.Therefore, the relationship between the input and output of the quantum neuron model can be described as(10)y=sinπ2fγ−θ=sinπ2fγ−arg∑i=1nRθixi.Figure 2
The quantum neuron model.


### 3.2. QNN Model

Based on the quantum neuron model, a quantum neural network for the ship steering controller design is constructed as shown in Figure3. The proposed neural network has three layers including an input layer, hidden layer, and output layer. The concept of QNN is applied to the layer that is between the input layer and the hidden layer; there are n quantum neurons in the input layer, m quantum neurons in the hidden layer, and p conventional neurons in the output layer.Figure 3
The quantum neuron networks model.Assuming the input variable isxi, the output of the hidden layer is hj, the output of the QNN is yk, Rθij is the quantum rotation gate between the input layer and the hidden layer to update the qubits, and wjk is the network weight for the hidden layer and the output layer. Taking the qubit-controlled NOT-gate Uγj as the transfer function of the hidden layer, then the output of the QNN can be expressed as(11)yk=g∑j=1mwjkhj=g∑j=1mwjksinπ2fγj−arg∑i=1mRθijxi,where i=1,2,…,n; j=1,2,…,m; and k=1,2,…,p.


### 3.3. The Learning Algorithm of QNN

To apply the QNN in practical engineering, the training samples should be transformed into the quantum states. For example, then-dimensional Euclidean space training sample X¯=x¯1,x¯2,…,x¯nT can be defined as the corresponding quantum state as(12)X=x1,x2,…,xnT,where(13)xi=cos2π1+exp−x¯i0+sin2π1+exp−x¯i1=cos2π1+exp−x¯i,sin2π1+exp−x¯iT.In the three layers of the QNN model as described in Figure3, there are 3 groups of parameters, namely, phase rotation parameters θij, reverse parameters γj, and network weights wjk needed to be updated. Firstly, define the error evaluation function as(14)E=12∑k=1pdk−yk2,where dk and yk are the desired outputs and actual outputs of the normalized quantum neural network, respectively. Let xi=cosφi,sinφiT and βj=arctan∑i=1nsinφi+θij/∑i=1ncosφi+θij, then equation (11) could be rewritten as(15)yk=g∑j=1mwjksinπ2fγj−βj.Let(16)Sj=∑i=1nsinφi+θij∑i=1ncosφi+θij,Sj1=∑i=1ncosφi+θij,Tj=cosφi+θijSj1+sin2φi+θijSj12.According to the gradient descent method, we can get(17)Δθij=−∂E∂θij=−∑k=1pdk−ykg′wjkcosπ2fγj−βjTj1+Sj2,Δγj=−∂E∂γj=π2∑k=1pdk−ykg′wjkcosπ2fγj−βjf′,Δwjk=−∂E∂wjk=dk−ykg′sinπ2fγj−βj.Therefore, the updated rules for phase rotation parametersθij, reverse rotation parameters γj, and network weights wjk are(18)θijt+1=θijt+ηΔθijt,γjt+1=γjt+ηΔγjt,wjkt+1=wjkt+ηΔwjkt,where η is the learning rate of the QNN.


### 3.4. Teacher Controller of QNN

In this paper, the conventional PID steering control controller is acted as the teacher of the QNN controller. The input variable of the PID controller is the heading deviationΔψ, and the linear combination of the proportion, integration, and differentiation of the heading deviation Δψ is used as the output value of the PID controller. The command steering angle δk can be expressed as(19)δk=kpΔψk+ki∑j=0kΔψj+kdΔψk−Δψk−1,where kp, ki, and kd are the controller proportion parameter, integral parameter, and differential parameter, respectively, and k is the sampling time (k=0,1,2,…).


### 3.5. Design of the QNN Steering Controller

In this section, a three layer 2-5-1 QNN model was constructed. The structure of the QNN steering control system is shown in Figure4. The two inputs of the QNN steering controller are the heading deviation Δψk and yaw rate rk, respectively, and the output is the command steering angle δrQNNk. The difference between the QNN steering controller outputs and PID course keeping controller outputs is defined as the system error. The mean square of the system error (MSE) is defined as the performance evaluation function of the proposed QNN to evaluate the performance of the QNN learning performance and optimized targets. Generally, its value is set as 0.00001. The activation function of the QNN hidden layer and the output layer is defined as hyperbolic tangent sigmoid function (tan-sigmoid) to accelerate the QNN training and convergence performance in the training process. The gradient descent with a quasi-Newton algorithm [35] is offered to the QNN training, and the momentum parameter of the quasi-Newton algorithm is set as 0.8. The initial values of the QNN weights are randomly generated between the intervals (−1, 1), and the learning rate η of QNN is set as 0.1.Figure 4
IASV QNN-steering autopilot structure.


## 3.1. The Quantum Neuron Model

The structure of the quantum neuron model based on the quantum logic gate is defined as Figure2, including the input part, phase rotation part, aggregation part, reverse rotation part, and output part. The details of the quantum neural networks working processes are shown as the following steps:Step 1: letxi=costi,sintiT, and define the qubit phase rotation gate as(6)Rθ=cosθ−sinθsinθcosθ.Then, with the aggregation, we can get(7)∑i=1nRθixi=cosθsinθT,whereθ=arg∑i=1nRθixi=argtan∑i=1nsinti+θi/∑i=1ncosti+θi.Step 2: the result of equation (7) makes the reverse rotation operation by the controlled-NOT gate as follows:(8)Uγ=cosfγπ2−2θ0−sinfγπ2−2θ0sinfγπ2−2θ0cosfγπ2−2θ0,wheref is the sigmoid function; then, we can get(9)Uγ∑i=1nRθixi=cosπ2fγ−θsinπ2fγ−θT.Therefore, the relationship between the input and output of the quantum neuron model can be described as(10)y=sinπ2fγ−θ=sinπ2fγ−arg∑i=1nRθixi.Figure 2
The quantum neuron model.


## 3.2. QNN Model

Based on the quantum neuron model, a quantum neural network for the ship steering controller design is constructed as shown in Figure3. The proposed neural network has three layers including an input layer, hidden layer, and output layer. The concept of QNN is applied to the layer that is between the input layer and the hidden layer; there are n quantum neurons in the input layer, m quantum neurons in the hidden layer, and p conventional neurons in the output layer.Figure 3
The quantum neuron networks model.Assuming the input variable isxi, the output of the hidden layer is hj, the output of the QNN is yk, Rθij is the quantum rotation gate between the input layer and the hidden layer to update the qubits, and wjk is the network weight for the hidden layer and the output layer. Taking the qubit-controlled NOT-gate Uγj as the transfer function of the hidden layer, then the output of the QNN can be expressed as(11)yk=g∑j=1mwjkhj=g∑j=1mwjksinπ2fγj−arg∑i=1mRθijxi,where i=1,2,…,n; j=1,2,…,m; and k=1,2,…,p.


## 3.3. The Learning Algorithm of QNN

To apply the QNN in practical engineering, the training samples should be transformed into the quantum states. For example, then-dimensional Euclidean space training sample X¯=x¯1,x¯2,…,x¯nT can be defined as the corresponding quantum state as(12)X=x1,x2,…,xnT,where(13)xi=cos2π1+exp−x¯i0+sin2π1+exp−x¯i1=cos2π1+exp−x¯i,sin2π1+exp−x¯iT.In the three layers of the QNN model as described in Figure3, there are 3 groups of parameters, namely, phase rotation parameters θij, reverse parameters γj, and network weights wjk needed to be updated. Firstly, define the error evaluation function as(14)E=12∑k=1pdk−yk2,where dk and yk are the desired outputs and actual outputs of the normalized quantum neural network, respectively. Let xi=cosφi,sinφiT and βj=arctan∑i=1nsinφi+θij/∑i=1ncosφi+θij, then equation (11) could be rewritten as(15)yk=g∑j=1mwjksinπ2fγj−βj.Let(16)Sj=∑i=1nsinφi+θij∑i=1ncosφi+θij,Sj1=∑i=1ncosφi+θij,Tj=cosφi+θijSj1+sin2φi+θijSj12.According to the gradient descent method, we can get(17)Δθij=−∂E∂θij=−∑k=1pdk−ykg′wjkcosπ2fγj−βjTj1+Sj2,Δγj=−∂E∂γj=π2∑k=1pdk−ykg′wjkcosπ2fγj−βjf′,Δwjk=−∂E∂wjk=dk−ykg′sinπ2fγj−βj.Therefore, the updated rules for phase rotation parametersθij, reverse rotation parameters γj, and network weights wjk are(18)θijt+1=θijt+ηΔθijt,γjt+1=γjt+ηΔγjt,wjkt+1=wjkt+ηΔwjkt,where η is the learning rate of the QNN.


## 3.4. Teacher Controller of QNN

In this paper, the conventional PID steering control controller is acted as the teacher of the QNN controller. The input variable of the PID controller is the heading deviationΔψ, and the linear combination of the proportion, integration, and differentiation of the heading deviation Δψ is used as the output value of the PID controller. The command steering angle δk can be expressed as(19)δk=kpΔψk+ki∑j=0kΔψj+kdΔψk−Δψk−1,where kp, ki, and kd are the controller proportion parameter, integral parameter, and differential parameter, respectively, and k is the sampling time (k=0,1,2,…).


## 3.5. Design of the QNN Steering Controller

In this section, a three layer 2-5-1 QNN model was constructed. The structure of the QNN steering control system is shown in Figure4. The two inputs of the QNN steering controller are the heading deviation Δψk and yaw rate rk, respectively, and the output is the command steering angle δrQNNk. The difference between the QNN steering controller outputs and PID course keeping controller outputs is defined as the system error. The mean square of the system error (MSE) is defined as the performance evaluation function of the proposed QNN to evaluate the performance of the QNN learning performance and optimized targets. Generally, its value is set as 0.00001. The activation function of the QNN hidden layer and the output layer is defined as hyperbolic tangent sigmoid function (tan-sigmoid) to accelerate the QNN training and convergence performance in the training process. The gradient descent with a quasi-Newton algorithm [35] is offered to the QNN training, and the momentum parameter of the quasi-Newton algorithm is set as 0.8. The initial values of the QNN weights are randomly generated between the intervals (−1, 1), and the learning rate η of QNN is set as 0.1.Figure 4
IASV QNN-steering autopilot structure.


## 4. Simulations and Analysis

In this section, a series of simulations were used to illustrate the fast convergence characteristics and practical engineering effectiveness of the proposed controller. Especially an IASV BAICHUAN is utilized as a practical experiment for validations of the proposed QNN steering controller. TakeK=0.6, T=1.866, a1=1, and a3=−9.44×10−6 as the dynamic parameters of the second-order Nomoto ship model equation (4) for IASV BAICHUAN. Set kp=2, ki=0.00001, and kd=1.5 as tuning parameters of the teacher controller equation (19). In the simulations, the initial course of the IASV was set as 000° and the desired course keeping angle was set as 090°. The simulation time was set as 50 s, and the sampling period was set as 0.05 s. From the result of the simulations shown in Figure 5, it can be seen that the PID steering controller, which acted as the teacher of the QNN controller, could track the desired course after 13s, and the result shows that the PID controller is satisfactory to act as a suitable teacher of the QNN steering controller.Figure 5
The PID steering control results.To illustrate the practical effectiveness of the proposed QNN steering control system, as shown in Figure4, during the QNN steering controller training, the values of phase rotation parameters θij, reverse rotation parameters γj, and network weights wjk would be updated according to equation (18) by using the training data set extracted from PID controller simulation results in Figure 5.For comparison, a conventional BP neural network steering controller is also trained using the same training data set extracted from the PID control results in Figure5. To emphasize the advantages of the faster convergence and fewer learning iterations, the QNN steering controller and BP neural network steering controller were trained 8 times, respectively, and then the epochs in each training time are shown in Figure 6. For the BP neural network, the maximum number of training epoch is 9565 (in the 6th training time), the minimum training epoch is 4325 (in the 2nd training time), and the average number of training epochs for the 8 training times is 7022. Although, for the QNN, the maximum number of training epoch is 4625 (in the 2nd training time), the minimum training epoch is 1526 (in the 4th training time), and the average number of sample training epoch of the 8 training times is 3302. Therefore, it can be concluded that the QNN steering controller is improved significantly in the convergence rate compared with the conventional BP neural network steering controller.Figure 6
The epochs of eight training times.To validate the effectiveness of the trained QNN steering controller, an IASV BAICHUAN QNN steering control simulation was carried out. The weightswjk of the QNN controller were extracted from the 2nd training time and selected as the initial weights of the IASV BAICHUAN QNN steering controller. The values are detailed in Table 1. Then, the simulation result are shown in Figure 7.Table 1
The weights and parameters of the QNN steering controller.
w
13
w
14
w
15
w
16
w
17
w
23
w
24
w
25
w
26
w
27
w
38
w
48
w
58
w
68
w
78
b
1
b
2
b
3
b
4
b
5
b
6
0.0026
−0.165
−0.0012
0.0074
−0.0075
−0.0133
0.1705
−0.0001
0.0230
−0.0233
−0.0190
0.0038
0.0010
0.0271
−0.0275
0.0013
0.0003
−0.0003
0.0026
6.4116
6.4114Figure 7
The course keeping simulation results for the PID and QNN steering controller.It can be seen from Figure7 that the QNN steering controller could track the desired course at about 13 s. The control result is very similar to the PID controller. It can be concluded that the proposed QNN steering controller has a very strong learning ability and could be widely applied to various fields.To further confirm the proposed QNN steering controller performance, an IASV BAICHUAN course keeping practical engineering experiment was carried out. The experiment environment is shown in Figure8. The wind direction of the experiment scene was northwest (310°–330°), and the wind velocity varied from 0–0.20 m/s. The temperature was about 8°C. The maximum wave height was about 0–0.05 m. The initial course of the IASV is set at 000°, and the desired course keeping angle is set as 090°. The QNN steering controller’s initial parameters are also set as Table 1. Also the PID steering control experiment was carried out for comparison. The parameter of the PID steering controller was also set as kp=2, ki=0.00001, and kd=1.5, as mentioned above. The sampling period of the QNN steering controller and PID steering controller are set as 0.05s, respectively. Finally, the experiment results are shown in Figure 9.Figure 8
The scene of the experiment.Figure 9
The practical course keeping control results of IASV BAICHUAN.The left side of Figure9 shows the course keeping control effect, and the right side shows the output of the IASV BAICHUAN steering control. It can be seen that the rising time of the QNN steering controller is slightly slower than the PID controller, but both controllers can reach the target course rapidly and both of them can achieve a good course keeping control effect. As it can be seen on the right side of Figure 9, the controller output of the two type steering controller is basically the same and the time to reach the static stabilities are also similar, but the response of the QNN steering controller is also slightly slower (about one second) than the PID steering controller.To further quantify the controller performance, the controller efficiency function (CEF) is defined as(20)CEF=1n∑k=1nΔψk2+∑k=1nΔδk2.Then, we can obtain that the CEF of the QNN steering controller is 0.323 and the CEF of the PID steering controller is 0.299. Hence, it is concluded that the control efficiency of the QNN steering controller can get a similar control effect compared with the PID steering controller for the IASV course keeping.Remark 1.
From the numeric simulation and practical engineering experiment, it can be seen that the proposed QNN steering controller has a slightly delayed response compared with the PID steering controller, although the delayed response phenomenon is not obvious in the numeric simulations. The reason of the delayed response phenomenon might be caused by the larger computation burden of the QNN steering controller. This is a potential disadvantage of the QNN. However, due to the features of strong learning ability and fast convergence performance, the proposed QNN steering controller could be used in learning of other advanced controllers, not only restricted in the PID controller. Therefore, the proposed QNN steering controller might be a universal controller design structure and scheme for the future IASV steering feedback control module.


## 5. Conclusions

In this paper, a QNN steering controller design method based on the planning and control concept is proposed. Through the numeric simulations of the steering controller based on the conventional BP neural network and QNN, it can be inferred that the QNN steering controller has a faster convergence rate than the conventional BP neural network steering controller. Also, the numeric simulation results show that the QNN steering controller has a similar course keeping control performance comparing with the training teacher PID steering controller. Furthermore, the practical QNN steering control experiment on an IASV BAICHUAN has shown that the proposed QNN steering controller is feasible to be equipped to a practical IASV for steering to yaw control in the future IASV planning and control engineering. Especially the strong learning characteristics and efficient convergence performance of the QNN steering controller might be the developing trend of the advanced IASV steering controller. However, the QNN steering controller proposed in this paper might be the first step to apply the advanced AI controller to the IASV. Furthermore, the proposed QNN controller structure could apply to other marine control engineering practices.



---

*Source: 3821048-2019-12-17.xml*