A Rapid and Adaptive Alignment under Mooring Condition Using Adaptive EKF and CNN-Based Learning

Alignment of the inertial navigation system (INS) in the mooring environment should take into account the movements of the waves or wind. The alignment of the INS is performed through an extended Kalman filter (EKF) using zero velocity as a measurement. However, in the mooring condition, this is not perfect stationary, thus the measurement error covariance matrix should be adjusted. In addition, if the measurement error covariance matrix is fixed to one value, the alignment time may take longer or the performance may be reduced depending on the change in mooring conditions. To solve this problem, we propose an alignment method using adaptive Kalman filter and convolution neural network (CNN)-based learning. The proposed method was verified for the superiority of alignment time and accuracy through Monte Carlo simulation in a mooring environment.


Introduction
The inertial navigation system (INS) is the most fundamental navigation system that provides position, velocity, and attitude information using the gyro to measure angular velocity and the accelerometer to measure the linear acceleration of the vehicle. The strapdown-based INS calculates navigation solution in the navigation frame from the output of the inertial sensors attached to the body frame through recursive integration and coordinate transformation based on initial information. Therefore, it is necessary to find the initial attitude precisely, and this process is called alignment [1,2].
Alignment in the stationary state is performed using the Earth's rate and gravitational acceleration. To perform the alignment, a gyrocompassing method using a control law or an estimator based on a Kalman filter technique capable of estimating errors of sensors as well as an attitude during alignment has been applied.
The stationary state has a complete zero velocity, thus the alignment process is performed using the zero-velocity information as a measurement in Kalman filter. However, if the alignment is performed in a sea environment, the velocity and attitude are continuously changed by the wind and wave. Therefore, it is essential for navigation systems operated on marine platforms, such as a ship and a submarine, to apply the technique of performing alignment in sea environment [1][2][3].
We conducted a study on Extended Kalman Filter (EKF)-based alignment using INS in a mooring environment. Here, EKF, which is a linearized Kalman filter, is applied with consideration to the integration with the nonlinear system INS. The most crucial point is how to handle this linear velocity and rotation that repeatedly occur in the mooring environment with wind or wave. These movements appear as errors or disturbances that interfere with a stationary condition, thus EKF-based alignment can be performed by setting the measurement error covariance large.
However, in the continuously changing mooring environment, this method may degrade performance depending on changing situations and takes a long time to finish the alignment. Therefore, we propose adaptive methods using adaptive EKF and CNN-based learning for alignment in the mooring environment. The adaptive EKF uses innovation of the measurement to estimate the measurement error covariance matrix continuously, and outputs an adaptive result according to the condition of the measurement. The CNN-based learning method learns the optimal measurement error covariance matrix to minimize the error in changing the mooring environment based on a large number of data.

