CNN-Based Vessel Meeting Knowledge Discovery From AIS Vessel Trajectories

How to extract a collection of trajectories for different vessels from the raw AIS data to discover vessel meeting knowledge is a heavily studied focus. Here, the AIS database is created based on the raw AIS data after parsing, noise reduction and dynamic Ramer-Douglas-Peucker compression. Potential encountering trajectory pairs will be recorded based on the candidate meeting vessel searching algorithm. To ensure consistent features extracted from the trajectories in the same time period, time alignment is also adopted. With statistical analysis of vessel trajectories, sailing segment labels will be added to the input feature. All motion features and sailing segment labels are combined as input to one trajectory similarity matching method based on convolutional neural network to recognize crossing, overtaking or head-on situations for each potential encountering vessel pair, which may lead to collision if false actions are adopted. Experiments on AIS data show that our method is effective in classifying vessel encounter situations to provide decision support for collision avoidance.


INTRoDUCTIoN
Automatic identification system (AIS) data, as a fundamental source of information, plays a very important role in monitoring vessel activity in a maritime surveillance system.However, the behavior of vessels is difficult to recognize.How to take full advantage of available AIS data to discover vessel maneuvering patterns to provide decision support for collision avoidance or complex event dealing has attracted much attention in recent years.Trajectory analysis from AIS sources is an essential branch of the study.There are four levels concerning AIS research: data level, method level, knowledge level and decision level.
Regarding the data level, there are data cleaning, data compression, interpolation or time alignment, data quality, data de-noising and so on.For example, Wei et al. (2020) designed a novel algorithm considering the spatial and motion features of trajectories to compress AIS trajectories based on ship behavior characteristics.Tang et al. (2021) proposed an ADP (Adaptive-threshold Douglas-Peucker) algorithm based on DP (Douglas-Peucker) algorithm to determine the key points of each trajectory through the threshold change rate for ship trajectory compression.Li et al. (2020) used U-Net convolutional networks to construct AIS-based vessel trajectories to obtain the rich skip connections in the network and make great use of historical trajectories.Guo et al. (2021) presented an improved kinematic interpolation for AIS trajectory reconstruction, which integrated data preprocessing and interpolation that considered the ships' kinematic information.With automatic ship reporting systems, Greidanus et al. (2016) discussed how to complete a wide-area maritime situational picture.To combine different data processing methods, Zhang et al. (2016) proposed a new scheme for implementing the Douglas-Peucker (DP) algorithm to complete simplification of AIS trajectories and presented a new AIS-based minimum ship domain evaluation method for simplification threshold determination.
At the method level, there are clustering methods, machine learning methods, statistical methods and so on.For example, Wang et al. (2021) proposed a ship AIS trajectory clustering method based on Hausdorff distance and Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN) to provide insightful knowledge for traffic management and operation optimization.Burger et al. (2020) compared the performance of the Discrete Kalman filter (DKF) and the Linear Regression Model (LRM) to conclude that LRM is a computationally simpler method for trajectory prediction.Jadidi (2021) presented an enhanced density-based spatial clustering of applications with noise (DBSCAN) method to model vessel behaviours based on trajectory point data.
In terms of knowledge level, there are trajectory analysis, maritime anomaly detection, trajectory similarity measuring, collision avoidance analysis and so on.For example, Gao & Shi (2020) put forward a sequence conditional generative adversarial network (Seq-CGAN) to learn how to generate appropriate anthropomorphic collision avoidance decisions and bypass the process of ship collision.Zhang & Furusho (2020) combined rule-based method and neural based method for data preprocessing for guidance direction.From a collection of trajectories, Lee et al. (2021) designed an AIS data-driven approach to analyze the pattern of ship trajectories in ports using the DBSCAN algorithm.D' Afflisio et al. (2021) proposed a derivation of anomaly detection rules based on the Generalized Likelihood Ratio Test (GLRT) and the Model Order Selection (MOS) for collision avoidance and maritime surveillance.Singh & Heymann (2020) proposed a multi-class artificial neural network (ANN)-based anomaly detection framework to classify intentional and non-intentional AIS on-off switching anomalies.Iphar et al. (2020) presented a method based on expert knowledge for the risk assessment of cyberthreats in maritime transportation data.Zhen et al. (2017) proposed a method combining vessel trajectory clustering and a naive Bayes classifier to learn the typical vessel sailing pattern to detect anomalous vessel behavior in the maritime surveillance system.Based on exploring maritime trajectory data for anomalous behavior detection, Lei (2016) proposed a so-called MT-MAD framework for maritime trajectory modeling and anomaly detection.For vessel motion pattern recognition, Chen et al. (2019) put forward a method to classify collision avoidance situations, and Sun et al. (2018) tried to mine spatial-temporal motion patterns for vessel recognition.There are also similar studies in Le et al. (2016), Yan et al. (2020), andFu et al. (2017).Because AIS data contains information such as vessel identity, position, speed, and course for vessels, most of these researchers studied trajectory data or derived motion patterns with certain statistical methods.In most cases, feature extraction is too simple to find vessel maneuvering actions or only to find limited types of anomalies.
With the rapid development of maritime traffic, over 580,000 vessels installed AIS receivers and emitted broadcast information continuously throughout the world.AIS data updates with a frequency of every 2 to 12 seconds while the vessel is underway and every 3 minutes while the vessel is anchored, which is shown in Figure 1.
Except for the anchored status, AIS updates every 4.83 seconds for the other six cases.Therefore, in the AIS aggregation process, the original data may be very large if the observation period is long enough.For example, the whole sailing time for a vessel is six days, and the total amount of data for this vessel is approximately 107,329 records.To cope with the large amount of available AIS data, one quick dynamic Ramer-Douglas-Peucker is adopted to obtain a reduction of the original AIS data.Along with a normal course, some redundant locations can be discarded.Then, trajectories for different vessels can be extracted from the AIS database.With statistical analysis of vessel trajectories, sailing segment labeling of critical vessel motions, such as maneuvering actions of a sharp left turn or a sharp right turn, is completed.Next, candidate encountering vessel pairs are selected based on the candidate meeting vessel searching algorithm.Time alignment based on the interpolation operation is also adopted to prepare for the input of the CNN (Convolutional Neural Network, CNN).For each pair of potential encounter trajectories, the CNN is called to calculate the similarity of the trajectory in the vessel encounter situation knowledge base.
The rest of the paper is organized as follows.A step-by-step procedure for preprocessing vessel trajectories from AIS data is presented first.Then, sailing segment label modeling from the trajectory is given.The whole similarity matching framework from AIS trajectory data is described in the next section.Next, the experimental results and discussions are given.Finally, the conclusions of our work and future research directions are listed.

