AIS data ship trajectory extraction method based on improved LOF-GMM algorithm

Through the improved LOF-GMM algorithm, combined with coordinate conversion and time weight, efficient identification of AIS data is achieved, solving the problems of low efficiency of ship trajectory data extraction and multi-stage detection in the existing technology, and realizing navigation, stay and Accurate identification of abnormal data.

CN119179880APending Publication Date: 2024-12-24SHANGHAI OCEAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411232074.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

When processing AIS data, the extraction efficiency of ship trajectory data is low, and requires human subjective judgment and multiple stages to detect abnormal and stay trajectory points respectively. It is impossible to efficiently identify multiple data types, resulting in large amounts of computing and low efficiency.

Method used

The improved LOF-GMM algorithm is used to obtain ship navigation data, coordinate conversion and time weight determination, and the improved LOF algorithm detects local anomaly factors, and clusters through GMM algorithms to determine the residence cluster, navigation cluster and abnormal cluster to achieve Identification of three types of data.

Benefits of technology

While eliminating noise data, navigation and stay data are efficiently extracted, overcoming the difficulty of overlapping trajectory recognition, improving data cleaning efficiency, and being able to identify multiple data types at once, reducing the amount of computing and improving detection efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119179880A_ABST
    Figure CN119179880A_ABST
Patent Text Reader

Abstract

The invention discloses an AIS data ship trajectory extraction method based on an improved LOF-GMM algorithm, and the method comprises the steps: obtaining the original data of ship navigation, carrying out the coordinate conversion of the original data, and determining a time weight according to the converted data; performing local abnormal factor detection on the original data by using an improved LOF algorithm according to the time weight so as to obtain an LOF numerical value of each track point; and clustering the LOF numerical values by using a GMM algorithm to obtain an average value of each clustering type LOF, and determining a stay cluster, a navigation cluster and an abnormal cluster according to the average value. According to the method provided by the invention, the navigation data and the stay data can be extracted while the noise of the AIS data is eliminated, the method adapts to the continuity of ship trajectory data, and the problem of difficulty in identification caused by overlapped trajectories is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of marine technology, and in particular to a method for extracting ship tracks from AIS data based on an improved LOF-GMM algorithm. Background Art

[0002] In many important branches of today's ocean field, such as marine science, maritime management, and marine resource protection, the collection, analysis, and application of ship trajectory data play an indispensable role. As a widely adopted ship position monitoring system, the Automatic Identification System (AIS) transmits a variety of information in real time through the Very High Frequency (VHF) band, including the ship name, Maritime Mobile Service Identifier (MMSI), location coordinates, speed, heading, etc. With these data, not only can nearby ships avoid traffic, but shore base stations and regulatory agencies can also perform decoding work to improve the visual management and safety index of maritime traffic. At the same time, AIS also provides massive ship trajectory data, which provides an important way to study the ocean field.

[0003] At present, the process of extracting ship trajectories from AIS data includes two stages. First, the noise points in the original data are separated by rule detection to extract the stop trajectory points and the navigation trajectory points. Then, the stop data is separated by the speed threshold. It is worth noting that there is a significant difference between the stop state of a ship at sea and the stop state of a ground vehicle. One obvious difference is that when the ship's diesel engine is stopped, although the ship speed is zero, the ship is not actually stationary due to the effect of sea breeze and current. Most of the ship speed information in the AIS system comes from the speedometer and GPS. The value of zero does not represent true stillness, so the stop point cannot be accurately determined by speed alone. For the setting of the speed threshold, due to the differences in the marine environment, it is impossible to have a universal standard. Therefore, after the abnormal data is cleared, the separated data set is feature extracted, and the stop trajectory points are clustered and identified through relevant mathematical models.

[0004] However, most ship trajectory data processing methods require subjective human judgment of input parameters or thresholds to achieve ideal identification results. At the same time, a single algorithm can only detect one type of data, so two stages are used to detect abnormal trajectory points and stop trajectory points respectively. However, in the face of the huge amount of AIS data, the efficiency needs to be improved. If the same method can be used to identify multiple data types, it will effectively reduce the amount of calculation and improve the cleaning efficiency. Therefore, there is an urgent need for a method to extract trajectory data after efficiently detecting three data types with high efficiency. Summary of the invention

[0005] The present invention provides a method for extracting ship tracks from AIS data based on an improved LOF-GMM algorithm, aiming to effectively solve the above technical problems.

[0006] According to a first aspect of the present invention, the present invention provides a method for extracting ship tracks from AIS data based on an improved LOF-GMM algorithm, the method comprising:

[0007] Acquire original data of ship navigation, perform coordinate transformation on the original data, and determine time weight according to the transformed data;

[0008] According to the time weight, using an improved LOF algorithm to perform local anomaly factor detection on the original data to obtain the LOF value of each trajectory point;

[0009] The LOF values ​​are clustered using the GMM algorithm to obtain the average value of the LOF of each cluster type, and the stay cluster, navigation cluster and abnormal cluster are determined based on the average value.

[0010] According to a second aspect of the present invention, the present invention also provides an AIS data ship track extraction device based on an improved LOF-GMM algorithm, comprising:

[0011] A data acquisition and conversion module is used to acquire the original data of the ship's navigation, perform coordinate conversion on the original data, and determine the time weight according to the converted data;

[0012] A LOF detection module, configured to perform local anomaly factor detection on the raw data using an improved LOF algorithm according to the time weight, so as to obtain a LOF value of each trajectory point;

[0013] The clustering module is used to cluster the LOF values ​​using the GMM algorithm to obtain the average value of each cluster type LOF, and determine the stay cluster, navigation cluster and abnormal cluster according to the average value.

[0014] According to a third aspect of the present invention, the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above method.

[0015] According to a fourth aspect of the present invention, the present invention further provides a storage medium on which a computer program is stored, and when the program is executed by a processor, the method as described above is implemented.

[0016] Through one or more of the above embodiments of the present invention, at least the following technical effects can be achieved: the AIS data ship trajectory extraction method based on the improved LOF-GMM algorithm provided by the present application can extract navigation data and stay data while removing the noise of AIS data, and it improves the LOF algorithm to adapt to the continuity of ship trajectory data, overcomes the recognition difficulty caused by overlapping trajectories, and obtains the abnormal factor distribution of three types of data. The optimal clustering algorithm GMM is selected for clustering, and finally the clustered data clusters are classified according to the distribution characteristics of the LOF data type, and finally the stay cluster, navigation cluster and abnormal cluster are obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The technical solutions and other beneficial effects of the present invention will be made apparent by describing in detail the specific embodiments of the present invention in conjunction with the accompanying drawings.

