Method and device for generating ship abnormal behavior recognition model

By clustering and feature extraction of the original data of the ship automatic identification system, the LightGBM model is generated, which solves the problem of large calculation volume and low accuracy of ship abnormal behavior detection in the prior art, and achieves efficient and accurate identification of ship abnormal behavior.

CN120217229APending Publication Date: 2025-06-27WUHAN UNIV OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510277910.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-06-27

AI Technical Summary

Technical Problem

When detecting abnormal behavior of ships, the prior art has large calculation volume and low recognition accuracy, making it difficult to achieve real-time monitoring.

Method used

Based on the original data of the ship automatic identification system, the ship behavior pattern is determined and the position information of the trajectory segment corresponding to each ship behavior pattern is clustered to extract the ship navigation area. Then, ship behavior anomaly data is determined based on these navigation areas, and trained by LightGBM model, ship similarity and difference characteristics are extracted to generate a ship abnormal behavior identification model.

Benefits of technology

It significantly improves the efficiency and accuracy of ship monitoring, reduces the amount of identification and calculation, and realizes real-time monitoring and early warning of ship abnormal behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120217229A_ABST
    Figure CN120217229A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for generating a ship abnormal behavior recognition model, and belongs to the technical field of ship supervision and management, and the method comprises the steps: determining ship behavior modes based on the original data of an automatic ship recognition system, and carrying out the clustering of the position information of a track segment corresponding to each ship behavior mode, extracting a ship navigation area corresponding to each ship behavior mode; the ship behavior modes comprise direct navigation, steering and staying; determining ship behavior abnormal data based on the ship navigation area corresponding to each ship behavior mode; based on the ship behavior abnormal data, determining ship similarity features and ship difference features in different ship behavior modes; and training a LightGBM model based on the ship similarity features and the ship difference features to obtain a ship abnormal behavior recognition model. By training the LightGBM model, the problems of large identification calculation amount and low identification accuracy when the ship abnormal behavior is detected by the existing scheme can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ship supervision and management, and particularly to a method and device for generating a ship abnormal behavior recognition model. Background Art

[0002] With the continuous development of the maritime transportation industry, various maritime accidents occur frequently. Relevant research shows that more than 90% of ship accidents are related to human factors. The common cause of collision accidents is mainly that human errors lead to abnormal behaviors of ships, thus causing collision accidents. The occurrence of accidents not only brings huge economic losses, but also causes a large number of casualties. Therefore, how to identify ship abnormal behaviors to reduce the incidence of ship accidents is of great significance for improving the efficiency of ship transportation operations, ensuring the safety of ship navigation, and promoting the safe and efficient development of the shipping industry.

[0003] At present, the main method for detecting ship abnormal behaviors is Vessel Traffic Service (VTS). Maritime supervision personnel monitor the behaviors of ships within the supervised waters through Automatic Identification System (AIS), Closed Circuit Television (CCTV), marine radar, etc., identify ships with suspicious behaviors or accident risks, and give alarms. However, the method relying on manual duty is prone to false alarms, missed alarms, etc. due to insufficient numbers of monitoring personnel, lack of experience, physical fatigue, etc. Especially when the traffic flow is large, it is difficult for the duty personnel to quickly detect abnormal behaviors threatening the safety of ship navigation and make timely responses.

[0004] In recent years, ship behavior recognition methods based on machine learning have gradually emerged. The algorithm models used in this method are relatively complex and computationally intensive, making it difficult to achieve real-time monitoring in practical applications; some other methods may have low recognition accuracy due to insufficient extraction of data features or improper setting of algorithm parameters. Summary of the Invention

[0005] In view of this, it is necessary to provide a method and device for generating a ship abnormal behavior recognition model to solve the technical problems of large recognition calculation amount and low recognition accuracy existing in the existing solutions for detecting ship abnormal behaviors.

[0006] To solve the above problems, in the first aspect, the present invention provides a method for generating a ship abnormal behavior recognition model, including: Based on the raw data of the Automatic Identification System (AIS) of ships, determine the ship behavior patterns, and cluster the position information of the trajectory segments corresponding to each ship behavior pattern to extract the ship navigation areas corresponding to each ship behavior pattern; the ship behavior patterns include straight sailing, turning, and staying. Based on the ship navigation areas corresponding to each ship behavior pattern, determine the abnormal ship behavior data. Based on the abnormal ship behavior data, determine the ship similarity features and ship difference features under different ship behavior patterns. Based on the ship similarity features and the ship difference features, train a LightGBM model to obtain a ship abnormal behavior recognition model.

[0007] In a possible implementation, determining the ship behavior patterns based on the raw data of the Automatic Identification System (AIS) of ships includes: Delete the duplicate data in the raw data of the Automatic Identification System (AIS) of ships to obtain the first data. Fuse the static data table and the dynamic data table in the first data to obtain the second data. Screen the ship data within the target area range from the second data, sort the ship data within the target area range according to the MMSI number, and sort the ships with the same MMSI number as the sorting objects according to the positioning time to obtain the preprocessed data. Based on the preprocessed data, determine the ship behavior patterns.

[0008] In a possible implementation, the preprocessed data includes: the total displacement distance of the ship's trajectory in the first state, the sum of the direction changes of the ship's trajectory points within the first target time range, and the sum of the direction changes of the ship's trajectory points within the second target time range. The first state is the state corresponding to the duration when the ship's traveling speed is less than the first speed threshold and is greater than the first time threshold. Based on the preprocessed data, determining the ship behavior patterns includes: When the total displacement distance of the ship's trajectory in the first state is less than the first distance threshold, determine that the ship behavior pattern is the staying pattern. When the sum of the direction changes of the ship's trajectory points within the first target time range is greater than the first target turning threshold, determine that the ship behavior pattern is the turning pattern. When the sum of the direction changes of the ship's trajectory points within the second target time range is less than the second target turning threshold, determine that the ship behavior pattern is the straight sailing pattern.

