A traffic accident cause analysis method, device, equipment and medium

By analyzing traffic accident data using large language models and constructing multi-level accident cause labels, the rough and subjective problems of traffic accident cause analysis in the existing technology are solved, and the accuracy and standardization of the analysis are improved.

CN119760573AActive Publication Date: 2025-04-04HANGZHOU TRUSTWAY TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411894914.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-04
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

The existing technology has problems such as rough classification, subjectiveness and difficulty in labeling in the analysis of traffic accident causes, which makes it difficult to accurately analyze the causes of accidents.

Method used

The large language model is used as the base model, and labeled data is constructed through preset prompt words, traffic accident data and labeled information, and the model is trained to determine the multi-level accident cause labels, and then the deep causes of the traffic accident data to be analyzed.

Benefits of technology

A more refined multi-level accident cause label has been achieved, the accuracy and standardization of traffic accident cause analysis has been improved, and the multi-faceted and deep causes of traffic accidents can be explored more comprehensively.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760573A_ABST
    Figure CN119760573A_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, equipment and medium for analyzing the causes of traffic accidents, which relates to the field of road traffic, including: determining the first N levels of accident cause labels and corresponding accident cause descriptions of historical traffic accident data through a first base model, classifying them using a second base model to determine the next level of accident cause labels of the Nth level accident cause labels, thereby constructing multi-level accident cause labels, so as to use the first base model and add a few sample prompt words to the traffic accident data based on the multi-level accident cause label analysis to obtain the first N+1 levels of accident cause labels and corresponding accident cause descriptions of the traffic accident data. The present application utilizes the analysis and classification capabilities of a large language model to determine the next level of accident cause labels of the Nth level accident cause labels based on the first N levels of accident cause labels and corresponding accident cause descriptions, thereby constructing more refined multi-level accident cause labels to explore the multi-faceted and deep-seated causes of traffic accidents.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of road traffic, and in particular to a method, device, equipment and medium for analyzing the cause of a traffic accident. Background Art

[0002] As the handling of traffic accidents deepens, problems such as the complexity and diversity of accident causes, the difficulty in uncovering the true causes, and the slow progress of hidden danger investigation have gradually emerged. The key to these problems lies in the rough, subjective, and difficult to label classification of accident causes. The main reasons for this are: 1. The accident data in the traffic management system generally lacks a direct description of the cause of the accident, and mainly focuses on the description of the behavior of the parties involved, resulting in the classification of accident causes also focusing on traffic violations, lacking a refined classification of accident causes. 2. There are no relevant standards for the description of accident causes. Due to different personal writing habits of different case handlers, the descriptions of accident causes are also varied, making it difficult to use and analyze directly.

[0003] Although traditional NLP (Natural Language Processing) technology is effective in processing accident text data, NLP technology relies on Chinese word segmentation and manually extracted features, requiring technicians with rich experience and professional knowledge, and a large workload. Especially in the field of road traffic, the text styles of traffic accident data are diverse, and writing habits vary from region to region or individual to individual. NLP technology may be difficult to understand the complex description of traffic accident data, resulting in incomplete or inaccurate extraction of key information, and the classification of accident causes is relatively superficial and lacks standardization, which can easily have a negative impact on the accurate analysis of the causes of traffic accidents. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a traffic accident cause analysis method, device, equipment and medium, which can utilize the analysis and classification capabilities of a large language model to determine the next level of the Nth level of the accident cause label based on the first N levels of the accident cause label and the corresponding accident cause description, thereby constructing a more refined multi-level accident cause label to explore the multi-faceted and deep-seated causes of traffic accidents. The specific scheme is as follows:

[0005] In a first aspect, the present application provides a method for analyzing the causes of traffic accidents, comprising:

[0006] Obtain a pre-trained first base model; wherein the labeled data in the training set and the test set used to train the first base model are data based on preset prompt words, traffic accident data and labeled information, and the labeled information includes the first N levels of accident cause labels of the traffic accident data and the accident cause descriptions corresponding to each accident cause label in the traffic accident data, where N is a positive integer;

[0007] Determine the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the first base model, and classify the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the second base model to determine the next level accident cause label of the Nth level accident cause label; wherein the base models are all large language models;

[0008] Multi-level accident cause labels are determined based on the first N levels of accident cause labels and the next level accident cause labels of the Nth level accident cause labels, so as to utilize the first base model and analyze the traffic accident data to be analyzed with a small number of sample prompt words based on the multi-level accident cause labels to obtain the first N+1 levels of accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed.

[0009] Optionally, before obtaining the pre-trained first base model, the method further includes:

[0010] The initial first base model is trained using the training set, and during the training process, a low-rank matrix is ​​added to the weight parameters of the initial first base model to fine-tune the weight parameters of the initial first base model until the fine-tuned first base model meets a preset end condition, and then a pre-trained first base model is determined based on the fine-tuned first base model.

[0011] Optionally, the preset end condition includes that the accuracy of the fine-tuned first base model reaches a preset accuracy threshold;

[0012] The process of determining the accuracy of the fine-tuned first base model includes:

[0013] Inputting the test set into the fine-tuned first base model to determine the top N accident cause labels and corresponding accident cause descriptions of each annotated data in the test set;

