Next Article in Journal
Year-Round Acoustic Presence of Beaked Whales (Ziphiidae) Far Offshore off Australia’s Northwest Shelf
Previous Article in Journal
Underwater Side-Scan Sonar Target Detection: An Enhanced YOLOv11 Framework Integrating Attention Mechanisms and a Bi-Directional Feature Pyramid Network
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A High-Precision Method for Evaluating the Similarity of Maritime Vessel Trajectories

Department of Military Oceanography and Hydrography, Dalian Naval Academy, Dalian 116018, China
*
Author to whom correspondence should be addressed.
J. Mar. Sci. Eng. 2025, 13(5), 928; https://doi.org/10.3390/jmse13050928
Submission received: 26 March 2025 / Revised: 25 April 2025 / Accepted: 29 April 2025 / Published: 8 May 2025
(This article belongs to the Section Ocean Engineering)

Abstract

:
This study investigates the demand for high-precision trajectory similarity assessment in intelligent maritime navigation. This is done by analyzing discrepancies between GPS-derived trajectories and actual vessel paths, while identifying critical limitations in existing evaluation methods. To address these challenges, we propose a robust framework that integrates three core innovations: firstly, a linear feature accuracy-constrained resampling method to ensure computational precision under diverse complexity conditions, validated through experimental verification; secondly, a shape feature extraction and transformation protocol designed to maintain consistency across multi-scale and heterogeneous operational scenarios; thirdly, a quantitative similarity evaluation criterion based on extracted shape characteristics, enabling systematic alignment between localized trajectory segments and historical navigation patterns. The experimental results confirm the method’s enhanced robustness and its capability to bridge local and global trajectory comparisons, demonstrating that shape-driven quantification significantly refines similarity analysis. This approach advances intelligent maritime systems by providing a technically rigorous solution for real-time decision support and actionable insights into next-generation navigation applications.

1. Introduction

The rapid development of intelligent navigation technology and the widespread application of AISs (automatic identification systems) are driving ship navigation towards automation and unmanned operation [1]. To achieve unmanned navigation [2], ships need to compare their own trajectories with the routes stored in their system database and continuously adjust their own routes based on the similarity results. In terms of application, ship trajectory clustering methods have been widely used [3]. However, during maritime navigation, vessels are subject to special conditions such as environmental factors and human influences, making traditional land-based trajectory similarity algorithms inadequate for meeting actual maritime needs. This necessitates the design of a measurement method for ship trajectory similarity that is tailored to the maritime field to meet practical requirements.
With the rapid development of computer technology and artificial intelligence, many scholars both domestically and internationally have proposed methods for measuring the trajectories of ships. This study takes a comparison between GPS-positioned trajectories and actual navigation tracks as an example to explore the requirements and methods for comparing trajectory similarity in the field of intelligent maritime navigation, particularly emphasizing the importance of similarity accuracy for intelligent navigation. Through analyzing existing similarity calculation processes and traditional similarity computation methods, we reveal their limitations in terms of their robustness and adaptability. To address these issues, this paper proposes a high-precision maritime vessel trajectory similarity assessment method. The method entails, first, a resampling approach that considers the accuracy of linear features to preprocess the given data, ensuring consistency in the data scale. Second, a shape feature extraction (shape feature extraction involves identifying and quantifying distinctive geometric or structural attributes of an object’s form to enable analysis, classification, or recognition in applications like computer vision and pattern recognition) and a transformation process for linear features are established, guaranteeing consistent feature extraction results across multi-scale and various scenarios and thereby enhancing the method’s robustness. Finally, a similarity evaluation criterion based on the “shape” feature extraction results is proposed, enabling quantitative comparison between updated and original data, and providing a scientific basis for currency assessment.
Trajectory similarity based on practical situations and existing algorithms: The algorithms that are traditionally used include the Hausdorff distance [4], Frechet distance [5], dynamic time warping (DTW) [6], edit distance (ED) [7], and longest common subsequence (LCSS) [8] algorithms. However, traditional algorithms face significant issues in practical applications. For example, the DTW algorithm has a high computational complexity, making it unsuitable for long time series and difficult to apply in long-duration navigation. The ED and LCSS algorithms are quite robust in handling noise, but they are overly reliant on distance thresholds, which leads to poor measurement performance for trajectories with different sampling frequencies. The improved edit distance (IED) [9] algorithm redefines the costs of insertion, deletion, and replacement operations for trajectory points based on actual spatial distances and specific matching rules. The fuzzy-based longest common subsequence (FLCSS) algorithm [10] replaces the threshold of the LCSS algorithm with a fuzzy membership function and defines new matching methods for non-sampled points. Both methods reduce the dependence on distance thresholds and improve the robustness for trajectories with different sampling frequencies. Although sequence-based methods use dynamic programming to obtain a global optimal solution, they strictly follow the sequence order and rely only on the previous state for each calculation, which prevents them from discovering similar relationships between point pairs with significant differences in their sequence order. The Hausdorff distance and Frechet distance algorithms measure trajectory similarity solely based on the distance between a pair of key points, which cannot accurately capture the global characteristics of the trajectory.
Contemporary scholars have leveraged high-performance computing to enhance traditional algorithms, developing innovative approaches such as anchor point matching with distance correction for trajectory similarity measurement [11], dynamic time warping (DTW) combined with trajectory point compression [12], traffic flow-aware vessel trajectory similarity metrics [13], and improved Fréchet distance-based methods for maritime trajectory similarity assessment [14]. Trajectory similarity measures [15]; review on trajectory similarity measures [16]; review of trajectories similarity measures in mining algorithms [17]; ship trajectory clustering based on trajectory resampling and enhanced BIRCH algorithm [18]; a novel method for vessel trajectory clustering based on three-dimensional triangulation division algorithm [19]; marine targets spatiotemporal trajectory similarity measurement method based on multidimensional features [20]; clustering of maritime trajectories with ais features for context learning [21]; charting the course of ship track prediction: a novel approach for maritime traffic analysis and enhanced situational awareness [22]. These advancements exhibit substantial improvements over classical algorithms, offering enhanced “scale invariance” and “noise robustness”, and thereby enable the more accurate characterization of trajectory similarity across diverse spatial scales and under environmental noise. Additionally, they holistically integrate critical factors, including trajectory shape features, directional consistency between start and end points, and temporal intervals at trajectory endpoints, providing a multidimensional framework for robust similarity evaluation in complex maritime scenarios.
The aforementioned methods measure vessel trajectory similarity through spatial distance and shape analysis in their respective application domains. However, these algorithms fail to meet the “high-precision trajectory similarity comparison” requirements for intelligent maritime navigation, where discrepancies between satellite-acquired trajectories and database-stored historical routes often lead to hazardous navigational scenarios due to insufficient alignment accuracy. To address this challenge, this paper proposes a “high-precision maritime vessel trajectory similarity evaluation method” characterized by robust noise resistance and a registration-free framework. By quantifying similarity through shape feature extraction and multi-scale analysis, this method enables the precise, quantitative comparison of trajectory congruence without requiring spatial alignment pre-processing, thereby effectively mitigating operational risks in autonomous maritime navigation systems. Compared to the algorithms referenced in this study, the proposed method achieves three-decimal-place precision, demonstrating superior accuracy. The computational efficiency of the proposed method remains comparable to that of existing approaches, with execution times averaging approximately five seconds under equivalent experimental conditions. Additionally, the framework exhibits enhanced robustness, with significantly improved noise resistance capabilities compared to existing solutions.
Through the analysis of existing similarity computation workflows and traditional similarity calculation methods, this paper reveals the limitations of current algorithms: (1) current mainstream algorithms lack robustness and are susceptible to noise in propagated trajectories; (2) current mainstream algorithms exhibit low adaptability and cannot accommodate the diverse characteristics of ship trajectories across varying environments; (3) current mainstream algorithms lack sufficient precision to meet the high-accuracy requirements of maritime vessels. To address these issues, as referenced in the aforementioned literature, most authors primarily focus on innovating and integrating traditional algorithms to enhance their precision and robustness.
This paper is structured into the following sections: Section 2 presents the algorithmic principle analysis; Section 3 describes the algorithmic workflow; Section 4 demonstrates the experimental procedures; Section 5 provides the article’s conclusion.