[0009] In a possible implementation, clustering the trajectory segment position information corresponding to the ship behavior patterns to extract the ship navigation areas corresponding to each ship behavior pattern includes: Dividing the data space of the trajectory segment position information corresponding to the ship behavior patterns; Clustering the trajectory segment data in the divided data space; Extracting the navigation area boundary based on the concave hull algorithm for the clustering result to obtain the ship navigation areas corresponding to each ship behavior pattern.

[0010] In a possible implementation, clustering the trajectory segment data in the divided data space includes: Determining that the largest set of dense units where the trajectory segment data is connected in the divided data space is a cluster; Determining the maximum coverage area of each cluster based on the greedy algorithm, and determining the minimum coverage area of each cluster from the maximum coverage area. Based on the minimum coverage area of each cluster, the clustering result is obtained.

[0011] In a possible implementation, determining the ship behavior abnormal data based on the ship navigation areas corresponding to each ship behavior pattern includes: Dividing the grid of the ship navigation areas corresponding to each ship behavior pattern by using the isolation forest algorithm; Determining the outliers in the grid with the data volume greater than the target quantity threshold as the ship behavior abnormal data.

[0012] In a possible implementation, determining the outliers in the grid with the data volume greater than the target quantity threshold as the ship behavior abnormal data includes: Constructing an isolation tree based on the data points in the grid with the data volume greater than the target quantity threshold; Traversing the isolation tree to determine the path length of the data points in the grid with the data volume greater than the target quantity threshold; Determining the outliers in the grid with the data volume greater than the target quantity threshold based on the path length, and determining the outliers as the ship behavior abnormal data.

[0013] In a possible implementation, determining the ship similarity features and ship difference features under different ship behavior patterns based on the ship behavior abnormal data includes: Determining the ship motion characteristic parameters under different behavior patterns based on the ship behavior abnormal data; Using the principal component analysis method to determine the cumulative contribution rate of the principal components corresponding to the ship motion characteristic parameters under different behavior patterns; Determining the principal component of the characteristic parameters affecting the ship abnormal behavior recognition based on the cumulative contribution rate of the principal components; Based on the principal components of the characteristic parameters, the same ship motion characteristic parameters under different behavior patterns are determined as ship similarity characteristics, and the ship motion characteristic parameters unique to a specific behavior pattern are determined as ship difference characteristics.

[0014] In a second aspect, the present invention provides a method for identifying abnormal ship behaviors, including: Inputting the data to be measured of the automatic identification system of ships into the ship abnormal behavior identification model obtained by the above method to obtain the ship abnormal behavior identification result.

[0015] In a third aspect, the present invention provides a device for generating a ship abnormal behavior identification model, including: A clustering module, configured to determine ship behavior patterns based on the original data of the automatic identification system of ships, and cluster the position information of the trajectory segments corresponding to each ship behavior pattern to extract the ship navigation areas corresponding to each ship behavior pattern; the ship behavior patterns include straight sailing, turning, and staying; An abnormal data determination module, configured to determine ship behavior abnormal data based on the ship navigation areas corresponding to each ship behavior pattern; A feature determination module, configured to determine ship similarity characteristics and ship difference characteristics under different ship behavior patterns based on the ship behavior abnormal data; A model training module, configured to train a LightGBM model based on the ship similarity characteristics and the ship difference characteristics to obtain a ship abnormal behavior identification model.

[0016] The beneficial effects of adopting the above implementation manner are as follows: The method and device for generating a ship abnormal behavior identification model provided by the present invention cluster the position information of the trajectory segments corresponding to each ship behavior pattern to extract the ship navigation areas corresponding to each ship behavior pattern, so as to determine ship behavior abnormal data. Ship similarity characteristics and ship difference characteristics under different ship behavior patterns are extracted from the ship behavior abnormal data for model training. The trained model can identify these ship abnormal data. The present application determines abnormal data through clustering, and does not use normal ship behavior data or other forms of data as the input of model training, which can reduce the recognition calculation amount of the model, thereby significantly improving the efficiency and accuracy of ship monitoring; A LightGBM model is trained based on the ship similarity characteristics and the ship difference characteristics. The LightGBM model can train the abnormal behavior identification models for three behavior patterns of straight sailing, turning, and staying respectively. Compared with the traditional method, it has better classification performance and lower time complexity, and further solves the technical problems of large recognition calculation amount and low recognition accuracy existing in the existing solutions for detecting ship abnormal behaviors. Description of the Drawings

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those skilled in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0018] Figure 1 It is a flowchart of an embodiment of the method for generating a ship abnormal behavior recognition model provided by the present invention; Figure 2 It is a flowchart of the preprocessing of the original data provided by the present invention; Figure 3 It is a flowchart of the ship behavior pattern recognition method provided by the present invention; Figure 4 It is a flowchart of the CLIQUE grid clustering algorithm provided by the present invention; Figure 5 It is a schematic diagram of the training process of the isolation forest provided by the present invention; Figure 6 It is a schematic diagram of the ship abnormal behavior trajectory segment provided by the present invention; Figure 7 It is a flowchart of the algorithm of the LightGBM model provided by the present invention; Figure 8 It is a flowchart of an embodiment of the ship abnormal behavior method provided by the present invention; Figure 9 It is a principle block diagram of an embodiment of the device for generating a ship abnormal behavior recognition model provided by the present invention; Figure 10 It is a schematic structural diagram of an embodiment of the electronic device provided by the present invention. Detailed implementation manners

[0019] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.

[0020] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality" is two or more.