[0018] Figure 1 One of the flow charts of the method for extracting ship tracks from AIS data based on the improved LOF-GMM algorithm provided in an embodiment of the present invention;

[0019] Figure 2 The second flowchart of the method for extracting ship tracks from AIS data based on the improved LOF-GMM algorithm provided in an embodiment of the present invention;

[0020] Figure 3a , Figure 3b , Figure 3c They are respectively a schematic diagram of a return trajectory provided by an embodiment of the present invention, a schematic diagram of trajectory anomaly distribution without considering time characteristics, and a schematic diagram of trajectory anomaly distribution considering time characteristics.

[0021] Figure 4a , Figure 4b , Figure 4c , Figure 4d They are respectively a schematic diagram of an original trajectory, a distribution diagram of abnormal factors at the start of a stop point, a distribution diagram of abnormal factors at the start of a navigation point, and a distribution diagram of abnormal factors at the start of an abnormal point provided by an embodiment of the present invention;

[0022] Figure 5 A schematic diagram of actual AIS data provided by an embodiment of the present invention;

[0023] Figure 6 A schematic diagram of abnormal data identification effects of different threshold LOF algorithms provided in an embodiment of the present invention;

[0024] Figure 7a This is one of the original trajectory schematic diagrams provided in the embodiment of the present invention. Figure 7b-7k Based on Figure 7aSchematic diagram of data extraction results with the provided original trajectory and thresholds ranging from 1 to 10;

[0025] Figure 8a The second schematic diagram of the original trajectory provided by the embodiment of the present invention is: Figure 8b , Figure 8c Based on Figure 8a K-means++ navigation trajectory extraction map and K-means++ stay trajectory extraction map generated by the provided original trajectory. Figure 8d , Figure 8e Based on Figure 8a The K-medoid navigation trajectory extraction map and K-medoid stay trajectory extraction map generated by the provided original trajectory, Figure 8f , Figure 8g Based on Figure 8a The FCM navigation trajectory extraction map and FCM stay trajectory extraction map generated by the provided original trajectory, Figure 8h , Figure 8i Based on Figure 8a GMM navigation trajectory extraction map and GMM stay trajectory extraction map generated by the provided original trajectory;

[0026] Figure 9a , Figure 9b They are respectively a schematic diagram of a detection effect considering time characteristics and a schematic diagram of a detection effect not considering time characteristics provided by an embodiment of the present invention;

[0027] Fig.10a , Fig.10b , Fig.10c They are respectively a schematic diagram of a navigation trajectory, a schematic diagram of a stop trajectory, and a schematic diagram of an abnormal trajectory provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0028] The technical scheme in the embodiment of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all of the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0029] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the term "and / or" herein is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " herein, unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.

[0030] The data transmission frequency of the AIS system is high when the ship is sailing. At the same time, the ocean traffic is crowded and the marine environment is complex, which also leads to the fact that the quality of the huge ship trajectory data is very unsatisfactory. Therefore, the AIS trajectory data has the characteristics of large magnitude, strong spatiotemporal correlation, and multiple data types (such as sailing, stop and abnormal data). The actual trajectory diagram of a ship records its process from acceleration to deceleration to stop and re-departure, which includes not only navigation data, but also stop data and abnormal data.

[0031] Abnormal data is usually a small probability random event in which the normal navigation track of a ship deviates significantly, which interferes with the use of AIS data. Therefore, it is necessary to eliminate the impact of abnormal data on the data set to ensure the reliability of all research on AIS data. In addition, navigation data and stop data are the main components of AIS data, among which navigation data is often used for ship collision avoidance, ship trajectory prediction, and navigation planning. Stop data is used for port berthing area analysis, fishery resource development, ship stop monitoring, etc. Extracting navigation and stop data is the basis for the above-mentioned research.

[0032] At present, in the process of processing ship trajectory data, there are common processing methods such as simply eliminating abnormal data and using interpolation fitting. Such methods ignore the mixed stop data and navigation data of ships, lack of detailed identification of stop point data, and the disadvantages are obvious. In specific studies, such as navigation feature extraction, stop data is not helpful for analysis, but will drag down the calculation efficiency. Therefore, the cleaning of abnormal data and stop data cannot be ignored. The thresholds required to identify abnormal data and stop data mostly rely on manual settings, which inevitably brings the risk of misjudgment and may even delete some valid data by mistake. When processing real-time massive AIS data, the efficiency of manual cleaning is questioned, especially in complex situations, where human factors have a great impact on the identification results. The limitations of current research on the identification of stop point data, such as over-reliance on density judgment and neglect of time feature analysis, undoubtedly lead to incomplete and inaccurate cleaning results.

[0033] In terms of abnormal data removal, R Martinko et al. first divided the study area into grids, and then used AIS data to determine whether it was in the specified grid to identify abnormal points. Hubert M et al. explored how to use robust statistical methods to detect outliers in multivariate data sets to deal with possible noise in the data. GuanYUAN et al. first introduced the concept of trajectory structure and made full use of the implicit features of the trajectory for analysis. Liangbin et al. set breakpoints based on spatial and temporal empirical thresholds to divide the trajectory into sub-trajectories, and filtered out the sub-trajectories that lacked integrity after correlation judgment of adjacent trajectories. Ling-zhi Sang et al. classified AIS abnormal data into three types: range anomaly, speed anomaly, and heading anomaly. According to the geographical location of the AIS equipment and its maximum receiving range, they calculated the vector composed of longitude, latitude, heading, and speed to determine the abnormal points. However, this method requires an advance investigation of the parameters of the AIS equipment in the relevant ports. Considering that most anomaly detection algorithms ignore important factors such as speed, acceleration and curves, Sun Shuang et al. proposed a trajectory outlier detection algorithm TODDT based on dynamic differential threshold. By combining dynamic differential threshold with outlier detection, the traditional distance-based algorithm was improved to discover more trajectory abnormal data. Based on the development of abnormal trajectory detection of moving objects, Zhipeng Liu et al. introduced the classic trajectory outlier detection (TRAOD) algorithm, and then proposed a density-based trajectory outlier detection (DBTOD) algorithm to make up for the shortcomings of the TRAOD algorithm that cannot detect abnormal defects when the trajectory is locally dense. Ryan et al. used the DBSCAN method to automatically detect random outliers, and identified outliers by classifying data points into core points, boundary points, and noise points, but the model input parameters need to be determined through experiments, and the model is only suitable for identifying data generated during navigation, but cannot identify data generated by other navigation modes of ships. B Zong et al. proposed a deep autoencoder Gaussian mixture model (DAGMM) for unsupervised anomaly detection, and optimized the parameters of the deep autoencoder and GMM in an end-to-end manner. The F1 score of the experimental results in the official dataset achieved an improvement of up to 14%. Yingfu Huang et al. proposed a ship abnormal behavior detection method combining K nearest neighbor (KNN) and LOF algorithms based on the problems of low accuracy of ship abnormal behavior detection based on global variables and high computational complexity of ship anomaly detection based on local variables. First, KNN filtering is performed on the data set, and then the local deviation index is calculated using the LOF algorithm. Finally, the abnormal ship data is identified by reasonably setting the threshold.