2. Algorithm Principle Analysis

Existing line similarity discrimination methods exhibit limitations in threshold configuration and robustness. To enhance the algorithmic effectiveness of these methods, this paper proposes a line similarity evaluation method based on the shape feature extraction of linear features, addressing the requirement for line similarity computation in flight track comparative analysis. This approach carries out holistic evaluation through local segment matching, demonstrating strong robustness and reliability. The method first standardizes line features through resampling, the subsequently extracts shape characteristics via coordinate system transformation (coordinate system transformation converts spatial data between different reference frames (e.g., via translation, rotation, scaling) to align coordinates), and, finally, designs similarity metrics based on the Fréchet distance and DTW distance from feature extraction results, which collectively form a complete algorithmic framework. This section elaborates the methodological principles of this approach in detail.

2.1. Analysis of Resampling Accuracy Metrics

The current analysis methods of flight track data often rely on multi-source information such as GPS positioning and AIS data, which offer advantages including temporal currency, accessibility, and adaptability, and have been widely utilized in the production and updating of multi-scale vector spatial datasets. Drawing on existing deep learning methodologies, this study extracts historical trajectories from available vector data by leveraging prior information. However, factors such as waves, ocean currents, and weather conditions during navigation significantly influence the movements of ships, resulting in complex historical trajectories. Additionally, variations in vessel types and tonnage lead to inconsistent route selections during voyages, causing discrepancies in the scale and granularity of trajectory data. Consequently, directly extracted linear features often prove impractical due to exhibiting uneven node distribution, which introduces scale inconsistency during similarity comparisons and adversely affects evaluation outcomes.
To address this, this paper introduces a resampling procedure as a preprocessing step prior to the conducting of similarity evaluation, aiming to unify the scale discrepancies and uneven node distributions across linear features while controlling the node quantities to maintain the algorithm’s efficiency within manageable limits. Notably, although the resampling step exclusively serves to conduct the quantitative similarity assessment of linear features without altering the raw data, it inevitably raises concerns about potential inconsistencies between resampled and original linear features. To mitigate this, the precision thresholds for resampling are constrained based on the accuracy requirements across application scenarios, ensuring that the accuracy loss caused by resampling remains controllable. The accuracy assessment of the proposed resampling method is demonstrated in Figure 1 below:
As illustrated, P k P 1 , and P e represent the start and end of a linear feature containing k nodes. If the shape of the entire linear feature is depicted solely through these nodes, it introduces “linear approximation” errors (replacing curves with straight lines). For example, in the intercepted segment that is shown, describing this portion using a straight line connecting node P f , P f + 1 results in a sagitta error H i —the precision loss distance caused by linear simplification.
To address how to set an appropriate step length for keeping the distance accuracy loss within acceptable limits in intelligent ship navigation scenarios, this study conducts a detailed analysis using comparison between GPS-derived trajectories and actual trajectories.
In marine applications, the CA-code single-frequency GPS navigators that are commonly used on ships exhibit a positioning accuracy of approximately 15 m. During actual navigation, scenarios may arise, as depicted in Figure 2, where a vessel temporarily deviates from its original course to avoid an obstacle before returning. Here, w1 represents the lateral displacement between the initial and adjusted courses. When w1 falls below 15 m, the system automatically disregards the deviation, simplifying the trajectory into a straight line. To address this, this study establishes a maximum step length of 15 m, which inversely determines the number of resampling interpolation points. This approach ensures both scale consistency between linear features and maintains the accuracy of the resampled trajectory within standardized tolerances.

2.2. Reversibility Analysis of Linear Feature Shape Feature Extraction