[0014] Based on the top N accident cause labels and corresponding accident cause descriptions of the annotated data, and the annotated information of the annotated data, the accuracy of the fine-tuned first base model is determined.

[0015] Optionally, traffic accident data includes information about the parties involved, environmental information, illegal behaviors of the parties involved, and the course of the accident;

[0016] The process of acquiring traffic accident data includes:

[0017] Obtaining a scanned copy of the accident responsibility determination letter based on the traffic accident case file, and performing optical character recognition on the scanned copy to extract traffic accident data;

[0018] And / or, obtaining traffic accident data from a preset traffic management platform; the preset traffic management platform is used to manage traffic accident data.

[0019] Optionally, the process of forming the labeled data in the training set and the test set includes:

[0020] The traffic accident data is processed by thought chain to add the preset prompt words to the traffic accident data, extract the description of each accident cause from the traffic accident data, and use the first N levels of accident cause labels to label the traffic accident data with accident cause labels corresponding to each accident cause description, so as to form labeled data.

[0021] Optionally, the annotation information also includes the legal provisions violated by the traffic accident data;

[0022] Accordingly, the first N levels of accident cause labels and corresponding accident cause descriptions of the historical traffic accident data are determined by the first base model, including:

[0023] Determine, by means of the first base model, the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data, as well as the legal provisions violated by the historical traffic accident data;

[0024] Furthermore, the method of using the first base model and adding a small number of sample prompt words to the traffic accident data to be analyzed based on the multi-level accident cause label analysis to obtain the first N+1 level accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed includes:

[0025] The first base model is used to analyze the traffic accident data to be analyzed with a small number of sample prompt words based on the multi-level accident cause label analysis, so as to obtain the first N+1 level accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed, as well as the legal provisions violated by the traffic accident data to be analyzed.

[0026] Optionally, after the method uses the first base model and analyzes the traffic accident data to be analyzed with a small number of sample prompt words based on the multi-level accident cause labels to obtain the first N+1 levels of accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed, it also includes:

[0027] Clustering the accident locations of the traffic accident data to be analyzed to determine traffic accident black spots;

[0028] Based on the first N+1 level accident cause labels of the traffic accident data corresponding to the traffic accident black spot, the cause of frequent accidents at the traffic accident black spot is determined, and rectification suggestions for the traffic accident black spot are determined based on the cause of frequent accidents.

[0029] In a second aspect, the present application provides a traffic accident cause analysis device, comprising:

[0030] A model acquisition module, used to acquire a pre-trained first base model; wherein the labeled data in the training set and the test set used to train the first base model are data based on preset prompt words, traffic accident data and labeled information, and the labeled information includes the first N levels of accident cause labels of the traffic accident data and the accident cause descriptions corresponding to each accident cause label in the traffic accident data, where N is a positive integer;

[0031] a cause description classification module, for determining the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the first base model, and classifying the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the second base model, so as to determine the next level accident cause label of the Nth level accident cause label; wherein the base models are all large language models;

[0032] An accident cause analysis module is used to determine multi-level accident cause labels based on the first N levels of accident cause labels and the next level accident cause labels of the Nth level accident cause labels, so as to use the first base model and analyze the traffic accident data to be analyzed with a small number of sample prompt words based on the multi-level accident cause labels to obtain the first N+1 levels of accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed.

[0033] In a third aspect, the present application provides an electronic device, including:

[0034] Memory, used to store computer programs;

[0035] A processor is used to execute the computer program to implement the aforementioned traffic accident cause analysis method.

[0036] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned method for analyzing the cause of a traffic accident.

[0037] In the present application, a pre-trained first base model is obtained; wherein the labeled data in the training set and the test set used to train the first base model are data based on preset prompt words, traffic accident data and annotation information, and the annotation information includes the first N levels of accident cause labels of the traffic accident data and the accident cause descriptions corresponding to each accident cause label in the traffic accident data, where N is a positive integer; the first N levels of accident cause labels and the corresponding accident cause descriptions of the historical traffic accident data are determined by the first base model, and the first N levels of accident cause labels and the corresponding accident cause descriptions of the historical traffic accident data are classified by the second base model to determine the next level of accident cause labels of the Nth level accident cause label; wherein the base models are all large language models; multi-level accident cause labels are determined based on the first N levels of accident cause labels and the next level of accident cause labels of the Nth level accident cause labels, so as to use the first base model and based on the multi-level accident cause label analysis to increase the traffic accident data to be analyzed with a small number of sample prompt words, so as to obtain the first N+1 levels of accident cause labels and the corresponding accident cause descriptions of the traffic accident data to be analyzed.

[0038] It can be seen that the present application introduces a large language model with good semantic parsing and learning capabilities as a base model, so as to train the first base model using annotated data composed of preset prompt words, traffic accident data and annotation information. Since the annotation information includes the top N accident cause labels of the traffic accident data and the corresponding accident cause descriptions, the first base model can learn why these accident cause labels are labeled with the traffic accident data based on the accident cause descriptions, that is, the first base model can capture and learn the potential language rules therein, so as to better analyze the causes of accidents on the traffic accident data. In addition, the present application utilizes the analysis and classification capabilities of a large language model to classify the next-level accident cause labels of the N-th level accident cause labels according to the first N levels of accident cause labels and the corresponding accident cause descriptions, thereby constructing more standardized, richer and more refined multi-level accident cause labels based on the first N levels of accident cause labels and the next-level accident cause labels of the N-th level accident cause labels, so that the first base model can use the multi-level accident cause labels to explore the multi-faceted and deep-seated causes of traffic accident data and improve the accuracy of the analysis of the causes of traffic accidents. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0040] Figure 1A flow chart of a method for analyzing the causes of traffic accidents disclosed in this application;