[0034] In terms of separation of navigation data and stay data, Zhang Pengxin et al., after using DBSCAN, regarded each cluster as a stay point, and judged the stay cluster according to the maximum distance between the geometric center starting point and the end point and the artificially set threshold. This method easily retains the acceleration behavior of the ship from stay to sail as a stay point. Fangli Mou et al. constructed a traffic density image based on AIS data, clustered the main maritime routes and identified the navigation trajectory, and processed the stay data through K-nearest neighbor clustering and morphological processing techniques to reduce its interference with the navigation route analysis. The similarity method was also applied to improve the efficiency and accuracy of extracting and analyzing the ship's navigation route from AIS data, but the robustness of this algorithm to noise needs further verification and optimization. Rong H et al. proposed an outlier algorithm based on distance. By analyzing the spatiotemporal data of ship movement, the algorithm can find uncommon or suspicious paths to help ensure the safety and efficiency of port operations. This method has been proven to be applicable to the identification of outliers in large multidimensional data sets in various fields, but the recognition effect of the algorithm needs to be improved when dealing with complex behavior pattern ship trajectories. Fabrizio Natale et al. adopted a threshold setting method to identify points with speeds below a certain value as stop points, and points with speeds above the value as navigation points. Based on the ship speed profile analysis, they identified when the ship was sailing (faster speed or changing within a certain range) and when the ship was moored or fishing (speed close to zero or within a very low range). The threshold selection involved in this method is affected by many factors in different situations and has poor stability. ROCHA et al. took the change of heading in the trajectory as the main research object, regarded the trajectory as a collection of a series of stop and move segments, and studied the stop, move and heading change. On this basis, they proposed a trajectory clustering algorithm based on heading change, clustered and extracted the stop points and move points of the ship trajectory, and finally analyzed the average preparation and navigating time, fishing time, and the number of preparations and fishing times of fishing boats during fishing. Considering that the heading data in the AIS message is not accurate, and this method has high requirements for heading accuracy, this method has great limitations in practical application. Based on the problems of unstable time intervals to messages and inability to describe the specific activities of fishing vessels, PEEL et al. described the activities of fishing vessels as four states: anchored, sailing, in port, and trawling. They used the hidden Markov method to identify the patterns of ship activities and clustered each state separately, thereby obtaining the patterns of fishing vessel activities and concentrated fishing areas. Since the hidden Markov model requires a large number of accurate event markers to train the model in practical applications, and these markers are often difficult to obtain, the conditions of this method are relatively strict.Liang Huang et al. constructed a two-stage ship trajectory stop point extraction strategy to accurately evaluate ship stop activities in large-scale trajectory data, and proposed a feature-driven ship stop behavior recognition and automatic classification method; a rule model was constructed with distance, time and number of trajectory points as constraints, and candidate stop trajectories in the original trajectory were detected. The isolated forest algorithm was introduced to detect and remove abnormal outliers, and a highly concentrated set of ship stop trajectories was extracted; although innovations were made in extracting stop trajectories in this method, the universality of this method for different sea areas and ship types still has certain limitations. ZhengTao Zheng et al. proposed a ship stop trajectory extraction method based on multiple constraints, which mines port stop areas by setting multiple thresholds, but the algorithm results are affected by the threshold settings, and it is easy to confuse the deceleration stage before the ship stops and the initial acceleration stage after the stop.

[0035] The existing LOF algorithm reflects the density distribution of data in space, while in most cases, ships are often distributed in a forward manner in space. When dealing with return or overlapping routes, the LOF algorithm will not show its advantages.

[0036] In view of the above problems, the present invention provides a method for extracting ship tracks from AIS data based on an improved LOF-GMM algorithm. The following introduces a method for extracting ship tracks from AIS data based on an improved LOF-GMM algorithm provided by the present invention in conjunction with the accompanying drawings.

[0037] See also Figure 1 and Figure 2 , a method for extracting ship tracks from AIS data based on an improved LOF-GMM algorithm, comprising the following steps:

[0038] S101, obtaining original data of ship navigation, performing coordinate conversion on the original data, and determining a time weight according to the converted data. Specifically, the original data of ship navigation is obtained through an AIS system.

[0039] S102, performing local anomaly factor detection on the original data using an improved LOF algorithm according to the time weight, so as to obtain the LOF value of each trajectory point.

[0040] S103, clustering the LOF values ​​using a GMM algorithm to obtain an average value of the LOF of each cluster type, and determining a stay cluster, a navigation cluster, and an abnormal cluster according to the average value.

[0041] This application calculates the outlier value (i.e., LOF value) of each AIS data through the improved LOF algorithm, and clusters the outliers using the GMM algorithm to obtain three types of data clusters. The true type division of each type of cluster is achieved by judging the size of the outlier value. Among them, the outlier value of the outlier cluster is greater than the outlier value of the navigation cluster, and the outlier value of the stay cluster is the smallest.

[0042] The AIS data ship trajectory extraction method based on the improved LOF-GMM algorithm provided in the embodiment of the present application can extract navigation data and stay data while removing the noise of AIS data. It improves the LOF algorithm to adapt to the continuity of ship trajectory data, overcomes the recognition difficulty caused by overlapping trajectories, and obtains the abnormal factor distribution of three types of data. The optimal clustering algorithm GMM is selected for clustering, and finally the clustered data clusters are classified according to the distribution characteristics of the LOF data type, and finally the stay cluster, navigation cluster and abnormal cluster are obtained.

[0043] In some embodiments of the present application, the local anomaly factor detection is performed on the original data using an improved LOF algorithm according to the time weight to obtain the LOF value of each trajectory point, including:

[0044] The spatiotemporal Euclidean distance between each trajectory point in the original data is calculated according to the time weight.