[0021] In the embodiments of the present invention, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product, or equipment that includes a series of steps or modules does not necessarily have to be limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or are inherent to these processes, methods, products, or equipment.

[0022] In the embodiments of the present invention, the naming or numbering of steps does not mean that the steps in the method flow must be executed in the chronological / logical order indicated by the naming or numbering. The named or numbered process steps can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.

[0023] Referring to "embodiments" herein means that the specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present invention. The phrase appears in various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0024] The present invention provides a method and device for generating a ship abnormal behavior recognition model, which will be described separately below.

[0025] As Figure 1 shown, the present invention provides a method for generating a ship abnormal behavior recognition model, including: S101. Based on the original data of the Automatic Identification System (AIS) of ships, determine the ship behavior patterns, and cluster the position information of the trajectory segments corresponding to each ship behavior pattern to extract the ship navigation areas corresponding to each ship behavior pattern; the ship behavior patterns include straight sailing, turning, and staying.

[0026] It can be understood that the original data of the Automatic Identification System (AIS) of ships may include the MMSI number, data time (ship positioning time), ship longitude and latitude information (ship position information), and ship speed information. These data are distributed in static data packets and dynamic data tables. The static data table stores fixed data, such as the MMSI number, and the dynamic data table stores dynamic data, such as ship longitude and latitude information and ship speed information.

[0027] Here, the position information of the trajectory segments corresponding to different ship behavior patterns is clustered, and the trajectory segment position information can be determined based on the ship longitude and latitude information in the above original data.

[0028] Cluster the trajectory segment position information corresponding to the ship behavior patterns. According to the clustering results, the ship navigation area can be determined, and the ship positions with large deviations are determined as ship abnormal position data.

[0029] S102. Determine ship behavior abnormal data based on the ship navigation areas corresponding to each ship behavior pattern.

[0030] It can be understood that the ship abnormal position data is used to represent that the ship position is abnormal. The ship behavior abnormal data includes abnormal behavior trajectory segments in the straight - sailing mode, turning mode, and staying mode. Here, the behavior includes characteristics such as the speed, course, turning angle, curvature, etc. of the ship during the movement process.

[0031] S103. Based on the ship behavior abnormal data, determine the ship similarity characteristics and ship difference characteristics under different ship behavior patterns.

[0032] It can be understood that the ship similarity characteristics include the spatial distance, speed, course, turning angle, heading, angular velocity, time difference, acceleration, maximum value, minimum value, median, mean, standard deviation, variance of curvature between each sub - trajectory point of the ship, as well as the variance and standard deviation of longitude and latitude; the ship difference characteristics include the staying center, error radius, average straight - sailing direction, straight - sailing speed standard deviation, straight - sailing acceleration, turning equivalent center, turning equivalent radius, and turning speed.

[0033] S104. Train a LightGBM model based on the ship similarity characteristics and the ship difference characteristics to obtain a ship abnormal behavior recognition model.

[0034] It can be understood that based on the ship similarity characteristics and the ship difference characteristics, after extracting the principal components of the characteristic parameters corresponding to the three behavior patterns of straight - sailing, turning, and staying, the characteristic parameters corresponding to the three behavior patterns are input into LightGBM according to the ratio of 80% for the training set and 20% for the test set to train the abnormal behavior recognition models for the corresponding behavior patterns, namely, the abnormal behavior recognition model for the straight - sailing mode, the abnormal behavior recognition model for the turning mode, and the abnormal behavior recognition model for the staying mode, and the accuracy rate, recall rate, and F1 - score are selected as evaluation indicators.

[0035] The finally obtained ship abnormal behavior recognition model can be used to identify ship abnormal behaviors. For example, after pre - processing the data to be measured of the Automatic Identification System (AIS) of the ship, it is input into the ship abnormal behavior recognition model for ship abnormal behavior recognition to obtain the final recognition result.

[0036] The method provided by the present invention can be executed by an application on a terminal or a server. The terminal can be a computer, a mobile phone, a tablet computer, or other device terminals. The server can be a cloud server or an edge server.

[0037] The present invention proposes a method for generating a ship abnormal behavior recognition model. This model is trained based on the LightGBM (Light Gradient Boosting Machine) model and can be used for ship abnormal behavior recognition. This recognition method combines the efficiency and accuracy of the LightGBM algorithm. By deeply analyzing ship navigation data, extracting key features, and constructing an accurate recognition model, it realizes real-time monitoring and early warning of ship abnormal behavior. This method not only improves the efficiency and accuracy of ship monitoring but also brings new development opportunities to the fields of marine transportation and ship management.

[0038] In some embodiments, based on the original data of the Automatic Identification System (AIS) of ships, determining the ship behavior pattern includes: Deleting duplicate data in the original data of the Automatic Identification System of ships to obtain the first data; Fusing the static data table and the dynamic data table in the first data to obtain the second data; Screening the ship data within the target area from the second data, sorting the ship data within the target area according to the MMSI number, and sorting the ships with the same MMSI number as the sorting object according to the positioning time to obtain the preprocessed data; Based on the preprocessed data, determining the ship behavior pattern.

[0039] It can be understood that the process of preprocessing the original data is as Figure 2 shown. Analyze the AIS data (original data) based on the MMSI number, data time, ship longitude and latitude information, and speed information, and delete all duplicate information; then, using the ship MMSI number as the index, fuse the static data table and the dynamic data table, and only retain the fields available for subsequent analysis; then, by comparing the longitude and latitude ranges, screen the ships within the jurisdiction as the research objects; then delete the data that does not conform to the actual situation in the AIS data, such as the MMSI is not 9 digits, and the longitude and latitude exceed the normal value range; finally, taking the MMSI as the standard, sort in ascending order of MMSI, and then taking the ships with the same MMSI as the sorting object, sort in ascending order of positioning time, put the data of the same ship into different data tables respectively, and delete the ships with too few track points to obtain the preprocessed data.