In line similarity measurement, shape description is the most critical factor [23]. Effective description should abstract the shape characteristics of linear features while maintaining invariance across scenarios and ensuring feature reversibility. Building on a comparative analysis of existing methods, this study develops a high-precision maritime vessel trajectory similarity assessment approach that fulfills these requirements. The current line similarity metrics include methods that compare shapes through feature extraction, yet those that rely solely on global characteristics inadequately capture the local details, while methods that emphasize local features fail to represent global patterns. As mentioned in the introduction, invariant moments have been proposed to document linear features, but they prove computationally intensive for complex shapes, struggle with multi-scale feature extraction, and cannot guarantee unique correspondence between the extracted features and original linear elements.
To address these challenges, this paper abstracts the concept of a “linear feature shape” by extracting inter-point relationships through coordinate system transformation, achieving effective feature extraction that remains robust across multi-scale scenarios. The methodology is as follows: First, the original linear feature X is transformed into the resampled feature X through preprocessing. Let D ( x , y ) denote the Euclidean distance calculation, where k represents the number of nodes in X , and X ( f ) indicates the f th-node. For each node f [ 0 , k 2 ] on X , compute its Euclidean distance to the feature’s starting point, then normalize this value by dividing it by the average distance.
a v e r a g e = 1 k f = 1 k 1 d f
In the formula, d f denotes the distance from the f -th node of linear feature X to the starting point (the first node of linear feature X ).
Based on the obtained a v e r a g e , step (b) for linear feature extraction essentially entails a coordinate system transformation which sequentially converts each node in linear feature C into the following form:
( D ( X ( 0 ) , X ( f ) ) a v e r a g e , D ( X ( f 1 ) , X ( f + 1 ) ) a v e r a g e )
In the formula, D ( X ( 0 ) , X ( f ) ) denotes the distance from node 0 to node f in linear feature X ; step b sequentially transforms all nodes of X , which is illustrated here using node f as an example, where its original coordinates ( a , b ) are converted to ( D ( X ( 0 ) , X ( f ) ) a v e r a g e , D ( X ( f 1 ) , X ( f + 1 ) ) a v e r a g e ) .
In the aforementioned transformation process that takes place during feature extraction, the resampled node set X of the linear feature is reconstructed into a shape feature point set X . Notably, due to the resampling procedure, the Euclidean distance between consecutive nodes in this algorithm is equal and defined as r , as detailed below:
X : { ( a 0 , b 0 ) , ( a 1 , b 1 ) , ( a 2 , b 2 ) , , ( a n , b n ) } X : { ( L 0 , d 0 ) , ( L 1 , d 1 ) , ( L 2 , d 2 ) , , ( L n , d n ) }
In the formula, s i denotes the distance from node i 1 to node i + 1 , and L t i represents the distance from node i to the starting point; these values are calculated as follows:
s i = ( a f + 1 a max ( 0 , f 1 ) ) 2 + ( b f + 1 b max ( 0 , f 1 ) ) 2 L t i = ( a f a 0 ) 2 + ( b f b 0 ) 2
Thus, a linear feature model is established that is governed by fixed parameters. The step length is represented by r , the fixed distance is represented by d , and the fixed length is represented by L . The conceptual framework is illustrated in Figure 3 below:
As shown in the diagram, to reconstruct the original point set X from the resampled set X , the following geometric method is applied: Using the current node f as the center, a circle Y 1 is drawn with radius r . Simultaneously, another circle Y 2 is created with the starting point as the center and L j as the radius. The intersection of these two circles determines the position of the next node f + 1 . Additionally, the distance between preceding and succeeding nodes of f must satisfy the constraint d f . Due to the algorithmic specificity in this study, the two circles are guaranteed to have at least one intersection point. When two intersections exist, the unique solution is determined by constraining d f .
( a a j ) 2 + ( b b j ) 2 = r 2 a 2 + b 2 = L t f + 1 2
By solving the system of equations mentioned above, the coordinates of the intersection points ( a , b ) can be derived:
d = x f 2 + y f 2 m = r 2 L t f + 1 2 + d 2 2 d h = r f 2 m 2 a = a f + a f m d ± b f h d b = b f + b f m d a f h d
In the formula, the distance between circle centers is d ; based on d , the number of intersections between the two circles (one or two) is determined. The distance m from an intersection point to the circle center and the distance h from the intersection to the perpendicular bisector are then calculated, which ultimately derives the intersection coordinates ( a , b ) . Consequently, at most two linear features can be reconstructed from X . It follows that X corresponds to a unique linear feature whose shape is fully preserved in the point set X . Here, the coordinates ( a , b ) present two possible cases, with the unique solution being determined by constraining d f . This demonstrates that, through transformation and extraction, X is made to uniquely represent the shape of a linear feature.

2.3. Principle Analysis of Shape Feature Extraction for Linear Features

The preceding analysis demonstrates that this transformation and extraction process converts linear features into a point set that describes their shape characteristics and which corresponds to a unique linear feature shape. Building on this foundation, this section will analyze the inherent characteristics and significance embedded in the coordinates of the transformed point set, and discuss why this conversion can effectively represent the shape features of a linear feature.
As mentioned earlier, in the transformed point set X : { ( L 0 , d 0 ) , ( L 1 , d 1 ) , ( L 2 , d 2 ) , , ( L e , d e ) } , each coordinate contains two elements: d f denotes the distance from node f 1 to node f + 1 , and L f represents the distance from node f to the starting point. As illustrated in Figure 4, d f in the coordinates corresponds to the labeled d in the diagram. During preprocessing, the step length r is fixed. Given this fixed d and r , the angle β (in radians) between the current node (the circle center in the diagram) and its adjacent nodes can be calculated using the following formula:
β = arctan ( b 2 b 1 a 2 a 1 b 1 b 3 a 1 a 3 ) arctan ( b 2 b 1 a 2 a 1 b 2 b 3 a 2 a 3 )
In the equation above, it is evident that the coordinate value d f stores the feature of the angle β between the preceding and succeeding nodes at node f , representing the bending characteristics of the linear feature. However, as shown in the diagram above, preserving only the angle β is insufficient to uniquely determine the corresponding point. This necessitates the use of the second coordinate value L f in the point set to impose additional constraints.
As shown in Figure 5, L f , L f + 1 , and the step length r form a triangle, allowing the calculation of angle β (in radians) using the three known side lengths according to the law of cosines. The computational method is as follows:
δ = arccos ( L f 2 + L f + 1 2 r 2 2 L f L f + 1 )
This demonstrates that the transformed point set X : { ( L 0 , d 0 ) , ( L 1 , d 1 ) , ( L 2 , d 2 ) , , ( L n , d n ) } records two angles, δ and β , which collectively characterize the linear feature.
As shown in Figure 6, the transformed linear feature X : { ( L 0 , d 0 ) , ( L 1 , d 1 ) , ( L 2 , d 2 ) , , ( L e , d e ) } encodes two angles, β and δ , which enable the derivation of the coordinates of node f + 1   ( a f + 1 , b f + 1 ) from node j , thereby constructing a point set to characterize the linear feature. Through coordinate system transformation, shape features are extracted. The proposed algorithm achieves robust performance in similarity matching by leveraging these shape features.