[0045] The reachable distance is calculated based on the spatiotemporal Euclidean distance, and the LOF value is calculated based on the reachable distance and the spatiotemporal Euclidean distance.

[0046] In some embodiments of the present application, calculating the spatiotemporal Euclidean distance between each trajectory point in the original data according to the time weight includes:

[0047] According to the first spatiotemporal Euclidean distance calculation formula, the first spatiotemporal Euclidean distance between each trajectory point is calculated:

[0048]

[0049] Where P is the space-time coordinate set of the trajectory, d(P) is the first Euclidean distance matrix between the trajectory points, ω is the time weight, T i is the time corresponding to the current i-th trajectory point, n is the number of trajectory points, and Respectively represent the latitude and longitude of the i-th trajectory point;

[0050] The obtaining of the reachable distance according to the spatiotemporal Euclidean distance calculation, and further obtaining of the LOF value according to the reachable distance and the spatiotemporal Euclidean distance calculation, includes:

[0051] Based on the first spatiotemporal Euclidean distance, the reachable distance of each trajectory point is calculated using the reachable distance calculation formula:

[0052] d k (p i ,p j )=max{d k (p j ),d(p i ,p j )},(i≠j,N k (p i ) ≥ k);

[0053] Among them, d(p i ,p j ) represents the trajectory point p i To the trajectory point p j The distance, d k (p j ) represents point p j The kth distance from point p j The distance of the kth original trajectory point, N k (p i ) represents the trajectory point p i The kth distance neighborhood range, d k (p i ,p j ) represents point p j To point p i The k-th reachable distance of

[0054] Based on the reachable distance, the LOF value is calculated using the local outlier factor formula:

[0055] in,

[0056] In the formula, ρ k (p i ) indicates p i All trajectory points in the kth distance neighborhood to p i The inverse of the average reachable distance, L OFk (p i ) represents point p i The local outlier factor.

[0057] In this embodiment, the ship trajectory in time and space is considered, and the converted time is introduced into the calculation. Directly introducing time will directly affect the characteristics of the original trajectory, so the time weight is introduced for calculation.

[0058] First, the spatiotemporal Euclidean distance between each trajectory point is calculated, as shown in formula (2):

[0059]

[0060] Where P is the space-time coordinate set of the trajectory, d(P) is the Euclidean distance matrix between the trajectory points, ω is the time weight, T i is the time corresponding to the current i-th trajectory point, in seconds, and n is the number of trajectory points.

[0061] As shown in formula (3), the k-th reachable distance in space and time is calculated for each trajectory point.

[0062] d k (p i ,p j )=max{d k (p j ),d(p i ,p j )},(i≠j,N k (p i )≥k) (3)

[0063] Where d(p i ,p j ) represents the trajectory point p i to p j Distance. k (p j ) represents point p j The kth distance from point p j The distance of the kth original trajectory point. N k (p i ) represents the trajectory point p i The kth distance neighborhood range is |N k (p i )| indicates that p i The number of trajectory points in the neighborhood is greater than or equal to k. k (p i ,p j ) represents point p j To point p i The k-th reachable distance, special attention should be paid to d k (p i ,p j ) and d k (p j ,p i ) have different meanings.

[0064] The kth reachable distance is calculated, and the local reachable density between trajectory points is calculated, ρ k (p i ) indicates p i All trajectory points in the kth distance neighborhood to p iThe inverse of the average reachable distance is shown in the following formula (4):

[0065]

[0066] It should be noted that the stop track generated by the ship has a certain probability of being a repeated point (the coordinate points are completely the same). If the spatial coordinates are directly used for calculation, p i It is also the k+1th trajectory point in the repeated point, which will lead to ρ k (p i ) is zero, which leads to the value of the kth reachable density in the subsequent calculation to be infinite. Based on this, the application adds the value of the time dimension. Since time is continuous, it cleverly overcomes the difficulty in identifying overlapping trajectories.

[0067] Finally, the local outlier factor is calculated, Represents point p i The local outlier factor of is shown in formula (5):

[0068]

[0069] In the formula, The value of is close to 1, which proves that p i The density between the neighborhood points of is basically the same as that of other nearby points, and they belong to the same category. The smaller the value, the greater the density. The larger the value, the greater the p i The greater the probability of being an abnormal trajectory point. The LOF algorithm needs to select the best k-th distance for calculation. At the same time, the larger the k value, the greater the amount of calculation.

[0070] In some embodiments of the present application, calculating the spatiotemporal Euclidean distance between each trajectory point in the original data according to the time weight includes:

[0071] According to the second space-time Euclidean distance calculation formula, the space-time Euclidean distance between each trajectory point is calculated:

[0072]

[0073] Where, d T (p i ,p j ) is the second space-time Euclidean distance between two points in the space-time coordinate system of the considered trajectory, p z Indicates time at T i and T j All points of

[0074] Accordingly, the obtaining the reachable distance according to the spatiotemporal Euclidean distance calculation includes:

[0075] Based on the second spatiotemporal Euclidean distance, the reachable distance of each trajectory point is calculated using the reachable distance calculation formula.

[0076] In this embodiment, taking into account various emergencies, there is a certain probability that the ship will choose to return along the way during the voyage. Two special situations may occur when returning. One is the arc trajectory generated when the ship adjusts the sailing direction, and the other is that the ship returns along the original route. When adjusting the sailing direction, when the sailing speed is low and the ship is operated by the crew, data features similar to those of a stopover point may be generated. When the ship returns along the way, it may be adjacent to or overlap with historical data (shorter Euclidean distance), which may cause abnormal distribution of abnormal factors. The occurrence of the above two situations may cause disorder of abnormal factors. Figure 3a The figure shows a return trajectory. Figure 3b From the distribution, it can be found that the abnormal factor of the arc trajectory generated by adjusting the bow direction during the return voyage is much smaller than the abnormal factor of normal navigation, and it will be cleared as a stop point. The process of adjusting the bow direction contains a large number of ship behavior characteristics (heading angular velocity, track curvature, heading acceleration, etc.). If this data is cleared, the available data information will be greatly reduced. When the data overlap points generated during the return voyage, a small amount of erroneous feature distribution will also be generated, making the entire distribution feature no longer obvious, and the LOF detection algorithm loses its classification utility.

[0077] The reason for the above phenomenon is that LOF reflects the density distribution of data in space, and in most cases, ships are often distributed in a forward manner in space. When dealing with return or overlapping routes, the LOF algorithm will not show its advantages. In the density identification method, the return track is often cut by identifying the change in the ship's heading, and then redivided into a new section of the navigation track for operation. Using this method, the heading change of all sample data will be identified, and other non-return tracks will be ineffectively calculated, reducing the efficiency of the algorithm. This phenomenon is caused by the LOF algorithm selecting and calculating the data objects in the neighborhood of the kth distance according to the size of the spatial Euclidean distance.

