Traffic accident scene clustering and variable heterogeneity effect analysis method
By combining quantum principal component analysis and k-medoids clustering with a latent class ordered Probit regression model, the problems of dimensionality reduction and high complexity in traffic accident data analysis were solved. This approach achieved efficient dimensionality reduction and structural clustering of traffic accident data, revealing the potential heterogeneity patterns in the formation mechanism of accident severity.
Patent Information
- Application Number
- CN202511806884.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-03
- Publication Date
- 2026-03-06
AI Technical Summary
Existing technologies for analyzing traffic accident data suffer from problems such as difficulty in dimensionality reduction of high-dimensional data, high complexity of k-medoids algorithms, and difficulty in quantifying and analyzing the formation mechanism of accident severity, resulting in insufficient stability and interpretability of the analysis results.
Quantum principal component analysis (QPCA) was used for data dimensionality reduction, and k-medoids clustering was combined to identify the initial scenario categories. Subsequently, a latent category ordered Probit regression model was constructed to quantify the heterogeneous impact of variables under different scenarios.
It achieves efficient dimensionality reduction and structural clustering of traffic accident data, reveals the potential heterogeneity patterns in the formation mechanism of accident severity, and provides a reliable basis for traffic safety management.
Smart Images

Figure FT_1 
Figure SMS_6 
Figure SMS_7
Abstract
Description
Technical Field
[0001] This invention belongs to the field of traffic accident data analysis and traffic safety technology, specifically relating to a system method suitable for mining traffic accident characteristics and quantifying the heterogeneous impact of variables in different scenarios. Background Technology
[0002] With the rapid development of the transportation industry, traffic accidents have become a prominent threat to public safety. A thorough understanding of accident characteristics and the mechanisms underlying their severity are crucial prerequisites for improving traffic safety and perfecting the risk prevention and control system.
[0003] Currently, traffic accident data analysis largely relies on traditional data processing and modeling techniques, but these techniques still have limitations in areas such as dimensionality reduction of high-dimensional data, scenario classification, and analysis of severity heterogeneity. Traditional principal component analysis and linear discriminant analysis are prone to losing key information and failing to effectively maintain the main characteristic structure of the data when processing nonlinear and highly coupled traffic data. Although the k-medoids clustering algorithm is robust, its high computational complexity in high-dimensional data scenarios can easily lead to decreased clustering efficiency and classification instability. Existing Logit or Probit models are mostly based on global parameter estimation and lack the ability to sensitively identify differences in potential subgroups, making it difficult to reveal the potential heterogeneity patterns in the process of accident severity formation.
[0004] The aforementioned problems lead to insufficient stability and interpretability of traffic accident data analysis results, making it difficult to provide a reliable basis for subsequent accident prevention and safety assessment. Therefore, this invention proposes a traffic accident scenario clustering and variable heterogeneity effect analysis method that integrates quantum principal component analysis and k-medoids clustering. This method fully preserves key data features during efficient dimensionality reduction and reduces clustering complexity through algorithm optimization, achieving structured clustering of accidents. Furthermore, based on the initial scenario clustering results, a latent class ordered probit regression model is constructed to identify unobservable potential heterogeneous structures in traffic accident data, systematically revealing the differentiated patterns of accident severity formation mechanisms. Summary of the Invention
[0005] This invention proposes a method for clustering traffic accident scenarios and analyzing the heterogeneity effect of variables to solve the technical problems of high-dimensional redundancy of accident data, complexity of the k-medoids algorithm, and difficulty in quantifying and analyzing the formation mechanism of accident severity.
[0006] A scenario clustering and variable heterogeneity effect analysis method suitable for traffic accident feature mining is implemented through the following steps:
[0007] Step 1: Preprocess the traffic accident dataset. Systematic data cleaning is performed to address missing and outlier values in the original accident dataset, ensuring data integrity and accuracy. Based on the numerical characteristics of each feature variable, standardization methods are used to unify the scale, ensuring the consistency and comparability of the dimensions of each feature value in subsequent analysis.
[0008] Step 2: Perform dimensionality reduction using Quantum Principal Component Analysis (QPCA). This is achieved through the following steps:
[0009] Step 2.1: Prepare the quantum state. Transform the preprocessed data into a quantum state, assuming its data matrix is... Each sample can be represented as ,in For the sample size, For feature dimension, These are singular values, used to measure the variance contribution of the data along the corresponding principal component direction. The specific steps are as follows:
[0010] Step 2.1.1: Initial State Preparation. In the quantum state initialization process, unitary operations are the core means of realizing quantum state transformation. The probability conservation of the quantum state is ensured through the unitary transformation of the unitary matrix, and the preparation of complex states is achieved through the combination of basic quantum gates. The two unitary operations used are calculated as follows:
[0011]
[0012]
[0013] in,
[0014] In the formula, To transform the feature vector of the sample Encode it into a quantum state form to realize the quantum state representation of the sample; To determine the relative weights among the samples, the norm of all samples is... Encoded as quantum states; For the Euclidean norm, it is the first... The length of each sample vector is used to normalize the feature values of a single sample. is the Flobenius norm of the matrix, representing the length of the entire data matrix, used to normalize the norm of all samples to ensure the probability conservation of quantum states;
[0015] Step 2.1.2: Quantum state encoding. Unitary operation. and These are used to encode and obtain the quantum state form of the initial sample point, and to encode the sample point norm in terms of amplitude, respectively. for The adjoint matrix is used to obtain the initial state based on the unitary operation formula. The calculation is as follows:
[0016]
[0017] in, and These are the left and right singular vectors, respectively, forming an orthogonal basis for the data space; These are eigenvalues, also known as singular values. The proportion of the square of in the sum of squares of all singular values is expressed as: , ;
[0018] Step 2.2: Singular Value Decomposition and Phase Estimation. The initial state is subjected to Singular Value Decomposition (SVD), and singular values are extracted through phase estimation. This invention utilizes a quantum phase estimation algorithm for unitary operations. The phase is estimated. The specific steps are as follows:
[0019] Step 2.2.1: Construct unitary operations. Introduce several auxiliary qubits. In the second quantum computing system, apply the phase estimation operation to the register storing the quantum state, and perform unitary operations on the unitary operations. Phase extraction is performed, i.e.:
[0020]
[0021] Step 2.2.2: Perform phase estimation. The quantum phase estimation formula is as follows:
[0022]
[0023] Finally, add an index register to store... indivual A quantum bit in a quantum state, when performing a controlled unitary operation, changes the unitary transformation parameter... Substitution of unitary transformation Execution control bits Transform into The calculation is as follows:
[0024]
[0025] Obtaining quantum state The calculation is as follows:
[0026]
[0027] Step 2.3: Singular Value Screening. During singular value screening, inverse phase estimation is performed to eliminate the influence of the eigenvalue register, and a singular value is introduced into the system. The quantum bits of a state. The specific steps are as follows:
[0028] Step 2.3.1: Controlled Revolving Door Design. [The following is a continuation of the previous sentence: A set of controlled revolving doors is introduced as a parameter. In the middle. Among them, the control bits are kept in... The state remains unchanged, and the target bit changes from... Transform into The superposition state is calculated as follows:
[0029]
[0030] The constant used to control the rotation amplitude Thus, quantum state is obtained. The calculation is as follows:
[0031]
[0032] Step 2.3.2: Projection Measurement. When using projection measurement of the ground state... Measurement The second register is used to determine whether it is in a quantum state, and the ground state is measured by projection. Projection measurements are performed on the last qubit to determine if it is... If the measurement results show In a quantum state (i.e., the second register is) ), and the last qubit is in If the state is compressed into the first register, then the entire quantum state is compressed into the first register. At this point, the quantum state exhibits entanglement and amplitude relationships, and the register is in the quantum state. as follows:
[0033]
[0034] Step 2.4: Data Reconstruction. During the controlled rotating door operation, the singular values of the selected principal component data points are restored and recompressed into their corresponding quantum states. This process achieves a quantum mapping from the feature space to a lower-dimensional space. Finally, the quantum algorithm converts the original high-dimensional data points into their corresponding quantum states. Converted to a new low-dimensional data representation, its reconstructed quantum state can be expressed as:
[0035]
[0036] Finally, the quantum states reconstructed by quantum principal component analysis (QPCA) Represented as the set of scenario samples corresponding to each principal component after dimensionality reduction. , This serves as the input for the accident data sample in step 3. The number of quantum principal component scenarios for traffic data after dimensionality reduction based on QPCA;
[0037] Step 3: Construct a k-medoids clustering model based on the dimensionality-reduced traffic accident data to identify the initial scenario category. This is achieved through the following steps:
[0038] Step 3.1: Select cluster centers. Let the traffic accident dataset after QPCA dimensionality reduction be... ,in, Indicates a group consisting of all OK The set of real matrices of columns, where The number of quantum principal component scenarios for traffic data after dimensionality reduction. The feature dimension is denoted as . The set of scenario samples corresponding to each principal component after dimensionality reduction is . ,in Indicates the first Data points for traffic accident scenarios. Randomly selected. 1 sample was used as the initial cluster center. Defined as ;
[0039] Step 3.2: Assign data points. For any dimensionality-reduced feature vector data point in the dataset... Calculate its relationship with each center point in the current iteration. Euclidean distance between The calculation is as follows:
[0040]
[0041] in, Indicates the first The first sample 3D eigenvalues No. During the nth iteration The center point of each cluster.
[0042] For each data point The cluster assigned to the nearest centroid is defined as:
[0043]
[0044] in, Indicates the first During the nth iteration The set of members of each cluster. Through this process, the initial clustering of data points is completed;
[0045] Step 3.3: Update the centroid. For each cluster Then, the sample with the smallest total distance within each cluster is selected as the new cluster center. The specific steps are as follows:
[0046] Step 3.3.1: Calculate the total intra-cluster distance. Calculate the cluster distance. Each sample in The sum of distances to other samples within the cluster is defined as follows:
[0047]
[0048] in, Indicated by Clusters centered on Total internal distance cost Represents the distance function;
[0049] Step 3.3.2: Select a new center point. Choose the one that minimizes distance cost. The smallest sample is used as the new center point. ,Right now:
[0050]
[0051] By calculating the new centroids, the updated set of centroids is: ;
[0052] Step 3.4: Output the clustering results. Repeat steps 3.2 and 3.3 until the convergence condition is met, i.e., the set of centroids no longer changes. When, or when the number of iterations Greater than or equal to the maximum number of iterations set threshold Furthermore, the change in total intra-cluster distance caused by the center point update is less than the convergence threshold. The clustering process terminates. The convergence condition can be expressed as:
[0053]
[0054] Final output cluster set As the context input for step 4;
[0055] Step 4: Construct an ordered Probit regression model for latent categories based on QK-medoids clustering results to quantify the heterogeneous impact of variables on accident severity under different latent categories and scenarios. This is achieved through the following steps:
[0056] Step 4.1: Construct a latent categorical ordered Probit regression model to capture the unobservable heterogeneity features in traffic accident data and characterize the heterogeneous impact of different variables on the severity of accidents.
[0057] Based on the above steps, the following steps were obtained. Initial scenario clustering Let each scenario contain Potential categories, 1 predictor variable and There are 3 covariates. The predictor variables characterize the variation of the outcome variable within each latent category, while the covariates explain the differences in sample attribution between different latent categories. In the 1st... In the scenario described, belonging to the first... Cumulative probability distribution function of each potential class for:
[0058]
[0059] Cumulative distribution function of standard normal distribution for:
[0060]
[0061] in, For predictor variables; For covariates; To measure the influence of predictor variables on latent categories Parameters related to the strength of the influence of attribution; To measure the influence of covariates on latent categories Parameters related to the strength of the influence of attribution; For ordered threshold parameters; It is an integral variable, and therefore a dummy variable. It is a standard score, representing the number of standard deviations of a value from the mean in a standard normal distribution.
[0062] The formula for the latent class ordered Probit regression model is:
[0063]
[0064]
[0065] in, For the context Potential variables affecting the severity of accident damage; The regression coefficients of the covariates on the severity of the accident; To depict the first Model parameters for classifying the submersible category in each scenario; For the first The severity of a scenario under the influence of covariates.
[0066] For each potential category, explore the probability distribution of the influence of covariates on the heterogeneity of accident severity under different scenarios. The model formula is as follows:
[0067]
[0068] when When the value is positive, it indicates that the covariate has a significant positive impact on the severity of the accident; when... When the value is negative, it indicates that the covariate has a significant negative impact on the severity of the accident; when A value of 0 indicates that the covariate has no significant effect on the severity of the accident;
[0069] Step 4.2: Estimate model parameters. This is done using the maximum log-likelihood function. The parameters of the latent class ordered regression model are estimated using the following formula:
[0070]
[0071] Will and Substituting into the maximum log-likelihood function, the parameters can be estimated. .
[0072] Step 4.3: Model Results Analysis. Based on the estimation results, the differences in variable distribution and regression coefficients among different latent categories are compared to test the significance of inter-class heterogeneity. This verifies the effectiveness of latent category classification in distinguishing different accident scenarios and analyzes the impact of the same variable on accident severity in different latent categories, thereby revealing the potential heterogeneity characteristics of the accident severity formation mechanism.
[0073] The beneficial effects of this invention are as follows: This invention integrates quantum principal component analysis and k-medoids clustering to achieve efficient dimensionality reduction and structural clustering of traffic accident data. Based on the initial clustering scenario, a latent categorical ordered Probit regression model is established to capture unobservable heterogeneous features in traffic accident data and explore the differentiated effects of different variables on accident severity. This method can reveal the potential heterogeneous patterns in the formation mechanism of accident severity, providing a more reliable technical solution for traffic accident data analysis and traffic safety management. Attached Figure Description
[0074] Figure 1 This is a flowchart of a scenario clustering and variable heterogeneity effect analysis method applicable to traffic accident feature mining according to the present invention; Detailed Implementation
[0075] like Figure 1 As shown, this invention proposes a scenario clustering and variable heterogeneity effect analysis method suitable for traffic accident feature mining. The specific implementation of this invention will be described in detail below.
[0076] Step 1: Preprocess the traffic accident dataset. Systematic data cleaning is performed to address missing and outlier values in the original accident dataset, ensuring data integrity and accuracy. Based on the numerical characteristics of each feature variable, standardization methods are used to unify the scale, ensuring the consistency and comparability of the dimensions of each feature value in subsequent analysis.
[0077] Step 2: Perform dimensionality reduction using Quantum Principal Component Analysis (QPCA). This is achieved through the following steps:
[0078] Step 2.1: Prepare the quantum state. Transform the preprocessed data into a quantum state, assuming its data matrix is... Each sample can be represented as ,in For the sample size, For feature dimension, These are singular values, used to measure the variance contribution of the data along the corresponding principal component direction. The specific steps are as follows:
[0079] Step 2.1.1: Initial State Preparation. In the quantum state initialization process, unitary operations are the core means of realizing quantum state transformation. The probability conservation of the quantum state is ensured through the unitary transformation of the unitary matrix, and the preparation of complex states is achieved through the combination of basic quantum gates. The two unitary operations used are calculated as follows:
[0080]
[0081]
[0082] in,
[0083] In the formula, To transform the feature vector of the sample Encode it into a quantum state form to realize the quantum state representation of the sample; To determine the relative weights among the samples, the norm of all samples is... Encoded as quantum states; For the Euclidean norm, it is the first... The length of each sample vector is used to normalize the feature values of a single sample. is the Flobenius norm of the matrix, representing the length of the entire data matrix, used to normalize the norm of all samples to ensure the probability conservation of quantum states;
[0084] Step 2.1.2: Quantum state encoding. Unitary operation. and These are used to encode and obtain the quantum state form of the initial sample point, and to encode the sample point norm in terms of amplitude, respectively. for The adjoint matrix is used to obtain the initial state based on the unitary operation formula. The calculation is as follows:
[0085]
[0086] in, and These are the left and right singular vectors, respectively, forming an orthogonal basis for the data space; These are eigenvalues, also known as singular values. The proportion of the square of in the sum of squares of all singular values is expressed as: , ;
[0087] Step 2.2: Singular Value Decomposition and Phase Estimation. The initial state is subjected to Singular Value Decomposition (SVD), and singular values are extracted through phase estimation. This invention utilizes a quantum phase estimation algorithm for unitary operations. The phase is estimated. The specific steps are as follows:
[0088] Step 2.2.1: Construct unitary operations. Introduce several auxiliary qubits. In the second quantum computing system, apply the phase estimation operation to the register storing the quantum state, and perform unitary operations on the unitary operations. Phase extraction is performed, i.e.:
[0089]
[0090] Step 2.2.2: Perform phase estimation. The quantum phase estimation formula is as follows:
[0091]
[0092] Finally, add an index register to store... indivual A quantum bit in a quantum state, when performing a controlled unitary operation, changes the unitary transformation parameter... Substitution of unitary transformation Execution control bits Transform into The calculation is as follows:
[0093]
[0094] Obtaining quantum state The calculation is as follows:
[0095]
[0096] Step 2.3: Singular Value Screening. During singular value screening, inverse phase estimation is performed to eliminate the influence of the eigenvalue register, and a singular value is introduced into the system. The quantum bits of a state. The specific steps are as follows:
[0097] Step 2.3.1: Controlled Revolving Door Design. [The following is a continuation of the previous sentence: A set of controlled revolving doors is introduced as a parameter. In the middle. Among them, the control bits are kept in... The state remains unchanged, and the target bit changes from... Transform into The superposition state is calculated as follows:
[0098]
[0099] The constant used to control the rotation amplitude Thus, quantum state is obtained. The calculation is as follows:
[0100]
[0101] Step 2.3.2: Projection Measurement. When using projection measurement of the ground state... Measurement The second register is used to determine whether it is in a quantum state, and the ground state is measured by projection. Projection measurements are performed on the last qubit to determine if it is... If the measurement results show In a quantum state (i.e., the second register is) ), and the last qubit is in If the state is compressed into the first register, then the entire quantum state is compressed into the first register. At this point, the quantum state exhibits entanglement and amplitude relationships, and the register is in the quantum state. as follows:
[0102]
[0103] Step 2.4: Data Reconstruction. During the controlled rotating door operation, the singular values of the selected principal component data points are restored and recompressed into their corresponding quantum states. This process achieves a quantum mapping from the feature space to a lower-dimensional space. Finally, the quantum algorithm converts the original high-dimensional data points into their corresponding quantum states. Converted to a new low-dimensional data representation, its reconstructed quantum state can be expressed as:
[0104]
[0105] Finally, the quantum states reconstructed by quantum principal component analysis (QPCA) Represented as the set of scenario samples corresponding to each principal component after dimensionality reduction. , This serves as the input for the accident data sample in step 3. The number of quantum principal component scenarios for traffic data after dimensionality reduction based on QPCA;
[0106] Step 3: Construct a k-medoids clustering model based on the dimensionality-reduced traffic accident data to identify the initial scenario category. This is achieved through the following steps:
[0107] Step 3.1: Select cluster centers. Let the traffic accident dataset after QPCA dimensionality reduction be... ,in, Indicates a group consisting of all OK The set of real matrices of columns, where The number of quantum principal component scenarios for traffic data after dimensionality reduction. The feature dimension is denoted as . The set of scenario samples corresponding to each principal component after dimensionality reduction is . ,in Indicates the first Data points for traffic accident scenarios. Randomly selected. 1 sample was used as the initial cluster center. Defined as ;
[0108] Step 3.2: Assign data points. For any dimensionality-reduced feature vector data point in the dataset... Calculate its relationship with each center point in the current iteration. Euclidean distance between The calculation is as follows:
[0109]
[0110] in, Indicates the first The first sample 3D eigenvalues No. During the nth iteration The center point of each cluster.
[0111] For each data point The cluster assigned to the nearest centroid is defined as:
[0112]
[0113] in, Indicates the first During the nth iteration The set of members of each cluster. Through this process, the initial clustering of data points is completed;
[0114] Step 3.3: Update the centroid. For each cluster Then, the sample with the smallest total distance within each cluster is selected as the new cluster center. The specific steps are as follows:
[0115] Step 3.3.1: Calculate the total intra-cluster distance. Calculate the cluster distance. Each sample in The sum of distances to other samples within the cluster is defined as follows:
[0116]
[0117] in, Indicated by Clusters centered on Total internal distance cost Represents the distance function;
[0118] Step 3.3.2: Select a new center point. Choose the one that minimizes distance cost. The smallest sample is used as the new center point. ,Right now:
[0119]
[0120] By calculating the new centroids, the updated set of centroids is: ;
[0121] Step 3.4: Output the clustering results. Repeat steps 3.2 and 3.3 until the convergence condition is met, i.e., the set of centroids no longer changes. When, or when the number of iterations Greater than or equal to the maximum number of iterations set threshold Furthermore, the change in total intra-cluster distance caused by the center point update is less than the convergence threshold. The clustering process terminates. The convergence condition can be expressed as:
[0122]
[0123] Final output cluster set As the context input for step 4;
[0124] Step 4: Construct an ordered Probit regression model for latent categories based on QK-medoids clustering results to quantify the heterogeneous impact of variables on accident severity under different latent categories and scenarios. This is achieved through the following steps:
[0125] Step 4.1: Construct a latent categorical ordered Probit regression model to capture the unobservable heterogeneity features in traffic accident data and characterize the heterogeneous impact of different variables on the severity of accidents.
[0126] Based on the above steps, the following steps were obtained. Initial scenario clustering Let each scenario contain Potential categories, 1 predictor variable and There are 3 covariates. The predictor variables characterize the variation of the outcome variable within each latent category, while the covariates explain the differences in sample attribution between different latent categories. In the 1st... In the scenario described, belonging to the first... Cumulative probability distribution function of each potential class for:
[0127]
[0128] Cumulative distribution function of standard normal distribution for:
[0129]
[0130] in, For predictor variables; For covariates; To measure the influence of predictor variables on latent categories Parameters related to the strength of the influence of attribution; To measure the influence of covariates on latent categories Parameters related to the strength of the influence of attribution; For ordered threshold parameters; It is an integral variable, and therefore a dummy variable. It is a standard score, representing the number of standard deviations of a value from the mean in a standard normal distribution.
[0131] The formula for the latent class ordered Probit regression model is:
[0132]
[0133]
[0134] in, For the context Potential variables affecting the severity of accident damage; The regression coefficients of the covariates on the severity of the accident; To depict the first Model parameters for classifying the submersible category in each scenario; For the first The severity of a scenario under the influence of covariates.
[0135] For each potential category, explore the probability distribution of the influence of covariates on the heterogeneity of accident severity under different scenarios. The model formula is as follows:
[0136]
[0137] when When the value is positive, it indicates that the covariate has a significant positive impact on the severity of the accident; when... When the value is negative, it indicates that the covariate has a significant negative impact on the severity of the accident; when A value of 0 indicates that the covariate has no significant effect on the severity of the accident;
[0138] Step 4.2: Estimate model parameters. This is done using the maximum log-likelihood function. The parameters of the latent class ordered regression model are estimated using the following formula:
[0139]
[0140] Will and Substituting into the maximum log-likelihood function, the parameters can be estimated. .
[0141] Step 4.3: Model Results Analysis. Based on the estimation results, the differences in variable distribution and regression coefficients among different latent categories are compared to test the significance of inter-class heterogeneity. This verifies the effectiveness of latent category classification in distinguishing different accident scenarios and analyzes the impact of the same variable on accident severity in different latent categories, thereby revealing the potential heterogeneity characteristics of the accident severity formation mechanism.
Claims
1.The application provides a traffic accident scenario clustering and variable heterogeneity effect analysis method to solve the technical problems of high-dimensional redundancy of accident data, complexity of k-medoids algorithm and difficulty in quantitatively analyzing the formation mechanism of accident severity. A scenario clustering and variable heterogeneity effect analysis method suitable for traffic accident feature mining is realized through the following steps: Step 1: Preprocessing of traffic accident data set. In view of the missing values and abnormal values existing in the original accident data set, systematic data cleaning is carried out to ensure the integrity and accuracy of the data. According to the numerical characteristics of each feature variable, the standardization processing method is used to unify the scale, so as to ensure the dimensional consistency and comparability of each feature value in the subsequent analysis; Step 2: Data dimension reduction is realized by using quantum principal component analysis (QPCA). The following steps are realized: Step 2.1: Prepare quantum states. Convert the pre-processed result data into quantum states, let the data matrix be Each sample can be represented as where is the number of samples, is the feature dimension, is the singular value, which measures the contribution of the data to the variance in the corresponding principal component direction. The specific steps are as follows: Step 2.1.1: Initial state preparation. In the initialization process of quantum state, the unitary operation is the core means to realize the transformation of quantum state, which guarantees the probability conservation of quantum state through the unitary transformation of unitary matrix, and realizes the preparation of complex state through the combination of basic quantum gate. The two unitary operations applied are calculated as follows: , , wherein , In the formula, To transform the feature vector of the sample Encode it into a quantum state form to realize the quantum state representation of the sample; To determine the relative weights among the samples, the norm of all samples is... Encoded as quantum states; For the Euclidean norm, it is the first... The length of each sample vector is used to normalize the feature values of a single sample. is the Flobenius norm of the matrix, representing the length of the entire data matrix, used to normalize the norm of all samples to ensure the probability conservation of quantum states; Step 2.1.2: Quantum state encoding. Unitary operation and are used to encode and obtain the quantum state form of the initial sample point and to encode the sample point norm in amplitude, respectively. is the adjoint matrix of , the initial state is calculated as follows: , wherein, and are left and right singular vectors, respectively, which constitute an orthogonal basis of the data space; is an eigenvalue, i.e., a singular value of the square of the singular value occupies in the sum of squares of all singular values, and the expression is , ; Step 2.2: Singular Value Decomposition and Phase Estimation. Perform a singular value decomposition (SVD) on the initial state and extract the singular values by phase estimation. The present invention utilizes a quantum phase estimation algorithm to estimate the phase of the unitary operation The specific steps are as follows: Step 2.2.1 : Constructing the unitary operation. Introduce several ancilla qubits, in the second quantum computing system, apply a phase estimation operation on the register storing the quantum state, to the unitary operation performing phase extraction, i.e.: , Step 2.2.2: Perform phase estimation. The execution formula of quantum phase estimation is: , Finally, an index register is added, storing the quantum state of the qubit, in performing a controlled unitary operation by bringing the unitary transformation parameter into the unitary transformation , the control bit is transformed to , computed as follows: , Obtaining quantum states , calculated as follows: , Step 2.3: Singular Value Filtering. In the singular value filtering process, the effect of the eigenvalue register is removed by performing an inverse phase estimation and introducing a quantum bit in the state |0> into the system. The specific steps are as follows: Step 2.3.1: Controlled rotation gate design. We will introduce a set of controlled rotation gates as parameters in the circuit. Here, the control bit remains in the state |0> and the target bit transitions from |0> to |1> in the superposition state |0> + |1>, which is computed as follows: , where the constant for controlling the amplitude of rotation , thereby obtaining the quantum state , is calculated as follows: , Step 2.3.2: Projection measurement. When the ground state of the projection measurement is used Measurement the second register to determine whether it is in the quantum state, and the ground state of the projection measurement is used to project the last qubit to determine whether it is in the state If the measurement result shows that the quantum state is in the state (i.e., the second register is in the state ), and the last qubit is in the state , then the entire quantum state is compressed into the first register , at which time the quantum state has entanglement and amplitude relations, and the quantum state of the register is as follows: , Step 2.4: Data reconstruction. Upon performing the controlled rotation gate operation, the singular values of the screened principal component data points are de-compressed and re-compressed into the corresponding quantum states. This process implements a quantum mapping from the feature space to the low-dimensional space. Finally, the quantum algorithm converts the quantum states corresponding to the original high-dimensional data points into a new low-dimensional data representation, whose reconstructed quantum states can be represented as: , Finally, the quantum state reconstructed by QPCA is represented as a set of scenario samples corresponding to each principal component after dimension reduction , As the accident data sample input of step 3. Among them, is the quantum principal component scenario number of traffic data based on QPCA after dimension reduction Step 3: Based on the reduced traffic accident data, a k-medoids clustering model is constructed to identify the initial scenario category. The following steps are realized: Step 3.1: Selecting cluster center points. Let the traffic accident dataset after QPCA dimension reduction be where denotes a set of all by real matrices, where is the number of traffic data quantum principal component scenarios after dimension reduction, and is the feature dimension after dimension reduction. The scenario sample set corresponding to each principal component after dimension reduction is where denotes the traffic accident scenario data point. Randomly select samples as initial cluster centers , defined as ; Step 3.2: Assign data points. For any dimensionality-reduced feature vector data point in the dataset... Calculate its relationship with each center point in the current iteration. Euclidean distance between The calculation is as follows: , wherein, represents the dimensional feature value of the dimensional feature value of the dimensional feature value of the dimensional feature value of the center point of the th cluster at the th iteration. For each data point is assigned to the cluster corresponding to the nearest center point, defined as: , wherein, represents the set of members of the th cluster at the th iteration. Through this process, the clustering of data points is preliminarily completed; Step 3.3: Update the center point. For each cluster , reselect the sample with the minimum total distance within the cluster as the new cluster center point. The specific steps are as follows: Step 3.3.1: Calculate total distance within cluster. Calculate the distance sum of each sample in cluster to other samples in the cluster, which is defined as: , wherein, denotes a cluster centered at the total distance cost within the cluster, denotes a distance function; Step 3.3.2: Select new center point. Choose the sample that minimizes the distance cost as the new center point i.e.: , By calculating the new center points, the updated set of center points is ; Step 3.4: Output clustering results. Repeat Step 3.2 and Step 3.3 until a convergence condition is met, i.e., when the set of center points no longer changes , or when the number of iterations is greater than or equal to a maximum number of iterations set threshold , and the total distance change within the cluster caused by the center point update is less than a convergence threshold , the clustering process terminates. The convergence condition can be expressed as: , Final output cluster set As step 4 scenario input; Step 4: Based on the QK-medoids clustering results, a latent class ordered Probit regression model is constructed to quantify the heterogeneity effect of variables on accident severity in different latent classes and scenarios. The following steps are realized: Step 4.1: Construct a latent class ordered Probit regression model to capture the unobservable heterogeneity characteristics in traffic accident data and describe the heterogeneity effect of different variables on accident severity. Based on the above steps obtained An initial scenario cluster , assuming that each scenario contains A latent class, A prediction variable and A covariate. Among them, the prediction variable is used to describe the change rule of the result variable in each latent class, and the covariate is used to explain the difference in the attribution of the sample between different latent classes. In the first Scenario, the cumulative probability distribution function Of the first Latent class is: , cumulative distribution function of the standard normal distribution is: , where, is the predictor variable; is the covariate variable; is a parameter measuring the strength of the effect of the predictor variable on the latent class belonging; is a parameter measuring the strength of the effect of the covariate variable on the latent class belonging; is an ordinal threshold parameter; is an integral variable, belonging to the dummy variable; is a standard score, indicating the number of standard deviations from the mean in the standard normal distribution. The formula of latent class ordered Probit regression model is: , , wherein, is the scenario the potential variable for injury severity in an accident; is the regression coefficient of the covariate on the severity of the accident; is the model parameter describing the latent class membership in the scenario is the severity of the scenario under the influence of the covariate. For each latent class, the probability distribution of the effect of the covariates on the severity of the accident in different scenarios is explored The model formula is as follows: , When is positive, it indicates that the covariate has a significant positive effect on accident severity; when is negative, it indicates that the covariate has a significant negative effect on accident severity; when is 0, it indicates that the covariate has no significant effect on accident severity; Step 4.2: Estimate model parameters. Estimate the parameters of the model by maximizing the log-likelihood function The parameters of the latent class ordered regression model are estimated as follows: , Substituting into the log-likelihood function gives the estimate of the parameter and Substituting into the log-likelihood function gives the estimate of the parameter . Step 4.3: Model result analysis. Based on the estimation results, the differences of variable distribution and regression coefficient between different latent classes are compared, and the significance of inter-class heterogeneity is tested to verify the effectiveness of latent class division in distinguishing different accident scenarios, and the influence of the same variable on accident severity in different latent classes is analyzed to reveal the potential heterogeneity characteristics of the formation mechanism of accident severity.