[0041] Figure 2 A model training flow chart disclosed in this application;

[0042] Figure 3 A flowchart for constructing a multi-level accident cause label disclosed in this application;

[0043] Figure 4 This is a schematic diagram of the structure of a traffic accident cause analysis device disclosed in this application;

[0044] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] The text styles of traffic accident data are diverse, and writing habits vary from region to region or individual to individual. NLP technology may have difficulty understanding the complex descriptions of traffic accident data, resulting in incomplete or inaccurate extraction of key information, and the classification of accident causes is relatively superficial and lacks standardization, which can easily have a negative impact on the accurate analysis of the causes of traffic accidents. To this end, the present application provides a method for analyzing the causes of traffic accidents, which utilizes the analysis and classification capabilities of a large language model to determine the next level of the Nth level of the accident cause label based on the first N levels of the accident cause label and the corresponding accident cause description, thereby constructing a more refined multi-level accident cause label to explore the multi-faceted and deep-seated causes of traffic accidents.

[0047] See also Figure 1 As shown, an embodiment of the present invention discloses a method for analyzing the cause of a traffic accident, comprising:

[0048] Step S11, obtaining a pre-trained first base model; wherein the labeled data in the training set and the test set used to train the first base model are data based on preset prompt words, traffic accident data and annotation information, and the annotation information includes the top N levels of accident cause labels of the traffic accident data and the accident cause descriptions corresponding to each accident cause label in the traffic accident data, where N is a positive integer.

[0049] In this embodiment, a large language model (LLM, Large Language Models) built based on the Transformer architecture is used as the first base model, and the first base model is trained and tested using a training set and a test set to obtain a pre-trained first base model.

[0050] Among them, the training set and the test set can include both unlabeled data and labeled data. The purpose is to achieve supervised training (Supervised Fine-Tuning, SFT) of the first base model, to avoid the problem of overfitting of the first base model by using only labeled data to train the first base model, and to avoid the problem of reducing the training efficiency of the first base model by using only unlabeled data to train the first base model.

[0051] The labeled data in the training set and the test set can be composed based on preset prompt words, traffic accident data and labeling information; wherein the labeling information includes the top N accident cause labels of the traffic accident data and the corresponding accident cause descriptions, and the accident cause descriptions are the relevant descriptions corresponding to the accident cause labels in the traffic accident data; and N is a positive integer.

[0052] It should be noted that the first N levels of accident cause labels include the first level accident cause label, the second level accident cause label, ..., the Nth level accident cause label; and the first N levels of accident cause labels correspond to the N-level accident cause label system, which is an accident cause label system established in advance based on expert experience. The first N levels of accident cause labels of traffic accident data refer to the accident cause labels in the N-level accident cause label system that match the traffic accident data.

[0053] Taking N out of three as an example, the first-level accident cause label may include human accident causes, vehicle accident causes, road accident causes and environmental accident causes, etc.; the second-level accident cause label refers to the general classification of negligent behavior under the first-level accident cause label, for example, the second-level accident cause label may include failure to reduce speed and failure to use crosswalks under human accident causes, etc.; the third-level accident cause label refers to the slightly more detailed classification under the second-level accident cause label, for example, the third-level accident cause label may include failure to reduce speed due to poor visibility and failure to reduce speed due to the driver's driving status, etc.

[0054] Specifically, the process of forming the labeled data in the training set and the test set may include: performing Chain-of-Thought processing on the traffic accident data to add preset prompt words to the traffic accident data, extracting descriptions of the causes of each accident from the traffic accident data, and using the top N levels of accident cause labels (or an N-level accident cause label system) to label the traffic accident data with accident cause labels corresponding to the descriptions of each accident cause, thereby forming labeled data.

[0055] It should be noted that the labeled data is the data obtained by labeling high-quality traffic accident data; high-quality traffic accident data generally refers to data including the location and process of the accident.

[0056] Among them, the preset prompt words may include role limitation, task background description, task description, accident cause label system description and output expectation, etc. Role limitation can be: "You are a traffic accident analysis expert"; task background description can be: "The task you need to do is to understand the case information by reading traffic accident data"; task description can be: "Analyze the accident causes of traffic accident data and extract the corresponding accident cause description"; accident cause label system description can be: "Describe the N-level accident cause label system"; output expectation can be: "Accident cause label and corresponding accident cause description".

[0057] Furthermore, for each accident cause description extracted from the traffic accident data, each accident cause description can be highlighted in a specific format so that the first base model can learn why the traffic accident data are labeled with these accident cause labels based on each accident cause description, that is, the first base model can capture and learn the potential language rules therein, thereby better analyzing the causes of traffic accident data and improving the accuracy of analysis of the causes of traffic accidents.

