Traffic accident evolution prediction method based on affair atlas
Through the method based on the factual map, the event development laws and evolution logic of traffic accidents are constructed, and the problem of ignoring deep causal relationships and dynamic characteristics in the existing technology is solved, and a comprehensive analysis and prediction of traffic accidents is realized, and traffic safety control is supported. and emergency decision-making.
Patent Information
- Application Number
- CN202411059547.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-04
- Publication Date
- 2024-12-03
AI Technical Summary
The existing method of analysis of the mechanism of cause causes of traffic accidents focuses on surface phenomena, ignores deep causal relationships, and cannot accurately reflect the dynamic characteristics of traffic accidents, resulting in the inability to fully reveal the accident development context and evolution logic.
Using a traffic accident evolution prediction method based on the matter map, the traffic accident story rational map is constructed through data acquisition and preprocessing, event extraction, event generalization and knowledge storage, and BERT-Lattice LSTM-CRF and BERT+BiGRU+Self-Attention+ The CRF model performs event extraction and relationship extraction, and combines the Neo4j graph database for visual evolution prediction.
The constructed matter map can dynamically display the evolution context and development laws of accidents, provide traffic safety control departments with analysis of accident causes and decision-making support, help understand the development process and direction of accidents, and provide targeted emergency response decision-making basis.
Smart Images