Related Work
Various methods of using digital filters such as FIR or IIR have been developed to deal with this problem. Lian et al. proposed a method to reduce the effect of acceleration disturbance by using a finite impulse response (FIR) filter [4]. Feng et al. applied the infinite impulse response (IIR) filter and power spectrum analysis to compensate for the disadvantages of the FIR filter that must have a huge order [5]. However, this digital filter method has a delay problem in real-time applications and has limitations due to a fixed filter coefficient in a sea environment in which the magnitude or period of motion continuously changes. Gaiffe et al. proposed an inertial frame-based alignment (IFBA) technique to project gravity on an inertial frame to estimate the coordinate transformation matrix between the inertial frame and the body frame [6]. Since then, this IFBA technique has been used by many researchers for alignment in mooring [5,7,8]. Gao et al supposed a fast alignment method using IFBA, and bidirectional Kalman filter [7], and Sun et al applied the IFBA and hidden Markov model to prevent filter delay for alignment in mooring [8].
As mentioned above, the easiest Kalman filter-based method to perform alignment in the mooring environment is to set the filter coefficients with consideration of movement conservatively. When the zero velocity is used as a measurement in the mooring environment, repetitive changes in velocity or attitude due to wind or waves occur in the form of a sin wave. Since this can be regarded as the large error of the measurement, the Kalman filter should be performed by setting the measurement error covariance matrix R to be larger than the conventional case.
The conventional EKF recursively performs the measurement update and time propagation. The nonlinear system model and measurement model are as follows.
where f is a nonlinear function for the system equation; h is a nonlinear function for the measurement equation; x is a state variable; y is a measurement; w is a noise of the system model; v is noise of the measurement model, which follows a Gaussian Probability Density Function (PDF); Q is system error covariance matrix; and R is measurement error covariance matrix. The results of linearizing and discretizing Equations (1) and (2) and expressing them in error state are as follows [1,3]. where The time update equation of EKF is as follows.
The measurement update equation of EKF is as follows.
The nonlinear error model of the INS system is as follows [1,2], and the system matrix F k refers to Appendix A.
where δV n is a velocity error, δΦ n is an attitude error, δ∇ is an accelerometer error, δε is a gyro error, C n b is a coordinate transformation matrix that converts from body frame to navigation frame, ω n ie is an angular rate due to the Earth rate in navigation frame, ω n en is an angular rate due to the transpose rate in navigation frame, g n is a gravity acceleration in navigation frame, and f b is a specific force in body frame.
where δV n k is an error of propagated north-direction velocity, δV e k is an error of propagated east-direction velocity, δV d k is an error of propagated down-direction velocity. V n k is a measured north-direction velocity, V e k is a measured east-direction velocity, V d k is a measured down-direction velocity, δV n k is an error of measured north-direction velocity, δV e k is an error of measured east-direction velocity, and δV d k is an error of measured down-direction velocity.
However, in the case of using the fixed measurement error covariance matrix, performance and convergence speed of the Kalman filter change according to sea conditions, which change with time or position. In general, assuming that system error covariance matrix Q is appropriately fixed, if the measurement error covariance matrix R becomes small, the filter believes the measurement more.
Since it is judged that the measurement is accurate, the performance is improved, and convergence speed is fast. However, if the error of the actual measurement is larger than the expected measurement error, performance of the filter degrades, and even the filter may diverge.
Conversely, if the measurement error covariance matrix R is large, the filter judges that the error of the measurement is significant. Thus, the convergence speed becomes slow, but the divergence of the filter can be avoided. In other words, if the error of the actual measurement in the mooring environment is similar to the error of the expected measurement, the best result is estimated. Since the error of actual measurement in the mooring environment is changing, conventional EKF using a fixed measurement error covariance matrix may degrade performance. Therefore, we propose two methods for alignment under the mooring condition, as described in the next sections.

Adaptive EKF Based Alignment in Mooring Environment
The adaptive EKF is to adaptively change measurement error covariance matrix R using an innovation sequence, which is defined as the difference between the measured value and the estimated value. The innovation sequence is as follows [9].
where i k is an innovation sequence, z k is a measurement, H is a measurement model matrix, and F is a system model matrix. Substituting the measurement in Equation (15) into Equation (16), Innovation sequence is a kind of indicator of real estimation errors that can be used for the adaptive algorithm. The covariance of innovation is calculated using the above equation and is as follows [9,10].
Therefore, an adaptive measurement error covariance matrix is as follows.
where I k is a covariance of innovation, i k is an innovation, H is an observation matrix, P k|k−1 is a state error covariance, and R k is a measurement error covariance matrix. In the stationary system and noise environment, I k can be calculated by using the average as following equation [17].Î Moreover, converting the above equation to recurrent form is as follows.
Substituting Equation (21) into Equation (19), we can obtain the estimated adaptive measurement error covariance matrix as follows.R At this time, to prevent R from becoming negative in the caseÎ k is too small, the following equation is added. i An innovation is obtained from the measurement, and the covariance of innovation is calculated through data. Since the calculated covariance of innovation represents the condition of the measurement, the measurement error covariance matrix is automatically adjusted according to the current measurement. In other words, if the wave is large, the measurement error is large, so the measurement error covariance matrix R is increased. Conversely, if the wave is small, the measurement error is small, and then the measurement error covariance matrix R is decreased.