[0058] It should also be noted that the output expectation of the preset prompt words may include not only the accident cause label and the corresponding accident cause description, but also the violated legal provisions; accordingly, the annotation information of the traffic accident data may include not only the first N levels of accident cause labels and the corresponding accident cause description of the traffic accident data, but also the violated legal provisions of the traffic accident data. In this way, when analyzing the accident cause of the traffic accident data, the first base model can also analyze the violated legal provisions of the traffic accident data.

[0059] After constructing the training set, the initial first base model is trained using the training set, and during the training process, the LoRA (Low-Rank Adaptation) technology is used to add a low-rank matrix to the weight parameters of the initial first base model to fine-tune the weight parameters of the initial first base model until the fine-tuned first base model meets the preset end conditions, and then the pre-trained first base model is determined based on the fine-tuned first base model.

[0060] In this way, this embodiment uses the training set to train the first base model, which can improve the ability of the first base model in analyzing the causes of traffic accidents, and the use of low-rank adaptive technology can allow the first base model to learn new tasks under a limited training set, while retaining the original capabilities of the first base model to the greatest extent, preventing the first base model from overfitting, and improving the training efficiency of the first base model.

[0061] Furthermore, the preset end condition may include that the accuracy of the fine-tuned first base model reaches a preset accuracy threshold, or that the current training times reaches a preset total number of times. The preset accuracy threshold and the preset total number of times may be set according to the accuracy requirements of the model. For example, the higher the accuracy requirements of the model, the larger the preset accuracy threshold and the preset total number of times are set.

[0062] When the preset end condition is that the accuracy of the fine-tuned first base model reaches a preset accuracy threshold, the fine-tuned first base model can be tested using a test set to determine the accuracy of the fine-tuned first base model.

[0063] Specifically, the test set is input into the fine-tuned first base model to determine the top N accident cause labels and corresponding accident cause descriptions of each annotated data in the test set; based on the top N accident cause labels and corresponding accident cause descriptions of each annotated data, as well as the annotation information of each annotated data, the accuracy of the fine-tuned first base model is determined.

[0064] It can be understood that the fine-tuned first base model is used to perform accident cause analysis on each data in the test set to obtain the top N accident cause labels and corresponding accident cause descriptions of each data in the test set, and then the top N accident cause labels and corresponding accident cause descriptions of each annotated data in the test set, as well as the annotation information of each annotated data, are compared to determine the accuracy of the fine-tuned first base model.

[0065] It should be noted that when the first base model after fine-tuning does not meet the preset end condition, the first base model continues to be trained using the training set, and the training set at this time can be the optimized and adjusted training set. Among them, the optimization and adjustment of the training set includes optimizing and adjusting the N-level accident cause label system, optimizing and adjusting the preset prompt words, optimizing and adjusting the annotation information of the annotated data in the training set, etc., so as to improve the training effect of the first base model by continuously optimizing the training set.

[0066] The traffic accident data in this embodiment includes but is not limited to party information, environmental information, party violations, accident responsibility division, accident process, accident location, etc. Among them, one way to obtain traffic accident data can be: obtain a scanned copy of the accident responsibility determination letter based on the traffic accident case file, and perform optical character recognition (OCR) on the scanned copy to extract the traffic accident data from the recognized data. The traffic accident data at this time can be the case handler's opinion in the accident responsibility determination letter. Another way can be: obtain traffic accident data from a preset traffic management platform, wherein the preset traffic management platform is a platform for managing traffic accident data, such as a comprehensive traffic management application platform (six-in-one platform).

[0067] Since there are no relevant standards for the opinions of the case handlers in the accident responsibility determination document, and different case handlers have different opinions due to their different personal writing habits, the traffic accident data extracted from the scanned copy of the accident responsibility determination document may be unstructured data. The preset traffic management platform may have certain standards for recording traffic accident data, so the traffic accident data obtained from the preset traffic management platform may be unstructured data or semi-structured data.

[0068] Step S12: determine the top N levels of accident cause labels and corresponding accident cause descriptions of the historical traffic accident data through the first base model, and classify the top N levels of accident cause labels and corresponding accident cause descriptions of the historical traffic accident data using the second base model to determine the next level of accident cause label of the Nth level accident cause label.

[0069] In this embodiment, after obtaining the pre-trained first base model, a number of historical traffic accident data are input into the first base model, so as to perform accident cause analysis on the historical traffic accident data through the first base model, thereby obtaining the top N levels of accident cause labels and corresponding accident cause descriptions of the historical traffic accident data. Then, the top N levels of accident cause labels and corresponding accident cause descriptions of the historical traffic accident data are classified using the second base model to obtain the next level of accident cause labels of the Nth level accident cause labels, that is, the N+1th level accident cause labels.

[0070] After obtaining the next level accident cause label of the N level accident cause label, the N+1 level accident cause label can also be calibrated through manual and expert calibration to optimize and adjust the N+1 level accident cause label, thereby making the N+1 level accident cause label more accurate.

[0071] It should be noted that the N+1th level accident cause label is a fine division under the Nth level accident cause label. Taking N as three as an example, the fourth level accident cause label refers to the fine division under the third level accident cause label. For example, the fourth level accident cause label may include the unreduced speed caused by the driver's driving state, the unreduced speed caused by the driver's fatigue state, the unreduced speed caused by the driver's drunk driving state, etc.

