Method for generating collision avoidance test scene in open water area
By using convex optimization algorithm and situational division model to generate single-target ship test cases with collision risk, and constructing multi-target ship test scenarios through clustering and arrangement combination methods, the problem of insufficient effectiveness and reliability of the traditional collision avoidance test scenario generation method is solved, and efficient and accurate test case generation is achieved.
Patent Information
- Application Number
- CN202411723654.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-11
AI Technical Summary
The traditional collision avoidance test scenario generation method has technical problems such as generating invalid cases, inability to specify situations, inability to adjust safety and distances, and the multi-target ship test cases are too similar.
A convex optimization algorithm is used to generate single-target ship test cases that can generate collision risks, and classify them according to the situation division model. Through the clustering algorithm, a multi-objective ship test case is merged, and a multi-objective ship test scenario is constructed, and a multi-objective ship test scenario is generated using the arrangement and combination method.
Ensure that the generated target ship has a collision risk with the ship, can specify safe distances, reduce the similarity of multi-target ship test cases, and improve testing efficiency and accuracy.
Smart Images

Figure CN119807027A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a ship intelligent technology, and in particular to a method for generating an open water collision avoidance test scene. Background Art
[0002] As the shipping industry's demands for safety, greenness and economy continue to increase, unmanned autonomous navigation of ships is the top priority of ship intelligence. China Classification Society has also launched the "Smart Ship Specification 2024" to put forward requirements for the certification of ships' autonomous navigation capabilities. Among them, the auxiliary navigation system needs to be able to identify the encounter situation between ships and give prompts and alarms, and the autonomous navigation system needs to make decisions and control by machines based on the auxiliary navigation system, and give collision avoidance decisions and operations that comply with the "International Regulations for Preventing Collisions at Sea, 1972".
[0003] Compared with cars, ships are heavy assets, have lower ownership than cars, have limited maneuverability, complex motion responses, and collision avoidance requires comprehensive situation analysis. The intelligent navigation system should have sufficient test cases during the land testing phase to improve the accuracy of its decision-making, thereby enhancing safety and avoiding risks.
[0004] However, the traditional collision avoidance test scenario generation used in the test cases has the following technical problems:
[0005] 1. The generated target ship does not necessarily have a collision risk with the own ship, resulting in a large number of invalid use cases;
[0006] 2. It is impossible to generate the target ship position in a specified encounter situation and to conduct repeated training for specific scenarios;
[0007] 3. It is not possible to specify a safe encounter distance (SDA) and adjust it for ships of different sizes;
[0008] 4. The test cases of multiple target ships are too similar, resulting in duplicate samples and a waste of testing time. Summary of the invention
[0009] Aiming at the problem that the traditional collision avoidance test scenario generation of intelligent navigation system is insufficient in effectiveness and reliability, a method for generating collision avoidance test scenarios in open waters is proposed. The method can generate ships that pose a collision risk to the own ship and create an encounter situation within a specified range, which can provide a large number of test cases for the decision-making of the autonomous navigation system.
[0010] The technical solution of the present invention is:
[0011] A method for generating an open water collision avoidance test scenario comprises the following steps:
[0012] Step 1. Use convex optimization algorithm to find a single target ship test case that can generate collision risk;
[0013] Step 2. Classify the single ship test cases according to the encounter situation classification model;
[0014] Step 3. Single target ship test case, i.e. single target ship open water collision avoidance test scenario;
[0015] Step 4. The multi-target ship test uses a clustering algorithm to merge similar single-target ship test cases to form the basic case of the multi-target scenario, and then uses the permutation and combination method to form the multi-target ship test scenario.
[0016] Furthermore, step 1 is as follows:
[0017] The open water collision avoidance test case must first meet the conditions of collision risk with the own ship. The adjustable parameters include the own ship speed, the other ship speed, the starting longitude and latitude of the own ship, the starting longitude and latitude of the other ship, the own ship heading, the other ship heading, and the safe encounter distance SDA. A single ship test scenario library is constructed. The method is shown in Formula 1. The solution satisfies the following inequality:
[0018] for iin(0,360):
[0019] for j in(0,360):
[0020]
[0021] Where Dist is the initial position of the two ships, in nautical miles; RB is the relative azimuth of the two ships, in π; RC is the relative side angle, in π; V os V is the ship's speed, in knots; TAR is the speed of the other ship, in knots; SDA is the safe encounter distance, in nautical miles; T is the time, in hours; i is the relative azimuth of the other ship, in degrees; j is the relative side angle of the other ship, in degrees; Dist lowbound is the minimum value of the initial ship position, in nautical miles; Dist highbound is the maximum value of the initial ship position, in nautical miles; os is the set own ship speed, in knots; is the minimum speed of other ships, in knots; is the maximum speed of the other ship, in knots; SDA is the set minimum encounter distance, the distance is nautical miles; T lowbound is the set minimum encounter time, in hours; T highbound The maximum encounter time is set in hours;
[0022] The above nonlinear equations are solved by convex optimization solving tools to obtain all target ships that meet the above conditions.
[0023] Furthermore, step 2 is as follows:
[0024] Due to the diversity of encounter situation classification models, single-ship test cases with the same collision risk are considered to be different encounter situations. At this time, the test cases generated in the first step can be classified according to the encounter situation classification model developed by the collision avoidance algorithm to ensure the consistency between the test scenario situation generation and the algorithm cognition.
[0025] Furthermore, step 3 is as follows:
[0026] The collision avoidance algorithm needs to traverse all single target ship open water collision avoidance test scenarios and verify the indicator system through collision avoidance tests, thus completing the single ship collision avoidance test;
[0027] Among them, the ultimate goal of common ship collision avoidance algorithms is to plan an avoidance path that is consistent with the ship's maneuverability and the safety of maritime regulations to avoid the target ship. This process can be accomplished by steering or reducing speed.
[0028] Furthermore, step 4 is as follows:
[0029] First, the ships are grouped according to the encounter situation, and then the clustering algorithm is used to merge the single target ship test cases with similar situations; the basic test cases of the multi-target scenario are formed, and then the permutation and combination method is used according to the comprehensive situation to form a multi-target ship open water collision avoidance test scenario;
[0030] The collision avoidance algorithm needs to traverse all multi-target ship open water collision avoidance test scenarios and verify the indicator system through the collision avoidance test, thus completing the multi-ship collision avoidance test.
[0031] Furthermore, the convex optimization solving tool is Python's GEKKO library.
[0032] Furthermore, the encounter situation model divides the single-ship test cases into at least five situations: left crossing, right crossing, encounter, overtaking, and being overtaken.
[0033] Furthermore, common ship collision avoidance algorithms can be divided into three categories: sampling-based, search-based, and machine learning types.
[0034] Furthermore, clustering algorithms include K-Medoids, K-Means, k-nearest neighbors, and hierarchical clustering.
[0035] Furthermore, according to the results of the situation classification in the second step, the K-Medoids algorithm, Calinski-Harabasz Index or Davies-Bouldin Index are used within each category to select the best K value and merge the scenes of each situation.
[0036] The beneficial effects of the present invention are:
[0037] 1. The generated target ship must have a collision risk with the own ship, and each generated single-ship test case will enter the safe encounter distance (SDA) of the own ship;
[0038] 2. By constructing a single-ship and multi-ship encounter scenario library, the collision avoidance algorithm can specify comprehensive encounter scenarios for training, accelerating the convergence of onshore testing;
[0039] 3. You can specify the safe encounter distance (SDA) and adjust it for ships of different sizes;
[0040] 4. The initial generation position of the target ship can be adjusted. The longer generation distance can meet the compliance test of the collision avoidance algorithm, and the near-field generation can meet the safety test of the collision avoidance algorithm.
[0041] 5. Avoid the test cases of multiple target ships being too similar and the samples being identical, thus saving test time.
[0042] 6. Each situation scenario is clustered using the K-Medoids algorithm, and the best K value is selected using the Calinski-Harabasz Index or Davies-Bouldin Index;
[0043] 7. Comprehensive situation scenarios are constructed using a combination of numbers. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 This is a model diagram for dividing the four types of meetings and situations for reference;
[0045] Figure 2 Generate a flow chart for the open water collision avoidance test scenario of the present invention;
[0046] Figure 3 This is the chart of Regulation 14 of the International Regulations for Preventing Collisions at Sea, 1972;
[0047] Figure 4 The target (geo-coordinate system) map of the present invention with a SDA of less than 500m at 5 to 8 nautical miles;
[0048] Figure 5 This is a target (situation judgment model) diagram of the present invention with a 5 to 8 nautical mile SDA less than 500m. DETAILED DESCRIPTION
[0049] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0050] The generation of the open water collision avoidance test scenario in the present invention is mainly divided into several steps:
[0051] 1. Use convex optimization algorithm to find single target ship test cases that can cause collision risk;
[0052] 2. Classify single-ship test cases according to the encounter situation classification model;
[0053] 3. Single target ship test case is a single target ship open water collision avoidance test scenario;
[0054] 4. The multi-target ship test uses a clustering algorithm to merge similar single-target ship test cases to form the basic case of the multi-target scenario, and then uses the permutation and combination method to form the multi-target ship test scenario.
[0055] like Figure 2 As shown, the specific steps are as follows:
[0056] In the first step, a convex optimization algorithm is used to find a single target ship test case that can generate a collision risk.
[0057] The open water collision avoidance test case must first meet the conditions of collision risk with the own ship. The adjustable parameters include the own ship speed, the other ship speed, the starting longitude and latitude of the own ship, the starting longitude and latitude of the other ship, the own ship heading, the other ship heading, and the safe encounter distance (SDA). The single ship test scenario library is constructed as follows (as shown in Formula 1), and the inequality that satisfies the following equation group is solved:
[0058] for iin(0,360):
[0059] for j in(0,360):
[0060]
[0061] Formula 1 Collision risk calculation method
[0062] Where Dist is the initial position of the two ships, in nautical miles; RB is the relative azimuth of the two ships, in π; RC is the relative side angle, in π; V os V is the ship's speed, in knots; TAR is the speed of the other ship, in knots; SDA is the safe encounter distance, in nautical miles; T is the time, in hours; i is the relative azimuth of the other ship, in degrees; j is the relative side angle of the other ship, in degrees; Dist lowbound is the minimum value of the initial ship position, in nautical miles; Dist highbound is the maximum value of the initial ship position, in nautical miles; os is the set own ship speed, in knots; is the minimum speed of other ships, in knots; is the maximum speed of the other ship, in knots; SDA is the set minimum encounter distance, the distance is nautical miles; T lowbound is the set minimum encounter time, in hours; T highbound The maximum encounter time is set in hours;
[0063] The above nonlinear equations are solved by convex optimization solving tools such as Python's GEKKO library to obtain all target ships that meet the above conditions.
[0064] The second step is to classify the single ship test case scenarios according to the encounter situation classification model. The encounter situation classification model is a highly subjective model with multiple types of classification methods. The same classification method has multiple situation boundary classification thresholds. Figure 1 Shown are four models of meeting and situation division;
[0065] Due to the diversity of the encounter situation classification model {Note: the single-ship test case generated by this algorithm only has the risk of collision. Before the encounter situation model is added, it is impossible to determine what type of risk it is. The encounter situation identification model can classify the case into five types: left crossing, right crossing, encounter, overtaking, and being overtaken; due to differences in the models used (which may be related to the type of ship and the operating route), the thresholds of the same model (which may be related to the size and type of the ship) may also be different, so the judgment of collision risk is different for different algorithm developers}, the single-ship test cases with the same collision risk are considered to be different encounter situations. At this time, the test cases generated in the first step can be classified according to the encounter situation classification model developed by the collision avoidance algorithm to ensure the consistency between the test scenario situation generation and the algorithm cognition.
[0066] The encounter situation model divides the single-ship test cases into at least five situations: left crossing, right crossing, encounter, overtaking, and being overtaken.
[0067] The third step is to construct a single target ship open water collision avoidance test scenario.
[0068] The single target ship test case is the single target ship open water collision avoidance test scenario. The collision avoidance algorithm needs to traverse all single target ship open water collision avoidance test scenarios and verify the indicator system through the collision avoidance test, thus completing the single ship collision avoidance test.
[0069] Among them, common ship collision avoidance algorithms can be divided into three categories: sampling-based, search-based, and machine learning-based. Their ultimate goal is to plan an avoidance path that is consistent with the ship's maneuverability and the safety of maritime regulations to avoid the target ship. This process can be accomplished by steering or reducing speed.
[0070] The fourth step is to construct a multi-target ship open water collision avoidance test scenario.
[0071] First, group them according to the encounter situation, and then use clustering algorithms such as K-Medoids, K-Means, k-nearest, hierarchical clustering and other clustering algorithms to merge the single target ship test cases with similar single situations {Note: The five types mentioned above are to classify the targets with collision risks according to the situation. Now it is at the next level, within a single situation, for example, the encounter target ship is merged. The reason is that simply combining the single ship use cases according to the situation will lead to too many multi-ship collision avoidance test cases, and some of the single ship use cases with the same situation are similar. It takes about several minutes to run the collision avoidance algorithm once, and repeated extraction will waste time} to form the basic test cases of the multi-target scenario. Then, according to the comprehensive situation, the permutation and combination method is used {for example, the clustering algorithm is used to cluster the use cases of the five situations from 1000 to n (n≤1000), then the total number of scenarios generated by the combination number for the 2-ship complex scenario is The number of complex scenarios with one encounter and one right crossing is The multi-target ship test scenario (i.e., the multi-target ship open water collision avoidance test scenario) is constituted.
[0072] The collision avoidance algorithm needs to traverse all multi-target ship open water collision avoidance test scenarios and verify the indicator system through the collision avoidance test, thus completing the multi-ship collision avoidance test.
[0073] Example: Assume that it is necessary to build an open water collision avoidance test scenario library;
[0074] In the first step, a convex optimization algorithm is used to find a single target ship test case that can generate a collision risk.
[0075] Assume that a batch of test cases are to be generated to test the compliance of the algorithm with the International Regulations for Preventing Collisions at Sea, 1972. First, assume that the starting position of the other ship is between 5 and 8 nautical miles from the ship, and the other ship is close enough to the ship but has not entered an urgent risk situation; secondly, assume that the speed of the ship is 12 knots and the speed of the other ship is between 10 and 14 knots, so as to include the situation of overtaking and being overtaken by the other ship; thirdly, considering the length and maneuverability of the ocean-going ship, the SDA of the ship is set to 0.27 nautical miles, that is, 500 meters; finally, the time to the collision point is set to 0 to 2 hours to avoid collisions in the case that the test case is too far away.
[0076] for iin(0,360):
[0077] for j in(0,360):
[0078]
[0079] Where Dist is the initial position of the two ships, in nautical miles; RB is the relative azimuth of the two ships, in π; RC is the relative side angle, in π; Vos is the speed of the own ship, in knots; Vtar is the speed of the other ship, in knots; SDA is the safe encounter distance, in nautical miles; T is the time, in hours; i is the relative azimuth of the other ship, in degrees; j is the relative side angle of the other ship, in degrees.
[0080] After defining the variables and equations through the Python gekko library, we loop through the relative azimuth and relative side angle of the other ship to obtain the numerical solution of the equations. The visualization of the single ship test case is as follows Figure 4 As shown, the red dot in the center is the own ship, the position of the other ship is the blue dot, and the speed of the other ship is the red vector arrow.
[0081] In the second step, the single-ship test case scenarios are classified according to the encounter situation classification model.
[0082] According to a meeting situation identification model based on relative side angle and relative azimuth {Note: According to Article 14 of the International Regulations for Preventing Collisions at Sea, 1972, the meeting situation is judged, as follows Figure 3 The single ship test cases are classified as follows Figure 5 As shown. The horizontal axis is the relative side angle, the vertical axis is the relative azimuth, the red area is the encounter, the blue area is the right crossing, the green area is the left crossing, the yellow area is the overtaking, and the pink area is the overtaking. The target points generated in the first step {that is, all the single-ship use cases with collision risks generated in the first step are marked in the relative side angle / relative azimuth (non-geod coordinate system) coordinate system} are divided into the specified situations according to the relative azimuth and relative side angle. It can be seen that the generated test cases have covered all situations.
[0083] The third step is to construct a single target ship open water collision avoidance test scenario.
[0084] According to the results of the situation classification in the second step, the test cases are labeled. When building a single-ship collision avoidance test scenario library, they can be divided into five situation scenarios: left crossing, right crossing, encounter, overtaking, and being overtaken. Separate situation tests are also carried out, and targeted tests can be carried out for situations where the algorithm is weak.
[0085] The fourth step is to construct a multi-target ship open water collision avoidance test scenario.
[0086] According to the results of the situation classification in the second step, the K-Medoids algorithm, Calinski-Harabasz Index (variance ratio criterion) or Davies-Bouldin Index (an indicator for evaluating clustering effect) are used within each category to select the best K value and merge the scenarios of each situation. Finally, consider the comprehensive situation to generate multi-ship test scenarios. For example, if a three-ship encounter scenario is currently required, one is a left-crossing situation and two are right-crossing situations. Assuming that after clustering, the left-crossing situation has N test cases and the right-crossing situation has M test cases, then the final situation scenario has This method can be used to combine all complex scenarios.
[0087] The above-mentioned embodiment only expresses one implementation mode of the present invention, and its description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
Claims
1. A method for generating an open water collision avoidance test scenario, characterized in that: The following steps are involved: Step 1. Use convex optimization algorithm to find a single target ship test case that can generate collision risk; Step 2. Classify the single ship test cases according to the encounter situation classification model; Step 3. Single target ship test case, i.e. single target ship open water collision avoidance test scenario; Step 4. The multi-target ship test uses a clustering algorithm to merge similar single-target ship test cases to form the basic case of the multi-target scenario, and then uses the permutation and combination method to form the multi-target ship test scenario.
2. The method for generating an open water collision avoidance test scenario according to claim 1, characterized in that: Step 1 is as follows: The open water collision avoidance test case must first meet the conditions of collision risk with the own ship. The adjustable parameters include the own ship speed, the other ship speed, the starting longitude and latitude of the own ship, the starting longitude and latitude of the other ship, the own ship heading, the other ship heading, and the safe encounter distance SDA. A single ship test scenario library is constructed. The method is shown in Formula 1. The solution satisfies the following inequality: for i in(0,360): for j in(0,360): Where Dist is the initial position of the two ships, in nautical miles; RB is the relative azimuth of the two ships, in π; RC is the relative side angle, in π; V os V is the ship's speed, in knots; TAR is the speed of the other ship, in knots; SDA is the safe encounter distance, in nautical miles; T is the time, in hours; i is the relative azimuth of the other ship, in degrees; j is the relative side angle of the other ship, in degrees; Dist lowbound is the minimum value of the initial ship position, in nautical miles; Dist highbound is the maximum value of the initial ship position, in nautical miles; os is the set own ship speed, in knots; is the minimum speed of other ships, in knots; is the maximum speed of the other ship, in knots; SDA is the set minimum encounter distance, the distance is nautical miles; T lowbound is the set minimum encounter time, in hours; T highbound The maximum encounter time is set in hours; The above nonlinear equations are solved by convex optimization solving tools to obtain all target ships that meet the above conditions.
3. The method for generating an open water collision avoidance test scenario according to claim 2, characterized in that: Step 2 is as follows: Due to the diversity of encounter situation classification models, single-ship test cases with the same collision risk are considered to be different encounter situations. At this time, the test cases generated in the first step can be classified according to the encounter situation classification model developed by the collision avoidance algorithm to ensure the consistency between the test scenario situation generation and the algorithm cognition.
4. The method for generating an open water collision avoidance test scenario according to claim 3, characterized in that: Step 3 is as follows: The collision avoidance algorithm needs to traverse all single target ship open water collision avoidance test scenarios and verify the indicator system through collision avoidance tests, thus completing the single ship collision avoidance test; Among them, the ultimate goal of common ship collision avoidance algorithms is to plan an avoidance path that is consistent with the ship's maneuverability and the safety of maritime regulations to avoid the target ship. This process can be accomplished by steering or reducing speed.
5. The method for generating an open water collision avoidance test scenario according to claim 4, characterized in that: Step 4 is as follows: First, the ships are grouped according to the encounter situation, and then the clustering algorithm is used to merge the single target ship test cases with similar situations; the basic test cases of the multi-target scenario are formed, and then the permutation and combination method is used according to the comprehensive situation to form a multi-target ship open water collision avoidance test scenario; The collision avoidance algorithm needs to traverse all multi-target ship open water collision avoidance test scenarios and verify the indicator system through the collision avoidance test, thus completing the multi-ship collision avoidance test.
6. The method for generating an open water collision avoidance test scenario according to claim 2, characterized in that: The convex optimization solving tool is Python's GEKKO library.
7. The method for generating an open water collision avoidance test scenario according to claim 3, characterized in that: The encounter situation model divides single-ship test cases into at least five situations: left crossing, right crossing, encounter, overtaking, and being overtaken.
8. The method for generating an open water collision avoidance test scenario according to claim 4, characterized in that: Common ship collision avoidance algorithms can be divided into three categories: sampling-based, search-based, and machine learning-based.
9. The method for generating an open water collision avoidance test scenario according to claim 5, characterized in that: Clustering algorithms include K-Medoids, K-Means, k-nearest, and hierarchical clustering.
10. The method for generating an open water collision avoidance test scenario according to claim 5, characterized in that: According to the results of the situation classification in the second step, the K-Medoids algorithm, Calinski-Harabasz Index or Davies-Bouldin Index are used within each category to select the best K value and merge the scenes of each situation.