[0078] In view of this situation, the present application can calculate the spatiotemporal Euclidean distance between each trajectory point by using the second spatiotemporal Euclidean distance calculation formula:

[0079]

[0080] Among them, d T (p i ,p j ) is the Euclidean distance between two points in the space-time coordinate system of the considered trajectory, p z Indicates time at T i and T j All points of . When p jIn p i In the neighborhood, the Euclidean distance is the real Euclidean distance. Otherwise, the real distance between the two trajectories is obtained. By improving the distance calculation method of LOF, the temporal and spatial distance distribution of the ship trajectories can be maintained, and the influence of trajectory overlap can be eliminated. Figure 3c As shown, the LOF data of the trajectory points have normal numerical distribution after the improved calculation.

[0081] In some embodiments of the present application, clustering the LOF values ​​using the GMM algorithm to obtain the average value of the LOF of each cluster type includes:

[0082] Initialization step, randomly initialize the parameters of Gaussian distribution;

[0083] Step E, based on the initialization parameters, calculate the probability that each LOF value belongs to each Gaussian distribution;

[0084] Step M, updating the parameters of the Gaussian distribution based on the probability so as to maximize the log-likelihood of the updated parameters;

[0085] Iteration step: repeatedly executing the E step and the M step to reach the iteration end condition, and obtaining the final distribution model parameters for clustering the LOF data.

[0086] In this embodiment, the improved LOF algorithm is used to calculate the outlier value of each AIS data. Then, a clustering algorithm is used to obtain three types of data clusters. For the three types of data clusters, they also need to be divided into corresponding data types.

[0087] The type of starting point determines the size of the overall AIS data outlier. The outlier distribution of the three types of trajectory data in the AIS data is observed and analyzed. Figure 4a From the original trajectory diagram, we can see that the trajectory stops after a period of navigation, resulting in a stop trajectory. At the same time, during the navigation process, an obvious outlier coordinate, namely an abnormal trajectory point, is generated due to various reasons.

[0088] When calculating the local outlier factor, it is necessary to introduce all the k-th reachable distances in its neighborhood, which makes the calculated outlier factor propagable. However, the ship trajectory points are continuous in time and space, so the outlier factor has complete propagation. Therefore, selecting different starting trajectory points will affect the outlier factor of the overall trajectory point. Figure 4b It is the distribution characteristic of the overall abnormal factor obtained after the stop trajectory point is used as the starting calculation data. It can be observed that the abnormal factor of the stop trajectory point stays near the value of 1000, which is much larger than the abnormal factors of other data types. The factor of normal navigation data is concentrated around the value of 400, which is much larger than the abnormal factor of the stop trajectory. Figure 4cWhen the navigation trajectory is used as the starting point for calculation, the abnormal factor of the abnormal trajectory point is around the value 2, and the abnormal factor of the navigation trajectory data is still obviously distributed between the other two trajectory data. Figure 4d When the abnormal trajectory is used as the starting calculation point, the distribution characteristics remain unchanged.

[0089] From the distribution diagram, we can see that under the propagation effect of the LOF algorithm, the type of data selected as the starting point for calculation only affects the change in the overall abnormal factor amplitude, and does not affect the abnormal factor distribution structure of each of the three types of data, that is, the abnormal factor of the abnormal trajectory point is greater than that of the normal navigation trajectory point, and the value of the stop trajectory point is the smallest. The data type can be judged according to the numerical sorting of the abnormal factor of the entire navigation trajectory data. Therefore, after calculating the overall data abnormal value, the data is normalized to eliminate the amplitude effect and retain the distribution of the abnormal value. The mean of the abnormal value of each cluster is calculated, and the true type division of each cluster is realized by judging the size of the mean.

[0090] Select the clustering algorithm GMM to fit the complex distribution. Through the EM algorithm, the parameters of each Gaussian distribution in the mixed Gaussian model (π k ,μ k ,Σ k ), where π k , is the weight of the kth Gaussian model in the mixed Gaussian model, and μ k is the mean, Σ k is the covariance. The EM algorithm mainly includes two steps: the expectation step (E step) and the expectation maximization step (M step). In the E step, first randomly initialize the parameters or use the results of the previous iteration. Then, consider the hidden variables of each Gaussian distribution and calculate the probability that each data point belongs to each Gaussian distribution. This step mainly calculates the expectation of each data point corresponding to each Gaussian distribution. In the M step, according to the results of the hidden variables obtained in the previous step E, the parameters of the Gaussian distribution, including weights, mean and covariance, are updated by back-stepping. This step is to optimize the model parameters by maximizing the likelihood function. The whole process will be iterated in the above two steps until the log-likelihood function of the mixed Gaussian model converges. In this cycle, the EM algorithm gradually optimizes the parameters of the mixed Gaussian model through continuous iterations to make it better fit the data distribution.

[0091] In some embodiments of the present application, the step E comprises:

[0092] According to the probability formula, the probability of each LOF value belonging to each Gaussian distribution is calculated based on the initialization parameters:

[0093]

[0094] Among them, N(x i |μ k ,∑ k ) represents the mean μ k and covariance is ∑ k Gaussian model probability distribution function, γ(t,k) is the LOF value x of each trajectory point i The posterior probability of the Gaussian mixture model after the tth iteration is, is the weight of the kth Gaussian model in the Gaussian mixture model after the t-1th iteration.

[0095] The M steps include:

[0096] According to the maximum likelihood function, the parameters of the Gaussian distribution are updated based on the probability, and the estimated value is calculated:

[0097]

[0098] In this embodiment, the specific calculation method is as follows:

[0099] (1) Initialize the starting parameters and execute step E, as shown in the following formula:

[0100]

[0101] In the formula, N(x i |μ k ,∑ k ) represents the mean μ k and covariance is ∑ k Gaussian model probability distribution function. Calculate the LOF value of each trajectory point at x i The posterior probability γ(t,k) of the Gaussian mixture model after the tth iteration. i The probability of belonging to the kth Gaussian model.

[0102] (2) Execute the M step and obtain the estimated value by calculating the maximum likelihood function of the parameter Get the iterated GMM model, calculation formula:

[0103]

[0104] The E step and the M step are performed alternately until the maximum likelihood estimate in the M step converges. The significance of this algorithm is to maximize the joint probability of the LOF sample set for parameter estimation and select the best distribution model to complete clustering.