TRAJeCToRy eXTRACTIoN FRoM AIS DATA AND PRePRoCeSSING
Figure 2 shows one AIS data visualization result in one marine area of China in one month.Without compression, it is difficult to deal with the overwhelming data for long time intervals.

DyNAMIC D-P ALGoRITHM
Given a trajectory composed of line segments, the Ramer-Douglas-Peucker algorithm (RDP) attempts to find a similar trajectory with fewer points.The algorithm first joins the first and last vertices of the original trajectory to complete a single edge for crude simplification.It then computes the distance of all intermediate vertices to that edge.The vertex with the furthest distance (also larger than a specified tolerance) from that edge will be marked as a key point and added to the simplification.In the simplification process, the same operation will recur for each edge until all vertices of the original polyline are within the tolerance of the simplification results.The process is illustrated in Figure 3.
The algorithm recursively divides the trajectory.It first marks the first point p 1 and last point p 13 to be kept.It then finds the point p 7 with the furthest distance from the trajectory segment p p 1 13 .In the simplification process, the velocity changing points are considered as the velocity keeping points, and they may be discarded.Alternatively, in the case of anchoring, the vessel is represented as one point in the 2D dimension.Because of the loss of the time feature for the anchored point, only a few points remain, which may lead to the loss of some anchored points.These critical points are very important for determining vessel status or providing decision support, which may be discarded by the traditional D-P algorithm.So the improved iterative point adaptive dynamic D-P (Douglas Peucker) algorithm is adopted, and the state stationary points with the course change exceeding the threshold value or the speed change exceeding the threshold value are added.No matter whether the distance between the state stationary point and the track line in the Douglas Puck algorithm is greater than the distance threshold, the point will be retained in the final compressed track to ensure that all critical points are retained in the final compressed trajectory.
Each trajectory point records the vessel identity, position, speed and course for the vessel.There is one mmsi (Maritime Mobile Service Identify, abbreviated mmsi) field in each AIS broadcast information, denoting the vessel identity.Without loss of generality, a vessel trajectory is an aggregation of its broadcasting AIS information, represented as TV p p p mmsi n = { , , , } 1 2  , with mmsi as its unique ID.Here, each trajectory point p i is defined as p t SOG COG , where SOG refers to speed over ground and COG refers to course over ground.This is the representation of a trajectory with no compression.After compression, the new trajectory for the same vessel is denoted as The new improved algorithm considers the data points of acceleration, deceleration and turning during the vessel's traveling, which are often the most important dynamic behavior points in the vessel's trajectory.The determination of speed or course change threshold is calculated according to the speed and course statistics of the current segment.
The computation process for our dynamic D-P algorithm is as follows, which is shown in Figure 4.
Step 1: According to the given starting point and ending point of the trajectory, all state stationary points in the trajectory are calculated.The start point, state stationary point and end point are recorded as the segment mark points.
Step 2: Connects the start point and end point of each segment trajectory and calculates the distance between all data points on the curve and the segment trajectory to find the maximum distance D max , comparing the maximum distance with the predefined distance threshold D T .

