A city road network traffic accident duration prediction method based on classification regression

CN122965753APending Publication Date: 2026-10-23BEIJING YUNXINGYU TRAFFIC SCI & TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611163976.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-03
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

一种基于分类回归的城市路网交通事故持续时间预测方法,以解决现有技术特征工程依赖人工经验,缺乏拟合效果的评价与优选,分类结果与回归结果之间缺少误差反馈校正关系,机器学习可解释性弱、易出现过拟合以及分类误差向回归预测阶段传递等技术问题或其组合

Benefits of technology

1. 现有交通事故持续时间预测方法中,常依赖人工经验对字段进行筛选、清洗和编码,不同类型字段处理方式不统一,容易造成特征处理不一致和模型输入偏差。本发明针对数值型、文本分类型和布尔型字段分别进行标准化预处理,并结合皮尔逊相关系数矩阵和斯皮尔曼相关系数矩阵对特征相关性进行分析,同时利用核密度估计方法识别数据分布特征。由此能够同时考虑线性相关关系、单调相关关系及数据分布差异,提高特征筛选和特征分析的稳定性,降低人工处理带来的主观性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122965753A_ABST
    Figure CN122965753A_ABST
Patent Text Reader

Abstract

The application discloses a city road network traffic accident duration prediction method based on classification regression, and belongs to the technical field of data processing. The technical scheme is as follows: quality evaluation, cleaning and feature engineering processing are performed on city road traffic accident data, static information such as road conditions, weather and temperature and accident duration characteristics are extracted; a short-time and long-time classification model is constructed and the classification effect is evaluated; a short-time regression model and a long-time regression model are respectively established, and a fusion prediction value is formed based on the classification probability; an error feedback correction module is set, and the error is detected according to the classification probability, the grouped regression result and the prediction residual error; the classification, regression and correction processes are cooperatively optimized through a joint loss function, the error transmission caused by classification errors is reduced, and the effectiveness of the fusion prediction model is verified. The technical problems of lacking evaluation and optimization of fitting effect, weak machine learning interpretability, easy overfitting and classification error transmission to the regression prediction stage are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data processing technology, and in particular relates to a method for predicting the duration of traffic accidents in urban road networks based on classification regression. Background Technology

[0002] Against the backdrop of accelerating urbanization in China, traffic congestion has evolved into an increasingly severe urban governance problem, with its negative effects on the economy, society, and environment becoming increasingly prominent. Traffic congestion can be broadly categorized into two types: recurring congestion and non-recurring congestion. The former stems from roads operating at sustained saturation, exhibiting significant periodicity and regularity; the latter is caused by unforeseen events, road maintenance, or infrastructure construction, leading to temporary and sudden drops in normal road capacity. Due to the highly random nature of delays in non-recurring congestion, accurate prediction has always been a challenge in the transportation sector. Therefore, in-depth research on the duration of traffic accidents is of crucial practical significance for traffic management departments to efficiently handle traffic incidents, improve road traffic safety, reduce various losses caused by congestion, and ensure the safety and travel experience of travelers.

[0003] Currently, in the field of urban road network traffic accident research, the analysis and prediction of accident datasets has become a core focus for many scholars. Research methods regarding the duration of traffic accidents can be mainly categorized into three types: The first category is traditional statistical methods, which include probability distribution models, regression analysis, time series analysis, etc. These methods rely on rigorous mathematical assumptions and fixed function forms to build prediction models, but due to the difficulty in accurately capturing the complex nonlinear characteristics of the traffic system, they often have the limitation of low prediction accuracy. The second category is machine learning methods, including mainstream algorithms such as neural networks, gradient boosting decision trees, support vector machines, and random forests. Compared with statistical methods, these methods have significantly improved prediction accuracy, but they generally suffer from problems such as weak model interpretability and overfitting, which limit their application value in actual traffic management decisions. The third category is hybrid methods that combine statistics and machine learning. These methods typically begin with a preliminary analysis of data features, but most existing research has failed to delve into the differentiated impact mechanisms of various environmental factors (such as weather, time of day, and road type) on accident duration. Furthermore, the model building process often lacks fine-tuning of parameters and systematic performance evaluation, resulting in final models that fall short of ideal levels in terms of predictive accuracy and interpretability.

[0004] Chinese invention CN116227730A discloses a hybrid method that integrates statistics and machine learning to address the duration of traffic accidents based on a two-layer architecture model, comprising the following steps: Step 1: Obtain the relevant variables of the traffic accident data to be predicted, and preprocess the relevant variables of the traffic accident data to be predicted; Step 2: Construct a two-layer architecture model. The first layer consists of three different types of machine learning algorithms in parallel, and the second layer uses a logistic regression model. Step 3: Use N-fold cross-validation to feed the preprocessed data from Step 1 into the two-layer architecture model from Step 2 to obtain the classification level.

[0005] The existing technology has at least the following shortcomings: 1. Feature engineering relies on human experience: The model's encoding and processing of input variables is highly dependent on manual feature selection and preprocessing, lacking automated feature extraction capabilities, which may miss key latent features and affect the model's upper limit; 2. Lack of evaluation and optimization of fitting effect: In the entire process of machine learning and statistical modeling, the evaluation and optimization of the fitting effect of a single model is the core link that determines the generalization ability and business value of the model. Existing technology only integrates three different types of machine learning algorithms in parallel, without evaluating and optimizing their fitting effect.

[0006] 3. Lack of classification error feedback correction mechanism: Existing methods typically classify the duration of traffic accidents into different levels or categories and make predictions based on the classification results. However, there is a lack of error feedback between the classification stage and the subsequent prediction stage. When the classification model misclassifies accidents of short duration, long duration, or different levels, the erroneous results can easily propagate to the subsequent prediction process, causing the accumulation of prediction errors and making it difficult to achieve collaborative optimization between the classification model and the regression model. Summary of the Invention

[0007] The purpose of this invention is to provide: A method for predicting the duration of traffic accidents in urban road networks based on classification and regression is proposed to address the technical problems, or combinations thereof, in existing technologies, such as reliance on human experience in feature engineering, lack of evaluation and optimization of fitting effects, lack of error feedback correction relationship between classification and regression results, weak interpretability of machine learning, susceptibility to overfitting, and propagation of classification errors to the regression prediction stage.

[0008] Terminology Explanation: Unless otherwise defined, all technical terms herein have the same meaning as commonly understood by one of ordinary skill in the art to which the subject matter of the claims pertains.