[0105] When the rule judges abnormal points, points greater than the threshold are often removed as abnormal data. However, when considering the spatiotemporal characteristics, it is found that misjudgment may occur when there is data missing in the AIS data. In this algorithm, local missing data may cause the abnormal value of the isolated point that is not missing to be too high, causing the algorithm to misjudge the data as abnormal data. For the abnormal data determined by the classifier, the time interval (the time interval is the difference between the timestamps of the two sets of data) is used to determine whether the data is abnormal due to missing data. Finally, the entire classifier design is completed.

[0106] In some embodiments of the present application, the coordinate conversion of the original data includes:

[0107] The latitude and longitude coordinates of each track point in the original data are converted into earth plane coordinates using the Mercator projection formula to obtain converted data;

[0108] Among them, the Mercator projection formula is:

[0109]

[0110] Where, L at and L on They represent the latitude and longitude of the trajectory point, respectively. x and y represent the coordinate axes of the coordinate system of the earth plane map. r0 is the radius of the circle parallel to the standard latitude. L at0 represents the standard latitude in the Mercator projection, a represents the equatorial radius of the earth ellipse, and e l is the first eccentricity of the Earth's ellipse.

[0111] Specifically, since the time of the original AIS data is in text format, it is necessary to convert the text into a numerical value in seconds through the corresponding time conversion formula. The longitude and latitude of the AIS data are typical geographic data. Therefore, formula (1) can be used to convert the geographic coordinate system into the Mercator projection (Universal Transverse Mercator, UTM). The longitude and latitude coordinates of the ship's navigation track point are converted into the coordinates of the earth's plane map through projection.

[0112]

[0113] Where, L at and L on They represent the latitude and longitude of the trajectory point, x and y represent the coordinate axes of the new coordinate system, r0 is the radius of the circle parallel to the standard latitude, L at0 represents the standard latitude in the Mercator projection, a represents the equatorial radius of the earth ellipse, and e l is the first eccentricity of the Earth's ellipse.

[0114] After converting to the Mercator coordinate system, the converted coordinates can be used to introduce time weights and calculate anomaly factors based on time weights. Before calculating anomaly factors, iKSSE is placed before the LOF algorithm to efficiently cut a large amount of useless interference data, obtain a more accurate search space, and improve the efficiency and effect of the LOF anomaly detection algorithm.

[0115] In another embodiment of the present application, the performance of the method provided in the present application is verified using historical AIS trajectory data, which specifically includes a model training process and a model testing process.

[0116] Training process: Use the training data and the GMM clustering algorithm to conduct training and observe the experimental results, and determine the best LOF k for the next test experiment.

[0117] Testing process: Two sets of comparative experiments were conducted using the test data: (1) Comparing the effects of several clustering methods, and obtaining the best clustering algorithm by comparing the accuracy of data type recognition. (2) Experimentally comparing the traditional LOF and the improved LOF algorithm provided in this application to verify the effectiveness and advancement of the improved algorithm.

[0118] The training data can be the trajectory generated near the New York Harbor in the United States from (40.2646°N, 72.7354°E) to (41.1792°N, 74,3591°E) from July 1 to July 2, 2022. For a schematic diagram of the training data, see Figure 5 , the training data includes manually labeled data types.

[0119] In this embodiment, each data point in the training data is marked, and data without ship type label, navigation track data, and track data time confusion are eliminated. For tracks without abnormal points, the MATLAB built-in randomization function is used to insert abnormal track points and mark them. Finally, 1738 segments of track data are obtained. The data set is divided into 80% training set and 20% test set.

[0120] After obtaining the above training set, model training is performed to determine the optimal LOF threshold k. Select the GMM clustering algorithm, the maximum number of iterations can be set to 100, and the termination condition of the iteration can be 10 -8 .

[0121] Set the threshold k = 1, 2…, 10, and calculate the recognition accuracy of the model under each threshold. Figure 6 As shown, the accuracy curve of the statistical model and the change of k.

[0122] Depend on Figure 6It can be seen that the model accuracy of thresholds 4 to 6 is relatively high, and the recognition accuracy of abnormal data and navigation data is perfect. As the threshold increases, the recognition of outliers continues to decline, resulting in a decrease in the overall model accuracy. The larger the threshold, the greater the amount of calculation of the LOF algorithm. Considering the adaptability to the overall ship trajectory, a threshold of 4 is the best choice.

[0123] Figure 7a This is the original track map of the ship with MMSI number 368009780 near the Port of New York, USA on July 1, 2022 (40.2646°N, 72.7354°E) ~ (41.1792°N, 74,3591°E). Figure 7b to Figure 7k The trajectory changes with the classification results as the threshold increases. The blue points in the figure are navigation points, the green points are stop points, and the red points are abnormal points. Figure 7b to Figure 7c , when the threshold is small (i.e., the threshold is 1 or 2), the local information is insufficient and some navigation data are easily identified as stay data. Figure 7d to Figure 7g It can be seen that as the threshold increases from 3 to 6, the situation is significantly improved. Figure 7h~Figure 7k It can be seen that when the threshold is 6, some abnormal data begin to be identified incorrectly, and the normal navigation trajectory also begins to be identified as abnormal data.

[0124] After training, the test set and the parameters obtained in the last iteration were used for testing. The test set includes 335 ship trajectories. As shown in Table 1, the test samples include 77 tugboats, 20 fishing boats, 160 yachts, 26 passenger ships, 32 cargo ships, and 20 tankers. A total of 160,232 data trajectory points, including 104,184 stop trajectory points, 54,418 navigation trajectory points, and 1,721 abnormal trajectory points.

[0125] Table 1 Distribution of test samples

[0126]

[0127] This model is a multi-classification model. Accuracy is the most intuitive measure of the model. It is calculated by dividing the number of correctly identified samples by the total number of sample data. Precision is the probability of being correctly classified as a certain type of sample. Recall is the proportion of sample data correctly classified as a certain type to the total number of that type. F1-Score is the harmonic mean of precision and recall. The higher the score, the better the classifier performs in balancing precision and recall. Accuracy, recall, precision, and F1 score are selected as evaluation indicators for the model's recognition effect on a certain category.

[0128] In addition, this embodiment also verifies the clustering process provided by this application.

