Abstract
Existing ship trajectory clustering methods often overlook the impact of navigation behaviors (e.g., heading and speed variations) on clustering performance. To address this limitation, a novel ship trajectory clustering method that explicitly incorporates navigation behavior sequence is proposed. Firstly, ship trajectories are preprocessed, and key motion parameters, including the ship Rate Of Turn (ROT) and acceleration at each trajectory point, are calculated through a sliding window. Secondly, by integrating various motion parameters, the navigation behaviors corresponding to trajectory points are classified, and the classification results are taken as the core element to measure the behavior distance between different trajectories. Then, the spatial distance between trajectories is measured based on the Hausdorff distance. Finally, an adaptive Density-Based Spatial Clustering of Applications with Noise (DBSCAN) algorithm is adopted, which fuses behavior distance and spatial distance, to realize ship trajectory clustering that takes navigation behavior into account. Experimental results on Dalian Port and Yantai Port datasets show that: (1) Compared with the classical DBSCAN and Multi-dimensional Density-Based Trajectory Clustering of Applications with Noise (MD-DBTCAN) methods, the proposed method achieves finer granularity of clustering results; (2) Compared with the classical DBSCAN method, the proposed method can effectively distinguish straight-line navigation trajectories from trajectories with frequent turning behaviors; compared with the MD-DBTCAN method, the proposed method can distinguish normal straight-line navigation trajectories from trajectories with frequent acceleration and deceleration behaviors.
1. Introduction
The Automatic Identification System (AIS) continuously acquires dynamic and static information from ships via shore-based stations and satellite systems, generating massive ship trajectory data [1]. It provides data support for marine big data mining research, including ship behavior analysis, traffic flow prediction, and maritime supervision optimization [2]. As one of the key technical means for marine big data mining [3], ship trajectory clustering technology can effectively extract key navigation channels of ships by clustering massive ship trajectories and provide technical support for the mining of ship navigation rules and the optimization of maritime management [4].
At present, numerous scholars have carried out research on ship trajectory clustering and proposed a series of trajectory clustering algorithms [5,6,7]. Among them, the Density-Based Spatial Clustering of Applications with Noise (DBSCAN) algorithm is widely used because it does not require a preset number of clusters and can discover trajectory clusters of arbitrary shapes [8,9,10]. Zhang et al. [11] improved the DBSCAN method with a segmentation strategy, which divides long trajectories into feature sub-paths and performs density clustering based on them, solving the problems of local feature loss and low efficiency when the traditional DBSCAN method processes long trajectories. Wang et al. [12] improved the DBSCAN method combined with a hierarchical idea and realized multi-scale hierarchical extraction of trajectories by constructing a hierarchical density tree of trajectories. However, Shen et al. [13] noted that traditional Hausdorff distance cannot distinguish trajectories with identical spatial shapes but opposite directions. To solve this, they proposed a Cosine–Hausdorff distance by fusing course vector cosine similarity with spatial Hausdorff distance.
To further improve the representation capability for trajectory features, scholars have begun to explore trajectory representation learning methods based on deep learning and graph structure in recent years. Lian et al. [14] fused a deep autoencoder and a clustering network to iteratively complete ship trajectory clustering in a low-dimensional latent space. Murray et al. [15] used a Variational Recurrent Neural Network (VRNN) to generate implicit representations by learning the temporal position features of trajectories and extract main navigation routes. Mohamed et al. [16] combined a Graph Neural Network (GNN) to model sea area grids and trajectory heterogeneous graphs and realized ship navigation path clustering by learning the spatial adjacency relationships of trajectories. Zhang et al. [17] constructed a trajectory similarity graph combined with a Graph Attention Network (GAT) and used the attention mechanism to capture the local spatial dependencies between trajectories, which improved the clustering accuracy in dense water areas.
Trajectory clustering is not only a fundamental task for navigation pattern mining but also provides critical support for downstream maritime applications. Zhang et al. [11] combined trajectory clustering with abnormal navigation behavior detection, showing that accurate clustering can effectively identify deviant vessels in busy port waters. Baghizadeh et al. [18] applied AIS trajectory analysis to optimize vessel operations for offshore wind farm maintenance, demonstrating the practical engineering value of trajectory mining technology.
Although these methods have improved feature extraction capability, two key limitations remain. First, the model has low interpretability, and the implicit vector representation cannot correspond to the specific semantics of navigation behaviors. Second, ship maneuvering features such as heading and speed are not incorporated into the model as explicit structured parameters, making it unable to distinguish different navigation patterns.
To further consider the motion differences between ships, Xu et al. [19] introduced two instantaneous parameters, heading and speed, at the trajectory point level for clustering under the density framework. Liu et al. [20] realized clustering by extracting statistical values such as the mean and median of the heading and speed of the entire trajectory. An et al. [21] further proposed a Multi-dimensional Density-Based Trajectory Clustering of Applications with Noise (MD-DBTCAN) algorithm based on fusion distance measurement, which compresses trajectories to retain feature change points of heading and speed and then calculates the fusion distance respectively for clustering.
However, the above methods only consider two motion parameters, heading and speed, in trajectory clustering and have not fully exploited the potential of motion features. Li et al. [3] proposed an unsupervised maritime traffic pattern extraction method based on adaptive trajectory segmentation, which demonstrated that segment-level trajectory representation can better capture continuous motion patterns than point-level features. Reference [22] further analyzed the influence of ship rate of turn and acceleration on navigation and classified basic ship navigation behaviors. This provides a theoretical inspiration for making full use of ship rate of turn, acceleration and other factors to carry out trajectory clustering considering navigation behavior.
To address these research gaps, this paper proposes a ship trajectory clustering method considering navigation behavior sequence. The contributions are listed as follows:
- (1)
- A novel behavior sequence representation method is proposed for ship trajectories, converting geometric trajectories into semantic behavior sequences based on seven basic navigation behaviors.
- (2)
- A weighted edit distance metric combined with Run-Length Encoding (RLE) compression is designed to measure similarity between behavior sequences, capturing temporal behavioral patterns while reducing computational complexity.
- (3)
- Behavioral distance and spatial distance are combined and incorporated into an adaptive DBSCAN clustering method, which automatically determines clustering parameters based on data distribution characteristics.
- (4)
- Experiments are conducted on two port datasets, demonstrating the effectiveness, generalization ability, and preliminary cross-port robustness of the proposed method.
3. Experimental Results and Analysis
3.1. Experimental Setup
3.1.1. Dataset Description
The experimental data utilized in this study comprises AIS records from Dalian Port and Yantai Port in June 2019. Dataset 1 covers the Dalian Port waters (121.60° E–121.86° E, 38.83° N–39.03° N) and contains 936 valid trajectories after preprocessing. Dataset 2 covers the area of Yantai Port (121.37° E–121.52° E, 37.51° N–37.61° N), with 832 valid trajectories, and is used specifically to evaluate the cross-port generalizability of the proposed model. Both datasets include various ship types, such as cargo ships, fishing vessels, and passenger ships. Their spatial distribution is shown in Figure 6, and the ship type distribution is shown in Figure 7.
Figure 6.
Example of the experimental dataset. (a) Dalian Port dataset; (b) Yantai Port dataset.
Figure 7.
Distribution of ship types in the experimental data. (a) Dalian Port ship type distribution; (b) Yantai Port ship type distribution.
3.1.2. Evaluation Metrics
The experiment adopts two commonly used indicators in the industry to quantitatively evaluate the quality of clustering results [31], as follows:
First, the Silhouette Score (SC) is selected to measure the intra-cluster compactness and inter-cluster separation, with a value range of [−1, 1]. The closer to 1, the more accurate the clustering effect. The calculation formula is shown in Equation (19), where SC is the Silhouette Score, Ti is the ship trajectory, n is the total number of trajectories, p(Ti) is the average distance from the i-th ship trajectory to all other ship trajectories in its cluster, and q(Ti) is the average distance from the i-th ship trajectory to the nearest cluster among all other clusters.
The Davies–Bouldin Index (DBI) is selected to measure the similarity between clusters, with a value ≥0. The smaller the value, the more significant the difference between clusters. The calculation formula is:
In Equation (21), k is the total number of clusters after ship trajectory clustering, Si is the average intra-cluster distance of the i-th cluster, and Mij is the centroid distance between the i-th cluster and the j-th cluster.
3.1.3. Determination of Behavior Judgment Thresholds
This section defines the core thresholds in ship behavior recognition. Considering that the experimental area is port water with complex navigable ship types, to ensure the unity of the judgment standard and international comparability, the threshold setting refers to the relevant standards issued by IMO, IEC and ISO and is empirically set in combination with the application requirements of AIS trajectory behavior recognition in port scenarios. Referring to [32], the reporting frequency of dynamic information of ships in low speed or anchored/moored state is significantly different from that in normal navigation state. Therefore, this paper takes 0.5 kn as the recognition threshold for the stopped state and 3 kn as the division threshold for the slow speed navigation state.
For turning behavior, Referring to [33], the 10°/10° zig-zag test adopts a 10° heading deviation as the typical maneuverability test condition, indicating that the heading change of this magnitude is representative in ship maneuvering analysis. Therefore, this paper takes 10° as the empirical threshold to distinguish straight-line navigation from obvious turning behavior. For the severity of turning, ISO 20672:2022 involves a typical turning angular velocity test range, such as ±30°/min [34], indicating that this magnitude has engineering significance in ship turning monitoring. Therefore, this paper further takes 30°/min (0.5°/s) as the empirical threshold to distinguish steady turning from sharp turning. Reference [35] takes 0.1 kn/s as the extraction threshold of speed feature points, and this paper uses this value as the judgment standard for ship acceleration and deceleration.
3.2. Verification of Method Effectiveness and Generalization
3.2.1. Results of Dalian Port Dataset
The core adjustable parameters of the proposed method are the weight of spatial distance and the weight of behavior distance. To accurately find the optimal weight combination, a grid search strategy is adopted with the goal of maximizing the clustering Silhouette Score. The weight search range is 0–1, with a step size of 0.1. The optimal parameter combination is obtained as the behavior weight of 0.3 and the spatial position weight of 0.7. The Kmax is set to 10 to balance computational efficiency and density sensitivity, and the self-attenuation coefficient λ is set to 0.4 based on pre-experimental validation on both port datasets. On this basis, through the proposed adaptive parameter optimization mechanism, the final clustering parameters of the proposed method are determined as ε = 0.09 and MinPts = 5. The clustering result of the proposed method is shown in Figure 8c, and all trajectories are clustered into 28 clusters.
Figure 8.
Comparison of clustering results of different methods in Dalian Port Dataset (a) Clustering result of classical DBSCAN; (b) clustering result of MD-DBTCAN; (c) clustering result considering navigation behavior.
To verify the effectiveness of the proposed method, the classical trajectory clustering method (DBSCAN) and the multi-dimensional ship trajectory clustering method based on the fusion distance metric (MD-DBTCAN) proposed in Reference [21] are selected as comparison methods. The adaptive mechanism is also used to determine the clustering parameters of the comparison methods. The clustering parameters of the classical DBSCAN are ε = 0.13 and MinPts = 6, and the clustering parameters of MD-DBTCAN are ε = 0.17 and MinPts = 3. The comparison of clustering result parameters of each method is shown in Table 3, and the schematic diagram of clustering results is shown in Figure 8.
Table 3.
Comparison of clustering result parameters of different methods.
Table 3 shows that the proposed method outperforms the comparison methods across all metrics. The Silhouette Score is 0.52, which is 0.07 and 0.05 higher than the classical DBSCAN and MD-DBTCAN methods respectively. The DBI index of the proposed method is reduced to 0.56, which is 0.10 and 0.04 lower than the two comparison methods respectively. The Noise Rate is 17.12%, which is 6.55% and 4.24% lower than the two comparison methods respectively. This is because classical DBSCAN only uses spatial position features for clustering and cannot distinguish trajectories that overlap spatially but have different motion patterns. Although MD-DBTCAN introduces heading and speed features, it adopts the method of equal weight fusion after single-dimensional calculation, which is difficult to achieve clear separation between clusters. At the same time, in Figure 8c, the proposed method divides more clusters in Area A and Area B than the two comparison methods. For further analysis, the clustering results of the three methods in Area A and Area B are extracted for visual comparison, as shown in Figure 9 and Figure 10.
Figure 9.
Comparison of clustering results of different methods in Area A. (a) Clustering result of classical DBSCAN; (b) clustering result of MD-DBTCAN; (c) clustering result considering navigation behavior.
Figure 10.
Comparison of clustering results of different methods in Area B. (a) Clustering result of classical DBSCAN; (b) clustering result of MD-DBTCAN; (c) clustering result considering navigation behavior.
In Figure 9 and Figure 10, the proposed method divides the ship trajectories in Area A and Area B into two different clusters, the classical DBSCAN method classifies them into one cluster, and the MD-DBTCAN method can distinguish different clusters in Area B but clusters the ship trajectories into one category in the straight channel Area A without division. Further, the trajectories in these two areas are numerically analyzed, and the behavior frequency distribution of each cluster is counted, as shown in Figure 11.
Figure 11.
Comparison of behavior frequency distribution of each cluster in Area A and Area B. (a) Comparison of behavior distribution frequency between Cluster 11 and Cluster 17 in Area A; (b) comparison of behavior distribution frequency between Cluster 22 and Cluster 23 in Area B.
It can be seen in Figure 11 that there are great differences in the behavior frequency distribution between the two clusters in Area A and Area B. Taking the normal navigation with the highest proportion as an example, the frequency of behavior A of Cluster 11 in Area A is 21.1% different from that of Cluster 17, and the frequency of behavior A of Cluster 22 in Area B is 13.4% different from that of Cluster 23. Therefore, the proposed method can divide the trajectories in these two areas into different clusters.
To explore the reason why the MD-DBTCAN method can achieve effective clustering in Area B but cannot complete effective division in the straight channel Area A, the Silhouette Scores of the clustering results in the two areas are calculated based on motion parameters and behavior sequences respectively, and the comparison results are shown in Table 4.
Table 4.
Comparison of Silhouette Scores of clustering results of different methods in Area A and Area B.
Table 4 shows that, in Area B, the Silhouette Scores calculated based on motion parameters and behavior sequences are relatively close, indicating that the motion parameters and navigation behaviors of the trajectories in this area have certain differences, which is the reason why both the proposed method and the MD-DBTCAN method can achieve trajectory division in this area. In the straight channel Area A, all trajectories are clustered into one category by the MD-DBTCAN method, so the Silhouette Score is not calculated; the Silhouette Score of the clustering results of the proposed method is 0.37 based on motion parameters and reaches 0.65 based on behavior sequence. This result shows that the motion parameters of the trajectories in Area A are relatively similar, so the MD-DBTCAN method that only relies on motion parameters cannot achieve effective cluster division. At the same time, Figure 11a shows that, in the results of the proposed method, Cluster 11 is the trajectory with a high proportion of normal navigation state, while the proportion of acceleration state and slow speed state of Cluster 17 is 4.5% and 11.8% higher than that of Cluster 11 respectively. Therefore, the trajectories in this area have great differences in navigation behaviors, such as acceleration and deceleration, and the proposed method can effectively identify the trajectories with differences in such behaviors by measuring the edit distance of the behavior sequence and realize the effective division of the trajectories in this area.
3.2.2. Results of Yantai Port Dataset
To verify the scenario generalization ability of the method, a completely consistent comparative experiment is carried out on the Yantai Port dataset. Judged by the adaptive mechanism, the optimal clustering parameters of the proposed method are ε = 0.07 and MinPts = 5, and the 832 trajectories are finally clustered into 24 clusters. The schematic diagrams of clustering results of each method are shown in Figure 12, and the comparison of clustering performance is shown in Table 5.
Figure 12.
Comparison of clustering results of different methods in Yantai Port Dataset. (a) Clustering result of classical DBSCAN; (b) clustering result of MD-DBTCAN; (c) clustering result considering navigation behavior.
Table 5.
Comparison of clustering result parameters of different methods in Yantai Port dataset.
It can be seen from the data in Table 5 that, on the Yantai Port dataset with more passenger ships and concentrated wharf distribution, the proposed method still maintains the optimal clustering performance. Its SC is 0.09 higher than that of the classical DBSCAN and 0.04 higher than that of the MD-DBTCAN method, and its DBI is 0.13 lower than that of the classical DBSCAN and 0.04 lower than that of the MD-DBTCAN method. Its Noise Rate is 4.35% and 2.93% lower than the two comparison methods. Combined with the experimental results on the Dalian Port dataset in Section 3.2.1, the core indicators of the proposed method perform similarly in the two scenarios, indicating that the method has stable performance in different scenarios and certain generalization ability.
3.3. Supplementary Experiments and Robustness Analysis
3.3.1. Sensitivity Analysis of Behavior Classification Thresholds and Weight Combination
- 1.
- Sensitivity Analysis of Behavior Classification Thresholds;
To verify the robustness of the proposed method against behavior classification thresholds, a control-variable method is used to perform sensitivity analysis on six core thresholds. Only one threshold is adjusted at each step, while all other parameters are fixed at baseline values. Five gradients are set within the range of ±40% of the baseline value, and the changes in SC and DBI of the proposed method on the Dalian Port dataset under different values are statistically analyzed. The value of behavior classification thresholds are shown in Table 6, and the variations are shown in Figure 13.
Table 6.
Value of behavior classification thresholds.
Figure 13.
Variation in behavior classification thresholds. (a) Stopping speed threshold variation diagram; (b) slow speed threshold variation diagram; (c) turning angle threshold variation diagram; (d) ROT threshold variation diagram; (e) acceleration threshold variation diagram; (f) short trip filter threshold variation diagram.
As shown in Figure 13, when all core thresholds vary within ±40% of their baseline values, the SC values of the proposed method remain above 0.50, and the DBI values remain below 0.58, suggesting that the method is relatively insensitive to threshold fluctuations within the tested range and shows good robustness. It is worth noting that, as shown in Figure 13c, compared with the relatively flat curves when other parameters change, the fluctuations of the turning angle threshold cause relatively more significant changes in SC and DBI indicators. This is mainly because the turning angle is a key feature defining the core maneuvering behaviors of ships (straight navigation/turning), and its threshold change will directly affect the encoding of behavior sequences. Nevertheless, all results (SC > 0.50, DBI < 0.58) are still concentrated in the high-performance range. Considering all subfigures together, the proposed method maintains relatively stable performance when the core thresholds fluctuate within ±40%, indicating satisfactory robustness to moderate threshold perturbations.
- 2.
- Sensitivity Analysis of Weight Combination;
The optimal weight combination was determined exclusively on the Dalian Port training dataset via grid search to maximize the Silhouette Score (SC), which is a standard model selection procedure for unsupervised clustering.
To evaluate the sensitivity of the proposed method to behavior weight, we fixed all other parameters and validated the clustering performance on the independent Yantai Port test dataset, with wb varying from 0.1 to 0.9 with a step of 0.1. The variation is shown in Figure 14.
Figure 14.
Variation in weight combination.
As shown in Figure 14, the results show that the fixed weight combination (wb = 0.3, wS = 0.7) derived from Dalian Port also achieves the optimal performance on Yantai Port. Moreover, the performance is relatively stable, and the SC value remains above 0.45 when wb fluctuates between 0.2 and 0.4.
3.3.2. Ablation Experiments of Core Modules
To further isolate the contributions of the core designs in this paper, ablation analysis is conducted on behavior modeling, RLE, logarithmic normalization, and adaptive parameter selection while keeping the dataset, preprocessing process, spatial distance definition, and evaluation metrics consistent. It should be noted that behavior modeling (converting original trajectories into behavior sequences) is the fundamental improvement of this method. Removing this module will lead to the failure of the method, so its contribution is evaluated through the overall comparison between the full method and the baseline method. A total of one baseline group, three ablation groups, and one full method group are set up. Using the control variable method, only one core module is removed each time, and the remaining modules are completely consistent with the full method. Experiments are carried out on the Dalian Port dataset to quantify the contribution degree of each module through performance changes. To ensure experimental fairness, the classical DBSCAN in the baseline group and the full method of this paper adopt the same adaptive parameter determination mechanism to eliminate the interference of parameter selection differences on the experimental results.
The group settings and experimental results of the ablation experiments are shown in Table 7.
Table 7.
Ablation experiment settings and results.
The results of Table 7 show that the complete method in this article achieves the best clustering effect, and the performance of all melting groups is not better than that of the complete method, which indicates that there is a positive contribution to the design of each module. The analysis of each module is as follows.
Behavior modeling is the primary source of performance improvement in this work. Compared with the baseline group without behavior modeling, the SC value of the full method increases by 0.07, and the DBI value decreases by 0.10, achieving the most significant optimization of clustering effect.
RLE is a core auxiliary module. After removing RLE compression, the SC value of the method decreases by 0.01, and the DBI value increases by 0.04, resulting in a decline in clustering performance. On the other hand, this module reduces the time complexity of edit distance from O(n × m) for the original point-by-point sequences (where n and m are the number of original sampling points of two trajectories) to O(L1 × L2) at the behavior segment level (where L1 and L2 are the number of behavior segments of two trajectories), thus reducing the computational overhead.
After replacing logarithmic normalization with linear normalization, the SC value of the method decreases by 0.01, and the DBI value increases by 0.02, resulting in a slight decrease in clustering performance. This module mainly solves the problem that linear normalization is sensitive to extreme values of ship behavior features such as speed and turning angle and ensures the balanced contribution of different behavior features to similarity calculation.
Adaptive parameter optimization is the least contributing general auxiliary module. After changing to the fixed parameter strategy, the SC value of the method did not change; only the DBI value increased slightly by 0.01, which had the least impact on the core cluster performance. For the fixed-parameter ablation, ε = 0.08 and MinPts = 4 were selected from preliminary tuning and then kept constant across all ablation settings. The adaptive parameter mechanism mainly eliminates the subjectivity of manual tuning and ensures stable performance across different datasets, while the main source of performance improvement of this method is the behavior modeling and sequence similarity measurement framework.
3.3.3. Analysis of Algorithm Computational Complexity and Running Efficiency
- 1.
- Theoretical Time Complexity Analysis;
The proposed method is divided into three core stages, and the time complexity analysis of each stage is as follows:
- (1)
- Key Motion Parameter Calculation Stage: Let the total number of trajectories be N, the average number of points per trajectory be L, and the average size of the sliding window be w. In this paper, the window size is adaptively determined with the trajectory length, i.e., w = O(). The computational complexity within the window for each trajectory point is O(w), so the total complexity of this stage is O(N·L·w) = O(N·L1.5). To prevent the window from being too large, the window size in the Formula (1) is limited to 11, and the computation per point is restricted to a constant amount, so the complexity of this stage is actually O(N·L).
- (2)
- Distance Measurement Stage: For spatial distance, the computational complexity of the Hausdorff distance between two trajectories is O(L1·L2), and the total complexity for all trajectory pairs is O(N2·L2), which is consistent with the classical DBSCAN and MD-DBTCAN methods. For behavior distance, after RLE compression, the average length of behavior sequences M ≪ L, the computational complexity of weighted edit distance between two sequences is O(M2), and the total complexity is O(N2·M2), which is negligible compared with spatial distance calculation. Therefore, the total complexity of this stage is O(N2·L2), which is in the same order of magnitude as classical DBSCAN.
- (3)
- Adaptive DBSCAN Clustering Stage: The time complexity of classical DBSCAN is O(N2). The complexity of the adaptive parameter optimization process in this paper is O(Kmax·N2), where Kmax is a fixed small value (set to 10 in this paper). Therefore, the total complexity of this stage is O(N2).
- 2.
- Actual Running Efficiency Comparison;
All experiments are completed in a unified hardware environment with the following specific configuration: CPU is AMD Ryzen9 9955HX made in China, memory is 32 GB, operating system is Windows 11. The algorithm is implemented based on Python 3.8, where the spatial distance calculation is implemented based on the Geopy library, and the clustering algorithm is extended based on the Scikit-learn library.
On the Dalian Port dataset, the total end-to-end running time of the three methods is statistically analyzed, and the running time changes under different numbers of trajectories are tested to verify the scalability of the method. The results are shown in Table 8.
Table 8.
Comparison of running time of different methods (Unit: s).
It can be seen in Table 8 that, on the two experimental datasets, the total running time of the proposed method increases by 4.9–6.9 s compared with classical DBSCAN, with relative increases in computational overhead of approximately 7.8% and 6.0% respectively. Meanwhile, it is 28.2–29.5 s less than the MD-DBTCAN method. The reason is that the MD-DBTCAN method calculates the fusion distances of position, heading, and speed separately and then weights them, with a computational complexity of O(N2·L2). Although all three methods belong to the quadratic order of magnitude, MD-DBTCAN has a larger constant factor because it needs to calculate three attribute distances separately and fuse them, leading to increased computation time.
With the increase in the number of trajectories, the growth rate of running time of the proposed method is basically consistent with the two comparison methods. At the scale of 2000 trajectories, the computation time increases by 12.1 s compared with classical DBSCAN while still maintaining acceptable running efficiency. This indicates that the proposed method remains computationally practical for the tested trajectory scale.
3.3.4. Statistical Significance Analysis and Robustness Verification
Although the experimental results in Section 3.2 show that the proposed method generally outperforms the comparison methods in both SC and DBI, given the inherent randomness of clustering algorithms and evaluation processes, the differences in single evaluations may be within the range of random fluctuations. To strictly verify the statistical significance of the performance improvement of the proposed method and evaluate the stability of its results, this section adopts Bootstrap resampling and statistical hypothesis testing for quantitative analysis.
The specific evaluation process for the Dalian Port dataset is as follows:
- (1)
- Perform 100 rounds of random resampling with replacement on the original dataset, generating a Bootstrap sample of the same size as the original dataset each time. This process aims to obtain the approximate sampling distribution of performance indicators by simulating multiple independent samplings.
- (2)
- Run the proposed method and comparison methods independently on each Bootstrap sample and record their SC and DBI values. Finally, 100 sets of performance indicators are obtained for each method.
- (3)
- Statistical Test: Due to the dependence between Bootstrap samples and the unknown distribution of performance indicators, the non-parametric paired Wilcoxon signed-rank test is adopted. We test SC and DBI separately: the null hypothesis (H0) is that there is no difference in the median of a certain indicator between the two methods; the alternative hypothesis (H1) is that the median of the proposed method on this indicator is significantly better (i.e., higher SC or lower DBI). The significance level is set to 0.05.
Table 9 shows the detailed statistical test results on the Dalian Port dataset.
Table 9.
Statistical test results of Dalian Port dataset.
For a more intuitive presentation, Figure 14 plots the paired difference distribution of SC scores between the proposed method and the two comparison methods in 100 resampling.
It can be seen in Table 9 that the p-values in all comparison scenarios are far below 0.001; therefore, the null hypothesis can be rejected at the α = 0.05 significance level. This indicates that the observed performance improvements of the proposed method over the baseline methods are statistically significant under the current resampling setting. Meanwhile, Figure 15 shows that, across all 100 resampling runs, the proposed method yields uniformly better SC differences relative to the baseline methods.
Figure 15.
SC difference distribution between the proposed method and comparison methods (Dalian Port dataset, 100 resampling).
4. Conclusions
This paper proposes a ship trajectory clustering method considering navigation behavior. Through analysis and experimental validation, the main conclusions are as follows:
- (1)
- The Silhouette Score of the clustering results of the proposed method is 0.07 and 0.05 higher than that of the classical DBSCAN and MD-DBTCAN methods, and the DBI index is reduced by 0.10 and 0.04 respectively. Thus, the clustering results suggest improved inter-cluster discrimination and a finer clustering granularity.
- (2)
- Compared with the classical DBSCAN method, the proposed method can effectively split the heterogeneous trajectories mis-clustered by classical DBSCAN in experimental Areas A and B. The maximum difference in the frequency of normal straight-line navigation behavior between the two clusters after splitting reaches 21.1%, which suggests that the method can better capture differences in turning behavior. Compared with the MD-DBTCAN method, in the straight channel Area A, the frequency of acceleration behavior and slow speed behavior of the two types of trajectories divided by the proposed method differs by 4.5% and 11.8% respectively, while MD-DBTCAN cannot achieve effective division because it cannot capture such fine-grained behavior differences.
- (3)
- The generalization experiments on the independent Yantai Port dataset show that the proposed method maintains stable performance across two typical northern Chinese port scenarios, providing preliminary evidence of its cross-port applicability. The sensitivity analysis supports the robustness of the method to fluctuate in core thresholds, the ablation experiments highlight the contributions of the core modules, and the complexity analysis indicates its practical scalability.
Nevertheless, the proposed method has several limitations that require further investigation. It only considers basic navigational behaviors, such as steady turning, emergency turning, and ship acceleration and deceleration, but has not yet considered complex navigational behaviors; at the same time, behavior classification thresholds and weights use globally fixed values and do not account for maneuverability differences between ship types, such as cargo ships, fishing vessels, and passenger ships. Additionally, this study evaluates clustering performance using internal validation metrics and does not conduct in-depth analysis of the navigation behavior patterns within individual clusters.
In the future, we will expand the ship navigation behavior classification system by introducing complex navigation behaviors such as collision avoidance, anchoring operations, and towing operations; we will study determining ship behavior thresholds and behavior weights through adaptive mechanisms and adjust behavior judgment thresholds according to the maneuvering characteristics of different ships to improve the accuracy of behavior classification. We will incorporate expert-validated route data to further verify the operational significance of the clustering results and analyze the typical behavior characteristics of each cluster. In addition, we will further explore deep learning methods and graph theory methods in ship behavior extraction and trajectory clustering to improve the accuracy of ship behavior recognition.
Author Contributions
Conceptualization, L.Z. and Y.Z.; methodology, S.W. (Shaxige Wu) and Y.Z.; software, S.W. (Shaxige Wu) and S.W. (Shuai Wei); formal analysis, Y.Z. and C.C.; resources, C.C. and L.Z.; writing—original draft preparation, S.W. (Shaxige Wu) and Y.Z.; writing—review and editing, L.Z. and S.W. (Shuai Wei).; visualization, S.W. (Shaxige Wu)and C.C.; project administration, L.Z. and Y.Z.; funding acquisition, L.Z. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by National Natural Science Foundation of China grant number 42071439.
Data Availability Statement
The raw data supporting the conclusions of this article will be made available from the corresponding author upon reasonable, non-commercial academic research request.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Huang, I.-L.; Lee, M.-C.; Chang, L.; Huang, J.-C. Development and Application of an Advanced Automatic Identification System (AIS)-Based Ship Trajectory Extraction Framework for Maritime Traffic Analysis. J. Mar. Sci. Eng. 2024, 12, 1672. [Google Scholar] [CrossRef] [Scilit]
- Yang, D.; Wu, L.; Wang, S.; Jia, H.; Li, K.X. How Big Data Enriches Maritime Research—A Critical Review of Automatic Identification System (AIS) Data Applications. Transp. Rev. 2019, 39, 755–773. [Google Scholar] [CrossRef] [Scilit]
- Li, H.; Lam, J.S.L.; Yang, Z.; Liu, J.; Liu, R.W.; Liang, M.; Li, Y. Unsupervised Hierarchical Methodology of Maritime Traffic Pattern Extraction for Knowledge Discovery. Transp. Res. Part C Emerg. Technol. 2022, 143, 103856. [Google Scholar] [CrossRef] [Scilit]
- Hu, X.; Xie, L.; Chang, J.; Yang, Y.; Ou, C. Application of improved QuickBundles algorithm in ship trajectory clustering. Navig. China 2023, 46, 145–152. [Google Scholar] [CrossRef]
- MacQueen, J.B. Some Methods for Classification and Analysis of Multivariate Observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability; University of California Press: Berkeley, CA, USA, 1967; Volume 1, pp. 281–297. [Google Scholar]
- Mieczyńska, M.; Czarnowski, I. K-Means Clustering for SAT-AIS Data Analysis. WMU J. Marit. Aff. 2021, 20, 377–400. [Google Scholar] [CrossRef] [Scilit]
- Zhen, R.; Jin, Y.; Hu, Q.; Shao, Z.; Nikitakos, N. Maritime Anomaly Detection within Coastal Waters Based on Vessel Trajectory Clustering and Naïve Bayes Classifier. J. Navig. 2017, 70, 648–670. [Google Scholar] [CrossRef] [Scilit]
- Ester, M.; Kriegel, H.-P.; Sander, J.; Xu, X. A Density-Based Algorithm for Discovering Clusters in Large Spatial Databases with Noise. In Proceedings of the Second International Conference on Knowledge Discovery and Data Mining; AAAI Press: Portland, OR, USA, 1996; pp. 226–231. [Google Scholar]
- Sheng, P.; Yin, J. Extracting Shipping Route Patterns by Trajectory Clustering Model Based on Automatic Identification System Data. Sustainability 2018, 10, 2327. [Google Scholar] [CrossRef] [Scilit]
- Liu, Z.; Yang, H.; Xiong, C.; Xu, F.; Gan, L.; Yan, T.; Shu, Y. Research on the Optimization of Ship Trajectory Clustering Based on the OD–Hausdorff Distance. J. Mar. Sci. Eng. 2024, 12, 1398. [Google Scholar] [CrossRef] [Scilit]
- Zhang, C.; Liu, S.; Guo, M.; Liu, Y. A Novel Ship Trajectory Clustering Analysis and Anomaly Detection Method Based on AIS Data. Ocean Eng. 2023, 288, 116082. [Google Scholar] [CrossRef] [Scilit]
- Wang, L.; Chen, P.; Chen, L.; Mou, J. Ship AIS Trajectory Clustering: An HDBSCAN-Based Approach. J. Mar. Sci. Eng. 2021, 9, 566. [Google Scholar] [CrossRef] [Scilit]
- Shen, H.; Tang, H.; Yin, Y. A Novel Method for Ship Trajectory Clustering. Int. J. Nav. Archit. Ocean Eng. 2022, 14, 100474. [Google Scholar] [CrossRef] [Scilit]
- Xiong, L.; Xiong, X.; Zhang, F.; Chen, H. Unsupervised Deep Embedding Clustering for AIS Trajectory. In Proceedings of the IGARSS 2022—2022 IEEE International Geoscience and Remote Sensing Symposium; IEEE: Kuala Lumpur, Malaysia, 2022; pp. 2283–2286. [Google Scholar]
- Murray, B.; Perera, L.P. Deep Representation Learning-Based Vessel Trajectory Clustering for Situation Awareness in Ship Navigation. In Developments in Maritime Technology and Engineering; CRC Press: London, UK, 2021; pp. 157–165. ISBN 978-1-003-21658-2. [Google Scholar]
- Abuella, M.; Atoui, M.A.; Nowaczyk, S.; Johansson, S.; Faghani, E. Spatial Clustering Approach for Vessel Path Identification. IEEE Access 2024, 12, 66248–66258. [Google Scholar] [CrossRef] [Scilit]
- Zhang, R.; Fan, Y.; Zhang, D. Vessel Trajectory Association Algorithm Based on Deep Learning Trajectory Similarity with Post-Processing. In Proceedings of the 2025 4th International Conference on Cyber Security, Artificial Intelligence and the Digital Economy; ACM: Kuala Lumpur, Malaysia, 2025; pp. 683–689. [Google Scholar]
- Baghizadeh, K.; Pahl, J.; Lützen, M.; Rytter, N.G.M. Using AIS Data to Analyze and Optimize Vessel Operations for Offshore Wind Farm Maintenance. In Proceedings of the Innovations in Sustainable Maritime Technology—IMAM 2025; Spyrou, K.J., Themelis, N., Eds.; Springer Nature: Cham, Switzerland, 2025; pp. 405–422. [Google Scholar]
- Xu, X.; Cui, D.; Li, Y.; Xiao, Y. Research on Ship Trajectory Extraction Based on Multi-Attribute DBSCAN Optimisation Algorithm. Pol. Marit. Res. 2021, 28, 136–148. [Google Scholar] [CrossRef] [Scilit]
- Liu, L.; Zhang, Y.; Hu, Y.; Wang, Y.; Sun, J.; Dong, X. A Hybrid-Clustering Model of Ship Trajectories for Maritime Traffic Patterns Analysis in Port Area. J. Mar. Sci. Eng. 2022, 10, 342. [Google Scholar] [CrossRef] [Scilit]
- An, J.; Li, H.; Lei, Y.; Wang, Y.; Yao, C. Mining Method of Ship Activity Trajectory Pattern Based on Big Data. Fire Control Command Control 2024, 49, 156–163. [Google Scholar] [CrossRef]
- Wen, Y.; Song, R.; Huang, L.; Huang, Y.; Sui, Z.; Zhu, M. Semantic Modeling and Expression for Ship Behaviors. J. Harbin Inst. Technol. 2021, 53, 109–115. [Google Scholar] [CrossRef]
- Lei, J.; Sun, Y.; Wu, Y.; Zheng, F.; He, W.; Liu, X. Association of AIS and Radar Data in Intelligent Navigation in Inland Waterways Based on Trajectory Characteristics. J. Mar. Sci. Eng. 2024, 12, 890. [Google Scholar] [CrossRef] [Scilit]
- Chen, X.; Ling, J.; Yang, Y.; Zheng, H.; Xiong, P.; Postolache, O.; Xiong, Y. Ship Trajectory Reconstruction from AIS Sensory Data via Data Quality Control and Prediction. Math. Probl. Eng. 2020, 2020, 7191296. [Google Scholar] [CrossRef] [Scilit]
- Zhang, L.; Zhu, Y.; Lu, W.; Wen, J.; Cui, J. A detection and restoration approach for vessel trajectory anomalies based on AIS. Xibei Gongye Daxue Xuebao/J. Northwest. Polytech. Univ. 2021, 39, 119–125. [Google Scholar] [CrossRef] [Scilit]
- Huang, L.; Wen, Y.; Guo, W.; Zhu, X.; Zhou, C.; Zhang, F.; Zhu, M. Mobility Pattern Analysis of Ship Trajectories Based on Semantic Transformation and Topic Model. Ocean Eng. 2020, 201, 107092. [Google Scholar] [CrossRef] [Scilit]
- Wu, S.; Zimányi, E.; Sakr, M.; Torp, K. Semantic Segmentation of AIS Trajectories for Detecting Complete Fishing Activities. In Proceedings of the 2022 23rd IEEE International Conference on Mobile Data Management (MDM); IEEE: New York, NY, USA, 2022; pp. 419–424. [Google Scholar]
- Wagner, R.A.; Fischer, M.J. The String-to-String Correction Problem. J. ACM 1974, 21, 168–173. [Google Scholar] [CrossRef] [Scilit]
- Taha, A.A.; Hanbury, A. An Efficient Algorithm for Calculating the Exact Hausdorff Distance. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 2153–2163. [Google Scholar] [CrossRef] [Scilit]
- Wan, J.; Hu, D.; Jiang, Y. Research on Method of Multi-density Self-Adaptive Determination of DBSCAN Algorithm Parame-ters. Comput. Eng. Appl. 2022, 58, 78–85. [Google Scholar] [CrossRef]
- Mou, F.; Fan, Z.; Li, X.; Wang, L.; Li, X. A Method for Clustering and Analyzing Vessel Sailing Routes Efficiently from AIS Data Using Traffic Density Images. J. Mar. Sci. Eng. 2023, 12, 75. [Google Scholar] [CrossRef] [Scilit]
- IEC 61993-2:2018; Maritime Navigation and Radiocommunication Equipment and Systems—Automatic Identification Systems (AIS)—Part 2: Class A Shipborne Equipment of the Automatic Identification System (AIS)—Operational and Performance Requirements, Methods of Test and Required Test Results. IEC: Geneva, Switzerland, 2018.
- Resolution MSC.137(76); Standards for Ship Manoeuvrability. IMO: London, UK, 2002.
- ISO 20672:2022; Ships and Marine Technology—Rate-of-Turn Indicators. ISO: Geneva, Switzerland, 2022.
- Zhang, B.; Hirayama, K.; Ren, H.; Wang, D.; Li, H. Ship Anomalous Behavior Detection Using Clustering and Deep Recurrent Neural Network. J. Mar. Sci. Eng. 2023, 11, 763. [Google Scholar] [CrossRef] [Scilit]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
