[0009] It should be understood that the above brief description and the following detailed description are exemplary and for illustrative purposes only, and do not limit the subject matter of the invention in any way. In this invention, the singular is used in conjunction with the plural unless otherwise specifically stated. It should also be noted that, unless otherwise stated, the use of “or” or “or” means “and / or”. Furthermore, the use of the term “comprising” and other forms such as “including,” “containing,” and “contains” are not limiting.

[0010] Unless otherwise stated, existing or conventional methods within the scope of the art shall be used.

[0011] The term "One-Hot encoding" used in this article is a feature encoding technique that converts categorical variables into binary vectors. It is widely used in machine learning and natural language processing to solve the problem that algorithms cannot directly process discrete text features.

[0012] The term "binary field processing" used in this article often refers to the process of converting categorical variables into binary matrices in data analysis and machine learning preprocessing.

[0013] The term "categorical feature processing" used in this paper refers to converting non-numerical category fields such as weather, road type, and accident type into numerical features that the model can recognize through methods such as ordered target statistical coding. This enables the classification augmentation gradient boosting tree model to directly utilize category information to participate in the training of weak learners and reduces the risks of manual coding and data leakage.

[0014] The term "Random Forest" used in this article refers to the Random Forest model, a classic guided aggregation algorithm model with a decision tree model as the weak learner. The Random Forest model randomly samples from the original dataset to form different sample datasets, builds multiple different decision tree models based on these datasets, and finally obtains the final result based on the average of these decision tree models (for regression models) or the voting results (for classification models).

[0015] The term "gradient boosting decision tree" used in this article refers to an ensemble learning algorithm that combines multiple weak learners to improve the predictive performance of a model. For both regression and classification problems, the weak learners in gradient boosting decision trees are CART decision trees. The basic idea is to construct a sequence of decision trees, with each tree learning the prediction residuals (i.e., the gradient of the prediction error) of the preceding trees, thereby gradually approaching the target value.

[0016] The term "Extreme Gradient Boosting" (XGBoost) used in this article refers to an improved gradient boosting algorithm that is efficient, flexible, and scalable, renowned for its outstanding performance in competitions and its efficiency in practical applications. XGBoost can handle tasks such as regression, classification, and ranking. Its core idea is similar to traditional gradient boosting, but it has made significant optimizations in terms of efficiency and performance.

[0017] The term "Categorical Boosting" (CatBoost) used in this article refers to a high-performance gradient boosting decision tree (GBDT) algorithm that effectively handles categorical features while reducing some common problems in gradient boosting algorithms, such as overfitting and gradient bias. Its most significant advantage is that it can directly process categorical data as input without requiring manual preprocessing of categorical features (such as One-Hot encoding). Like other gradient boosting decision tree algorithms, CatBoost aims to optimize the objective function using a weighted combination of multiple weak learners.

[0018] The term "CNN," used in this article, stands for Convolutional Neural Network. It is a deep learning model specifically designed for processing data with a grid structure. It extracts local features through convolutional layer operations, has fewer parameters and stronger feature extraction capabilities, and is a core model in tasks such as image recognition and time series prediction. The core idea of ​​CNN is to use convolutional operations to extract local features from data and gradually abstract higher-order features by stacking multiple convolutional layers and pooling layers.

[0019] The term "LSTM" used in this paper refers to a variant of recurrent neural networks specifically designed for processing time series data. LSTM overcomes the vanishing and exploding gradient problems when processing long sequences by introducing memory units and gating mechanisms, thereby capturing long-term dependencies in sequence data. LSTM dynamically adjusts the flow of information through three gating mechanisms, selectively remembering and forgetting information.

[0020] The term "LightGBM" used in this article refers to a high-efficiency machine learning algorithm based on gradient boosting decision trees (GBDT), developed by Microsoft Research. It is designed to handle large-scale data and performs well in terms of training speed, memory consumption, and model accuracy.

[0021] The term "joint loss function" used in this paper refers to a loss function that incorporates classification loss, grouping regression loss, probability fusion prediction loss, error correction loss, and classification-regression consistency constraint loss into the same optimization objective, so as to enable the classification model, regression model, and error feedback correction module to be optimized collaboratively under a unified objective.

[0022] The term "error feedback correction module" used in this article refers to a functional module that calculates the prediction residual or consistency bias based on the output probability of the classification model, the short-term regression prediction value, the long-term regression prediction value, and the initial fusion prediction value, and corrects the final accident duration prediction result accordingly.

[0023] The term "BCE" used in this article is short for Binary Cross Entropy in the field of deep learning. Essentially, it is a loss function specifically used for binary classification tasks, and its core function is to measure the difference between the model's predicted probability and the true label.

[0024] In a first aspect, the present invention provides: A method for predicting the duration of traffic accidents in urban road networks based on classification regression includes the following steps: Step S1: Perform feature engineering on the urban road network traffic accident dataset to generate standardized feature vectors; the feature engineering process includes data quality assessment and data preprocessing. Step S2: Using the standardized feature vector obtained in step S1, different interpretable machine learning methods are used to analyze the impact of static information on the duration of the accident, outputting short-term features, long-term features and accident classification probabilities, and evaluating the classification performance of the different machine learning models. Step S3: Based on the short-term and long-term features obtained in step S2, regression analysis of traffic accident duration is carried out using different interpretable machine learning methods. The predicted duration values ​​of short-term and long-term accidents are output respectively, and the classification effect of different machine learning models is evaluated. Step S4: Set up the error feedback correction module. Based on the accident classification probability obtained in step S2 and the duration prediction value obtained in step S3, form an initial fusion prediction value. Construct a joint loss function including the classification model, regression model and error feedback correction module to perform collaborative optimization and correction on the final prediction value. Step S5: Based on machine learning pipeline technology, the functions of data feature engineering processing, the optimal classification model of step S2, the optimal regression model of step S3, and the error feedback correction module of step S4 are encapsulated to verify the effectiveness of the classification-regression fusion prediction model.

[0025] Based on further solutions to the technical problems of the present invention, or simultaneous solutions to multiple technical problems, the preferred solution in the technical solution provided in the first aspect of the present invention includes: The first preferred option is that the machine learning method in step S2 includes decision tree-based models and / or deep learning models, wherein the decision tree-based models include random forest models, extreme gradient boosting tree models, and classification-enhanced gradient boosting tree models.