Introduction of CNN
In this section, the measurement error covariance matrix R is adjusted according to the wave condition using the trained network. In this paper, convolutional neural network (CNN) is applied to learn time-series sensor data. Recursive neural network (RNN) is generally used to process this kind of time series data. However, this time series data can also be processed as a convolution feature, thus this study uses a one-dimensional convolution network. Compared to RNN, CNN has the advantage of less complexity and reduced computation, and better extraction of data characteristics according to conditions. In fact, in the field of audio generation and machine translation, CNN has shown good results in the past few years.
CNN extracts important characteristic among related data. In other words, CNN is not just learning a list of data as in the multi-layer perceptron (MLP) but learning spatial correlation by assigning local connections between neurons in the adjacent layer. CNN compresses the characteristics of the original signal through convolution. At this time, according to the filter used, a feature map is constructed to output only the characteristics that can best represent the data. The feature map starts from low-level feature information and synthesizes low-level features as the layer deepens to generate high-level features.
Learning using this CNN has the advantage of being able to process many data at a time through a convolution operation, and significantly reducing the number of parameters to be learned through the sharing of weights and the receptive field. In addition, CNN can extract and learn spatial and temporal characteristics of data through spatial/temporal correlation, thus it has a robustness against noise or external disturbance [18].
The input through sensors is continuous time-series data, and data of the previous time and current time are dependent and have a relationship by system model.

Architecture
In this paper, CNN is composed of an input layer that receives sensor input, a convolution layer that performs synthesis, a ReLU activation function that adds nonlinearity, a dropout layer, and an output layer. The output layer consists of a fully connected layer and outputs the measurement error covariance matrix R, as shown in Figure 1.
Sensors 2020, 20, x FOR PEER REVIEW 6 of 20 the sharing of weights and the receptive field. In addition, CNN can extract and learn spatial and temporal characteristics of data through spatial/temporal correlation, thus it has a robustness against noise or external disturbance [18]. The input through sensors is continuous time-series data, and data of the previous time and current time are dependent and have a relationship by system model.

Architecture
In this paper, CNN is composed of an input layer that receives sensor input, a convolution layer that performs synthesis, a ReLU activation function that adds nonlinearity, a dropout layer, and an output layer. The output layer consists of a fully connected layer and outputs the measurement error covariance matrix R, as shown in Figure 1. ω is an angular rate that is the output of gyro, b a is a linear acceleration that is an output of accelerometer, and Conv Set is composed of Conv1d representing one-dimensional convolution layer, Rep_Pad1d, which creates one-dimensional padding by copying the boundary values, ReLU activation function, and Dropout layer. The input of learning is the output of the inertial sensors, which is linear acceleration and angular rate. Since the values have different characteristics, normalization preprocessing is performed using the average and variance of the sensor output. The output is measurement error covariance matrix R, which is the parameter that controls the EKF.

Input Data and Normalization
The network inputs consist of three-axis gyros and accelerometers. When performing alignment during mooring, the ship moves repeatedly depending on the size of the sea waves, so the parameter of the filter must be adjusted according to this movement. Gyros measure rotation and accelerometers measure linear acceleration, thus the networks input is the physical quantity measured by the gyros and accelerometers.
The scale of the physical quantity measured by the gyros and accelerometers is not the same. In the static condition, the acceleration on the horizontal x and y axes is not large. However, the z axis accelerometer measures the Earth's gravitational acceleration, thus it outputs a relatively large value. In addition, the gyros measure the Earth rate, but its size is very small. Therefore, normalization is performed to make the range of all physical quantities equal. Normalization is performed using the mean and standard deviation as shown in Equations (24)-(27). ω b ib is an angular rate that is the output of gyro, a b is a linear acceleration that is an output of accelerometer, and Conv Set is composed of Conv1d representing one-dimensional convolution layer, Rep_Pad1d, which creates one-dimensional padding by copying the boundary values, ReLU activation function, and Dropout layer.
The input of learning is the output of the inertial sensors, which is linear acceleration and angular rate. Since the values have different characteristics, normalization preprocessing is performed using the average and variance of the sensor output. The output is measurement error covariance matrix R, which is the parameter that controls the EKF.