[0072] It should also be noted that the second base model can also be a large language model built based on the Transformer architecture. In addition, the processing power and computing power of the second base model are stronger than those of the first base model, but the model parameters of the second base model are more than those of the first base model, and the second base model has higher requirements for memory and graphics card than the first base model. For example, the first base model can use Qwen-7b (Tongyi Qianwen Large Language Model), and the second base model can use Qwen-72b.

[0073] Furthermore, when the annotation information of the annotated data in the training set and the test set also includes the legal provisions violated by the traffic accident data, the accident cause analysis of the historical traffic accident data is performed through the first base model. In addition to obtaining the top N level accident cause labels and corresponding accident cause descriptions of the historical traffic accident data, the legal provisions violated by the historical traffic accident data can also be obtained.

[0074] Step S13, determining a multi-level accident cause label based on the first N levels of accident cause labels and the next level accident cause label of the Nth level accident cause label, so as to utilize the first base model and analyze the traffic accident data to be analyzed with a small number of sample prompt words based on the multi-level accident cause label to obtain the first N+1 levels of accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed.

[0075] In this embodiment, after the next-level accident cause label of the N-th level accident cause label is obtained by classification through the second base model, a multi-level accident cause label is constructed based on the first N levels of accident cause labels and the next-level accident cause label of the N-th level accident cause label, that is, a multi-level accident cause label system is constructed based on the N-level accident cause label system and the N+1-th level accident cause label, thereby realizing the standardization and refined division of accident cause labels.

[0076] After the first base model is trained and the multi-level accident cause labels are constructed, the first base model can be used to perform accident cause analysis on the traffic accident data to be analyzed based on the multi-level accident cause labels, thereby obtaining the first N+1 level accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed.

[0077] Specifically, the traffic accident data to be analyzed are processed by a thought chain to add a few sample prompt words to the traffic accident data to be analyzed, and then the traffic accident data to be analyzed with the added few sample prompt words are input into the first base model, so that the first base model can use the multi-level accident cause labels to determine the first N+1 levels of accident cause labels and the corresponding accident cause descriptions of the traffic accident data to be analyzed.

[0078] Among them, the few-sample prompt words are a method of guiding the large model to complete the task by providing a small number of examples. It helps the large model better understand the user's intention by adding specific examples to the prompt words, thereby improving the performance of the large model in complex scenarios. In this embodiment, the few-sample prompt words may include specific examples for a small number of Nth-level accident cause labels. The specific examples illustrate how to infer the N+1th-level accident cause labels based on the Nth-level accident cause labels and traffic accident data. In this way, this embodiment utilizes the good semantic parsing and reasoning capabilities of the large language model, combined with standardized and refined multi-level accident cause labels, to achieve the mining of multiple aspects of the deep-seated causes of traffic accident data.

[0079] When the annotation information of the annotated data in the training set and the test set also includes the legal provisions violated by the traffic accident data, the traffic accident data to be analyzed with the addition of small sample prompt words is analyzed using the first base model based on the multi-level accident cause labels. In addition to obtaining the first N+1 level accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed, the legal provisions violated by the traffic accident data to be analyzed can also be obtained.

[0080] Furthermore, by clustering the accident locations of each traffic accident data to be analyzed, traffic accident black spots are determined, where traffic accident black spots refer to locations or areas where traffic accidents frequently occur; based on the first N+1 accident cause labels of the traffic accident data corresponding to the traffic accident black spots, the causes of frequent accidents in the traffic accident black spots are determined, and then rectification suggestions for the traffic accident black spots are determined based on the causes of frequent accidents. In this way, this embodiment can provide traffic management departments with traffic accident black spots and rectification suggestions for traffic accident black spots, thereby providing scientific guidance for traffic accident prevention and hidden danger rectification, and improving the level of traffic safety management and governance efficiency.

[0081] It should be noted that if the first base model has hallucinations during operation, that is, the content output by the first base model does not correspond to the real-world facts or input data, then it is considered that the first base model has hallucinations. At this time, the multi-level accident cause labels, training sets, test sets, etc. are optimized and adjusted according to the input data that causes the first base model to have hallucinations, so that the first base model is optimized and adjusted according to the optimized and adjusted multi-level accident cause labels, training sets, test sets, etc. In this way, this embodiment continuously optimizes and adjusts the multi-level accident cause labels, training sets, test sets, etc., thereby achieving continuous optimization and adjustment of the first base model, making the first base model more perfect and more suitable for various usage scenarios.

[0082] It can be seen that the present application introduces a large language model with good semantic parsing and learning capabilities as a base model, so as to train the first base model using annotated data composed of preset prompt words, traffic accident data and annotation information. Since the annotation information includes the top N accident cause labels of the traffic accident data and the corresponding accident cause descriptions, the first base model can learn why these accident cause labels are labeled with the traffic accident data based on the accident cause descriptions, that is, the first base model can capture and learn the potential language rules therein, so as to better analyze the causes of accidents on the traffic accident data. In addition, the present application utilizes the analysis and classification capabilities of a large language model to classify the next-level accident cause labels of the N-th level accident cause labels according to the first N levels of accident cause labels and the corresponding accident cause descriptions, thereby constructing more standardized, richer and more refined multi-level accident cause labels based on the first N levels of accident cause labels and the next-level accident cause labels of the N-th level accident cause labels, so that the first base model can use the multi-level accident cause labels to explore the multi-faceted and deep-seated causes of traffic accident data and improve the accuracy of the analysis of the causes of traffic accidents.