[0040] In some embodiments, the preprocessed data includes: the total displacement distance of the ship's trajectory in the first state, the sum of the direction changes of the ship's trajectory points within the first target time range, and the sum of the direction changes of the ship's trajectory points within the second target time range; The first state is the state where the duration of the ship's traveling speed being less than the first speed threshold is greater than the first time threshold; Based on the preprocessed data, determining the ship's behavior pattern includes: When the total displacement distance of the ship's trajectory in the first state is less than the first distance threshold, determining the ship's behavior pattern as the staying pattern; When the sum of the direction changes of the ship's trajectory points within the first target time range is greater than the first target turning threshold, determining the ship's behavior pattern as the turning pattern; When the sum of the direction changes of the ship's trajectory points within the second target time range is less than the second target turning threshold, determining the ship's behavior pattern as the straight - sailing pattern.

[0041] It can be understood that the sliding window algorithm is used to identify the ship's behavior pattern. The flow of the ship's behavior pattern recognition method is as Figure 3 shown. The ship's behavior patterns are divided into three types: straight - sailing, turning, and staying. In the ship's trajectory , if there is a sub - trajectory where the speed is less than the threshold , the duration is greater than the threshold , and the total displacement distance of this trajectory is less than the threshold , then the motion pattern of this sub - trajectory is considered as the staying pattern. If there is a sub - trajectory where the sum of the direction changes of the trajectory points within a certain time range is greater than the turning threshold , then the motion pattern of this sub - trajectory is considered as the turning pattern. Set the turning threshold . If the sum of the direction changes of a certain sub - trajectory within a certain time range is less than , then the motion pattern of this sub - trajectory is considered as the straight - sailing pattern. For the three navigation states of staying, turning, and going straight, set corresponding judgment thresholds and judgment conditions for the ship speed, course, time, etc. Use the sliding window algorithm to judge and extract the ship's motion sub - trajectories and put them into different datasets.

[0042] In some embodiments, clustering the position information of the trajectory segments corresponding to the ship's behavior pattern to extract the ship's navigation area corresponding to each ship's behavior pattern, including: Dividing the data space of the position information of the trajectory segments corresponding to the ship's behavior pattern; Clustering the trajectory segment data in the divided data space; Extract the navigation area boundary from the clustering results based on the convex hull algorithm to obtain the ship navigation areas corresponding to each ship behavior pattern.

[0043] It can be understood that in this embodiment, for the ship navigation area recognition that integrates the CLIQUE grid clustering and the convex hull algorithm, the process of the clustering method is as Figure 4 shown. Use the CLIQUE grid clustering algorithm to cluster the position information of the trajectory segments corresponding to different ship behavior patterns to extract the navigation areas corresponding to different behavior patterns, so as to determine the abnormal position data of the ship based on the navigation area.

[0044] In some embodiments, clustering the trajectory segment data in the partitioned data space includes: Determine that the largest set of dense cells where the trajectory segment data is connected in the partitioned data space is the cluster; Based on the greedy algorithm, determine the maximum coverage area of each cluster, and determine the minimum coverage area of each cluster from the maximum coverage area. Based on the minimum coverage area of each cluster, obtain the clustering result.

[0045] It can be understood that this embodiment uses the depth-first algorithm to discover the clusters in the space. Starting from a dense cell in the space, find all the cells connected to it and mark them with the serial number 1, indicating that they are the first ones to be traversed. Then randomly select an unmarked dense cell to continue the exploration, and number them in ascending order according to the previous serial number until all the dense cells in the space have been searched and each has its own number. After the traversal is completed, the largest set of connected dense cells is defined as the cluster.

[0046] Finally, generate a minimized description for each cluster. For each cluster, first use the greedy algorithm to find the maximum coverage area, that is, greedily cover the cluster with the largest number of rectangles, and then remove the minimum number of redundant maximum space areas from the existing maximum coverage until there are no redundant maximum dense areas, then the minimum coverage of each cluster can be determined and the clustering is completed.

[0047] In some embodiments, based on the ship navigation areas corresponding to each ship behavior pattern, determining the ship behavior abnormal data includes: Use the isolation forest algorithm to divide the grid for the ship navigation areas corresponding to each ship behavior pattern; Determine the outliers in the grids with the data volume greater than the target quantity threshold as the ship behavior abnormal data.

[0048] It can be understood that the ship behavior abnormal data in this embodiment redefines the ship behavior abnormal data by using the isolation forest algorithm, and the specific process is asFigure 5 As shown in the figure. Based on the grids divided by the CLIQUE algorithm, for grids with a data volume greater than 1000, the Isolation Forest algorithm is used to detect the outliers in each grid, and the outliers are defined as abnormal data. The longitude, latitude, and speed in the straight - sailing mode, the longitude, latitude, and angular velocity in the turning mode, and the longitude and latitude in the staying mode are selected as data objects, and the Isolation Forest algorithm is used for outlier detection.

[0049] In some embodiments, the outliers in the grids with a data volume greater than the target quantity threshold are determined as ship behavior abnormal data, including: Based on the data points in the grids with a data volume greater than the target quantity threshold, construct isolation trees; Traverse the isolation trees to determine the path lengths of the data points in the grids with a data volume greater than the target quantity threshold; Based on the path lengths, determine the outliers in the grids with a data volume greater than the target quantity threshold, and determine the outliers as ship behavior abnormal data.

[0050] It can be understood that the anomaly score is calculated according to the path length of the data in the isolation tree. In the solution of the anomaly score, normalization processing is performed on the anomaly score, and the anomaly score range is between 0 and 1. The higher the anomaly score, the more likely it is to be abnormal data.