Input Data and Normalization
The network inputs consist of three-axis gyros and accelerometers. When performing alignment during mooring, the ship moves repeatedly depending on the size of the sea waves, so the parameter of the filter must be adjusted according to this movement. Gyros measure rotation and accelerometers measure linear acceleration, thus the networks input is the physical quantity measured by the gyros and accelerometers.
The scale of the physical quantity measured by the gyros and accelerometers is not the same. In the static condition, the acceleration on the horizontal x and y axes is not large. However, the z axis accelerometer measures the Earth's gravitational acceleration, thus it outputs a relatively large value. In addition, the gyros measure the Earth rate, but its size is very small. Therefore, normalization is performed to make the range of all physical quantities equal. Normalization is performed using the mean and standard deviation as shown in Equations (24)-(27).
Since the calculation frequency of the inertial navigation and EKF filter is 10 Hz, the sampling time of the input data for training is 0.1 s. For continuous time series data to output the measurement error covariance matrix R, continuous sensor data of 20 s were used.

Convolution Layer
One-dimensional convolution layer is applied to perform the convolution operation of time series sensor data. The output of the convolution layer is input to the ReLU activation function to add nonlinearity, and the dropout layer is connected to the activation function to reduce the size and give generality. Total convolution layers are composed of six consecutive Conv Sets.
One Conv Set is composed of one-dimensional convolution layer, one-dimensional padding layer, one ReLU, and one dropout layer, as shown in Figure 2.
Since the calculation frequency of the inertial navigation and EKF filter is 10 Hz, the sampling time of the input data for training is 0.1 s. For continuous time series data to output the measurement error covariance matrix R, continuous sensor data of 20 s were used.

Convolution Layer
One-dimensional convolution layer is applied to perform the convolution operation of time series sensor data. The output of the convolution layer is input to the ReLU activation function to add nonlinearity, and the dropout layer is connected to the activation function to reduce the size and give generality. Total convolution layers are composed of six consecutive Conv Sets.
One Conv Set is composed of one-dimensional convolution layer, one-dimensional padding layer, one ReLU, and one dropout layer, as shown in Figure 2. In this paper, the conv1d function provided by PyTorch is applied to construct one-dimensional convolution layer; the length of output sequence is determined by Equation (28).

