Accident detection method and device, electronic equipment and computer readable storage medium
Patent Information
- Application Number
- CN202311800204.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-25
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2043-12-25
AI Technical Summary
这些因素都可能导致驾驶员无法正常驾驶车辆,从而增加了交通事故的风险
Smart Images

Figure CN117935109B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle technology, and more specifically, to an accident detection method, apparatus, electronic device, and computer-readable storage medium in the field of vehicle technology. Background Technology
[0002] In recent years, with the rapid increase in car ownership, the number of highway traffic accidents has also continued to rise. This trend has attracted widespread public attention, and relevant departments have stepped up measures to address it. According to investigations and research by relevant institutions, vehicle malfunctions are a major factor causing traffic accidents. This further exacerbates our concerns about highway traffic safety.
[0003] Vehicle malfunctions can be caused by a variety of factors, including driver discomfort, fatigue, and driving under the influence of alcohol, as well as issues with the vehicle itself such as insufficient battery power, tire slippage, or low tire pressure. These factors can all prevent the driver from operating the vehicle properly, thus increasing the risk of traffic accidents. If these malfunctioning vehicles are not predicted and addressed in a timely manner, the consequences can range from increased traffic congestion and reduced road capacity to serious accidents causing personal injury and significant economic losses.
[0004] Therefore, predicting potential accidents during vehicle operation and intervening in them in a timely manner to reduce property damage and personal injury caused by accidents is of great significance for improving road safety. Summary of the Invention
[0005] This application provides an accident detection method, apparatus, electronic device, and computer-readable storage medium. The method can identify abnormal data from past vehicle operating data using an accident detection model obtained by fusing an isolated forest model and a time series model, and determine whether an accident has occurred based on the abnormal data. Since the accident detection model is obtained by fusing an isolated forest model and a time series model, it combines the advantages of both models, improving the accuracy and reliability of abnormal data identification.
[0006] Firstly, an accident detection method is provided, comprising: inputting target data generated during the operation of a target vehicle into a pre-trained accident detection model; wherein the target data includes operational data of multiple dimensions, the accident detection model includes an isolated forest model and a time series model, the output layer of the isolated forest model is connected to the input layer of the time series model; using the isolated forest model to identify abnormal data in the target data to obtain first abnormal data; obtaining operational data belonging to the same dimension as the first abnormal data from the target data to obtain time series data belonging to the same dimension as the first abnormal data and containing the first abnormal data; using the time series model to identify abnormal data in the time series data to obtain second abnormal data; determining the time difference between the generation of the first abnormal data and the generation of the second abnormal data during the operation of the target vehicle; and determining whether the target vehicle has been involved in an accident based on the time difference.
[0007] In the above technical solution, this embodiment of the application employs a method of inputting target data generated during the operation of a target vehicle into a pre-trained accident detection model. The target data includes operational data across multiple dimensions. The accident detection model includes an isolated forest model and a time series model. The isolated forest model is used to identify anomalous data in the target data, obtaining first anomalous data. Operational data belonging to the same dimension as the first anomalous data is then obtained from the target data to obtain time series data belonging to the same dimension as the first anomalous data and containing it. The time series model is then used to identify anomalous data in the time series data, obtaining second anomalous data. The time difference between the generation of the first anomalous data and the generation of the second anomalous data during the operation of the target vehicle is determined, and the timing difference is used to determine whether an accident has occurred. This technical solution enables the accident detection model, obtained by fusing the isolated forest model and the time series model, to identify anomalous data from the vehicle's past operational data and to determine whether an accident has occurred based on the anomalous data. Since the accident detection model is obtained by fusing the isolated forest model and the time series model, it combines the advantages of both models, improving the accuracy and reliability of anomalous data identification. When abnormal data indicates that a vehicle has been involved in an accident, users can be promptly notified, preventing them from continuing to use the vehicle without their knowledge, which could endanger their personal safety.
[0008] In conjunction with the first aspect, in some possible implementations, each piece of operational data in the target data carries the data's generation time; the step of obtaining operational data belonging to the same dimension as the first abnormal data from the target data to obtain time-series data belonging to the same dimension as the first abnormal data and containing the first abnormal data includes: using the generation time carried by the first abnormal data as a reference time; obtaining operational data belonging to the same dimension as the first abnormal data within a first preset time period generated before the reference time from the target data to obtain first detection data; obtaining operational data belonging to the same dimension as the first abnormal data within a second preset time period generated after the reference time from the target data to obtain second detection data; and generating the time-series data based on the first detection data, the first abnormal data, and the second detection data.
[0009] In combination with the first aspect and the above implementation methods, in some possible implementation methods, determining the time difference between the generation of the first abnormal data and the generation of the second abnormal data during the operation of the target vehicle includes: determining the difference between the generation time carried by the first abnormal data and the generation time carried by the second abnormal data; and determining the difference as the time difference.
[0010] In combination with the first aspect and the above implementation methods, in some possible implementation methods, determining whether the target vehicle has been involved in an accident based on the time difference includes: when the time difference is the difference value, determining whether the difference value is less than or equal to a preset difference value; if yes, determining that the target vehicle has been involved in an accident; if no, determining that the target vehicle has not been involved in an accident.
[0011] In conjunction with the first aspect and the above implementation methods, in some possible implementation methods, after determining whether the target vehicle has been involved in an accident based on the time difference, the accident detection method further includes: if it is determined that the target vehicle has been involved in an accident, acquiring driving record videos collected from the time of generation of the first abnormal data to the time of generation of the second abnormal data; determining the accident type based on the first abnormal data, the second abnormal data, and the driving record videos; and outputting prompt information about the accident type.
[0012] In combination with the first aspect and the above implementation methods, in some possible implementation methods, the step of using the isolated forest model to identify abnormal data in the target data and obtain the first abnormal data includes: inputting each running data in the target data into the isolated forest model to obtain the path length of each running data in the isolated forest model; determining the abnormal score of each running data in the target data based on the path length of each running data in the isolated forest model; and determining the running data that meets the abnormal conditions from the target data based on the abnormal scores to obtain the first abnormal data.
[0013] In conjunction with the first aspect and the above implementation methods, in some possible implementation methods, the accident detection method further includes: acquiring sample datasets corresponding to multiple sample vehicles; wherein, for each of the multiple sample vehicles, the sample dataset corresponding to the sample vehicle includes multi-dimensional sample operation data generated by the sample vehicle operating at different times, each sample operation data has annotation information, the annotation information being used to indicate whether the data category of the sample operation data is a normal category or an abnormal category; using the isolated forest model to identify abnormal data in the sample dataset corresponding to the sample vehicle, obtaining the first identification result, the first identification result including third abnormal data and the first data category of the third abnormal data, the first data category... The abnormal data is categorized as follows: Sample operational data belonging to the same dimension as the third abnormal data are obtained from the sample dataset corresponding to the sample vehicle, to obtain sample time series data belonging to the same dimension as the third abnormal data and containing the third abnormal data; the time series model is used to identify the abnormal data in the sample time series data to obtain the second identification result, which includes the fourth abnormal data and the second data category of the fourth abnormal data, the second data category being the abnormal category; the accident detection model is trained based on the first difference information between the first data category and the annotation information of the third abnormal data, and based on the second difference information between the second data category and the annotation information of the fourth abnormal data.
[0014] Secondly, an accident detection device is provided, the accident detection device comprising:
[0015] An anomaly detection module is used to input target data generated during the operation of a target vehicle into a pre-trained accident detection model. The target data includes operational data across multiple dimensions. The accident detection model includes an isolated forest model and a time series model, with the output layer of the isolated forest model connected to the input layer of the time series model. The isolated forest model is used to identify anomalous data in the target data to obtain first anomalous data. Operational data belonging to the same dimension as the first anomalous data is obtained from the target data to obtain time series data belonging to the same dimension as the first anomalous data and containing the first anomalous data. The time series model is used to identify anomalous data in the time series data to obtain second anomalous data.
[0016] The difference determination module is used to determine the time difference between the generation of the first abnormal data and the generation of the second abnormal data during the operation of the target vehicle.
[0017] The accident determination module is used to determine whether the target vehicle has been involved in an accident based on the time difference.
[0018] In conjunction with the second aspect, in some possible implementations, each piece of runtime data in the target data carries the data generation time, and the anomaly identification module includes:
[0019] The first data selection unit is used to take the generation time carried by the first abnormal data as a reference time; and to obtain the first detection data from the target data, which is generated within a first preset time period before the reference time and belongs to the same dimension as the first abnormal data.
[0020] The second data selection unit is used to obtain the second detection data from the target data, which is generated within a second preset time period after the reference time and belongs to the same dimension as the first abnormal data.
[0021] A data construction unit is used to generate the time series data based on the first detection data, the first abnormal data, and the second detection data.
[0022] In conjunction with the second aspect and the above implementation methods, in some possible implementation methods, the difference determination module is specifically used to: determine the difference between the generation time of the first abnormal data and the generation time of the second abnormal data; and determine the difference as the time difference.
[0023] In conjunction with the second aspect and the above implementation methods, in some possible implementation methods, the accident judgment module is specifically used to: when the time difference is the difference value, determine whether the difference value is less than or equal to a preset difference value; if yes, determine that the target vehicle has had an accident; if no, determine that the target vehicle has not had an accident.
[0024] In conjunction with the second aspect and the above-described implementations, in some possible implementations, the accident detection device further includes:
[0025] The prompting unit is used to, when it is determined that the target vehicle has been involved in an accident, acquire the driving record video collected from the time of generation of the first abnormal data to the time of generation of the second abnormal data; determine the accident type based on the first abnormal data, the second abnormal data and the driving record video; and output prompt information about the accident type.
[0026] In conjunction with the second aspect and the above implementation methods, in some possible implementations, the anomaly identification module further includes:
[0027] An abnormal data identification unit is used to input each running data in the target data into the isolated forest model to obtain the path length of each running data in the isolated forest model; determine the abnormal score of each running data in the target data based on the path length of each running data in the isolated forest model; and determine the running data that meets the abnormal conditions from the target data based on the abnormal score to obtain the first abnormal data.
[0028] In conjunction with the second aspect and the above-described implementations, in some possible implementations, the accident detection device further includes:
[0029] A model training unit is used to acquire sample datasets corresponding to multiple sample vehicles. For each of the multiple sample vehicles, the sample dataset includes multi-dimensional sample operation data generated by the vehicle at different times. Each sample operation data has annotation information indicating whether the data category is normal or abnormal. The isolated forest model is used to identify abnormal data in the sample dataset corresponding to the sample vehicle, obtaining a first identification result. The first identification result includes third abnormal data and a first data category of the third abnormal data, where the first data category is the abnormal category. From the sample vehicles... Sample running data belonging to the same dimension as the third abnormal data are obtained from the corresponding sample dataset to obtain sample time series data that belongs to the same dimension as the third abnormal data and contains the third abnormal data; the time series model is used to identify the abnormal data in the sample time series data to obtain the second identification result, the second identification result including the fourth abnormal data and the second data category of the fourth abnormal data, the second data category being the abnormal category; the accident detection model is trained based on the first difference information between the first data category and the annotation information of the third abnormal data, and based on the second difference information between the second data category and the annotation information of the fourth abnormal data.
[0030] Thirdly, an electronic device is provided, including a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, causing the electronic device to perform the accident detection method in the first aspect or any possible implementation thereof.
[0031] Fourthly, a computer program product is provided, comprising: computer program code, which, when run on a computer, causes the computer to execute the accident detection method in the first aspect or any possible implementation thereof.
[0032] Fifthly, a computer-readable storage medium is provided that stores computer program code, which, when executed on a computer, causes the computer to perform the accident detection method described in the first aspect or any possible implementation thereof. Attached Figure Description
[0033] Figure 1 A schematic flowchart of an accident detection method provided in an embodiment of this application is shown;
[0034] Figure 2A schematic diagram of the accident detection model is shown.
[0035] Figure 3 A schematic diagram of the abnormal data identification process of the accident detection model is shown;
[0036] Figure 4 This paper shows a schematic diagram of the structure of an accident detection device provided in an embodiment of this application;
[0037] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0038] The technical solutions in this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0039] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0040] The following is an embodiment of an accident detection method provided in this application.
[0041] Figure 1 A schematic flowchart of an accident detection method provided in an embodiment of this application is shown, such as... Figure 1 As shown, the accident detection method provided in this application is applied to electronic devices, such as computers, and the accident detection method includes the following schemes:
[0042] S110: Input the target data generated during the operation of the target vehicle into the pre-trained accident detection model.
[0043] In an exemplary embodiment, the target vehicle is a vehicle that needs to be detected for accidents. Different operating time periods of the target vehicle are selected, and target data generated during the operation of the target vehicle during the operation period are obtained from the vehicle network data. The vehicle network data includes operating data such as vehicle speed, steering data, braking data, fuel consumption data, engine temperature data, and tire pressure data. The target data includes operating data in multiple dimensions, including time feature dimension, statistical feature dimension, operational feature dimension, sensor feature dimension, time series feature dimension, spatial feature dimension, frequency domain feature dimension, and combined feature dimension.
[0044] 1. Time-related characteristics, including:
[0045] Time units such as hours, minutes, and seconds are used to capture behavioral patterns over different time periods;
[0046] The day of the week, whether it is a working day, etc., are used to reflect the influence of the surrounding environment.
[0047] 2. Statistical feature dimensions, including:
[0048] Mean, standard deviation, maximum, minimum, etc., are statistical characteristics used to describe the distribution of data. Statistical characteristics can reveal the trend, dispersion, and outliers of the data.
[0049] 3. Operational characteristics, including: number of operations, operation duration, operation frequency, etc.; for example, the number of braking, acceleration, and steering operations. Operational characteristics can reveal the vehicle's behavior patterns and driving habits.
[0050] 4. Sensor feature dimensions, including features extracted from sensor data, such as acceleration, speed, and steering angle. These features can help capture the dynamic behavior and changes of the vehicle.
[0051] 5. Time-series feature dimension, including: sliding window features based on historical data, such as average speed and acceleration over the past few hours. Time-series features can capture the trend and periodicity of data.
[0052] 6. Spatial feature dimension, including: vehicle location, latitude and longitude and other geographical information. Spatial features can be used to analyze the differences in vehicle behavior in different locations.
[0053] 7. Frequency domain feature dimension, including: frequency features. Using methods such as Fourier transform, time domain data is converted into frequency domain data, and frequency features are extracted. Frequency domain features can capture the periodicity and oscillation of data.
[0054] 8. Combining feature dimensions, including combinations of different features, such as the product of velocity and acceleration. Combining features can help the model better understand the multidimensional relationships in the data.
[0055] like Figure 2 As shown, Figure 2 The diagram shows the structure of the accident detection model, which includes an Isolation Forest model 100 and a time series model 200. The output layer of the Isolation Forest model 100 is connected to the input layer of the time series model 200, which is a Holt-Winters model.
[0056] S120: The isolated forest model is used to identify abnormal data in the target data to obtain the first abnormal data.
[0057] After the target data is input into the accident detection model, it serves as the input data for the Isolation Forest model. The Isolation Forest model identifies anomalous data in the target data and outputs the identified anomalous data, which is called the first anomalous data.
[0058] S130: Obtain operational data belonging to the same dimension as the first abnormal data from the target data to obtain time series data that belongs to the same dimension as the first abnormal data and contains the first abnormal data.
[0059] After obtaining the first abnormal data, operational data belonging to the same dimension as the first abnormal data is extracted from the target data. Time series data is then constructed using the first abnormal data and the operational data belonging to the same dimension in the target data. For example, if the dimension of the first abnormal data is the operational feature dimension, then operational data belonging to the operational feature dimensions other than the first abnormal data are extracted from the target data. Finally, time series data is constructed using the operational data belonging to the operational feature dimensions other than the first abnormal data in the target data and the first abnormal data.
[0060] S140: The time series model is used to identify abnormal data in the time series data to obtain second abnormal data.
[0061] After the time series data is constructed, it is used as the input data for the time series model. The time series model identifies outliers in the time series data and outputs the identified outliers, which are called second outliers.
[0062] S150: Determine the time difference between the generation of the first abnormal data and the generation of the second abnormal data during the operation of the target vehicle.
[0063] S160: Determine whether the target vehicle has been involved in an accident based on the time difference.
[0064] After obtaining the first and second abnormal data, the time difference between the generation of the first and second abnormal data during the operation of the target vehicle is calculated. The time difference represents the length of the time interval between the generation of the first and second abnormal data. If the time difference is large, it means that the time interval between the generation of the first and second abnormal data is long, and it can be considered that the target vehicle has not had an accident. If the time difference is small, it means that the time interval between the generation of the first and second abnormal data is short, and it can be considered that the target vehicle has had an accident.
[0065] This application embodiment employs a method where target data generated during the operation of a target vehicle is input into a pre-trained accident detection model. The target data includes operational data across multiple dimensions. The accident detection model comprises an isolated forest model and a time series model. The isolated forest model identifies anomalous data within the target data, yielding first anomalous data. Operational data belonging to the same dimension as the first anomalous data is then extracted from the target data to obtain time series data containing the first anomalous data. The time series model then identifies anomalous data within the time series data, yielding second anomalous data. The time difference between the generation of the first and second anomalous data during the target vehicle's operation is determined, and the timing of this time difference is used to determine whether an accident has occurred. This technical solution utilizes an accident detection model derived from the fusion of the isolated forest model and the time series model to identify anomalous data from the vehicle's past operational data and to determine whether an accident has occurred based on this anomalous data. Because the accident detection model is obtained by fusing the isolated forest model and the time series model, it combines the advantages of both models, improving the accuracy and reliability of anomalous data identification. When abnormal data indicates a vehicle accident, users are promptly notified, preventing them from unknowingly using the vehicle and endangering their safety. The accident detection model and method provided in this application can be configured in the vehicle's after-sales service system. On one hand, it helps vehicle users promptly identify potential safety hazards, ensuring customer safety; on the other hand, it increases revenue for businesses, thereby increasing customer volume and preventing customer churn.
[0066] The following are Figure 1 The specific implementation methods of each step in the illustrated embodiment will be explained below:
[0067] In one possible implementation, each piece of runtime data in the target data carries the data's generation time. The above-mentioned method of obtaining runtime data belonging to the same dimension as the first abnormal data from the target data to obtain time-series data belonging to the same dimension as the first abnormal data and containing the first abnormal data includes the following schemes:
[0068] The generation time carried by the first abnormal data is used as the reference time;
[0069] The first detection data is obtained by extracting operational data from the target data that was generated before the reference time within a first preset time period and belongs to the same dimension as the first abnormal data within that time period.
[0070] The second detection data is obtained by extracting operational data from the target data that is generated within a second preset time period after the reference time and belongs to the same dimension as the first abnormal data within that time period.
[0071] The time series data is generated based on the first detection data, the first abnormal data, and the second detection data.
[0072] The duration of the first preset time period and the duration of the second preset time period can be the same or different. For example, if the generation time of the first abnormal data is 12:10:10 on October 1, 2021, and the duration of both the first and second preset time periods is 24 hours, then 12:10:10 on October 1, 2021 is used as the reference time. Operational data belonging to the same dimension as the first abnormal data, from 12:10:10 on September 30, 2021 to 12:10:10 on October 1, 2021, is obtained from the target data to obtain the first detection data. Operational data belonging to the same dimension as the first abnormal data, from 12:10:10 on October 1, 2021 to 12:10:10 on October 2, 2021, is also obtained from the target data to obtain the second detection data. Then, time series data is constructed using the first detection data, the first abnormal data, and the second detection data.
[0073] In one possible implementation, determining the time difference between the generation of the first abnormal data and the generation of the second abnormal data during the operation of the target vehicle includes the following schemes:
[0074] Determine the difference between the generation time of the first abnormal data and the generation time of the second abnormal data;
[0075] The difference is defined as the time difference.
[0076] After obtaining the first and second abnormal data, the difference between the generation time of the first abnormal data and the generation time of the second abnormal data is calculated, that is, the time interval between the generation of the first abnormal data and the generation of the second abnormal data. The calculated difference is determined as the time difference.
[0077] In one possible implementation, the method of determining whether the target vehicle has been involved in an accident based on the time difference includes the following schemes:
[0078] When the time difference is the specified difference value, determine whether the difference value is less than or equal to a preset difference value;
[0079] If so, determine that the target vehicle has been involved in an accident;
[0080] If not, it is determined that the target vehicle has not been involved in an accident.
[0081] After obtaining the difference, the relationship between the difference and a preset difference is determined. If the difference is less than or equal to the preset difference, it indicates that the time interval between the generation of the first and second abnormal data is short. If the difference is 0, it indicates that the first and second abnormal data are the same data, and the target vehicle is determined to have been involved in an accident. If the difference is greater than the preset difference, it indicates that the time interval between the generation of the first and second abnormal data is long, and the target vehicle is determined not to have been involved in an accident.
[0082] In one possible implementation, after determining whether the target vehicle has been involved in an accident based on the time difference, the accident detection method further includes:
[0083] If it is determined that the target vehicle has been involved in an accident, the driving record video collected from the time of generation of the first abnormal data to the time of generation of the second abnormal data is obtained.
[0084] The accident type is determined based on the first abnormal data, the second abnormal data, and the driving record video.
[0085] Output a prompt message regarding the type of accident.
[0086] In cases where an accident is determined to have occurred involving the target vehicle, for example, if the first abnormal data shows a generation time of 12:10:10 on October 1, 2021, and the second abnormal data shows a generation time of 12:10:10 on October 2, 2021, then the driving record video from 12:10:10 on October 1, 2021, to 12:10:10 on October 2, 2021, is retrieved. If both the first and second abnormal data points are abnormal fuel consumption data, it indicates that the vehicle's fuel consumption is higher than the maximum normal operating fuel consumption, leading to the determination that an accident has occurred. Furthermore, the retrieved driving record video is analyzed to understand the user's behavior during vehicle use. The cause of the tire problem, for example, is that the dashcam video captured the vehicle driving over an uneven road surface between 16:30:20 and 16:40:00 on October 1, 2021, accompanied by the sound of the vehicle's chassis scraping against the ground. Combined with the first and second abnormal data, which are both abnormal fuel consumption data, it can be determined that the vehicle's fuel tank is leaking. Therefore, the accident type of the vehicle is determined to be fuel tank damage. After determining the type of vehicle accident, an accident type prompt message is output to inform the user in a timely manner so that the user can repair the vehicle in time and avoid the user continuing to use the vehicle without knowing that an accident has occurred, thereby endangering personal safety.
[0087] In one possible implementation, the above-mentioned use of the isolated forest model to identify anomalous data in the target data to obtain the first anomalous data includes the following schemes:
[0088] Each running data point in the target data is input into the isolated forest model to obtain the path length of each running data point in the isolated forest model.
[0089] Based on the path length of each running data point in the isolated forest model, determine the anomaly score for each running data point in the target data;
[0090] Based on the anomaly score, the operational data that meets the anomaly conditions is determined from the target data to obtain the first anomaly data.
[0091] The Isolation Forest model consists of multiple isolated trees (also known as binary search trees). Each running data point in the target data traverses each isolated tree in the Isolation Forest model, resulting in a path length corresponding to each isolated tree for each running data point. Since there are multiple isolated trees, each running data point corresponds to multiple path lengths. The average of these multiple path lengths is calculated, and the average is used to calculate the anomaly score for each running data point. Then, based on the anomaly score of each running data point, running data points from the target data that meet the anomaly criteria are identified, resulting in the first anomaly data. The anomaly criteria include an anomaly score less than a preset score threshold.
[0092] In one possible implementation, the above-mentioned accident detection method also includes the following scheme:
[0093] Obtain the sample datasets corresponding to each of the multiple sample vehicles;
[0094] The isolated forest model is used to identify abnormal data in the sample dataset corresponding to the sample vehicle to obtain the first identification result. The first identification result includes the third abnormal data and the first data category of the third abnormal data, where the first data category is the abnormal category.
[0095] Obtain sample operation data belonging to the same dimension as the third abnormal data from the sample dataset corresponding to the sample vehicle, so as to obtain sample time series data that belongs to the same dimension as the third abnormal data and contains the third abnormal data;
[0096] The time series model is used to identify abnormal data in the sample time series data to obtain the second identification result. The second identification result includes a fourth abnormal data and a second data category of the fourth abnormal data, where the second data category is an abnormal category.
[0097] The accident detection model is trained based on the first difference information between the annotation information of the first data category and the third abnormal data, and based on the second difference information between the annotation information of the second data category and the fourth abnormal data.
[0098] Figure 3 The diagram illustrates the abnormal data identification process of the accident detection model, as shown below. Figure 3 As shown, the training process of the accident detection model is as follows:
[0099] The vehicle network data corresponding to multiple sample vehicles are preprocessed in advance to obtain preprocessed data corresponding to multiple sample vehicles. The sample vehicles are not the same as the target vehicles mentioned above. The vehicle network data corresponding to the sample vehicles include operating data such as vehicle speed, steering data, braking data, fuel consumption data, engine temperature data, and tire pressure data.
[0100] Preprocessing includes:
[0101] 1. Data cleaning: Cleaning data to remove noise, outliers, and duplicates. For example, there may be data errors, missing data, abnormal operations, etc., which need to be identified and handled.
[0102] 2. Handle missing values: Analyze the situation of missing values in the data. You can use interpolation methods, fill in the mean, or use data from other time points to fill in the missing values to ensure data continuity and accuracy.
[0103] 3. Data format conversion: Convert the raw data into a format suitable for analysis, ensure that the data timestamps are correct and arranged in chronological order; the data can be converted into data frames or other data structures suitable for analysis.
[0104] 4. Normalization and standardization: Normalize or standardize the features to ensure that the numerical range of different features is consistent, which helps the model converge and improve performance.
[0105] 5. Data visualization: Use data visualization tools to explore the distribution, trends, and relationships of data. Visualization helps to understand the characteristics of data and discover anomalies and patterns.
[0106] 6. Data validation and inspection to ensure that the preprocessed data is error-free, conforms to business logic, and can be used for model building and analysis.
[0107] After obtaining the preprocessed data for each of the multiple sample vehicles, the operational data within the preprocessed data for each sample vehicle is labeled. Operational data from the time of the accident or exhibiting abnormal operational behavior is labeled as an anomaly category, while operational data that is not an anomaly category is labeled as a normal category. The labeled preprocessed data for each sample vehicle is then divided according to the aforementioned multiple dimensions, resulting in a sample dataset for each sample vehicle. For each of the multiple sample vehicles, the sample dataset includes multi-dimensional sample operational data generated by the vehicle at different times. Each sample operational data has labeling information indicating whether the data category is normal or an anomaly.
[0108] For each sample vehicle, the sample dataset is divided into a training set, a validation set, and a test set. The training set is used for model training, the validation set is used to adjust model parameters, and the test set is used for model evaluation, thereby ensuring the temporal order of the data.
[0109] After the sample dataset is segmented, for each sample vehicle, the training set (first input) is input into the Isolation Forest model. The Isolation Forest model identifies the abnormal data in the training set and obtains the first identification result. The first identification result includes the third abnormal data and the first data category of the third abnormal data. The first data category is the abnormal category.
[0110] After obtaining the first identification result, sample running data belonging to the same dimension as the third abnormal data are obtained from the training set. Sample time series data are generated based on the third abnormal data and the sample running data belonging to the same dimension as the third abnormal data in the training set.
[0111] After obtaining the sample time series data, the sample time series data (second input) is input into the time series model. The time series model identifies the abnormal data in the sample time series data and obtains the second identification result. The second identification result includes the fourth abnormal data and the second data category of the fourth abnormal data. The second data category is the abnormal category.
[0112] After obtaining the second identification result, a first difference is calculated between the labeled information of the first data category and the third abnormal data using a loss function, and a second difference is calculated between the labeled information of the second data category and the fourth abnormal data. The first difference represents the first difference information, and the second difference represents the second difference information. It is determined whether the first difference is less than or equal to a first difference threshold and whether the second difference is less than or equal to a second difference threshold. If the first difference is greater than the first difference threshold and the second difference is greater than the second difference threshold, the accident detection model continues to be iteratively trained until the first difference is less than or equal to the first difference threshold and the second difference is less than or equal to the second difference threshold. At this point, the training of the accident detection model stops, and the accident detection model training is complete. After the accident detection model training is complete, the model parameters are adjusted using a validation set, and the accident detection model is evaluated using a test set. If the evaluation results meet expectations, the accident detection model is saved, thus completing the entire training process of the accident detection model, and the accident detection model can be put into practical application.
[0113] Since the accident detection model is a fusion of the Holt-Winters model and the Isolation Forest model, it combines the advantages of both models. Specifically, the advantages of the accident detection model include:
[0114] 1. Ability to comprehensively utilize time series and isolated information: The Holt-Winters model is suitable for capturing trends and seasonality in time series data, while the Isolation Forest model is suitable for detecting isolated anomalies in data; by combining these two models, the incident detection model can comprehensively utilize time series and isolated information to more comprehensively identify data anomalies.
[0115] 2. Ability to identify anomalous data from multiple perspectives: By using the Holt-Winters model and the Isolation Forest model to identify anomalous data from different perspectives, the Holt-Winters model focuses on the time trend and periodicity of the data, while the Isolation Forest model focuses on the relative isolation of the data. Combining these two models can capture anomalous data more accurately.
[0116] 3. Improved accuracy of anomaly detection: Holt-Winters and Isolation Forest models have good anomaly detection capabilities in different domains. Combining these two models can improve the accuracy and reliability of anomaly detection by comprehensively considering their outputs.
[0117] 4. Reduces the false positive rate of anomaly detection: Using either the Holt-Winters model or the Isolation Forest model alone may produce false positives. Combining the outputs of the two models can reduce the false positive rate of anomaly detection. In this application, the anomaly data output by the Holt-Winters model and the Isolation Forest model are all in the same dimension. The difference lies in the generation time of the anomaly data, which may differ, or the generation time of the anomaly data output by the Holt-Winters model and the Isolation Forest model may be the same.
[0118] 5. Adaptable to diverse data: The Holt-Winters model and the Isolation Forest model can be applied to different types of data, including time series data and multidimensional feature data. The fusion method can adapt to the diverse characteristics of vehicle data.
[0119] Accident detection models can be applied to identify abnormal data in vehicle operation data, thereby determining whether an accident has occurred based on the identified abnormal data. Accident prediction models combine the advantages of Holt-Winters and IsolationForest models, and using accident prediction models for anomaly identification can improve the accuracy and robustness of anomaly detection.
[0120] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.
[0121] Figure 4 A schematic diagram of the structure of an accident detection device provided in an embodiment of this application is shown. For example, as shown... Figure 4 As shown, the accident detection device 400 includes:
[0122] An anomaly identification module 410 is used to input target data generated during the operation of the target vehicle into a pre-trained accident detection model; wherein, the target data includes operational data of multiple dimensions, the accident detection model includes an isolated forest model and a time series model, the output layer of the isolated forest model is connected to the input layer of the time series model; the isolated forest model is used to identify abnormal data in the target data to obtain first abnormal data; operational data belonging to the same dimension as the first abnormal data is obtained from the target data to obtain time series data belonging to the same dimension as the first abnormal data and containing the first abnormal data; the time series model is used to identify abnormal data in the time series data to obtain second abnormal data;
[0123] The difference determination module 420 is used to determine the time difference between the generation of the first abnormal data and the generation of the second abnormal data during the operation of the target vehicle.
[0124] The accident determination module 430 is used to determine whether the target vehicle has been involved in an accident based on the time difference.
[0125] In one possible implementation, each piece of runtime data in the target data carries the data generation time, and the anomaly identification module 410 includes:
[0126] The first data selection unit is used to take the generation time carried by the first abnormal data as a reference time; and to obtain the first detection data from the target data, which is generated within a first preset time period before the reference time and belongs to the same dimension as the first abnormal data.
[0127] The second data selection unit is used to obtain the second detection data from the target data, which is generated within a second preset time period after the reference time and belongs to the same dimension as the first abnormal data.
[0128] A data construction unit is used to generate the time series data based on the first detection data, the first abnormal data, and the second detection data.
[0129] In one possible implementation, the difference determination module 420 is specifically used to: determine the difference between the generation time of the first abnormal data and the generation time of the second abnormal data; and determine the difference as the time difference.
[0130] In one possible implementation, the accident determination module 430 is specifically used to: determine whether the time difference is less than or equal to a preset difference when the time difference is the difference value; if yes, determine that the target vehicle has been involved in an accident; if no, determine that the target vehicle has not been involved in an accident.
[0131] In one possible implementation, the accident detection device 400 further includes:
[0132] The prompting unit is used to, when it is determined that the target vehicle has been involved in an accident, acquire the driving record video collected from the time of generation of the first abnormal data to the time of generation of the second abnormal data; determine the accident type based on the first abnormal data, the second abnormal data and the driving record video; and output prompt information about the accident type.
[0133] In one possible implementation, the anomaly detection module 410 further includes:
[0134] An abnormal data identification unit is used to input each running data in the target data into the isolated forest model to obtain the path length of each running data in the isolated forest model; determine the abnormal score of each running data in the target data based on the path length of each running data in the isolated forest model; and determine the running data that meets the abnormal conditions from the target data based on the abnormal score to obtain the first abnormal data.
[0135] In one possible implementation, the accident detection device 400 further includes:
[0136] A model training unit is used to acquire sample datasets corresponding to multiple sample vehicles. For each of the multiple sample vehicles, the sample dataset includes multi-dimensional sample operation data generated by the vehicle at different times. Each sample operation data has annotation information indicating whether the data category is normal or abnormal. The isolated forest model is used to identify abnormal data in the sample dataset corresponding to the sample vehicle, obtaining a first identification result. The first identification result includes third abnormal data and a first data category of the third abnormal data, where the first data category is the abnormal category. From the sample vehicles... Sample running data belonging to the same dimension as the third abnormal data are obtained from the corresponding sample dataset to obtain sample time series data that belongs to the same dimension as the third abnormal data and contains the third abnormal data; the time series model is used to identify the abnormal data in the sample time series data to obtain the second identification result, the second identification result including the fourth abnormal data and the second data category of the fourth abnormal data, the second data category being the abnormal category; the accident detection model is trained based on the first difference information between the first data category and the annotation information of the third abnormal data, and based on the second difference information between the second data category and the annotation information of the fourth abnormal data.
[0137] It should be noted that the accident detection device provided in the above embodiments is only illustrated by the division of the above functional modules when performing the accident detection method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the accident detection device and the accident detection method embodiments provided in the above embodiments belong to the same concept. Therefore, for details not disclosed in the device embodiments of this application, please refer to the embodiments of the accident detection method of this application, which will not be repeated here.
[0138] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0139] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown.
[0140] For example, such as Figure 5 As shown, the electronic device 500 includes a memory 501 and a processor 502. The memory 501 stores executable program code 5011, and the processor 502 is used to call and execute the executable program code 5011 to perform an accident detection method.
[0141] This embodiment can divide the electronic device into functional modules according to the above method example. For example, each module can correspond to a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0142] When each functional module is divided according to its corresponding function, the electronic device may include: an anomaly identification module, a difference determination module, an accident judgment module, etc. It should be noted that all relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0143] The electronic device provided in this embodiment is used to execute the above-described accident detection method, and therefore can achieve the same effect as the above-described implementation method.
[0144] When using integrated units, the electronic device may include a processing module and a storage module. The processing module is used to control and manage the operation of the electronic device. The storage module is used to support the execution of program code and data by the electronic device.
[0145] The processing module may be a processor or a controller, which can implement or execute various exemplary logic blocks, modules, and circuits as disclosed in this application. The processor may also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and microprocessors, etc., and the storage module may be a memory.
[0146] This embodiment also provides a computer-readable storage medium storing computer program code. When the computer program code is run on a computer, the computer executes the above-described related method steps to implement an accident detection method in the above embodiment.
[0147] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned related steps to implement an accident detection method as described in the above embodiment.
[0148] In addition, the electronic device provided in the embodiments of this application may specifically be a chip, component or module. The electronic device may include a connected processor and a memory. The memory is used to store instructions. When the electronic device is running, the processor may call and execute the instructions to make the chip execute an accident detection method in the above embodiments.
[0149] In this embodiment, the electronic device, computer-readable storage medium, computer program product or chip are all used to execute the corresponding accident detection method provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding accident detection method provided above, and will not be repeated here.
[0150] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0151] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0152] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An accident detection method, characterized in that, The accident detection method includes: The target data generated during the operation of the target vehicle is input into a pre-trained accident detection model; wherein, the target data includes operational data in multiple dimensions, and the accident detection model includes an isolated forest model and a time series model, wherein the output layer of the isolated forest model is connected to the input layer of the time series model; The isolated forest model is used to identify anomalous data in the target data to obtain the first anomalous data; From the target data, obtain the operational data that belongs to the same dimension as the first abnormal data, so as to obtain time series data that belongs to the same dimension as the first abnormal data and contains the first abnormal data; The time series model is used to identify abnormal data in the time series data to obtain second abnormal data; Determine the time difference between the generation of the first abnormal data and the generation of the second abnormal data during the operation of the target vehicle; The time difference is used to determine whether the target vehicle has been involved in an accident.
2. The accident detection method according to claim 1, characterized in that, Each piece of running data in the target data carries the time when the data was generated. The step of obtaining operational data belonging to the same dimension as the first abnormal data from the target data to obtain time series data belonging to the same dimension as the first abnormal data and containing the first abnormal data includes: The generation time carried by the first abnormal data is used as the reference time; The first detection data is obtained by extracting operational data from the target data that was generated before the reference time within a first preset time period and belongs to the same dimension as the first abnormal data within that time period. The second detection data is obtained by extracting operational data from the target data that is generated within a second preset time period after the reference time and belongs to the same dimension as the first abnormal data within that time period. The time series data is generated based on the first detection data, the first abnormal data, and the second detection data.
3. The accident detection method according to claim 2, characterized in that, The determination of the time difference between the generation of the first abnormal data and the generation of the second abnormal data during the operation of the target vehicle includes: Determine the difference between the generation time of the first abnormal data and the generation time of the second abnormal data; The difference is defined as the time difference.
4. The accident detection method according to claim 3, characterized in that, The step of determining whether the target vehicle has been involved in an accident based on the time difference includes: When the time difference is the specified difference value, determine whether the difference value is less than or equal to a preset difference value; If so, determine that the target vehicle has been involved in an accident; If not, it is determined that the target vehicle has not been involved in an accident.
5. The accident detection method according to claim 4, characterized in that, After determining whether the target vehicle has been involved in an accident based on the time difference, the accident detection method further includes: If it is determined that the target vehicle has been involved in an accident, the driving record video collected from the time of generation of the first abnormal data to the time of generation of the second abnormal data is obtained. The accident type is determined based on the first abnormal data, the second abnormal data, and the driving record video. Output a prompt message regarding the type of accident.
6. The accident detection method according to claim 1, characterized in that, The method of using the isolated forest model to identify abnormal data in the target data, and obtaining the first abnormal data, includes: Each running data point in the target data is input into the isolated forest model to obtain the path length of each running data point in the isolated forest model. Based on the path length of each running data point in the isolated forest model, determine the anomaly score for each running data point in the target data; Based on the anomaly score, the operational data that meets the anomaly conditions is determined from the target data to obtain the first anomaly data.
7. The accident detection method according to any one of claims 1 to 6, characterized in that, The accident detection method also includes: Obtain sample datasets corresponding to multiple sample vehicles; wherein, for each of the multiple sample vehicles, the sample dataset corresponding to the sample vehicle includes multi-dimensional sample operation data generated by the sample vehicle running at different times, and each sample operation data has annotation information, which is used to indicate whether the data category of the sample operation data is normal or abnormal. The isolated forest model is used to identify abnormal data in the sample dataset corresponding to the sample vehicles to obtain a first identification result. The first identification result includes a third abnormal data and a first data category of the third abnormal data, where the first data category is an abnormal category. Obtain sample operation data belonging to the same dimension as the third abnormal data from the sample dataset corresponding to the sample vehicle, so as to obtain sample time series data that belongs to the same dimension as the third abnormal data and contains the third abnormal data; The time series model is used to identify abnormal data in the sample time series data to obtain a second identification result. The second identification result includes a fourth abnormal data and a second data category of the fourth abnormal data, wherein the second data category is an abnormal category. The accident detection model is trained based on the first difference information between the first data category and the annotation information of the third abnormal data, and based on the second difference information between the second data category and the annotation information of the fourth abnormal data.
8. An accident detection device, characterized in that, The accident detection device includes: An anomaly detection module is used to input target data generated during the operation of a target vehicle into a pre-trained accident detection model. The target data includes operational data across multiple dimensions. The accident detection model includes an isolated forest model and a time series model, with the output layer of the isolated forest model connected to the input layer of the time series model. The isolated forest model is used to identify anomalous data in the target data to obtain first anomalous data. Operational data belonging to the same dimension as the first anomalous data is obtained from the target data to obtain time series data belonging to the same dimension as the first anomalous data and containing the first anomalous data. The time series model is used to identify anomalous data in the time series data to obtain second anomalous data. The difference determination module is used to determine the time difference between the generation of the first abnormal data and the generation of the second abnormal data during the operation of the target vehicle. The accident determination module is used to determine whether the target vehicle has been involved in an accident based on the time difference.
9. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable program code; A processor is configured to call and run the executable program code from the memory, causing the electronic device to perform the accident detection method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the accident detection method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Bullet train axle temperature fault early warning method based on machine learning and isolated forest
CN112287602A
Abnormal event determination method and device for automatic driving and electronic equipment
CN113177077A