A ship abnormal behavior detection method and system based on traffic behavior patterns

By combining a weighted multidimensional dynamic time bending distance and an improved K-Fermat algorithm that simulates plant growth with an adaptive local outlier factor algorithm, the problems of unquantized feature coupling and parameter dependence in ship abnormal behavior detection are solved, achieving efficient and accurate ship abnormal behavior detection that is adaptable to complex maritime traffic environments.

CN121527722BActive Publication Date: 2026-06-26SHANDONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANDONG UNIV OF SCI & TECH
Filing Date
2025-11-21
Publication Date
2026-06-26

Smart Images

  • Figure CN121527722B_ABST
    Figure CN121527722B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of intelligent transportation and data mining, and discloses a ship abnormal behavior detection method and system based on a traffic behavior mode. k-dist The curve graph and the least square fitting are adaptively determined to determine the optimal value of the LOF algorithm. k The optimal threshold value is determined by combining the artificial modification of the abnormal trajectory traversal value, so that the ship abnormal behavior detection is realized. lof The application improves the processing capability of the ship trajectory data, enhances the accuracy of the behavior mode recognition, and improves the robustness of the abnormal behavior detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent transportation and data mining technology, and in particular relates to a method and system for detecting abnormal ship behavior based on traffic behavior patterns. Background Technology

[0002] With the rapid development of the global economy, maritime transport, due to its efficiency and low cost, has gradually become an important mode of transportation in transnational trade. However, the rapid development of the shipping industry and the significant increase in maritime traffic have led to frequent maritime accidents. These accidents not only cause huge economic losses to shipping companies but also seriously threaten the lives of crew members.

[0003] Traditional management methods struggle to cope with complex environments, making ship anomaly detection algorithms based on traffic behavior patterns a crucial means of ensuring safety. These algorithms identify patterns in ship traffic behavior and detect anomalies based on the characteristics of different identified navigation patterns. However, existing technologies suffer from several problems. For example, traditional multidimensional dynamic time curvature distance calculations do not consider the coupling effects of different trajectory features; the K-Fermat algorithm for pattern recognition is computationally complex and has weak global search capabilities, making it prone to getting trapped in local optima; the Local Outlier Factor (LOF) anomaly detection algorithm lacks robustness; and it relies heavily on traditional experience.

[0004] Existing technologies fail to fully consider the coupling effect of spatial and kinematic characteristics of navigational vessel traffic behavior. Furthermore, the K-Fermat identification algorithm faces significant challenges in finding Fermat points, and the simulated plant growth algorithm, when used to assist in Fermat point search, is prone to local convergence and cannot simultaneously balance search capability and efficiency. For identified vessel traffic behavior patterns, the traditional LOF algorithm calculates… The parameters for each mode need to be set manually during the scoring process. The value has poor robustness and the accuracy of the detection results is affected by... The value has a significant impact. Setting the value too low makes it overly sensitive to noise. Setting the value too high makes it difficult to capture local anomalies.

[0005] Based on the above analysis, the problems and shortcomings of the existing technology are as follows:

[0006] (1) The traditional multidimensional dynamic time bending distance calculation does not take into account the coupling effect of different trajectory features. The K-Fermat algorithm pattern recognition algorithm is computationally complex and has weak global search ability, making it easy to get trapped in local optima. The Local Outlier Factor (LOF) abnormal behavior detection algorithm is not robust enough and relies on traditional experience.

[0007] (2) Existing technologies fail to fully consider the coupling effect of spatial and kinematic characteristics of navigation vessel traffic behavior. At the same time, the K-Fermat identification algorithm is difficult to solve for Fermat points, and the simulated plant growth algorithm is prone to local convergence when searching for Fermat points and cannot simultaneously take into account search ability and search efficiency.

[0008] (3) For the identified ship traffic behavior patterns, the traditional LOF algorithm calculates The parameters for each mode need to be set manually during the scoring process. k The value has poor robustness and the accuracy of the detection results is affected by... The value has a significant impact. Setting the value too low makes it overly sensitive to noise. Setting the value too high makes it difficult to capture local anomalies. Summary of the Invention

[0009] To overcome the problems existing in related technologies, the present invention discloses an embodiment of a method and system for detecting abnormal ship behavior based on traffic behavior patterns, the technical solution of which is as follows:

[0010] This invention is implemented as follows: a method for detecting abnormal ship behavior based on traffic behavior patterns, comprising the following steps:

[0011] S1. Data Preprocessing: Based on the AIS data compression algorithm for ship navigation behavior, the DP algorithm is first used to compress the spatial features of AIS data, including ship longitude and ship latitude. Then, the sliding window algorithm is used to compress the motion features of the navigation ship trajectory, including speed and heading. The compression threshold of the sliding window is determined by Gaussian distribution and parametric trajectory. Finally, the compressed spatial features and motion features are fused to generate a compressed trajectory, which retains the spatial and motion features of the navigation ship trajectory.

[0012] S2. Ship trajectory coupling metric: Based on compressed ship AIS data, the weighted multidimensional dynamic time bending distance similarity metric method is used to calculate the similarity between ship trajectories. The coupling effect between the spatial and kinematic features of the trajectories of navigable ships is quantified through weighted processing.

[0013] S3. Ship traffic behavior pattern recognition: Based on the improved K-Fermat ship traffic behavior recognition algorithm that simulates plant growth, ship traffic behavior patterns are identified through node update operators based on neighborhood solutions, node update operators based on spatially symmetric positions, and corresponding node update strategies.

[0014] S4. Ship Anomaly Behavior Detection: Based on the identified ship traffic behavior patterns, anomaly behavior detection is performed using an adaptive local outlier factor-based algorithm. This involves... Curve adaptive determination of optimal parameters for the LOF algorithm Values, and calculate the local outlier factor of the ship trajectory. Anomaly scoring thresholds are used to identify abnormal ship trajectories and detect abnormal ship behavior.

[0015] In step S2, the expression for the weighted multidimensional dynamic time bending distance similarity metric is as follows:

[0016] ;

[0017] In the formula, For ship trajectory The Middle Points and ship trajectory The Middle The weighted Euclidean distance between points For the first Dimensional weights For ship trajectory The Middle The first point Dimensional value, For ship trajectory The Middle The first point Dimensional value;

[0018] ;

[0019] In the formula, For ship trajectory With ship trajectory Multidimensional dynamic time bending distance. For ship trajectory With ship trajectory The weighted Euclidean distance, To obtain the minimum value, For ship trajectory The number of trajectory points, For ship trajectory The number of trajectory points, Ship tracks Take before points and Take before Multidimensional dynamic time curvature distance at each point, ship trajectory Take before points and Take before Multidimensional dynamic time curvature distance at each point, ship trajectory Take before points and Take before Multidimensional dynamic time curvature distance at each point;

[0020] By weighting the spatial and kinematic similarities between the trajectories of navigating vessels, the coupling effect between spatial and kinematic features in vessel traffic behavior is quantified.

[0021] In step S3, the K-Fermat ship traffic behavior recognition algorithm based on the improved simulation of plant growth includes:

[0022] The Fermat point with the smallest sum of distances to ship trajectory samples in the ship traffic behavior pattern is taken as the plant growth node, and the optimal number of patterns determined by the contour coefficient method is set as the number of plant growth nodes; the initial plant growth node position is determined by the random uniform method as the pattern center.

[0023] In step S3, the node update operator based on the neighborhood solution includes:

[0024] Update operator 1: Incorporate neighborhood solutions in the solution space into the plant growth node information interaction system, and generate new nodes by comparing the current best node with the global worst node. The expression is:

[0025] ;

[0026] In the formula, To update the step size, A random number within the interval (0, 1). The optimal node in the current iteration. As the worst node globally, To update the new node generated by operator one, Impact factor;

[0027] Update operator 2: Generates a new node by comparing the globally optimal node with the globally worst node. The expression is:

[0028] ;

[0029] In the formula, It is the globally optimal node. To update the new node generated by operator two.

[0030] Update operator 3: From the perspective of the solution space, the spatially symmetric position of the globally optimal node about the origin is selected as the jump direction for generating new nodes. The expression is:

[0031] ;

[0032] In the formula, To update the new nodes generated by operator 3;

[0033] Impact Factor It adjusts dynamically with the number of iterations, and the expression is:

[0034] ;

[0035] In the formula, It is the arctangent function. This represents the number of iterations.

[0036] Furthermore, the expression for the node update strategy is:

[0037] ;

[0038] ;