[0051] In some embodiments, based on the ship abnormal data, determine the ship similarity features and ship difference features in different ship behavior modes, including: Adopt a sliding window algorithm. When it is determined that the abnormal data determined secondarily in the target trajectory is greater than the target abnormal data threshold, determine the target trajectory as the ship abnormal behavior trajectory segment; the target trajectory is a sub - trajectory composed of a target number of data points.

[0052] It can be understood that in this embodiment, a sliding window algorithm is used to define the ship abnormal behavior trajectory segment. Using the sliding window algorithm, set a window threshold. Only when the number of abnormal data in a sub - trajectory with no less than 5 trajectory points is greater than or equal to the set threshold of 3 can it be defined that the current ship behavior is abnormal, and the corresponding trajectory segment is the abnormal behavior trajectory segment.

[0053] In some embodiments, based on the ship behavior abnormal data, determine the ship similarity features and ship difference features in different ship behavior modes, including: Based on the ship behavior abnormal data, determine the ship motion characteristic parameters in different behavior modes; Adopt the principal component analysis method to determine the cumulative contribution rate of the principal components corresponding to the ship motion characteristic parameters in different behavior modes; Based on the cumulative contribution rate of the principal components, determine the principal components of the characteristic parameters that affect the recognition of ship abnormal behavior; Based on the principal components of the characteristic parameters, the same ship motion characteristic parameters under different behavior patterns are determined as ship similarity characteristics, and the ship motion characteristic parameters unique to a specific behavior pattern are determined as ship difference characteristics.

[0054] It can be understood that the partial same spatio-temporal motion characteristics of the ship under different behavior patterns and the unique spatio-temporal motion characteristics under specific behavior patterns are respectively defined as ship similarity characteristics and ship difference characteristics. The ship similarity characteristics include the maximum value, minimum value, median, mean, standard deviation, variance of the spatial distance, speed, course, turning angle, heading, angular velocity, time difference, acceleration, curvature between each sub-trajectory point of the ship, as well as the variance and standard deviation of longitude and latitude, a total of 58; the ship difference characteristics include the stay center, error radius, straight-ahead average direction, straight-ahead speed standard deviation, straight-ahead acceleration, turning equivalent center, turning equivalent radius and turning speed, a total of 8. The ship similarity and difference motion characteristic parameters are extracted respectively. Then, the principal component analysis method is used to extract the principal components of the characteristic parameters that affect the identification of abnormal ship behavior from the ship motion characteristic parameters.

[0055] The method for generating an abnormal ship behavior identification model provided by the present invention includes: Step 1: AIS data preprocessing. The original data from the Automatic Identification System (AIS) of ships is preprocessed. First, the AIS data is analyzed based on the Maritime Mobile Service Identity (MMSI), data time, ship longitude and latitude information, and speed information, and all duplicate information is deleted; then, with the ship MMSI number as the index, the static data table and the dynamic data table are fused, and only the fields available for subsequent analysis are retained; next, by comparing the longitude and latitude ranges, the ships within the jurisdiction range are selected as the research objects; then, the data that does not conform to the actual situation in the AIS data, such as the MMSI is not 9 digits, the longitude and latitude exceed the normal value range, etc., is deleted; finally, with the MMSI as the standard, it is sorted in ascending order of MMSI, and then the ships with the same MMSI are used as the sorting objects, and they are sorted in ascending order of positioning time. The data of the same ship is placed in different data tables respectively, and the ships with too few trajectory points are deleted.

[0056] Step 2: Use the sliding window algorithm to identify the ship behavior pattern. The ship behavior patterns are divided into straight-ahead, turning, and staying. In the ship trajectory If there is a sub-trajectory in which the speed is less than the threshold and the duration is greater than the threshold and the total displacement distance of this trajectory is less than the threshold , it is considered that the motion pattern of this sub-trajectory is the staying pattern. If there is a sub-trajectory where the sum of the direction changes of the trajectory points within a certain time range is greater than the turning threshold , it is considered that the motion pattern of this sub-trajectory is the turning pattern. Set the turning threshold . If within a certain time range the sum of the direction changes of a certain sub-trajectory is less than , it is considered that the motion pattern of this sub-trajectory is the straight navigation pattern. For the three navigation states of staying, turning, and going straight, set the corresponding judgment thresholds and judgment conditions for speed, heading, time, etc., and use the sliding window algorithm to judge and extract the ship motion sub-trajectories and put them into different datasets.

[0057] Step 3: Ship navigation area recognition by fusing the CLIQUE (Clustering In QUEst) grid clustering and the concave hull algorithm. Use the CLIQUE grid clustering algorithm to cluster the position information of the trajectory segments corresponding to different ship behavior patterns to extract the navigation areas corresponding to different behavior patterns.

[0058] First, divide the data space. Input the parameter , divide each dimension of the space S where the ship trajectory segment data is located into the same number of intervals, that is, divide the entire space into non-overlapping rectangular cells, and each such rectangular cell can be described as .

[0059] Next, identify the clusters. Use the depth-first algorithm to discover the clusters in the space. Start from a dense cell in the space , find all the cells connected to it, and mark them with the serial number 1, indicating that they are the first ones to be traversed, then randomly select an unmarked dense cell to continue the exploration, and number them in ascending order according to the previous serial number until all the dense cells in are searched and all have their own numbers. After the traversal is completed, the largest set of connected dense cells is defined as a cluster.

[0060] Finally, generate a minimized description for each cluster. For each cluster, first use the greedy algorithm to find the maximum covering area, that is, greedily cover the cluster with the largest number of rectangles, and then remove the smallest number of redundant maximum space areas from the existing maximum covering until there are no redundant maximum dense areas, and then the minimum covering of each cluster can be determined, and the clustering is completed.

