Unmanned ship collision avoidance method and device based on DBSCAN algorithm
By using the DBSCAN algorithm and a six-degree of freedom ship motion model in the unmanned ship collision avoidance system, combining wind speed, current and captain driving information, the ship collision risk and collision avoidance behavior are solved, and the problems of inaccurate collision avoidance prediction and environmental factors in the existing technology are solved, and the collision avoidance ability and navigation safety of unmanned ships are improved.
Patent Information
- Application Number
- CN202411898767.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-04
AI Technical Summary
The existing unmanned ship collision avoidance methods When dealing with multiple ship encounters, DCPA and TCPA are not accurate enough, and environmental factors and ship handling performance are not fully considered, resulting in insufficient accuracy in the judgment of collision avoidance risks.
The unmanned ship collision avoidance method based on the DBSCAN algorithm is adopted. By collecting ship data, establishing a six-degree of freedom ship motion model, obtaining wind speed and current information, using AIS/radar to obtain the speed and position information of other ships, collecting the captain's driving information, establishing a ship driving model, and calculating the ship collision risk through the DBSCAN algorithm, and performing corresponding collision avoidance behaviors.
It has improved the collision avoidance ability of unmanned ships and has good generalization ability. It has generally improved the efficiency of unmanned ships to avoid collision safely on the water surface, and can more accurately judge and deal with the encounter situations of multiple ships.
Smart Images