[0039] In the formula, For the fitness function, For the new node, This represents the total number of ship trajectory samples in the model. For the trajectories of the remaining ships in the model, The multidimensional dynamic time curvature distance between the trajectory of the new node and the trajectories of other ships; For the first One ship trajectory sample, The number of trajectory points for the new node's ship trajectory. For the first The number of trajectory points for each ship's trajectory;

[0040] After the algorithm iteratively generates new nodes, it calculates the fitness of each node; when The fitness is greater than When determining the fitness of the algorithm, the newly generated node by the node update operator replaces the globally worst node to fully explore local neighborhood information and accelerate the convergence speed of the algorithm in the local region; when The fitness is less than fitness and The fitness is greater than When assessing fitness, the new node generated by update operator 2 is used to replace the globally worst node to expand the search range, prevent the algorithm from converging too early to a local inferior node, and increase the probability of finding the globally optimal node. When neither of the above two conditions is met, the new node generated by update operator 3 is used to replace the globally worst node to open up a completely new search direction, escape local optima, and improve the diversity of algorithm results.

[0041] In step S4, through Curve adaptive determination of optimal parameters for the LOF algorithm Values, including:

[0042] The ship trajectories of each ship traffic behavior pattern identified by the ship traffic behavior coupling algorithm based on navigation behavior were taken as training sets and input into the ALOF detection model to calculate the weighted multidimensional dynamic time curvature distance matrix.

[0043] ;

[0044] In the formula, For a weighted multidimensional dynamic time-bending distance matrix, For the central trajectory of the data With trajectory distance, The number of ship trajectories in the dataset;

[0045] The weighted multidimensional dynamic time-bending distance matrix The elements in the matrix are sorted in ascending order by row. After sorting, the first column of the matrix contains all 0 elements, which is the distance from each trajectory to itself.

[0046] The sorted matrix The elements in the column are sorted in ascending order as The ordinate of each point on the curve, the amount of data As k-dist The x-coordinate of each point on the curve, Each point on the curve is the first point in the dataset. The trajectory and the most recent one The distance between the nearest trajectories is used to generate... Curve, Parameter Different values ​​will generate different Curves, all Curve composition Line graph;

[0047] right The picture The curve was fitted using the least squares polynomial fitting method.

[0048] ;

[0049] In the formula, For the sum of squared errors, For the first The actual observed values ​​of each data point The curve expression is obtained by least-squares polynomial fitting, and ;

[0050] By minimizing the sum of squared errors, a function that best matches the original data distribution was found. After repeated experiments and cross-validation, setting the fitting order to 15 yielded the best curve fitting results. The curve was fitted using a least-squares polynomial as shown in the following equation:

[0051] ;

[0052] In the formula, The coefficients of the terms in the polynomial;

[0053] Calculate the fitted The point of maximum curvature within the abrupt change region after a smooth curve's steady ascent, i.e., the inflection point, is expressed as:

[0054] ;

[0055] In the formula, To fit the curvature of the curve, The second derivative of the fitted curve. The first derivative of the fitted curve;

[0056] Each The values ​​are sorted by size and set as the x-axis; the corresponding inflection points are the y-axis, generating a new curve. The inflection points of the new curve are then calculated, and the x-axis corresponding to the inflection point values ​​is... The value is the optimal parameter, where, .

[0057] In step S4, to identify abnormal ship trajectories and detect abnormal ship behavior, the following steps are included:

[0058] Will Curve graphs yield the optimal parameters for various models. Substitution The formula for calculating the value is as follows:

[0059] ;

[0060] ;

[0061] ;

[0062] In the formula, For ship trajectory Based on ship trajectory distance, To obtain the maximum value, For ship trajectory of k -distance, For ship trajectory With ship trajectory The actual distance For trajectory of k - Trajectory within the neighborhood, for of k - Distance neighborhood, including and The distance is no greater than k - Distance for each trajectory, For ship trajectory of k -Local density of ship tracks within the neighborhood for All ship tracks To ship track Sum of distances, For ship trajectory of score, For ship trajectory Local density, For ship trajectory The local density.

[0063] In step S4, the local outlier factor value of the ship trajectory is calculated. and abnormal scoring thresholds, including:

[0064] Abnormal trajectory sample construction: 5% of normal ship trajectory samples were selected from the training set corresponding to each of the various modes using stratified sampling. Abnormal trajectory samples for the corresponding modes were then constructed through manual modification.

[0065] Value calculation: Calculating the optimal parameters determined by various models. Substitute the values ​​into the training set containing anomalous samples after the model modification, and calculate the ship trajectories in each model. Values ​​are used to quantify the degree of anomaly in the trajectory;

[0066] Candidate threshold generation: To select the optimal anomaly scoring threshold, statistical analysis of trajectories in the training set for various patterns is performed. The value distribution range is traversed with a step size of 0.1. The distribution range of values ​​is used to generate alternative thresholds for various patterns;

[0067] Threshold performance evaluation: The F1 score demonstrates significant adaptability and objectivity in detecting abnormal ship behavior. Through the harmonic averaging of precision and recall, it can dynamically adapt to different ship traffic patterns with varying densities, and automatically adjusts during pattern switching. The F1 score, calculated based on statistical data, yields unique and reproducible results, avoiding subjective bias and automatically finding the optimal threshold for various patterns, effectively improving overall detection accuracy. For each pattern, one candidate threshold is selected as the criterion for anomaly detection in each round, and anomaly detection is performed on ship trajectories in the training set for that pattern. If the trajectory... If the value is greater than the candidate threshold, it is determined to be an abnormal trajectory; otherwise, it is determined to be a normal trajectory. The F1 score corresponding to the candidate threshold in this mode is calculated based on the detection results.

[0068] Determining the optimal threshold: The candidate thresholds that maximize the F1 score for each mode are determined as the optimal anomaly scoring thresholds for the corresponding modes.

[0069] Another object of the present invention is to provide a traffic behavior pattern-based ship abnormal behavior detection system for implementing the aforementioned traffic behavior pattern-based ship abnormal behavior detection method, the system comprising:

[0070] The data preprocessing module uses an AIS data compression algorithm based on ship navigation behavior. First, the DP algorithm is used to compress the spatial features of AIS data, including ship longitude and latitude. Second, the sliding window algorithm is used to compress the motion features of the navigation ship trajectory, including speed and heading. The compression threshold of the sliding window is determined by Gaussian distribution and parametric trajectory. Finally, the compressed spatial features and motion features are fused to generate a compressed trajectory, preserving the spatial and motion features of the navigation ship trajectory.

[0071] The ship trajectory coupling measurement module, based on compressed ship AIS data, uses a weighted multidimensional dynamic time bending distance similarity measurement method to calculate the similarity between ship trajectories. It quantifies the coupling effect between the spatial and kinematic features of the trajectories of navigable ships through weighted processing.

[0072] The ship traffic behavior pattern recognition module is based on the improved K-Fermat ship traffic behavior recognition algorithm that simulates plant growth. It identifies ship traffic behavior patterns through node update operators based on neighborhood solutions, node update operators based on spatially symmetric positions, and corresponding node update strategies.

[0073] The ship abnormal behavior detection module detects abnormal behavior based on identified ship traffic behavior patterns and an algorithm that uses an adaptive local outlier factor. Curve adaptive determination of the optimal parameters for the LOF algorithm Values, and calculate the local outlier factor of the ship trajectory. Anomaly scoring thresholds are used to identify abnormal ship trajectories and detect abnormal ship behavior.

[0074] Combining all the above technical solutions, the beneficial effects of this invention are as follows:

[0075] First, addressing the shortcomings of existing ship traffic behavior pattern recognition algorithms in considering the coupling effect of spatial and kinematic features of navigating vessels on ship traffic behavior, and the difficulty in quickly and accurately determining Fermat points in the K-Fermat recognition algorithm, this invention first designs a ship traffic behavior pattern recognition algorithm based on the coupling effect of navigating behavior. This algorithm comprehensively considers the coupling effect of trajectory spatial features and kinematic features in ship traffic behavior pattern recognition by designing a weighted multidimensional dynamic time curvature distance similarity metric. Based on this, an improved K-Fermat ship traffic behavior pattern recognition algorithm based on simulated plant growth is designed. This algorithm improves the global search capability of the algorithm by designing update operators based on neighborhood solutions, update operators based on spatially symmetric positions, and update strategies, avoiding getting trapped in local convergence and thus quickly and accurately completing pattern recognition. This invention utilizes the ship traffic behavior pattern recognition algorithm based on the coupling effect of navigating behavior to divide ship traffic behavior into different modes. Regarding the navigation behavior characteristics of different modes, given that the LOF algorithm cannot adaptively determine the parameters of each mode... The value, which relies on empirical settings, leads to poor robustness and low accuracy of detection results. Therefore, the design... Curve graphs adaptively determine the optimal parameters for various modes. The algorithm generates a weighted multidimensional dynamic time curvature distance matrix between objects of different patterns. The curve is fitted using a least-squares polynomial, and the maximum inflection point of the fitted curve is calculated to determine the optimal parameters. The value is used to calculate the trajectory of each ship in the model using this optimal parameter. By using values ​​and anomaly scoring thresholds, abnormal ship trajectories can be identified, effectively detecting abnormal ship behavior.