[0061] After completing the clustering of trajectory segment data of different behavior patterns, the concave hull algorithm (Alpha-Shape) is used to extract the boundary of the navigation area. The waters where most ships are basically clustered when in the same behavior pattern are determined as the ship navigation area. For the areas where only a small number of ships are sporadically distributed, the data of the ships corresponding to these areas are defined as the data of ships with abnormal positions.

[0062] Step 4: Redefine the ship behavior abnormal data using the Isolation Forest algorithm. Based on the grid divided by the CLIQUE algorithm, for grids with a data volume greater than 1000, the Isolation Forest algorithm is used to detect the outliers in each grid, and the outliers are defined as abnormal data. Select the longitude, latitude, and speed in the straight navigation mode, the longitude, latitude, and angular velocity in the turning mode, and the longitude and latitude in the staying mode as data objects, and use the Isolation Forest algorithm to detect outliers.

[0063] First: Build an Isolation Tree (iTree). Let the AIS data set be , which consists of n data points, that is , . Let the feature set of the data set be , which consists of d features, then , . According to the sub-data set build an Isolation Tree iTree, take the random value as the root node, and based on the feature value , traverse the sub-data set . If , put in the left child node of the parent node; if put in the right child node of the parent node.

[0064] Next: Calculate the path length. The path length of the AIS data is defined as Traverse the iTree from the root node until reaching the external node. The total number of edges passed during the traversal is the path length of the AIS data x. The calculation formula is as follows:

[0065] where is the number of edges passed by the sample from the root node to the leaf node of the tree, that is, the number of splits. T.size represents the tree and the sample The number of samples in the same leaf node. C(T.size) represents the average path length of constructing a binary tree with T.size samples. The calculation formula is as follows:

[0066] Among them, 0.5772156649 is the Euler constant.

[0067] Finally: Calculate the anomaly score. The anomaly score is calculated based on the path length of the data in the iTree. Normalization processing is performed in the solution of the anomaly score, and the anomaly score ranges from 0 to 1. The higher the anomaly score, the more likely it is to be abnormal data. The anomaly score is defined as follows:

[0068] In the formula, is the average value in the set .

[0069] When , , that is, when the average path length of the sample is close to the average path length of the tree, it cannot be determined whether the AIS data is abnormal.

[0070] When , , that is , when the anomaly score of

[0071] When , , it is determined that the AIS data is normal.

[0072] Step 5: Use the sliding window algorithm to define the abnormal behavior trajectory segment of the ship. Using the sliding window algorithm, set the window threshold. Only when the number of abnormal data in a sub-trajectory with no less than 5 trajectory points is greater than or equal to the set threshold of 3 can the current behavior of the ship be defined as abnormal. The abnormal behavior trajectory segment of the ship is as Figure 6 shown.

[0073] Step 6: Ship motion feature parameter extraction and dimensionality reduction. The spatio-temporal motion features that are partially the same under different ship behavior patterns and the spatio-temporal motion features unique to specific behavior patterns are defined as ship similarity features and ship difference features respectively. Ship similarity features include the spatial distance, speed, heading, turning angle, bow direction, angular velocity, time difference, acceleration, maximum, minimum, median, mean, standard deviation, variance of curvature between each sub-trajectory point of the ship, as well as the variance and standard deviation of longitude and latitude, a total of 58; ship difference features include the stay center, error radius, straight-ahead average direction, straight-ahead speed standard deviation, straight-ahead acceleration, turning equivalent center, turning equivalent radius, and turning speed, a total of 8. Extract the ship similarity and difference motion feature parameters respectively. Then, use the principal component analysis method for the ship motion feature parameters to extract the principal components of the feature parameters that affect the identification of abnormal ship behaviors.

[0074] Construct a data matrix from the extracted ship motion feature parameters :

[0075] Among them, is the observed value of the th sample for the th index .

[0076] First, standardize the ship motion feature parameters using the function. The function is as follows:

[0077] Among them is the standardization result is the data of the sample is the mean of the column where is the standard deviation of the column where

[0078] Then, calculate the correlation coefficient matrix of the data matrix .

[0079]

[0080] Next, let the characteristic equation and calculate the eigenvalues and eigenvectors .

[0081] Finally, calculate the contribution rate and cumulative contribution rate of the principal components . Use the principal components with a cumulative contribution rate reaching 85%.

[0082] The contribution rate of the principal component is and its calculation formula is as follows:

[0083] The cumulative contribution rate of the first m principal components is and the calculation formula is as follows:

[0084] Step 7: Train a ship abnormal behavior recognition model based on LightGBM. The algorithm process of LightGBM is as Figure 7 shown. After extracting the principal components of the feature parameters corresponding to the three behavior patterns, input the feature parameters corresponding to the three behavior patterns into LightGBM for training the abnormal behavior recognition models corresponding to the respective behavior patterns, namely the straight - sailing mode abnormal behavior recognition model, the turning mode abnormal behavior recognition model, and the staying mode abnormal behavior recognition model, according to the ratio of 80% for the training set and 20% for the test set, and select accuracy, recall rate, and F1 - score as evaluation indicators.

[0085] In summary, the method provided by the present invention effectively defines the ship abnormal behavior trajectory segments by integrating the CLIQUE grid clustering and the isolation forest algorithm, significantly improving the efficiency and accuracy of ship monitoring. Using the LightGBM algorithm, this method can train the abnormal behavior recognition models for the three behavior patterns of straight - sailing, turning, and staying respectively. Compared with traditional methods, it has better classification performance and lower time complexity, realizing real - time monitoring and early warning of ship abnormal behaviors. This method not only saves human resources but also provides a discrimination basis for decision - makers in complex situations, helping to reduce the incidence of ship accidents, improve the efficiency of ship transportation operations, and ensure the safety of ship navigation. In addition, the emergence of this method also brings new development opportunities to the fields of marine transportation and ship management, having important practical value and social significance.