2.4. Evaluation and Analysis of Similarity Metrics

Through the above analysis, it is established that the proposed algorithm transforms original point sets into feature point sets that reflect the angles β and δ of linear features via transformation and extraction. Simultaneously, during experimental validation, the authors discovered that retaining the most characteristic segments of linear features enables high matching accuracy through localized partial matching.
As introduced in Section 2.3, this paper designs a linear similarity evaluation criterion that combined the averaged DTW distance and Fréchet distance after completing feature transformation and shape extraction. To eliminate the multi-scale effects of linear features, the criterion normalizes transformed coordinates, scaling linear features of varying lengths to a unified scale for comparison. The compared point sets are structured as X : { ( L 0 , d 0 ) , ( L 1 , d 1 ) , ( L 2 , d 2 ) , , ( L k , d k ) } , where the two coordinate values reflect angles β and δ , respectively, which collectively represents the shape characteristics of the entire linear feature. The similarity formula integrates two distance metrics: the DTW distance quantifies the global alignment quality between trajectories, while the Fréchet distance measures the maximum local shape deviation, with the two jointly ensuring comprehensive similarity assessment.
The DTW (dynamic time warping) distance employs a dynamic programming principle that enables non-linear temporal warping between sequences. This allows for the identification of optimal alignment points between two sequences even when they differ in length and shape. Specifically, DTW computes pairwise distances between all elements of one sequence and those of another, constructing a distance matrix. It then identifies a warping path through this matrix, via dynamic programming, that corresponds to the optimal alignment between sequences. During the path calculation, DTW enforces local constraints (e.g., limiting warping ranges) to ensure interpretable alignments. Owing to these characteristics, DTW has been widely applied in signal processing, speech recognition, and image analysis. The proposed algorithm leverages the DTW distance to quantify the local shape compatibility between linear features. As DTW’s computational methodology is extensively documented, it is not elaborated here.
The Fréchet distance is a method for comparing the similarity between two paths by considering the temporal progression and movement along their points. Specifically, the Fréchet distance is defined as the minimum distance required for two paths to traverse synchronously from their starting points at a uniform rate. When one path reaches its endpoint, the distance between the other path’s final position and its own endpoint defines their Fréchet distance. Leveraging this property, this paper incorporates the Fréchet distance between transformed linear features to quantify the maximum deviation in the shape characteristics of the original features, thereby capturing their structural dissimilarity.
By integrating these two distance metrics, the proposed algorithm’s similarity evaluation criterion comprehensively achieves registration-free similarity comparison between linear features. After transformation, the original spatial coordinates of two linear features are converted into shape characteristics, where the DTW distance between the transformed features reflects the local alignment of their original shapes, while the Fréchet distance captures the maximum deviation in their shape characteristics. Based on these two distances, the algorithm effectively quantifies the shape similarity between linear features, demonstrating higher accuracy compared to traditional similarity comparison methods without relying on manually set thresholds. The experimental results indicate that, even if one linear feature represents only a partial segment of another, retaining its characteristic portions still yields high similarity scores due to the preserved geometric invariants encoded in the transformed feature set

3. Algorithm Workflow

3.1. Workflow of Linear Feature Similarity Matching Method

Typically, vessels obtain their navigation trajectories through GPS satellite data. However, trajectories extracted from GPS data may exhibit significant deviations from the actual paths in both precision and shape due to data-source inconsistencies and registration errors. To address these limitations, the proposed algorithm abandons the conventional approach of performing similarity comparisons after spatial registration within a unified coordinate system. Instead, it abstracts the “shape” concept of linear features, enabling direct similarity assessment between the intrinsic geometric forms of two trajectories. Guided by this principle, the method implements a workflow of sampling, transformation, and shape-based comparison, which significantly enhances its robustness against the coordinate system distortions and partial deformations that are inherent in GPS-derived trajectory data.
After transforming and extracting the “shape” features of linear elements, the critical task of defining similarity metrics must be addressed. This paper resolves this by calculating both the Fréchet distance and the DTW distance between transformed linear features, then integrating these metrics with the intrinsic lengths of the trajectories to establish a robust similarity evaluation framework. The algorithmic workflow, as depicted in Figure 7, systematically combines these parameters through weighted aggregation to produce a composite similarity score. The validity and superiority of this evaluation approach will be empirically verified in subsequent experimental analyses.

3.2. Specific Steps of the Linear Feature Similarity Matching Method

3.2.1. Precision-Aware Resampling of Linear Features

Before conducting similarity comparison between the original trajectory and the extracted trajectory, resampling must be performed on both to standardize scale inconsistencies caused by differing node densities. This preprocessing step ensures that the two trajectories can be assessed for currentness under a unified scale. The proposed algorithm selects the number of resampled nodes based on the original shoreline shape characteristics, prioritizing geometric fidelity while maintaining scale consistency for the comparative analysis. Resampling refers to the discretization process of converting a continuous linear feature into a set of fitted points. For a continuous linear feature X with k nodes defined over the domain [ a 0 , a k ] , where the i-th node is denoted as ( a i , b i ) , uniform resampling generates an equidistant point set x through systematic interval division.
During resampling, the first step is to calculate the resampling step length:
Δ a = 1 k i = 0 k 1 ( a i + 1 a i ) 2 + ( b i + 1 b i ) 2
In the formula, Δ a represents the resampling step length (interval between consecutive sampled points), ( a i , b i ) denotes the coordinates of node i , and n indicates the number of nodes after resampling. After determining Δ a , the coordinates of the resampled points ( a , b ) are sequentially calculated starting from the initial point. The resampling prioritizes preserving original feature nodes: when the step length ends between two original nodes, sampling occurs at that intermediate position, which then serves as the new starting point for subsequent resampling with the same Δ a . The method proceeds as follows:
a i = Δ a i + a 0 b i = X ( a i )
In the formula, ( a i , b i ) represents the coordinates of the resampled points,  X ( a i ) denotes the vertical coordinate of linear feature X that corresponds to the horizontal coordinate a i . The resampled point set is ultimately X : { ( a 0 , b 0 ) , ( a 1 , b 1 ) , , ( a n , b n ) } .
The newly resampled linear feature X retains the start and end points of the original linear feature X . The scale detail of the resampled linear feature can be controlled by adjusting the resampling node count n . Notably, since this algorithm focuses on similarity evaluation between two linear features, the resampling process does not alter the integrity of the original data. After resampling, both linear features maintain consistent scale and node counts, which ensures the effective implementation of subsequent similarity assessment methodologies.