[0076] Secondly, this invention provides a method for detecting abnormal ship behavior based on traffic behavior patterns. First, it designs a ship traffic behavior pattern recognition algorithm based on the coupling effect of navigation behavior. By fully considering the coupling effect of the spatial and motion characteristics of navigating ships, it achieves accurate identification of ship traffic behavior patterns. Then, it proposes a K-Fermat ship traffic behavior pattern recognition algorithm based on improved simulation of plant growth. By designing update operators and update strategies, it effectively improves the algorithm's recognition performance. Based on the identified ship traffic behavior patterns, this invention combines the navigation behavior characteristics of various patterns and designs an abnormal ship behavior detection algorithm based on adaptive local outlier factors. This algorithm can adaptively determine the optimal parameters, eliminating reliance on human experience. This invention comprehensively improves the processing capability of navigating ship trajectory data, enhances the accuracy of behavior pattern recognition, and improves the robustness of abnormal behavior detection. It can better adapt to the actual maritime traffic environment and the needs of large-scale data processing, and has significant practical value and application prospects. Experiments have verified the accuracy and robustness of the algorithm.

[0077] Third, this invention achieves a dual path of cost reduction and efficiency improvement, as well as commercial monetization. It reduces operating costs for shipping companies: through optimization of the entire process of coupling interaction, pattern recognition, and anomaly detection, this invention can accurately identify abnormal behaviors such as deviation from the course, excessive speed, and illegal berthing, reducing accidents such as ship collisions and groundings. This invention can improve the accuracy rate of abnormal behavior early warning to 93%. The technology can be transformed into a ship abnormal behavior detection system product, providing tiered services to maritime management departments, port operators, and ship navigation service companies.

[0078] Fourth, this invention breaks through the traditional passive mode of manual monitoring of AIS trajectories and post-event accountability, transforming it into proactive supervision through intelligent prediction and real-time intervention. This solution achieves this through adaptive parameter adjustment ( Curve determines LOF This invention, with its unique characteristics, can adapt to different vessel traffic densities in ports, nearshore areas, and offshore areas, meeting the maritime authorities' needs for comprehensive and precise supervision. Its trajectory pattern recognition and anomaly detection capabilities can be extended horizontally to scenarios such as fishing vessel supervision (identifying illegal fishing across borders), dangerous goods vessel monitoring (early warnings of illegal changes in direction), and maritime search and rescue (rapidly locating abnormal or missing vessels). For example, in the field of fishing vessel supervision, by identifying the differences in patterns between normal fishing trajectories and those crossing borders, it can assist fisheries authorities in combating illegal fishing.

[0079] Fifth, this invention improves industry compliance and reduces the risk of personal injury, ensuring life safety: Maritime accidents seriously threaten the lives of crew members. Existing technologies, both domestically and internationally, generally treat spatial and kinematic features equally or calculate individual features independently when measuring ship trajectory similarity, without considering the coupling effect of these two types of features on ship traffic behavior. The weighted multidimensional dynamic time-bending distance designed in this invention provides, for the first time, a quantitative measurement of the coupling effect between spatial and kinematic features of ship trajectories, solving the pattern recognition bias caused by neglecting the coupling relationship in existing technologies.

[0080] Sixth, currently, there is no K-Fermat algorithm for ship trajectory pattern recognition, either domestically or internationally. Solving for Fermat points relies on full spatial traversal or traditional simulated plant growth algorithms, which suffer from computational complexity and susceptibility to local optima. While domestic technologies have attempted to improve the search mechanism, they only enhance efficiency through single-node update strategies, failing to balance global search capability and convergence speed. This invention proposes a K-Fermat algorithm based on improved simulated plant growth, innovatively designing a neighborhood solution update operator + a spatially symmetric update operator and a dynamic node update strategy. This accelerates convergence by mining local information through neighborhood solution interaction and expands the global search range through spatially symmetric jumps, achieving for the first time a synergistic optimization of the K-Fermat algorithm's search capability and convergence efficiency. This fills a technological gap in the field of dual-objective optimization of K-Fermat algorithms both domestically and internationally. Existing local outlier factor algorithms for ship anomaly detection both domestically and internationally rely on manually set parameters and anomaly thresholds, failing to adapt to ship behavior patterns with varying densities, such as densely packed ports or sparsely populated open seas. This invention designs an adaptive local outlier factor detection algorithm that, through… Curve graphs adaptively determine the optimal model for each type of pattern The optimal anomaly threshold is generated by combining the F1 score with the value, and for the first time, the local outlier factor algorithm parameters and threshold are dynamically adapted to the ship behavior pattern.

[0081] Seventh, prior to this invention, domestic and international ship behavior pattern recognition technologies had long faced the dilemma of processing spatial and motion features separately, requiring equal weighting or independent calculation of the two types of features. This led to ships in densely populated waters with different motion states in the same spatial region being misclassified as the same pattern, and ships in sparsely populated waters with the same motion state but different spatial regions being confused. Pattern recognition accuracy remained below 85% for a long time, becoming a key bottleneck restricting intelligent maritime supervision. This invention, by designing a weighted multidimensional dynamic time curvature distance, quantifies the coupling effect using feature weights for the first time, successfully breaking through the technical barrier of the inability to quantify feature coupling and solving this long-standing problem.

[0082] Eighth, this invention solves the long-standing problem of the K-Fermat algorithm's inability to simultaneously achieve global search capability and convergence efficiency, resulting in time-consuming and low-accurate pattern recognition. The K-Fermat algorithm, due to its ability to accurately classify ship trajectory patterns using Fermat points, is considered an ideal pattern recognition tool in the industry. However, it has long faced the dual challenges of complex full-space traversal computation and the susceptibility of auxiliary search algorithms to local optima. Foreign technologies rely on traditional simulated plant growth algorithms for auxiliary search, which can only be optimized through single-node update strategies. This either leads to a lack of globally optimal solutions due to an emphasis on local search, or slow convergence speed due to blindly expanding the search range. While domestic improvement schemes have attempted optimization, they have consistently failed to balance search capability and convergence efficiency, failing to meet the actual needs of accurate maritime traffic classification and becoming a core obstacle to the practical application of the K-Fermat algorithm. This invention innovatively designs a neighborhood solution update operator and a spatially symmetric update operator, along with a dynamic adaptation strategy: the neighborhood solution operator mines local information to accelerate convergence, while the spatially symmetric operator expands the global search range to avoid local optima. This achieves synergistic optimization of both for the first time, completely solving the problem of the K-Fermat algorithm's inability to simultaneously achieve accuracy and efficiency.

[0083] Ninth, this invention solves the long-standing problem of poor robustness in anomaly detection caused by the reliance on manually set parameters and thresholds in the Local Outlier Factor (LOF) algorithm. The LEF algorithm is a mainstream tool for ship anomaly detection, but the industry has long been hampered by parameter limitations. The problem of inconsistent values ​​and outlier thresholds: Due to significant differences in density characteristics among different ship behavior patterns, manually set fixed values ​​are not adaptive. The values ​​are either overly sensitive to noise or miss local anomalies, and the anomaly threshold also suffers from large fluctuations in detection accuracy due to the lack of quantitative standards. Although the industry has attempted to optimize through grid search and cross-validation, it has consistently failed to achieve dynamic adaptation of parameters and patterns, resulting in poor robustness of the local outlier factor algorithm in real-world maritime scenarios and an inability to reliably perform anomaly detection. This invention addresses this issue by... The curve adaptively determines the optimal parameters, and the optimal threshold is generated by combining the F1 score. This results in an ACC value of 0.93 and an F1 score of 0.75 for the adaptive local outlier factor algorithm, which is a significant improvement over the traditional fixed-parameter local outlier factor algorithm with an ACC value of 0.82 and an F1 score of 0.48. This successfully solves the long-standing problem that parameters and thresholds cannot be adaptive, and makes the local outlier factor algorithm truly adaptable to complex and ever-changing maritime traffic scenarios. Attached Figure Description

[0084] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure;

[0085] Figure 1 This is a flowchart of the ship abnormal behavior detection method provided in the embodiments of the present invention;

[0086] Figure 2 This is a flowchart of the K-Fermat ship traffic behavior pattern recognition algorithm based on improved simulated plant growth provided in this embodiment of the invention;

[0087] Figure 3 This is a framework diagram of the ship traffic behavior pattern recognition algorithm based on navigation behavior coupling provided in the embodiments of the present invention;

[0088] Figure 4 These are spatial feature distribution maps of the patterns provided in the embodiments of the present invention; wherein, (a) is the spatial feature distribution map of combination 1, (b) is the spatial feature distribution map of combination 2, (c) is the spatial feature distribution map of combination 3, and (d) is the spatial feature distribution map of combination 4.

[0089] Figure 5 These are SOG and COG cloud and rain images provided in this embodiment of the invention; wherein, (a) is SOG cloud and rain image of combination 1, (b) is SOG cloud and rain image of combination 2, (c) is SOG cloud and rain image of combination 3, (d) is SOG cloud and rain image of combination 4, (e) is SOG cloud and rain image of combination 5, (f) is SOG cloud and rain image of combination 6, (g) is SOG cloud and rain image of combination 7, and (h) is SOG cloud and rain image of combination 8.

[0090] Figure 6 This is a comparison chart of convergence speeds provided in an embodiment of the present invention;

[0091] Figure 7 These are the k-dist curves and fitted curves of Mode 1 provided in the embodiments of the present invention; wherein, (a) is the k-dist curve of Mode 1, and (b) is the fitted k-dist curve of Mode 1.

[0092] Figure 8 The above are experimental set abnormal ship trajectory diagrams provided in the embodiments of the present invention; wherein, (a) is the abnormal ship trajectory diagram of mode 1, (b) is the abnormal ship trajectory diagram of mode 2, (c) is the abnormal ship trajectory diagram of mode 6, (d) is the abnormal ship trajectory diagram of mode 8, and (e) is the abnormal ship trajectory diagram of mode 9. Detailed Implementation

[0093] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a thorough understanding of the present invention. However, the present invention can be practiced in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0094] The innovation of this invention lies in:

[0095] 1. This paper proposes a ship traffic behavior pattern recognition algorithm based on the coupling effect of navigation behavior. Firstly, the algorithm fully considers the coupling effect of spatial and kinematic features of navigation vessels in ship traffic behavior pattern recognition. A weighted multidimensional dynamic time-bending distance similarity measurement method is designed to comprehensively consider the coupling influence of the spatial and kinematic features of navigation vessels on traffic behavior patterns, thereby scientifically measuring the similarity between trajectories. Secondly, an improved K-Fermat ship traffic behavior pattern recognition algorithm based on simulated plant growth is proposed. Addressing the problems of high computational complexity of the K-Fermat pattern recognition algorithm, low optimization efficiency with large-scale datasets, and the tendency of the heuristic simulated plant growth algorithm to get trapped in local convergence leading to low recognition accuracy, an improved simulated plant growth algorithm is proposed to improve the efficiency and accuracy of pattern recognition. The improved algorithm of this invention enhances the information interaction and global search capabilities during optimization by designing update operators based on neighborhood solutions and spatially symmetric positions, as well as multiple update strategies, thereby accelerating the algorithm's convergence speed, achieving efficient optimization, and effectively improving the accuracy of ship traffic behavior pattern recognition.

[0096] 2. Design an algorithm for detecting abnormal ship behavior based on an adaptive local outlier factor. Building upon the ship traffic behavior pattern recognition algorithm based on the coupling effect of navigation behavior, which identifies various ship traffic behavior patterns, the traditional local outlier factor algorithm calculates... Anomaly scoring requires manual setting of parameters for each mode. k Value, if Setting the value too low makes it overly sensitive to noise. Setting the value too high makes it difficult to capture local anomalies, resulting in poor robustness and low detection accuracy. In view of the above problems, this invention designs a ship anomaly behavior detection algorithm based on an adaptive local outlier factor, utilizing historical AIS datasets of ships from various identified patterns and... The curve graph adaptively selects the optimal parameters for each mode. Values, and based on optimal parameters Value calculation of trajectories in various modes The optimal threshold for detecting abnormal behavior patterns is determined by using a discrete method, thereby effectively improving the robustness and accuracy of abnormal behavior detection.

[0097] Example 1, as Figure 1As shown in the embodiment of the present invention, the method for detecting abnormal ship behavior based on traffic behavior patterns first designs a ship traffic behavior pattern recognition algorithm based on the coupling effect of navigation behavior to identify the traffic behavior patterns of ships affected by the coupling effect of navigation behavior; based on the ship navigation behavior features in the identified patterns, a ship abnormal behavior detection algorithm based on adaptive local anomaly factors is designed to detect abnormal ship behavior, specifically including the following steps:

[0098] S1, Data Preprocessing: Based on the AIS data compression algorithm for ship navigation behavior, the DP algorithm is first used to compress the spatial features of AIS data, including ship longitude and ship latitude. Then, the sliding window algorithm is used to compress the motion features of the navigation ship trajectory, including speed and heading. The compression threshold of the sliding window is determined by Gaussian distribution and parametric trajectory. Finally, the compressed spatial features and motion features are fused to generate a compressed trajectory, which retains the spatial and motion features of the navigation ship trajectory.

[0099] In order to fully consider the coupling effect between navigation spatial features and motion features in ship traffic behavior pattern recognition, a weighted multidimensional dynamic time bending distance similarity metric was designed as shown in Equations (1) and (2). By weighting the similarity between spatial features and motion features between navigation ship trajectories, the degree of coupling effect between spatial features and motion features in ship traffic behavior is quantified.

[0100] (1)

[0101] (2)

[0102] In the formula, For ship trajectory The Middle Points and ship trajectory The Middle The weighted Euclidean distance between points For the first Dimensional weights For ship trajectory The Middle The first point Dimensional value, For ship trajectory The Middle The first point Dimensional value; For ship trajectory With ship trajectory Multidimensional dynamic time bending distance. For ship trajectory With ship trajectory The weighted Euclidean distance, To obtain the minimum value, For ship trajectory The number of trajectory points, For ship trajectory The number of trajectory points, Ship tracks Take before points and Take before Multidimensional dynamic time curvature distance at each point, ship trajectory Take before points and Take before Multidimensional dynamic time curvature distance at each point, ship trajectory Take before points and Take before Multidimensional dynamic time curvature distance at each point;

[0103] By weighting the spatial and kinematic similarities between the trajectories of navigating vessels, the coupling effect between spatial and kinematic features in vessel traffic behavior is quantified.

[0104] S2, Ship trajectory coupling metric: Based on compressed ship AIS data, the weighted multidimensional dynamic time bending distance similarity metric method is used to calculate the similarity between ship trajectories. The coupling effect between the spatial and kinematic features of the trajectories of navigable ships is quantified through weighted processing.

[0105] The K-Fermat algorithm requires traversing the entire solution space to find Fermat points. This full-space search method is not only computationally intensive but also prone to getting stuck in invalid search paths in the multi-dimensional solution space, leading to search difficulties. Therefore, Li Tong et al. used a simulated plant growth algorithm to assist the K-Fermat algorithm in searching for Fermat points. However, while this algorithm can improve search efficiency to some extent, it is prone to getting stuck in local optima during the search process, seriously affecting the accuracy of ship traffic behavior pattern recognition. Therefore, the proposed K-Fermat ship traffic behavior recognition algorithm based on improved simulated plant growth is designed by using node update operators based on neighborhood solutions (update operator one, update operator two) and node update operators based on spatially symmetric positions (update operator three), along with corresponding node update strategies. This enhances information interaction between nodes, expands the search range, improves the algorithm's local and global search capabilities and convergence speed, quickly approaches the optimal solution, and avoids getting stuck in local optima. The specific implementation steps of the algorithm are as follows:

[0106] (1) Algorithm initialization: The point with the smallest sum of distances to the ship trajectory samples in the pattern (Fermat point) is taken as the plant growth node; the optimal number of patterns determined by the contour coefficient method is set as the number of plant growth nodes; the initial plant growth node position is determined by the random uniform method as the pattern center.