[0083] by Figure 2 and Figure 3 Taking the example of FIG. 1 as an example, a method for analyzing the cause of a traffic accident disclosed in an embodiment of the present invention is described in detail, which may specifically include:

[0084] In the preparation stage, a scanned copy of the accident responsibility determination letter is obtained based on the traffic accident case file, and the scanned copy is subjected to OCR optical character recognition to extract unstructured traffic accident data, thereby forming an accident determination information database. At this time, the traffic accident data can be the case handler's opinion in the accident responsibility determination letter. In addition, semi-structured traffic accident data can also be obtained from the six-in-one platform to form an accident basic information database.

[0085] Select several high-quality traffic accident data from the accident identification information database and the accident basic information database, and perform thought chain processing on each high-quality traffic accident data to add preset prompt words to the traffic accident data, extract descriptions of each accident cause from the traffic accident data, and use the N-level accident cause label system established in advance based on expert experience to label the traffic accident data with accident cause labels corresponding to each accident cause description, and at the same time label the traffic accident data with the legal provisions violated, thereby forming labeled data. That is, the labeling information of the labeled data includes the first N-level accident cause labels of the traffic accident data, the accident cause descriptions corresponding to each accident cause label in the traffic accident data, and the legal provisions violated by the traffic accident data. Then, the training set and test set are constructed based on the labeled data and the unlabeled data in the accident identification information database and the accident basic information database.

[0086] During the model training phase, the training set is fed to the first base model to train the initial first base model using the training set, and during the training process, the LoRA low-rank adaptive technology is used to add a low-rank matrix to the weight parameters of the initial first base model to fine-tune the weight parameters of the initial first base model until the fine-tuned first base model meets the preset end conditions, and then the pre-trained first base model is determined based on the fine-tuned first base model.

[0087] The preset termination condition includes that the accuracy of the fine-tuned first base model reaches a preset accuracy threshold. The accuracy of the fine-tuned first base model can be determined by inputting the test set into the fine-tuned first base model to determine the top N accident cause labels and corresponding accident cause descriptions of each annotated data in the test set, as well as the violated legal provisions, and then comparing them with the annotated information of each annotated data to determine the accuracy of the fine-tuned first base model.

[0088] If the accuracy of the fine-tuned first base model does not reach the preset accuracy threshold, the N-level accident cause label system, preset prompt words, and the annotation information with annotated data in the training set are optimized and adjusted to continue training the first base model based on the optimized and adjusted training set. Among them, the optimization and adjustment methods include but are not limited to the optimization and adjustment methods by sorting out erroneous data, the optimization and adjustment methods by expert experience, and the optimization and adjustment methods by summarizing and sorting out. If the accuracy of the fine-tuned first base model reaches the preset accuracy threshold, the pre-trained first base model is determined based on the fine-tuned first base model.

[0089] In the construction phase of the multi-level accident cause label system, the first N levels of accident cause labels and corresponding accident cause descriptions of historical traffic accident data, as well as the legal provisions violated, are determined through the first base model. Then, the second base model is used to classify the first N levels of accident cause labels and corresponding accident cause descriptions of historical traffic accident data to determine the next level of accident cause labels of the Nth level accident cause label, that is, the N+1th level accident cause label. After that, the N+1th level accident cause label is calibrated by manual and expert calibration to optimize and adjust the N+1th level accident cause label. Finally, a multi-level accident cause label system is constructed based on the Nth level accident cause label system and the N+1th level accident cause label.

[0090] In the traffic accident cause analysis stage, a small number of sample prompt words are added to the traffic accident data to be analyzed in the accident analysis database, and the traffic accident data to be analyzed with the small number of sample prompt words are analyzed based on the multi-level accident cause label system through the first base model to determine the first N+1 level accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed, as well as the violated legal provisions, and backfilled into the accident analysis database. Afterwards, the accident locations of each traffic accident data to be analyzed in the accident analysis database are clustered to determine the traffic accident black spots, and the causes of frequent accidents in the traffic accident black spots are determined based on the first N+1 level accident cause labels of the traffic accident data corresponding to the traffic accident black spots, and then the rectification suggestions for the traffic accident black spots are determined based on the causes of frequent accidents. In this way, through the rectification suggestions for traffic accident black spots, scientific guidance can be provided for traffic accident prevention and hidden danger rectification, thereby improving the level of traffic safety management and governance efficiency.

[0091] See also Figure 4 As shown, the embodiment of the present invention discloses a traffic accident cause analysis device, comprising:

[0092] The model acquisition module 11 is used to acquire a pre-trained first base model; wherein the labeled data in the training set and the test set used to train the first base model are data based on preset prompt words, traffic accident data and labeled information, and the labeled information includes the first N levels of accident cause labels of the traffic accident data and the accident cause descriptions corresponding to each accident cause label in the traffic accident data, where N is a positive integer;

