Two-ship meeting state intelligent identification method based on machine learning
By extracting and analyzing AIS data features and building an intelligent recognition model based on machine learning, the existing technology will solve the problem of insufficient recognition parameter sensitivity and dynamic information processing that ships encounter in big data environments, and improve the recognition accuracy and navigation safety.
Patent Information
- Application Number
- CN202411619000.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-02-28
AI Technical Summary
In the process of big data environment, the existing technology has problems of parameter sensitivity and insufficient dynamic information processing when ships encounter identification in big data environments, and it is impossible to accurately capture complex motion relationships, especially in multiple ship encounter scenarios.
By performing feature extraction and analysis on AIS data, an intelligent recognition model based on machine learning is constructed, and Bayesian filtering and random forest algorithm are used to train the model to identify the navigation behavior of ships in different encounter states.
It improves the recognition accuracy and decision-making efficiency of ship encounter status, enhances navigation safety, and provides new technical means for maritime traffic management.
Smart Images

Figure CN119538113A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and in particular to a method for intelligently identifying the encounter state of two ships based on machine learning. Background Art
[0002] At present, the global industry is moving towards informatization and intelligence, and the world has entered the fourth industrial revolution. With the rapid development of the global shipping industry, ship traffic is increasing, and ships are also showing the development advantages of large-scale, fast, intelligent and unmanned. Driven by the new generation of information technology such as artificial intelligence, the shipping industry is facing unprecedented transformation opportunities and challenges. With the development of artificial intelligence, smart ships and unmanned ships have become important directions for future maritime traffic management. As an important carrier and symbol of the digital intelligent transformation of the shipping industry, smart ships are a new engine to promote the high-quality development of the shipping industry.
[0003] Whether in coastal, port or inland waters, ships will face complex encounter situations, especially in converging waters with high traffic density and complex situations, where ship traffic faces high navigation and collision risks. In order to reduce the huge loss of life and property and marine environmental pollution caused by water traffic accidents, avoiding ship collisions is a vital task for ship driving, and automatic collision avoidance is an indispensable capability for smart ships.
[0004] Ship encounter situations include two-ship encounters and multiple-ship encounters. In navigation practice, when faced with a multiple-ship encounter situation, the usual practice is to break it down into two-ship encounter situations one by one according to the degree of urgency for handling. Therefore, the two-ship encounter is the most basic and important situation that needs to be handled when ships avoid collisions. The two-ship encounter situation is a meeting situation formed when ships approach each other from different directions during navigation, which is generally divided into a head-on encounter situation, a crossing situation, and an overtaking situation. Smart ships need to have highly intelligent autonomous navigation and collision avoidance capabilities. When navigating in a complex maritime traffic environment, they must be able to promptly and accurately identify and judge the ship encounter status, including overtaking, crossing, and head-on encounters, and respond to the encounter status in a very short time to take autonomous collision avoidance measures to ensure navigation safety.
[0005] In recent years, the Automatic Identification System (AIS) has been widely used in maritime traffic control and monitoring. AIS is an automatic reporting system for ships that can provide real-time dynamic information of ships, such as position, speed, heading, ship name and call sign. This information is transmitted through VHF radio frequency and can be received by other ships and coastal stations, thereby realizing information sharing and tracking management between ships. AIS is an important data basis for ships to judge the encounter situation. Through AIS, information such as the distance between two ships, relative speed and relative heading can be calculated, which is an indispensable means for ships in practice. At the same time, the various information contained in the accumulated AIS historical data also contains the spatiotemporal distribution of ship behavior patterns, ship maneuvering behavior characteristics, ship traffic flow characteristics and ship customary route distribution characteristics. These AIS data are an important basis for studying and analyzing ship encounter situations. Combining AIS historical data and machine learning methods, an intelligent recognition model for ship encounter status can be trained to assist ship collision avoidance operations or directly used for intelligent collision avoidance of smart ships.
[0006] Existing ship encounter schemes, such as the ship encounter recognition model based on improved DBSCAN, proposes an improved density clustering algorithm (DBSCAN) for ship encounter recognition, aiming to solve the problems of low efficiency and misjudgment of traditional methods in a big data environment. However, this scheme has problems such as parameter sensitivity (if the threshold of the improved DBSCAN algorithm is not properly selected, a large number of ships may be mistakenly identified as noise points, or the number of ships in the same encounter situation may be too large, resulting in poor recognition effect) and insufficient dynamic information processing (unable to accurately capture the complex motion relationship between ships, especially in complex scenarios of multiple ship encounters). For another example, in the actual distribution of specific ship encounters based on AIS, an algorithm based on massive AIS data combined with maritime traffic engineering theory is proposed, aiming to intuitively reflect the behavioral characteristics and laws of ships by drawing the encounter information of specific ships. However, this scheme has problems such as limited scope of application of the algorithm, over-reliance on AIS data quality, and limited instance verification. Summary of the invention
[0007] In view of this, the present invention discloses a method for intelligently identifying the encounter state of two ships based on machine learning. The method extracts and analyzes features of AIS data to construct an intelligent recognition model and training method based on machine learning. The trained model can intelligently identify the navigation behaviors of ships in different encounter states such as overtaking, crossing and encountering, which can improve the recognition accuracy and decision-making efficiency, thereby assisting subsequent ship collision avoidance and enhancing navigation safety. The present invention will provide new technical means for ship navigation safety and maritime traffic management, and promote the development of intelligent shipping.
[0008] To this end, the present invention provides the following technical solutions:
[0009] The present invention provides a method for intelligently identifying the encounter state of two ships based on machine learning, comprising:
[0010] Collect and preprocess AIS data; use a sliding window to filter the preprocessed AIS data based on each ship trajectory to form an initial ship encounter data set; calculate feature parameters based on the initial ship encounter data set, and generate an encounter recognition data set through the feature parameters;
[0011] The encounter data set is supplemented with an artificially designed two-ship encounter data set; the artificially designed two-ship encounter data set includes: generating AIS data of other ships under different circumstances according to predefined encounter types and relative azimuth ranges; slightly perturbing the position, speed, and heading of the center ship and combining them with randomly generated other ship data;
[0012] Constructing a ship encounter state recognition model, and using the supplemented encounter data set to train the ship encounter state recognition model; constructing the ship encounter state recognition model, including: using Bayesian filtering to smooth the data, and combining a random forest algorithm to form a ship encounter state recognition model;
[0013] The trained ship encounter state recognition model is used to identify the encounter state of the two ships' dynamic data.
[0014] Furthermore, AIS data is collected and preprocessed, including:
[0015] Perform missing value detection on AIS data and delete data that does not meet the requirements;
[0016] All ships are grouped according to their MMSI, and each ship is divided into voyages according to whether the UTC time interval is greater than 90s;
[0017] For AIS data that have completed voyage division, the isolation forest method is used to detect outliers in longitude, latitude, speed and heading, and the data that does not meet the conditions is deleted;
[0018] The cubic spline interpolation method is used to interpolate the AIS data at preset time intervals to complete data preprocessing.
[0019] Furthermore, the sliding window concept is used to filter each ship trajectory, including:
[0020] Read the pre-processed AIS data and arrange all the ship data in chronological order from small to large;
[0021] Extract the first row of data, use the current row of data as the anchor row to draw a sliding window, build a circle with a radius of 2 nautical miles with the longitude and latitude information of the data row as the center, and record the MMSI value and UTC value of the data row;
[0022] Use the current time step as the index to build a dictionary, automatically traverse all rows in the file and compare them with the anchor row, and add the data rows that meet the conditions to the current time step data;
[0023] The time step increases by one step, and the next row of data of the anchor row is extracted as the anchor row, and the above steps are repeated;
[0024] If the MMSI of the current row is not equal to anchor_MMSI, the current dictionary is output and the time step is cleared to zero; this process is repeated until the last row of the file becomes the anchor row.
[0025] Furthermore, the added row should satisfy the following three points at the same time:
[0026] The MMSI value is not equal to anchor_MMSI;
[0027] The geographical location identified by the longitude and latitude is within the constructed circle;
[0028] UTC values are in the range of anchor_UTC+10.
[0029] Further, characteristic parameters are calculated based on the initial ship encounter data set, and an encounter recognition data set is generated by the characteristic parameters, including:
[0030] According to the longitude, latitude, speed and heading in AIS, the ship encounter status parameters are calculated and the labels of ship encounter status types are automatically generated, so as to form a complete ship encounter feature data set; the feature parameters include: the closest encounter time, the closest encounter distance and the relative azimuth; the ship encounter types include encounter, crossing and overtaking.
[0031] Furthermore, the artificially designed two-ship encounter dataset includes:
[0032] Using the center ship in the real AIS data as a reference, slightly random perturb its longitude, latitude, speed and heading to simulate the uncertainty in reality;
[0033] According to the defined types of encounter features and the corresponding relative azimuth ranges, simulated AIS data is generated in all directions with a difference of 0.1° over 360°.
[0034] For each time frame, the generated other ship data include the distance relative to the center ship, the relative azimuth RB, the calculated relative speed RS, the minimum encounter distance DCPA and the shortest encounter time TCPA;
[0035] When generating these data, the generated data needs to be checked. If the calculated TCPA is less than or equal to zero, the data of the ship is skipped and regenerated.
[0036] Furthermore, a ship encounter state recognition model is constructed, including:
[0037] The supplemented encounter dataset is randomly divided into training set and test set, and the training samples are input into each decision tree for training with replacement;
[0038] Each decision tree builds a classification model by learning the features of longitude, latitude, speed and heading input in the ship encounter recognition dataset and the ship encounter label;
[0039] After all decision trees are constructed, the ship encounter status data to be identified is input into each decision tree classifier, and each decision tree makes a ship encounter status judgment based on the input features;
[0040] The identification and classification results of each decision tree are integrated through a voting mechanism, and the classification result with the most votes is the final ship encounter status identification result;
[0041] Compare the final recognition results with the true labels of the test set and calculate the recognition accuracy of the encounter state intelligent recognition model;
[0042] In the data processing stage, Bayesian filtering dynamically combines prior information with observation data through prediction and update steps to smooth the longitude, latitude, speed and heading data of each ship, thereby effectively reducing the impact of noise on the model.
[0043] Furthermore, in the training process of the ship encounter state recognition model, grid search is used to adjust parameters, and the parameters include the number of decision trees, the maximum depth, the minimum number of sample splits, the minimum number of sample leaves, and whether to use bootstrap; after the grid search is completed, the best parameter combination is selected for training.
[0044] Advantages and positive effects of the present invention:
[0045] 1) By extracting and analyzing massive amounts of historical AIS ship data, this solution can fully tap into the potential patterns and rules in the data, learn the ability to identify encounter situations, and provide data support and decision-making basis for ship collision avoidance and navigation safety. Moreover, with the increase of training data, the accuracy of the recognition model can be further improved.
[0046] 2) This scheme adopts a self-supervised training method and proposes a method for manually generating ship encounter training data sets and automatically generating them based on AIS, which avoids the labor-intensive data labeling work, can greatly expand the scale of the data set, and improve the feasibility, efficiency, and accuracy of ship encounter status recognition model training.
[0047] 3) Compared with the traditional method of directly calculating the encounter situation based on AIS data, this scheme can make full use of the advantages of machine learning models, avoid explicit coding, and is easier to further expand other capabilities such as hazard identification, difficulty identification, and ship maneuvering suggestions. It is also conducive to integrating into a more complete and powerful end-to-end ship intelligent collision avoidance model, promoting the improvement of ship autonomous navigation capabilities. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0049] Figure 1 It is a flow chart of a method for intelligently identifying the encounter status of two ships based on machine learning in the implementation of the present invention;
[0050] Figure 2 It is a schematic diagram of the encounter state in the implementation of the present invention;
[0051] Figure 3 It is a schematic diagram of the left crossing state in the implementation of the present invention;
[0052] Figure 4 It is a schematic diagram of the right crossing state in the implementation of the present invention;
[0053] Figure 5 It is a schematic diagram of the overtaking state in the implementation of the present invention;
[0054] Figure 6 A schematic diagram of a ship encounter characteristic data segment in the implementation of the present invention;
[0055] Figure 7 It is a schematic diagram of the structure of the ship encounter status recognition model in the implementation of the present invention. DETAILED DESCRIPTION
[0056] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0057] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0058] The encounters between ships during navigation are becoming more and more frequent. The encounters between two ships mainly include head-on encounters, crossings and overtaking. If these situations are not handled properly, they may lead to collision accidents and threaten the safety of ships and personnel. For intelligent navigation systems and intelligent ships, the ability to accurately identify different encounter situations is of great significance to ship safety and efficient navigation. In order to correctly identify the encounter status, the present invention provides an intelligent recognition method for the encounter status of two ships based on machine learning. By performing in-depth feature extraction and analysis on AIS data, the potential laws in AIS data are excavated, and combined with machine learning algorithms, the accuracy and real-time performance of recognition are improved, and strong support is provided for ship collision avoidance decision-making, thereby improving navigation safety.
[0059] In order to realize the intelligent recognition of the encounter status of two ships, the basic idea of the present invention is: first collect AIS data, pre-process the collected AIS data, then calculate and extract the encounter features of the AIS data, build a data set for ship encounter status recognition, and finally select a machine learning model for training and evaluation, and finally complete the recognition of the ship encounter status.
[0060] Specifically, Figure 1 As shown, a method for intelligently identifying the encounter status of two ships based on machine learning in an embodiment of the present invention includes the following steps:
[0061] S1. Collect and preprocess AIS data;
[0062] Due to the large number of ships, too many AIS devices broadcasting at the same time will cause incomplete data reception. In addition, environmental factors may cause AIS data errors and anomalies. Under different navigation conditions, the frequency of AIS information broadcast varies (2s-30s), which makes the time interval of AIS data uneven and cannot reasonably express the laws of ship movement.
[0063] First, data is screened according to the geographical scope of the AIS data. Since the AIS data of each ship are not all data from a complete voyage but are in the form of multiple tracks, different voyages of the same ship need to be divided. Before division, the AIS data needs to be detected for missing values and data that does not meet the conditions is deleted. In the embodiment of the present invention, all ships are grouped according to MMSI, and each ship is divided into voyages according to whether the UTC time interval is greater than 90s. For the AIS data that has completed the voyage division, the isolation forest method is used to detect outliers on longitude, latitude, speed and heading, and delete data that does not meet the conditions. In the embodiment of the present invention, the cubic spline interpolation method is used to interpolate the AIS data at intervals of 10s to complete data preprocessing.
[0064] S2, calculate the AIS data encounter characteristics;
[0065] In the embodiment of the present invention, the sliding window concept is adopted to filter the trajectory of each ship. First, the preprocessed AIS data is read, and all the ship data are arranged in chronological order from small to large. Secondly, the first row of data is extracted, and the sliding window is drawn with the currently taken data row as the anchor row. A circle with a radius of 2 nautical miles is constructed with the longitude and latitude information of the data row as the center, and the MMSI value (anchor_MMSI) and UTC value (anchor_UTC) of the row of data are recorded. A dictionary is constructed with the current time step as the index, and all rows in the file are automatically traversed and compared with the anchor row, and the qualified data rows are added to the current time step data. The added row should meet the following three points at the same time:
[0066] The MMSI value is not equal to anchor_MMSI;
[0067] The geographical location identified by the longitude and latitude is within the constructed circle;
[0068] UTC values are in the range of anchor_UTC+10.
[0069] The time step increases by one step, and the next line of data of the anchor line is extracted as the anchor line, and the above steps are repeated. If the MMSI of the current line is not equal to anchor_MMSI, the current dictionary is output and the time step is cleared to zero. This process is repeated until the last line of the file becomes the anchor line.
[0070] S3, based on the encounter characteristics of AIS data, the encounter dataset is constructed using a self-supervisory approach;
[0071] After completing the screening of ship interaction data, a preliminary ship encounter data set has been formed. The next step is to calculate the parameters required for the encounter status based on the longitude, latitude, speed and heading in the AIS to automatically create the encounter status label.
[0072] First, in order to incorporate the ship encounter status into each AIS data sequence, the required characteristic parameters need to be calculated according to the changes in the ship motion status (relative distance, relative speed, TCPA and DCPA).
[0073] The relative distance (RD) between two ships can be calculated using the formula:
[0074]
[0075] Among them, p1 is the center ship, p2 is the target ship, is the center ship latitude, is the center ship longitude, is the target ship's latitude, is the longitude of the target ship.
[0076] Calculate the relative speed (RS) using the following formula:
[0077]
[0078] in, and are the speeds of the center ship and the target ship, and are the headings of the center ship and the target ship respectively.
[0079] Calculate the closest encounter time (T cpa ) is calculated using the following formula:
[0080]
[0081] Calculate the closest encounter distance (D cpa ) is calculated using the following formula:
[0082]
[0083] The relative azimuth (RB) can be calculated using the following formula:
[0084]
[0085] The output angle range should be -180°, 180°. If RB is less than 0, add 360°.
[0086] Based on the characteristic parameters calculated above, the types of ship encounters include head-on encounter, crossing and overtaking:
[0087] If the relative bearing RB is within the range of [355°, 360°] or [0°, 5°], and the heading difference ΔC is within the range of [174°, 186°], D cpa <2,T cpa >0 is considered as an encounter state.
[0088] If the relative bearing RB is within the range of [247.5°, 355°], D cpa <2,T cpa >0 is considered as left crossing state.
[0089] If the relative bearing RB is within the range of [5°,112.5°], D cpa <2,T cpa >0 is considered as right crossing state.
[0090] If the relative orientation RB is [112.5°, 247.5°], D cpa <2,T cpa >0 is considered as overtaking state.
[0091] Through the above method, the ship encounter state parameters are calculated and the ship encounter state type labels are automatically generated, thereby forming a complete ship encounter feature data set, such as Figure 6 shown.
[0092] S4. Supplement the manually designed two-ship encounter dataset.
[0093] Real AIS data is often affected and limited by the navigation characteristics of ships in the data area. Ships with certain encounter states, such as cross-encounter feature types, account for the majority of ship encounter feature data sets. Therefore, if only real data sets are used for training, the model cannot learn all encounter features, which will affect the recognition effect of the intelligent model. On this basis, this scheme proposes a method for artificially generating ship encounter training data sets.
[0094] Firstly, the center ship in the real AIS data is used as a benchmark, and its longitude, latitude, speed and heading are slightly randomly perturbed to simulate the uncertainty in reality.
[0095] Secondly, according to the defined types of encounter features and the corresponding relative azimuth range, simulated AIS data are generated in 360° with a difference of 0.1°. For each time frame, the generated other ship data includes the distance (RD), relative azimuth (RB) and calculated relative speed (RS), minimum encounter distance (DCPA) and shortest encounter time (TCPA) relative to the center ship. When generating these data, the generated data needs to be checked. If the calculated TCPA is less than or equal to zero (which means that the other ship has passed or will not encounter the center ship), the data of the ship is skipped and regenerated.
[0096] This method generates simulated AIS data for analyzing the encounter situations of ships sailing at sea. The core of this method is to generate AIS data of other ships under different circumstances according to the predefined encounter types and relative azimuth ranges. The position, speed, and heading of the center ship are slightly disturbed and combined with randomly generated data of other ships. These data generated based on relative azimuth can provide a basis for studying the interaction between ships, especially providing diverse and representative sample data for the training of machine learning models.
[0097] S5. Construct a ship encounter status recognition model and improve the model.
[0098] The ship encounter training data set formed by the above method can be assigned to different machine learning methods for modeling and training ship encounter recognition models. These machine learning methods can usually be supervised learning, including random forest algorithm, SVM, neural network, etc. This scheme uses random forest as the basic model as an example to illustrate the intelligent recognition model of the encounter status of two ships.
[0099] Random forest is an ensemble learning algorithm that achieves classification or regression by combining multiple decision trees (CART). In this scheme, each decision tree randomly extracts a subset from the ship encounter status dataset during training, and randomly selects a feature subset for training at each node split. The specific construction process of the two-ship encounter status intelligent recognition model based on random forest in this scheme includes the following steps:
[0100] 1) Information gain:
[0101] For decision tree classification problems, select the feature that can maximize the information gain for node splitting. The calculation formula of information gain IG is:
[0102]
[0103] Where H(D) is the entropy of data set D, D v It is a data subset with value v on input feature A.
[0104] Random forest training and recognition process:
[0105] (1) The ship encounter recognition dataset is randomly divided into a training set and a test set, and the training samples are input into each decision tree for training with replacement;
[0106] (2) Each decision tree builds a classification model by learning the features of longitude, latitude, speed and heading input in the ship encounter recognition dataset and the ship encounter label;
[0107] (3) After all decision trees are constructed, the ship encounter status data to be identified is input into each decision tree classifier, and each decision tree makes a ship encounter status judgment based on the input features;
[0108] (4) The identification and classification results of each decision tree are integrated through a voting mechanism, and the classification result with the most votes is the final ship encounter status identification result;
[0109] (5) Compare the final recognition results with the true labels of the test set and calculate the recognition accuracy of the encounter state intelligent recognition model;
[0110] (6) Based on the recognition accuracy, running time, memory usage and other indicators, evaluate and adjust the parameters of the encounter state intelligent recognition model to optimize performance and accuracy. Figure 7 shown.
[0111] In addition to using the random forest algorithm, the embodiment of the present invention also introduces a Bayesian filter to smooth the data to further improve the performance of the model in ship encounter status recognition. In the data processing stage, the Bayesian filter dynamically combines the prior information with the observation data through the prediction and update steps to smooth the longitude, latitude, speed and heading data of each ship, thereby effectively reducing the impact of noise on the model. The core steps of Bayesian filtering include prediction and update:
[0112] 1) Prediction step: At each time step t, we predict the current state based on the state estimate and control input at the previous time step t-1. The prediction equation is as follows:
[0113]
[0114] in, is the state estimate at time t, A is the state transfer matrix, B is the control input matrix, and u t is the control input, is the state covariance matrix, and Q is the process noise covariance matrix. In the ship encounter state recognition, the prediction step estimates the position and motion state of the next moment through the previous longitude, latitude, speed and heading of the ship.
[0115] 2) Update step: After getting the predicted value, we update the state estimate with the current observation data to correct the error in the prediction. The update equation is as follows:
[0116]
[0117] Among them, K t is the Kalman gain, C is the observation matrix, R is the observation noise covariance matrix, z t is the observed value. is the updated state estimate, P t is the updated state covariance matrix. In the ship encounter state recognition, the update step uses the actual ship's longitude, latitude, speed and heading data at the current time step to correct the predicted value.
[0118] By introducing Bayesian filtering into the random forest algorithm and smoothing the data, not only the impact of noise on the model is reduced and data quality is improved, but also the robustness and prediction performance of the model in complex and uncertain environments are enhanced. By combining prior information and observation data through prediction and update steps, the data is dynamically smoothed, making the identification of ship encounter states more accurate and reliable.
[0119] S6. Conduct training on ship encounter status recognition.
[0120] In the encounter status dataset, the total AIS data volume is 26102757, the total number of labels is 10326661, and the training set and test set are divided into training set and test set according to the ratio of 8:2. The built model is put into training. During the training process, grid search is used to adjust the parameters, including the number of decision trees (n_estimators), maximum depth (max_depth), minimum number of sample splits (min_samples_split), minimum number of sample leaves (min_samples_leaf), whether to use bootstrap (bootstrap), etc. After the grid search is completed, the best parameter combination is selected for training to obtain better results.
[0121] S7. Use the intelligent model to identify the encounter status of the two ships' dynamic data.
[0122] 20% of the AIS data in the data set is used for testing, and 40% of the training set is artificially generated data. Experiments are conducted in the above data set, and NB (Naive Bayes), SVM (Support Vector Machine), KNN (K-Nearest Neighbors) are used to compare with the method proposed in this invention. Ours is the model of this solution. The results obtained by predicting the test set are shown in Table 1.
[0123] Table 1
[0124]
[0125] It can be seen that on the test set, the accuracy of the model proposed by the present invention reaches more than 98%, which is better than other models in the accuracy of encounter state recognition and can effectively improve the accuracy of the encounter state recognition problem.
[0126] In the above embodiments, a ship encounter recognition data set is innovatively produced. Key features such as ship position, speed, and heading are extracted from AIS data, and the relationship between them is explored to produce encounter status labels. A method for artificially generating a ship encounter training data set is invented, and AIS data is generated based on the encounter features. In the above embodiments, an improved machine learning model algorithm is also proposed, which uses a large amount of AIS data for training, explores the potential rules in the AIS data, and improves the recognition accuracy and robustness of the model by optimizing the model parameters.
[0127] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for intelligently identifying the encounter status of two ships based on machine learning, characterized in that: include: Collect and pre-process AIS data; For the pre-processed AIS data, a sliding window is used to screen each ship trajectory to form an initial ship encounter data set; characteristic parameters are calculated based on the initial ship encounter data set, and an encounter recognition data set is generated through the characteristic parameters; The encounter data set is supplemented with an artificially designed two-ship encounter data set; the artificially designed two-ship encounter data set includes: generating AIS data of other ships under different circumstances according to predefined encounter types and relative azimuth ranges; slightly perturbing the position, speed, and heading of the center ship and combining them with randomly generated other ship data; Constructing a ship encounter state recognition model, and using the supplemented encounter data set to train the ship encounter state recognition model; constructing the ship encounter state recognition model, including: using Bayesian filtering to smooth the data, and combining a random forest algorithm to form a ship encounter state recognition model; The trained ship encounter state recognition model is used to identify the encounter state of the two ships' dynamic data.
2. The method for intelligently identifying the encounter status of two ships based on machine learning according to claim 1 is characterized in that: Collect and pre-process AIS data, including: Perform missing value detection on AIS data and delete data that does not meet the requirements; All ships are grouped according to their MMSI, and each ship is divided into voyages according to whether the UTC time interval is greater than 90s; For AIS data that have completed voyage division, the isolation forest method is used to detect outliers in longitude, latitude, speed and heading, and the data that does not meet the conditions is deleted; The cubic spline interpolation method is used to interpolate the AIS data at preset time intervals to complete data preprocessing.
3. The method for intelligently identifying the encounter status of two ships based on machine learning according to claim 1 is characterized in that: The sliding window concept is used to filter each ship's trajectory, including: Read the pre-processed AIS data and arrange all the ship data in chronological order from small to large; Extract the first row of data, use the current row of data as the anchor row to draw a sliding window, build a circle with a radius of 2 nautical miles with the longitude and latitude information of the data row as the center, and record the MMSI value and UTC value of the data row; Build a dictionary with the current time step as the index, automatically traverse all rows in the file and compare them with the anchor row, and add the data rows that meet the conditions to the current time step data; The time step increases by one step, and the next row of data of the anchor row is extracted as the anchor row, and the above steps are repeated; If the MMSI of the current row is not equal to anchor_MMSI, the current dictionary is output and the time step is cleared to zero; this process is repeated until the last row of the file becomes the anchor row.
4. The method for intelligently identifying the encounter status of two ships based on machine learning according to claim 3 is characterized in that: The added row should meet the following three points at the same time: The MMSI value is not equal to anchor_MMSI; The geographical location identified by the longitude and latitude is within the constructed circle; UTC values are in the range of anchor_UTC+10.
5. The method for intelligently identifying the encounter status of two ships based on machine learning according to claim 1 is characterized in that: Calculating characteristic parameters based on the initial ship encounter data set, and generating an encounter identification data set through the characteristic parameters, including: According to the longitude, latitude, speed and heading in AIS, the ship encounter status parameters are calculated and the labels of ship encounter status types are automatically generated, so as to form a complete ship encounter feature data set; the feature parameters include: the closest encounter time, the closest encounter distance and the relative azimuth; the ship encounter types include encounter, crossing and overtaking.
6. The method for intelligently identifying the encounter status of two ships based on machine learning according to claim 1 is characterized in that: A manually designed two-ship encounter dataset, including: Using the center ship in the real AIS data as a reference, slightly random perturb its longitude, latitude, speed and heading to simulate the uncertainty in reality; According to the defined types of encounter features and the corresponding relative azimuth ranges, simulated AIS data is generated in all directions with a difference of 0.1° over 360°. For each time frame, the generated other ship data include the distance relative to the center ship, the relative azimuth RB, the calculated relative speed RS, the minimum encounter distance DCPA and the shortest encounter time TCPA; When generating these data, the generated data needs to be checked. If the calculated TCPA is less than or equal to zero, the data of the ship is skipped and regenerated.
7. The method for intelligently identifying the encounter status of two ships based on machine learning according to claim 1 is characterized in that: Construct a ship encounter status recognition model, including: The supplemented encounter dataset is randomly divided into training set and test set, and the training samples are input into each decision tree for training with replacement; Each decision tree builds a classification model by learning the features of longitude, latitude, speed and heading input in the ship encounter recognition dataset and the ship encounter label; After all decision trees are constructed, the ship encounter status data to be identified is input into each decision tree classifier, and each decision tree makes a ship encounter status judgment based on the input features; The identification and classification results of each decision tree are integrated through a voting mechanism, and the classification result with the most votes is the final ship encounter status identification result; Compare the final recognition results with the true labels of the test set and calculate the recognition accuracy of the encounter state intelligent recognition model; In the data processing stage, Bayesian filtering dynamically combines prior information with observation data through prediction and update steps to smooth the longitude, latitude, speed and heading data of each ship, thereby effectively reducing the impact of noise on the model.
8. The method for intelligently identifying the encounter status of two ships based on machine learning according to claim 1, characterized in that: During the training process of the ship encounter state recognition model, grid search is used to adjust parameters, including the number of decision trees, maximum depth, minimum sample segmentation number, minimum sample leaf number, and whether to use bootstrap; after the grid search is completed, the best parameter combination is selected for training.
Citation Information
Cited By
Intelligent decision-making method based on maritime collision avoidance rule
CN120823729A