A step-by-step method for predicting ship trajectory based on AIS dynamic information
By preprocessing AIS data and building an Xgboost model, combined with polynomial or piecewise interpolation methods, the data quality problem in ship trajectory prediction in harsh maritime environments is solved and the prediction accuracy and stability are improved.
Patent Information
- Application Number
- CN202210863446.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-20
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-07-20
AI Technical Summary
The quality of AIS data is unstable due to the harsh communication environment at sea. It is difficult for existing methods to effectively correct the data when processing ship trajectory prediction, resulting in a decrease in prediction accuracy.
By preprocessing, timing alignment, grid processing and anomaly detection of AIS data, an Xgboost model is constructed for trajectory point prediction, and polynomial or piecewise interpolation methods are used for trajectory prediction to eliminate time series constraints based on RNN models.
It improves the accuracy and stability of ship trajectory prediction, reduces error accumulation, and is suitable for data processing in harsh maritime environments.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present invention relates to the field of ship trajectory prediction, and in particular to a method for predicting ship trajectory step by step based on AIS dynamic information. Background Art
[0002] AIS is an automatic tracking system on ships. With the mandatory installation of AIS equipment, we can easily obtain information such as the speed, heading, destination and ship identification code of each shipping ship. By analyzing AIS data, the trajectory of the ship can be predicted. However, due to the harsh communication environment at sea, the original AIS data may contain some obviously incorrect fields and abnormal information points, or even lose the entire data packet, which will pollute the database. In the case of uneven data quality, the RNN-based method popular for land vehicle trajectory prediction is not suitable for predicting ship trajectories.
[0003] In order to solve this problem and obtain evenly distributed corrected AIS data in the time dimension, the original AIS data needs to be interpolated and corrected. The current effective method is to use cubic spline interpolation to smooth the trajectory. However, if the AIS data of the ship trajectory is still regarded as a time series for interpolation processing, it is necessary to compensate for the non-existent data. Using this interpolation or recovery method to process data will inevitably bring additional error accumulation to the trajectory prediction system and reduce the accuracy of the prediction.
[0004] Previous studies on ship trajectory prediction can be roughly divided into two categories: modeling based on kinematic equations and machine learning. In order to ensure prediction accuracy, the modeling method must establish appropriate kinematic equations to adapt to complex environmental factors. This requires the operator to have sufficient prior knowledge of the ship's navigation area, which is usually difficult to meet in practice. The machine learning method does not require the establishment of kinematic equations for each selected ship. The usual practice is to establish a neural network-based prediction model and a clustering-based model. However, these methods either require strictly aligned AIS data as input or require large data sets to cluster similar trajectories. Summary of the invention
[0005] The present invention provides a method for predicting ship tracks step by step based on AIS dynamic information to overcome the above technical problems.
[0006] A method for predicting ship trajectory step by step based on AIS dynamic information, comprising:
[0007] S1. Obtain the track point information generated during the ship's navigation process according to AIS. The track point information includes IMO, MMSI, speed, ground course, ship heading, longitude, latitude, time, and length. All track point information generated during the navigation process is stored in the AIS data set.
[0008] S2. Preprocessing the AIS data set, and sorting the preprocessed AIS data set in chronological order, wherein the preprocessing includes deleting abnormal records, detecting and deleting abnormal track point information obtained based on an abnormality detection algorithm, wherein deleting abnormal records includes deleting data with MMSI numbers less than 9 digits or all 0s, headings less than 0° or greater than 360°, and navigation speeds less than 0 miles per hour or greater than 25 miles per hour;
[0009] S3, performing time series alignment on the sorted AIS data set, including decomposing the AIS data set based on the time difference, interpolating the decomposed AIS data set, and removing redundant data in the AIS data set;
[0010] S4, gridding the longitude and latitude of all track point information in the AIS data set, obtaining the coupling points of all track points, representing the track points and their coupling points as track point pairs, and calculating the navigation distance of the track points based on the track point pairs;
[0011] S5. Obtain the sailing distance of all track points, construct training samples according to the longitude, latitude, speed, heading, bow direction, length, and sailing distance of all track points, and divide the training samples into a training set and a test set.
[0012] Construct an Xgboost model, train a first Xgboost model with longitude change as output and a second Xgboost model with latitude change as output through a training set, and optimize the two trained models with a test set, wherein the optimization of the two trained models with the test set is to optimize the two models respectively by a 5-fold cross-validation method, input the test set into the model, calculate the evaluation index of the model prediction, adjust the parameters of the model according to the evaluation index, and obtain two models with the best evaluation index, wherein the evaluation index includes but is not limited to AUC, ACC, MSE and F1-score,
[0013] Input a single track point into the two models respectively, obtain the output longitude change and latitude change, and obtain the longitude and latitude of the ship after the prediction time interval according to the longitude and latitude of the track point and the output longitude change and latitude change.
[0014] S6. Set k different prediction time intervals, train the first Xgboost model and the second Xgboost model respectively based on different prediction time intervals, input a single trajectory point into the two models respectively, obtain k groups of longitude changes and latitude changes, obtain k groups of ship longitudes and latitudes according to the longitudes and latitudes of the trajectory points and the k groups of longitude changes and latitude changes, and use the k groups of ship longitudes and latitudes as the skeleton points of the ship trajectory.
[0015] S7. Calculate the slope and slope deviation of the straight line formed by the longitude and latitude of two adjacent groups of ships. When the slope deviation is less than the fourth threshold, use the polynomial interpolation method for interpolation. Otherwise, use the piecewise interpolation method for interpolation. Use the skeleton points and the longitude and latitude obtained by interpolation as the predicted ship trajectory.
[0016] Preferably, S4 includes gridding the longitude and latitude of all track point information in the AIS data set by formulas (1) and (2).
[0017]
[0018] Among them, δ lng ,δ lat The grid sizes representing longitude and latitude are set to 0.004° and 0.005° respectively. min(lng) is the minimum longitude value in the AIS dataset, and min(lat) is the minimum latitude value in the AIS dataset. lng i Indicates the longitude of the i-th trajectory point, lat i represents the latitude of the i-th trajectory point;
[0019] According to formula (3), we can get the trajectory point x i The coupling point x j , P ij represents the trajectory point pair,
[0020]
[0021] x i = {lat i ,lng i ,v i ,d t ,h i ,l i ,t} T ,lat i ,lng i ,v i ,d t ,h i ,l i Respectively represent the longitude, latitude, speed, heading, ship heading, length, and time of the i-th track point, x j = {lat j ,lng j ,v j ,d t ,h j ,l j ,t} T ,lat j ,lng j ,v j ,d t ,hj ,l j , t represent the longitude, latitude, speed, heading, ship heading, length, and time of the jth track point respectively. is the time of the ith trajectory point, is the time of the jth trajectory point, ∈1 is the prediction time interval, ∈2 is the deviation, T is the AIS dataset,
[0022] According to P ij Calculate the navigation distance y of the i-th track point i ={dlat i ,dlng i} T ,
[0023] dlng i =lng j -lng i (4)
[0024] dlat i =lat j -lat i (5)
[0025] lng i Indicates the longitude of the i-th trajectory point, lat i Indicates the latitude of the i-th trajectory point, lng j Indicates the longitude of the jth trajectory point, lat j Represents the latitude of the j-th trajectory point. The j-th trajectory point and the i-th trajectory point constitute a trajectory point pair.
[0026] Preferably, S7 includes calculating the slope k of the straight line formed between the longitudes and latitudes of two adjacent groups of ships according to formula (6): i , calculate the slope deviation Δk according to formula (7),
[0027]
[0028] Among them, dlng m is the change in longitude of the mth group, dlat m is the latitude change of the mth group, dlng m+1 is the change in longitude of the m+1th group, dlat m+1 is the change in latitude of the m+1th group,
[0029] When Δk is less than the fourth threshold, the polynomial interpolation method is used for interpolation, otherwise the piecewise interpolation method is used for interpolation, and the skeleton points and the longitude and latitude obtained by interpolation are used as the predicted ship trajectory.
[0030] Preferably, the decomposing the AIS data set based on the time difference includes setting a first time threshold, calculating the time difference of all adjacent trajectory points in the AIS data set, traversing the time difference in sequence, and if the time difference is greater than the first time threshold, the trajectory point at the previous moment among the adjacent trajectory points corresponding to the time difference is regarded as a demarcation point, all demarcation points are obtained, and the AIS data is decomposed according to the demarcation points.
[0031] Preferably, the interpolating the decomposed AIS data set includes setting a second time threshold, and interpolating the decomposed AIS data set according to the second time threshold and a cubic spline interpolation method.
[0032] Preferably, removing redundant data in the AIS data set includes setting a third time threshold, recalculating the time difference of all adjacent trajectory points in the AIS data set, traversing the time difference in sequence, and if the time difference is less than the third time threshold, obtaining the adjacent trajectory point corresponding to the time difference, randomly deleting one of the trajectory point information, and repeatedly calculating the time difference of all adjacent trajectory points in the AIS data set until all time differences are greater than the third time threshold.
[0033] Preferably, the detecting and deleting of abnormal trajectory point information obtained based on the abnormality detection algorithm includes calculating the normalized speed of the trajectory point according to formula (8):
[0034]
[0035] Among them, x i represents the i-th trajectory point, x i-1 represents the i-1th trajectory point, grad[i] is the normalized velocity of the i-th trajectory point, v i-1 is the velocity of the i-1th trajectory point, Dist(x i ,x i-1 ) represents the physical distance between the i-th trajectory point and the i-1-th trajectory point, is the time of the ith trajectory point, is the time of the i-1th trajectory point,
[0036] The average speed of all trajectory points in the AIS data set is calculated, and all trajectory points are traversed to calculate the difference between the normalized speed of the trajectory point and the average value. When the difference is greater than the fifth threshold, the trajectory point is marked as a speed anomaly point. A box plot is drawn based on the adjacent trajectory points of the speed anomaly point. The trajectory points that exceed the upper boundary of the box plot or are lower than the lower boundary of the box plot are marked as position anomaly points. All speed anomaly points and position anomaly points in the AIS data are deleted.
[0037] The present invention provides a method for predicting ship trajectories step by step based on AIS dynamic information. Each record of AIS data of a selected ship is processed separately. By training an Xgboost model, only the subsequent trajectory points of the ship need to be predicted according to the last trajectory point of the ship to form a complete trajectory. The constraint that the input of the RNN-based model must be a time series is eliminated, thereby improving the accuracy of ship trajectory prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0039] Figure 1 is a flow chart of the method of the present invention;
[0040] Figure 2 is a flow chart of abnormal point detection of the present invention;
[0041] Figure 3 This is the Xgboost model training process of the present invention;
[0042] Figure 4 It is the Xgboost model optimization prediction process of the present invention;
[0043] Figure 5 It is the overall model structure diagram of the present invention. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0045] Figure 1 It is a flow chart of the method of the present invention, such as Figure 1 As shown, the method of this embodiment may include:
[0046] A method for predicting ship trajectory step by step based on AIS dynamic information, comprising:
[0047] S1. Obtain the track point information generated during the ship's navigation process according to AIS. The track point information includes IMO (International Maritime Organization, International Maritime Organization identification code), MMSI (Maritime Mobile Service Identify, Maritime Mobile Service Identify code), speed, ground heading, ship heading, longitude, latitude, time, and ship length. All track point information generated during the navigation process is stored in the AIS data set;
[0048] Due to the harsh communication environment at sea, the original AIS data may contain some obviously incorrect fields, such as IMO, MMSI, speed, heading over the ground, heading, longitude, latitude, etc. In order to obtain a cleaner data set, the abnormal records must be removed first. The abnormal records can be divided into the following categories:
[0049] (1) Records with unreasonable MMSI numbers. The MMSI is a sequence of 9 digits that uniquely identifies a ship and some records may return insufficient or all zero digits in the sequence;
[0050] (2) Records of headings outside the normal range. The heading should be within the range of 0 to 360°.
[0051] (3) The speed recorded exceeds the normal range. The speed should not exceed 25 miles per hour.
[0052] S2, preprocessing the AIS data set, sorting the preprocessed AIS data set by time, the preprocessing includes deleting abnormal records, detecting and deleting abnormal trajectory point information obtained based on anomaly detection algorithm;
[0053] Deleting abnormal records includes: deleting data with MMSI numbers less than 9 digits or all zeros, headings less than 0° or greater than 360°, and navigation speeds less than 0 miles per hour or greater than 25 miles per hour.
[0054] Even if significant erroneous records have been eliminated, the ship's trajectory may still have some abnormal points with abnormal position information. This interference will provide inappropriate information and inevitably interfere with the model's effective prediction of the ship's position. Therefore, it is necessary to further detect and remove abnormal track points.
[0055] Detecting and deleting abnormal trajectory point information obtained based on the anomaly detection algorithm includes calculating the normalized velocity of the trajectory point according to formula (1):
[0056]
[0057] Among them, grad[i] is the normalized velocity of the ith trajectory point, vi-1 is the velocity of the i-1th trajectory point, Dist(x i ,x i-1 ) represents the physical distance between the i-th trajectory point and the i-1-th trajectory point, are the times of the i-th trajectory point and the i-1-th trajectory point respectively.
[0058] For AIS data records in the same voyage, the deviation between the actual average speed and the recorded speed should be within a reasonable range. Points with unreasonable speed are called suspicious speed abnormal points. Suspicious speed abnormal points can be selected according to the 3-σ rule. The 3-σ rule is to select the percentage of the AIS speed data with a deviation from the average value less than one σ, 2σ, and 3σ in the normally distributed AIS speed data. The corresponding ranges are 68.27%, 95.45%, and 99.73%. Points with errors exceeding 3 standard deviations are considered to be speed abnormal points.
[0059] The outlier detection flow chart is as follows: Figure 2 As shown, the average speed of all trajectory points in the AIS data set is calculated, all trajectory points are traversed, and the difference between the normalized speed of the trajectory point and the average speed is calculated. When the difference is greater than the fifth threshold, that is, when the difference exceeds 3 standard deviations, the trajectory point is marked as a speed anomaly point, and a box plot is drawn according to the adjacent trajectory points of the speed anomaly point. The trajectory points exceeding the upper boundary of the box plot or below the lower boundary of the box plot are marked as position anomaly points, and all speed anomaly points and position anomaly points in the AIS data are deleted.
[0060] S3, performing time series alignment on the sorted AIS data set, including decomposing the AIS data set based on the time difference, interpolating the decomposed AIS data set, and removing redundant data in the AIS data set;
[0061] For a continuous trajectory, if the time interval between two consecutive AIS messages received between the trajectories exceeds the time threshold, the trajectory is decomposed into two unrelated trajectories. If there are multiple such points in a trajectory, it is decomposed into multiple (temporally discontinuous) unrelated trajectories.
[0062] Decomposing the AIS data set based on the time difference includes setting a first time threshold, calculating the time difference of all adjacent track points in the AIS data set, traversing the time difference in sequence, and if the time difference is greater than the first time threshold, the track point at the previous moment among the adjacent track points corresponding to the time difference is regarded as a demarcation point, obtaining all the demarcation points, and decomposing the AIS data according to the demarcation points;
[0063] Interpolating the decomposed AIS data set includes setting a second time threshold, and interpolating the decomposed AIS data set according to the second time threshold and a cubic spline interpolation method;
[0064] Since the minimum transmission interval of AIS data can be in the order of seconds, a large number of valid samples will be gathered in certain periods of time of the ship. These samples are similar to each other. When used as training samples, the effect is similar to or even worse than taking only one of them as a representative, and there is also a negative effect of increasing the amount of calculation. Therefore, it is considered that the samples with a recording time difference of less than 1 minute have similar characteristics, and only one of them is sampled as a valid sample. Therefore, all records can be resampled within 1 minute to reduce redundancy. After resampling, there will be no more than one point pair in one minute. Preferably, the value of the second time threshold can be 1 minute.
[0065] The decomposed AIS dataset is interpolated using the cubic spline interpolation method, using the cubic polynomial shown in formula (2) to approximate each time interval t i ~t i+1 The actual curve of , i represents the i-th trajectory in the trajectory set.
[0066] S i (t) = a i t 3 +b i t 2 +c i t+d i (2)
[0067] where a i ,b i ,c i ,d i are the coefficients that need to be calculated under the constraints of the first and second derivatives. After obtaining the approximate cubic polynomial, the intermediate values between adjacent skeleton points can be derived and the prediction of the selected trajectory can be completed at the target point, thereby completing the interpolation.
[0068] Removing redundant data in the AIS data set includes setting a third time threshold, recalculating the time difference of all adjacent trajectory points in the AIS data set, traversing the time difference in sequence, and if the time difference is less than the third time threshold, obtaining the adjacent trajectory points corresponding to the time difference, randomly deleting one of the trajectory point information, and repeatedly calculating the time difference of all adjacent trajectory points in the AIS data set until all time differences are greater than the third time threshold.
[0069] S4. Grid the longitude and latitude of all track point information in the AIS data set using formulas (3) and (4).
[0070]
[0071]
[0072] Among them, δ lng ,δ latThe grid sizes representing longitude and latitude are set to 0.004° and 0.005° respectively. min(lng) is the minimum longitude value in the AIS dataset, and min(lat) is the minimum latitude value in the AIS dataset. lng i Indicates the longitude of the i-th trajectory point, lat i represents the latitude of the i-th trajectory point;
[0073] Using subscript notation T = {x i |x i , i=1,2,…,m} to represent a trajectory consisting of m points, where x i Represents the i-th record of the entire trajectory. A trajectory point pair is defined as two points in the same trajectory that are separated by a certain period of time (∈1) (for example, 5 minutes). “Approximately” means that we can tolerate a small deviation (∈2). According to formula (5), we can obtain the trajectory point x i The coupling point x j , P ij represents the trajectory point pair,
[0074]
[0075] x i = {lat i ,lng i ,v i ,d t ,h i ,l i ,t} T ,lat i ,lng i ,v i ,d t ,h i ,l i Respectively represent the longitude, latitude, speed, heading, ship heading, length, and time of the i-th track point, x j = {lat j ,lng j ,v j ,d t ,h j ,l j ,t} T ,lat j ,lng j ,v j ,d t ,h j ,l j , t represent the longitude, latitude, speed, heading, ship heading, length, and time of the jth track point respectively. is the time of the ith trajectory point, is the time of the jth trajectory point, ∈1 is the prediction time interval, ∈2 is the deviation, T is the AIS dataset,
[0076] According to P ij The navigation distance of the i-th track point is represented as y i ={dlat i ,dlng i} T , calculate dlng according to formula (6) i , calculate dlat according to formula (7) i ,
[0077] dlng i =lng j -lng i (6)
[0078] dlat i =lat j -lat i (7)
[0079] lng i Indicates the longitude of the i-th trajectory point, lat i Indicates the latitude of the i-th trajectory point, lng j Indicates the longitude of the jth trajectory point, lat j represents the latitude of the jth trajectory point. The jth trajectory point and the i-th trajectory point form a trajectory point pair.
[0080] S5. Obtain the sailing distance of all track points, construct training samples based on the longitude, latitude, speed, heading, bow direction, length, and sailing distance of all track points, and select longitude, latitude, speed, ground heading, bow direction, and length as input features of the Xgboost model from all track point information based on navigation knowledge. Since speed and heading are the key conditions for establishing a ship kinematic model, ground heading can be used as an auxiliary correction of heading. From the longitude and latitude features, the model can understand the hydrological characteristics of the study area. Since ships of different lengths have different sailing trends, in practice, ship length is another effective predictive factor.
[0081] The training samples are divided into a training set and a test set, and an Xgboost model is constructed. The first Xgboost model with longitude change as output and the second Xgboost model with latitude change as output are trained through the training set. The Xgboost model training process is as follows: Figure 3 As shown, during the Xgboost model training process, the objective function is set as formula (8):
[0082]
[0083] The former is the loss function, which uses the log-likelihood cost function to measure the difference between the current output prediction value and the true value. The latter is the penalty term to avoid overfitting, which is positively correlated with the number and score of leaf nodes in the spanning tree. t (X i ) is the number of predicted ships at the track point X i The sailing distance after ∈1 time, is the cumulative distance prediction value obtained by calculating all spanning trees previously, y i is the actual distance, Ω(f t ) is the score of the current spanning tree structure.
[0084] The objective function Obj (t) Use Taylor's second-order Taylor expansion approximation, and then calculate f t (x i ) is derived to find the optimal solution that minimizes the objective function as shown in formula (9):
[0085]
[0086] where g i is the loss function l for The first derivative of i is the loss function l for The second derivative of , T is the number of leaf nodes in the current tree, γ is the penalty coefficient for the number of leaf nodes, and λ is the penalty coefficient for the score of the leaf node. Traverse all the features of the sample and possible split nodes, calculate the gain of the objective function before and after the split, and select the largest node gain to compare with the gain threshold. If the number of split nodes is too large or the score of the leaf node is low, terminate the tree split and start the next round of iteration. Divide the training set into an internal training set and an internal test set, optimize the Xgboost model using a 5-fold cross-validation method, and optimize the two trained models with the test set. Use AUC (Area Under Curve, area under the curve), ACC (accuracy, accuracy), MSE (Mean Square Error) and F1-score (F1 value) and other evaluation indicators to evaluate the prediction performance of the model, and adjust the parameters in the model according to these indicators to obtain the optimal model.
[0087] Input a single track point into the two models respectively, obtain the longitude change (longitude moving distance) and latitude change (latitude moving distance) output in the grid coordinate system, and obtain the longitude and latitude of the ship after the prediction time interval based on the longitude and latitude of the track point and the output longitude change and latitude change. Figure 4 shown.
[0088] However, only one future coordinate is not enough to form a complete ship trajectory. Therefore, it is necessary to train a set of Xgboost models to predict the subsequent coordinates within a specified time period by adjusting the value of the time interval. These subsequent coordinates are the skeleton points.
[0089] S6. Assign ∈1 to k different prediction time intervals, train the first Xgboost model and the second Xgboost model based on different prediction time intervals, and obtain k Xgboost model groups. The standard symbol definition of the Xgboost model group is shown in formulas (10), (11), and (12).
[0090]
[0091]
[0092] F=(φ k (x i ;∈1),ψ k (x i ;∈1)) / ∈1∈slot1, slot2,..., slot k ... (12)
[0093] Among them, x i is the feature of the i-th sample, φ k , ψ k Represents the latitude and longitude of the navigation distance predicted by the kth group model. The possible values of ∈1 are set to 1, 5, 10, 15, 20, 25, 30 minutes, slot k is the prediction time interval of the kth group model.
[0094] That is, a single trajectory point is input into the Xgboost model group to obtain k groups of longitude changes and latitude changes. According to the longitude and latitude of the trajectory point and the k groups of longitude changes and latitude changes, k groups of ship longitudes and latitudes are obtained, and the k groups of ship longitudes and latitudes are used as the skeleton points of the ship trajectory.
[0095] After training to obtain a set of Xgboost models, the Xgboost model can be used to predict the position of the skeleton points in the future trajectory of the ship. The skeleton points are connected by interpolation, and the coordinates are fitted at the intermediate time points to expand the discrete skeleton points to a complete trajectory. Different interpolation methods have different accuracy and resource consumption. For example, polynomial interpolation is simple and easy to use, but when the highest degree of the polynomial is high, the Runge phenomenon may occur, causing the interpolation curve to become unstable. The segmented interpolation method, such as the cubic spline interpolation method, will avoid the Runge phenomenon, but it has high requirements for the selection of interpolation nodes and increases the amount of calculation. The prediction by Xgboost model is based on the prediction of single-point skeleton points, and the longitude and latitude coordinates of the skeleton points are predicted. Therefore, before interpolation, the longitude and latitude between any two adjacent skeleton points can be calculated, and the slope ki of the straight line connecting the two points can be calculated. The slope deviation Δk is used to distinguish the trajectory. Δk is the absolute value of the difference between the average slope of any two adjacent skeleton points and the slope of the first and last points. Δk can reflect the change of the curve. Generally speaking, the smaller Δk is, the closer the fitting trajectory curve is to the linear trajectory. The larger Δk is, the more complex the fitting curve is. Linear trajectories use polynomial interpolation, and complex trajectories use piecewise interpolation methods.
[0096] S7. Calculate the slope k of the straight line between the longitudes and latitudes of two adjacent groups of ships according to formula (13): i , calculate the slope deviation Δk according to formula (14),
[0097]
[0098]
[0099] Among them, dlng m is the change in longitude of the mth group, dlat m is the latitude change of the mth group, dlng m+1 is the change in longitude of the m+1th group, dlat m+1 is the change in latitude of the m+1th group,
[0100] When Δk is less than the fourth threshold, it is a complex trajectory and is interpolated using the polynomial interpolation method. Otherwise, it is a simple linear trajectory and is interpolated using the piecewise interpolation method. The skeleton points and the longitude and latitude obtained by interpolation are used as the predicted ship trajectory.
[0101] Denote the k prediction time intervals as [t1, t2, t3, ..., t N ], the corresponding coordinates are [y0, y1, y2...y n ],f[t k ]=y k .
[0102] For simple linear trajectories, the Newton interpolation method in polynomial interpolation is used. The difference quotient of f(t) can be defined as:
[0103] f[k]=f(t k ), k=1, 2, 3,..., n (15)
[0104]
[0105] Its high-order difference quotient recursion formula:
[0106]
[0107] Therefore, the prediction curve S(t) fitted by the skeleton points is as shown in formula (18):
[0108] S(t)=a0+a1(t-t1)+...+a N (t-t1)(t-t2)...(tt N ) (18)
[0109] where a k =f[t1, t2, ..., t k ],k=1,2,3,...,n,
[0110] For complex trajectories, the cubic spline interpolation method in the piecewise interpolation is used to fit the curve. The cubic polynomial shown in formula (1) is used to approximate each time interval t i ~t i+1 The actual curve of , i represents the i-th track in the track set. After obtaining the approximate cubic polynomial, the intermediate values between adjacent skeleton points can be derived and the prediction of the selected track can be completed at the target point.
[0111] The overall model of the method for predicting the ship trajectory step by step based on AIS dynamic information includes obtaining historical AIS data, cleaning AIS data, detecting and deleting AIS data anomalies, aligning AIS data in time series, selecting trajectory point fields as features to train the Xgboost model, predicting the longitude and latitude coordinates of the skeleton points according to the Xgboost model, and obtaining the fitted trajectory according to the skeleton point classification interpolation, such as Figure 5 Shown is the overall model structure diagram of this embodiment.
[0112] The overall beneficial effect is to provide a method for predicting the ship's trajectory step by step based on AIS dynamic information. Each record of the AIS data of the selected ship is processed separately. By training the Xgboost model, only the subsequent trajectory points of the ship need to be predicted based on the last trajectory point of the ship to form a complete trajectory. This eliminates the constraint that the RNN-based model input must be a time series, and improves the accuracy of ship trajectory prediction.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting ship trajectory step by step based on AIS dynamic information, characterized in that: include, S1. Obtain the track point information generated during the ship's navigation process according to AIS. The track point information includes IMO, MMSI, speed, ground course, ship heading, longitude, latitude, time, and length. All track point information generated during the navigation process is stored in the AIS data set. S2. Preprocessing the AIS data set, and sorting the preprocessed AIS data set in chronological order, wherein the preprocessing includes deleting abnormal records, detecting and deleting abnormal track point information obtained based on an abnormality detection algorithm, wherein deleting abnormal records includes deleting data with MMSI numbers less than 9 digits or all 0s, headings less than 0° or greater than 360°, and navigation speeds less than 0 miles per hour or greater than 25 miles per hour; S3, performing time series alignment on the sorted AIS data set, including decomposing the AIS data set based on the time difference, interpolating the decomposed AIS data set, and removing redundant data in the AIS data set; S4, gridding the longitude and latitude of all track point information in the AIS data set, obtaining the coupling points of all track points, representing the track points and their coupling points as track point pairs, and calculating the navigation distance of the track points based on the track point pairs; S5. Obtain the sailing distance of all track points, construct training samples according to the longitude, latitude, speed, heading, bow direction, length, and sailing distance of all track points, and divide the training samples into a training set and a test set. Construct an Xgboost model, train a first Xgboost model with longitude change as output and a second Xgboost model with latitude change as output through a training set, and optimize the two trained models with a test set, wherein the optimization of the two trained models with a test set is to optimize the two models respectively by a 5-fold cross-validation method, input the test set into the model, calculate the evaluation index of the model prediction, adjust the parameters of the model according to the evaluation index, and obtain the two models with the best evaluation index, wherein the evaluation index includes AUC, ACC, MSE and F1-score, Input a single track point into the two models respectively, obtain the output longitude change and latitude change, and obtain the longitude and latitude of the ship after the prediction time interval according to the longitude and latitude of the track point and the output longitude change and latitude change. S6. Set k different prediction time intervals, train the first Xgboost model and the second Xgboost model respectively based on different prediction time intervals, input a single trajectory point into the two models respectively, obtain k groups of longitude changes and latitude changes, obtain k groups of ship longitudes and latitudes according to the longitudes and latitudes of the trajectory points and the k groups of longitude changes and latitude changes, and use the k groups of ship longitudes and latitudes as the skeleton points of the ship trajectory. S7. Calculate the slope and slope deviation of the straight line formed by the longitude and latitude of two adjacent groups of ships. When the slope deviation is less than the fourth threshold, use the polynomial interpolation method for interpolation. Otherwise, use the piecewise interpolation method for interpolation. Use the skeleton points and the longitude and latitude obtained by interpolation as the predicted ship trajectory.
2. The method for predicting ship trajectory step by step based on AIS dynamic information according to claim 1, characterized in that: S4 includes gridding the longitude and latitude of all track point information in the AIS data set using formulas (1) and (2). Among them, δ lng ,δ lat The grid sizes representing longitude and latitude are set to 0.004° and 0.005° respectively. min(lng) is the minimum longitude value in the AIS dataset, and min(lat) is the minimum latitude value in the AIS dataset. lng i Indicates the longitude of the i-th trajectory point, lat i represents the latitude of the i-th trajectory point; According to formula (3), we can get the trajectory point x i The coupling point x j , P ij represents the trajectory point pair, x i = {lat i ,lng i ,v i ,d t ,h i ,l i ,t} T ,lat i ,lng i ,v i ,d t ,h i ,l i , t represent the latitude, longitude, speed, heading, heading, length, and time of the i-th track point, respectively. j = {lat j ,lng j ,v j ,d t ,h j ,l j ,t} T ,lat j ,lng j ,v j ,d t ,h j ,l j , t represent the latitude, longitude, speed, heading, ship heading, length, and time of the jth track point, respectively. is the time of the ith trajectory point, is the time of the jth trajectory point, ∈1 is the prediction time interval, ∈2 is the deviation, T is the AIS dataset, According to P ij Calculate the navigation distance y of the i-th track point i ={dlat i ,dlng i } T , no i =long j -lng i (4) for i =years j -years i (5) The j-th trajectory point and the i-th trajectory point form a trajectory point pair.
3. The method for predicting ship trajectory step by step based on AIS dynamic information according to claim 1, characterized in that: S7 includes calculating the slope k of the straight line formed between the longitudes and latitudes of two adjacent groups of ships according to formula (6): i , calculate the slope deviation Δk according to formula (7), Among them, dlng m is the change in longitude of the mth group, dlat m is the latitude change of the mth group, dlng m+1 is the change in longitude of the m+1th group, dlat m+1 is the change in latitude of the m+1th group, When Δk is less than the fourth threshold, the polynomial interpolation method is used for interpolation, otherwise the piecewise interpolation method is used for interpolation, and the skeleton points and the longitude and latitude obtained by interpolation are used as the predicted ship trajectory.
4. The method for predicting ship trajectory step by step based on AIS dynamic information according to claim 1, characterized in that: The decomposing of the AIS data set based on the time difference includes setting a first time threshold, calculating the time difference of all adjacent trajectory points in the AIS data set, traversing the time difference in sequence, and if the time difference is greater than the first time threshold, the trajectory point at the previous moment among the adjacent trajectory points corresponding to the time difference is regarded as a demarcation point, all demarcation points are obtained, and the AIS data is decomposed according to the demarcation points.
5. The method for predicting ship trajectory step by step based on AIS dynamic information according to claim 4 is characterized in that: The interpolating the decomposed AIS data set includes setting a second time threshold, and interpolating the decomposed AIS data set according to the second time threshold and a cubic spline interpolation method.
6. The method for predicting ship trajectory step by step based on AIS dynamic information according to claim 5, characterized in that: The removing of redundant data in the AIS data set includes setting a third time threshold, recalculating the time difference of all adjacent track points in the AIS data set, traversing the time difference in sequence, and if the time difference is less than the third time threshold, obtaining the adjacent track points corresponding to the time difference, randomly deleting one of the track point information, and repeatedly calculating the time difference of all adjacent track points in the AIS data set until all time differences are greater than the third time threshold.
7. The method for predicting ship trajectory step by step based on AIS dynamic information according to claim 1, characterized in that: The detecting and deleting of abnormal trajectory point information obtained based on the abnormal detection algorithm includes calculating the normalized velocity of the trajectory point according to formula (8): Among them, x i represents the i-th trajectory point, x i-1 represents the i-1th trajectory point, grad[i] is the normalized velocity of the i-th trajectory point, v i-1 is the velocity of the i-1th trajectory point, Dist(x i ,x i-1 ) represents the physical distance between the i-th trajectory point and the i-1-th trajectory point, is the time of the ith trajectory point, is the time of the i-1th trajectory point, The average speed of all trajectory points in the AIS data set is calculated, and all trajectory points are traversed to calculate the difference between the normalized speed of the trajectory point and the average value. When the difference is greater than the fifth threshold, the trajectory point is marked as a speed anomaly point. A box plot is drawn based on the adjacent trajectory points of the speed anomaly point. The trajectory points that exceed the upper boundary of the box plot or are lower than the lower boundary of the box plot are marked as position anomaly points. All speed anomaly points and position anomaly points in the AIS data are deleted.
Citation Information
Patent Citations
Ship trajectory prediction method based on machine learning and AIS data
CN113283653A
Method and system for predicting channel crossing behavior of ferry based on machine learning
CN114118604A
Artificial-intelligence-based waterway information system
US20210334650A1
Method and system for assessing and early warning ship collision risk
US20220036738A1