[0086] In some embodiments, as Figure 8 shown, the present invention also provides a method for recognizing ship abnormal behaviors, including: S801. Input the data to be measured of the Automatic Identification System (AIS) of the ship into the ship abnormal behavior recognition model obtained by the above - mentioned method to obtain the ship abnormal behavior recognition result.

[0087] It can be understood that the data to be measured of the Automatic Identification System (AIS) of the ship can be the corresponding pre - processed data to be measured obtained after pre - processing the original data to be detected by the Automatic Identification System (AIS) of the ship according to the above steps, and then input the pre - processed data to be measured into the ship abnormal behavior recognition model.

[0088] As Figure 9As shown in the figure, the present invention also provides a generating device 900 for a ship abnormal behavior recognition model, including: A clustering module 901, configured to determine ship behavior patterns based on the original data of the Automatic Identification System (AIS) of ships, and cluster the position information of the trajectory segments corresponding to each ship behavior pattern to extract the ship navigation areas corresponding to each ship behavior pattern; the ship behavior patterns include straight sailing, turning, and staying; An abnormal data determination module 902, configured to determine ship behavior abnormal data based on the ship navigation areas corresponding to each ship behavior pattern; A feature determination module 903, configured to determine ship similarity features and ship difference features under different ship behavior patterns based on the ship behavior abnormal data; A model training module 904, configured to train a LightGBM model based on the ship similarity features and the ship difference features to obtain a ship abnormal behavior recognition model.

[0089] The generating device for the ship abnormal behavior recognition model provided in the above embodiment can implement the technical solutions described in the above method embodiment for generating the ship abnormal behavior recognition model. The specific implementation principles of the above modules or units can be referred to the corresponding content in the above method embodiment for generating the ship abnormal behavior recognition model, and will not be elaborated here.

[0090] As Figure 10 shown in the figure, the present invention also correspondingly provides an electronic device 1000. The electronic device 1000 includes a processor 1001, a memory 1002, and a display 1003. Figure 10 Only some components of the electronic device 1000 are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.

[0091] The memory 1002 may be an internal storage unit of the electronic device 1000 in some embodiments, such as the hard disk or memory of the electronic device 1000. The memory 1002 may also be an external storage device of the electronic device 1000 in other embodiments, such as a plug-in hard disk equipped on the electronic device 1000, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc.

[0092] Furthermore, the memory 1002 may also include both the internal storage unit and the external storage device of the electronic device 1000. The memory 1002 is used to store the application software installed on the electronic device 1000 and various types of data.

[0093] In some embodiments, the processor 1001 may be a central processing unit (CPU), a microprocessor, or other data processing chips, which are used to run the program code stored in the memory 1002 or process data, such as the method for generating a ship abnormal behavior recognition model in the present invention.

[0094] In some embodiments, the display 1003 may be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) toucher, etc. The display 1003 is used to display the information of the electronic device 1000 and to display a visual user interface. The components 1001-1003 of the electronic device 1000 communicate with each other through the system bus.

[0095] In some embodiments of the present invention, when the processor 1001 executes the program for generating the ship abnormal behavior recognition model in the memory 1002, the following steps can be implemented: Based on the original data of the Automatic Identification System (AIS) of ships, determine the ship behavior patterns, and cluster the position information of the trajectory segments corresponding to each ship behavior pattern to extract the ship navigation areas corresponding to each ship behavior pattern; the ship behavior patterns include straight sailing, turning, and staying; Based on the ship navigation areas corresponding to each ship behavior pattern, determine the ship abnormal behavior data; Based on the ship abnormal behavior data, determine the ship similarity features and ship difference features under different ship behavior patterns; Train a LightGBM model based on the ship similarity features and the ship difference features to obtain a ship abnormal behavior recognition model.

[0096] It should be understood that when the processor 1001 executes the program for generating the ship abnormal behavior recognition model in the memory 1002, in addition to the above functions, other functions can also be implemented. For specific details, please refer to the description of the corresponding method embodiments above.

[0097] Further, the embodiments of the present invention do not specifically limit the type of the mentioned electronic device 1000. The electronic device 1000 can be a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop, or other portable electronic devices. Exemplary embodiments of the portable electronic device include, but are not limited to, portable electronic devices equipped with IOS, android, microsoft, or other operating systems. The above portable electronic devices can also be other portable electronic devices, such as a laptop with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 1000 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0098] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it is used to implement the method for generating a ship abnormal behavior recognition model provided by the above-mentioned various methods. The method includes: Based on the original data of the Automatic Identification System (AIS) of ships, determine the ship behavior patterns, and cluster the trajectory segment position information corresponding to each ship behavior pattern to extract the ship navigation areas corresponding to each ship behavior pattern; the ship behavior patterns include straight sailing, turning, and staying; Based on the ship navigation areas corresponding to each ship behavior pattern, determine the ship behavior abnormal data; Based on the ship behavior abnormal data, determine the ship similarity features and ship difference features under different ship behavior patterns; Based on the ship similarity features and the ship difference features, train a LightGBM model to obtain a ship abnormal behavior recognition model.

[0099] Those skilled in the art can understand that all or part of the processes of implementing the methods of the above embodiments can be completed by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium is a magnetic disk, an optical disk, a read-only memory, or a random access memory, etc.