Figure CN119067251A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of traffic accidents, and in particular to a traffic accident evolution prediction method based on a causal graph. Background Art
[0002] Traffic accidents are characterized by suddenness, complexity, derivativeness, and randomness. Moreover, they are prone to cause secondary accidents after they occur, resulting in greater losses and delays. After a traffic accident occurs, emergency personnel need to make timely disposal decisions and carry out rescue work based on the on-site environment and accident conditions. However, the complex state of the accident site may hinder emergency rescue and recovery work, thereby increasing the time of traffic interruption. Long-term traffic interruption will not only affect economic activities, but also have an adverse impact on the quality of life of surrounding communities. Therefore, traffic safety control and prevention as well as emergency response have always been the focus of research.
[0003] With the remarkable achievements of smart transportation construction, it has provided rich heterogeneous data for data mining research in this field. At present, the research on the causal mechanism analysis of traffic accidents mainly adopts data statistics, decision trees, random forests, and Bayesian networks. The statistical method focuses on the surface phenomenon of the accident and ignores the deep causal relationship. Although the machine learning models of decision trees and random forests perform well in accident risk prediction and mechanism analysis, their "black box" characteristics make it difficult to clearly explain the decision-making process within the model, and researchers cannot fully understand and grasp the cause of the accident and the deep development context. The Bayesian network method usually assumes that the system is static. However, the cause and evolution process of traffic accidents are often dynamic and cannot accurately reflect the dynamic characteristics of the system. The existing research on the mechanism analysis of traffic accidents only focuses on the mapping relationship between influencing factors and accident consequences, and cannot fully reveal the development context and evolution logic of the accident, which has limitations. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the purpose of the present invention is to provide a traffic accident evolution prediction method based on event graph.
[0005] To achieve the above objectives, the present disclosure adopts the following technical solutions:
[0006] A traffic accident evolution prediction method based on event graph includes the following steps:
[0007] S1. Data acquisition and preprocessing: using traffic accident record data as a basic source, acquiring structured data and text data, and performing data preprocessing on the acquired structured data and text data;
[0008] S2. Define the event ontology in the field of traffic accidents and perform data annotation;
[0009] S3. Event extraction and event relationship extraction: Use BERT-Lattice LSTM-CRF and BERT+BiGRU+Self-Attention+CRF to respectively perform event extraction and event relationship extraction on the text data of the traffic accident and the text data in the event ontology defined in the traffic accident field;
[0010] S4. Event generalization: Construct an event generalization model, use cosine similarity and Jaccard similarity to evaluate the similarity between events, make generalization decisions based on the similarity threshold and the number of events, simplify the set of events with high similarity and meeting the conditions into common elements or frequent clauses, and then generate a generalized expression of the event;
[0011] S5. Knowledge storage and evolution prediction: Build a traffic incident logic map, store entities and relationships in the Neo4j graph database for visualization, and make evolution predictions based on the traffic incident logic map.
[0012] In some embodiments of the present disclosure, in S1, the preprocessing of the text data includes text cleaning, custom dictionary, word segmentation and removal of stop words; the preprocessing of the structured data includes data cleaning, data integration, data transformation and data reduction.
[0013] In some embodiments of the present disclosure, the preprocessing of the text data specifically includes:
[0014] Delete invalid, duplicate, and abnormal data in text data;
[0015] Establish a business dictionary in the field of traffic accidents, including proper nouns, traffic terms, toll booth names and highway names;
[0016] Combine the default dictionary and custom dictionary built into the jieba library and use the precise mode for word segmentation.
[0017] Remove punctuation marks, numbers, spaces, modal particles, conjunctions, and words irrelevant to the topic from the text;
[0018] The preprocessing of the structured data specifically includes:
[0019] Filter and delete duplicate data, noise data and other data not related to data mining in the original data set;
[0020] Integrate data from different sources, formats, and data storage systems into a consistent database;
[0021] Combined with the needs of mining tasks and mining algorithms, data is converted into a specific normalized form;
[0022] Generate a smaller data set while ensuring data integrity.
[0023] In some embodiments of the present disclosure, in S2,
[0024] The event ontology in the field of traffic accidents is defined as follows: the event attributes are divided into accident time, location, weather, diversion conditions, lane conditions, and disposal information such as disposal agencies, disposal equipment, disposal measures, and disposal effects. Event relations can be divided into seven types: cause and effect, succession, condition, transition, parallel, superior and subordinate, and composition.
[0025] The data annotation uses the BIO annotation strategy to complete the annotation of text data. Each letter of the BIO annotation represents the marking state of a word in the named entity recognition task, wherein the B label represents the beginning of an event, the I label represents that the word is the middle word or the ending word of the event, and O represents an irrelevant word.
[0026] In some embodiments of the present disclosure, S3 specifically includes:
[0027] S3.1 Event extraction: The text data of traffic accidents annotated by BIO is input into the BERT-Lattice LSTM-CRF event extraction model for recognition. The character information and vocabulary information are input together. The Lattice LSTM model effectively extracts the proper nouns in the sentence and integrates the implicit word features into the character-based LSTM-CRF model. The probability of the tag sequence is obtained through the CRF layer, and the maximum probability value is calculated using the Viterbi algorithm. The corresponding tag is the predicted tag;
[0028] S3.2 Event relationship extraction: A model based on BERT+BiGRU+Self-Attention+CRF is used for event relationship extraction.
[0029] In some embodiments of the present disclosure, S3.1 includes:
[0030] Lattice LSTM model: In the character-based structure, each character c j Through the character embedding matrix e c Represented as input word vector Then pass through the input gate Forget Gate and output gate Get the unit vector and hidden vector The unit vector controls the historical information of the sentence, and the hidden vector is used as the input of CRF. The calculation formula based on the character structure is as follows:
[0031]
[0032]
[0033]
[0034] Among them, σ is the activation function, and b c is the model parameter, ⊙ represents the dot product, and tanh is the hyperbolic tangent function;
[0035] In the word-based structure, each word Through the word embedding matrix e w Get the input word vector in Represents the vocabulary consisting of characters indexed from b to e; since the tagging is performed only at the character level, there is no output gate in the word-based structure, and the rest is similar to the character structure. The calculation formula is as follows:
[0036]
[0037]
[0038] in, and b w are model parameters;
[0039] Using additional gates Will The included vocabulary information is integrated into the corresponding characters Ending word vector In the example above, we get the unit vector of the current character. The calculation formula is as follows:
[0040]
[0041]
[0042] The final hidden vector The expression is as follows:
[0043]
[0044] in, and They are and Normalized results;
[0045] Get the hidden vectors h1,h2,...,h of all outputs l , where l is the number of words in the sentence, and the tag sequence y=l1,l2,...,l is obtained through the CRF layer τThe probability of a given target is calculated using the Viterbi algorithm, and the maximum probability value is obtained. The corresponding mark is the predicted mark.
[0046] In some embodiments of the present disclosure, S3.2 includes:
[0047] 3.2.1 BiGRU model
[0048] The specific calculation process of GRU is as follows:
[0049] r t =σ(W r ·[h t-1 ,x t ]+b r )
[0050] z t =σ(W z ·[h t-1 ,x t ]+b z )
[0051]
[0052]
[0053] The text word vector matrix obtained through pre-training is used as the input of the bidirectional GRU. The previous and following information are extracted through the forward GRU and backward GRU. The output is weighted and summed to obtain the final output label column of the BiGRU network model. The calculation formula is as follows:
[0054]
[0055]
[0056]
[0057] x t Represents the current input, y t Indicates the output state of the forward GRU and backward GRU at the current moment, h t Represents the state information of the hidden layer at the current moment, represents the candidate value of the state information at time t, z t Represents the reset gate, r t represents the update gate, W is the weight matrix, σ is the Sigmoid activation function, and tanh is the hyperbolic tangent activation function;
[0058] 3.2.2 Attention Mechanism
[0059] Attention is mainly divided into the following three stages when calculating. For a feature sequence Y=[y1,y2…y n ], with attention probability distribution a i , use a i Perform weighted summation on the input features;
[0060] Phase 1: Calculate the similarity or correlation between the query and the key to get the original score of phase 1. Use the dot product of the query and the key (indicating the length of one vector on another vector) to reflect the similarity between the two vectors. The calculation formula is:
[0061]
[0062] Among them, d k is the dimension of Key;
[0063] Stage 2: Normalize the scores using the SoftMax function and map them to a value between 0 and 1 to obtain weight coefficients (a1, a2…a n ), the calculation formula is:
[0064] a i =SoftMax(S(K,Q))
[0065] Stage 3: Perform weighted summation according to the weight coefficient matrix to obtain the attention output vector. The calculation formula is:
[0066]
[0067] In some embodiments of the present disclosure, S4 includes:
[0068] S4.1 Event Generalization The extracted events are generalized by combining cosine similarity and Jaccard similarity;
[0069] S4.1.1 Cosine similarity
[0070] The similarity between two vectors is determined by calculating the cosine value of the angle between them. When the cosine value is close to 1, it means that the two vectors are highly similar. On the contrary, when the cosine value is close to -1, it means that the two vectors are unrelated. If there is an event E i 、E j , then:
[0071]
[0072] Among them, A and B are events E i and E j The corresponding vector representation;
[0073] S4.1.2 Jaccard Similarity:
[0074] When calculating event similarity, first convert the two events into word sets, and then calculate the ratio of the intersection and union of the two event sets to obtain the similarity. The calculation formula is as follows:
[0075]
[0076] Among them, X and Y represent event E i and E j The corresponding bag of words.
[0077] The final formula for calculating event similarity is as follows:
[0078]
[0079] After calculating the similarity between two events, generalize similar events based on the similarity calculation results. The specific rules are as follows:
[0080] When the similarity between two events is less than 0.5 or the number of events is less than three, the event is considered to lack generality and will not be generalized;
[0081] When the similarity result between two events is greater than or equal to 0.5, and the number of events that meet the similarity condition is not less than three, the common elements or clauses with higher occurrence frequency in these events will be extracted as generalized events.
[0082] In some embodiments of the present disclosure, S5 includes:
[0083] S5.1 Knowledge storage: Import the event list and relationship list into the Neo4j graph database to complete the visualization of the event graph;
[0084] S5.2 Evolutionary prediction: Based on the obtained event graph, any new event can be predicted. The specific steps are: first, the event is vectorized, the similarity between the event and the events in the event graph is calculated, and the event with the highest similarity is selected as the starting event for prediction; second, the generalized event of the starting event is found in the event graph; finally, the abstract event graph is traversed to find the subsequent event nodes of the generalized event and their weights, and the probability of the event occurrence is determined based on the weights.
[0085] Compared with the prior art, the traffic accident evolution prediction method based on the event graph according to some embodiments of the present disclosure can bring beneficial technical effects. For example, according to the traffic accident evolution prediction method based on the event graph according to some embodiments of the present disclosure, the event graph constructed is a event logic knowledge base, with the event of the traffic accident as the node and the relationship between the events as the edge, forming a directed graph that depicts the development law and evolution logic of the event, which can dynamically display the evolution context and development law of the accident, and provide a basis for the traffic safety control department to analyze the cause of the accident, assist in decision-making and early warning. For another example, according to the traffic accident evolution prediction method based on the event graph according to some embodiments of the present disclosure, it can fully integrate the current heterogeneous data in the field of traffic accidents, combine the new generation of artificial intelligence technology and data-driven algorithms, and construct algorithm models of BERT-Lattice LSTM-CRF and BERT+BiGRU+Self-Attention+CRF for event extraction and event relationship extraction, and use the Neo4j graph database for visualization of the event graph. At the same time, evolution prediction is performed based on the event graph of the traffic accident. For another example, according to some embodiments of the present disclosure, the traffic accident evolution prediction method based on the causal graph provides a structured accident evolution knowledge base through detailed mapping of various types of traffic accident events, clearly showing the development process and dynamic logic of an accident, and can provide data support for relevant personnel of the traffic safety control department to understand the evolution process and development direction of traffic accidents, thereby providing targeted technical basis for emergency response decisions. BRIEF DESCRIPTION OF THE DRAWINGS
[0086] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0087] Figure 1 A flow chart of a method for predicting the evolution of traffic accidents based on a causal graph according to some embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0088] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements may be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0089] Figure 1 A flow chart of a method for predicting the evolution of traffic accidents based on a causal graph according to some embodiments of the present disclosure is shown.
[0090] like Figure 1As shown, in some embodiments of the present disclosure, a traffic accident evolution prediction method based on an event graph includes the following steps:
[0091] S1. Data acquisition and preprocessing: Traffic accident record data is used as the basic source. Data preprocessing is performed on structured data and text data respectively.
[0092] S2. Define the event ontology in the field of traffic accidents and perform data annotation.
[0093] S3. Event and event relationship extraction: Use BERT-Lattice LSTM-CRF and BERT+BiGRU+Self-Attention+CRF to perform event extraction and event relationship extraction on the traffic accident text data and the text data in the event ontology defined in the traffic accident field respectively.
[0094] S4. Event generalization: In order to deeply explore the complex relationship between events, an event generalization model is constructed. The cosine similarity and Jaccard similarity are used to evaluate the similarity between events. The generalization decision is made based on the similarity threshold and the number of events. The event set with high similarity and meeting the conditions is simplified into common elements or frequent clauses, and then the generalized expression of the event is generated.
[0095] S5. Knowledge storage and evolution prediction: Build a traffic incident logic map, store entities and relationships in the Neo4j graph database for visualization, and make evolution predictions based on the traffic incident logic map.
[0096] In some embodiments of the present disclosure, the specific analysis process of step S1 is:
[0097] S1.1 Data acquisition. Using the recorded data of traffic events as the basic database (traffic accident data records structured accident attribute information including the location, time, weather conditions, road property damage, etc. of the accident, and a detailed natural language text description of the development process after the accident, including the accident handling information and status change information), filter out the structured data and text data related to traffic accidents.
[0098] S1.2 Text data preprocessing. Text data preprocessing includes text cleaning, custom dictionary, word segmentation, and stop word removal. Delete invalid, duplicate, and abnormal data in the text data; establish a business dictionary in the field of traffic accidents, including proper nouns, traffic terms, toll station names, highway names, etc.; combine the default dictionary and custom dictionary built in the jieba library, and use the precise mode for word segmentation; remove punctuation marks, numbers, spaces, modal particles, conjunctions, and words irrelevant to the topic in the text.
[0099] S1.3 Structured data preprocessing. Structured data preprocessing includes data cleaning, data integration, data transformation, and data reduction. Data cleaning is to filter and delete duplicate data, noise data, and other data that are not related to data mining in the original data set, such as missing values, outliers, etc.; data integration is to integrate data from different sources, different formats, and different data storage systems into a consistent database; data transformation is to convert data into a specific standardized form in combination with the needs of mining tasks and mining algorithms; data reduction is to generate a smaller data set while ensuring data integrity.
[0100] In some embodiments of the present disclosure, the specific analysis process of step 2 is:
[0101] S2.1 Define event ontology: Event ontology is a knowledge representation model with events as the core, which can clearly describe events, event elements and various relationships between events. It is the logical framework for constructing the event graph. The present invention takes into account accident information and its temporal relationship, and defines the accident attributes into accident attributes such as accident time, location, weather, diversion situation, lane conditions, and disposal information such as disposal agencies, disposal equipment, disposal measures, and disposal effects. Among them, accident attributes are structured data, and disposal information is text data. Event relationships can be divided into seven major relationships: cause and effect, sequence, condition, transition, parallel, superior and subordinate, and composition.
[0102] S2.2 Data annotation: The BIO (Begin, Inside, Outside) annotation strategy is used to complete the annotation of text data. Each letter of the BIO annotation represents the tag status of a word in the named entity recognition task. Among them, the B label represents the beginning of the event, the I label represents that the word is the middle word or the ending word of the event, and the O represents an irrelevant word.
[0103] According to the traffic accident evolution prediction method based on the event graph of some embodiments of the present disclosure, the event ontology in the field of traffic accidents is defined using data in the field of traffic accidents, including event attributes and event relationships. The event attributes are divided into basic information such as accident time, location, weather, diversion situation, and lane situation, and disposal information such as disposal agencies, disposal equipment, disposal measures, and disposal effects. Event relationships can be divided into seven major relationships: cause and effect, succession, condition, transition, parallel, superior and subordinate, and composition. The accident information and time series relationship are integrated to construct the event graph of traffic accidents.
[0104] In some embodiments of the present disclosure, the specific analysis process of step 3 is:
[0105] 3.1 Event extraction. The text data of traffic accidents annotated by BIO is input into the event extraction model of BERT-Lattice LSTM-CRF for recognition. Character information and vocabulary information are input together. The Lattice LSTM model effectively extracts proper nouns in the sentence and integrates the implicit word features into the character-based LSTM-CRF model. The probability of the tag sequence is obtained through the CRF layer, and the maximum probability value is calculated using the Viterbi algorithm. The corresponding tag is the predicted tag.
[0106] 3.1.1 Lattice LSTM Model: In the character-based structure, each character c j Through the character embedding matrix e c Represented as input word vector Then pass through the input gate Forget Gate and output gate Get the unit vector and hidden vector The unit vector controls the historical information of the sentence, and the hidden vector is used as the input of CRF. The calculation formula based on the character structure is as follows:
[0107]
[0108]
[0109]
[0110] Among them, σ is the activation function, and b c is the model parameter, ⊙ represents the dot product, and tanh is the hyperbolic tangent function.
[0111] The advantage of Lattice LSTM is that it integrates latent vocabulary information into the character-based structure, so that the model can effectively utilize the prior information of words while obtaining character information. Through the word embedding matrix e w Get the input word vector in Represents the vocabulary consisting of characters indexed from b to e. Since the tagging is performed only at the character level, there is no output gate in the word-based structure, and the rest is similar to the character structure. The calculation formula is as follows:
[0112]
[0113]
[0114] in, and b w is the model parameter, and the rest are consistent with the above parameters.
[0115] Based on the above structure, additional gating is used Will The included vocabulary information is integrated into the corresponding characters Ending word vector In the example above, we get the unit vector of the current character. The calculation formula is as follows:
[0116]
[0117]
[0118] The final hidden vector The expression is as follows:
[0119]
[0120] in, and They are and The normalized result, the rest of the parameters remain the same as above.
[0121] Get the hidden vectors h1,h2,...,h of all outputs l , where l is the number of words in the sentence, and the tag sequence y=l1,l2,...,l is obtained through the CRF layer τ The probability of a given target is calculated using the Viterbi algorithm, and the maximum probability value is obtained. The corresponding mark is the predicted mark.
[0122] 3.2 Event Relation Extraction: A model based on BERT+BiGRU+Self-Attention+CRF is used for event relationship extraction.
[0123] 3.2.1 BiGRU model: GRU is an improvement on the long short-term memory network (LSTM). It reduces training parameters to improve convergence and maintain the good learning performance of LSTM. The update gate is used internally to replace the input gate and forget gate of LSTM, and the reset gate is retained. The bidirectional gated recurrent network (BiGRU) is composed of two independent forward GRUs and backward GRUs. The two-directional GRUs are used to extract the global features of text information and learn the information of the two directions of the context at each moment. The output at the current moment is jointly determined by the two opposite-direction GRUs. The specific calculation process of GRU is as follows:
[0124] r t =σ(W r·[h t-1 ,x t ]+b r )
[0125] z t =σ(W z ·[h t-1 ,x t ]+b z )
[0126]
[0127]
[0128] The text word vector matrix obtained through pre-training is used as the input of the bidirectional GRU. The previous and following information are extracted through the forward GRU and backward GRU. The output is weighted and summed to obtain the final output label column of the BiGRU network model. The calculation formula is as follows:
[0129]
[0130]
[0131]
[0132] x t Represents the current input, y t represents the output state of the forward GRU and backward GRU at the current moment, ht represents the state information of the hidden layer at the current moment, represents the candidate value of the state information at time t, z t Represents the reset gate, r t represents the update gate, W is the weight matrix, σ is the Sigmoid activation function, and tanh is the hyperbolic tangent activation function.
[0133] 3.2.2 Attention mechanism: The attention mechanism is a model that simulates the human brain's acquisition of information. This model can be used to set corresponding weights for words in the data, weaken the impact of irrelevant features on the results, and enable the model to better focus on key information. Its essence can be described as a mapping from a query target (Query) to a series of key-value pairs (Key-Value).
[0134] Attention is mainly divided into the following three stages when calculating. For a feature sequence Y=[y1,y2…y n ], with attention probability distribution a i , use a i Performs a weighted sum of the input features.
[0135] Phase 1: Calculate the similarity or correlation between the query and the key to get the original score of phase 1. The similarity between the two vectors can be reflected by using the dot product of the query and the key (indicating the length of one vector on another vector). The calculation formula is as follows, where d k The dimension of the Key.
[0136]
[0137] Stage 2: Normalize the scores using the SoftMax function and map them to a value between 0 and 1 to obtain weight coefficients (a1, a2…a n ). The calculation formula is:
[0138] =SoftMax(S(K,Q))
[0139] Stage 3: Perform weighted summation based on the weight coefficient matrix to obtain the attention output vector. The calculation formula is:
[0140]
[0141] In some embodiments of the present disclosure, the specific analysis process of step 4 is:
[0142] 4.1 Event generalization: In order to further explore the rules between events and make the connections between events in the event graph closer, it is necessary to generalize the extracted events by combining cosine similarity and Jaccard similarity.
[0143] 4.1.1 Cosine Similarity: Cosine similarity is a method for calculating the similarity between two vectors. It is usually used to calculate the similarity between document, sentence or word vectors. The principle is to judge their similarity by calculating the cosine value of the angle between two vectors. When the cosine value is close to 1, it means that the two vectors are highly similar. Conversely, when the cosine value is close to -1, it means that the two vectors are unrelated. If there is an event E i 、E j , then:
[0144]
[0145] Among them, A and B are events E i and E j The corresponding vector representation.
[0146] 4.1.2 Jaccard similarity: Jaccard similarity is a measurement method used to calculate the similarity between two sets. It calculates the ratio of the number of common elements in the two sets to the sum of the number of all elements in the two sets as the similarity. When calculating event similarity, it first converts the two events into word sets, and then calculates the ratio of the intersection and union of the two event sets to obtain the similarity. The calculation formula is as follows:
[0147]
[0148] Among them, X and Y represent event E i and E j The corresponding bag of words.
[0149] The final formula for calculating event similarity is as follows:
[0150]
[0151] After calculating the similarity between two events, it is necessary to generalize similar events based on the similarity calculation results. The specific rules are as follows:
[0152] (1) When the similarity between two events is less than 0.5 or the number of events is less than three, the event is considered to lack generality and will not be generalized.
[0153] (2) When the similarity between two events is greater than or equal to 0.5, and the number of events that meet the similarity condition is not less than three, the common elements or clauses with higher occurrence frequency in these events are extracted as generalized events.
[0154] According to the traffic accident evolution prediction method based on the event graph of some embodiments of the present disclosure, the results of event extraction and event relationship extraction are used, combined with cosine similarity and Jaccard similarity technology to generalize events, and deeply analyze the complex relationships and development context after the traffic accident occurs.
[0155] According to the traffic accident evolution prediction method based on the causal graph of some embodiments of the present disclosure, the causal graph of traffic accidents is constructed by combining the fusion of accident information and time series relationships, and the two key points of event generalization are combined with cosine similarity and Jaccard similarity technology, deep learning and natural language processing technology are integrated to construct a causal graph in the field of traffic accidents, and the evolution of traffic accidents is predicted based on the causal graph.
[0156] In some embodiments of the present disclosure, the specific analysis process of step 5 is:
[0157] S5.1 constructs a graph after processing the structured data obtained in S1, the accident attribute data in the event attributes in S2, the text data obtained in S1, and the text data in the event ontology in the field of traffic accidents defined in S2 through steps S3 and S4. Knowledge storage: Import the event list obtained after the generalized expression of the S4 event and the relationship list obtained by the event relationship defined in S2 into the Neo4j graph database to complete the visualization of the event graph.
[0158] S5.2 Evolutionary prediction: Based on the obtained causal graph, any newly occurring event can be predicted. The specific steps are as follows: first, the event is vectorized, the similarity between the event and each event in the causal graph is calculated, and the event with the highest similarity is selected as the starting event for prediction; second, the generalized event of the starting event is found in the causal graph; finally, the abstract causal graph is traversed to find the subsequent event nodes of the generalized event and their weights, and the most likely events are determined based on the weights.
[0159] According to the traffic accident evolution prediction method based on the causal map of some embodiments of the present disclosure, the recorded data of traffic accidents is used as the basic data source, and the causal map in the field of traffic accidents is constructed in combination with deep learning and natural language processing technology. It can comprehensively express the development process of the accident, each sub-event and their relationship, show the evolution process of the accident in the real scene, systematically sort out the complex relationship and causal chain of the occurrence of traffic accidents, and can discover patterns and connections that may be ignored by traditional data analysis methods, so as to clarify the development context of the accident and reveal the law of accident development. At the same time, the evolution prediction of traffic accidents based on the causal map can obtain the evolution path and development trend of traffic accidents, which is an important technical support for traffic safety risk prevention and control and emergency response decision-making.
[0160] The above describes the specific embodiments of the present invention. It should be understood that the present invention is not limited to the above specific embodiments, and those skilled in the art may make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. A traffic accident evolution prediction method based on event graph, characterized in that: The following steps are involved: S1. Data acquisition and preprocessing: using traffic accident record data as a basic source, acquiring structured data and text data, and performing data preprocessing on the acquired structured data and text data; S2. Define the event ontology in the field of traffic accidents and perform data annotation; S3. Event extraction and event relationship extraction: Use BERT-Lattice LSTM-CRF and BERT+BiGRU+Self-Attention+CRF to respectively perform event extraction and event relationship extraction on the text data of the traffic accident and the text data in the event ontology defined in the traffic accident field; S4. Event generalization: Construct an event generalization model, use cosine similarity and Jaccard similarity to evaluate the similarity between events, make generalization decisions based on the similarity threshold and the number of events, simplify the set of events with high similarity and meeting the conditions into common elements or frequent clauses, and then generate a generalized expression of the event; S5. Knowledge storage and evolution prediction: Build a traffic incident logic map, store entities and relationships in the Neo4j graph database for visualization, and make evolution predictions based on the traffic incident logic map.
2. The traffic accident evolution prediction method based on event graph according to claim 1 is characterized in that: In S1, the preprocessing of the text data includes text cleaning, custom dictionary, word segmentation and removal of stop words; the preprocessing of the structured data includes data cleaning, data integration, data transformation and data reduction.
3. The traffic accident evolution prediction method based on event graph according to claim 2 is characterized in that: The preprocessing of the text data specifically includes: Delete invalid, duplicate, and abnormal data in text data; Establish a business dictionary in the field of traffic accidents, including proper nouns, traffic terms, toll booth names and highway names; Combine the default dictionary and custom dictionary built into the jieba library and use the precise mode for word segmentation. Remove punctuation marks, numbers, spaces, modal particles, conjunctions, and words irrelevant to the topic from the text; The preprocessing of the structured data specifically includes: Filter and delete duplicate data, noise data and other data not related to data mining in the original data set; Integrate data from different sources, formats, and data storage systems into a consistent database; Combined with the needs of mining tasks and mining algorithms, data is converted into a specific normalized form; Generate a smaller data set while ensuring data integrity.
4. The traffic accident evolution prediction method based on event graph according to claim 1 is characterized in that: In S2, The event ontology in the field of traffic accidents is defined as follows: the event attributes are divided into accident time, location, weather, diversion conditions, lane conditions, and disposal information such as disposal agencies, disposal equipment, disposal measures, and disposal effects. Event relations can be divided into seven types: cause and effect, succession, condition, transition, parallel, superior and subordinate, and composition. The data annotation uses the BIO annotation strategy to complete the annotation of text data. Each letter of the BIO annotation represents the marking state of a word in the named entity recognition task, wherein the B label represents the beginning of an event, the I label represents that the word is the middle word or the ending word of the event, and O represents an irrelevant word.
5. The traffic accident evolution prediction method based on event graph according to claim 4 is characterized in that: S3 specifically includes: S3.1 Event extraction: The text data of traffic accidents annotated by BIO is input into the BERT-Lattice LSTM-CRF event extraction model for recognition. The character information and vocabulary information are input together. The Lattice LSTM model effectively extracts the proper nouns in the sentence and integrates the implicit word features into the character-based LSTM-CRF model. The probability of the tag sequence is obtained through the CRF layer, and the maximum probability value is calculated using the Viterbi algorithm. The corresponding tag is the predicted tag; S3.2 Event relationship extraction: A model based on BERT+BiGRU+Self-Attention+CRF is used for event relationship extraction.
6. The traffic accident evolution prediction method based on event graph according to claim 5 is characterized in that: S3.1 includes: Lattice LSTM model: In the character-based structure, each character c j Through the character embedding matrix e c Represented as input word vector Then pass through the input gate Forget Gate and output gate Get the unit vector and hidden vector The unit vector controls the historical information of the sentence, and the hidden vector is used as the input of CRF. The calculation formula based on the character structure is as follows: Among them, σ is the activation function, and b c is the model parameter, ⊙ represents the dot product, and tanh is the hyperbolic tangent function; In the word-based structure, each word Through the word embedding matrix e w Get the input word vector in Represents the vocabulary consisting of characters indexed from b to e; since the tagging is performed only at the character level, there is no output gate in the word-based structure, and the rest is similar to the character structure. The calculation formula is as follows: in, and b w are model parameters; Using additional gates Will The included vocabulary information is integrated into the corresponding characters Ending word vector In the example above, we get the unit vector of the current character. The calculation formula is as follows: The final hidden vector The expression is as follows: in, and They are and Normalized results; Get the hidden vectors h1,h2,...,h of all outputs l , where l is the number of words in the sentence, and the tag sequence y=l1,l2,...,l is obtained through the CRF layer τ The probability of a given target is calculated using the Viterbi algorithm, and the maximum probability value is obtained. The corresponding mark is the predicted mark.
7. The traffic accident evolution prediction method based on event graph according to claim 5 is characterized in that: S3.2 includes: 3.2.1 BiGRU model The specific calculation process of GRU is as follows: r t =σ(W r ·[h t-1 ,x t ]+b r ) z t =σ(W z ·[h t-1 ,x t ]+b z ) The text word vector matrix obtained through pre-training is used as the input of the bidirectional GRU. The previous and following information are extracted through the forward GRU and backward GRU. The output is weighted and summed to obtain the final output label column of the BiGRU network model. The calculation formula is as follows: x t Represents the current input, y t Indicates the output state of the forward GRU and backward GRU at the current moment, h t Represents the state information of the hidden layer at the current moment, represents the candidate value of the state information at time t, z t Represents the reset gate, r t represents the update gate, W is the weight matrix, σ is the Sigmoid activation function, and tanh is the hyperbolic tangent activation function; 3.2.2 Attention Mechanism Attention is mainly divided into the following three stages when calculating. For a feature sequence Y=[y1,y2…y n ], with attention probability distribution a i , use a i Perform weighted summation on the input features; Phase 1: Calculate the similarity or correlation between the query and the key to get the original score of phase 1. Use the dot product of the query and the key (indicating the length of one vector on another vector) to reflect the similarity between the two vectors. The calculation formula is: Among them, d k is the dimension of Key; Stage 2: Normalize the scores using the SoftMax function and map them to a value between 0 and 1 to obtain weight coefficients (a1, a2…a n ), the calculation formula is: a i =SoftMax(S(K,Q)) Stage 3: Perform weighted summation according to the weight coefficient matrix to obtain the attention output vector. The calculation formula is:
8. The traffic accident evolution prediction method based on the event graph according to claim 1 is characterized in that S4 include: S4.1 Event Generalization The extracted events are generalized by combining cosine similarity and Jaccard similarity; S4.1.1 Cosine similarity The similarity between two vectors is determined by calculating the cosine value of the angle between them. When the cosine value is close to 1, it means that the two vectors are highly similar. On the contrary, when the cosine value is close to -1, it means that the two vectors are unrelated. If there is an event E i 、E j , then: Among them, A and B are events E i and E j The corresponding vector representation; S4.1.2 Jaccard Similarity: When calculating event similarity, first convert the two events into word sets, and then calculate the ratio of the intersection and union of the two event sets to obtain the similarity. The calculation formula is as follows: Among them, X and Y represent event E i and E j The corresponding bag of words; The final formula for calculating event similarity is as follows: After calculating the similarity between two events, generalize similar events based on the similarity calculation results. The specific rules are as follows: When the similarity between two events is less than 0.5 or the number of events is less than three, the event is considered to lack generality and will not be generalized; When the similarity result between two events is greater than or equal to 0.5, and the number of events that meet the similarity condition is not less than three, the common elements or clauses with higher occurrence frequency in these events will be extracted as generalized events.
9. The traffic accident evolution prediction method based on the event graph according to claim 1 is characterized in that S5 include: S5.1 Knowledge storage: Import the event list and relationship list into the Neo4j graph database to complete the visualization of the event graph; S5.2 Evolution prediction: Based on the event graph, any new event can be predicted. The specific steps are as follows: first, the event is vectorized, the similarity between the event and the events in the event graph is calculated, and the event with the highest similarity is selected as the starting event for prediction; Secondly, find the generalized event of the starting event in the event graph; finally, traverse the abstract event graph, find the subsequent event nodes of the generalized event and their weights, and judge the probability of the event occurring based on the weights.