3.2.2. Transformation and Extraction of Linear Features

After resampling linear features, the algorithm performs coordinate system transformation on both features to extract their shape characteristics for subsequent similarity evaluation. To ensure distance scale consistency during comparison, normalization is applied to both transformed features using their respective lengths as denominators.
For each node f [ 0 , k 2 ] on the linear feature X , compute the Euclidean distance from node f to the starting point of the linear feature, then divide this distance by the average value a v e r a g e to achieve normalization. The average a v e r a g e is calculated as follows:
a v e r a g e = 1 k f = 1 k 1 L f
In the formula, L f denotes the distance from the f -th node to the starting point (the first node of the linear feature X ) . Based on the calculated a v e r a g e , step b of the linear feature extraction effectively performs a coordinate system transformation, converting each node in X into the following format:
D X 0 , X f a v e r a g e , D X f 1 , X f + 1 a v e r a g e
In the formula, D ( X ( 0 ) , X ( f ) ) denotes the distance between node 0 and node f in the linear feature X . In step b, all nodes of X are sequentially transformed; taking node f as an example, its coordinate value is transformed from the original ( a , b ) to ( D ( X ( 0 ) , X ( f ) ) a v e r a g e , D ( X ( f 1 ) , X ( f + 1 ) ) a v e r a g e ) .
As mentioned in Formula (4), the coordinate transformation method reconstructs the original point set X (composed of linear feature nodes) into a new point set X , where each node stores its Euclidean distance from the starting point. Notably, due to the resampling step, the Euclidean distance between consecutive nodes, denoted as r , is equidistant. The transformed and extracted linear feature X is specifically structured as follows:
X : { ( a 0 , b 0 ) , ( a 1 , b 1 ) , ( a 2 , b 2 ) , , ( a e , b e ) } X : { ( L 0 , d 0 ) , ( L 1 , d 1 ) , ( L 2 , d 2 ) , , ( L e , d e ) }
In the point set X defined above, d f represents the distance between node f 1 and node f + 1 of the linear feature X .   L f denotes the distance from node f to the starting point of the linear feature.
Their calculation methods are as follows:
d f = ( a f + 1 a max ( 0 , f 1 ) ) 2 + ( b f + 1 b max ( 0 , f 1 ) ) 2 L f = ( a f a 0 ) 2 + ( b f y 0 ) 2
Thus, a linear feature model controlled by three fixed parameters has been established: the step length r , the inter-node distance d , and the total length L .
Through the aforementioned transformation and extraction, the original linear feature X can be converted into a new linear feature X , whose coordinates consist of the distance L i from the current point to the starting point, and the distance d i between the i 1 -th and i + 1 -th nodes. This transformed linear feature preserves the shape characteristics of the original feature by recording L i and d i . Combined with the resampling step length Δ a , this method uniquely represents the original linear feature’s shape signature. Under varying conditions, the original linear feature consistently corresponds to a distinct set of characteristic points in X , ensuring geometric invariance across different scenarios.

3.2.3. Evaluation of Linear Feature Similarity

After performing resampling, centroid matching, and other normalization steps on the original trajectory and the extracted trajectory, two linear features that are directionally aligned and scale-invariant are obtained. At this stage, similarity evaluation between these two linear features is required. This paper proposes a similarity evaluation index s based on the Fréchet distance, for which the calculation steps outlined below:
Step 1: initialize the Fréchet distance between the two linear features as D f = to record the shortest distance found during the optimization process;
Step 2: calculate the average DTW distance between the transformed and extracted linear features, and store this value;
Step 3: compute the Fréchet distance d i between the transformed feature X and the trajectory. If d i is smaller than D f , update D f with d i ;
Step 4: repeat Step 3 iteratively to determine the final minimal Fréchet distance D f ;
Step 5: design the line similarity evaluation index L m using the following formula, incorporating the minimal Fréchet distance D f , the geometric mean of the two linear features, and their average DTW distance:
a l e = l t h ( X 1 ) + l t h ( X 2 ) L m = max 1 D D T W × D f a l e 2 , 0
In the formula, a l e denotes the ensemble average of the two linear features, l t h ( a ) represents the length of the linear feature, and max ( a , b ) indicates the maximum value between the two features.
After completing the aforementioned steps, the proposed algorithm obtains a line similarity evaluation metric for the original trajectory and the extracted trajectory. This metric will be in the range [ 0 , 1 ] , effectively reflecting the shape similarity between the two linear features. Furthermore, the algorithm demonstrates robust performance across diverse scenarios. Subsequent sections will present validity tests and comparative experiments designed to substantiate the algorithm’s effectiveness.

4. Experiments and Analysis

To evaluate the effectiveness and superiority of the proposed algorithm for line feature similarity assessment, this study implements the algorithm using the pytorch framework in a Python environment (version 3.13.1). The PIL library is utilized for visualizing and analyzing the experimental results. Three experimental designs are specifically formulated: (1) a reliability analysis experiment for the similarity evaluation metric, (2) an algorithm effectiveness experiment, and (3) a comparative experiment with existing methods. These experiments systematically validate the theoretical foundations proposed earlier from multiple perspectives. The experimental environment consists of an Intel(R) Core (TM) i9-12900H processor (2.50 GHz main frequency), 16 GB of RAM, and a GeForce GTX 3060 laptop GPU (The equipment was sourced Lenovo in Beijing, China).

4.1. Feasibility Experiment of Linear Feature Similarity Matching Method