[0107] (2) Node update operator:

[0108] 1) Update operator one: In order to expand the sources of information acquisition for plant growth nodes and improve the sufficiency of information interaction within the solution space, the neighborhood solutions in the solution space are incorporated into the information interaction system of plant growth nodes to achieve in-depth mining of internal information. New nodes are generated by the current best node and the global worst node as shown in equation (3).

[0109] (3)

[0110] In the formula, To update the step size, A random number within the interval (0, 1). The optimal node in the current iteration. As the worst node globally, To update the new node generated by operator one, Impact factor;

[0111] 2) Update operator two: In order to systematically explore the neighborhood space during the search process, expand the search range, and effectively avoid the algorithm from getting stuck in local optima, new nodes are generated by the global optimal node and the global worst node as shown in equation (4).

[0112] (4)

[0113] In the formula, It is the globally optimal node. To update the new node generated by operator two.

[0114] 3) Update operator three: The jumps of plant growth nodes in the solution space should have a certain direction and purpose to help the algorithm jump out of the local optimum. Therefore, from the perspective of the solution space, choosing the spatially symmetrical position of the global optimum node about the origin as the jump direction for generating new nodes helps to jump out of the local optimum as soon as possible, as shown in equation (5):

[0115] (5)

[0116] In the formula, To update the new nodes generated by operator 3;

[0117] In addition, to ensure that the algorithm maintains strong search capabilities, the influence factor... The dynamic adjustment is shown in equation (6) as the number of iterations changes.

[0118] (6)

[0119] In the formula, It is the arctangent function. This represents the number of iterations.

[0120] (3) Node update strategy: Considering the convergence speed and search capability of the three update operators, the corresponding node update strategies are designed as shown in equations (7) and (8), where in equation (7), For the fitness function, For the new node; This represents the total number of ship trajectory samples in the model. For the trajectories of the remaining ships in the model, The multidimensional dynamic time curvature distance between the trajectory of the new node and the trajectories of other ships is used. After the algorithm iteratively generates new nodes, the fitness of each node is calculated. The fitness is greater than When assessing fitness, the newly generated node by update operator 1 replaces the globally worst node to fully exploit local neighborhood information and accelerate the algorithm's convergence speed in local regions; when The fitness is less than fitness and The fitness is greater than When assessing fitness, the new node generated by update operator 2 is used to replace the globally worst node to expand the search range, prevent the algorithm from converging too early to a local inferior node, and increase the probability of finding the globally optimal node. When neither of the above two conditions is met, the new node generated by update operator 3 is used to replace the globally worst node to open up a completely new search direction, escape local optima, and improve the diversity of algorithm results.

[0121] (7)

[0122] (8)

[0123] In the formula, For the fitness function, For the new node, This represents the total number of ship trajectory samples in the model. For the trajectories of the remaining ships in the model, The multidimensional dynamic time curvature distance between the trajectory of the new node and the trajectories of other ships; For the first One ship trajectory sample, The number of trajectory points for the new node's ship trajectory. For the first The number of trajectory points for each ship's trajectory;

[0124] The implementation process of the K-Fermat ship traffic behavior pattern recognition algorithm based on improved plant growth simulation is as follows: Figure 2 As shown.

[0125] The framework for ship traffic behavior pattern recognition algorithms based on navigation behavior coupling is as follows: Figure 3 As shown, an AIS data compression algorithm based on ship navigation behavior is used to compress AIS data to preserve the spatial and kinematic features of the trajectories of passing ships. Based on this, a weighted multidimensional dynamic time-bending distance similarity metric is designed to quantify the coupling effect between spatial and kinematic features. Furthermore, a K-Fermat ship traffic behavior pattern recognition algorithm based on improved simulation of plant growth is designed, and ship traffic behavior is identified according to the similarity metric results.

[0126] S3. Ship traffic behavior pattern recognition: Based on the improved K-Fermat ship traffic behavior recognition algorithm that simulates plant growth, ship traffic behavior patterns are identified through node update operators based on neighborhood solutions, node update operators based on spatially symmetric positions, and corresponding node update strategies.

[0127] S4. Ship Anomaly Behavior Detection: Based on the identified ship traffic behavior patterns, anomaly behavior detection is performed using an adaptive local outlier factor-based algorithm. This involves... Curve adaptive determination of optimal parameters for the LOF algorithm Values, and calculate the local outlier factor of the ship trajectory. Anomaly scoring thresholds are used to identify abnormal ship trajectories and detect abnormal ship behavior.

[0128] Based on the various ship traffic behavior patterns identified by the ship traffic behavior coupling algorithm, and considering the Local Outlier Factor (LOF) algorithm, which compares samples with the first... The relative density relationship of other samples within the neighborhood is used to determine the purpose. Value calculation is used to identify outlier samples in a dataset with uneven density distribution. An inappropriate value selection can lead to biases in anomaly detection of samples, reducing the robustness of the algorithm. A smaller value... Values ​​that are too high may cause the algorithm to become overly sensitive, reacting excessively to noise and irrelevant points. Values ​​may fail to capture local anomalies in the dataset. To address this issue, this invention designs a ship anomaly behavior detection algorithm based on the Adaptive Local Outlier Factor (ALOF), applying... Curve graphs determine optimal parameters value.

[0129] (1) Adaptive determination of optimal parameters value;

[0130] Step 1: Take 95% of the ship trajectories of each ship traffic behavior pattern identified by the ship traffic behavior coupling algorithm as the training set, and input them into the ALOF detection model to calculate the weighted multidimensional dynamic time curvature distance matrix.

[0131] (9)

[0132] In the formula, For a weighted multidimensional dynamic time-bending distance matrix, For the central trajectory of the data With trajectory distance, The number of ship trajectories in the dataset;

[0133] Step 2: Weight the multidimensional dynamic time-bending distance matrix The elements in the matrix are sorted in ascending order by row. After sorting, the first column of the matrix contains all 0 elements, which is the distance from each trajectory to itself.

[0134] Step 3: Sort the matrix by... The elements in the column are sorted in ascending order as The ordinate of each point on the curve, the amount of data As The x-coordinate of each point on the curve, i.e. The meaning of each point on the curve is the first point in the dataset. The trajectory and its nearest _th The distance between the nearest trajectories is used to generate... Curve, Parameter Different values ​​will generate different k-dist Curves, all Curve composition Line graph.

[0135] Step 4: [Regarding...] The picture The curve is fitted using the least squares polynomial fitting method, and the calculation process of the least squares method is shown in equation (10).

[0136] (10)

[0137] In the formula, For the sum of squared errors, For the first The actual observed values ​​of each data point The curve expression is obtained by least-squares polynomial fitting, and ;

[0138] We find the function that best matches the original data distribution by minimizing the sum of squared errors (for a more accurate fit). The curve was fitted using the least squares polynomial as shown in equation (11) after repeated experiments and cross-validation.

[0139] (11)

[0140] In the formula, The coefficients of the terms in the polynomial;

[0141] Step 5: Calculate the fitted value The point with the largest curvature in the abrupt change region after the smooth curve rises steadily is the inflection point. The curvature is calculated as shown in equation (12).

[0142] (12)

[0143] In the formula, To fit the curvature of the curve, The second derivative of the fitted curve. The first derivative of the fitted curve;

[0144] Each The values ​​are sorted by size and set as the x-axis. The corresponding inflection points are then used as the y-axis to generate a new curve. The inflection points of the new curve are then identified; the x-axis corresponding to the value at that inflection point is... The value is the optimal parameter.

[0145] (2) Calculate the local outlier factor

[0146] Will k-dist The curve graph shows the optimal parameters for various modes. Substitution The formulas for calculating the value are shown in equations (13) to (15).

[0147] (13)

[0148] (14)

[0149] (15)

[0150] ;

[0151] In the formula, For ship trajectory Based on ship trajectory distance, To obtain the maximum value, For ship trajectory of k -distance, For ship trajectory With ship trajectory The actual distance For trajectory of Trajectory within the neighborhood, for of k - Distance neighborhood, including and The distance is no greater than k - Distance for each trajectory, For ship trajectory of k -Local density of ship tracks within the neighborhood for All ship tracks To ship track Sum of distances, For ship trajectory of score, For ship trajectory Local density, For ship trajectory The local density.

[0152] (3) Determine the abnormal scoring threshold;