[0026] The second preferred option is to set up an error feedback correction module in step S4. The classification model outputs the probability that a sample belongs to a long-term accident, and the short-term regression model and the long-term regression model output the predicted value of the corresponding accident duration, respectively. The classification probability is used to weight the two regression prediction values ​​to obtain the initial fused prediction value.

[0027] Preferably, the actual duration of the accident is set to... The threshold for dividing short-term and long-term time is: Then category label satisfy:

[0028] when hour, ;when hour, The classification model outputs long-term probabilities.

[0029] Short-time regression model output Long-term regression model output .

[0030] Preferably, the initial fusion prediction value is The error feedback correction module outputs the residual correction amount. The final predicted value is .

[0031] Preferably, the joint loss function is:

[0032] in, Indicates classification loss; This represents the grouped regression loss; This represents the probability fusion prediction loss; This represents the prediction loss after error feedback correction;

[0033] This represents the consistency constraint between classification probability and final prediction duration. α is the smoothing coefficient. α, β, γ, δ, and η are the corresponding weighting coefficients.

[0034] The third preferred option: The data preprocessing in step S1 includes standardization processing, which includes normalization processing for numerical data, effective encoding processing for text categorized data, binary field processing for Boolean data, and data linear correlation analysis.

[0035] Preferably, the linear correlation analysis of the data includes calculating the linear correlation between the static information using the Pearson correlation coefficient and converting the original data into a ranking using the Spearman rank correlation coefficient; comparing the results of the two correlation coefficient calculations verifies the effective correlation of the features in the processed dataset.

[0036] Preferably, the data preprocessing further includes feature data distribution, which includes analyzing the distribution of feature data using a kernel density estimation method.

[0037] The fourth preferred option: The classification performance evaluation method in step S2 is to use the confusion matrix method to compare the predicted labels of the classification model with the true labels, and use relative indicators to judge whether the prediction results are accurate.

[0038] Preferably, the relative metrics include accuracy, precision, recall, and... F 1 value, where The value is the harmonic mean of precision and recall.

[0039] The fifth preferred option: The regression performance evaluation method in step S3 is root mean square error and mean absolute error.

[0040] In this invention, Embodiment 1 at least supports the protection scope of the method for predicting the duration of traffic accidents in urban road networks using a classification-regression architecture model.

[0041] The present invention has at least the following beneficial effects: 1. Existing methods for predicting the duration of traffic accidents often rely on manual experience to screen, clean, and encode fields. Inconsistent processing methods for different field types can easily lead to inconsistencies in feature processing and model input bias. This invention performs standardized preprocessing on numerical, text-based, and Boolean fields separately, and analyzes feature correlation using Pearson and Spearman correlation coefficient matrices. Simultaneously, it utilizes kernel density estimation to identify data distribution characteristics. This allows for the simultaneous consideration of linear correlation, monotonic correlation, and data distribution differences, improving the stability of feature selection and analysis, and reducing the subjectivity introduced by manual processing.

[0042] 2. In existing technologies, some methods directly perform overall regression prediction of accident duration without fully considering the differences in influencing factors and data distribution between long-duration and short-duration accidents, which can easily reduce prediction stability. This invention first divides traffic accident duration into two categories: long-duration and short-duration. It then comprehensively incorporates weather factors, road characteristics, and other tabular features at the time of the accident to construct a machine learning-based classification model. By comparing models such as random forest, extreme gradient boosting tree, and classification-enhanced gradient boosting tree, and evaluating the classification performance using accuracy, precision, recall, F1 score, and confusion matrix, a model suitable for accident duration classification can be selected, thereby improving the accuracy of identifying both long-duration and short-duration accidents.

[0043] 3. Existing methods typically employ a single regression model to uniformly predict all accident samples, making it difficult to simultaneously adapt to the different variation patterns of short-duration and long-duration accidents. This invention, after classifying accidents into short-duration and long-duration categories, performs regression predictions separately for each category and compares methods such as convolutional neural networks, lightweight gradient boosters, and long short-term memory networks. The prediction error is evaluated using root mean square error and mean absolute error. This approach can select a more suitable regression model based on different duration categories, reducing the error accumulation caused by uniform modeling and improving the applicability and stability of accident duration prediction results.

[0044] 4. In existing traffic accident duration prediction processes, data preprocessing, feature engineering, classification modeling, and regression modeling are often performed separately, which can easily lead to problems such as inconsistencies between training and test set processing, redundant parameter tuning, and data leakage. This invention establishes an integrated classification-regression model for traffic accident duration prediction, encapsulating data preprocessing, feature engineering, random forest classifiers, and LightGBM regressors, thus automating the data processing, model training, and prediction processes. This reduces manual steps, improves the consistency and repeatability of the model's operation, and reduces the risk of data leakage due to improper human handling.

[0045] 5. In existing classification-regression prediction processes, the output of the classification model is typically used directly as the input to the regression stage. When short-term and long-term misclassifications occur in the first stage, the incorrect classification results are further propagated to the subsequent regression model, leading to the accumulation of duration prediction errors. This invention introduces an error feedback correction mechanism between the classification and regression models, and simultaneously constrains the classification results, grouped regression results, fused prediction results, and error correction results through a joint loss function, enabling the classification and regression models to form a synergistic optimization relationship. Therefore, even if local misclassifications occur in the classification stage, subsequent regression errors can be corrected to the final predicted value through consistency constraints and residual correction, thereby reducing the error propagation caused by classification errors and improving the stability and accuracy of traffic accident duration prediction. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is a flowchart of the method for predicting the duration of traffic accidents in urban road networks with an error feedback correction mechanism according to an embodiment of the present invention; Figure 2 This is a box plot of the incident duration after filtering outliers according to an embodiment of the present invention; Figure 3 This is a Pearson correlation matrix diagram of eigenvalues ​​according to an embodiment of the present invention; Figure 4 This is a Spearman correlation matrix diagram of eigenvalues ​​according to an embodiment of the present invention; Figure 5 This is a kernel density count distribution map of 24-hour precipitation data in an embodiment of the present invention; Figure 6 This is a density counting graph of air pressure data according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the random forest model according to an embodiment of the present invention; Figure 8 This is a histogram showing the distribution of the training and test sets in an embodiment of the present invention; Figure 9 This is a diagram showing the confusion matrix result of a random forest in an embodiment of the present invention; Figure 10 This is a diagram showing the XGBoost confusion matrix results of an embodiment of the present invention; Figure 11 This is a diagram showing the CatBoost confusion matrix results of an embodiment of the present invention; Figure 12This is a schematic diagram of a convolutional neural network according to an embodiment of the present invention; Figure 13 This is a structural diagram of the LSTM model according to an embodiment of the present invention; Figure 14 This is a graph showing the prediction results of the LightGBM model based on the first 100 long-term traffic accident records in this embodiment of the invention. Figure 15 This is a graph showing the prediction results of the LightGBM model for the first 100 short-term traffic accident records in an embodiment of the present invention; Figure 16 This is a schematic diagram of the classification-regression fusion prediction framework for error feedback correction and joint optimization in an embodiment of the present invention; Figure 17 This is a schematic diagram of the basic framework of the machine learning pipeline with error feedback correction mechanism according to an embodiment of the present invention. Detailed Implementation

