A method and device for predicting ship behavior characteristics
By performing similarity and distance matrix calculations on historical trajectory data, cluster analysis and extracting the ship trajectory centerline, the problem of not using navigation historical data in the existing technology is solved, and more accurate ship behavior prediction is achieved.
Patent Information
- Application Number
- CN202310667092.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2043-06-06
AI Technical Summary
When constructing a ship behavior prediction model, the prior art only considers the ship behavior characteristics that can be directly observed in the ship AIS data, and fails to effectively utilize the navigation history data, resulting in low accuracy of the preset behavior characteristics.
By obtaining historical trajectory data, using the water rasterized model to calculate the similarity matrix and distance matrix, perform cluster analysis, extract ship trajectory clusters and identify trajectory centerlines, and conduct behavioral feature predictions based on the prediction model.
The accuracy of the ship behavior prediction model is improved, and by combining navigation practice data to predict, the predictive ability of the current ship's behavioral characteristics at the subsequent moments is enhanced.
Smart Images

Figure CN116680584B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ship behavior prediction, and in particular to a method and device for predicting ship behavior characteristics. Background Art
[0002] With the advent of the data era and the continuous development of emerging technologies such as big data, artificial intelligence, and ship networking, the widespread installation and application of devices such as Automatic Identification Systems (AIS) and radars on ships have made it increasingly convenient to obtain data reflecting historical ship behaviors and movements, such as ship navigation data, ship radar data, and ship video data. The massive data brings new research methods and a solid data foundation for ship behavior feature mining and ship behavior prediction. These data record the position and state changes of ships in space in chronological order, and contain the internal connections and evolution laws between different ship behaviors. Building a ship behavior prediction model based on understanding the laws of ship behavior to achieve accurate prediction of future ship behaviors can not only effectively reduce misjudgments by drivers during ship collision avoidance maneuvers to reduce the probability of accidents, but also help maritime management departments make decisions quickly to improve ship traffic efficiency and ensure water traffic safety. Achieving real-time, accurate, and reliable prediction of ship behaviors greatly guarantees the safety of ship navigation and effectively improves maritime supervision efficiency.
[0003] Currently, existing research methods often only consider the directly observable ship behavior characteristics in ship AIS data, such as position, speed, and course, when constructing prediction models, and do not combine well with the characteristics of navigation historical data.
[0004] Therefore, there is an urgent need to propose a method and device for predicting ship behavior characteristics to solve the technical problem in the prior art that only the directly observable ship behavior characteristics in ship AIS data are considered when constructing a prediction model, without considering the characteristics of the historical route of the ship during navigation, resulting in low accuracy of the preset behavior characteristics. Summary of the Invention
[0005] In view of this, it is necessary to provide a method and device for predicting ship behavior characteristics to solve the technical problem in the prior art that only the directly observable ship behavior characteristics in ship AIS data are considered when constructing a prediction model, without considering the characteristics of the historical route of the ship during navigation, resulting in low accuracy of the preset behavior characteristics.
[0006] On the one hand, the present invention provides a method for predicting ship behavior characteristics, including:
[0007] Obtain the historical trajectory data of historical ships and the current trajectory data of the current ship in the water area to be studied;
[0008] Calculate the similarity between pairs of trajectories in the historical trajectory data according to the water area rasterization model to obtain a similarity matrix;
[0009] Calculate a distance matrix based on the similarity matrix; input the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result; the ship trajectory clustering result includes ship trajectory clusters corresponding to different categories;
[0010] Identify and extract the ship trajectory clusters of different categories respectively according to an extraction algorithm to obtain the ship trajectory centerlines corresponding to different categories;
[0011] Process the current trajectory data and the ship trajectory centerlines according to a prediction model to obtain the behavior characteristics of the current ship at subsequent moments.
[0012] In some possible implementation manners, the inputting the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result includes:
[0013] Perform a first marking and a second marking on the historical trajectory data respectively to obtain a first marking result and a second marking result of the historical trajectory data; both the first marking result and the second marking result are unvisited;
[0014] Process the first trajectory data in the historical trajectory data according to the distance matrix to obtain the number of the second trajectory data in the historical trajectory data within the distance threshold range for dividing adjacent trajectories;
[0015] Judge whether the number of the second trajectory data is greater than or equal to the minimum trajectory number threshold set for clustering;
[0016] If so, modify the first marking result of the first trajectory data to a core trajectory, and modify the second marking result of the first trajectory data to visited;
[0017] If not, modify the first marking result of the first trajectory data to an outlier, and modify the second marking result of the first trajectory data to visited;
[0018] Determine the target cluster of the first trajectory data according to the first marking result of the first trajectory data, and determine the first trajectory data as the third trajectory data in the target cluster;
[0019] When there is no trajectory data with the second marking result of unvisited in the historical trajectory data, according to the third trajectory data corresponding to each target cluster, a ship trajectory cluster corresponding to each target cluster is obtained; according to the ship trajectory clusters corresponding to all target clusters, a ship trajectory clustering result is obtained.
[0020] In some possible implementation manners, determining the target cluster of the first trajectory data according to the first marking result of the first trajectory data and determining the first trajectory data as the third trajectory data in the target cluster includes:
[0021] Determine whether the first trajectory data is assigned a target cluster;
[0022] If so, determine the first trajectory data as the third trajectory data in the target cluster;
[0023] If not, when the first trajectory data is the core trajectory, establish a target cluster belonging to the first trajectory data and determine the first trajectory data as the third trajectory data in the target cluster; when the first trajectory data is the outlier, no operation is performed.
[0024] In some possible implementation manners, when there is no trajectory data with the second marking result of unvisited in the historical trajectory data, obtaining a ship trajectory cluster corresponding to each target cluster according to the third trajectory data corresponding to each target cluster includes:
[0025] Determine whether there is trajectory data with the second marking result of unvisited in the historical trajectory data;
[0026] If so, determine the unvisited trajectory data as the first trajectory data, and re - execute the step of "processing the first trajectory data in the historical trajectory data according to the distance matrix to obtain the number of second trajectory data in the historical trajectory data within the distance threshold range for dividing adjacent trajectories";
[0027] If not, obtain a ship trajectory cluster corresponding to each target cluster according to the third trajectory data corresponding to each target cluster.
[0028] In some possible implementation manners, the extraction algorithm includes:
[0029] Normalize the longitudes and latitudes of at least two third trajectory data in the ship trajectory cluster of the current category to obtain at least one trajectory length corresponding to the ship trajectory of the current category;
[0030] Model the at least one trajectory length of the current category according to Gaussian process regression and summarize it into the ship route model to obtain the ship trajectory center line of the current category.
[0031] In some possible implementation manners, calculating the similarity between every two trajectories in the historical trajectory data according to the water area grid model to obtain a similarity matrix includes:
[0032] Determine the size of the grid in the water area grid model according to the range of the water area to be studied;
[0033] Obtain the coordinates of each grid line in the water area grid model according to the size of the grid, longitude, and latitude;
[0034] Map the historical trajectory data into the water area grid model according to the coordinates of each grid line to obtain the mapping result of the water area grid model;
[0035] Determine the similarity between every two trajectories according to the mapping result;
[0036] Obtain a similarity matrix according to the similarity between every two trajectories.
[0037] In some possible implementation manners, every two trajectories include a first trajectory and a second trajectory;
[0038] Determining the similarity between every two trajectories according to the mapping result includes:
[0039] According to the mapping result, calculate the number of first grids jointly passed by the first trajectory and the second trajectory in the water area grid model, and the number of second grids passed by the first trajectory and the second trajectory in the water area grid model;
[0040] Obtain the similarity between the first trajectory and the second trajectory according to the number of first grids and the number of second grids.
[0041] In some possible implementation manners, processing the current trajectory data and the ship trajectory center line according to the prediction model to obtain the behavior characteristics of the current ship at subsequent moments includes:
[0042] Calculate the similarity between the current trajectory data and the ship trajectory center lines corresponding to different categories respectively according to the water area grid model, and determine at least one target center line whose similarity meets a preset threshold;
[0043] Establish a similar ship trajectory library according to the at least one target center line;
[0044] Input the behavior features corresponding to the target centerlines in the similar ship trajectory library into the prediction model to obtain the behavior features of the current ship at the first moment;
[0045] Input the behavior features of the current ship at the first moment into the prediction model to obtain the behavior features at the second moment;
[0046] Determine the behavior features at the second moment as the behavior features at the first moment, and loop the step of "input the behavior features of the current ship at the first moment into the prediction model to obtain the behavior features at the second moment" to obtain the behavior features of the current ship at subsequent moments.
[0047] In some possible implementation manners, the behavior features include the distance between trajectories;
[0048] The step of inputting the behavior features corresponding to the target centerlines in the similar ship trajectory library into the prediction model to obtain the behavior features of the current ship at the first moment includes:
[0049] According to the coordinates of the target centerlines and the longitude and latitude coordinates of the current ship, calculate the distance between trajectories from the current ship to the target centerlines respectively to obtain the behavior features corresponding to the target centerlines;
[0050] Perform normalization processing on the behavior features corresponding to the target centerlines to obtain the processed behavior features;
[0051] Input the processed behavior features into the prediction model to obtain the behavior features of the current ship at the first moment.
[0052] On the other hand, the present invention also provides a device for predicting ship behavior features, including:
[0053] A data acquisition module, configured to acquire historical trajectory data of historical ships and current trajectory data of the current ship in the water area to be studied;
[0054] A similarity calculation module, configured to calculate the similarity between pairwise trajectories in the historical trajectory data according to the water area rasterization model to obtain a similarity matrix;
[0055] A trajectory clustering module, configured to calculate a distance matrix according to the similarity matrix; input the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result; the ship trajectory clustering result includes ship trajectory clusters corresponding to different categories;
[0056] The centerline extraction module is used to identify and extract the ship trajectory clusters of different categories according to the extraction algorithm, and obtain the ship trajectory centerlines corresponding to different categories.
[0057] The feature prediction module is used to process the current trajectory data and the ship trajectory centerline according to the prediction model, and obtain the behavior features of the current ship at subsequent moments.
[0058] The beneficial effects of adopting the above embodiments are as follows: The ship behavior feature prediction method provided by the present invention can cluster the shipping lanes in the historical trajectory data through setting the similarity matrix, so as to obtain ship trajectory clusters of different categories, and then extract the ship trajectory centerlines corresponding to different categories from the ship trajectory clusters of different categories, so that the prediction model can be processed through the ship trajectory centerlines, and the behavior features of the prediction model are increased. Further, the prediction model can be combined with navigation practice by processing the ship trajectory centerline and the current trajectory data of the current ship, and the behavior features of the current ship at subsequent moments can be predicted, thereby improving the prediction accuracy of the prediction model. Description of the Drawings
[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required in the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.
[0060] Figure 1 It is a schematic flowchart of an embodiment of the ship behavior feature prediction method provided by the present invention;
[0061] Figure 2 It is a schematic structural diagram of an embodiment of the water area rasterization model provided by the present invention;
[0062] Figure 3 It is a schematic flowchart of an embodiment of the Gaussian process regression provided by the present invention;
[0063] Figure 4 It is a schematic structural diagram of an embodiment of the Gaussian process for extracting the ship trajectory centerline provided by the present invention;
[0064] Figure 5 It is a schematic structural diagram of an embodiment of the ship behavior feature prediction device provided by the present invention;
[0065] Figure 6 It is a schematic structural diagram of an embodiment of the ship behavior feature prediction device provided by the present invention. Detailed Embodiments
[0066] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.
[0067] Some of the block diagrams shown in the drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor systems and / or microcontroller systems.
[0068] Referring to "embodiments" herein means that specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0069] The embodiments of the present invention provide a method and device for predicting ship behavior characteristics, which will be described separately below.
[0070] Figure 1 It is a schematic flowchart of an embodiment of the method for predicting ship behavior characteristics provided by the present invention. As Figure 1 shown, the method for predicting ship behavior characteristics includes:
[0071] S101. Obtain the historical trajectory data of historical ships and the current trajectory data of the current ship in the water area to be studied;
[0072] S102. Calculate the similarity between every two trajectories in the historical trajectory data according to the water area rasterization model to obtain a similarity matrix;
[0073] S103. Calculate a distance matrix according to the similarity matrix; input the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result; the ship trajectory clustering result includes ship trajectory clusters corresponding to different categories;
[0074] S104. Identify and extract the ship trajectory clusters of different categories respectively according to an extraction algorithm to obtain the ship trajectory centerlines corresponding to different categories;
[0075] S105. Process the current trajectory data and the center line of the ship trajectory according to the prediction model to obtain the behavior characteristics of the current ship at subsequent moments.
[0076] Compared with the prior art, the ship behavior characteristic prediction method provided by the present invention can cluster the shipping lanes in the historical trajectory data through setting a similarity matrix, so that the clustering algorithm can obtain different categories of ship trajectory clusters, and thus different categories of corresponding center lines of ship trajectories can be extracted from different categories of ship trajectory clusters, enabling the prediction model to be processed through the center line of the ship trajectory, and increasing the behavior characteristics of the prediction model. Further, the center line of the ship trajectory and the current trajectory data of the current ship can be processed to combine the prediction model with navigation practice to predict the behavior characteristics of the current ship at subsequent moments, thereby improving the accuracy of the prediction of the prediction model.
[0077] It should be understood that the historical trajectory data of the historical ships obtained in step S101 can be the navigation data of the historical ships or the shipping lanes designed by the current ship before navigation.
[0078] In some embodiments of the present invention, step S102 includes:
[0079] Determine the size of the grid in the water area rasterization model according to the range of the water area to be studied;
[0080] Obtain the coordinates of each grid line in the water area rasterization model according to the size of the grid, longitude and latitude;
[0081] Map the historical trajectory data to the water area rasterization model according to the coordinates of each grid line to obtain the mapping result of the water area rasterization model;
[0082] Determine the similarity between two trajectories according to the mapping result;
[0083] Obtain a similarity matrix according to the similarity between two trajectories.
[0084] It should be noted that the size of the grid in the water area rasterization model can be set reasonably according to the range of the water area to be studied. According to the range of the water area to be studied and the size of the grid, the length and width of each grid can be calculated, and thus the coordinates of each grid line can be calculated. The calculation formulas are shown in formulas 1 and 2:
[0085]
[0086]
[0087] In the formula, lon is the longitude, lat is the latitude, max(lon) is the maximum longitude of the water area to be studied, min(lon) is the minimum longitude of the water area to be studied, max(lat) is the maximum latitude of the water area to be studied, min(lat) is the minimum latitude of the water area to be studied, and N is the size of the grid.
[0088] After obtaining the coordinates of each grid line, all the trajectory data in the historical trajectory data can be mapped to the water area rasterization model according to the coordinates of each grid line, and the mapping result of the water area rasterization model can be obtained.
[0089] In some embodiments of the present invention, the pairwise trajectories include a first trajectory and a second trajectory;
[0090] Determining the similarity between pairwise trajectories according to the mapping result includes:
[0091] According to the mapping result, calculate the number of first grids jointly passed by the first trajectory and the second trajectory in the water area rasterization model, and the number of second grids passed by the first trajectory and the second trajectory in the water area rasterization model;
[0092] According to the number of first grids and the number of second grids, obtain the similarity between the first trajectory and the second trajectory.
[0093] It should be noted that pairwise processing of historical trajectory data can be performed in the water area rasterization model. Figure 2 This is a schematic structural diagram of an embodiment of the water area rasterization model provided by the present invention. As Figure 2 shown, the first trajectory is represented as Tr1, the second trajectory is Tr2, Tr1 and Tr2 jointly pass through the solid line A water area, the number of grids in the solid line A water area is the number of first grids, the dotted line B water area is the water area passed by Tr1 alone, the dotted line C water area is the water area passed by Tr2 alone, the number of grids in the solid line A water area plus the number of grids in the dotted line B water area and the dotted line C water area is the number of second grids of Tr1 and Tr2, and then calculate the similarity between Tr1 and Tr2. The calculation formula is as shown in Formula 3:
[0094]
[0095] In the formula, N(Tr i ∩Tr j ) is the number of first grids jointly passed by trajectory Tr i and trajectory Tr j , and N(Tr i ∪Tr j ) is the number of second grids of trajectory Tr i and trajectory Tr j .
[0096] After obtaining the similarity between every two trajectory data in all the trajectory data of the historical trajectory data, a similarity matrix can be obtained. The similarity matrix S is shown in Formula 4:
[0097]
[0098] Since the clustering algorithm processes the distance matrix, it is necessary to convert the similarity matrix S into a distance matrix. The conversion formula is shown in Formula 5:
[0099]
[0100] In some embodiments of the present invention, step S103 includes:
[0101] Inputting the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result, including:
[0102] Performing a first marking and a second marking on the historical trajectory data respectively to obtain a first marking result and a second marking result of the historical trajectory data; both the first marking result and the second marking result are unvisited;
[0103] Processing the first trajectory data in the historical trajectory data according to the distance matrix to obtain the number of second trajectory data in the historical trajectory data within the distance threshold range for dividing adjacent trajectories;
[0104] Judging whether the number of the second trajectory data is greater than or equal to the minimum trajectory number threshold set for clustering;
[0105] If so, modifying the first marking result of the first trajectory data to a core trajectory and modifying the second marking result of the first trajectory data to visited;
[0106] If not, modifying the first marking result of the first trajectory data to an outlier and modifying the second marking result of the first trajectory data to visited;
[0107] Determining the target cluster of the first trajectory data according to the first marking result of the first trajectory data, and determining the first trajectory data as the third trajectory data in the target cluster;
[0108] When there is no trajectory data in the historical trajectory data with the second marking result being unvisited, obtaining a ship trajectory cluster corresponding to each target cluster according to the third trajectory data corresponding to each target cluster; and obtaining the ship trajectory clustering result according to the ship trajectory clusters corresponding to all the target clusters.
[0109] It should be noted that the clustering algorithm can only cluster points. Therefore, it is necessary to process the historical trajectory data through a similarity matrix so that the clustering algorithm can cluster the historical trajectory data.
[0110] When there are many water area ship trajectories, it is inevitable that there will be correct trajectories that cannot be correctly classified into a certain category. Clustering analysis can be performed through the clustering algorithm, and the characteristics of its insensitivity to noise can be used to identify the trajectory clusters with a high ship navigation density in the water area to obtain more accurate identification results.
[0111] In some embodiments of the present invention, determining the target cluster of the first trajectory data according to the first marking result of the first trajectory data and determining the first trajectory data as the third trajectory data in the target cluster includes:
[0112] Judging whether the first trajectory data is assigned a target cluster;
[0113] If so, determining the first trajectory data as the third trajectory data in the target cluster;
[0114] If not, when the first trajectory data is the core trajectory, establishing a target cluster belonging to the first trajectory data and determining the first trajectory data as the third trajectory data in the target cluster; when the first trajectory data is the outlier, no operation is performed.
[0115] It should be noted that the historical trajectory data may include at least one trajectory data, and each trajectory data includes a corresponding first mark and a second mark. When the first trajectory data is the core trajectory and does not belong to other clusters, a target cluster corresponding to the category of the first trajectory data is established. The first trajectory data belongs to the third trajectory data of the target cluster. After all the trajectory data in the historical trajectory data are processed, the target cluster corresponding to each category can be obtained. The target cluster is the ship trajectory cluster corresponding to the category. When the first trajectory data is the outlier, the first trajectory data is discarded.
[0116] In some embodiments of the present invention, when there is no trajectory data in the historical trajectory data with the second marking result of unvisited, obtaining the ship trajectory cluster corresponding to each target cluster according to the third trajectory data corresponding to each target cluster includes:
[0117] Judging whether there is trajectory data in the historical trajectory data with the second marking result of unvisited;
[0118] If so, determine the unvisited trajectory data as the first trajectory data, and re - execute the step of "processing the first trajectory data in the historical trajectory data according to the distance matrix to obtain the number of second trajectory data in the historical trajectory data within the distance threshold range for dividing adjacent trajectories";
[0119] If not, obtain the ship trajectory clusters corresponding to each target cluster according to the third trajectory data corresponding to each target cluster.
[0120] It should be noted that after the operation on the first trajectory data is completed, if there is trajectory data with the second marker result being unvisited in the historical trajectory data, re - determine the first trajectory data from the unvisited trajectory data, and then re - execute the step of "processing the first trajectory data in the historical trajectory data according to the distance matrix to obtain the number of second trajectory data in the historical trajectory data within the distance threshold range for dividing adjacent trajectories" until all the historical trajectory data is processed, then the ship trajectory clusters of the target clusters corresponding to each category can be obtained.
[0121] In some embodiments of the present invention, the extraction algorithm in step S104 includes:
[0122] Normalize the longitudes and latitudes of at least two third trajectory data in the ship trajectory cluster of the current category to obtain at least one trajectory length corresponding to the ship trajectory of the current category;
[0123] Model the at least one trajectory length of the current category according to Gaussian process regression and summarize it into the ship route model to obtain the ship trajectory center line of the current category.
[0124] It should be noted that after obtaining the ship trajectory clusters corresponding to different categories, it is necessary to process the third trajectory data in the ship trajectory clusters respectively through the extraction algorithm to obtain the ship trajectory center lines corresponding to different categories.
[0125] The embodiment of the present invention uses the Gaussian Process Regression (GPR) process to extract the ship trajectory center line of the ship trajectory cluster of the same - category ship trajectories. Figure 3 This is a schematic flow diagram of an embodiment of the Gaussian process regression provided by the present invention, as Figure 3 shown:
[0126] The present invention uses the Gaussian process to model the ship trajectories in the ship trajectory cluster of the same - category ship trajectories, and extracts the trajectory center line by aggregating the Gaussian process posterior distributions of each trajectory. The Gaussian process function is expressed as shown in Formula 6:
[0127] The formula 6: \(f(x)\sim N(\mu(x),k(x,x))\)
[0128] where all \(x = [x_1,x_2,\cdots,x n \) follows a multivariate Gaussian distribution. The function \(f(x)\) is defined by the mean function \(\mu(x)\) and the kernel function (covariance function) \(k(x,x)\). The mean function returns the mean of each dimension in the Gaussian distribution, and the kernel function returns the covariance matrix between two independent variables. The kernel function is the core of the Gaussian process and determines the properties of the Gaussian process. In the embodiments of the present invention, the most commonly used kernel function, i.e., the radial basis function (RBF), is adopted, and its basic form is shown in formula 7:
[0129]
[0130] where \(x'\) is the center of the kernel function; \(\sigma\) is the width parameter of the kernel function, which controls the radial range of the function.
[0131] The essence of the Gaussian process is to construct the function \(f(x^*)\) according to the input data and can predict the function at any position \(x^*\). The distribution of these predicted values at \(x^*\) is called the Gaussian posterior distribution, which has a mean and a covariance.
[0132] In order to extract the centerline of the ship trajectory, first, a ship trajectory cluster containing ship trajectories of the same category needs to be selected. Since the longitude and latitude in the ship trajectory are both time-related variables, and based on the linear relationship between the ship trajectory length and time, the trajectory length can be selected to replace the time-related variables. The longitude and latitude in the ship trajectory are respectively modeled as independent functions normalized by the trajectory length. The trajectory length calculation formula is shown in formula 8:
[0133]
[0134] where \(d\) is the distance between adjacent points in the trajectory, is the total length of the trajectory; \(i\) and \(j\) respectively represent the trajectory point and the trajectory number.
[0135] Then, each ship trajectory is modeled by Gaussian process regression according to the total trajectory length, and the Gaussian process regression process distribution of the ship trajectory is summarized into the ship route model. Due to the smoothing property of the Gaussian process, the centerline of the ship trajectory can be extracted according to the mean of the summarized posterior distribution. The mean summary formula for extracting the centerline of the ship trajectory is shown in formula 9:
[0136]
[0137] where \(m\) represents the total number of trajectories, \(T^*\) represents an arbitrary position of the trajectory length-normalized coordinate, \(\mu(T^*)\) represents the total mean of all trajectory lengths at the position \(T^*\), \(\mu j(T*) represents the mean value of the j-th trajectory at the position of T*.
[0138] By aggregating the mean values, the center line of the ship trajectory is obtained. Figure 4 It is a schematic structural diagram of an embodiment of extracting the center line of the ship trajectory by the Gaussian process provided by the present invention, as Figure 4 shown. Figure 4 The upper left is the Gaussian process regression graph of the longitude-normalized trajectory length, and the lower left is the Gaussian process regression graph of the latitude-normalized trajectory length. By combining the average values of longitude and latitude, the center line of the ship trajectory of the current category can be extracted, as Figure 4 shown in the right figure. By the same steps, the center lines of the ship trajectories corresponding to different categories can be obtained respectively.
[0139] In some embodiments of the present invention, step S105 includes:
[0140] Calculating the similarity between the current trajectory data and the center lines of the ship trajectories corresponding to different categories respectively according to the water area rasterization model, and determining at least one target center line whose similarity meets a preset threshold;
[0141] Establishing a similar ship trajectory library according to the at least one target center line;
[0142] Inputting the behavior characteristics corresponding to each target center line in the similar ship trajectory library into the prediction model to obtain the behavior characteristics of the current ship at the first moment;
[0143] Inputting the behavior characteristics of the current ship at the first moment into the prediction model to obtain the behavior characteristics at the second moment;
[0144] Determining the behavior characteristics at the second moment as the behavior characteristics at the first moment, and looping the step of "inputting the behavior characteristics of the current ship at the first moment into the prediction model to obtain the behavior characteristics at the second moment" to obtain the behavior characteristics of the current ship at subsequent moments.
[0145] In a specific embodiment of the present invention, for example, if there are 5 center lines of the ship trajectory, the similarity between these 5 center lines of the ship trajectory and the current trajectory data is calculated respectively through the water area rasterization model. When the similarity meets the preset threshold, the center line of the ship trajectory that is highly similar to the current trajectory data is determined. For example, if there are 3 center lines of the ship trajectory that are highly similar to the current trajectory data, then these 3 center lines of the ship trajectory are determined as the target center lines, and then a similar ship trajectory library is established according to all the data of these 3 target center lines.
[0146] In some embodiments of the present invention, the behavior characteristics include the distance between trajectories;
[0147] Inputting the behavior features corresponding to the respective target centerlines in the similar ship trajectory library into the prediction model to obtain the behavior features of the current ship at the first moment includes:
[0148] According to the coordinates of the respective target centerlines and the longitude and latitude coordinates of the current ship, calculate the inter-trajectory distances from the current ship to the respective target centerlines, respectively, to obtain the behavior features corresponding to the respective target centerlines;
[0149] Perform normalization processing on the behavior features corresponding to the respective target centerlines to obtain the processed behavior features;
[0150] Input the processed behavior features into the prediction model to obtain the behavior features of the current ship at the first moment.
[0151] It should be noted that the behavior features may include the longitude, latitude, speed, course, and inter-trajectory distance of the ship. The inter-trajectory distance can be calculated from the coordinates of the target centerline and the longitude and latitude coordinates of the current ship. The calculation formula is as shown in Formula 10:
[0152]
[0153] In the formula: x0 and y0 are respectively the longitude coordinate and latitude coordinate of the current ship in the Cartesian coordinate system, x i , y i , x i+1 , y i+1 are respectively the coordinates of the coordinate points of the target centerline in the Cartesian coordinate system.
[0154] After obtaining the longitude, latitude, speed, course, and inter-trajectory distance, due to the differences in the dimensions and value ranges between different ship behavior features, there are significant differences in the magnitudes between different features. For example, the speed is usually below 20 knots, while the course is within 0 - 360°. Therefore, before inputting the behavior features corresponding to at least one target centerline into the prediction model, it is necessary to perform normalization processing on each feature to scale different features to the same scale, thereby avoiding the comparison and calculation between different features being affected by large numerical changes in certain features. Normalization can enhance the generalization ability of the model, make the data between different samples have the same scale, and thus make it easier for the model to learn the laws between different samples and improve the generalization ability of the model. In the embodiment of the present invention, min-max normalization is adopted to scale different ship behavior features proportionally to within 0 - 1. The normalization formula is as shown in Formula 11:
[0155]
[0156] In the formula: X fis an eigenvalue; X min and X max are respectively the minimum and maximum values of this feature; X n is the eigenvalue after normalization.
[0157] In some embodiments of the present invention, at least one behavior feature corresponding to the normalized target center line can be input into the prediction model for training the prediction model;
[0158] Test the prediction model according to the behavior features of the current ship.
[0159] In a specific embodiment of the present invention, the state of the longitude, latitude, speed, course, and distance between trajectories of the behavior feature at the i-th moment of the ship can be expressed as P i =(x i , y i , v i , c i , d i ), and the ship behavior feature sequence T={p1, p2…p n} can be obtained. The prediction model predicts the state of the ship at the next moment i+1 by inputting the state of the ship in the previous i moments, and its model can be summarized as shown in Formula 12:
[0160] P i+1 =f(P i-n+1 ,…, P i-1 , P i ) Formula 12
[0161] After predicting the state P i+1 of the ship at the i+1 moment, it can be combined with (P i-n+2 ,…, P i-1 , P i , P i+1 ) to form a prediction of the state of the ship at the i+2 moment. Therefore, the model for predicting the future ship state through ship historical data can be as shown in Formula 13:
[0162]
[0163] For the prediction model, it is necessary to calculate the difference between the predicted ship behavior feature sequence and the actual ship behavior feature sequence to reflect the prediction effect of the model. Therefore, it is necessary to predict the longitude, latitude, speed, and course of the ship at future moments, and the root mean square error (RMSE) and mean absolute error (MAE) can be calculated. The calculation methods are as shown in Formula 14 and Formula 15:
[0164]
[0165]
[0166] where: y i and are the characteristic predicted value and the true value respectively, and N is the number of samples.
[0167] The root mean square error (RMSE) and the mean absolute error (MAE) are selected to evaluate the model performance. The smaller the values of RMSE and MAE are, the better the model prediction performance is.
[0168] In order to better implement the ship behavior characteristic prediction method in the embodiments of the present invention, correspondingly, based on the ship behavior characteristic prediction method, the embodiments of the present invention further provide a ship behavior characteristic prediction device, as Figure 5 shown. The ship behavior characteristic prediction device includes:
[0169] A data acquisition module 501, configured to acquire historical trajectory data of historical ships and current trajectory data of a current ship in a water area to be studied;
[0170] A similarity calculation module 502, configured to calculate the similarity between pairwise trajectories in the historical trajectory data according to a water area rasterization model to obtain a similarity matrix;
[0171] A trajectory clustering module 503, configured to calculate a distance matrix according to the similarity matrix; input the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result; the ship trajectory clustering result includes ship trajectory clusters corresponding to different categories;
[0172] A center line extraction module 504, configured to identify and extract the ship trajectory clusters of different categories according to an extraction algorithm respectively to obtain ship trajectory center lines corresponding to different categories;
[0173] A feature prediction module 505, configured to process the current trajectory data and the ship trajectory center lines according to a prediction model to obtain the behavior characteristics of the current ship at subsequent moments.
[0174] The ship behavior characteristic prediction device provided in the above embodiments can implement the technical solutions described in the embodiments of the above ship behavior characteristic prediction method. For the specific implementation principles of the above modules or units, reference can be made to the corresponding content in the embodiments of the above ship behavior characteristic prediction method, which will not be elaborated here.
[0175] As Figure 6 shown, the present invention also correspondingly provides a ship behavior characteristic prediction device 600. The ship behavior characteristic prediction device 600 includes a processor 601, a memory 602, and a display 603. Figure 6Only some components of the ship behavior feature prediction device 600 are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively.
[0176] In some embodiments, the memory 602 may be an internal storage unit of the ship behavior feature prediction device 600, such as the hard disk or memory of the ship behavior feature prediction device 600. In other embodiments, the memory 602 may also be an external storage device of the ship behavior feature prediction device 600, such as a plug-in hard disk equipped on the ship behavior feature prediction device 600, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc.
[0177] Furthermore, the memory 602 may also include both an internal storage unit and an external storage device of the ship behavior feature prediction device 600. The memory 602 is used to store the application software installed in the ship behavior feature prediction device 600 and various types of data.
[0178] In some embodiments, the processor 601 may be a Central Processing Unit (CPU), a microprocessor, or other data processing chips, and is used to run the program code stored in the memory 602 or process data, such as the ship behavior feature prediction method in the present invention.
[0179] In some embodiments, the display 603 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. The display 603 is used to display the information in the ship behavior feature prediction device 600 and to display a visual user interface. The components 1001-1003 of the ship behavior feature prediction device 600 communicate with each other through the system bus.
[0180] In some embodiments of the present invention, when the processor 601 executes the ship behavior feature prediction program in the memory 602, the following steps may be implemented:
[0181] Obtain the historical trajectory data of historical ships and the current trajectory data of the current ship in the water area to be studied;
[0182] Calculate the similarity between every two trajectories in the historical trajectory data according to the water area rasterization model to obtain a similarity matrix;
[0183] Input the similarity matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result; the ship trajectory clustering result includes ship trajectory clusters corresponding to different categories;
[0184] Identify and extract the ship trajectory clusters of the different categories respectively according to the extraction algorithm, and obtain the ship trajectory center lines corresponding to the different categories;
[0185] Process the current trajectory data and the ship trajectory center line according to the prediction model, and obtain the behavior characteristics of the current ship at subsequent moments.
[0186] It should be understood that when the processor 601 executes the ship behavior characteristic prediction program in the memory 602, in addition to the above functions, other functions can also be realized. For specific details, reference can be made to the description of the corresponding method embodiments above.
[0187] Furthermore, the type of the ship behavior characteristic prediction device 600 mentioned in the embodiments of the present invention is not specifically limited. The ship behavior characteristic prediction device 600 can be a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of the portable ship behavior characteristic prediction device include, but are not limited to, portable ship behavior characteristic prediction devices equipped with IOS, android, microsoft or other operating systems. The above portable ship behavior characteristic prediction devices can also be other portable ship behavior characteristic prediction devices, such as a laptop computer with a touch-sensitive surface (such as a touch panel). It should also be understood that in some other embodiments of the present invention, the ship behavior characteristic prediction device 600 may not be a portable ship behavior characteristic prediction device, but a desktop computer with a touch-sensitive surface (such as a touch panel).
[0188] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the programs or instructions are executed by a processor, the method steps or functions of the ship behavior characteristic prediction method provided in the above method embodiments can be realized.
[0189] Those skilled in the art can understand that all or part of the processes of implementing the methods in the above embodiments can be completed by instructing relevant hardware (such as a processor, a controller, etc.) through a computer program. The computer program can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium is a disk, an optical disk, a read-only memory or a random access memory, etc.
[0190] The above has introduced in detail the method and device for predicting ship behavior characteristics provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for predicting ship behavior characteristics, characterized in that, Including: Obtain the historical trajectory data of historical ships and the current trajectory data of current ships in the water area to be studied; Calculate the similarity between every two trajectories in the historical trajectory data according to the water area rasterization model to obtain a similarity matrix; Calculate a distance matrix according to the similarity matrix; input the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result; the ship trajectory clustering result includes ship trajectory clusters corresponding to different categories; Identify and extract the ship trajectory clusters of different categories respectively according to an extraction algorithm to obtain the ship trajectory centerlines corresponding to different categories; Process the current trajectory data and the ship trajectory centerlines according to a prediction model to obtain the behavior characteristics of the current ship at subsequent moments; The inputting the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result includes: Perform a first marking and a second marking on the historical trajectory data respectively to obtain a first marking result and a second marking result of the historical trajectory data; both the first marking result and the second marking result are unvisited; Process the first trajectory data in the historical trajectory data according to the distance matrix to obtain the quantity of the second trajectory data in the historical trajectory data within the distance threshold range for dividing adjacent trajectories; Judge whether the quantity of the second trajectory data is greater than or equal to the minimum trajectory number threshold set for clustering; If so, modify the first marking result of the first trajectory data to a core trajectory and modify the second marking result of the first trajectory data to visited; If not, modify the first marking result of the first trajectory data to an outlier and modify the second marking result of the first trajectory data to visited; Determine the target cluster of the first trajectory data according to the first marking result of the first trajectory data, and determine the first trajectory data as the third trajectory data in the target cluster; When there is no trajectory data in the historical trajectory data with the second marking result being unvisited, obtain the ship trajectory clusters corresponding to each target cluster according to the third trajectory data corresponding to each target cluster; obtain the ship trajectory clustering result according to the ship trajectory clusters corresponding to all target clusters.
2. The ship behavior characteristic prediction method according to claim 1, wherein, The determining the target cluster of the first trajectory data according to the first marking result of the first trajectory data and determining the first trajectory data as the third trajectory data in the target cluster includes: Judge whether the first trajectory data is assigned a target cluster; If so, determine the first trajectory data as the third trajectory data in the target cluster; If not, when the first trajectory data is the core trajectory, establish a target cluster belonging to the first trajectory data and determine the first trajectory data as the third trajectory data in the target cluster; when the first trajectory data is the outlier, do not perform any operation.
3. The ship behavior characteristic prediction method according to claim 1, characterized in that When there is no trajectory data with the second marking result of unvisited in the historical trajectory data, obtaining a ship trajectory cluster corresponding to each target cluster according to the third trajectory data corresponding to each target cluster includes: Judging whether there is such trajectory data with the second marking result of unvisited in the historical trajectory data; If so, determining the unvisited trajectory data as the first trajectory data, and re-executing the step of "processing the first trajectory data in the historical trajectory data according to the distance matrix to obtain the quantity of the second trajectory data in the historical trajectory data within the distance threshold range for dividing adjacent trajectories"; If not, obtaining a ship trajectory cluster corresponding to each target cluster according to the third trajectory data corresponding to each target cluster.
4. The ship behavior characteristic prediction method according to claim 1, wherein The extraction algorithm includes: Normalizing the longitudes and latitudes of at least two third trajectory data in the ship trajectory cluster of the current category to obtain at least one trajectory length corresponding to the ship trajectory of the current category; Modeling the at least one trajectory length of the current category according to Gaussian process regression and summarizing it into the ship route model to obtain the ship trajectory center line of the current category.
5. The ship behavior characteristic prediction method according to claim 1, characterized in that Calculating the similarity between every two trajectories in the historical trajectory data according to the water area rasterization model to obtain a similarity matrix includes: Determining the size of the grid in the water area rasterization model according to the range of the water area to be studied; Obtaining the coordinate of each grid line in the water area rasterization model according to the size of the grid, longitude and latitude; Mapping the historical trajectory data into the water area rasterization model according to the coordinate of each grid line to obtain the mapping result of the water area rasterization model; Determining the similarity between every two trajectories according to the mapping result; Obtaining a similarity matrix according to the similarity between every two trajectories.
6. The ship behavior characteristic prediction method according to claim 5, wherein Every two trajectories include a first trajectory and a second trajectory; Determining the similarity between every two trajectories according to the mapping result includes: Calculating the quantity of the first grids jointly passed by the first trajectory and the second trajectory in the water area rasterization model and the quantity of the second grids passed by the first trajectory and the second trajectory in the water area rasterization model according to the mapping result; Obtaining the similarity between the first trajectory and the second trajectory according to the quantity of the first grids and the quantity of the second grids.
7. The ship behavior feature prediction method according to claim 1, characterized in that Processing the current trajectory data and the ship trajectory center line according to the prediction model to obtain the behavior characteristics of the current ship at subsequent moments includes: Calculating the similarity between the current trajectory data and the ship trajectory center lines corresponding to different categories respectively according to the water area rasterization model, and determining at least one target center line whose similarity meets the preset threshold; Establishing a similar ship trajectory library according to the at least one target center line; Inputting the behavior characteristics corresponding to each target center line in the similar ship trajectory library into the prediction model to obtain the behavior characteristics of the current ship at the first moment; Input the behavioral characteristics of the current ship at the first moment into the prediction model to obtain the behavioral characteristics at the second moment; Determine the behavioral characteristics at the second moment as the behavioral characteristics at the first moment, and loop the step of "input the behavioral characteristics of the current ship at the first moment into the prediction model to obtain the behavioral characteristics at the second moment" to obtain the behavioral characteristics of the current ship at subsequent moments.
8. The ship behavior characteristic prediction method according to claim 7, wherein The behavioral characteristics include the distance between trajectories; The step of inputting the behavioral characteristics corresponding to each target centerline in the similar ship trajectory library into the prediction model to obtain the behavioral characteristics of the current ship at the first moment includes: According to the coordinates of each target centerline and the longitude and latitude coordinates of the current ship, calculate the distance between trajectories from the current ship to each target centerline respectively to obtain the behavioral characteristics corresponding to each target centerline; Perform normalization processing on the behavioral characteristics corresponding to each target centerline to obtain the processed behavioral characteristics; Input the processed behavioral characteristics into the prediction model to obtain the behavioral characteristics of the current ship at the first moment.
9. A ship behavior feature prediction device, characterized in that, Include: A data acquisition module for acquiring the historical trajectory data of historical ships and the current trajectory data of the current ship in the water area to be studied; A similarity calculation module for calculating the similarity between pairwise trajectories in the historical trajectory data according to the water area rasterization model to obtain a similarity matrix; A trajectory clustering module for calculating a distance matrix according to the similarity matrix; inputting the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result; the ship trajectory clustering result includes ship trajectory clusters corresponding to different categories; A centerline extraction module for respectively identifying and extracting the ship trajectory clusters of different categories according to an extraction algorithm to obtain the ship trajectory centerlines corresponding to different categories; A feature prediction module for processing the current trajectory data and the ship trajectory centerlines according to a prediction model to obtain the behavioral characteristics of the current ship at subsequent moments; The step of inputting the distance matrix and the historical trajectory data into a clustering algorithm to obtain a ship trajectory clustering result includes: Perform a first marking and a second marking on the historical trajectory data respectively to obtain a first marking result and a second marking result of the historical trajectory data; both the first marking result and the second marking result are unvisited; Process the first trajectory data in the historical trajectory data according to the distance matrix to obtain the number of second trajectory data in the historical trajectory data within the distance threshold range for dividing adjacent trajectories; Judge whether the number of the second trajectory data is greater than or equal to the minimum trajectory number threshold set for clustering; If so, modify the first marking result of the first trajectory data to a core trajectory and modify the second marking result of the first trajectory data to visited; If not, modify the first marking result of the first trajectory data to an outlier and modify the second marking result of the first trajectory data to visited; Determine the target cluster of the first trajectory data according to the first labeling result of the first trajectory data, and determine the first trajectory data as the third trajectory data in the target cluster; When there is no trajectory data with the second labeling result of unvisited in the historical trajectory data, obtain the ship trajectory clusters corresponding to each target cluster according to the third trajectory data corresponding to each target cluster; obtain the ship trajectory clustering result according to the ship trajectory clusters corresponding to all target clusters.
Citation Information
Patent Citations
Ship route prediction method based on ship trajectory clustering
CN112164247A
Computer-Implemented Systems And Methods For Variable Clustering In Large Data Sets
US20100153456A1