First, this experiment will verify the effectiveness of the proposed similarity evaluation metric. The experimental data employ a complex trajectory composed of 200 nodes, and self-comparisons are conducted for the data while cross-comparisons are conducted with other trajectories to validate the line similarity comparison method. The experimental data are shown in Figure 8 and Figure 9.
As shown in the figure, the selected experimental trajectory exhibits complex shapes and scaling characteristics, effectively demonstrating the validity of the proposed similarity evaluation metric. The specific experimental results of the similarity assessment for this complex trajectory are presented in Table 1.
The intermediate process diagrams and final result diagrams of the line feature transformation conducted in this experiment are shown in Table 2.
The comparative experimental results above demonstrate that the proposed line similarity evaluation method achieves a 100% similarity score when the test trajectory is compared against itself, and 0% similarity when it is compared against trajectories with significantly dissimilar shapes. This validates the methodological feasibility of the proposed line similarity comparison approach.

4.2. Effectiveness Experiment of the Linear Feature Similarity Quantitative Evaluation Method

4.2.1. Multi-Scale Linear Feature Similarity Matching Experiment

The first experiment involves multi-scale trajectory similarity matching. To validate the effectiveness of the proposed line similarity quantification method, a multi-scale similarity matching test was conducted on a relatively complex trajectory. The experimental dataset used in the test region is illustrated in the figure below (highlighted section represents the adopted linear feature).
As shown in Figure 10, the experiment utilizes three distinct linear features with similar shapes from the same region. This validation test confirms the effectiveness of the proposed algorithm. The experimental analysis results from pairwise comparisons of these three linear features are presented in the table below.
According to Table 3, the results show that the self-similarity evaluation metric for the same linear feature achieves 100%, meeting the required criteria. Despite significant morphological and characteristic differences between Line3 and Line1/Line2, their similarity scores reach 96.00% and 97.05%, respectively. Line1 and Line2, which share similar features and align in key bending sections, attain a high similarity score of 99.71%, which is consistent with expectations. To visually demonstrate the DTW and Fréchet distance calculations between the transformed linear features, intermediate process diagrams and result diagrams from the experiment are provided.
From Table 4, it can be seen that the proposed algorithm demonstrates robust similarity computation capabilities under multi-scale conditions, effectively matching partial segments to the entire trajectory. Notably, in Experiment 2_6, Line4 achieved a similarity score of 99.57% despite retaining only two points, which is attributed to the preservation of the most “characteristic” segment of the trajectory. In Experiments 2_4 and 2_5, the comparisons between Line2 and Line3/Line4 also yielded similarity scores exceeding 95%, which validates our hypothesis and confirms the algorithm’s capability of computing similarity under multi-scale conditions. These experiments demonstrate that the proposed algorithm can effectively compare linear features across different scales with strong robustness.

4.2.2. Overall Effectiveness Experiment of Local Matching

To validate the claim that retaining partial characteristic regions of linear features can maintain high similarity metrics with the original features, this paper conducts a partial–whole comparison experiment. The experimental region uses a trajectory segmented into 70%, 50%, 30%, and 10% portions of the original line feature. The experimental area is illustrated in the figure below.
As shown in Figure 11, the experimental linear features are different segments of the same original feature. Through this validity test, the effectiveness of the proposed algorithm in matching local regions to the entire feature can be evaluated. The experimental results are presented in the following table.
From Table 5, it can be seen that the similarity evaluation metric for the same linear feature is 100%, meeting the requirements. As the linear feature is progressively truncated, the similarity decreases. Notably, Experiment 3_4 retains a similarity of 98.53%, with only 30% of the original feature having been preserved. This is attributed to the model retaining the most “characteristic” portion of the linear feature. To validate the reliability of this hypothesis, Experiment 3_5 was conducted. Under the same 10% truncation of the original feature, Experiment 3_5 captured a varying “characteristic” segment. As hypothesized, Experiment 3_5 achieved a high similarity of 99.50% with only 10% of the feature having been retained, which further supports the algorithm’s capability of matching local segments to the entire feature. To visually demonstrate the process of calculating the DTW and Fréchet distances between transformed feature sets and deriving the similarity metric, intermediate transformation steps and results are presented in Table 6.
As shown in Table 6, the proposed algorithm effectively matches partial segments to the entire linear feature, achieving higher similarity accuracy particularly when the “characteristic” portions of the linear feature are preserved.

4.3. Limitations of the Study

The algorithm proposed in this paper still has certain potential limitations when facing real-world conditions. Below, we will analyze these issues and propose future directions of improvement.
Currently, the algorithm primarily relies on GPS satellite data. However, the positioning accuracy of GPS is inherently limited, and maritime vessel data can be obtained through various methods, such as radar and AIS, which leads to significant limitations when applying the proposed algorithm to such scenarios. Additionally, the algorithm is constructed based on latitude-longitude coordinates. When processing data without such coordinates, it cannot extract the information required for similarity analysis. The computation time also requires improvement—the current algorithm takes approximately five seconds, which is acceptable on high-performance computers but becomes significantly longer on typical vessel systems with lower computational capabilities, hindering the comparison of similarities in real-time.
In the future, we will optimize the algorithm to accommodate multiple data sources, enhancing its applicability. Further improvements will focus on streamlining the algorithm’s structure, reducing redundant computations, accelerating its processing speed, and lowering its hardware requirements to meet the needs of most maritime vessels.

5. Conclusions

This study takes a comparison between GPS-positioned trajectories and actual navigation tracks as an example to explore the requirements and methods for comparing trajectory similarities in the field of intelligent maritime navigation, particularly emphasizing the importance of similarity accuracy for intelligent navigation. Through analyzing existing similarity calculation processes and traditional similarity computation methods, we reveal their limitations in robustness and adaptability. To address these issues, this paper proposes a high-precision maritime vessel trajectory similarity assessment method. The method first designs a resampling approach that considers the accuracy of linear features to preprocess the data, ensuring consistency in the scale of the data. Second, it establishes a shape feature extraction and transformation process for linear features, guaranteeing consistent feature extraction results across multi-scale and various scenarios and thereby enhancing the method’s robustness. Finally, it proposes a similarity evaluation criterion based on “shape” feature extraction results, enabling quantitative comparison between updated and original data, and providing a scientific basis for currency assessment.
This research provides effective technical support for advancing intelligent maritime navigation and opens new perspectives regarding and methods for the similarity analysis of other maritime vessel trajectories. Future studies could explore the applicability of this method in more application scenarios, such as urban planning and environmental monitoring. Integrating machine learning and deep learning technologies holds potential to further improve the accuracy and automation level of similarity evaluation, promoting the profound development of intelligent maritime navigation technology.