[0048] The following non-limiting embodiments are intended to enable those skilled in the art to gain a more comprehensive understanding of the present invention, but do not limit the invention in any way. The following content is merely an exemplary description of the scope of protection claimed by the present invention, and those skilled in the art can make various changes and modifications to the present invention based on the disclosed content, and such changes should also fall within the scope of protection claimed by the present invention.

[0049] Example 1 like Figure 1 As shown, the urban road network traffic accident dataset used in this invention originates from the US-Accidents (A Countrywide Traffic Accident Dataset) traffic accident dataset. The data is collected in real-time by the US government and state transportation departments, law enforcement agencies, roadside electronic cameras, and traffic sensors within the road network. The data covers 49 states in the US, with recording periods from February 2016 to March 2023. It currently contains seven million traffic accident records, making it one of the largest and most comprehensive publicly available accident datasets, encompassing different climates, geographical locations, and urban traffic conditions.

[0050] The US-Accidents traffic accident dataset provides detailed information about traffic accidents, including vehicle number, data acquisition method, detailed start and end times, affected road length, start and end latitude and longitude coordinates, geographical location, weather temperature, and atmospheric pressure. Table 1 shows the description of the US-Accidents data.

[0051] Table 1. US-Accidents Data Description Table (Partial)

[0052] (a) Data Feature Engineering Feature engineering is the process of transforming raw data into more meaningful features that can be effectively utilized by the model. Its core goal is to improve the performance and generalization ability of machine learning models.

[0053] 1. Data quality assessment By thoroughly evaluating the completeness, accuracy, consistency, and usability of data, we can effectively identify potential errors, missing values, or anomalies in the data, thereby ensuring that the analysis and conclusions based on high-quality data are scientific and credible.

[0054] Based on the statistical description results of the urban road traffic accident dataset, the following data quality assessment was conducted: (1) Assessment of missing values: Some fields may be missing due to incomplete meteorological equipment in certain areas or failure to record weather conditions during an accident, such as the Precipitation and Wind_Chill fields. The End Longitude and End Latitude fields may be missing due to the location equipment not being installed or the equipment being used incorrectly during an accident.

[0055] (2) Limitations assessment: The accuracy of accident recording time may be subject to errors due to different data collection methods in different states, cities, streets and counties. For example, the start time and end time of the recording depend on manual reporting and automatic detection recording systems, and the recorded content has certain delays and errors.

[0056] (3) Bias assessment: Most traffic accident records in the dataset are in urban areas, while accidents in rural areas are not fully recorded for various reasons. The geographical distribution bias may affect the establishment of the prediction model and cause overfitting to urban data. The severity index is subjective because different recorders may have different definitions of severity. In real life, it is impossible to obtain an accurate description of the severity of a traffic accident in the first instance.

[0057] 2. Data Preprocessing Data preprocessing is one of the core steps in data analysis and the establishment of classification and inductive models. Effective and reasonable preprocessing of data can facilitate the finding of relationships between features, enhance the predictive performance of the model, and make the prediction results closer to the needs of the real situation.

[0058] (1) Handling missing values First, check the missing values ​​in each column of the dataset. For numerical fields such as road length affected by the accident, temperature, wind chill index, humidity, air pressure, visibility, wind speed, etc., fill the missing values ​​with the average value of the data. For textual fields such as weather conditions, wind direction, etc., fill them with the category mode or create a new specific description. For Boolean records such as whether there are traffic facilities, whether there is a collision, whether there is an intersection, etc., fill the missing values ​​with the modal values ​​of the features and then convert them into binary variables. For the missing accident start time and accident end time, the processing method is to remove the row where the missing time field is located to avoid errors in the subsequent calculation of the duration. Equation (1) is the difference between the start time and end time of the accident record, that is, the accident duration.

[0059] (1) In the formula This represents the time difference, calculated in minutes. The end time of the dataset records; The start time recorded for the dataset.

[0060] (2) Outlier handling First, by calculating the mean, standard deviation, maximum, and minimum values ​​of the original traffic accident duration data, it was found that the data had a large standard deviation, indicating a high degree of dispersion of data points relative to the mean, and a large difference between the maximum and the mean, suggesting significant differences in accident durations. The data at both ends of the duration distribution spectrum were removed, retaining the middle 90% of the spectrum, and the numerical characteristics of the duration were recalculated. Table 2 shows a comparison of the traffic accident data before and after processing. Figure 2 The yellow line represents the median duration of the incident after removing outliers. The green triangles indicate that the average duration of the incident after removing outliers is between 100 and 150 minutes. The first quartile is 81.2 minutes, the third quartile is 202.5 minutes, and the time distribution after removing outliers ranges from 20 minutes to 360 minutes.

[0061] Table 2 Comparison of Traffic Accident Data Before and After Processing

[0062] (3) Data standardization To prevent differences in feature value magnitudes from negatively impacting the gradient boosting model and neural network construction weight analysis, numerical, text classification, and Boolean fields are standardized to ensure that features have the same magnitude during model training, leading to more accurate model fitting. The specific steps are as follows: 1) Data normalization: Due to the large range of differences in traffic accident datasets and the significant differences in the dimensions of feature values, the minimum-maximum normalization method is used to map the numerical data to a unified range, as shown in equation (2): (2) In the formula For normalized values, the data range will be scaled to... Between sizes, The minimum value in the data column. This represents the maximum value in the data column.

[0063] 2) Effective Encoding (One-Hot Encoding): Machine learning algorithms cannot directly process categorical data and must convert it into numerical form. One-Hot encoding converts categorical variables into binary vectors, where each category corresponds to a binary vector, with only the corresponding category position set to 1 and the rest to 0. For categorical text such as Weather_Condition, One-Hot encoding is used to convert it into a one-hot vector.