2
( where o u t L is the length of output sequence, in L is the length of input sequence, P is the length of padding, D is the length of dilation, K is the length of kernel (filter), S : length of stride The values of each parameter for CNN layer used here are shown in Table 1 and the length of the output sequence was designed to remain the same as the length of the input sequence.  In this paper, the conv1d function provided by PyTorch is applied to construct one-dimensional convolution layer; the length of output sequence is determined by Equation (28).
where L out is the length of output sequence, L in is the length of input sequence, P is the length of padding, D is the length of dilation, K is the length of kernel (filter), S: length of stride. The values of each parameter for CNN layer used here are shown in Table 1 and the length of the output sequence was designed to remain the same as the length of the input sequence.

Fully Connected Layer and Network Output
The output of the convolutional layer is connected to the fully connected layers. The final output, the measurement error covariance matrix R, is calculated through the output of a fully connected layer. All fully connected layers are composed of four consecutive layer sets.
The output of the fully connected layer is connected to the ReLU activation function and goes through the dropout layer to add generality. The last fully connected layer omits the ReLU and dropout layer to output the measurement error covariance R.
The size of each fully connected layer is [200 × 2000], and this size remains the same in each fully connected layer. The output size of the final fully connected layer is [200 × 6]. The output value of network is finally converted to the measurement error covariance R using Equation (29).
where R is the measurement error covariance matrix, R 0 is the initial measurement error covariance matrix, z is output of network.

Loss Function
Mean squared error applies to the loss function. Since the measurement of the EKF becomes the zero velocity, the error is the difference between the velocity estimate and the true velocity, as shown in Equation (30).
whereV n i (γ) is estimated velocity vector at time i, V n i,True is true velocity vector at time i.

Optimizer
The purpose of this learning is to optimize the measurement error covariance matrix R for EKF that minimizes the loss of Equation (30). This model updates the parameters using the gradient obtained through backpropagation. In this paper, PyTorch framework is applied as a tool for learning, and the optimizer used Adam optimizer that reflects the adaptive learning rate algorithm that combines the ideas of momentum optimization and RMSprop for fast and stable learning.
Adam optimizer use two parameters (learning rate and weight decay) for optimization. In this study, the learning rate of 0.00001 and the weight decay of 0.000001 were selected to satisfy the learning speed and accuracy.

Parameter Tuning for CNN Architecture
If the length of this sequence is too long, the characteristics of the rapidly changing sea wave cannot be learned well. It is also known that the size of an excessively long input window can over-smooth the result [19]. Conversely, if the length of this sequence is too short, the coefficient of the covariance changes too quickly, which can degrade the stability of the filter. Therefore, considering the above characteristics, the input length of the sequence data for training was set to 20 s.
In this paper, the architecture of the overall filter is superposition on the Conv Set structure to which the one-dimensional filter of 5 × 1 size is applied. This repetitive placement of the Conv Set utilizes non-linearity thorough the ReLU block and Dropout block in the middle of the Conv Set, thus it can make the desired feature stand out more and is advantages in terms of computation amount.
Conv Set was designed by configuring filter block, padding block, and dilation block so that the length of the input sequence and the output sequence are the same to keep the computation constant and balance the system. That is, even after passing through one Conv Set, 200 (20 s × 10 Hz) sequence data maintain their length.
Learning parameters for CNN architecture are shown in Table 2.

Simulation Environment
To verify the performance of a proposed method, the mooring environment was simulated, and convergence speed and performance accuracy were compared by performing the alignment for the case of using a fixed measurement error covariance matrix, adaptive EKF, and learning as shown in      Figure 3 shows the case of using a fixed error covariance R. INS uses the acceleration and angular velocity to calculate the navigation solutions. The EKF module located in the middle consists of the time propagation and measurement update process. The measurement update process is performed by applying the zero-velocity measurement and the fixed R value indicated in the red box. The compensated is obtained by subtracting the estimated error state from EKF to the navigation solution from INS. Figure 4 shows the case where the adaptive EKF described in the Section 4 is used. The other parts are the same as in Figure 3. However, R is calculated adaptively in the red box labeled "Innovation Based R adaptor". The calculated R is used in the EKF measurement update in EKF. Figure 5 shows the case where R calculated by learning is used. The error covariance matrix R is calculated thorough the network updated by learning in the red box marked "Learning-based R adaptor". The calculated R is used in the EKF measurement update in EKF.
To simulate the mooring, linear motion and angular rate are generated by the following equations and added to the gyro and accelerometer outputs.      Figure 3 shows the case of using a fixed error covariance R. INS uses the acceleration and angular velocity to calculate the navigation solutions. The EKF module located in the middle consists of the time propagation and measurement update process. The measurement update process is performed by applying the zero-velocity measurement and the fixed R value indicated in the red box. The compensated is obtained by subtracting the estimated error state from EKF to the navigation solution from INS. Figure 4 shows the case where the adaptive EKF described in the Section 4 is used. The other parts are the same as in Figure 3. However, R is calculated adaptively in the red box labeled "Innovation Based R adaptor". The calculated R is used in the EKF measurement update in EKF. Figure 5 shows the case where R calculated by learning is used. The error covariance matrix R is calculated thorough the network updated by learning in the red box marked "Learning-based R adaptor". The calculated R is used in the EKF measurement update in EKF.
To simulate the mooring, linear motion and angular rate are generated by the following equations and added to the gyro and accelerometer outputs.   Figure 3 shows the case of using a fixed error covariance R. INS uses the acceleration and angular velocity to calculate the navigation solutions. The EKF module located in the middle consists of the time propagation and measurement update process. The measurement update process is performed by applying the zero-velocity measurement and the fixed R value indicated in the red box. The compensated is obtained by subtracting the estimated error state from EKF to the navigation solution from INS. Figure 4 shows the case where the adaptive EKF described in the Section 4 is used. The other parts are the same as in Figure 3. However, R is calculated adaptively in the red box labeled "Innovation Based R adaptor". The calculated R is used in the EKF measurement update in EKF. Figure 5 shows the case where R calculated by learning is used. The error covariance matrix R is calculated thorough the network updated by learning in the red box marked "Learning-based R adaptor". The calculated R is used in the EKF measurement update in EKF.
To simulate the mooring, linear motion and angular rate are generated by the following equations and added to the gyro and accelerometer outputs.
Velocity outputs can be expressed as follows. The IMU sensors (gyros and accelerometers), initial navigation error, and parameters used in the simulation are shown in Table 3. To simulate the mooring environment, reference values for position, velocity, and attitude were generated using the parameter values defined in Table 3 and Equations (31)-(33). Figure 6 shows the position of a vehicle in the mooring condition. Figures 7 and 8 show the reference position and attitude generated under mooring conditions. Figures 9 and 10 show the true output of the gyro sensors and accelerometers sensors generated under mooring conditions.

m Velocity duration
T Pbx = 7 s, T Pby = 6 s, T Pbz = 8 s        Input data for learning were randomly generated using the values in Table 3. Based on the same reference trajectory, sensor errors, initial navigation errors, and mooring conditions were changed. The inertial sensor measurements were generated by randomly defining bias and noise with values that follow a normal distribution. In the same way, the initial navigation errors were generated by randomly defining the initial position errors, initial velocity errors, and initial attitude errors with values that follow a normal distribution. The mooring condition was generated by randomly defining the size and duration time of waves with values follow uniform distribution. The network was trained using the generated input data, and the training was repeatedly performed up to the maximum epoch, as defined in Table 2 for each data sequence.

Mooring Condition
The simulation was performed by dividing the mooring condition into three movements: (1) small size of movement; (2) medium size of movement; and (3) large size of movement. As shown in Table 3, the small size of the movement is defined as 10% of the amplitude of the large size of movement, and medium-size movement is defined as 50% of the amplitude of the large size of movement. Alignment is performed in each case to compare the alignment accuracy and speed according to the method of applying the measurement error covariance matrix. As described above, it is divided into a method using CEKF with a fixed measurement error covariance matrix R, a method using adaptive EKF, and a method using CNN-based learning.
For coarse alignment, a feedback-based alignment technique can generally be applied in a mooring environment [9,10]. However, this paper focuses on fine alignment using Kalman filter and zero-velocity measurement, assuming that coarse alignment has been performed.
In consideration of the mooring environment, the initial attitude error after coarse alignment was set to 0.1° (roll/pitch, 1 σ) and 5° (heading, 1 σ). To perform the Monte Carlo simulation, sensor Input data for learning were randomly generated using the values in Table 3. Based on the same reference trajectory, sensor errors, initial navigation errors, and mooring conditions were changed. The inertial sensor measurements were generated by randomly defining bias and noise with values that follow a normal distribution. In the same way, the initial navigation errors were generated by randomly defining the initial position errors, initial velocity errors, and initial attitude errors with values that follow a normal distribution. The mooring condition was generated by randomly defining the size and duration time of waves with values follow uniform distribution. The network was trained using the generated input data, and the training was repeatedly performed up to the maximum epoch, as defined in Table 2 for each data sequence.
The simulation was performed by dividing the mooring condition into three movements: (1) small size of movement; (2) medium size of movement; and (3) large size of movement. As shown in Table 3, the small size of the movement is defined as 10% of the amplitude of the large size of movement, and medium-size movement is defined as 50% of the amplitude of the large size of movement.
Alignment is performed in each case to compare the alignment accuracy and speed according to the method of applying the measurement error covariance matrix. As described above, it is divided into a method using CEKF with a fixed measurement error covariance matrix R, a method using adaptive EKF, and a method using CNN-based learning.
For coarse alignment, a feedback-based alignment technique can generally be applied in a mooring environment [9,10]. However, this paper focuses on fine alignment using Kalman filter and zero-velocity measurement, assuming that coarse alignment has been performed.
In consideration of the mooring environment, the initial attitude error after coarse alignment was set to 0.1 • (roll/pitch, 1 σ) and 5 • (heading, 1 σ). To perform the Monte Carlo simulation, sensor errors and initial errors were randomly generated. Repeated simulation was performed 100 times in each case, and the results were analyzed for the RMS error, alignment speed, and final error values.

Simulation Results
Simulation results are shown in Figures 11-19 and Tables 4-9. In the figures, the green lines show the results of 100 evolutions of Monte Carlo simulations with randomly set initial values. The red line is the RMS value of the result of 100 evolutions. Table 4, Table 6, and Table 8 show the RMS value of the error during the entire time for each case. Table 5, Table 7, and Table 9 show the RMS value of the last error for each case. In Table 4, Table 6, and Table 8, the times of convergence is defined as the time when the heading error (RMS) is within 20% of the initial heading error.                                 The figures show the heading angle error, which has a relatively large initial error and is the main goal of fine alignment. Moreover, the errors of the horizontal angle, such as roll and pitch, are summarized in the tables.
In Figures 11-13 and Tables 4 and 5, which are the cases where there is almost no disturbance, Case 1 (CEKF) converges very slowly. In contrast, Cases 2 (Adaptive EKF) and 3 (Learning-based EKF) converge quickly, and the last value shows a small error. This shows that the current mooring condition is almost static, thus the smaller is the measurement error covariance matrix, the better is the convergence and accuracy. In Cases 2 (Adaptive EKF) and 3 (Learning-based EKF), the measurement error covariance matrix value was adjusted to be small to adapt to the static environment, while Case 1 (CEKF) was maintained at a relatively large value in consideration of disturbance, thus reducing performance.
In Figures 14-16 and Tables 6 and 7, which are the cases where the size of the disturbance is medium, Cases 1 (CEKF) and 2 (Adaptive EKF) show that the alignment was performed despite the disturbance. However, in Case 1 (CEKF), it can be seen that the alignment was performed slowly by a relatively large measurement error covariance matrix designed for stability against the disturbance. In Case 2 (Adaptive EKF), the measurement error covariance matrix value was adaptively increased for the disturbance, but this matrix value is not considered to be optimized. In Case 3 (Learning-based EKF), since the optimization was performed to reduce the error by learning, the alignment was performed quickly and accurately despite the disturbance.
In Figures 17-19 and Tables 8 and 9, which are the cases where the size of the disturbance is relatively large, the overall result is similar to that of medium size of the movement, except that the performance is slightly worse as the size of the disturbance increase. In Case 2 (Adaptive EKF), the measurement error covariance matrix value was adaptively adjusted according to the size of the disturbance, but the performance was worse than in Case 1 due to the unoptimized value.

Conclusions
In this paper, we propose adaptive EKF and learning-based EKF to perform alignment using a Kalman filter in the mooring environment. Since the size of the wave in the mooring environment continuously changes with time and position, the conventional alignment method using a fixed measurement error covariance matrix has limitations. Therefore, as a method of adaptively adjusting the measurement error covariance matrix according to the disturbance, an alignment using an innovation-based adaptive EKF and a CNN-based learning method was applied.
The Monte Carlo simulation was performed by changing the initial errors and sensor errors and dividing the mooring condition into three types: small, medium, and large size of waves.
As a result, in Case 1 (CEKF), the alignment was performed without the filter diverging despite the existence of disturbance. However, in all mooring conditions, alignment was performed very slowly regardless of the disturbance. In Case 2 (Adaptive EKF), a convergence of filter was fast and accurate when there was little disturbance, and it showed adaptive results that alignment was performed even when there was a disturbance. However, alignment was performed relatively slowly depending on the size of the disturbance because optimization was not applied. In Case 3 (Learning-based EKF), when there was little disturbance, alignment was high-speed and accurate, as if the alignment was performed in a static condition. Moreover, even if a disturbance occurs, it shows the best result regardless of the size of disturbance.
In the case of CNN-based alignment, it is necessary to learn various data in changing mooring conditions, but it enables fast and accurate alignment when performing alignment in a mooring. Therefore, it can be usefully applied to systems requiring fast and accurate alignment according to missions, such as surface vessel, ship, and submarine.

Author Contributions:
Conceptualization, J.N.L. and C.G.P.; methodology, software, validation, and writing-original draft preparation, J.N.L.; and writing-review and Supervision, C.G.P. All authors have read and agreed to the published version of the manuscript.
Funding: This study was supported by the Hanwha Corporation of South Korea.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A
The system matrix for the Kalman filter is as follows: where R m is the meridian radius of the curvature, R t is the transverse radius of the curvature in prime vertical, L is the latitude, h is the height, C n b is the direction cosine matrix that converts from the body frame to the navigation frame, f N f E f D T is the specific force in the NED navigation frame, is the Earth's rotation rate in the NED navigation frame, ρ N ρ E ρ D T is the transport rate in the NED navigation frame [1], and H is a measurement matrix.