[0100] The above has introduced in detail the method and device for generating a ship abnormal behavior recognition model provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A method for generating a ship abnormal behavior recognition model, characterized in that: include: Based on the original data of the ship automatic identification system, the ship behavior pattern is determined, and the trajectory segment position information corresponding to each ship behavior pattern is clustered to extract the ship navigation area corresponding to each ship behavior pattern; the ship behavior pattern includes straight sailing, turning and staying; Determine abnormal ship behavior data based on the ship navigation area corresponding to each ship behavior pattern; Based on the abnormal ship behavior data, determining ship similarity characteristics and ship difference characteristics under different ship behavior modes; The LightGBM model is trained based on the ship similarity features and the ship difference features to obtain a ship abnormal behavior recognition model.

2. The method for generating a ship abnormal behavior recognition model according to claim 1, characterized in that: Based on the raw data from the ship's automatic identification system, determine the ship's behavior pattern, including: Deleting duplicate data from the original data of the ship automatic identification system to obtain first data; Merging the static data table and the dynamic data table in the first data to obtain second data; Filtering the ship data within the target area from the second data, sorting the ship data within the target area according to the MMSI number, and sorting the ships with the same MMSI number as sorting objects according to the positioning time to obtain preprocessed data; Based on the pre-processed data, a vessel behavior pattern is determined.

3. The method for generating a ship abnormal behavior recognition model according to claim 2, characterized in that: The preprocessed data includes: the total displacement distance of the ship's trajectory in the first state, the sum of the direction changes of the ship's trajectory points within the first target time range, and the sum of the direction changes of the ship's trajectory points within the second target time range; The first state is a state corresponding to a time period when the ship's speed is less than a first speed threshold and the duration is greater than a first time threshold; Based on the pre-processed data, determining a ship behavior pattern includes: When the total displacement distance of the trajectory of the ship in the first state is less than the first distance threshold, determining that the ship behavior mode is a stay mode; When the sum of the direction changes of the ship's trajectory points within the first target time range is greater than the first target turning threshold, determining that the ship's behavior mode is a turning mode; When the sum of the direction changes of the ship's trajectory points within the second target time range is less than the second target turning threshold, the ship behavior mode is determined to be the straight sailing mode.

4. The method for generating a ship abnormal behavior recognition model according to claim 1, characterized in that: Clustering the track segment position information corresponding to the ship behavior pattern to extract the ship navigation area corresponding to each ship behavior pattern includes: Dividing the data space for the track segment position information corresponding to the ship behavior pattern; Clustering the trajectory segment data in the divided data space; The navigation area boundary is extracted from the clustering results based on the concave hull algorithm to obtain the ship navigation area corresponding to each ship behavior pattern.

5. The method for generating a ship abnormal behavior recognition model according to claim 4, characterized in that: Clustering the trajectory segment data in the divided data space includes: Determine the maximum set of dense units connected by trajectory segment data in the divided data space as a cluster; The maximum coverage area of ​​each cluster is determined based on the greedy algorithm, and the minimum coverage area of ​​each cluster is determined from the maximum coverage area. Based on the minimum coverage area of ​​each cluster, the clustering result is obtained.

6. The method for generating a ship abnormal behavior recognition model according to claim 1, characterized in that: Based on the ship navigation area corresponding to each ship behavior pattern, determine the abnormal ship behavior data, including: The isolation forest algorithm is used to divide the ship navigation area corresponding to each ship behavior pattern into grids; The outliers in the grid whose data volume is greater than the target quantity threshold are identified as abnormal ship behavior data.

7. The method for generating a ship abnormal behavior recognition model according to claim 6, characterized in that: The outliers in the grid whose data volume is greater than the target quantity threshold are determined as abnormal ship behavior data, including: Based on the data points in the grid whose data volume is greater than the target number threshold, an isolation tree is constructed; Traversing the isolation tree to determine the path length of data points in the grid whose data volume is greater than a target quantity threshold; Based on the path length, outliers in the grid whose data volume is greater than a target quantity threshold are determined, and the outliers are determined to be abnormal ship behavior data.

8. The method for generating a ship abnormal behavior recognition model according to any one of claims 1 to 7, characterized in that: Based on the abnormal ship behavior data, ship similarity characteristics and ship difference characteristics under different ship behavior modes are determined, including: Based on the abnormal ship behavior data, determining ship motion characteristic parameters under different behavior modes; The principal component analysis method is used to determine the principal component cumulative contribution rate corresponding to the ship motion characteristic parameters under different behavior modes; Based on the cumulative contribution rate of the principal components, determining the principal components of characteristic parameters that affect the identification of abnormal ship behavior; Based on the characteristic parameter principal components, the same ship motion characteristic parameters in different behavior modes are determined as ship similarity characteristics, and the unique ship motion characteristic parameters in a specific behavior mode are determined as ship difference characteristics.

9. A method for identifying abnormal behavior of a ship, characterized in that: include: The test data of the ship automatic identification system is input into the ship abnormal behavior recognition model obtained by the method described in any one of claims 1 to 8 to obtain the ship abnormal behavior recognition result.

10. A device for generating a ship abnormal behavior recognition model, characterized in that: include: A clustering module is used to determine the ship behavior pattern based on the original data of the ship automatic identification system, and cluster the trajectory segment position information corresponding to each ship behavior pattern to extract the ship navigation area corresponding to each ship behavior pattern; the ship behavior pattern includes straight sailing, turning and staying; An abnormal data determination module, used to determine abnormal ship behavior data based on the ship navigation area corresponding to each ship behavior pattern; A feature determination module, used to determine ship similarity features and ship difference features under different ship behavior modes based on the abnormal ship behavior data; The model training module is used to train the LightGBM model based on the ship similarity features and the ship difference features to obtain a ship abnormal behavior recognition model.

Citation Information

Cited By

  • Ship abnormal behavior determination method and device, storage medium and electronic equipment

    CN121260045A