[0153] (3-1) Construction of abnormal trajectory samples: 5% of normal ship trajectory samples were selected from the training set corresponding to each type of mode using stratified sampling method. Abnormal trajectory samples of the corresponding modes were constructed by artificial modification.

[0154] (3-2) Value calculation: Calculating the optimal parameters determined by various models. Substitute the values ​​into the training set containing anomalous samples after the model modification, and calculate the ship trajectories in each model. The value is used to quantify the degree of anomaly in the trajectory.

[0155] (3-3) Generation of candidate thresholds: In order to select the optimal anomaly scoring threshold, the trajectories in the training set of various patterns are statistically analyzed. The value distribution range is traversed with a step size of 0.1. The value distribution range is used to generate alternative thresholds for various patterns.

[0156] (3-4) Threshold Performance Evaluation: The F1 score exhibits significant adaptability and objectivity in detecting abnormal ship behavior. Through the harmonic averaging of precision and recall, it can dynamically adapt to different ship traffic patterns with varying densities and automatically adjust during pattern switching. Compared to traditional methods such as manually observing ROC curves or using fixed thresholds, the F1 score is calculated based on statistical data, resulting in unique and reproducible results, avoiding subjective bias, and automatically finding the optimal threshold for various patterns, effectively improving overall detection accuracy. For each pattern, one candidate threshold is selected as the criterion for anomaly detection in each round, and anomaly detection is performed on ship trajectories in the training set for that pattern. If the trajectory... If the value is greater than the candidate threshold, it is determined to be an abnormal trajectory; otherwise, it is determined to be a normal trajectory. The F1 score corresponding to the candidate threshold in this mode is calculated based on the detection results.

[0157] (3-5) Determination of the optimal threshold: The candidate thresholds that make the F1 score reach the maximum value for each mode are determined as the optimal anomaly score thresholds for the corresponding modes.

[0158] Example 2, this embodiment of the invention also provides a traffic behavior pattern-based ship abnormal behavior detection system for implementing the aforementioned traffic behavior pattern-based ship abnormal behavior detection method, comprising:

[0159] The data preprocessing module is used to compress ship AIS data using an AIS data compression algorithm based on ship navigation behavior, so as to preserve the spatial and motion characteristics of the trajectories of ships in transit.

[0160] The ship trajectory coupling measurement module is used to calculate the similarity between ship trajectories based on compressed ship AIS data using a weighted multidimensional dynamic time bending distance similarity measurement method, so as to quantify the coupling effect between the spatial and motion characteristics of the trajectories of navigable ships through weighted processing.

[0161] The ship traffic behavior pattern recognition module is used to identify ship traffic behavior patterns by employing the K-Fermat ship traffic behavior recognition algorithm based on improved simulated plant growth, through a node update operator based on neighborhood solution, a node update operator based on spatially symmetric position, and corresponding node update strategies.

[0162] The ship abnormal behavior detection module is used to detect abnormal behavior based on identified ship traffic behavior patterns using an algorithm based on adaptive local outlier factors. Curve adaptive determination of the optimal parameters for the LOF algorithm Values, and calculate the local outlier factor of the ship trajectory. Anomaly scoring thresholds are used to identify abnormal ship trajectories and detect abnormal ship behavior.

[0163] To further demonstrate the positive effects of the above embodiments, the present invention conducts the following experiments based on the above technical solutions: A comparison of existing technologies has been provided; the ship traffic behavior pattern recognition algorithm based on navigation behavior coupling is compared with the K-Means algorithm, MCK-Means algorithm, DEK-Means algorithm, PGSK-Fermat algorithm, and AutoEncoder-Clustering algorithm in terms of computation time, number of iterations, and DBI; the ALOF algorithm is compared with the Bayesian network algorithm, LOF algorithm, SVM algorithm, and LSTM algorithm in terms of ACC and F1 scores.

[0164] Experiment 1: To verify the performance of the proposed ship traffic behavior pattern recognition algorithm based on the coupling effect of navigation behavior, numerical experiments were conducted using AIS data of 1728 ships along the US coast on June 18, 2020. The silhouette coefficient method was used to calculate the optimal number of patterns, and the Davidson-Bourdin index (DBI) was used as the evaluation index for pattern recognition performance.

[0165] The proposed ship traffic behavior pattern recognition algorithm based on the coupling effect of navigation behavior is used to identify the traffic behavior patterns of navigation vessels. Table 1 shows different combinations of coupling effects corresponding to spatial position, speed, and trajectory, respectively. The optimal number of modes for each combination is determined using the profile coefficient method.

[0166] Table 1. Combinations of Coupling Effects

[0167]

[0168] Combination 1 only considers the motion characteristics of navigable vessels, resulting in a significantly enhanced ability of the algorithm to identify motion features, but it cannot accurately identify spatial features, as shown in the following... Figure 4 Figure (a) in the middle Figure 5 Figure (a) and Figure 5As shown in Figure (e), taking modes 1, 4, and 6 as examples, mode 1 has a distribution range of [15.624°N, 30.23°W] to [58.382°N, 159.358°W], with a main speed distribution range of 0.6kn-6.8kn and a main track direction distribution range of 134.2°-347.8°; mode 4 has the largest spatial distribution range, ranging from [10.501°N, 60.011°W] to [65.051°N, 60.011°W]. The speed distribution range for model 1 is [18.154°N, 64.147°W] to [80.136°N, 172.337°W], with a speed distribution range of 3.0 knots to 9.4 knots and a track orientation range of 101.4° to 277.4°. Model 6 has a distribution range of [18.154°N, 64.147°W] to [80.136°N, 172.337°W], with a speed distribution range of 4.4 knots to 11.8 knots and a track orientation range of 93.0° to 272.9°. There are significant differences in speed and track orientation distributions among the different models. However, spatially, the coverage areas of ship tracks in different models show extensive spatial overlap. Therefore, from the perspective of the spatial characteristics of navigable vessels, no differentiated traffic behavior patterns could be identified.

[0169] Combination 2 only considers the spatial characteristics of navigable vessels, which significantly enhances the algorithm's ability to identify spatial features, but it cannot identify the motion characteristics of navigable vessels, as shown in the following... Figure 4 Figure (b) in the middle Figure 5 Figure (b) in the middle and Figure 5 As shown in Figure (f), taking modes 5, 6, and 7 as examples, the spatial distribution range of mode 5 is [21.352°N, 76.059°W] to [38.095°N, 111.655°W]; the spatial distribution range of mode 6 is from [34.543°N, 76.514°W] to [48.447°N, 95.902°W]; and the spatial distribution range of mode 7 is from [21.462°N, 63.610°W] to [59.578°N, 84.676°W]. Clearly, these three modes have significant differences in spatial distribution. Furthermore, combining... Figures 4-6 It can be seen that the motion characteristics within these three modes also exhibit significant differences. These differences in motion characteristics are not identifiable when considering only the spatial characteristics of navigable vessels.

[0170] Combination 3 assigns the same coupling degree to the spatial and kinematic characteristics of navigable vessels, but weakens the algorithm's ability to identify spatial features, specifically as follows: Figure 4 Figure (c) in the middle Figure 5 Figure (c) in the middle and Figure 5As shown in Figure (g), taking Mode 1 and Mode 7 as examples, the distribution range of Mode 1 is [11.071°N, 55.168°W] to [48.447°N, 129.090°W], with a main speed distribution range of 2.6kn-7.6kn and a main trajectory distribution range of 91.7°-268.9°; the distribution range of Mode 7 is [18.218°N, 64.920°W] to [47.606°N, 98.181°W], with a main speed distribution range of 1.9kn-10.3kn and a main trajectory distribution range of 114.8°-297.4°. A comparison shows that although there are significant differences in motion characteristics such as speed and trajectory, their spatial distribution areas almost completely overlap. This result indicates that when the coupling effect of spatial features and motion features is considered in a balanced manner, the algorithm's ability to recognize spatial features is weakened, and the recognized traffic behavior patterns have low distinguishability in terms of spatial features.