Figure 3. Illustration of traditional D-P algorithm
Step 3: All the intermediate data points on the trajectory will be dropped if D D T max < and the starting point and ending point are connected directly.This line will be regarded as the approximation of the trajectory.Then, the processing is completed.

Flowchart of our dynamic D-P algorithm
Step 4: The point is regarded as a key point on the result trajectory if D D T max > , and the trajectory is split into two parts with the data point as the boundary.Repeat Steps 2 and 3 for the two parts of the curve until all segments satisfy D D T max < .
Step 5: The trajectories formed by connecting the segmentation points in turn can be used as the approximation of the original trajectory when all the sub-trajectories are processed.6 is the application result of our dynamic D-P algorithm.With different thresholds, different compression results can be obtained.Although the computation cost is larger than that of the traditional D-P compression algorithm, our dynamic D-P algorithm performs better in maintaining key navigation points.1. Original AIS trajectory data before compression 2. Compression result with a compression ratio of 90.39% 3. Compression result with a compression ratio of 29.06% 4. Compression result with a compression ratio of 5.12% After data compression for the original AIS data, the following process is adopted.Data of the vessels are first ordered by mmsi and then by timestamp.The next point in the trajectory is found to make a line segment for every part of the trajectory.The distance traveled with speed for every segment is calculated.For one vessel, the query retrieves its trajectory as a set of line segments.For each segment, the query calculates the speed and distance.
Compared to the traditional D-P algorithm, our dynamic D-P algorithm retains key points for collision avoidance analysis.A comparison result of the proportion of key points in the compressed trajectories is shown in Figure 7. Here, DATA1 consists of 2355 AIS trajectories, DATA2 consists of 5632 AIS trajectories, DATA3 consists of 8345 AIS trajectories and DATA4 consists of 12356 AIS trajectories.Clearly, our method remains more key points than the traditional one.

