A method, device and storage medium for calculating a risk of collision of a ship
By constructing a support vector machine model and a backpropagation neural network, combined with the sparrow search algorithm, and using AIS data to calculate ship collision parameters, filter encounter situation data, and predict collision risk, the problem of inaccurate ship collision risk prediction in existing technologies has been solved, thereby reducing maritime collision accidents and improving navigation safety.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-29
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies cannot effectively utilize AIS data to accurately predict collision risks in ship encounters, leading to frequent maritime collision accidents.
By constructing a support vector machine model and a backpropagation neural network, combined with the sparrow search algorithm, the system uses AIS data to calculate ship collision parameters, filters encounter situation data, predicts collision risk, and provides ship encounter bearing maps and collision risk assessments.
It enables accurate prediction of ship collision risks, reduces maritime collision accidents, and ensures navigation safety.
Smart Images

Figure CN115510737B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of marine technology, specifically to a method, apparatus, and storage medium for calculating ship collision risk. Background Technology
[0002] Automatic Identification System (AIS) is a new type of ship collision avoidance system used for automatic response and identification between ships and between ships and shore, and is widely used in navigation. How to utilize and process AIS data to determine the navigation status of each ship in advance and predict potential collision risks is of great significance for reducing maritime collisions and ensuring navigational safety. Summary of the Invention
[0003] To address the aforementioned problems, this invention provides a method, apparatus, and storage medium for calculating ship collision risk. Based on AIS data, a support vector machine model is used to accurately identify ship encounter situations, and a BP neural network is constructed to objectively and accurately predict the collision risk values of each ship in the ship encounter situation.
[0004] To achieve the above objectives, a method for calculating ship collision risk is provided, including:
[0005] S1, acquire the target AIS data information of the vessel, obtain the encounter situation information based on the target AIS data information, and calculate the vessel collision parameters using the encounter situation information. The target AIS data information includes speed, bearing, and position. The encounter situation information includes the relative distance, relative bearing, and vessel heading intersection angle of the vessels. The collision parameters include the relative distance, relative speed, minimum encounter distance DCPA, and minimum encounter time TCPA of the vessels.
[0006] S2, using pre-set filtering conditions for ship encounter situation data, based on the encounter situation information and the ship collision parameters, filter out the encounter situation data of ships that meet the filtering conditions, wherein the encounter situation data is determined by the encounter situation information;
[0007] S3, Construct a ship support vector machine classification model, and learn and classify the encounter situation data of the pre-selected samples according to the support vector machine classification model and the preset collision avoidance rules to obtain the ship encounter bearing map;
[0008] S4. Construct a BP neural network and use a sparrow search algorithm to optimize and determine the node parameters of each layer of the BP neural network. Predict the collision risk value between the selected ship and the target ship based on the encounter orientation map. The input terms of the BP neural network are the target ship's heading, target ship's speed, distance between the two ships, and relative orientation between the two ships. The output term is the collision risk value.
[0009] Furthermore, the step of obtaining the target AIS data information of the ship in step S1 includes:
[0010] S11, Remove abnormal data from the original ship AIS data;
[0011] S12, Decode the ship's AIS data after removing abnormal data to obtain the ship's position information;
[0012] S13, Based on the location information, construct the ship's trajectory in each time period to obtain a set of ship trajectories. The trajectory in each time period includes a starting point, an ending point, and trajectory feature points.
[0013] S14, Establish a fixed geodetic coordinate system XOY for the ship, convert the information in the trajectory set into the coordinate system XOY, and obtain the target AIS data information. The origin of the fixed geodetic coordinate system XOY is a preset point, the X-axis points due east, and the Y-axis points due north.
[0014] Furthermore, the pre-set filtering criteria for ship encounter situation data in step S2 include:
[0015] Let one ship be the target ship and the other be the target ship. Let the ship's coordinate system be xoy, with its origin o at the ship's center of mass, the y-axis pointing towards the bow at 0°, and the x-axis pointing towards the ship's right bank. Then,
[0016] The conditions for screening the encounter situation are set as follows: both ships are motorized vessels, both ships are in opposite or nearly opposite directions, and the target ship is located within a fan-shaped bearing range of 355° to 360° or 0° to 5° of the ship.
[0017] The overtaking situation screening criteria are set as follows: the velocity vector component of the following ship in the direction of the preceding ship's motion exceeds the velocity of the preceding ship, the distance between the two ships is less than 4 nautical miles, and the target ship is located within the fan-shaped bearing of the following ship from 112.5° to 247.5°.
[0018] The cross-encounter situation screening criteria are set as follows: the minimum encounter distance (DCPA) between the two ships is less than 2 nautical miles, the minimum encounter time (TCPA) is greater than 0, and the target ship is located within a fan-shaped bearing of 5° to 112.5° or 247.5° to 355° of the ship.
[0019] Furthermore, step S3, which involves constructing a support vector machine classification model for ships, includes:
[0020] S31, Suppose we have a known set of ship sample numbers (x) i ,y i ), where x∈R, y∈{-1,1}, i=1,2,...,N;
[0021] S32, Select an appropriate kernel function K(x)i ,y i With appropriate parameters C, the support vector machine problem for nonlinear samples of ships is transformed into an optimization problem: Where, α i For Lagrange multipliers;
[0022] S33, Solve the optimization problem to obtain...
[0023] S34, select α * A positive component 0≤α * ≤C, and calculate the threshold.
[0024] S35, Construct the decision function
[0025] Further, the angle θ of each azimuth region in the ship encounter bearing map described in step S3, and the distance relationship between each ship in the bearing region and the ship at the center point of the encounter bearing map, include: 2°<θ≤5°, the distance between the two ships is less than 6 nautical miles; 5°<θ≤45°, the distance between the two ships is less than 6 nautical miles; 45°<θ≤110°, the distance between the two ships is less than 3 nautical miles; 110°<θ≤200°, the distance between the two ships is less than 3 nautical miles; 200°<θ≤250°, the distance between the two ships is less than 3 nautical miles; 250°<θ≤310°, the distance between the two ships is less than 3 nautical miles; 310°<θ≤355°, the distance between the two ships is less than 3 nautical miles; 355°<θ≤360° or 0°<θ≤2°, the distance between the two ships is less than 3 nautical miles.
[0026] Further, the step of constructing the BP neural network in step S4 includes training the BP neural network. During training, an error evaluation is performed on the risk value output by the current BP neural network and the expected output value. The expected output value is obtained by a comprehensive evaluation method, specifically including:
[0027] S41, Pre-acquire the original AIS data of the ship in the ship collision accident as the data source for the fuzzy comprehensive evaluation method, and process it according to the steps S1-S3;
[0028] S42, The fuzzy comprehensive evaluation method is used to calculate the risk value of each ship in the ship collision accident, and the risk value is used as the expected output value Ex of the BP neural network;
[0029] S43, Use mean squared error to evaluate the prediction model results Training ends when the error MSE meets the preset conditions, where X is the predicted value of the collision hazard of the current BP neural network and T is the number of collision accident samples.
[0030] Furthermore, step S42, which involves calculating the risk value of each vessel in the collision accident, includes:
[0031] set up The danger membership degree of each parameter of the target vessel i to be encountered by this vessel, with values ranging from [0,1], i = 1,2,...,n; a D a K a B a DCPA a TCPA Let a be the weight of the danger membership degree of each parameter, with a value range of [0,1], and a D +a K +a B +a DCPA +a TCPA =1, Collision risk between this vessel and target vessel i The The calculation formulas include:
[0032] Among them, the latest avoidance distance D1 = H1H2H3D LA The distance that can be avoided is D2 = H1H2H3R. i ,in, H1 depends on visibility, H2 is determined by the conditions of the waters and the channel, H3 depends on human factors such as the experience, skill, and reaction time of the boat operator, and D LA For the latest rudder application distance, take 12 times the ship length, B i The bearing of the target vessel relative to this vessel;
[0033] Where W = 2 is a constant, C is the collision angle, and 0° ≤ C ≤ 180°K i The ratio of the speed of the target ship to the speed of the ship itself;
[0034] 0°≤B i ≤360°, where B i The bearing of the target vessel relative to this vessel;
[0035] in,
[0036] d2 = 2d1 is the ship collision distance, and d2 = 2d1 is the ship's attention distance;
[0037] in,
[0038] For the time of ship collision, Please note the time for the ship. Let be the relative speed between the target ship i and the current ship.
[0039] Furthermore, step S4, which uses the sparrow search algorithm to optimize and determine the node parameters of each layer of the BP neural network, includes the following steps:
[0040] Step 1: Initialize the sparrow search algorithm parameters. Initialization parameters include population size, number of discoverers, number of sparrows for reconnaissance and early warning, dimension of objective function, upper and lower bounds of initial values, maximum number of iterations or solution accuracy.
[0041] Step 2: Initialize the overall population, generate the initial population, and determine the fitness function, where network error is selected as the fitness function f. i ;
[0042] Step 3, Individual Fitness Calculation: Calculate the fitness f of each sparrow. i Select the current optimal fitness f g and its corresponding position x b And the current worst fitness f w and its corresponding position x w ;
[0043] Step 4: Position Update: Select the top p with the best fitness. Num One sparrow is designated as the discoverer, and the rest as the joiners. Then, the positions of the discoverers and joiners are updated. s sparrows are randomly selected from the sparrow population. Num Only sparrows conduct reconnaissance and early warning, and update their locations;
[0044] Step 5, Update fitness values: After one iteration, recalculate the fitness value f for each sparrow. i The average fitness value f of the sparrow population avg ;
[0045] Step 6: Based on the current state of the sparrow population, update the optimal position x experienced by the entire population. b and its fitness f g And the worst position x w and its fitness f w .
[0046] The present invention also proposes an apparatus for calculating ship collision risk, the apparatus comprising a memory and a processor, the memory storing at least one program, the at least one program being executed by the processor to implement the method for calculating ship collision risk as described above.
[0047] A computer-readable storage medium, characterized in that the storage medium stores at least one program, which is executed by a processor to implement the method for calculating ship collision risk as described above.
[0048] The above technical solution has the following technical effects:
[0049] The technical solution for calculating ship collision risk provided by this invention first acquires the target AIS data information of the ship, obtains encounter situation information based on the target AIS data information, and calculates ship collision parameters using the encounter situation information; secondly, it determines encounter situation data that meets preset ship encounter situation data screening conditions; then, it constructs a support vector machine classification model, combines preset collision avoidance rules to learn and classify the encounter situation data, and obtains a ship encounter bearing map; finally, it constructs a backpropagation neural network to predict the collision risk value between the target ship and the ship in the encounter bearing map. The encounter classification map and calculated collision risk provided by this solution enable ships to determine the navigation status of each ship in advance during navigation and predict possible collision risks, which is of great significance for reducing maritime collision accidents and ensuring navigation safety. Attached Figure Description
[0050] Figure 1 This is a flowchart illustrating a method for calculating ship collision risk according to an embodiment of the present invention;
[0051] Figure 2 This is a schematic diagram illustrating the combination of the geodetic fixed coordinate system and the shipboard coordinate system in a method for calculating ship collision risk according to an embodiment of the present invention.
[0052] Figure 3 This is a schematic diagram of a typical situation type identification model used in a method for calculating ship collision risk according to an embodiment of the present invention;
[0053] Figure 4 This is a ship encounter bearing map obtained in a method for calculating ship collision risk according to an embodiment of the present invention;
[0054] Figure 5 This is a flowchart illustrating the construction of a BP neural network in a method for calculating ship collision risk according to an embodiment of the present invention.
[0055] Figure 6 This is a schematic diagram of the Euclidean spatial distance function involved in the basis function fitting output expression of the BP neural network in the method for calculating ship collision risk according to an embodiment of the present invention.
[0056] Figure 7 This is a schematic diagram of an apparatus for calculating ship collision risk according to an embodiment of the present invention. Detailed Implementation
[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0058] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments.
[0059] Example 1:
[0060] Figure 1 This is a flowchart illustrating a method for calculating ship collision risk according to an embodiment of the present invention. Figure 1 The method described in this embodiment of the invention includes:
[0061] S1. Acquire the target AIS data of the vessel, obtain the encounter situation information based on the target AIS data, and calculate the collision parameters using the encounter situation information. Specifically, the target AIS data includes speed, bearing, and position; the encounter situation information includes the relative distance, relative bearing, and course intersection angle of the vessels; and the collision parameters include the relative distance, relative speed, minimum encounter distance (DCPA), and minimum encounter time (TCPA) of the vessels.
[0062] S2, using pre-set filtering conditions for ship encounter situation data, filter out the encounter situation data of ships that meet the filtering conditions based on the encounter situation information and ship collision parameters.
[0063] S3. Construct a ship support vector machine classification model. Based on the support vector machine classification model and the preset collision avoidance rules, learn and classify the encounter situation data of the pre-selected samples that meet the screening conditions in the previous step to obtain the ship encounter bearing map.
[0064] S4. Construct a BP neural network and use the sparrow search algorithm to optimize and determine the node parameters of each layer of the BP neural network. Predict the collision risk value between the target ship and the ship in the encounter position map. The input terms of the BP neural network are the target ship's heading, target ship's speed, distance between the two ships, and relative bearing of the two ships. The output term is the collision risk value.
[0065] Specifically:
[0066] First, target AIS data of the vessel is acquired. Based on this target AIS data, encounter situation information is obtained, and collision parameters are calculated using this information. Specifically, target AIS data includes speed, bearing, and position; encounter situation information includes relative distance, relative bearing, and course intersection angle between vessels; and collision parameters include relative distance, relative speed, minimum encounter distance (DCPA), and minimum encounter time (TCPA).
[0067] Secondly, using the pre-set screening criteria for ship encounter situation data, the encounter situation data between the ship and the target ship that meet the above screening criteria are selected based on the encounter situation information and ship collision parameters. The encounter situation data is determined by the encounter situation information.
[0068] Figure 2 This is a schematic diagram illustrating the combination of a geodetic fixed coordinate system and a shipboard coordinate system in a method for calculating ship collision risk according to an embodiment of the present invention. Specifically, as shown... Figure 2 As shown, TC is the ship's heading, Q is the ship's angle as seen from the other ship, and TB is the ship's true bearing as seen from the other ship; similarly, TB1 is the other ship's heading, Q1 is the other ship's angle as seen from the ship, and TB... 00 To determine the true bearing of this ship for other ships. TC is related to TB and Q:
[0069] TB = Q + TC.
[0070] The conversion relationship between shipboard coordinates and fixed geodetic coordinates is: [X,Y]=[x,y]·A+[X0,Y0], where [x,y] are the shipboard coordinates. [X0,Y0] represents the ship's current coordinates in the geodetic fixed coordinate system.
[0071] Let the geodetic coordinates of this ship be (x0, y0), its speed be v0, and its heading be C0; let the geodetic coordinates of the target ship be (x0, y0). R ,y R Let the speed be v1 and the heading be C1, and let Δx = x R -x0, Δy=y R -y0, then,
[0072] Distance between the two ships
[0073] relative speed
[0074]
[0075]
[0076] Among them, the relative velocity on the X-axis Relative velocity on the Y-axis For relative heading, α T This is the true bearing of our ship relative to the target ship.
[0077] Specifically, Figure 3 This is a schematic diagram of a typical situation type identification model used in a method for calculating ship collision risk according to an embodiment of the present invention. Figure 3As shown, other vessels coming from 0° to 5° or 355° to 360° directly in front of the bow are all oncoming vessels; other vessels coming from 5° to 112.5° on the starboard side or 247.5° to 355° on the port side are all crossing vessels; and other vessels coming from 112.5° to 247.5° aft of the main vessel are all overtaking vessels.
[0078] Based on this situation type identification model, the filtering criteria for ship encounter situation data are set as follows:
[0079] The screening criteria for a head-on encounter are set as follows: both ships are motorized vessels, both ships are moving in opposite or nearly opposite directions, and the target ship is located within a fan-shaped bearing of 355° to 360° or 0° to 5° of the ship. The screening criteria for an overtaking situation are set as follows: the velocity vector component of the following ship in the direction of motion of the preceding ship exceeds the velocity of the preceding ship, the distance between the two ships is less than 4 nautical miles, and the target ship is located within a fan-shaped bearing of 112.5° to 247.5° of the ship. The screening criteria for a cross encounter situation are set as follows: the minimum encounter distance DCPA of the two ships is less than 2 nautical miles, the minimum encounter time TCPA is greater than 0, and the target ship is located within a fan-shaped bearing of 5° to 112.5° or 247.5° to 355° of the ship.
[0080] Specifically, based on the three encounter scenarios mentioned above, the AIS data of vessels in encounter situations are classified into face-to-face encounters, cross encounters, and overtaking situations. The vessel AIS trajectory data is converted into one-to-one relative motion data, and information such as relative bearing, DCPA, TCPA, and relative distance of the vessels in the encounter situation are calculated.
[0081] Specifically, the processing of raw ship AIS data obtained from AIS base stations includes:
[0082] Remove abnormal data from the original ship AIS data; decode the ship AIS data after removing abnormal data, match the decoded AIS data according to preset matching rules to obtain ship position information; construct the ship's trajectory in each time period based on the position information to obtain a set of ship trajectories, where each time period's trajectory includes the start point, end point, and trajectory feature points;
[0083] Based on the above coordinate transformation method, the information in the ship trajectory set is transformed into the geodetic fixed coordinate system XOY to obtain the target AIS data information; then, based on the target AIS data information, the encounter situation information including speed, bearing, and position is obtained; further, using the above method, the encounter situation information is processed to calculate the collision parameters of the ship, including relative distance, relative speed, minimum encounter distance DCPA, and minimum encounter time TCPA.
[0084] Next, a ship support vector machine classification model is constructed. Based on the support vector machine classification model and the preset collision avoidance rules, the encounter situation data of the pre-selected samples that meet the above screening conditions are learned and classified to obtain the ship encounter bearing map.
[0085] Specifically, Support Vector Machine (SVM) was proposed in 1964 and experienced rapid development in the 1990s, leading to a series of improved and extended algorithms. It has been applied to pattern recognition problems such as facial recognition and text classification. The core idea of the SVM algorithm is to assume that the sample points in the original space cannot be directly linearly separated. A nonlinear transformation process is then used to convert these points into a corresponding high-dimensional feature space. Various optimization algorithms are then employed to find the maximum classification margin, thus achieving linear separability of the sample points in the transformed high-dimensional space. A subset of sample points lie above the hyperplane of the maximum classification margin; these sample points are the support vectors. SVM was initially proposed to handle the classification problem of linearly separable samples, assuming the sample dataset is (x1, y1), (x2, y2), ..., (x...). n ,y n Let x ∈ R, y ∈ {-1, 1}, i = 1, 2, ..., N. Here, N is the number of samples, n is the dimension of the samples, x is a sample, and y is the sample category. Avoidance maneuvers include port turn, starboard turn, and maintaining course and speed. This paper sets the input parameters as: distance between the two ships, bearing of the ship, bearing of the target ship, speed of the ship, and speed of the target ship. The output parameter is the type of ship encounter situation. Based on AIS data from the selected coastal area of Fujian within three months as samples, and using the encounter situation data extracted by the method described above as a basis, an SVM training data sample set is constructed. The SVM linear problem can then be transformed into the following equation.
[0086]
[0087] Among them, [ω T x i +b] represents the distance between point x and the hyperplane. For nonlinear classification problems, when the sample dataset is nonlinearly separable in a low-dimensional space, a mapping transformation is used to transform these sample points into a high-dimensional feature space, satisfying that they are linearly separable in this space. This transforms the sample dataset (x1,x1), (x2,x2), ..., (x... n ,x n ) maps to (Φ1,Φ1), (Φ2,Φ2),…, (Φ n ,Φ nThen, in the high-dimensional space, the generalized linear SVM classification decision function is solved. That is, a very complex classifier must be built in the low-dimensional space, and the sample points are mapped to a high-dimensional space, where the optimal hyperplane is then solved. The classifier in the high-dimensional space is simpler than the one in the low-dimensional space. At this point, the Lagrange multiplier α is introduced. i Then the dual problem of the original problem is transformed into the equation:
[0088]
[0089] In ship encounter problems, if Φ(x) does not appear independently, if there exists some function K(x) i ,x j )=Φ(x i ) T Φ(x j The function in this equation is called the kernel function. Since solving the kernel function is easier than solving Φ(x), the nonlinear vector machine is transformed into its dual problem, and the above equation can be transformed into the following equation:
[0090]
[0091] This dual problem must have a solution, which is α*=(α1*,...α l *) T , so that:
[0092]
[0093] The above analysis allows us to establish a mathematical description of the encounter situation support vector machine used to determine the ship encounter bearing map:
[0094] ① Suppose we have a known set of ship sample numbers (x) i ,y i ), where x∈R, y∈{-1,1}, i=1,2,...,N;
[0095] ② Select an appropriate kernel function K(x) i ,y i With appropriate parameters C, the support vector machine problem for nonlinear samples of ships is transformed into an optimization problem: Where, α i For Lagrange multipliers;
[0096] ③ Solve the optimization problem to obtain...
[0097] ④ Select a * A positive component 0≤a * ≤C, and calculate the threshold.
[0098] ⑤ Construct decision functions
[0099] Based on the SVM classification model constructed above, the ship encounter, cross-encounter, and overtaking data extracted based on the above situation type identification model and its set data filtering conditions are learned and classified respectively. All SVM classification results are combined with collision avoidance rules to obtain a ship encounter bearing map.
[0100] Furthermore, to facilitate use by crew members, and considering actual navigational conditions, all classification angles are rounded to obtain the final ship encounter bearing chart, such as... Figure 4 As shown in Table 1, the distance parameters between all target vessels within the same azimuth angle and the vessel in this azimuth diagram are consistent, and the possible collision avoidance measures are also consistent.
[0101] Table 1
[0102] Orientation area Distance between the two ships (NM) Azimuth θ (°) A Less than 6 NM 2<θ≤5 B Less than 6 NM 5<θ≤45 C Less than 3NM 45<θ≤110 D Less than 3NM 110<θ≤200 E Less than 3NM 200<θ≤250 F Less than 3NM 250<θ≤310 G Less than 3NM 310<θ≤355 H Less than 3NM 355θ≤2
[0103] For example, by learning and classifying different situation type identification models and the encounter situation data extracted under the data filtering conditions set by the identification models, the resulting encounter orientation maps may have some differences.
[0104] Finally, a BP neural network is constructed, and the sparrow search algorithm is used to optimize and determine the node parameters of each layer of the BP neural network to predict the collision risk value between the target ship and the ship in the encounter location map. The input terms of the BP neural network are the target ship's heading, the target ship's speed, the distance between the two ships, and the relative bearing of the two ships, and the output term is the collision risk value.
[0105] Figure 5 This is a schematic diagram illustrating the process of constructing a BP neural network in a method for calculating ship collision risk according to an embodiment of the present invention. Figure 5 The process described includes: normalizing the training data of the BP neural network, for example, normalization includes removing outliers from the original AIS data; initializing the BP algorithm parameters, including processing the original AIS data to obtain intermediate data; determining the input and output parameters; calculating the output of the hidden layer and output layer nodes; calculating the training and error; if the preset error conditions are met, the BP neural network training ends and can be used to calculate the hazard of newly collected ship AIS data; otherwise, the hidden layer error is calculated, the weights are adjusted according to the error gradient, and the input and output parameters are redefined for continued training.
[0106] Specifically, based on the ship encounter situation identification model described above, a neural network combined with fuzzy comprehensive evaluation is used to calculate the ship collision risk more objectively. Based on the pre-processed AIS information, collision risk information such as ship speed, bearing, heading, and the positions of the two ships is obtained.
[0107] The BP neural network training dataset contains 3000 samples, and the network test dataset contains 1000 samples. It selects raw AIS data, calculated intermediate data, and CR (Computational Recognition) data from each of the 2000 existing collision accidents, obtained using the fuzzy comprehensive evaluation method. i value.
[0108] The fuzzy comprehensive evaluation method was used to calculate the risk value CR of each ship in the aforementioned ship collision accident. i The risk level is then used as the expected output value Ex of the BP neural network. The mean squared error is selected. The training results of the BP neural network model are evaluated. The training ends when the error MSE meets the preset conditions. Here, X is the predicted value of the collision risk of the current BP neural network training network, and T = 2000 is the set number of AIS ship data.
[0109] This embodiment selects four neural network input terms: target ship's course, other ship's speed, relative distance between the two ships, and relative bearing between the two ships. Then, the CR is calculated using the fuzzy comprehensive evaluation method. i As the expected output value of the neural network.
[0110] Among them, the CR calculated by the fuzzy comprehensive evaluation method i Specifically as follows:
[0111] set up The danger membership degree of each parameter of the target vessel i to be encountered by this vessel, with values ranging from [0,1], i = 1,2,...,n; a D a K a B a DCPA a TCPA Let a be the weight of the danger membership degree of each parameter, with a value range of [0,1], and a D +a K +a B +a DCPA +a TCPA =1, Collision risk between this vessel and target vessel i The distance membership function Membership function of the speed ratio of the two ships Relative orientation membership function DPCA membership function TCPA membership function The calculation formulas are as follows:
[0112] Among them, the latest avoidance distance D1 = H1H2H3D LA The distance that can be avoided is D2 = H1H2H3R. i ,in, H1 depends on visibility, H2 is determined by the conditions of the waters and the channel, H3 depends on human factors such as the experience, skill, and reaction time of the boat operator, and D LA For the latest rudder application distance, take 12 times the ship length, B i The bearing of the target vessel relative to this vessel;
[0113] Where W = 2 is a constant, C is the collision angle, and 0° ≤ C ≤ 180°K i The ratio of the speed of the target ship to the speed of the ship itself;
[0114] 0°≤B i ≤360°, where B i The bearing of the target vessel relative to this vessel;
[0115] in,
[0116] d2 = 2d1 is the ship collision distance, and d2 = 2d1 is the ship's attention distance;
[0117] in,
[0118] For the time of ship collision, Please note the time for the ship. Let be the relative speed between the target ship i and the current ship.
[0119] In this implementation, the BP neural network is trained by function approximation, that is, the neural network is trained to become a nonlinear function that can represent the mapping relationship between the input data items and the collision risk of the output items.
[0120] The basis function fitting output expression is:
[0121] A = F l (||Wp||·B)=radbas(||Wp||·B)
[0122] In the formula, radbas represents the basis of the radial basis functions, and the basis sets are usually orthogonal. For example... Figure 6 The given information shows that ‖Wp‖ is the Euclidean distance function.
[0123] The distance function can be expressed as:
[0124]
[0125] For different hidden layers, their input and output parameters have the same dimension, and their input vector is:
[0126] P = [p1, p2, ..., pn]
[0127] In the formula, n represents the number of hidden layers in the neural network.
[0128] The activation function tansig can be calculated using the following formula:
[0129]
[0130] The threshold function is:
[0131] B l =[B1,B2,...,Bn] l ,
[0132] The intermediate output vector of the i-th hidden layer can then be defined as:
[0133] n l =K l +B l ,
[0134] K l Let l be the connection weight vector between the input and the threshold function, where l is the dimension.
[0135] The intermediate layer operation result is defined as:
[0136] A l =F l (K l +B l ),
[0137] Following the same iterative process, the weights and threshold vectors of each layer can be obtained, and the final output value can be acquired.
[0138] A = F i+1 (K 2 F i (K l +B l )+B i ),
[0139] The neural network collision hazard model achieves a small fitting error and satisfactory results. Then, the fuzzy comprehensive evaluation model is combined to predict the collision hazard of ships.
[0140] To determine the parameters of a backpropagation (BP) neural network, embodiments of this invention introduce a sparrow search algorithm to optimize the parameters of nodes at each layer of a typical BP neural network. The sparrow search algorithm can optimize the parameters of nodes at each layer of a typical BP neural network, thereby reducing the impact of training stagnation and local minima on the model's prediction results. The specific steps are as follows:
[0141] Step 1: Initialize the sparrow search algorithm parameters. Initialization parameters include population size, number of discoverers, number of sparrows for reconnaissance and early warning, dimension of the objective function, upper and lower bounds of the initial values, maximum number of iterations, or solution accuracy.
[0142] Step 2: Initialize the population. The population is initialized, including generating an initial population and determining the fitness function. In this model, network error is chosen as the fitness function f. i This embodiment uses a Tent chaotic sequence to initialize the population.
[0143] Step 3: Individual Fitness Calculation. Calculate the fitness f of each sparrow. i Select the current optimal fitness f g and its corresponding position x b And the current worst fitness f w and its corresponding position x w .
[0144] Step 4: Position Update. Select the top p with the best fitness. Num One sparrow is designated as the discoverer, and the rest as the joiners. The positions of the discoverers and joiners are then updated. s sparrows are randomly selected from the sparrow population. Num Only sparrows conduct reconnaissance and early warning, and update their locations.
[0145] Step 5: Update fitness values. After one iteration, recalculate the fitness value f for each sparrow. i The average fitness value f of the sparrow population avg When f i ≤f avg When f = 0, it indicates the occurrence of "clustering," and Gaussian mutation is performed. If the result is better than the original individual, the mutated individual replaces the original individual; otherwise, the original individual remains unchanged. i >f avg When this occurs, it indicates a "divergent" trend. Based on the Tent chaotic perturbation of individual i, if the perturbed individual has better performance, then the perturbed individual is used to replace the unperturbed individual; otherwise, the original individual remains unchanged.
[0146] Step 6: Judgment. Based on the current state of the sparrow population, update the optimal position x that the entire population has experienced. b and its fitness fg And the worst position x w and its fitness f w .
[0147] The above method is used to construct the encounter bearing map of the ship, and the collision risk value of the ship with other target ships is predicted by the BP neural network. Then, according to the specific bearing and collision risk of the target ship, the collision avoidance operation is carried out with reference to the preset collision avoidance rules.
[0148] In this embodiment, the method first acquires the target AIS data of the vessel, obtains encounter situation information based on the target AIS data, and calculates vessel collision parameters using the encounter situation information. Next, it determines encounter situation data that meets preset vessel encounter situation data filtering conditions. Then, it constructs a support vector machine classification model, combines preset collision avoidance rules to learn and classify the encounter situation data, and obtains a vessel encounter bearing map. Finally, it constructs a backpropagation neural network to predict the collision risk value between the target vessel and the vessel in the encounter bearing map. During vessel navigation, the ability to determine the navigation status of each vessel in advance and predict potential collision risks is of great significance for reducing maritime collision accidents and ensuring navigation safety.
[0149] Example 2:
[0150] The present invention also provides an apparatus for calculating ship collision risk, such as... Figure 7 As shown, the device includes a processor 701, a memory 702, a bus 703, and a computer program stored in the memory 702 and executable on the processor 701. The processor 701 includes one or more processing cores. The memory 702 is connected to the processor 701 via the bus 703. The memory 702 is used to store program instructions. When the processor executes the computer program, it implements the steps in the above-described method embodiment of Embodiment 1 of the present invention.
[0151] Furthermore, as an executable solution, the device for calculating ship collision risk can be a computer unit, which can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer unit may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above-described structure of the computer unit is merely an example and does not constitute a limitation on the computer unit. It may include more or fewer components, or combine certain components, or use different components. For example, the computer unit may also include input / output devices, network access devices, buses, etc., and this embodiment of the invention does not limit this.
[0152] Furthermore, as an executable solution, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. The processor is the control center of the computer unit, connecting various parts of the entire computer unit via various interfaces and lines.
[0153] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the computer unit by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0154] Example 3:
[0155] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in the embodiments of the present invention.
[0156] If the modules / units integrated in the computer unit are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0157] Although the invention has been specifically shown and described in conjunction with preferred embodiments, those skilled in the art should understand that various changes in form and detail may be made to the invention without departing from the spirit and scope of the invention as defined in the appended claims, all of which shall be within the scope of protection of the invention.
Claims
1. A method for calculating ship collision risk, characterized in that, include: S1, acquire the target AIS data information of the vessel, obtain the encounter situation information based on the target AIS data information, and calculate the vessel collision parameters using the encounter situation information. The target AIS data information includes speed, bearing, and position. The encounter situation information includes the relative distance, relative bearing, and vessel heading intersection angle of the vessels. The collision parameters include the relative distance, relative speed, minimum encounter distance DCPA, and minimum encounter time TCPA of the vessels. S2, using pre-set filtering conditions for ship encounter situation data, based on the encounter situation information and the ship collision parameters, filter out the encounter situation data of ships that meet the filtering conditions, wherein the encounter situation data is determined by the encounter situation information; S3, Construct a ship support vector machine classification model, and learn and classify the encounter situation data of the pre-selected samples according to the support vector machine classification model and the preset collision avoidance rules to obtain the ship encounter bearing map; S4. Construct a BP neural network and use a sparrow search algorithm to optimize and determine the node parameters of each layer of the BP neural network. Predict the collision risk value between the selected ship and the target ship based on the encounter bearing map. The input terms of the BP neural network are the target ship's heading, target ship's speed, distance between the two ships, and relative bearing between the two ships. The output term is the collision risk value. The collision risk value is calculated by weighting the distance membership degree, the speed ratio membership degree of the two ships, the relative bearing membership degree, the DPCA membership degree, and the TCPA membership degree using the fuzzy comprehensive evaluation method.
2. The method according to claim 1, characterized in that, The step of obtaining the target AIS data information of the ship in step S1 includes: S11, Remove abnormal data from the original ship AIS data; S12, Decode the ship's AIS data after removing abnormal data to obtain the ship's position information; S13, Based on the location information, construct the ship's trajectory in each time period to obtain a set of ship trajectories, wherein the trajectory in each time period includes a starting point, an ending point, and trajectory feature points; S14, Establish a fixed geodetic coordinate system XOY for the ship, convert the information in the trajectory set into the coordinate system XOY, and obtain the target AIS data information. The origin of the fixed geodetic coordinate system XOY is a preset point, the X-axis points due east, and the Y-axis points due north.
3. The method according to claim 1, characterized in that, The pre-set filtering criteria for ship encounter situation data in step S2 include: Let one ship be the target ship and the other be the target ship. Let the ship's coordinate system be xoy, with its origin o at the ship's center of mass, the y-axis pointing towards the bow at 0°, and the x-axis pointing towards the ship's right bank. Then, The conditions for screening the encounter situation are set as follows: both ships are motorized vessels, both ships are in opposite or nearly opposite directions, and the target ship is located within a fan-shaped bearing range of 355° to 360° or 0° to 5° of the ship. The overtaking situation screening criteria are set as follows: the velocity vector component of the following ship in the direction of the preceding ship's motion exceeds the velocity of the preceding ship, the distance between the two ships is less than 4 nautical miles, and the target ship is located within the fan-shaped bearing of the following ship from 112.5° to 247.5°. The cross-encounter situation screening criteria are set as follows: the minimum encounter distance (DCPA) between the two ships is less than 2 nautical miles, the minimum encounter time (TCPA) is greater than 0, and the target ship is located within a fan-shaped bearing of 5° to 112.5° or 247.5° to 355° of the ship.
4. The method according to claim 1, characterized in that, The steps in step S3 to construct the support vector machine classification model for ships include: S31, Suppose the known set of ship samples is... Where x∈R, y∈{-1,1}, i=1,2,...,N; where N is the number of samples, x is a sample, and y is the sample category; S32, Select an appropriate kernel function With appropriate parameters C, the support vector machine problem for nonlinear samples of ships is transformed into an optimization problem: ,in, For Lagrange multipliers; S33, Solve the optimization problem to obtain... ; S34, Select A positive component And calculate the threshold ; S35, Construct the decision function .
5. The method according to claim 1, characterized in that, The angles of each azimuth region divided in the ship encounter bearing map described in step S3 The distance relationships between each vessel in the bearing area and the vessel at the center point of the encounter bearing map include: 2° < 5°, the distance between the two ships is less than 6 nautical miles; 5° < 45°, the distance between the two ships is less than 6 nautical miles; 45° < 110°, the distance between the two ships is less than 3 nautical miles; 110° < 200°, the distance between the two ships is less than 3 nautical miles; 200° < 250°, the distance between the two ships is less than 3 nautical miles; 250° < 310°, the distance between the two ships is less than 3 nautical miles; 310° < 355°, the distance between the two ships is less than 3 nautical miles; 355° < 360° or 0° 2°, the distance between the two ships is less than 3 nautical miles.
6. The method according to claim 1, characterized in that, Step S4, constructing the BP neural network, includes training the BP neural network. During training, the error between the current BP neural network output risk value and the expected output value is evaluated. The expected output value is obtained using a comprehensive evaluation method, specifically including: S41, Pre-acquire the original AIS data of the ship in the ship collision accident as the data source for the fuzzy comprehensive evaluation method, and process it according to the steps S1-S3; S42, The fuzzy comprehensive evaluation method is used to calculate the risk value of each ship in the ship collision accident, and this risk value is used as the expected output value of the BP neural network. ; S43, Use mean squared error to evaluate the prediction model results Training ends when the error MSE meets the preset conditions, where X is the predicted value of the collision risk of the current BP neural training network, and T is the set number of AIS ship data.
7. The method according to claim 6, characterized in that, Step S42, which calculates the risk value of each vessel in the collision accident, includes: set up , , , , The danger membership degree of each parameter of the target vessel i to be encountered by this vessel, with a value range of [0,1]. ; , , , , The weights for the danger membership of each parameter are defined, with values ranging from [0,1]. Collision risk between this vessel and target vessel i The , , , , The calculation formulas include: Among them, the latest avoidance distance Avoidance measures can be taken at a distance ,in, H1 depends on visibility, H2 is determined by the conditions of the waters and the channel, and H3 depends on the experience, skill, and reaction time of the boat operator. The latest rudder application distance is calculated as 12 times the ship's length. The bearing of the target vessel relative to this vessel; Where W=2 is a constant, C is the collision angle, and 0°≤C≤180° The ratio of the speed of the target ship to the speed of the ship itself; , ,in, The bearing of the target vessel relative to this vessel; ,in, The distance of a ship collision. Be aware of the distance for ships; in, For the time of ship collision, Please note the time for the ship. Let be the relative speed between the target ship i and the current ship.
8. The method according to claim 1, characterized in that, The step S4, which uses the sparrow search algorithm to optimize and determine the node parameters of each layer of the BP neural network, includes the following steps: Step 1: Initialize the sparrow search algorithm parameters. Initialization parameters include population size, number of discoverers, number of sparrows for reconnaissance and early warning, dimension of objective function, upper and lower bounds of initial values, maximum number of iterations or solution accuracy. Step 2: Initialize the overall population, generate the initial population, and determine the fitness function, where network error is selected as the fitness function. ; Step 3, Individual Fitness Calculation: Calculate the fitness of each sparrow. Select the current optimal fitness and its corresponding position and the current worst fitness and its corresponding position ; Step 4, Position Update: Select the front with the best adaptability. One sparrow is designated as the discoverer, and the rest as the joiners. The positions of the discoverer and joiners are then updated. (This process is repeated, but the last part is unclear and likely refers to a separate task involving a random selection of sparrows.) Only sparrows conduct reconnaissance and early warning, and update their locations; Step 5, Update Fitness Values: After each iteration, recalculate the fitness value for each sparrow. and the average fitness value of sparrow populations ; Step 6: Based on the current state of the sparrow population, update the optimal position experienced by the entire population. and its fitness and worst position and its fitness .
9. A device for calculating ship collision risk, characterized in that, The device includes a memory and a processor, the memory storing at least one program that is executed by the processor to implement the method for calculating ship collision risk as described in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that, The storage medium stores at least one program, which is executed by a processor to implement the method for calculating ship collision risk as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Collision risk determination method, apparatus and device, and storable medium
CN111709633A
Ship intention recognition and reasoning method and system based on knowledge graph
CN114443860A