[0171] Combination 4 sets the coupling degree between the spatial and kinematic characteristics of navigable vessels to 0.8, 0.1, and 0.1, respectively. While ensuring the accuracy of spatial feature recognition, it also considers kinematic characteristics to further refine vessel traffic behavior patterns, specifically as follows: Figure 4 (d) diagram in the middle Figure 5 (d) diagram and Figure 5 As shown in Figure (h), taking Mode 5 and Mode 6 as examples, the spatial distribution range of Mode 5 is from [22.502°N, 89.096°W] to [29.96°N, 101.022°W], with a main speed distribution range of 3.2 knots to 7.2 knots and a main track direction distribution range of 91.8° to 266.9°; the spatial distribution range of Mode 6 is from [21.359°N, 76.059°W] to [29.571°N, 102.795°W], with a main speed distribution range of 1.2 knots to 9.3 knots and a main track direction distribution range of 119.5° to 297.5°. Although the spatial distributions of the two are highly similar and densely connected, their motion characteristics are significantly different. Therefore, considering both the spatial and motion characteristics of the navigating vessels, they are identified as different traffic behavior patterns. It can be seen that the coupling degree setting of combination 4 not only strengthens the core recognition function of spatial features, but also accurately identifies the differentiated information of motion features.

[0172] Based on the above analysis, it can be seen that different coupling degrees result in different identification focuses and thus different identification effects. In order to simultaneously consider the spatial and kinematic characteristics of navigable vessels and thus ensure the best identification effect, the optimal coupling degrees for spatial and kinematic characteristics are set to 0.8, 0.1, and 0.1.

[0173] To further verify the recognition performance of the proposed algorithm, it was compared with K-Means, DEK-Means, MCK-Means, PGSK-Fermat, and AutoEncoder-Clustering algorithms. The comparison results are shown in Tables 2 and 3. Figure 6 As shown.

[0174] As shown in Table 2, the DBI of the proposed algorithm is 6.2519, the DBI of the K-Means algorithm is 6.6573, the DBI of the MCK-Means algorithm is 6.6024, the DBI of the DEK-Means algorithm is 6.5033, the DBI of the PGSK-Fermat algorithm is 6.4659, and the DBI of the AutoEncoder-Clustering algorithm is 6.3765. Clearly, the proposed algorithm has the lowest DBI value, and compared to the other comparison algorithms, its DBI value is improved by 6.48%, 5.6%, 4.02%, 3.42%, and 1.99%, respectively. Therefore, the recognition effect of the proposed algorithm is the best. Furthermore, to further verify the efficiency of the proposed algorithm, the running time and convergence speed of various algorithms were statistically analyzed (see Table 3). Figure 6 It can be seen that the running time of the algorithm proposed in this invention is 3.12 seconds, which is between the fastest K-Means algorithm (1.39 seconds) and the slowest AutoEncoder-Clustering algorithm (3.31 seconds). This is an inevitable result of the increased computational complexity caused by the multiple update operators and update strategy structure of the algorithm proposed in this invention, but its convergence speed is significantly faster than the comparative algorithms. Therefore, considering both the recognition effect and efficiency of the algorithm, the performance of the algorithm proposed in this invention is significantly better than the comparative algorithms.

[0175] Table 2 DBI for different algorithms

[0176]

[0177] Table 3 Running time of different algorithms

[0178]

[0179] Experiment 2: Numerical Experiment: Mode 1 Curves Figure 7 As shown in (a), the fitted k-dist curve is as follows: Figure 7 As shown in (b).

[0180] To verify the performance of the proposed ALOF ship abnormal behavior detection algorithm, the remaining 5% of ship trajectories in the patterns identified by the ship traffic behavior pattern recognition algorithm based on navigation as a coupling effect were used as the experimental set. Ten abnormal ship trajectories were manually modified and randomly assigned to each pattern for numerical experiments. The results calculated using the algorithm proposed in this invention... The anomaly detection value and anomaly scoring threshold are used, and the F1 score is used as the evaluation index for anomaly detection effectiveness.

[0181] The ALOF ship anomaly behavior detection algorithm proposed in this invention was used to identify abnormal ships in an experimental set. The algorithm successfully detected 9 out of the preset 10 abnormal ship trajectories, with ACC and F1 values ​​reaching 0.93 and 0.75 respectively. The identification effect is as follows: Figure 8 As shown.

[0182] Experiment 3: Comparative Experiment: To further verify the detection performance of the proposed algorithm, the ALOF algorithm was compared with the Bayesian network algorithm, the LOF algorithm, the support vector machine (SVM) algorithm, and the long short-term memory network (LSTM) algorithm. The comparison results are shown in Table 4.

[0183] Table 4 shows that the ALOF algorithm has an ACC of 0.93 and an F1 score of 0.75, the Bayesian network algorithm has an ACC of 0.77 and an F1 score of 0.38, the LOF algorithm has an ACC of 0.82 and an F1 score of 0.48, the SVM algorithm has an ACC of 0.84 and an F1 score of 0.55, and the LSTM algorithm has an ACC of 0.89 and an F1 score of 0.64. Clearly, the proposed algorithm has the highest ACC and F1 scores, and compared to the other comparison algorithms, its ACC score is improved by 17.2%, 11.8%, 9.6%, and 4.3%, and its F1 score is improved by 49.3%, 36%, 26.6%, and 14.6%, respectively. Therefore, the proposed algorithm has the best detection performance.

[0184] Table 4 Comparison of ACC and F1 scores for different algorithms

[0185]

[0186] In summary, based on the detection results and the quantitative results of the evaluation metrics ACC and F1, the proposed algorithm significantly outperforms the comparison algorithms in terms of performance.

[0187] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by those skilled in the art within the scope of the technology disclosed in the present invention and within the spirit and principles of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for detecting abnormal ship behavior based on traffic behavior patterns, characterized in that, The method includes the following steps: S1. Data Preprocessing: Based on the AIS data compression algorithm for ship navigation behavior, the DP algorithm is first used to compress the spatial features of AIS data, including ship longitude and ship latitude. Then, the sliding window algorithm is used to compress the motion features of the navigation ship trajectory, including speed and heading. The compression threshold of the sliding window is determined by Gaussian distribution and parametric trajectory. Finally, the compressed spatial features and motion features are fused to generate a compressed trajectory, which retains the spatial and motion features of the navigation ship trajectory. S2. Ship trajectory coupling metric: Based on compressed ship AIS data, the weighted multidimensional dynamic time bending distance similarity metric method is used to calculate the similarity between ship trajectories. The coupling effect between the spatial and kinematic features of the trajectories of navigable ships is quantified through weighted processing. S3. Ship traffic behavior pattern recognition: Based on the similarity measurement results, the improved K-Fermat ship traffic behavior recognition algorithm based on simulated plant growth is used to identify ship traffic behavior patterns through node update operators based on neighborhood solutions, node update operators based on spatially symmetric positions, and corresponding node update strategies. S4. Ship Anomaly Behavior Detection: Based on the identified ship traffic behavior patterns, anomaly behavior detection is performed using an adaptive local outlier factor-based algorithm. This involves... Curve adaptive determination of the optimal parameters for the LOF algorithm Values, and calculate the local outlier factor of the ship trajectory. Anomaly scoring thresholds are used to identify abnormal ship trajectories and detect abnormal ship behavior. The node update operator based on spatially symmetric positions is: Update operator 3: From the perspective of the solution space, the spatially symmetric position of the globally optimal node about the origin is selected as the jump direction for generating new nodes. The expression is: ; In the formula, To update the new nodes generated by operator 3, It is the globally optimal node; Impact Factor It adjusts dynamically with the number of iterations, and the expression is: ; In the formula, It is the arctangent function. This represents the number of iterations.

2. The method for detecting abnormal ship behavior based on traffic behavior patterns according to claim 1, characterized in that, In step S2, the expression for the weighted multidimensional dynamic time bending distance similarity metric is as follows: ; In the formula, For ship trajectory The Middle Points and ship trajectory The Middle The weighted Euclidean distance between points For the first Dimensional weights For ship trajectory The Middle The first point Dimensional value, For ship trajectory The Middle The first point Dimensional value; ; In the formula, For ship trajectory With ship trajectory Multidimensional dynamic time bending distance. For ship trajectory With ship trajectory The weighted Euclidean distance, To obtain the minimum value, For ship trajectory The number of trajectory points, For ship trajectory The number of trajectory points, Ship tracks Take before points and Take before Multidimensional dynamic time curvature distance at each point, ship trajectory Take before points and Take before Multidimensional dynamic time curvature distance at each point, ship trajectory Take before points and Take before Multidimensional dynamic time curvature distance at each point; By weighting the spatial and kinematic similarities between the trajectories of navigating vessels, the coupling effect between spatial and kinematic features in vessel traffic behavior is quantified.