[0093] a cause description classification module 12, for determining the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the first base model, and classifying the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the second base model, so as to determine the next level accident cause label of the Nth level accident cause label; wherein the base models are all large language models;

[0094] The accident cause analysis module 13 is used to determine a multi-level accident cause label based on the first N levels of accident cause labels and the next level accident cause label of the Nth level accident cause label, so as to utilize the first base model and analyze the traffic accident data to be analyzed with a small number of sample prompt words based on the multi-level accident cause label to obtain the first N+1 levels of accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed.

[0095] It can be seen that the present application introduces a large language model with good semantic parsing and learning capabilities as a base model, so as to train the first base model using annotated data composed of preset prompt words, traffic accident data and annotation information. Since the annotation information includes the top N accident cause labels of the traffic accident data and the corresponding accident cause descriptions, the first base model can learn why these accident cause labels are labeled with the traffic accident data based on the accident cause descriptions, that is, the first base model can capture and learn the potential language rules therein, so as to better analyze the causes of accidents on the traffic accident data. In addition, the present application utilizes the analysis and classification capabilities of a large language model to classify the next-level accident cause labels of the N-th level accident cause labels according to the first N levels of accident cause labels and the corresponding accident cause descriptions, thereby constructing more standardized, richer and more refined multi-level accident cause labels based on the first N levels of accident cause labels and the next-level accident cause labels of the N-th level accident cause labels, so that the first base model can use the multi-level accident cause labels to explore the multi-faceted and deep-seated causes of traffic accident data and improve the accuracy of the analysis of the causes of traffic accidents.

[0096] In some specific embodiments, the traffic accident cause analysis device further includes:

[0097] A model training module is used to train the initial first base model using the training set, and during the training process, a low-rank matrix is ​​added to the weight parameters of the initial first base model to fine-tune the weight parameters of the initial first base model until the fine-tuned first base model meets a preset end condition, and then a pre-trained first base model is determined based on the fine-tuned first base model.

[0098] In some specific embodiments, the preset end condition includes that the accuracy of the fine-tuned first base model reaches a preset accuracy threshold;

[0099] The process of determining the accuracy of the fine-tuned first base model in the model training module includes:

[0100] A first determination unit, configured to input the test set into the fine-tuned first base model to determine the top N accident cause labels and corresponding accident cause descriptions of each annotated data in the test set;

[0101] The accuracy determination unit is used to determine the accuracy of the fine-tuned first base model based on the top N accident cause labels and corresponding accident cause descriptions of the annotated data and the annotation information of the annotated data.

[0102] In some specific embodiments, the traffic accident data includes information about the parties involved, environmental information, illegal behaviors of the parties involved, and the course of the accident;

[0103] The process of acquiring traffic accident data in the traffic accident cause analysis device includes:

[0104] A data extraction unit, used to obtain a scanned copy of the accident responsibility determination letter based on the traffic accident case file, and perform optical character recognition on the scanned copy to extract traffic accident data;

[0105] The data acquisition unit is used to acquire traffic accident data from a preset traffic management platform; the preset traffic management platform is used to manage traffic accident data.

[0106] In some specific embodiments, the process of forming the labeled data in the training set and the test set in the traffic accident cause analysis device includes:

[0107] The thought chain processing unit is used to perform thought chain processing on the traffic accident data to add the preset prompt words to the traffic accident data, extract the description of each accident cause from the traffic accident data, and use the first N levels of accident cause labels to label the traffic accident data with accident cause labels corresponding to each accident cause description, so as to form labeled data.

[0108] In some specific embodiments, the annotation information also includes the legal provisions violated by the traffic accident data;

[0109] Accordingly, the cause description classification module 12 includes:

[0110] A second determination unit, configured to determine, through the first base model, the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data, and the legal provisions violated by the historical traffic accident data;

[0111] Furthermore, the accident cause analysis module 13 includes:

[0112] An accident data analysis unit is used to use the first base model and based on the multi-level accident cause label analysis to add a small number of sample prompt words to the traffic accident data to be analyzed, so as to obtain the first N+1 level accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed, as well as the legal provisions violated by the traffic accident data to be analyzed.

[0113] In some specific embodiments, the traffic accident cause analysis device further includes:

[0114] A location clustering unit, used for clustering the accident locations of the traffic accident data to be analyzed to determine the traffic accident black spots;

[0115] A rectification suggestion determination unit is used to determine the cause of frequent accidents at the traffic accident black spot based on the first N+1 level accident cause labels of the traffic accident data corresponding to the traffic accident black spot, and determine rectification suggestions for the traffic accident black spot based on the cause of frequent accidents.

[0116] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0117] Figure 5 The structural diagram of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the traffic accident cause analysis method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0118] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0119] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0120] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and may be Windows Server, Netware, Unix, Linux, etc. In addition to computer programs that can be used to complete the traffic accident cause analysis method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks.