LAGRANGe INTeRPoLATIoN
To learn knowledge for meeting situations, the pair trajectories of two vessels are the basic requirements.However, some points for one vessel are missing because of the receiving frequency or the quality of AIS data.For the same time period, the same number of position points are needed, as shown in Figure 8.
There are 13 points in the first trajectory, but there are only 10 points in the second trajectory.Pair trajectory, that is, the same points in two trajectories, are used as the input for our trajectory similarity algorithm.This is the reason why interpolation is necessary for our preprocessing.
Before discussing how to call Lagrange interpolation, the first order difference quotient and second order difference quotient are listed as follows.
For its first-order difference quotient, the longitude velocity per unit time is computed as Eq. ( 2): Its latitude velocity per unit time is computed as Eq. ( 3): Its second-order difference quotient is computed with Eq. ( 4): Based on this assumption, the following formula holds: Therefore, the positive and negative sign of the second-order difference quotient is decided by its numerators ( [ , , ] l < 0 , and the curve is convex.
Figure 9 is taken as an example to explain this.From Figure 9, Eq. ( 6) to Eq. ( 8) can be obtained: Therefore, the curve is convex at point p i-1 , concave at point p i and convex at point p i +1 .The convexity of a curve is determined by the sign of its second-order difference quotient.If the sign is smaller than zero, the trajectory curve is convex.If the sign is larger than zero, the trajectory curve is concave.When the second-order difference quotient of a curve changes, there is a turning point.The reasoning of latitude direction is the same as above.
Here, the product of the second-order difference quotient of two adjacent points is used for determination.If the product is less than 0, there is a turning point.When two adjacent points have the same sign of second-order difference quotient, the vessel can be approximately considered as a straight-line motion, which can be directly solved by bilinear interpolation.When two adjacent points have different signs of the second-order difference quotient, the vessel's running trajectory can be considered a quadratic curve, which can be solved by Lagrange quadratic interpolation.
According to the AIS data, when the second-order difference quotient of two adjacent points is the same sign, it can be approximately considered that the ship moves in a straight line.With trajectory data of the two points before and after known as p t SOG COG and p t SOG COG j j j j j j ( , , , , ) ϕ λ , the interpolation is computed as Eq. ( 9) at time t k : When the sign of the second-order difference between two adjacent points of AIS data is different, the ship's trajectory can be considered a quadratic curve, which can be solved by Lagrangian quadratic interpolation.
Suppose that the trajectory data of the three adjacent points are p i-1 , p i and p j , and the interpolation time is t.First, the Gauss Kruger projection transformation is carried out to obtain the plane coordinates ′ ( , , , , ) and ¢ p x y t SOG COG j j j j j j ( , , , , ) .
Here, the latitude calculation is taken as an example.If y t y i i ( ) ( ) = , and y t y j j ( ) = , the latitude calculation formula of interpolation time t is: The calculation formulas of la t 0 ( ) , la t 1 ( ) and la t 2 ( ) are as follows: A similar method is used for the longitude calculation.If x t x i i ( ) x t x j j ( ) = , the latitude calculation formula of interpolation time t is: The calculation formulas of lo t 0 ( ) , lo t 1 ( ) and lo t 2 ( ) are as follows: Finally, the plane coordinates are transformed into corresponding latitude and longitude coordinates, and the final interpolation results are obtained.One example is shown in Figure 10.
Among them, the hollow point is the original track point, and the solid point is the track point calculated by interpolation.It can be seen that the algorithm in this paper can obtain interpolation results close to the original trajectory, whether it is straight-line navigation or turning curve navigation.
Figure 11 is an example of the time alignment result based on interpolation computation for crossing, heading and overtaking cases.

VeSSeL TRAJeCToRy SIMILARITy MeASUReMeNT
There are two categories for actual vessel maneuvering patterns under various navigational environments, that is, course keeping and emergency maneuvers.In this paper, vessel maneuvering actions are classified by course keeping and course turning, which is shown in Figure 12.
There are sixteen vessel maneuvering actions defined here, including speed keeping, deceleration, acceleration, weak yaw of left rudder, weak yaw of left rudder with acceleration, weak yaw of left rudder with deceleration, weak yaw of right rudder, weak yaw of right rudder with acceleration, weak yaw of right rudder with deceleration, strong yaw of left rudder, strong yaw of left rudder with acceleration, strong yaw of left rudder with deceleration, strong yaw of right rudder, strong yaw of right rudder with acceleration, strong yaw of right rudder with deceleration and stopping.
The AIS trajectory for vessels can be categorized into different sailing segments based on different maneuvering actions.Each sailing segment corresponds to one or two maneuvering actions.Considering kinematic constraints, the AIS trajectory is classified as a normal sailing segment, acceleration sailing segment, deceleration sailing segment, stopping sailing segment, weak yaw sailing segment, weak yaw sailing segment with acceleration, weak yaw sailing segment with deceleration, strong yaw sailing segment, strong yaw sailing segment with acceleration, and strong yaw sailing segment with deceleration, as shown in Figure 13.
An illustration of sailing segment S 1 , S 2 , S 3 and S 4 is shown in Figure 14.Here, S 1 is a normal sailing segment.For the whole segment, the linear velocity of the vessel is larger than zero, while linear acceleration and angular acceleration are approximately zero.This sailing segment corresponds to speed-keeping maneuvering action.S 2 is the acceleration sailing segment.For the whole segment, linear acceleration of the vessel is larger than a positive threshold, which corresponds to acceleration maneuvering action.S 3 is the deceleration sailing segment.For the whole segment, linear acceleration of the vessel is lower than a negative threshold, which corresponds to deceleration maneuvering action.S 4 is the stopping sailing segment.For the whole segment, the linear velocity is approximately zero, which corresponds to stopping the maneuvering action.
S 5 is the weak yaw sailing segment.For the segment, the angular velocity is approximately one fixed value, and the course difference between the ending point and the starting point is within a certain threshold.If the course difference is positive, it corresponds to a weak yaw of the right rudder maneuvering action.If the course difference is negative, it corresponds to a weak yaw of the left rudder maneuvering action.S 6 is a weak yaw sailing segment with acceleration.It satisfies the sailing conditions of S 2 and S 5 and corresponds to weak yaw of the left or right rudder with acceleration maneuvering action.An illustration of the sailing segment S 5 and S 6 is shown in Figure 15.
S 7 is a weak yaw sailing segment with deceleration.It satisfies the sailing conditions of S 3 and S 5 and corresponds to the weak yaw of the left or right rudder with deceleration maneuvering action.
An illustration of the sailing segment S 7 is shown in Figure 16.S 8 is a strong yaw sailing segment.For the segment, angular velocity is around a certain fixed value, and the course difference between the ending point and starting point is larger than the threshold of weak yaw but lower than a higher certain threshold.If the course difference is positive, it belongs to the right strong yaw sailing segment, corresponding to the strong yaw of the right rudder maneuvering An illustration of the sailing segment S 9 and S 10 is shown in Figure 18.
S 11 is the other sailing segment.It is difficult to categorize the sailing segment into S 1 to S 10 segments.This sailing segment is also called an irregular sailing segment.
Vessel sailing segment computation is based on vessel maneuvering actions.Vessel maneuvering action reflects the motion process of the vessel.Every three points in the trajectory imply one motion process.That is, every three trajectory points implies one vessel maneuvering action event.Vessel maneuvering action can be obtained based on three trajectory points of sampling data at a uniform time interval.Figure 19 shows an identification illustration for vessel maneuvering action.The time interval between p i and p i +1 , p i-1 and p i is Dt .v i in is the velocity vector of trajectory . v i out is the velocity vector of trajectory p p i i +1 .v i in and v i out can be computed as Eq. ( 18): In the field of nautical science, velocity vectors can be represented with speed over ground (SOG) and course over ground (COG , which is shown in the right part of Figure 19.
To distinguish maneuvering action patterns, there are four thresholds, which are RC weak and Here, VT zero is a small value around zero.When a vessel is anchored, there is still a small SOG influenced by wind or flow.Therefore, VT zero is defined to determine the vessel status.If the vessel speed is lower than VT zero , the vessel can be considered stopping.
RV acceleration is vessel acceleration.When a vessel is in sailing status, there will be a slight change in its speed because of the influence of wind and flow.When the acceleration of a vessel is larger than RV acceleration , the vessel can be considered to be in a speed-varying maneuvering state.RC RC weak sharp , are the rates of course change.The course change rate is the course change per second.When heading in the desired direction, the trajectory for a vessel will follow an S-shaped course because of the function of wind, current and waves.When there is a weak yaw for a vessel, it will turn to the desired To compare maneuvering patterns between p i and its adjacent up and down sailing segments, RC and RV are defined as Eq. ( 19): For the whole sailing segment, the global rate of course changes can be computed as Eq. ( 20): Therefore, the threshold can be chosen as Eq. ( 21): For the whole sailing segment, the global rate of speed change can be computed as Eq. ( 22): Therefore, the threshold can be chosen as Eq. ( 23): The identification rule for the sailing segment classification is as follows.Course change can be identified by Eq (24): Acceleration or deceleration can be identified by Eq (25): The right turn with acceleration or deceleration can be identified by Eq. ( 26 The left turn with acceleration or deceleration can be identified by Eq ( 27 For each vessel in one sailing period, its speed change curve and course change curve can be obtained from its AIS trajectory data.For example, there are three vessels in Figure 20.With critical points as a reference, certain situations can be obtained, such as crossing situations or overtaking situations, which are very important for the analysis of collision avoidance.The overall process can be divided into data preprocessing, candidate encountering vessel searching, and CNN-based trajectory similarity matching.As shown in Figure 24, data preprocessing starts from raw AIS data, and three threads of parsing AIS data, noise reduction and dynamic Ramer-Douglas-Peucker compression are called to create an AIS database.The aggregation of points for each vessel is retrieved from the database by mmsi and timestamp.Then, the trajectory can be represented as a set of line segments.The trajectory is also marked with different sailing segments based on feature extraction from every three points for the trajectory and identification rule for recognizing maneuvering actions.
For any vessel in the database, candidate encountering vessels will be searched based on the algorithm shown in Figure 25.For a given vessel, the searching algorithm will search the vessels near the same area in the same time period within the specified time period and location range.If the time points of AIS trajectory data of two vessels are different, an interpolation algorithm should be used for time alignment.The relative motion parameters, including heading difference and velocity difference, are calculated for the two vessel trajectories after time alignment.According to basic collision avoidance rules, the vessel encounter samples are extracted.
The CNN-based trajectory similarity matching algorithm is shown in Figure 26.The first part of the algorithm adds encountering labels for each data pair.
The second part matches the new input vessel pair with the known encountering AIS database to obtain the encountering situation result, which is shown in Figure 27.
Each input sample in the CNN consists of AIS trajectory data of two vessels according to time, and it is transformed into data of equal time intervals by interpolation processing and other operations.The features of each input sample are a 15-dimensional feature vector, including the time interval, vessel 1 longitude, vessel 1 latitude, vessel 1 speed, vessel 1 course, vessel 1 speed change rate, vessel 1 course change rate, vessel 1 sailing segment mark, vessel 2 longitude, vessel 2 latitude, vessel 2 speed, vessel 2 course, vessel 2 speed change rate, vessel 2 course change rate, vessel 2 course change rate, and vessel 2 segment label.The vector at time i is marked as Eq. ( 28): , ,  ,  ,  ,  , , , ,  ,  ϕ λ ϕ λ There are three filters used in the convolution computing process, which are listed as Eq. ( 29), Eq. ( 30) and Eq. ( 31): The convolution process is illustrated in Figure 28.Taking a filter of size 2 as an example, it adds the product with the first two lines of the input matrix, multiplies the corresponding elements, and then calculates the cumulative sum to obtain the first value of the result vector.Then, it moves the filter down one position to obtain the second value of the result vector, and the final feature map size is (15-2 + 1x1) = 14.Because the size of the feature map obtained by different size filters is different, a layer of max pooling is added to solve this problem, selecting a maximum value and combining the same size together.After the max pooling operation, the fixed length vector is given to sofamax to obtain the final matching degree.The encountering situation with the maximum matching degree is labeled for the new input vessel AIS trajectory pair.The loss function adopted is the conventional softmax cross entropy.Cross entropy describes the distance between the actual output (probability) and the expected output (probability).In other words, the smaller the cross entropy value is, the closer the two probability distributions are.It is defined as Eq. ( 32): Taking the Qiongzhou straits as an example, AIS data from 890 vessels were collected from May 20, 2019, to August 20, 2018.The features of the dataset used in the experiment are listed in Table 1.Configuration information for the hardware and software of our experiment is listed in Table 2.
For the training data, a classification decision method combining weighted kNN algorithm and hypersphere support vector machine algorithm in Chen et al. ( 2018) is used to achieve accurate and efficient vessel encounter classification, extracting the trajectory data of collision avoidance process to build a concise version of the ship collision avoidance knowledge base.All the original supervised data has passed the experts' verification.
Because this is a classification problem, the universal precision, recall and F value are used as the evaluation indicators of the experimental results.The evaluation indicators are Precision, Recall and F1_score, which are represented in Eq. ( 33), Eq. ( 34) and Eq. ( 35): Here, a represents the number of test tracks correctly assigned to category c, b represents the number of test tracks incorrectly assigned to category c, and j represents the number of test tracks incorrectly assigned to category.The comparison result between the LCS model in Chen et al. (2019), HSSVM in Chen et al. (2018) and our method is shown in Figure 29.Clearly, the performance of our  Here, it is assumed that the calculation amount of each layer is concentrated in conv2d, M and N are the number of input and output channels respectively, K is the size of convolution kernel, and H and W are the space size of output feature map respectively.Although the time complexity of CNN is higher than that of other methods, it can process large-scale data efficiently, and it is not necessary to consider the time complexity too much when using GPU computing.With our CNN-based similarity matching method, Figure 30 to Figure 34 show different meeting situation matching results.Figure 30 shows one overtaking situation matching result.Figure 31 shows one crossing situation with a small angle matching result, and Figure 32 shows the vertical crossing situation matching result.Figure 33 shows one crossing situation with a large angle matching result.Figure 34 shows the situation matching result.

CoNCLUSIoN
Starting from raw AIS data, one AIS database is created after noise reduction and dynamic Douglas-Peucker compression.Then, candidate encountering vessel pairs are selected based on the candidate  vessel trajectories, critical vessel motions, such as maneuvering actions of a sharp left turn or sharp right turn, can be identified.To ensure the accuracy of the CNN matching result, a sailing segment labeling algorithm is also adopted.For each pair of potential encounter trajectories, the convolution neural network is called to calculate the similarity of the trajectory in the vessel encounter situation knowledge base.Finally, the similarity matching results are obtained after the computation of the Figure 1.AIS update frequency illustration Figure 2. Visualization AIS data in one marine area in one month Figure 4. Flowchart of our dynamic D-P algorithm

Figure 5
Figure 5 is an illustration of our dynamic D-P algorithm.In the figure, blue points are state stationary points.The first point p 1 , the last point p 13 , and the state stationary points p p p 3 7 11 , , are first retained as key points.Then, based on the distance from the point to the trajectory segment, p o i n t p 4 a n d p o i n t p 9 a r e s e l e c t e d .T h e f i n a l s i m p l i f i e d t r a j e c t o r y i s p p p p p p p 1 3 4 7 9 11 13 Figure 5. Illustration of our dynamic D-P algorithm

Figure 6 .
Figure 6.Application result of our dynamic D-P compression algorithm Figure 7.Comparison result for the traditional D-P algorithm and our dynamic D-P compression algorithm

Figure 9 .
Figure 9. Illustration for solving the two-order difference quotient 1. Time alignment for the crossing situation.2. Time alignment for heading situation.3. Time alignment for the overtaking situation.
Figure 10.Interpolation result based on our algorithm Figure 11.Time alignment for different meeting situations

Figure 15 .
Figure 15.Illustration of sailing segment S 5 and S 6

Figure 17 .
Figure 17.Illustration of sailing segment S 8

Figure 18 .
Figure 18.Illustration of sailing segment S 9 and S 10 Figure 19.Identification for vessel maneuvering action from trajectory data

For
the vessel of the red trajectory with 413436820 as its mmsi identifier, its speed change curve and course change curve are shown in Figure 21.The curve can be considered as a reference to identify the sharp course change time point and sharp speed change time point.The average course and average speed for the whole sailing period can also be obtained to determine the threshold for vessel maneuvering action identification.Taking the Qiongzhou straits as an example, AIS data from 785 vessels were collected from July 20, 2018, to August 20, 2018.Based on preprocessing data mentioned above, vessel maneuvering actions such as speed keeping, deceleration, acceleration, weak yaw of left rudder, weak yaw of left rudder with acceleration, weak yaw of left rudder with deceleration, weak yaw of right rudder, weak yaw of right rudder with acceleration, weak yaw of right rudder with deceleration, strong yaw of left rudder, strong yaw of left rudder with acceleration, strong yaw of left rudder with deceleration, strong yaw of right rudder, strong yaw of right rudder with acceleration, strong yaw of right rudder with deceleration are identified.The sampling time interval is 60 seconds, and Figure 20.Three vessels AIS trajectory data from August 6 to August 12, 2018 in one area

Figure 21 .
Figure 21.Speed change curve and course change curve for vessels with MMSI=413436820 from August 6 to August 12, 2018 Figure 22.Two-vessel maneuvering action identification results in the Qiongzhou strait Figure 25.Flowchart of candidate encountering vessel pairs searching Figure 26.Flowchart of the CNN-based trajectory similarity matching algorithm . The time complexity of our CNN training is O(E * D/ B * T), where E is epochs, D is dataset size, B is batch Size, and T is the time complexity of a single item.Here, this T can be further decomposed into O(T)≈O (L * n), where L is the average time complexity of each layer, and n is the number of layers.This L can be further decomposed into O(L)≈O(M * N * K * K * H * W).
Figure 29.Comparison result of three methods

Figure 30 .
Figure 30.Overtaking situation matching result based on our method Figure 31.Crossing situation with a large angle matching result

Figure 32 .
Figure 32.Vertical crossing situation matching result

Figure 33 .
Figure 33.Crossing situation with small angle matching result Figure 34.Heading on situation matching result

Table 2 . Configuration information for the hardware and software of our experiment Configuration Parameters
Chen et al. (2018)t of the other two methods, with the highest precision 89.33%, the highest recall 92.1% and the F1_score 90.67%.For the hybrid hypersphere support vector machine proposed inChen et al. (2018), training time complexity is O n ( ) 2 method