[0064] 3) Binary field processing: For Boolean fields (such as Amenity, Bump, etc.), map "TRUE" values ​​to 1 and "FALSE" values ​​to 0; for binary fields (such as Sunrise_Sunset, Civil_Twilight, etc.), map "Day" to 1 and "Night" to 0. Table 3 shows an example of effective coding of factors affecting the duration of traffic accidents.

[0065] Table 3. Valid codes for factors affecting the duration of traffic accidents (partial list)

[0066] 4) Data linear correlation analysis: ① The linear correlation between features is calculated using the Pearson correlation coefficient. The calculation method is shown in equation (3), which can be simplified to equation (4).

[0067] In formula (4) The sample mean representing variable X. The sample mean of Y is represented by Y. This represents the covariance between variables X and Y. and Let X and Y be the standard deviations of variables X and Y, respectively. .in The degree of freedom is equal to the number of sample pairs between the two variables minus 1.

[0068] (3) (4) ② Use Spearman Rank Correlation to convert the original data into rankings: Rank each variable according to its value, with smaller values ​​ranked higher; if two variables have the same value, average the rankings of the equal variables. Calculate the ranking difference: For each pair of data... The ranking difference is calculated as shown in equation (5): (5) In formula (5) For variables and variables The difference in rankings, For variables The corresponding ranking, For variables The corresponding ranking, , For variables and variables The number of pairs.

[0069] Calculate the rank correlation coefficient: The rank correlation coefficient is calculated as shown in equation (6): (6) In formula (6) It is the sum of squared differences in the rankings of the data pairs; It is a standardization factor that limits the value of the correlation coefficient to a certain range. ; Indicates a perfect positive correlation. Indicates a completely negative correlation. This indicates that there is no correlation.

[0070] Figure 3 This is a Pearson correlation matrix plot of eigenvalues. Figure 4 This is a Spearman correlation matrix of eigenvalues. Comparing the results of the two correlation coefficient calculations shows that precipitation, air pressure, and the presence of traffic merging points around the accident site are positively correlated with the duration of the traffic accident, while weather conditions and the presence or absence of traffic lights are negatively correlated. The feature correlation analysis results are consistent with the influence of these variables on the duration of actual traffic accidents, indicating that there is a valid correlation between the features in the processed dataset.

[0071] (4) Distribution of characteristic data Kernel density estimation is a non-parametric probability density function estimation method that estimates the distribution of sample data by smoothing data points into a continuous probability density curve. Unlike histograms, kernel density estimation does not rely on a fixed interval width but smooths the data using a kernel function. A kernel function is a symmetric, smooth function that has a maximum value at the center and gradually decreases towards both sides; the value of the kernel function is not less than 0 and the total integral is 1. The Gaussian kernel is usually used as the kernel function. The mathematical expression of the Gaussian kernel is shown in equation (7): (7) Given dataset variables The formula for estimating nuclear density is shown in equation (8): (8) in For kernel function, For in position The estimated probability density on This is the smoothness parameter, also known as bandwidth. For each sample point in the dataset, the kernel density count distribution of the 24-hour precipitation data is as follows: Figure 5 As shown, The axis represents the amount of precipitation. The axes plot the density calculated by the kernel function. The 24-hour precipitation data recorded in the traffic accident data shows a high density distribution between 0.1 and 9.9 mm, corresponding to light rain, with a small amount of moderate and heavy rain also recorded. The kernel density count distribution of the air pressure data is as follows: Figure 6 As shown, 30 inches of mercury, after unit conversion, is 101.59 kPa, equivalent to one standard atmosphere. It can be seen that the atmospheric pressure density distribution in the accident data records ranges from 29 to 31 inches of mercury, slightly lower than standard atmosphere, while some atmospheric pressure records are around 26 inches of mercury, which is considered low pressure.

[0072] (II) Traffic Accident Duration Classification Model This study analyzes the impact of static information such as road conditions, weather conditions, and temperature on accident duration. It categorizes the duration of accidents recorded in the traffic accident dataset to reflect the degree of disruption to the urban traffic system. Based on the preprocessed dataset, interpretable machine learning methods are used to classify traffic accident durations, selecting models with high accuracy, minimal variation across multiple tests, and appropriate recall and precision.

[0073] 1. Selection of classification model Decision tree-based models are better suited for predicting tabular data than deep learning models, and offer stronger interpretability. This invention uses Random Forest (RF) as... Figure 7 The model is shown to perform data classification using Extreme Gradient Boosting (XGBoost) and Categorical Boosting (CatBoost) models.

[0074] Random forest is a classic guided aggregation algorithm model, using decision tree models as weak learners. The random forest model randomly samples from the original dataset to form... Based on these different sample datasets, construct... The final result is obtained by considering the average of these decision tree models (for regression models) or the voting results (for classification models).

[0075] Gradient boosting decision trees are an ensemble learning algorithm that combines multiple weak learners to improve the predictive performance of a model. For both regression and classification problems, the weak learners in gradient boosting decision trees are CART decision trees. The basic idea is to construct a sequence of decision trees, with each tree learning the prediction residuals (i.e., the gradient of the prediction error) of the preceding trees, thereby gradually approaching the target value.

[0076] Extreme Gradient Boosting Trees (XGBoost) is an improved gradient boosting algorithm that is efficient, flexible, and scalable, renowned for its outstanding performance in competitions and its efficiency in practical applications. XGBoost can handle tasks such as regression, classification, and ranking. Its core idea is similar to traditional gradient boosting, but it has made significant optimizations in efficiency and performance.

[0077] CatBoost is a gradient boosting decision tree framework that effectively handles categorical features while reducing some common problems in gradient boosting algorithms, such as overfitting and gradient bias. Its biggest advantage is that it can directly process categorical data as input without requiring manual preprocessing of categorical features (such as One-Hot encoding). Like other gradient boosting decision tree algorithms, CatBoost aims to optimize the objective function using a weighted combination of multiple weak learners, as shown in equation (9). (9) in This is the final model prediction value. This represents the total number of weak learners. For the first The prediction function of a weak learner The input sample is the feature vector.

[0078] The objective function is shown in equation (10): (10) in The overall loss that needs to be minimized during model training. The number of traffic accident samples. For sample number, Used to measure the true value Compared with the predicted value The error, This represents the total number of learners or decision trees in the model. The identifier for the learner or decision tree. For the first The regularization term for the learner.

[0079] Categorical feature processing methods: These methods encode categorical features using ordered encoding, leveraging information from the target variable to avoid common data overflow problems. For categorical feature values... and target variable The formula for sequence encoding is shown in (11): (11) in For sample number, For representing the index of historical samples, Indicates the first The target variable values ​​for each sample This represents the value of a sample in a certain category variable. It is an indicator function; the denominator should avoid using the current sample. The target value, Indicates the first The target variable values ​​for each sample.

[0080] 2. Division of training and testing data After preprocessing, the dataset in the example contains 113,194 accident data points. In the processed dataset, 80% was selected as the training set and 20% as the test set using a random sampling method.

[0081] After randomly sampling the original data using a computer, histograms of the distributions of the training and test sets are plotted as follows: Figure 8 As shown, it can be observed that the frequency distribution of the histograms of the training set and the test set is similar in each duration interval. The peak positions and distribution ranges of the two sets are very close. The duration of traffic accidents with short durations are concentrated between 25 minutes and 150 minutes, while the duration of accidents with long durations are concentrated between 150 minutes and 360 minutes.

[0082] By calculating the relevant indicators of the test set and the training set, Table 4 is a descriptive statistical table used to calibrate and verify the duration of the accident. Table 4 shows that the maximum, minimum and 25th percentile of the duration of the training set and the test set are consistent, and the mean, 50th percentile and 75th percentile values ​​are close, which effectively ensures that the trained model has a stronger generalization ability and improves the upper limit of the model's prediction effect.

[0083] Table 4. Descriptive statistics used for calibrating and verifying accident duration.

[0084] 3. Classification Task Evaluation Methods A confusion matrix is ​​a table that summarizes the performance of a classification model. It is applicable to both binary and multi-class classification. It determines the accuracy of the prediction results by comparing the predicted labels of the classification model with the true labels.

[0085] (1) Display the number of predicted labels that correctly predict the actual labels: True positive displays the number of correctly identified positive labels, that is, the number of labels that are actually positive and the model correctly predicts as positive; True negative displays the number of correctly identified negative labels, that is, the number of labels that are actually negative and the model correctly predicts as negative.

[0086] (2) Show the number of predicted labels that are incorrectly predicted to be true labels: false positives are the number of times the model predicts a positive label when the actual label is negative, while false negatives are the number of times the model predicts a negative label when the actual label is positive.

[0087] A confusion matrix displays the absolute number of correct and incorrect predictions from a model, providing a visual understanding of the scale between the predictions and the actual situation. However, using absolute numbers is not always feasible; to compare models or track their performance over time, the following relative metrics are needed: Accuracy is the proportion of correctly classified objects out of the total number of objects, and is calculated as shown in equation (12): (12) in It is a true positive. It is a true negative; It was a false positive. It is a false negative.

[0088] Precision is the proportion of correctly predicted positive labels among all predicted positive labels, and is calculated as shown in equation (13): (13) Recall represents the proportion of true positive predictions made by the model among all positive labels in the dataset, and is calculated as shown in Equation (14): (14) The value is the harmonic mean of precision and recall, and its calculation expression is shown in equation (15): (15) 4. Evaluation results of classification tasks Traffic accidents were categorized by duration: accidents with longer durations were labeled 0, while those with shorter durations were labeled 1. Random Forest, XGBoost, and CatBoost were used for binary classification, and the performance of each model is shown in Table 5.

[0089] The performance results of the random forest classification model demonstrate its ability to handle the inherent complexity of the dataset. An accuracy of 86% indicates its correct labeling level, 85% precision indicates a reduction in false positive predictions, and 83% recall indicates its ability to identify true positives. A value of 84% indicates a good balance between precision and recall, ensuring the quality of the classification task. The confusion matrix results for the random forest are as follows: Figure 9 As shown.

[0090] Table 5. Binary Classification Results of Traffic Accident Duration Prediction

[0091] The performance results of the XGBoost classification model demonstrate its ability to handle the inherent complexity of datasets. An accuracy of 84% indicates its correct label classification level, 83% precision indicates a reduction in false positive predictions, and 80% recall indicates its ability to identify true positives. A value of 81% indicates a balanced performance in terms of precision and recall. The XGBoost classification confusion matrix results are as follows: Figure 10 As shown.

[0092] The CatBoost classification model achieved a classification accuracy of 0.86 on the test set, demonstrating its accurate label classification. Precision and recall further prove the model's ability to accurately identify both positive and negative labels. The confusion matrix results for the CatBoost classification model are shown below. Figure 11 As shown.

[0093] The results are presented based on the confusion matrices of Random Forest, XGBoost, and CatBoost, as well as the accuracy, precision, recall, and... in the binary classification table for traffic accident duration prediction. The calculation results of the four numerical indicators show that the Random Forest classification model outperforms the XGBoost and CatBoost predictive classifiers in classifying traffic accidents of both long and short durations in the US-Accidents dataset.

[0094] (III) Short-term regression model of traffic accident duration 1. Selection of regression model This embodiment uses the following regression model, and the basic principle of the model will be briefly introduced below: RF-CNN combines random forests with convolutional neural networks (such as...) Figure 12 The model architecture (shown) combines the advantages of both, using the convolutional and pooling layers of CNN to gradually abstract features, and using the output of CNN as the input of random forest. The non-linear modeling capability of random forest is then used for further optimization to solve complex regression problems.

[0095] CNNs are deep learning models specifically designed for processing data with a grid structure. They extract local features through convolutional layer operations, have fewer parameters and stronger feature extraction capabilities, and are core models in tasks such as image recognition and time series prediction. The core idea of ​​CNNs is to use convolutional operations to extract local features from data, and to gradually abstract higher-order features by stacking multiple convolutional layers and pooling layers.

[0096] Lightweight gradient boosting machines are efficient implementations of gradient boosting decision trees. By optimizing training speed, memory usage, and accuracy, they have been widely used in industry and academia, and are particularly suitable for large-scale, high-dimensional data. Gradient boosting decision trees are an ensemble learning method that gradually reduces training error by building multiple weak learners, eventually combining them into a strong learner.

[0097] LSTM is a variant of recurrent neural networks specifically designed for processing time series data, such as... Figure 13 As shown, LSTM overcomes the gradient vanishing and gradient explosion problems of traditional RNNs when processing long sequences by introducing memory units and gating mechanisms, thereby capturing long-term dependencies in sequence data. LSTM dynamically adjusts the flow of information through three gating mechanisms, selectively remembering and forgetting information.

[0098] 2. Regression Task Evaluation Indicators Two commonly used metrics for evaluating the performance of regression models are the root mean squared error (RMSE) and the mean absolute error (MAE). These metrics can be used to effectively measure the error between the model's predicted values ​​and the actual values, reflecting the model's predictive ability from different perspectives.

[0099] The mean absolute error is the average absolute value of the error between the predicted value and the true value, and it is calculated as shown in Equation 16.

[0100] (16) The number of samples; It is the first One true value; It is the first One predicted value.

[0101] The root mean square error is calculated as shown in Equation 17.

[0102] (17) The range of RMSE values ​​is: The closer the RMSE is to 0, the better the performance of the prediction model. It reflects the overall error level between the model's predicted values ​​and the actual values, and is more sensitive to large errors.

[0103] 3. Regression Task Evaluation Results The short-term prediction regression evaluation results of traffic accident duration are shown in Table 6.

[0104] The LightGBM model demonstrated its superiority in the experimental dataset, achieving lower RMSE (30.5437 for short-term predictions and 31.2971 for long-term predictions) and MAE (23.9409 for short-term predictions and 15.2208 for long-term predictions). This indicates that the LightGBM model possesses the performance of minimizing the deviation between accurate predictions and actual values, effectively simulating the relationship between input features and the target variable, and providing a better solution for regression problems. Meanwhile, the RF-CNN, CatBoost, and LSTM models also showed competitiveness in prediction accuracy, achieving low RMSE and MAE values ​​and capturing underlying patterns and relationships in the data, but their prediction accuracy still lags behind that of the LightGBM model.

[0105] Table 6 Regression Performance of Predictive Models

[0106] Figure 14 The predictions of the LightGBM model for the first 100 traffic accidents in the test dataset, both over long and short time periods, were plotted, along with the corresponding actual values. The predicted values ​​closely match the actual data points across the entire plot, reflecting the changes in the actual values ​​and demonstrating the robustness of the LightGBM model in capturing the inherent complex relationships and dependencies within the dataset. Furthermore... Figure 14 It also shows the regularity of the degree of anomaly in the predicted values. The predicted value curve presents a continuous and expressive trajectory. The smoothness of the curve indicates that the model effectively encapsulates the underlying dynamics of the dataset, including the temporal and spatial dependencies. It can use dynamic information to generate predictions of the situation over time and as the actual situation progresses.

[0107] (iv) Error feedback correction and joint optimization model To reduce the propagation of errors from short-term and long-term classification results to subsequent regression predictions, this embodiment incorporates an error feedback correction module between the classification model and the grouped regression model. The classification model no longer outputs only hard labels, but instead outputs the probability that a sample belongs to a long-term or short-term incident; the short-term and long-term regression models respectively provide predicted values ​​for the corresponding durations, and form an initial fusion prediction value based on the classification probabilities. Figure 16 A classification-regression fusion prediction framework for error feedback correction and joint optimization was drawn up.

[0108] Let the standardized feature vector of the i-th accident sample be... The actual duration of the accident was [value missing]. The threshold for dividing short-term and long-term time is: Category label is . when hour, , indicating a short-term accident; when hour, This indicates a long-term incident. The classification model outputs the long-term probability. Short-time regression model output Long-term regression model output .

[0109] The initial fusion prediction value is calculated by weighting the two regression prediction values ​​according to their classification probabilities, as follows:

[0110] Error feedback correction module , , , and As input, the output residual correction is:

[0111] The final predicted value is .

[0112] During the model training phase, a joint loss function is constructed. L :

[0113] in, Used to measure the recognition error of classification models for short-term and long-term labels. Used to measure the grouping regression error of short-time and long-time regression models on the corresponding true categories. Used to measure the error between the initial fusion prediction and the actual duration. Used to measure the error between the final predicted value after error feedback correction and the actual duration. Used to constrain the consistency between the final duration prediction result and the classification probability, α, β, γ, δ, and η are the corresponding weight coefficients.

[0114] Through the aforementioned joint loss function, the classification model, short-term regression model, long-term regression model, and error feedback correction module can be coordinated and adjusted under a unified optimization objective. When the classification model misclassifies a short-term event as a long-term event or vice versa, the grouping regression error, fusion prediction error, and consistency constraint error can collectively reflect the impact of this misclassification on the final duration prediction result. The error feedback correction module then performs residual correction on the final prediction value, thereby reducing the accumulation of errors caused by classification errors.

[0115] (v) Classification-Regression Architecture Model like Figure 17 As shown, a machine learning pipeline can be understood as a pipeline, referring to a series of operational steps in computer science. Each step processes the input data in some way and forwards the result to the next step until the final output is achieved. Pipeline models are highly effective when there are many types of feature variables, complex compositions, and large differences in the number of samples. They enable the entire machine learning workflow to be modularized, automated, and reusable, thereby improving efficiency, reducing errors, and facilitating model maintenance and deployment. A typical pipeline includes steps such as data acquisition, feature engineering, model training and parameter tuning, and model deployment and prediction.

[0116] 1. Deployment of Machine Learning Pipeline Models A machine learning pipeline model for predicting the duration of traffic accidents is established. This model encapsulates the functions of data feature engineering, random forest classifier, LightGBM regressor, and error feedback correction module, simplifies the code logic, automates the entire process, reduces human intervention, and avoids data leakage and inconsistency issues.

[0117] Initial data preprocessing for traffic accidents takes into account the circumstances and factors present during data collection. After analysis, the data is categorized into long-duration and short-duration accidents. This data classification strategy makes accident duration prediction more effective. The first component of the machine learning pipeline is a feature classifier based on random forests. Random forests have the ability to manage complex relationships and capture feature interactions. Utilizing a large number of decision trees for collective prediction, accidents are accurately classified according to their duration category.

[0118] After the accident data is classified into short-term and long-term durations, the pipeline will not be interrupted but will instead enter regression analysis. After the classification model outputs the short-term or long-term probabilities, the short-term and long-term regression models respectively predict the duration, and an initial fused prediction value is obtained through probability weighting. Subsequently, the error feedback correction module calculates the residual correction amount based on the classification probabilities, grouped regression prediction results, and the initial fused prediction value, and outputs the final accident duration prediction result. The advantage of choosing LightGBM as the regression model lies in its ability to handle large datasets and identify complex models. It utilizes gradient enhancement technology to independently predict the duration of both long-term and short-term accidents, and the error feedback correction mechanism reduces the impact of classification errors on the final regression result.

[0119] 2. Comparison of pipeline prediction models To verify the effectiveness of the proposed pipeline prediction model, the results were compared with previous studies, as shown in Table 7.

[0120] The comparative study used data from the San Francisco highway network in California, which has less data content than the statewide Texas dataset and incorporated accident descriptions in the prediction process. The comparative study established two types of models: a two-layer classification and regression model, and a machine learning fusion model. The fusion method requires the simultaneous use of four different machine learning models, making it an over-designed solution. While this improves accuracy, it inevitably leads to tuning difficulties in real-world applications. The pipeline model proposed in this section, based solely on static features, yields results comparable to predictions using a smaller, more specific road network dataset, demonstrating the pipeline model's performance and applicability to a wider range of data.

[0121] Unlike a two-layer classification architecture that simply outputs accident duration levels through multiple machine learning models and then determines the classification level using a logistic regression model, this embodiment not only classifies accident duration into short-term and long-term categories but also performs continuous-time regression prediction on samples of different categories. Furthermore, it incorporates an error feedback correction module and a joint loss function between the classification and regression models, allowing classification error, regression error, and classification-regression consistency error to collectively correct the final prediction result. Therefore, this embodiment forms a classification-regression fusion prediction structure with a closed-loop error feedback loop, rather than a simple multi-model classification level fusion structure.

[0122] Table 7 Comparison of Duration Prediction Performance of Combined Models

[0123] It should be noted that in this invention, relational terms such as "first," "second," etc., are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0124] Finally, it should be noted that the above content is only used to illustrate the technical solution of the present invention, and is not intended to limit the scope of protection of the present invention. Simple modifications or equivalent substitutions made by those skilled in the art to the technical solution of the present invention do not depart from the essence and scope of the technical solution of the present invention.

Claims

1. A method for predicting the duration of traffic accidents in urban road networks based on classification regression, characterized in that, Includes the following steps: Step S1: Perform feature engineering on the urban road network traffic accident dataset to generate standardized feature vectors; The feature engineering process includes data quality assessment and data preprocessing; Step S2: Using the standardized feature vector obtained in step S1, different interpretable machine learning methods are used to analyze the impact of static information on the duration of the accident, outputting short-term features, long-term features and accident classification probabilities, and evaluating the classification performance of the different machine learning models. Step S3: Based on the short-term and long-term features obtained in step S2, regression analysis of traffic accident duration is carried out using different interpretable machine learning methods. The predicted duration values ​​of short-term and long-term accidents are output respectively, and the classification effect of different machine learning models is evaluated. Step S4: Set up the error feedback correction module. Based on the accident classification probability obtained in step S2 and the duration prediction value obtained in step S3, form an initial fusion prediction value. Construct a joint loss function including the classification model, regression model and error feedback correction module to perform collaborative optimization and correction on the final prediction value. Step S5: Based on machine learning pipeline technology, the functions of data feature engineering processing, the optimal classification model of step S2, the optimal regression model of step S3, and the error feedback correction module of step S4 are encapsulated to verify the effectiveness of the classification-regression fusion prediction model.

2. The method for predicting the duration of traffic accidents in urban road networks according to claim 1, characterized in that: The machine learning methods include decision tree-based models and / or deep learning models, wherein the decision tree-based models include random forest models, extreme gradient boosting tree models, and classification-enhanced gradient boosting tree models.

3. The method for predicting the duration of traffic accidents in urban road networks according to claim 1, characterized in that: In step S4, an error feedback correction module is set up. The error feedback correction module calculates the consistency error and regression residual between the classification result and the regression prediction result based on the short-term accident probability or long-term accident probability output by the classification model, the short-term regression model prediction value, the long-term regression model prediction value, and the initial fusion prediction value. Based on the consistency error and regression residual, the final accident duration prediction value is corrected.

4. The method for predicting the duration of traffic accidents in urban road networks according to claim 3, characterized in that: The initial fusion prediction value is obtained by weighting the short-term regression model prediction value and the long-term regression model prediction value with the output probability of the classification model.

5. The method for predicting the duration of traffic accidents in urban road networks according to claim 3 or 4, characterized in that: The classification model, short-term regression model, long-term regression model, and error feedback correction module are optimized collaboratively through a joint loss function, which includes at least classification loss, group regression loss, probability fusion prediction loss, error correction loss, and classification-regression consistency constraint loss.

6. The method for predicting the duration of traffic accidents in urban road networks according to claim 5, characterized in that: The joint loss function L Defined as: in, Used to measure the recognition error of classification models for short-term and long-term labels. Used to measure the grouping regression error of short-time and long-time regression models on the corresponding true categories. Used to measure the error between the initial fusion prediction and the actual duration. Used to measure the error between the final predicted value after error feedback correction and the actual duration. Used to constrain the consistency between the final duration prediction result and the classification probability, α, β, γ, δ, and η are the corresponding weight coefficients.

7. The method for predicting the duration of traffic accidents in urban road networks according to claim 1, characterized in that: The data preprocessing in step S1 includes standardization processing, which includes normalization processing for numerical data, effective encoding processing for text-based categorical data, binary field processing for Boolean data, and data linear correlation analysis.

8. The method for predicting the duration of traffic accidents in urban road networks according to claim 7, characterized in that: The linear correlation analysis of the data includes calculating the linear correlation between the static information using the Pearson correlation coefficient and converting the original data into a ranking using the Spearman rank correlation coefficient; the results of the two correlation coefficients are compared to verify the effective correlation of the features in the processed dataset.

9. The method for predicting the duration of traffic accidents in urban road networks according to claim 8, characterized in that: The data preprocessing in step S1 also includes feature data distribution, which includes analyzing the distribution of feature data using kernel density estimation methods.

10. The method for predicting the duration of traffic accidents in urban road networks according to claim 1, characterized in that: The classification performance evaluation method in step S2 is to use the confusion matrix method to compare the predicted labels of the classification model with the true labels, and use relative indicators to judge whether the prediction results are accurate.

11. The method for predicting the duration of traffic accidents in urban road networks according to claim 10, characterized in that: The relative metrics include accuracy, precision, recall, and F 1 value, where F The 1 value is the harmonic mean of precision and recall.

12. The method for predicting the duration of traffic accidents in urban road networks according to claim 1, characterized in that: The regression performance evaluation methods in step S3 are root mean square error and mean absolute error.

Citation Information

Patent Citations

  • Traffic accident duration prediction method based on double-layer architecture model

    CN116227730A