[0121] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed method for analyzing the causes of traffic accidents is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0122] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0123] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0124] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0125] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0126] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for analyzing the causes of traffic accidents, characterized in that: include: Obtain a pre-trained first base model; wherein the labeled data in the training set and the test set used to train the first base model are data based on preset prompt words, traffic accident data and labeled information, and the labeled information includes the first N levels of accident cause labels of the traffic accident data and the accident cause descriptions corresponding to each accident cause label in the traffic accident data, where N is a positive integer; Determine the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the first base model, and classify the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the second base model to determine the next level accident cause label of the Nth level accident cause label; wherein the base models are all large language models; Multi-level accident cause labels are determined based on the first N levels of accident cause labels and the next level accident cause labels of the Nth level accident cause labels, so as to utilize the first base model and analyze the traffic accident data to be analyzed with a small number of sample prompt words based on the multi-level accident cause labels to obtain the first N+1 levels of accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed.

2. The method for analyzing the cause of a traffic accident according to claim 1, characterized in that: Before obtaining the pre-trained first base model, the method further includes: The initial first base model is trained using the training set, and during the training process, a low-rank matrix is ​​added to the weight parameters of the initial first base model to fine-tune the weight parameters of the initial first base model until the fine-tuned first base model meets a preset end condition, and then a pre-trained first base model is determined based on the fine-tuned first base model.

3. The traffic accident cause analysis method according to claim 2, characterized in that: The preset end condition includes that the accuracy of the first base model after fine-tuning reaches a preset accuracy threshold; The process of determining the accuracy of the fine-tuned first base model includes: Inputting the test set into the fine-tuned first base model to determine the top N accident cause labels and corresponding accident cause descriptions of each annotated data in the test set; Based on the top N accident cause labels and corresponding accident cause descriptions of the annotated data, and the annotated information of the annotated data, the accuracy of the fine-tuned first base model is determined.

4. The traffic accident cause analysis method according to claim 1, characterized in that: Traffic accident data includes information about the parties involved, environmental information, illegal behaviors of the parties involved, and the course of the accident; The process of acquiring traffic accident data includes: Obtaining a scanned copy of the accident responsibility determination letter based on the traffic accident case file, and performing optical character recognition on the scanned copy to extract traffic accident data; And / or, obtaining traffic accident data from a preset traffic management platform; the preset traffic management platform is used to manage traffic accident data.

5. The traffic accident cause analysis method according to claim 1, characterized in that: The process of forming the labeled data in the training set and the test set includes: The traffic accident data is processed by thought chain to add the preset prompt words to the traffic accident data, extract the description of each accident cause from the traffic accident data, and use the first N levels of accident cause labels to label the traffic accident data with accident cause labels corresponding to each accident cause description, so as to form labeled data.

6. The traffic accident cause analysis method according to claim 1, characterized in that: The annotation information also includes the legal provisions violated by the traffic accident data; Accordingly, the first N levels of accident cause labels and corresponding accident cause descriptions of the historical traffic accident data are determined by the first base model, including: Determine, by means of the first base model, the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data, as well as the legal provisions violated by the historical traffic accident data; Furthermore, the method of using the first base model and adding a small number of sample prompt words to the traffic accident data to be analyzed based on the multi-level accident cause label analysis to obtain the first N+1 level accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed includes: The first base model is used to analyze the traffic accident data to be analyzed with a small number of sample prompt words based on the multi-level accident cause label analysis, so as to obtain the first N+1 level accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed, as well as the legal provisions violated by the traffic accident data to be analyzed.

7. The method for analyzing the cause of a traffic accident according to any one of claims 1 to 6, characterized in that: After the method uses the first base model and analyzes the traffic accident data to be analyzed with the few sample prompt words added based on the multi-level accident cause labels to obtain the first N+1 level accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed, the method further includes: Clustering the accident locations of the traffic accident data to be analyzed to determine traffic accident black spots; Based on the first N+1 level accident cause labels of the traffic accident data corresponding to the traffic accident black spot, the cause of frequent accidents at the traffic accident black spot is determined, and rectification suggestions for the traffic accident black spot are determined based on the cause of frequent accidents.

8. A traffic accident cause analysis device, characterized in that: include: A model acquisition module, used to acquire a pre-trained first base model; wherein the labeled data in the training set and the test set used to train the first base model are data based on preset prompt words, traffic accident data and labeled information, and the labeled information includes the first N levels of accident cause labels of the traffic accident data and the accident cause descriptions corresponding to each accident cause label in the traffic accident data, where N is a positive integer; a cause description classification module, for determining the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the first base model, and classifying the top N accident cause labels and corresponding accident cause descriptions of the historical traffic accident data by using the second base model, so as to determine the next level accident cause label of the Nth level accident cause label; wherein the base models are all large language models; An accident cause analysis module is used to determine multi-level accident cause labels based on the first N levels of accident cause labels and the next level accident cause labels of the Nth level accident cause labels, so as to use the first base model and analyze the traffic accident data to be analyzed with a small number of sample prompt words based on the multi-level accident cause labels to obtain the first N+1 levels of accident cause labels and corresponding accident cause descriptions of the traffic accident data to be analyzed.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, used to execute the computer program to implement the traffic accident cause analysis method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the method for analyzing the cause of a traffic accident as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Risk identification method, electronic device, storage medium and program product

    CN117876090A

  • Train operation risk identification method, computing device and storage medium

    CN119037502A

  • Liability cognizance method and device of traffic accident and computer readable storage medium

    WO2020024457A1

  • Systems and methods for providing process automation and artificial intelligence, market aggregation, and embedded marketplaces for a transactions platform

    WO2024025863A1