Classification method of cause types of water traffic accidents based on heterogeneous graph neural network
The modeling of water traffic accident data through heterogeneous graph neural network solves the problem of processing multi-source heterogeneous data and high-dimensional nonlinear coupling relationships, and realizes efficient classification of the causes of water traffic accidents.
Patent Information
- Application Number
- CN202410514359.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-26
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-04-26
AI Technical Summary
The prior art is difficult to fully model multi-source heterogeneous water traffic accident data, and it lacks effective modeling of the correlation between various factors in the accident.
A heterogeneous graph neural network is used to construct heterogeneous graphs and perform feature encoding, and the heterogeneous graph is reconstructed using heterogeneous feature mapping method. Combined with the multi-head R-GAT calculation module, graph reconstruction module and self-supervision strengthening module, a classification model for cause causes of water traffic accidents is constructed.
Effective modeling of water traffic accident data is realized, more ship accident information is retained, and high-dimensional nonlinear coupling relationship information between the basic accident information nodes and other nodes is able to extract, improving the accuracy of accident-causing type classification.
Smart Images

Figure CN118800058B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water transportation, and in particular to a method for classifying causal types of water transportation accidents based on a heterogeneous graph neural network. Background Art
[0002] At present, the classification modeling of the causes of water traffic accidents using maritime accident data has the following difficulties that need to be solved: first, the traditional classification method of the causes of water traffic accidents is usually based on expert knowledge as the prior of the model, which makes the proposed method subjective and difficult to adapt to the needs of different scenarios; second, water traffic accident reports are registered and recorded by multiple institutions and departments. The diversity of data sources makes water traffic accident data present a multi-source heterogeneous nature, and traditional methods cannot effectively process these data; third, there is high-level associative semantic information between the various parts of the traffic accident report, and traditional methods cannot make full use of such information; there is a high-dimensional nonlinear coupling relationship between the information of each element, and traditional theoretical methods are difficult to conduct a comprehensive analysis. Summary of the invention
[0003] The present invention provides a method for classifying the cause types of water traffic accidents based on a heterogeneous graph neural network, which solves the technical problems in the prior art that the prior art is difficult to fully model multi-source heterogeneous data and lacks effective modeling of the correlation between various elements in the accident.
[0004] The present invention can be achieved through the following technical solutions:
[0005] A method for classifying the cause types of water traffic accidents based on heterogeneous graph neural networks comprises the following steps:
[0006] Step 1: Construct a heterogeneous graph G with basic information of the accident, basic information of the ship involved, specific cause of the accident and abstract cause of the accident as nodes, wherein the splicing method is used to complete the feature coding of the basic information of the accident and the basic information of the ship involved, the unique hot coding is used to complete the feature coding of the specific cause of the accident and the abstract cause of the accident, and the unique hot coding is used to complete the node relationship coding;
[0007] Step 2: Use the heterogeneous feature mapping method to reconstruct the heterogeneous graph G and convert it into a homogeneous graph G′. Then, take the union of the adjacency matrices corresponding to the homogeneous graph G′ and the heterogeneous graph G to obtain a new adjacency matrix, which is used as the final adjacency matrix A. r , and then the final adjacency matrix A r Perform graph structure regularization processing to obtain graph structure regularization loss term;
[0008] Step 3: Process the homogeneous graph G′ with the multi-head R-GAT computing module and input the embedding vector h 0 And calculate the new embedding vector hl+1 , and then embed the vector h l+1 After being processed by the fully connected layer and the softmax function in turn, the accident cause type classification cross entropy loss term is obtained. At the same time, the embedding vector h l+1 After being processed by the self-supervised reinforcement module, the self-supervised node association classification loss term is obtained.
[0009] Step 4: Construct a joint loss function using the graph structure regularization loss term, the accident cause type classification cross entropy loss term, and the self-supervised node association classification loss term. Update the model parameters through the back propagation algorithm until the joint loss function converges to achieve the classification of the cause types of water traffic accidents.
[0010] Furthermore, the following formula is used to construct the special codes of the basic information nodes of the accident and the basic information nodes of the involved ships:
[0011] x accid =concat(x death ,x view ,x wind ,x angle ,x sink ,x sit ,x col ,x leak ,x type )
[0012] x ship =concat(x year ,x mat ,x ton ,x load ,x length ,x width ,x mould ,x speed ,x s )
[0013] Among them, x accid The feature vector representation of the basic information node of the accident, x ship The feature vector representation of the basic information node of the ship involved, concat represents the concatenation of data, x death 、x view 、x wind 、x angle 、x leak 、x year 、x mat 、x length 、x width 、x mould 、x speed 、x sinkThey represent the number of deaths, visibility, wind force level, collision angle, leakage, ship age, hull material, ship length, ship width, depth, speed, and ship sinking situation. sit 、x col 、x type 、x s The unique hot encoding vectors represent the ship encounter situation, ship collision mode, ship accident type, and ship type respectively.
[0014] The wind force level is divided into three levels: light breeze, moderate wind and strong wind, which respectively represent wind speed less than level 2, wind speed between level 3 and level 6, and wind speed greater than or equal to level 7, and each level is assigned a value of 0, 1, and 2;
[0015] According to the "Navigation Visibility Classification Standard" defined by the International Maritime Organization, the visibility at the accident site is classified. A visibility distance of more than 2 nautical miles is assigned a value of 0, a visibility distance between 1-2 nautical miles is assigned a value of 1, and a visibility distance of less than 1 nautical mile is assigned a value of 2;
[0016] If the hull material is steel, the value is 2; if the hull material is wood, the value is 1;
[0017] The following formula is used to calculate the ship's sinking condition x sink ,
[0018] x sink =a1x ton +a2x con +a3x load +a4x crew
[0019] Among them, x ton 、x con 、x load 、x crew They represent ship tonnage, hull structure, cargo capacity and number of crew members respectively, α1, α2, α3, α4 represent the weight factors of their corresponding variables respectively,
[0020] When 0≤x sink <0.3, the characteristic of the ship sinking is assigned a value of 0; when 0.3≤x sink ≤0.7, the characteristic of the ship sinking is assigned a value of 1. sink When >0.7, the characteristic value of the ship sinking is assigned to 2.
[0021] Furthermore, the heterogeneous graph is represented as G=(V,E,X), where V represents a node set, E represents an edge set, and X represents a feature vector set of a node.
[0022] When using the heterogeneous feature mapping method to reconstruct a heterogeneous graph, the feature vectors x of different types of nodes are first converted into a Mapped to the same dimension, the embedded vector h after heterogeneous feature mapping is obtained 0 ,
[0023] h 0 =σ(W a x a +b a )
[0024] Among them, W a is the mapping matrix of the node, σ(·) is the sigmoid activation function, b a is the bias vector of the node;
[0025] Then calculate the embedding vector h 0 The similarity between them is used to obtain the feature similarity graph G′. Finally, the adjacency matrix A of the initial original graph G and the adjacency matrix A′ of the feature similarity graph G′ are combined to obtain a new adjacency matrix A r .
[0026] Further, the joint loss function is calculated using the following equation:
[0027]
[0028] Among them, λ self represents the self-supervised node-associated classification loss weight, λ rec represents the graph structure regularization weight, L self represents the self-supervised node association classification loss term, L rec represents the graph structure regularization loss term, L cls Represents the cross entropy loss term for accident cause type classification.
[0029] The beneficial technical effects of the present invention are:
[0030] 1) Use heterogeneous graphs to model water traffic accident data, transform complex multi-source heterogeneous data into homogeneous data, and retain more effective information on ship accidents;
[0031] 2) Using the one-hot encoding method, the abstract correlation information between factors is converted into an explicit vector representation and integrated into the heterogeneous graph, providing high-level correlation semantic information for the heterogeneous graph of water traffic accidents;
[0032] 3) A classification model for the cause of water traffic accidents constructed by a multi-head R-GAT computing module, a graph reconstruction module, and a self-supervised reinforcement module is used to adaptively weight neighbor information through a message passing mechanism while streamlining the graph structure to extract high-dimensional nonlinear coupling relationship information between the basic accident information node and other nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a structural schematic diagram of a heterogeneous graph of water traffic accidents of the present invention;
[0034] Figure 2 It is a structural schematic diagram of the classification model of the cause type of water traffic accidents of the present invention;
[0035] Figure 3 It is the visualization result of the classification of the cause types of water traffic accidents according to the present invention. DETAILED DESCRIPTION
[0036] The present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0037] See attached Figure 1 The present invention discloses a classification method for the cause type of water traffic accidents based on a heterogeneous graph neural network. Firstly, according to the characteristics of water traffic accident data, a heterogeneous graph is used to model the water traffic accident data, and multi-source heterogeneous data is converted into homogeneous data. Abstract correlation information between factors is introduced, which is converted into an explicit vector representation and integrated into the heterogeneous graph, so as to further enrich the information contained in the heterogeneous graph of water traffic accidents. Secondly, a classification model for the cause type of water traffic accidents is constructed. Through a multi-head R-GAT calculation module, the manifold information of the accident node is extracted. The joint graph reconstruction module and the self-supervised reinforcement module are used to optimize the model parameter size, so as to realize efficient communication of information between graph nodes. The trained model can obtain the cause influence weight coefficient according to the input initial node vector, so as to realize the classification of the cause type of water traffic accidents, overcome the limitation of human subjectivity based on the expert knowledge model, provide the cause influence weight coefficient for the accident for cause type classification, and can mine the potential cause of the accident when the accident data is not fully collected.
[0038] The details are as follows:
[0039] Step 1: Construct heterogeneous graphs and perform feature encoding
[0040] Considering the characteristics of ship accident data such as multi-source heterogeneity, strong attribute correlation, and rich semantic features, the basic information of the accident, the basic information of the involved ship, the specific cause of the accident, and the abstract cause of the accident are selected as nodes to construct a heterogeneous graph G, as shown in formula (1). It consists of a node set V, an edge set E, and a node feature set X. Among them, the splicing method is used to complete the feature coding of the basic information of the accident and the basic information of the involved ship, and the unique hot coding is used to complete the feature coding of the specific cause of the accident and the abstract cause of the accident. At the same time, the unique hot coding is used to complete the node relationship coding;
[0041] G=(V,E,X), (1)
[0042] Each node in the node feature set X The eigenvector of Represents, where a represents the attribute of the node, i represents the label of the node, and d represents the dimension of the node feature vector; Representation Node and The adjacency matrix A corresponding to the heterogeneous graph G is an n×n matrix, where n represents the number of nodes. ij The value of is shown in formula (2).
[0043]
[0044] The accident information contained in the node is numerically processed using unique hot encoding. The accident information vector is shown in formula (3):
[0045] x m =(x1,x2,…x n ), (3)
[0046] In the formula, m represents the information contained in the vector. For a certain accident information vector x m , which satisfies when x i =1, x j =0 and j∈{1,2,…,n}\{i}, n represents the number of categories under the information, and different information is represented by different one-hot encodings.
[0047] Based on the above rules, the present invention performs unique hot coding on the ship accident type, ship collision mode, ship encounter situation, ship type, accident abstract cause, and accident specific cause respectively.
[0048] Types of ship accidents include: ship collision, ship mechanical failure, grounding, fire or explosion, capsizing / sinking, and oil spill; modes of ship collision include: bow hitting bow, bow hitting stern, bow hitting midship, stern hitting midship, and midship hitting midship; ship encounter situations include: crossing encounter, head-on encounter, and overtaking; ship types include: supply ships, multi-purpose ships, engineering ships, roll-on / roll-off ships, chemical tankers, container ships, passenger ships, bulk carriers, tugboats, oil tankers, yachts, fishing boats, general cargo ships, self-unloading sand ships, and other types of ships; abstract causes of accidents include: 18 abstract causes such as improper driving / ship operation; specific causes of accidents include: 129 specific causes such as overloading leading to reduced stability.
[0049] When using the splicing method for feature encoding, considering that water traffic accident information contains rich feature information represented by qualitative or numerical intervals, assigning reasonable numerical values to it is a key factor in improving the performance of heterogeneous graph networks and restoring accident scenes. Therefore, data features such as wind intensity, environmental visibility, ship materials, and ship sinking conditions are quantified.
[0050] Wind intensity is divided into three levels: light breeze, moderate wind and strong wind, which respectively represent wind speed less than level 2, wind speed between level 3 and level 6, and wind speed greater than or equal to level 7, and each level is assigned a value of 0, 1, and 2;
[0051] According to the "Navigation Visibility Classification Standard" defined by the International Maritime Organization, the visibility at the accident site is classified, where visibility distances exceeding 2 nautical miles are assigned a value of 0; visibility distances between 1-2 nautical miles are assigned a value of 1; and visibility distances less than 1 nautical mile are assigned a value of 2;
[0052] Considering that different ship materials have an impact on the severity of the accident under the same accident environment, a value of 2 is assigned to steel ships and a value of 1 is assigned to wooden ships;
[0053] The sinking of a ship is an important indicator for judging the level of an accident. Through expert investigation and statistical analysis, the ship's tonnage, hull structure, cargo capacity, and number of crew members are comprehensively considered for weighted calculation, and the following formula (4) is used to calculate the sinking of the ship x sink ,
[0054] x sink =a1x ton +a2x con +a3x load +a4x crew (4)
[0055] Among them, x ton 、x con 、x load 、x crew They represent the ship tonnage, hull structure, cargo capacity and number of crew members respectively. α1, α2, α3 and α4 represent the weight factors of their corresponding variables respectively. When 0≤x sink <0.3, the characteristic of the ship sinking is assigned a value of 0; when 0.3≤x sink ≤0.7, the characteristic of the ship sinking is assigned a value of 1. sink When >0.7, the characteristic value of the ship sinking is assigned to 2.
[0056] Then, the following formula is used to construct the special codes of the basic information nodes of the accident and the basic information nodes of the involved ships:
[0057] x accid =concat(xdeath ,x view ,x wind ,x angle ,x sink ,x sit ,x col ,x leak ,x type )
[0058] x ship =concat(x year ,x mat ,x ton ,x load ,x length ,x width ,x mould ,x speed ,x s )
[0059] Among them, x accid The feature vector representation of the ship accident type node, x ship The feature vector representation of the node of the ship type involved, concat represents the concatenation of data, x death 、x view 、x wind 、x angle 、x leak 、x year 、x mat 、x length 、x width 、x mould 、x speed 、x sink They represent the number of deaths, visibility, wind force level, collision angle, leakage, ship age, hull material, ship length, ship width, depth, speed, and ship sinking situation. sit 、x col 、x type 、x s The unique hot encoding vectors represent the ship encounter situation, ship collision mode, ship accident type, and ship type respectively.
[0060] When encoding the node relationship, i.e., the edge of the heterogeneous graph, the association information between the nodes of the heterogeneous graph mainly includes three categories: the responsibility relationship between the ship involved and the accident (the sole responsibility of the ship involved in the accident, the secondary responsibility of the ship involved in the accident, the main responsibility of the ship involved in the accident, and the equal responsibility of the ship involved in the accident), the causal relationship between the accident and the cause (the abstract cause of the accident causes the specific cause of the accident, and the specific cause of the accident causes the accident), and the similarity relationship between accidents, which can be converted into machine language using the unique hot encoding method, and the node relationship matrix can be used. Indicates that r ij=(r1,r2,…r l ) is the unique hot encoding of the relationship between node i and node j, which is an element in the node relationship matrix.
[0061] Step 2: Construct a classification model for the causes of water traffic accidents
[0062] Reference Figure 2 ,The classification model mainly consists of three modules: graph reconstruction module, multi-head R-GAT calculation module, and self-supervised reinforcement module.
[0063] S2.1. Reconstruct the heterogeneous graph G and perform regularization based on the graph reconstruction module
[0064] In the actual application of water traffic accident data, there are the following problems:
[0065] 1) The collection and collation of water traffic accident data involves multiple departments, multiple data sources and data structures, which may lead to problems such as low data quality and inconsistent data features. In addition, the missing or wrong edges in the graph data will lead to loose and unclear connections between accident nodes and reduce the expressiveness and connectivity of the graph.
[0066] 2) The node types in the water traffic accident graph data are complex, and there are different associations between different types of nodes. Designing a reasonable graph structure can effectively reduce the computational complexity of the graph data and retain the effective representation information of the graph.
[0067] 3) In the water traffic accident graph data reasoning stage, erroneous or complex graph data structures may introduce noise and redundant information, affecting the accuracy of accident risk level assessment.
[0068] In summary, the feature mapping method is used to reconstruct the heterogeneous graph G and convert it into a homogeneous graph G′. Then, the adjacency matrices corresponding to the homogeneous graph G′ and the heterogeneous graph G are combined to obtain a new adjacency matrix, which is used as the final adjacency matrix A. r , and then the final adjacency matrix A r Perform graph structure regularization to obtain the regularized loss term, as follows:
[0069] 1. Use heterogeneous feature mapping to transform the feature vectors x of different types of nodes a Map to the same dimension and get the mapped embedding vector h 0 , the mapping calculation process is shown in formula (5):
[0070] h 0 =σ(W a x a +b a ) (5)
[0071] Among them, Wa is the mapping matrix of the node type, σ(·) is the sigmoid activation function, b a is the bias vector for this node type.
[0072] 2. Calculate the similarity between node features. By measuring the similarity between node features, infer the potential connection between nodes and obtain the feature similarity graph G′. The calculation process is shown in formula (6) and formula (7):
[0073]
[0074] Among them, Γ represents the cosine similarity calculation function, ∈∈[0,1] is used to control the threshold value of the density of the generated feature similarity graph, is a parameterized function used to represent the similarity between two nodes, W1 and W2 are parameter matrices that measure the importance of different node features, ⊙ represents the Hadamard product, A i ' j Represents the node-edge relationship of the feature similarity graph G′ generated by node similarity calculation. The adjacency matrix A of the original graph G and the adjacency matrix A′ of the feature similarity graph G′ are combined to obtain a new adjacency matrix A r This is the final adjacency matrix.
[0075] 3. Graph structure regularization is used to avoid overfitting of the model to the training data due to the adjacency matrix of the data graph being too dense. The L1 norm regularization term is introduced into the loss function to punish too many model parameters, making the model parameters tend to be sparse and improving the generalization ability of the model. The regularization loss term L rec Calculated by formula (8):
[0076] L rec =||A r || (8)
[0077] Among them, A r represents the final adjacency matrix, ||·|| represents the sum of the absolute values of each element in the matrix, that is, ||A r ||=∑|A r [i,j]|.
[0078] S2.2. Constructing multi-head R-GAT computing module and self-supervised reinforcement module
[0079] The homogeneous graph G′ is processed by the multi-head R-GAT computing module, and the input embedding vector h 0 And calculate the new embedding vector h l+1 , and then embed the vector h l+1After being processed by the fully connected layer and the softmax function in turn, the accident cause type classification cross entropy loss term is obtained; at the same time, the embedding vector h l+1 After being processed by the self-supervised reinforcement module, the self-supervised node association classification loss term is obtained.
[0080] 1. Multi-head R-GAT computing module
[0081] The multi-head R-GAT module includes attention heads and relation attention heads, which are used to parallelly process the correlation between information of different nodes and the correlation between relations of different nodes, that is, to learn and aggregate the features of accidents, involved ships, abstract causes and specific cause nodes, and extract the manifold information of accident nodes for the classification of causes of water traffic accidents.
[0082] First, the calculation process of the node attention feature vector of the lth layer R-GAT is shown in formula (9) and formula (10). The input of the 0th layer R-GAT network is the embedding vector h 0 :
[0083]
[0084] In formula (13), is a learnable weight matrix, K is the number of attention heads, is the attention weight parameter between node i and all neighboring nodes j, || represents the concatenation of vectors, N i represents the set of all neighbor nodes of node i; in formula (14), express and The feature dimension of , (the two dimensions are the same), v l A learnable value vector that converts node representations into scalar scores.
[0085] Secondly, considering that in the calculation process of the above attention heads, GAT only aggregates the representation of neighboring nodes along the node connection path, ignoring the information attached to the node relationship. Therefore, an additional relational attention head mechanism is used to expand the original attention feature vector calculation, and its calculation process is shown in formula (11), formula (12), and formula (13):
[0086]
[0087] In formula (11), M is the number of relational attention heads, r ij Represents the attribute vector representation of the relationship between node i and neighboring node j, which is input into a two-layer perceptron to obtain the calculation result W m1 With W m2 is the learnable weight parameter in the two-layer perceptron, bm1 With b m2 is the learnable bias vector in the two-layer perceptron, σ(·) is the sigmoid activation function, and relu(·) is the rectified linear unit. Formula (13) is used to calculate the result After softmax normalization, the attention weight score between the connection relationship between node i and neighboring node j is obtained The attention weight score will be used in formula (11) to score each relationship feature vector. In formula (11), is a learnable parameter, is the j-th relation feature vector in the l-th attention layer.
[0088] Finally, the feature vectors calculated by the attention head and the relational attention head are fused to obtain the updated node representation feature vector of node i. The specific calculation formulas are shown in formula (14) and formula (15):
[0089]
[0090] 2. Self-supervised reinforcement module
[0091] Due to the scarcity of water traffic accident data, the self-supervised reinforcement module is used to increase the amount and diversity of training data, thereby improving the performance and generalization ability of the model without using additional labeled data.
[0092] First, the node embedding vector output by the R-GAT calculation module is Given a node i, we calculate the M nodes with the highest and lowest similarity to node i according to formula (8) and formula (9), V i h is the set of M nodes with the highest similarity, V i l is the set of M nodes with the lowest similarity.
[0093] Secondly, concatenate the features of all nodes q and node i to get x iq =x i ||x q ,i≠q. For node v q , if v q ∈V i h , then their connection relationship label is recorded as y iq =1; otherwise, if v q ∈V i l , then their connection relationship label is recorded as y iq =0.
[0094] Finally, a fully connected neural network model is constructed to determine the similarity of node features, as shown in formula (16) and formula (17):
[0095]
[0096] Where W self is the learnable weight parameter, b self is a learnable bias, and σ represents the sigmoid function, which converts the output of the network into a probability value in the range of [0,1]. Formula (17) is used to calculate the cross entropy loss between the true value and the predicted value, where y iq is the real connection relationship label, is the connection relationship label predicted by the network, V i s =V i l ∪V i h .
[0097] 3. Training model based on joint loss function
[0098] A joint loss function is constructed with the graph structure regularization loss term, the accident cause type classification cross entropy loss term, and the self-supervised node association classification loss term. The model parameters are updated through the back propagation algorithm until the joint loss function converges.
[0099] The joint loss function is calculated using the following equation:
[0100]
[0101] Among them, λ self represents the self-supervised node-associated classification loss weight, λ rec represents the graph structure regularization weight, L self represents the self-supervised node association classification loss term, L rec represents the graph structure regularization loss term, L cls Represents the cross entropy loss term for accident cause type classification.
[0102] Use self-supervised node-associated classification loss weight λ self and graph structure regularization weight λ rec Reasonably allocate the influence of each loss item on the classification network, while taking into account the robustness and efficiency of the graph structure, and output high-precision classification results of the cause types of water traffic accidents.
[0103] In order to verify the actual performance of the classification and recognition method of the present invention, a subgraph of the constructed water traffic accident heterogeneous graph is selected for display, as shown in the attached figure. Figure 3As shown, the subgraph contains 50 nodes, of which 12 nodes are accident nodes, numbered from 0 to 11, and the human factor class, ship factor class, environmental factor class and management factor class are marked in blue, green, yellow and red respectively. When the classification and recognition method of the present invention is used to classify and predict the subgraph part, only the classification of nodes 8 and 10 is wrong. For the remaining 10 accidents, the present invention correctly classifies the types of accident causes. The accident node input information, the true value of the node classification result and the node classification prediction result are shown in the following table.
[0104]
[0105]
[0106] In the early stage of an accident, when the cause of the accident is unclear, formula (18) can be used to calculate the influence weight coefficient of the cause node on the accident node.
[0107]
[0108] The cause node of the accident is a key factor in the occurrence of an accident. Using the attention score to distinguish the impact of different cause nodes on the accident can guide the accident investigation at the early stage of the accident. At the same time, it can provide direction guidance for reducing traffic accidents, focus on accident factors with higher weights and deploy risk prevention measures in advance. Figure 3 The cause impact weight coefficients are calculated by comparing accident node No. 4 with all potential cause nodes. The figure below shows the cause impact weight coefficients of 20 of the 129 specific causes.
[0109]
[0110]
[0111] Although specific embodiments of the present invention are described above, those skilled in the art should understand that these are merely examples and that various changes or modifications may be made to these embodiments without departing from the principles and essence of the present invention. Therefore, the scope of protection of the present invention is limited by the appended claims.
Claims
1. A classification method for the cause types of water traffic accidents based on heterogeneous graph neural networks, characterized in that The following steps are involved: Step 1: Construct a heterogeneous graph G with basic information of the accident, basic information of the ship involved, specific cause of the accident and abstract cause of the accident as nodes, wherein the splicing method is used to complete the feature coding of the basic information of the accident and the basic information of the ship involved, the unique hot coding is used to complete the feature coding of the specific cause of the accident and the abstract cause of the accident, and the unique hot coding is used to complete the node relationship coding; Step 2: Use the heterogeneous feature mapping method to reconstruct the heterogeneous graph G and convert it into a homogeneous graph G′. Then, take the union of the adjacency matrices corresponding to the homogeneous graph G′ and the heterogeneous graph G to obtain a new adjacency matrix, which is used as the final adjacency matrix A. r , and then the final adjacency matrix A r Perform graph structure regularization processing to obtain graph structure regularization loss term; Step 3: Process the homogeneous graph G′ with the multi-head R-GAT computing module and input the embedding vector h 0 And calculate the new embedding vector h l+1 , and then embed the vector h l+1 After being processed by the fully connected layer and the softmax function in turn, the accident cause type classification cross entropy loss term is obtained. At the same time, the embedding vector h l+1 After being processed by the self-supervised reinforcement module, the self-supervised node association classification loss term is obtained. Step 4: Construct a joint loss function using the graph structure regularization loss term, the accident cause type classification cross entropy loss term, and the self-supervised node association classification loss term. Update the model parameters through the back propagation algorithm until the joint loss function converges to achieve the classification of the cause types of water traffic accidents.
2. The method for classifying the cause types of water traffic accidents based on heterogeneous graph neural networks according to claim 1 is characterized by: The following formula is used to construct the special codes of the basic information nodes of the accident and the basic information nodes of the involved ships: x accid =concat(x death ,x view ,x wind ,x angle ,x sink ,x sit ,x col ,x leak ,x type ) x ship =concat(x year ,x mat ,x ton ,x load ,x length ,x width ,x mould ,x speed ,x s ) Among them, x accid The feature vector representation of the basic information node of the accident, x ship The feature vector representation of the basic information node of the ship involved, concat represents the concatenation of data, x death 、x view 、x wind 、x angle 、x leak 、x year 、x mat 、x length 、x width 、x mould 、x speed 、x sink They represent the number of deaths, visibility, wind force level, collision angle, leakage, ship age, hull material, ship length, ship width, depth, speed, and ship sinking situation. sit 、x col 、x type 、x s The unique hot encoding vectors represent the ship encounter situation, ship collision mode, ship accident type, and ship type respectively. The wind force level is divided into three levels: light breeze, moderate wind and strong wind, which respectively represent wind speed less than level 2, wind speed between level 3 and level 6, and wind speed greater than or equal to level 7, and each level is assigned a value of 0, 1, and 2; According to the "Navigation Visibility Classification Standard" defined by the International Maritime Organization, the visibility at the accident site is classified. A visibility distance of more than 2 nautical miles is assigned a value of 0, a visibility distance between 1-2 nautical miles is assigned a value of 1, and a visibility distance of less than 1 nautical mile is assigned a value of 2; If the hull material is steel, the value is 2; if the hull material is wood, the value is 1; The following formula is used to calculate the ship's sinking condition x sink , x sink =α1x ton +α2x con +α3x load +α4x crew Among them, x ton 、x con 、x load 、x crew They represent ship tonnage, hull structure, cargo capacity and number of crew members respectively, α1, α2, α3, α4 represent the weight factors of their corresponding variables respectively, When 0≤x sink <0.3, the characteristic of the ship sinking is assigned a value of 0; when 0.3≤x sink ≤0.7, the characteristic of the ship sinking is assigned a value of 1. sink When >0.7, the characteristic value of the ship sinking is assigned to 2.
3. The method for classifying the cause types of water traffic accidents based on heterogeneous graph neural networks according to claim 2 is characterized by: The heterogeneous graph is represented as G = (V, E, X), where V represents a node set, E represents an edge set, and X represents a feature vector set of a node. When using the heterogeneous feature mapping method to reconstruct a heterogeneous graph, the feature vectors x of different types of nodes are first converted into a Mapped to the same dimension, the embedded vector h after heterogeneous feature mapping is obtained 0 , h 0 =σ(W a x a +b a ) Among them, W a is the mapping matrix of the node, σ(·) is the sigmoid activation function, b a is the bias vector of the node; Then calculate the embedding vector h 0 The similarity between them is used to obtain the feature similarity graph G′. Finally, the adjacency matrix A of the initial original graph G and the adjacency matrix A′ of the feature similarity graph G′ are combined to obtain a new adjacency matrix A r .
4. The method for classifying the cause types of water traffic accidents based on heterogeneous graph neural networks according to claim 1 is characterized by: The joint loss function is calculated using the following equation: Among them, λ self represents the self-supervised node-associated classification loss weight, λ rec represents the graph structure regularization weight, L self represents the self-supervised node association classification loss term, L rec represents the graph structure regularization loss term, L cls Represents the cross entropy loss term for accident cause type classification; V i s =V i l ∪V i h , V i h is the set of M nodes with the highest similarity, V i l is a set of M nodes with the lowest similarity. It is necessary to calculate the M nodes with the highest and lowest similarity to node i, y iq is the real connection relationship label, Connection relationship labels predicted for the network; V represents a node set consisting of basic information of the accident, basic information of the ship involved, specific cause of the accident and abstract cause of the accident. r represents the final adjacency matrix, Represents the predicted value of the accident cause type, y i Indicates the true value of the accident cause type, V c Represents the node set corresponding to the accident cause type.
Citation Information
Patent Citations
Heterogeneous graph neural network attribute completion method
CN115587626A
Social heterogeneous graph node classification method fusing deep semantic graph convolution
CN117390521A