3. The method for detecting abnormal ship behavior based on traffic behavior patterns according to claim 1, characterized in that, In step S3, the K-Fermat ship traffic behavior recognition algorithm based on the improved simulation of plant growth includes: The Fermat point with the smallest sum of distances to ship trajectory samples in the ship traffic behavior pattern is taken as the plant growth node, and the optimal number of patterns determined by the contour coefficient method is set as the number of plant growth nodes; the initial plant growth node position is determined by the random uniform method as the pattern center.

4. The method for detecting abnormal ship behavior based on traffic behavior patterns according to claim 1, characterized in that, In step S3, the node update operator based on the neighborhood solution includes: Update operator 1: Incorporate neighborhood solutions in the solution space into the plant growth node information interaction system, and generate new nodes by comparing the current best node with the global worst node. The expression is: ; In the formula, Let the update step size be operator one. A random number within the interval (0, 1). The optimal node in the current iteration. It is the worst node in the world. To update the new node generated by operator one, Impact factor; Update operator 2: Generates a new node by comparing the globally optimal node with the globally worst node. The expression is: ; In the formula, Let this be the update step size for operator two. It is the globally optimal node. To update the new node generated by operator two.

5. The method for detecting abnormal ship behavior based on traffic behavior patterns according to claim 4, characterized in that, The expression for the node update strategy is: ; ; In the formula, For the fitness function, For the new node, This represents the total number of ship trajectory samples in the model. For the trajectories of the remaining ships in the model, The multidimensional dynamic time curvature distance between the trajectory of the new node and the trajectories of other ships; For the first One ship trajectory sample, The number of trajectory points for the new node's ship trajectory. For the first The number of trajectory points for each ship's trajectory; After the algorithm iteratively generates new nodes, it calculates the fitness of each node; when The fitness is greater than When determining the fitness of the algorithm, the newly generated node by the node update operator replaces the globally worst node to fully explore local neighborhood information and accelerate the convergence speed of the algorithm in the local region; when The fitness is less than fitness and The fitness is greater than When assessing fitness, the new node generated by update operator 2 is used to replace the globally worst node to expand the search range, prevent the algorithm from converging too early to a local inferior node, and increase the probability of finding the globally optimal node. When neither of the above two conditions is met, the new node generated by update operator 3 is used to replace the globally worst node to open up a completely new search direction, escape local optima, and improve the diversity of algorithm results.

6. The method for detecting abnormal ship behavior based on traffic behavior patterns according to claim 1, characterized in that, In step S4, through Curve adaptive determination of the optimal parameters for the LOF algorithm Values, including: The ship trajectories of each ship traffic behavior pattern identified by the ship traffic behavior coupling algorithm based on navigation behavior are taken as training sets and input into the detection model based on the adaptive local outlier factor ALOF to calculate the weighted multidimensional dynamic time bending distance matrix. ; In the formula, For a weighted multidimensional dynamic time-bending distance matrix, For the central trajectory of the data With trajectory distance, The number of ship trajectories in the dataset; The weighted multidimensional dynamic time-bending distance matrix The elements in the matrix are sorted in ascending order by row. After sorting, the first column of the matrix contains all 0 elements, which is the distance from each trajectory to itself. The sorted matrix The elements in the column are sorted in ascending order as The ordinate of each point on the curve, the amount of data As The x-coordinate of each point on the curve, Each point on the curve is the first point in the dataset. The trajectory and the most recent one The distance between the nearest trajectories is used to generate... Curve, Parameter Different values ​​will generate different Curves, all Curve composition Line graph; right The picture The curve was fitted using the least squares polynomial fitting method. ; In the formula, For the sum of squared errors, For the first The actual observed values ​​of each data point The curve expression is obtained by least-squares polynomial fitting, and ; The function that best matches the original data distribution is found by minimizing the sum of squared errors. The curve is then fitted using a least-squares polynomial, as shown in the following equation: ; In the formula, The coefficients of the terms in the polynomial; Calculate the fitted The point of maximum curvature within the abrupt change region after a smooth curve's steady ascent, i.e., the inflection point, is expressed as: ; In the formula, To fit the curvature of the curve, The second derivative of the fitted curve. The first derivative of the fitted curve; Each The values ​​are sorted by size and set as the x-axis; the corresponding inflection points are the y-axis, generating a new curve. The inflection points of the new curve are then calculated, and the x-axis corresponding to the inflection point values ​​is... The value is the optimal parameter, where, .

7. The method for detecting abnormal ship behavior based on traffic behavior patterns according to claim 1, characterized in that, In step S4, to identify abnormal ship trajectories and detect abnormal ship behavior, the following steps are included: Will The curve graph shows the optimal parameters for various modes. Substitution The formula for calculating the value is as follows: ; ; ; In the formula, For ship trajectory Based on ship trajectory distance, To obtain the maximum value, For ship trajectory of k -distance, For ship trajectory With ship trajectory The actual distance For trajectory of k - Trajectory within the neighborhood, for of k - Distance neighborhood, including and The distance is no greater than k - distance for each trajectory, for All ship tracks To ship track Sum of distances, For ship trajectory of score, For ship trajectory Local density, For ship trajectory The local density.

8. The method for detecting abnormal ship behavior based on traffic behavior patterns according to claim 1, characterized in that, In step S4, the local outlier factor value of the ship trajectory is calculated. and abnormal scoring thresholds, including: Abnormal trajectory sample construction: 5% of normal ship trajectory samples were selected from the training set corresponding to each of the various modes using stratified sampling. Abnormal trajectory samples for the corresponding modes were then constructed through manual modification. Value calculation: Calculating the optimal parameters determined by various models. Substitute the values ​​into the training set containing anomalous samples after the corresponding model modification, and calculate the ship trajectory in each model. Values ​​are used to quantify the degree of anomaly in the trajectory; Candidate threshold generation: To select the optimal anomaly scoring threshold, statistical analysis of trajectories in the training set for various patterns is performed. The value distribution range is traversed with a step size of 0.

1. The distribution range of values ​​is used to generate alternative thresholds for various patterns; Threshold performance evaluation: The F1 score demonstrates significant adaptability and objectivity in detecting abnormal ship behavior; it dynamically adapts to different ship traffic patterns using a harmonic average of precision and recall, and automatically adjusts during pattern switching; the F1 score is calculated based on statistical data; for each pattern, one alternative threshold is selected as the criterion for anomaly detection in each round, and anomaly detection is performed on ship trajectories in the training set for each pattern; if the trajectory... If the value is greater than the candidate threshold, it is determined to be an abnormal trajectory; otherwise, it is determined to be a normal trajectory. The F1 score corresponding to the candidate threshold of the corresponding mode is calculated based on the detection results. Determining the optimal threshold: The candidate thresholds that maximize the F1 score for each mode are determined as the optimal anomaly scoring thresholds for the corresponding modes.

9. A ship abnormal behavior detection system based on traffic behavior patterns, characterized in that, The system is implemented using the ship abnormal behavior detection method based on traffic behavior patterns as described in any one of claims 1-8, and the system includes: The data preprocessing module uses an AIS data compression algorithm based on ship navigation behavior. First, the DP algorithm is used to compress the spatial features of AIS data, including ship longitude and latitude. Second, the sliding window algorithm is used to compress the motion features of the navigation ship trajectory, including speed and heading. The compression threshold of the sliding window is determined by Gaussian distribution and parametric trajectory. Finally, the compressed spatial features and motion features are fused to generate a compressed trajectory, preserving the spatial and motion features of the navigation ship trajectory. The ship trajectory coupling measurement module, based on compressed ship AIS data, uses a weighted multidimensional dynamic time bending distance similarity measurement method to calculate the similarity between ship trajectories. It quantifies the coupling effect between the spatial and kinematic features of the trajectories of navigable ships through weighted processing. The ship traffic behavior pattern recognition module is based on the improved K-Fermat ship traffic behavior recognition algorithm that simulates plant growth. It identifies ship traffic behavior patterns through node update operators based on neighborhood solutions, node update operators based on spatially symmetric positions, and corresponding node update strategies. The ship abnormal behavior detection module detects abnormal behavior based on identified ship traffic behavior patterns and an algorithm that uses an adaptive local outlier factor. Curve adaptive determination of the optimal parameters for the LOF algorithm Values, and calculate the local outlier factor of the ship trajectory. Anomaly scoring thresholds are used to identify abnormal ship trajectories and detect abnormal ship behavior.

Citation Information

Patent Citations

  • Ship anomaly detection method based on improved trajectory segment DBSCAN clustering

    CN113032502A

  • Self-adaptive identification method and system for ship traffic behavior mode and computer equipment

    CN115828120A