Figure CN119763371A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of unmanned ship collision avoidance, and in particular to an unmanned ship collision avoidance method and device based on a DBSCAN algorithm. Background Art
[0002] There are two types of existing unmanned ship collision avoidance methods: one is the speed barrier-based collision avoidance method, which calculates the relative speed of the unmanned ship and the obstacle based on their ground speed, analyzes and determines the angular relationship between the relative speed and relative position of the two, obtains the feasible path range for collision avoidance, and completes the avoidance of obstacles by changing the direction of movement of the unmanned ship. This method has the advantage of simple logic, but it requires continuous judgment and calculation of the azimuth relationship between the unmanned ship and the obstacle; the second is to use the ship kinematic model, which determines whether there is a collision risk based on the size of the Collection Risk Index (CRI) between the two ships, and the degree of danger can be roughly determined based on the size of the CRI. This method is mostly limited to certain or a certain type of factors such as speed, encounter situation and other easily available data, and rarely considers uncertain factors such as the environment and the maneuverability of the unmanned ship. The existing unmanned ship collision avoidance risk judgment method is to calculate the distance to the closest point of approach (DCPA) and the time for the closest point of approach (TCPA). The DCPA and TCPA of this method are calculated based on the ideal situation that the ship maintains its current course and speed. In actual navigation, the ship may change its course and speed, which makes the predictions of DCPA and TCPA may not be accurate enough. In addition, in the case of multiple ship encounters, DCPA and TCPA mainly focus on the direct collision risk between two ships, without considering the complexity of multi-ship interaction. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide an unmanned ship collision avoidance method and device based on the DBSCAN algorithm, which improves the collision avoidance capability of the unmanned ship and has good generalization ability, thereby generally improving the efficiency of the unmanned ship in avoiding collisions and safely navigating on the water surface.
[0004] To achieve the above object, the present invention adopts the following technical solution: an unmanned ship collision avoidance method based on DBSCAN algorithm, comprising the following steps:
[0005] Step 1: Collect ship data and use neural network to train the six-degree-of-freedom ship motion model;
[0006] Step 2: Use a wind speed sensor to obtain wind speed, and use an ocean current sensor to obtain ocean current information;
[0007] Step 3: Use AIS / radar to obtain the speed and position information of other ships;
[0008] Step 4: Collect the captain's driving information, establish a ship driving model, and predict the future motion state of the ship;
[0009] Step 5: Use DBSCAN algorithm to conduct risk analysis on other ships and calculate the risk of ship collision;
[0010] Step 6: According to step 5, take corresponding collision avoidance actions according to the risk;
[0011] Step 7: Determine the execution status of the action and return the reward value and result.
[0012] In a preferred embodiment, in step 1, the ship's speed, longitude and latitude, propeller speed, heading, pitch, and roll information are collected, the data is normalized, and feature extraction is performed on the processed data. The bidirectional long-short term neural memory network Bi-LSTM is used to extract the forward and reverse information in the time series, and a multi-head self-attention mechanism is added for processing to train a six-degree-of-freedom ship motion model; the formula is as follows
[0013]
[0014] where m is the mass of the ship, is the vector of the ship, F is the force acting on the ship, and F H External forces include the force of current, wind and waves that changes the motion state of the ship; P X , P Y , P Z is the ship's angular velocity vector, M, L, K are the external torques acting on the ship, M H ,L H , K H is the torque generated by water, x is the longitudinal direction of the ship, y is the transverse direction of the ship, z is the vertical direction of the ship, Ix represents the moment of inertia and pitch of the ship around the x-axis, Iy is the moment of inertia and roll of the ship around the y-axis, and Iz is the moment of inertia of the ship around the z-axis.
[0015] In a preferred embodiment, in step 2, a rectangular coordinate system is established with the positive direction of the ship's heading as the positive direction of the x-axis, and the wind speed and the wave velocity are calculated using formula (2) to obtain the ship's velocity vector;
[0016] V F =V S sinα+V B cosβ (2)
[0017] Where V F is the calculated ship velocity vector, VS is the wind speed, sinα is the difference between the wind speed and the positive heading, V B is the size of the wave current, and cosβ is the distance between the wave current and the positive direction of the heading.
[0018] In a preferred embodiment, in step 4, the captain's driving information is collected in advance to make a data set, the collected data is normalized to remove noise, the local features in the time series are extracted through a one-dimensional convolutional layer, the time features of the ship's motion posture are extracted using a long short-term memory network LSTM, and the spatial features are extracted using a convolutional neural network CNN. In the training environment, environmental factors such as wind speed and wave currents are added to train the ship driving model, wherein 90% of the collected data is used to make the model and 10% is used to test the reliability of the model.
[0019] In a preferred embodiment, in step 5, the ship collision risk is calculated using DBSCAN
[0020] The algorithm processes the acquired information of other ships and performs cluster analysis. For the neighborhood radius eps required by the algorithm
[0021] The minimum number of samples in the neighborhood min_samples is determined by using the k-nearest neighbor matrix according to formula (3);
[0022]
[0023] Where d(x i ,x j ) is the distance between the own ship and the other ship, n is the number of features, x ik ,x jk They are the sample points x i and x j The value on the kth feature, for the value in the clustering result, according to formula (4), formula (5) calculate the TCPA and DCPA of each ship, and finally calculate the ship collision risk index CRI, where CRI ranges from 0 to 1, 0 means no collision risk, 1 means collision has occurred;
[0024]
[0025]
[0026] CRI=W1*U(DCPA)+W2*U(TCAP)+W3*U(Bearing)+W4*U(Range) (6)
[0027] In the formula, DCPA represents the distance between the closest points of the two ships’ routes, and TCPA represents the time from the current moment to the moment when the two ships are closest to each other; in the formula, X Tis the coordinate of the target ship on the x-axis, X O is the coordinate of the ship on the x-axis at a certain moment, Y T is the coordinate of the target ship on the y-axis at a certain moment, Y O is the coordinate of the ship on the y-axis at a certain moment, is the relative azimuth of the own ship to the target ship, TB is the modulus of the velocity vector difference between the two ships, V R It is the relative speed between the own ship and the target ship. U (Bearing) indicates the position of the obstacle ship relative to the own ship, U (Range) indicates the distance between the two ships, and U is the conditional function. All DCPA and TCPA values are taken to calculate their average values. If it is lower than the average value, U (TCAP) takes the value of 0, otherwise it takes the value of 1. U (DCPA) is the same, and the weights of W1, W2, W3, and W4 are 40%, 40%, 10%, and 10% respectively. The CRI value is obtained according to the calculation formula, and the collision risk is obtained.
[0028] In a preferred embodiment, in step 6, according to the calculated collision risk, corresponding collision avoidance actions are taken under the condition of satisfying the international maritime COLREGs rules.
[0029] In a preferred embodiment, in step 7, the model learns the action strategy by continuously interacting with the environment, and the learning effect is represented by the cumulative reward value of each training event, and the total reward value and result are calculated.
[0030] The present invention also provides an unmanned ship collision avoidance device based on the DBSCAN algorithm, and runs the unmanned ship collision avoidance method based on the DBSCAN algorithm, including using a catamaran unmanned ship, the catamaran unmanned ship is equipped with four millimeter-wave radars for detecting obstacles around the ship; the top of the catamaran unmanned ship is equipped with a wind speed and direction sensor for real-time monitoring of wind speed and wind direction, and the bottom of the catamaran unmanned ship is equipped with a wave current sensor for measuring wave current information; it also includes a communication module, using a 4G / LTE module to ensure communication with a shore-based control center even when far away from the coast, and equipped with a GNSS module for obtaining its own positioning.
[0031] In a preferred embodiment, the catamaran unmanned vessel is equipped with two electric propellers.
[0032] The present invention also provides a computer-readable storage medium, comprising:
[0033] The computer readable storage medium has a computer program stored thereon;
[0034] When the computer program is run by a processor, the unmanned ship collision avoidance method based on the DBSCAN algorithm is executed.
[0035] Compared with the prior art, the present invention has the following beneficial effects: the present invention changes the traditional collision avoidance algorithm by calculating the TCPA and DCPA between ships to obtain the determined risk coefficient of CRI between unmanned ships and perform collision avoidance actions. The present invention first collects its own ship data to establish a ship kinematic model, then uses the collected data set to establish a ship driving model, and finally calculates the collision risk coefficient between ships through the DBSCAN algorithm. During the execution of the collision avoidance strategy, the ant colony algorithm is introduced to convert the collision avoidance problem into a path planning problem. The algorithm proposed by the present invention improves the collision avoidance capability of unmanned ships, and has good generalization ability, which generally improves the efficiency of unmanned ships in avoiding collisions and safely navigating on the water surface. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 The flowchart of the novel collision avoidance method according to the preferred embodiment of the present invention is shown in FIG.
[0037] Figure 2 This is a diagram of maritime rules for unmanned ship collision avoidance according to a preferred embodiment of the present invention.
[0038] Figure 3 This is a structural diagram of a double-propeller unmanned boat according to a preferred embodiment of the present invention.
[0039] Figure 4 Schematic diagram of calculating ship speed according to a preferred embodiment of the present invention.
[0040] Figure 5 Schematic diagram of an algorithm device according to a preferred embodiment of the present invention. DETAILED DESCRIPTION
[0041] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0042] It should be noted that the following detailed descriptions are illustrative and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present application belongs.
[0043] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application; as used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or their combinations.
[0044] refer to Figure 1-5The present invention introduces factors such as wind speed and wave current in a deep reinforcement learning environment, collects data sets of captains driving ships, establishes a ship driving model, and introduces the DBSCAN algorithm to cluster ships, thus solving the limitations of traditional collision avoidance algorithms. The collision risk calculation formula is as follows:
[0045]
[0046]
[0047] CRI=W1*U(DCPA)+W2*U(TCAP)+W3*U(Bearing)+W4*U(Range) (3)
[0048] TCPA is the time to the closest encounter point, where X T is the coordinate of the target ship on the x-axis, X O is the coordinate Y of the ship on the x-axis at a certain moment T is the coordinate Y of the target ship on the y-axis at a certain moment O is the coordinate of the ship on the y-axis at a certain moment, is the relative azimuth of own ship to target ship, V R It is the modulus length of the velocity vector difference of the two ships. DCPA is the distance of the closest encounter point. CRI is the ship collision risk index, Bearing represents the position of the obstacle ship relative to the ship, Range represents the distance between the two ships, and the weights of W1, W2, W3, and W4 are 40%, 40%, 10%, and 10% respectively. The CRI value is obtained according to the calculation formula to obtain the collision risk size. The collision avoidance method proposed in the present invention first uses its own ship data to establish a six-degree-of-freedom ship motion model, and according to the collected data set of the captain driving the ship, considers external factors such as wind speed and ocean current, and obtains the ship driving model through the long-term and short-term neural memory network. When calculating the collision risk, the DBSCAN algorithm is integrated, the obstacle ships are clustered, and TCPA and DCPA are calculated respectively after clustering. This method changes the limitation of the previous collision avoidance method in which the collision risk calculation only considers the position information between ships to obtain CRI. The ant colony algorithm is integrated into the decision-making process to convert the collision avoidance problem into a path planning problem.
[0049] The improved algorithm flow structure diagram is as follows: Figure 1 The operation steps are as follows:
[0050] Step 1: The unmanned boat used in the present invention is a double-propeller under-actuated unmanned boat, such as Figure 3As shown. After the unmanned ship collects its own ship speed, longitude and latitude, propeller speed, bow direction, pitch, and roll information, it transmits the information to the comprehensive data processing center. The data is normalized, and the processed data is feature extracted. The bidirectional long short-term neural memory network (Bi-LSTM) is used to extract the forward and reverse information in the time series, and the multi-head self-attention mechanism is added for processing to train the six-degree-of-freedom ship motion model. The mathematical formula of the six-degree-of-freedom ship motion model is as follows:
[0051]
[0052] where m is the mass of the ship, is the vector of the ship, F is the force acting on the ship, and F H It is the external force, including the force of water current, wind and waves that changes the motion state of the ship. X , P Y , P Z is the ship's angular velocity vector, M, L, K are the external torques acting on the ship, M H , L H , K H is the torque generated by the water.
[0053] Step 2: Take the positive direction of the ship's heading as the positive direction of the x-axis, establish a rectangular coordinate system, and use the anemometer to measure the wind speed V S , using the velocity sensor to measure the wave velocity V B The data is transmitted to the data processing center, and the wind speed and wave velocity are calculated using formula (5) to obtain the ship speed vector
[0054] V F =V S sinα+V B cosβ (5)
[0055] Where V F is the calculated ship velocity vector, V S is the wind speed, sinα is the difference between the wind speed and the positive heading, V B is the size of the wave current, and cosβ is the distance between the wave current and the positive direction of the heading.
[0056] Step 3: Use AIS and ship radar to obtain the position and speed information of other ships. After obtaining the data, the collected data is processed, including data cleaning to remove outliers and fill in missing data.
[0057] Step 4, a ship motion posture prediction model based on LSTM-CNN-Attention is proposed. In the preparation stage, the methods used to collect the captain's driving information include self-made questionnaires, making simulation platforms, simulating various situations, and collecting captain's driving ship data. The ship operation data carried by intelligent ships are used to create a simulated driving environment collection data set. In the reinforcement learning training environment, environmental factors such as wind speed and wave currents are added. The collected data is normalized and noise is removed. The local features in the time series are extracted through a one-dimensional convolution layer. The long short-term memory network (LSTM) is used to extract the time features of the ship's motion posture, and the convolutional neural network (CNN) is used to extract the spatial features. 90% of the collected data is used to make the model, and 10% is used to test the reliability of the model.
[0058] Step 5: Input the ship motion state information calculated by the ship driving model, as well as the ocean current and wind speed information into the neural network to calculate the ship collision risk. Use the DBSCAN algorithm to process the acquired other ship information and perform cluster analysis. The ship's position coordinates, pitch, roll, speed, thrust, torque, and heading are used as features for clustering. The acquired obstacle ships are divided into three categories: A, B, and C, where category A is a ship that has no impact on the ship's navigation, category B is a ship that poses a moderate risk to the ship's navigation, and category C is a ship that poses a significant risk to the ship's navigation. According to formula (6), the k-nearest neighbor matrix determines the eps value and min_samples value.
[0059]
[0060] Where d(x i ,x j ) is the distance between the own ship and the other ship, n is the number of features, and in the present invention, n=7x ik ,x jk They are the sample points x i and x j The value on the kth feature, for the value in the clustering result, according to formula (1), formula (2) calculates the (TCPA) and (DCPA) of each ship, and finally calculates the ship collision risk index (CRI). The CRI range is 0 to 1. The larger the value, the greater the collision risk. It is used to determine whether avoidance action is needed. The final CRI calculation method is shown in (7). A The risk factor for Class A is 0, CRI B is the risk factor of Class B, and the CRI of the ship with the largest risk factor in Class B is taken C For Category C, add the risk factors of all ships.
[0061] CRI=CRI A +CRI B +CRI C (7)
[0062] Step 6: Based on the calculated collision risk, if collision avoidance is required, the decision instruction is transmitted to the unmanned ship. The unmanned ship loads the collision avoidance model integrated with the ant colony algorithm, executes the path planning that meets the international maritime regulations, and makes corresponding collision avoidance actions such as Figure 2 shown.
[0063] Step 7: The unmanned ship returns the results to the data processing center. The model learns the action strategy through continuous interaction with the environment. The learning effect is represented by the cumulative reward value of each training event, and the total reward value and result are calculated.
[0064] In order to address the shortcoming of traditional collision avoidance algorithms that only calculate TCPA and DCPA for collision avoidance, the present invention adds sea condition factors such as wave velocity and wind speed, trains the ship motion model by collecting data sets, uses the DBSCAN algorithm to perform cluster analysis on obstacle ships, calculates the collision risk index, and enables the unmanned ship to make correct collision avoidance actions while meeting international maritime regulations.
Claims
1. An unmanned ship collision avoidance method based on DBSCAN algorithm, characterized in that: The following steps are involved: Step 1: Collect ship data and use neural network to train the six-degree-of-freedom ship motion model; Step 2: Use a wind speed sensor to obtain wind speed, and use an ocean current sensor to obtain ocean current information; Step 3: Use AIS / radar to obtain the speed and position information of other ships; Step 4: Collect the captain's driving information, establish a ship driving model, and predict the future motion state of the ship; Step 5: Use DBSCAN algorithm to conduct risk analysis on other ships and calculate the risk of ship collision; Step 6: According to step 5, take corresponding collision avoidance actions according to the risk; Step 7: Determine the execution status of the action and return the reward value and result.
2. The unmanned ship collision avoidance method based on DBSCAN algorithm according to claim 1 is characterized in that: In step 1, the ship's speed, longitude and latitude, propeller speed, heading, pitch, and roll information are collected, the data is normalized, and feature extraction is performed on the processed data. The bidirectional long-term and short-term neural memory network Bi-LSTM is used to extract the forward and reverse information in the time series, and the multi-head self-attention mechanism is added for processing to train the six-degree-of-freedom ship motion model; the formula is as follows where m is the mass of the ship, is the vector of the ship, F is the force acting on the ship, and F H External forces include the forces of water currents, wind and waves that change the motion state of the ship; P X , P Y , P Z is the ship's angular velocity vector, M, L, K are the external torques acting on the ship, M H ,L H , K H is the torque generated by water, x is the longitudinal direction of the ship, y is the transverse direction of the ship, z is the vertical direction of the ship, Ix represents the moment of inertia and pitch of the ship around the x-axis, Iy is the moment of inertia and roll of the ship around the y-axis, and Iz is the moment of inertia of the ship around the z-axis.
3. The unmanned ship collision avoidance method based on DBSCAN algorithm according to claim 1 is characterized in that: In step 2, the positive direction of the ship's heading is taken as the positive direction of the x-axis, a rectangular coordinate system is established, and the wind speed and wave velocity are calculated using formula (2) to obtain the ship's velocity vector; V F =V S sinα+V B cosβ(2) Where V F is the calculated ship velocity vector, V S is the wind speed, sinα is the difference between the wind speed and the positive heading, V B is the size of the wave current, and cosβ is the distance between the wave current and the positive direction of the heading.
4. The unmanned ship collision avoidance method based on DBSCAN algorithm according to claim 1 is characterized in that: In step 4, the captain's driving information is collected in the early stage to make a data set, the collected data is normalized and noise is removed, the local features in the time series are extracted through a one-dimensional convolutional layer, the time features of the ship's motion posture are extracted using the long short-term memory network LSTM, and the spatial features are extracted using the convolutional neural network CNN. In the training environment, environmental factors such as wind speed and wave currents are added to train the ship driving model, of which 90% of the collected data is used to make the model and 10% is used to test the reliability of the model.
5. The unmanned ship collision avoidance method based on DBSCAN algorithm according to claim 1 is characterized in that: In step 5, the ship collision risk is calculated, and the DBSCAN algorithm is used to process the acquired information of other ships and perform cluster analysis. For the neighborhood radius eps and the minimum number of samples min_samples in the neighborhood required by the algorithm, the k-nearest neighbor matrix is used to determine the eps value and min_samples value according to formula (3); Where d(x i ,x j ) is the distance between the own ship and the other ship, n is the number of features, x ik ,x jk They are the sample points x i and x j The value on the kth feature, for the value in the clustering result, according to formula (4), formula (5) calculate the TCPA and DCPA of each ship, and finally calculate the ship collision risk index CRI, where CRI ranges from 0 to 1, 0 means no collision risk, 1 means collision has occurred; CRI=W1*U(DCPA)+W2*U(TCAP)+W3*U(Bearing)+W4*U(Range) (6) In the formula, DCPA represents the distance between the closest points of the two ships’ routes, and TCPA represents the time from the current moment to the moment when the two ships are closest to each other; in the formula, X T is the coordinate of the target ship on the x-axis, X O is the coordinate of the ship on the x-axis at a certain moment, Y T is the coordinate of the target ship on the y-axis at a certain moment, Y O is the coordinate of the ship on the y-axis at a certain moment, is the relative azimuth of the own ship to the target ship, TB is the modulus of the velocity vector difference between the two ships, V R is the relative speed between the own ship and the target ship; U (Bearing) represents the position of the obstacle ship relative to the own ship, U (Range) represents the distance between the two ships, and U is the conditional function. All DCPA and TCPA values are taken separately to calculate their average values. If it is lower than the average value, U (TCAP) takes the value of 0, otherwise it takes the value of 1. The same is true for U (DCPA). The weights of W1, W2, W3, and W4 are 40%, 40%, 10%, and 10% respectively. The CRI value is obtained according to the calculation formula to obtain the collision risk.
6. The unmanned ship collision avoidance method based on DBSCAN algorithm according to claim 1, characterized in that: In step 6, according to the calculated collision risk, corresponding collision avoidance actions are taken under the condition of meeting the international maritime COLREGs rules.
7. The unmanned ship collision avoidance method based on DBSCAN algorithm according to claim 1, characterized in that: In step 7, the model learns the action strategy by continuously interacting with the environment. The learning effect is represented by the cumulative reward value of each training event, and the total reward value and result are calculated.
8. An unmanned ship collision avoidance device based on DBSCAN algorithm, characterized in that: An unmanned ship collision avoidance method based on the DBSCAN algorithm as described in any one of claims 1 to 7 includes using a catamaran unmanned ship, the catamaran unmanned ship is equipped with four millimeter-wave radars for detecting obstacles around the ship; a wind speed and direction sensor is configured on the top of the catamaran unmanned ship for real-time monitoring of wind speed and wind direction, and a wave current sensor is configured on the bottom of the catamaran unmanned ship for measuring wave current information; it also includes a communication module, using a 4G / LTE module to ensure communication with a shore-based control center even when far away from the coast, and equipped with a GNSS module for obtaining its own positioning.
9. The unmanned ship collision avoidance device based on DBSCAN algorithm according to claim 8, characterized in that: The catamaran unmanned boat is equipped with two electric propellers.
10. A computer-readable storage medium, characterized in that: include: The computer readable storage medium has a computer program stored thereon; When the computer program is executed by a processor, the unmanned ship collision avoidance method based on the DBSCAN algorithm as described in any one of claims 1 to 7 is executed.
Citation Information
Cited By
Unmanned ship dynamic environment path planning system and method based on deep reinforcement learning
CN119961579A
Unmanned Ship Dynamic Environment Path Planning System and Method Based on Deep Reinforcement Learning
CN119961579B
Ship stall calculation method and system based on data driving
CN120373165A
Trailing suction dredger sailing collision risk dynamic assessment and collision avoidance decision-making method
CN121122074A