Author Contributions

Formal analysis, M.M.; Data curation, S.W.; Writing—original draft, R.J.; Writing—review & editing, R.J.; Supervision, J.D. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors on request.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Liu, C. Exploration of Ship Driving Automation and Intelligent Navigation. Ship Mater. Mark. 2021, 29, 65–66. [Google Scholar] [CrossRef]
  2. Xu, L.H. Research on Automated Ship Navigation Methods Based on Intelligent Navigation Technology. Pearl River Water Transp. 2025, 02, 12–14. [Google Scholar] [CrossRef]
  3. Hwang, T.; Youn, I.-H. Collision Risk Situation Clustering to Design Collision Avoidance Algorithms for Maritime Autonomous Surface Ships. J. Mar. Sci. Eng. 2022, 10, 1381. [Google Scholar] [CrossRef]
  4. Evans, R.M.; Oliver, D.; Shekhar, S.; Harvey, F. Fast and exact network trajectory similarity computation: A case-study on bicycle corridor planning. In Proceedings of the 2nd ACM SIGKDD International Workshop on Urban Computing, Chicago, IL, USA, 11 August 2013. [Google Scholar]
  5. Eiter, T.; Mannila, H. Computing Discrete Fréchet Distance; Christian Doppler Laboratory for Expert Systems, TU Vienna: Vienna, Austria, 1994. [Google Scholar]
  6. Yi, B.-K.; Jagadish, H.V.; Faloutsos, C. Efficient retrieval of similar time sequences under time warping. In Proceedings of the 14th International Cnonference on Data Engineering, Orlando, FL, USA, 23–27 February 1998; IEEE: New York, NY, USA, 2012. [Google Scholar]
  7. Chen, L.; Özsu, M.T.; Oria, V. Robust and fast similarity search for moving object trajectories. In Proceedings of the 2005 ACM SIG MOD International Conference on Management of Data, Baltimore, MD, USA, 14–16 June 2005; ACM: New York, NY, USA, 2005; pp. 491–502. [Google Scholar]
  8. Vlachos, M.; Kollios, G.; Gunopulos, D. Discovering similar multidimensional trajectories. In Proceedings of the 18th International Conference on Data Engineering, San Jose, CA, USA, 26 February–1 March 2002; IEEE: New York, NY, USA, 2002; pp. 673–684. [Google Scholar]
  9. Wang, Y.; Qin, K.; Chen, Y.; Zhao, P. Detecting anomalous trajectories and behavior patterns using hierarchical clustering from taxi GPS data. ISPRS Int. J. Geo-Inf. 2018, 7, 25. [Google Scholar] [CrossRef]
  10. Boroumand, F.; Alesheikh, A.A.; Sharif, M.; Farnaghi, M. FLCSS: A fuzzy-based longest common subsequence method for uncertainty management in trajectory similarity measures. Trans. GIS 2022, 26, 2244–2262. [Google Scholar] [CrossRef]
  11. Gui, Z.; Dou, C.; Peng, D.; Liu, Y.; Wu, H. A Trajectory Similarity Measurement Method Based on Anchor Point Matching and Distance Correction. Geogr. Geo-Inf. Sci. 2025, 41, 1–14. [Google Scholar]
  12. Gao, W.; Qian, C.; Zhang, Q.; Xie, H. A Trajectory Similarity Algorithm Based on Dynamic Time Warping and Trajectory Point Compression. Control Inf. Technol. 2024, 06, 43–50. [Google Scholar] [CrossRef]
  13. Li, Y.; Qi, L.; Liang, G.; Hu, Y.; Ji, Y.; Balling, R. A Ship Trajectory Similarity Measurement Method Considering Traffic Flow Characteristics. J. Wuhan Univ. Technol. 2024, 46, 107–115. [Google Scholar]
  14. Liu, J.; Guo, Q.; Chen, J.; Chu, B. A Maritime Target Trajectory Similarity Measurement Method Based on Improved Fréchet Distance. Radio Eng. 2022, 52, 1080–1085. [Google Scholar]
  15. Toohey, K.; Duckham, M. Trajectory similarity measures. SIGSPATIAL Spec. 2015, 7, 43–50. [Google Scholar] [CrossRef]
  16. Magdy, N.; Sakr, M.A.; Mostafa, T.; Elbahnasy, K. Review on trajectory similarity measures. In Proceedings of the 2015 IEEE Seventh International Conference on Intelligent Computing and Information Systems, Cairo, Egypt, 12–14 December 2015; IEEE: New York, NY, USA, 2015; pp. 613–619. [Google Scholar]
  17. Riyadh, M.; Mustapha, N.; Riyadh, D. Review of Trajectories Similarity Measures in Mining Algorithms. In Proceedings of the 2018 Al-Mansour International Conference on New Trends in Computing, Communication, and Information Technology (NTCCIT), Baghdad, Iraq, 23–25 October 2018; pp. 36–40. [Google Scholar] [CrossRef]
  18. Yan, Z.; Yang, G.; He, R.; Yang, H.; Ci, H.; Wang, R. Ship Trajectory Clustering Based on Trajectory Resampling and Enhanced BIRCH Algorithm. J. Mar. Sci. Eng. 2023, 11, 407. [Google Scholar] [CrossRef]
  19. Xu, K.; Wang, R.; Gao, Q.; Tan, J. A Novel Method for Vessel Trajectory Clustering Based on Three-dimensional Triangulation Division Algorithm. IEEE Access 2025, 13, 51388–51405. [Google Scholar] [CrossRef]
  20. Jiang, Q.; Liu, Y.; Sun, S.; Tan, D. Marine Targets Spatiotemporal Trajectory Similarity Measurement Method Based on Multidimensional Features. In Proceedings of the 2021 IEEE International Conference on Unmanned Systems (ICUS), Beijing, China, 15–17 October 202; pp. 852–857. [CrossRef]
  21. Pedroche, D.S.; Herrero, D.A.; Herrero, J.G.; Lopez, J.M.M. Clustering of maritime trajectories with AIS features for context learning. In Proceedings of the 2021 IEEE 24th International Conference on Information Fusion (FUSION), Sun City, South Africa, 1–4 November 2021; pp. 1–8. [Google Scholar] [CrossRef]
  22. Eljabu, L.; Etemad, M.; Matwin, S. Charting the Course of Ship Track Prediction: A Novel Approach for Maritime Traffic Analysis and Enhanced Situational Awareness. In Proceedings of the 2023 IEEE International Conference on Big Data (BigData), Sorrento, Italy, 15–18 December 2023; pp. 2588–2597. [Google Scholar] [CrossRef]
  23. Hu, H.C. Similarity Measurement of Linear Features Based on a Combined Gaussian Model and Its Application Research. Doctoral Dissertation, Wuhan University of Technology, Wuhan, China, 2022. [Google Scholar] [CrossRef]