[0129] First, the clustering performance of a group of classic clustering algorithms is compared to obtain the optimal clustering algorithm. For the classifier test experiment, the macro average parameter is used as the evaluation index. Since the current sample distribution is uneven and belongs to an unbalanced data set, and the macro average parameter focuses more on the category with a small sample size, the macro average parameter can be selected as the classification standard of the classifier. The performance parameters of each clustering algorithm are shown in the table, and the clustering results of the performance comparison experiment are shown in Figure 8a-8i As shown, the navigation trajectory extraction and stay trajectory extraction of each clustering algorithm are observed separately. Figure 8a The original data distribution of AIS includes red abnormal data points, blue navigation data points and green stop data points. Figure 8b - Figure 8I shows the clustering results of different clustering methods. Each method has a navigation data extraction situation and a stop data extraction situation. As can be seen from Table 2, K-meas++ has the fastest calculation speed, and the model accuracy reaches 92%, which is suitable for large-scale data. The K-means++ algorithm is a typical distance-based clustering algorithm, which uses distance as the evaluation indicator of similarity. The K-means++ method is easily affected by the selection of the initial cluster center, and may assign noise data or outliers to incorrect clusters. Therefore, this application uses the K-means++ algorithm to use a heuristic method to find the centroid seed of the k-means clustering. By Figure 8b-Figure 8c It can be seen that K-means++ has the best effect in identifying abnormal data. There is no abnormal data in the navigation data graph, and the noise cleaning is very clean. However, in the stay data, some normal navigation is also extracted as stay data.

[0130] K-medoid has a slightly improved accuracy compared to K-means++. The K-medoid algorithm considers that the new cluster center is not represented by the mean but by an object in the cluster, which can be considered as an improvement on the K-means algorithm. Figure 8d-8e It can be seen that although the accuracy has been improved, there are still problems with the separation of navigation points and stop points.

[0131] The FCM algorithm uses the least square error criterion for clustering, uses the distance between the sample point and the cluster center and expresses it with the square of the membership degree weighted, and transforms the intra-class error square sum objective function into a weighted error square sum objective function. The algorithm process is to continuously correct the cluster center value and the partition matrix composed of the membership degree value. Therefore, FCM is essentially also clustering by distance. From Table 2 and Figure 8f-8g It can be seen that the performance of FCM has been improved compared to K-medoid, but it still does not solve the problem of misjudgment of separation of navigation points and stop points.

[0132] In summary, K-means++, K-medoid, and FCM are all algorithms that use distance for clustering. These three clustering algorithms all have the problem of misjudgment of the separation of navigation points and stop points.

[0133] As can be seen from Table 2, GMM has the highest accuracy. GMM gives the probability of a data point being assigned to each category. Figure 8h-Figure 8i For the classification effect of GMM, GMM will remove a very small number of navigation points as abnormal points while perfectly separating abnormal data. But in return, the separation effect of navigation data and stop data has been greatly improved. The F1 score of the classifier is close to 1. The experimental results show that GMM is the clustering algorithm with the best ship classification effect among several algorithms.

[0134] Table 2 Performance indicators of each clustering algorithm

[0135]

[0136] From Table 3 and Table 4, we can see that the accuracy of the improved algorithm in this paper is improved by 4.38% compared with the original algorithm. Figure 9a and Figure 9b It shows the classification effect of the model on three types. Figure 9a and Figure 9b It can be found that after the algorithm is improved, the F1, precision and recall rates of the three types of recognition are improved. It is worth noting that the recall rate of abnormal data recognition has been greatly improved, which is very suitable for clearing noise.

[0137] Table 3 Experimental results before improvement

[0138]

[0139] Table 4 Experimental results after improvement

[0140]

[0141]

[0142] Figures 10a to 10cThe performance of the method provided in this application is observed from the perspective of ship types. For the navigation track point recognition of all types of ships, the F1 score has been improved, among which the tanker sacrificed a small part of the recall rate to improve the precision rate and thus improve the overall performance, and the precision and recall rates of the remaining ship types have been improved. The recall rate of fishing boats has been significantly improved, and the F1 score has been greatly improved. This is because the spatially chaotic trajectory data of fishing boats when they are stopped for fishing has been greatly improved after considering the time characteristics. In the identification of stop track points, the F1 scores of all ship types have been improved, and the precision rate and recall rate have been improved. Among them, the precision rate of the stop track points of tugboats and fishing boats has been greatly improved. Both tugboats and fishing boats stop irregularly, and can be better identified after the introduction of time features. For the recognition of abnormal track points, the overall recall rate is already quite high, so there is not much improvement, but the precision rate of tugboats, fishing boats, yachts, and passenger ships has been greatly improved, so the overall F1 score has been greatly improved. For cargo ships, due to their high sailing speed, after considering the time characteristics, the intervals between normal adjacent navigation points are large, which causes some abnormal points to be misjudged as normal navigation trajectories. This can be improved by adjusting the time weight of the cargo ships.

[0143] In summary, the AIS data ship trajectory extraction method based on the improved LOF-GMM algorithm provided in the embodiment of the present application is suitable for noise cleaning of large-scale AIS data and extraction of stop trajectories and navigation trajectories. According to the density distribution characteristics of ship navigation data, according to the spatiotemporal characteristics of the ship and the algorithm characteristics of the original LOF, the algorithm is improved, which perfectly solves the problem of misjudgment of the stop point due to the arc trajectory generated by the navigation direction of the return voyage and the abnormal distribution of abnormal factors caused by the overlap with the historical navigation trajectory during the return voyage, and solves the problem of no solution in the calculation of the LOF algorithm, so that LOF is suitable for multiple classification of ship trajectories. The algorithm can basically be applied to existing ship navigation scenarios. By comparing the clustering effects of various clustering algorithms, an improved LOF-GMM data classifier is proposed, which can simultaneously identify ship stop points and abnormal point data. Compared with the traditional separation processing method, it can detect stop data and abnormal data at one time, with high detection efficiency and no human intervention. This method can take into account the local and global distribution of trajectories, and can effectively detect the trajectory density generated by different ships.

[0144] In another embodiment of the present application, there is also provided an AIS data ship track extraction device based on an improved LOF-GMM algorithm, comprising:

[0145] The data acquisition and conversion module is used to acquire the original data of the ship's navigation, perform coordinate conversion on the original data, and determine the time weight according to the converted data.

[0146] The LOF detection module is used to perform local anomaly factor detection on the original data using an improved LOF algorithm according to the time weight to obtain the LOF value of each trajectory point.

[0147] The clustering module is used to cluster the LOF values ​​using the GMM algorithm to obtain the average value of each cluster type LOF, and determine the stay cluster, navigation cluster and abnormal cluster according to the average value.

[0148] It should be noted that the AIS data ship trajectory extraction device based on the improved LOF-GMM algorithm provided in this embodiment corresponds to the AIS data ship trajectory extraction method based on the improved LOF-GMM algorithm described above, which will not be repeated here.

[0149] Based on any of the above embodiments, another embodiment of the present invention further provides an electronic device, which may include: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor may call logic instructions in the memory to execute the above method.

[0150] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0151] On the other hand, an embodiment of the present invention further provides a storage medium on which a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to execute the AIS data ship trajectory extraction method based on the improved LOF-GMM algorithm as provided in the above embodiments.

[0152] On the other hand, the technical solution of the present invention, in essence or in other words, the part that contributes to the prior art, or the whole or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0153] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0154] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0155] In summary, although the present invention has been disclosed as above in terms of preferred embodiments, the above preferred embodiments are not intended to limit the present invention. A person skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be based on the scope defined in the claims.

Claims

1. A method for extracting ship tracks from AIS data based on an improved LOF-GMM algorithm, characterized in that: include: Acquire original data of ship navigation, perform coordinate transformation on the original data, and determine time weight according to the transformed data; According to the time weight, using an improved LOF algorithm to perform local anomaly factor detection on the original data to obtain the LOF value of each trajectory point; The LOF values ​​are clustered using the GMM algorithm to obtain the average value of the LOF of each cluster type, and the stay cluster, navigation cluster and abnormal cluster are determined based on the average value.

2. The method according to claim 1, characterized in that The method of performing local anomaly factor detection on the original data using an improved LOF algorithm according to the time weight to obtain the LOF value of each trajectory point includes: Calculate the spatiotemporal Euclidean distance between each trajectory point in the original data according to the time weight; The reachable distance is calculated based on the spatiotemporal Euclidean distance, and the LOF value is calculated based on the reachable distance and the spatiotemporal Euclidean distance.

3. The method according to claim 2, characterized in that The calculating the spatiotemporal Euclidean distance between each trajectory point in the original data according to the time weight comprises: According to the first spatiotemporal Euclidean distance calculation formula, the first spatiotemporal Euclidean distance between each trajectory point is calculated: Where P is the space-time coordinate set of the trajectory, d(P) is the first Euclidean distance matrix between the trajectory points, ω is the time weight, T i is the time corresponding to the current i-th trajectory point, n is the number of trajectory points, and Respectively represent the latitude and longitude of the i-th trajectory point; The obtaining of the reachable distance according to the spatiotemporal Euclidean distance calculation, and further obtaining of the LOF value according to the reachable distance and the spatiotemporal Euclidean distance calculation, comprises: Based on the first spatiotemporal Euclidean distance, the reachable distance of each trajectory point is calculated using the reachable distance calculation formula: d k (p i ,p j )=max{d k (p j ),d(p i ,p j )},(i≠j,N k (p i )≥k); Among them, d(p i ,p j ) represents the trajectory point p i To the trajectory point p j The distance, d k (p j ) represents point p j The kth distance from point p j The distance of the kth original trajectory point, N k (p i ) represents the trajectory point p i The kth distance neighborhood range, d k (p i ,p j ) represents point p j To point p i The k-th reachable distance of Based on the reachable distance, the LOF value is calculated using the local outlier factor formula: in, In the formula, ρ k (p i ) indicates p i All trajectory points in the kth distance neighborhood to p i The inverse of the average reachable distance, Represents point p i The local outlier factor.

4. The method according to claim 3, characterized in that The calculating the spatiotemporal Euclidean distance between each trajectory point in the original data according to the time weight comprises: According to the second space-time Euclidean distance calculation formula, the space-time Euclidean distance between each trajectory point is calculated: Where, d T (p i ,p j ) is the second space-time Euclidean distance between two points in the space-time coordinate system of the considered trajectory, p z Indicates time at T i and T j All points of Accordingly, the obtaining the reachable distance according to the spatiotemporal Euclidean distance calculation includes: Based on the second spatiotemporal Euclidean distance, the reachable distance of each trajectory point is calculated using the reachable distance calculation formula.

5. The method according to claim 1, characterized in that The method of clustering the LOF values ​​using the GMM algorithm to obtain the average value of the LOF of each cluster type includes: Initialization step, randomly initialize the parameters of Gaussian distribution; Step E, based on the initialization parameters, calculate the probability that each LOF value belongs to each Gaussian distribution; Step M, updating the parameters of the Gaussian distribution based on the probability so as to maximize the log-likelihood of the updated parameters; Iteration step: repeatedly executing the E step and the M step to reach the iteration end condition, and obtaining the final distribution model parameters for clustering the LOF data.

6. The method according to claim 5, characterized in that The step E comprises: According to the probability formula, the probability of each LOF value belonging to each Gaussian distribution is calculated based on the initialization parameters: Among them, N(x i |μ k ,∑ k ) represents the mean μ k and covariance is Σ k Gaussian model probability distribution function, γ(t,k) is the LOF value x of each trajectory point i The posterior probability of the Gaussian mixture model after the tth iteration is, is the weight of the kth Gaussian model in the Gaussian mixture model after the t-1th iteration; The M steps include: According to the maximum likelihood function, the parameters of the Gaussian distribution are updated based on the probability, and the estimated value is calculated:

7. The method according to claim 1, characterized in that The coordinate conversion of the original data comprises: The latitude and longitude coordinates of each track point in the original data are converted into earth plane coordinates using the Mercator projection formula to obtain converted data; Among them, the Mercator projection formula is: Where, L at and L on They represent the latitude and longitude of the trajectory point, respectively. x and y represent the coordinate axes of the coordinate system of the earth plane map. r0 is the radius of the circle parallel to the standard latitude. L at0 represents the standard latitude in the Mercator projection, a represents the equatorial radius of the earth ellipse, and e l is the first eccentricity of the Earth's ellipse.

8. An AIS data ship trajectory extraction device based on an improved LOF-GMM algorithm, characterized in that: include: A data acquisition and conversion module is used to acquire the original data of the ship's navigation, perform coordinate conversion on the original data, and determine the time weight according to the converted data; A LOF detection module, configured to perform local anomaly factor detection on the raw data using an improved LOF algorithm according to the time weight, so as to obtain a LOF value of each trajectory point; The clustering module is used to cluster the LOF values ​​using the GMM algorithm to obtain the average value of each cluster type LOF, and determine the stay cluster, navigation cluster and abnormal cluster according to the average value.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor runs the computer program to implement the method according to any one of claims 1 to 7.

10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.