Figure 1. Schematic diagram of resampling accuracy loss.
Figure 1. Schematic diagram of resampling accuracy loss.
Jmse 13 00928 g001
Figure 2. Extreme cases of resampling accuracy loss.
Figure 2. Extreme cases of resampling accuracy loss.
Jmse 13 00928 g002
Figure 3. Abstract model of linear features for coastal currency assessment.
Figure 3. Abstract model of linear features for coastal currency assessment.
Jmse 13 00928 g003
Figure 4. Parameter constraints diagram for nodes d and r of linear features.
Figure 4. Parameter constraints diagram for nodes d and r of linear features.
Jmse 13 00928 g004
Figure 5. Parameter constraints diagram for nodes L and r of linear features.
Figure 5. Parameter constraints diagram for nodes L and r of linear features.
Jmse 13 00928 g005
Figure 6. Parameter constraints diagram for nodes β and δ of linear features.
Figure 6. Parameter constraints diagram for nodes β and δ of linear features.
Jmse 13 00928 g006
Figure 7. Workflow of the linear feature similarity quantitative evaluation method.
Figure 7. Workflow of the linear feature similarity quantitative evaluation method.
Jmse 13 00928 g007
Figure 8. Experiment areas for the effectiveness of the linear feature similarity analysis method.
Figure 8. Experiment areas for the effectiveness of the linear feature similarity analysis method.
Jmse 13 00928 g008
Figure 9. Comparative experiment areas for the effectiveness of the linear feature similarity analysis method.
Figure 9. Comparative experiment areas for the effectiveness of the linear feature similarity analysis method.
Jmse 13 00928 g009
Figure 10. Experiment areas for the effectiveness of the linear feature similarity quantitative evaluation method.
Figure 10. Experiment areas for the effectiveness of the linear feature similarity quantitative evaluation method.
Jmse 13 00928 g010
Figure 11. Experimental region for partial–whole similarity evaluation.
Figure 11. Experimental region for partial–whole similarity evaluation.
Jmse 13 00928 g011
Table 1. Different transformation comparison data of the same trajectory.
Table 1. Different transformation comparison data of the same trajectory.
Experiment
No.
ABDTWEUCSimilarity
1_1Y1Y11.01.0100%
1_2Y1Y20.81030.04450%
Table 2. Comparison of different transformations on the same trajectory.
Table 2. Comparison of different transformations on the same trajectory.
Result figure
ID: 1_1
Jmse 13 00928 i001
ID: 1_2
Jmse 13 00928 i002
Table 3. Comparative experiment of similar linear features.
Table 3. Comparative experiment of similar linear features.
Experiment
Number
ABDTWEUCSimilarity
2_1Line1Line22.832524.630099.71%
2_2Line1Line35.494622.297896.00%
2_3Line1Line46.476534.832494.34%
2_4Line2Line34.696620.208697.05%
2_5Line2Line45.787332.642995.53%
2_6Line3Line42.956315.160899.57%
Table 4. Multi-scale similarity comparison of the same trajectory.
Table 4. Multi-scale similarity comparison of the same trajectory.
Result Figure
2_1
Jmse 13 00928 i003
2_2
Jmse 13 00928 i004
2_3
Jmse 13 00928 i005
2_4
Jmse 13 00928 i006
2_5
Jmse 13 00928 i007
2_6
Jmse 13 00928 i008
Table 5. Similar linear features comparison experiment.
Table 5. Similar linear features comparison experiment.
Experiment
Number
ABDTWEUCSimilarity
3_110010000100%
3_2100703.764748.451099.17%
3_3100504.492458.480499.04%
3_4100305.571757.410098.53%
3_5100105.512653.701799.50%
Table 6. Comparison of different transformations for the same route.
Table 6. Comparison of different transformations for the same route.
Result Figure
ID: 3_1
Jmse 13 00928 i009
ID: 3_2
Jmse 13 00928 i010
ID: 3_3
Jmse 13 00928 i011
ID: 3_4
Jmse 13 00928 i012
ID: 3_5
Jmse 13 00928 i013
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.

Share and Cite

MDPI and ACS Style

Ji, R.; Ma, M.; Dong, J.; Wang, S. A High-Precision Method for Evaluating the Similarity of Maritime Vessel Trajectories. J. Mar. Sci. Eng. 2025, 13, 928. https://doi.org/10.3390/jmse13050928

AMA Style

Ji R, Ma M, Dong J, Wang S. A High-Precision Method for Evaluating the Similarity of Maritime Vessel Trajectories. Journal of Marine Science and Engineering. 2025; 13(5):928. https://doi.org/10.3390/jmse13050928

Chicago/Turabian Style

Ji, Ran, Mengkai Ma, Jian Dong, and Sen Wang. 2025. "A High-Precision Method for Evaluating the Similarity of Maritime Vessel Trajectories" Journal of Marine Science and Engineering 13, no. 5: 928. https://doi.org/10.3390/jmse13050928

APA Style

Ji, R., Ma, M., Dong, J., & Wang, S. (2025). A High-Precision Method for Evaluating the Similarity of Maritime Vessel Trajectories. Journal of Marine Science and Engineering, 13(5), 928. https://doi.org/10.3390/jmse13050928

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop