A method for classifying and grading traffic safety hazards of key vehicles on highways

By constructing a hierarchical risk task prior structure and introducing operational status information, combined with historical sample risk level distribution statistics, a refined classification and graded early warning system for traffic safety hazards of key vehicles on highways was achieved, improving the accuracy of risk analysis and the stability of early warning.

CN121686785BActive Publication Date: 2026-07-17福建省公安厅交通管理总队

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
福建省公安厅交通管理总队
Filing Date
2026-01-13
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

The existing highway traffic management system is unable to systematically and meticulously characterize the traffic safety hazards of key vehicles. The risk identification results are coarse-grained and lack adaptability. Furthermore, the objectivity and interpretability of the early warning results are insufficient, making it difficult to support continuous monitoring and dynamic early warning.

Method used

Based on a set of risk indicators, structured sample context representation, and the TabPFN model, a hierarchical risk task prior structure is constructed. Operational situation information is introduced into the modulation to generate a hierarchical task inference structure. Combined with the statistical results of historical sample risk level distribution, an early warning level interval table is formed. Consistent real-time early warning output is completed based on the real-time standardized indicator input representation.

Benefits of technology

It improves the accuracy, interpretability, and engineering feasibility of risk analysis for traffic safety hazards of key vehicles, enhances the reliability and rationality of risk level prediction results, strengthens the adaptability to changes in the real-time operating environment of highways, and ensures the stability and repeatability of early warning levels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121686785B_ABST
    Figure CN121686785B_ABST
Patent Text Reader

Abstract

This invention discloses a method for classifying and classifying traffic safety hazards of key vehicles on highways, comprising the following steps: acquiring highway vehicle data, processing it to obtain operational context information, constructing a risk indicator set, and generating a historical standardized indicator input representation; constructing a structured sample context representation based on the historical standardized indicator input representation; constructing a hierarchical risk task prior structure in the TabPFN model and completing condition binding to generate a hierarchical task inference structure; performing modulation processing based on the operational context information to obtain a priori modulated TabPFN model; performing condition inference processing to generate a risk judgment result for key vehicle traffic safety hazards; constructing an early warning level interval table based on the risk judgment result for key vehicle traffic safety hazards; processing real-time data and outputting real-time vehicle early warning results. This invention achieves stable judgment and graded early warning of key vehicle traffic safety hazards.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of road traffic safety management technology, and in particular to a method for classifying and grading early warning of traffic safety hazards of key vehicles on highways. Background Technology

[0002] With the continuous growth of highway traffic flow, the complexity of vehicle types and the differentiation of driving behaviors are becoming increasingly apparent, and key vehicles have become a significant factor inducing traffic accidents and operational risks. Existing highway traffic management systems typically rely on fixed rules or single indicators to identify vehicle risks, making it difficult to systematically and meticulously characterize traffic safety hazards, resulting in coarse-grained and insufficiently adaptable risk identification results.

[0003] In existing technologies, the analysis of illegal or high-risk vehicles often relies on historical statistical thresholds or simple feature overlay methods. The determination of vehicle risk status is often based on isolated indicators or static models, lacking a characterization of the structural relationships between multidimensional risk factors. At the same time, historical data analysis and real-time operational status are often disconnected, making it impossible to maintain the consistency and stability of risk assessment results under different traffic environments and operating conditions, which can easily lead to misjudgments or fluctuations in warning levels.

[0004] In addition, existing early warning methods rely heavily on experience-based level ranges or manual rules in the risk classification process, lacking a systematic mapping mechanism with historical risk distribution. The objectivity and interpretability of the early warning results are insufficient, making it difficult to support continuous monitoring, dynamic early warning and refined management of key vehicles in highway scenarios.

[0005] Therefore, how to provide a method for classifying and classifying traffic safety hazards of key vehicles on highways is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] One objective of this invention is to propose a method for classifying and grading early warning of traffic safety hazards involving key vehicles on highways. This invention constructs a hierarchical risk task prior structure based on a risk indicator set, structured sample context representation, and a TabPFN model. It also incorporates operational situation context information to modulate the task prior distribution, enabling the identification of key vehicle types, prediction of risk levels, and generation of risk profiles. Simultaneously, it performs stabilization mapping processing based on historical sample risk level distribution statistics to form an early warning level interval table, and achieves consistent real-time early warning output based on real-time standardized indicator input representation. This invention can maintain the stability of risk judgment and grading rules under different operational situations, improving the accuracy, interpretability, and engineering feasibility of risk analysis for traffic safety hazards involving key vehicles.

[0007] A method for classifying and classifying traffic safety hazards of key vehicles on highways according to an embodiment of the present invention includes the following steps:

[0008] The system acquires a set of data on vehicles operating on highways, processes it to obtain the statistical results of the risk level distribution of historical samples and the context information of the operating status, and constructs a set of risk indicators. It then performs numerical normalization and categorical one-hot coding to obtain historical standardized indicator input representations and real-time standardized indicator input representations.

[0009] The historical standardized indicator input representation is divided into indicator group structured context input structure according to the dimension of the risk indicator set, and mapped to dimension context representation to obtain structured sample context representation;

[0010] The TabPFN model is invoked and improved to construct a hierarchical risk task prior structure. The structured sample context representation is input to complete the condition binding and generate a hierarchical task inference structure.

[0011] The operational situation context information is mapped to a priori modulation context representation, input into the hierarchical task inference structure, and modulation processing is performed to obtain the priori modulation TabPFN model.

[0012] The structured sample context representation is input into the prior modulated TabPFN model to perform conditional inference processing, and the output is the risk assessment result of traffic safety hazards of key vehicles;

[0013] Based on the risk assessment results of key vehicle traffic safety hazards and the statistical results of historical sample risk level distribution, a stabilization mapping process is performed to determine the warning level interval table;

[0014] Based on the real-time standardized indicator input representation, a real-time structured sample context representation is constructed. The input prior modulated TabPFN model performs conditional inference processing to generate real-time risk assessment results for key vehicle traffic safety hazards. The warning level is determined according to the warning level interval table, and real-time vehicle warning output results are generated.

[0015] Optionally, the generation of the historical standardized indicator input representation and the real-time standardized indicator input representation includes:

[0016] Acquire a set of vehicle data on highways, the set of vehicle data including a subset of historical data and a subset of real-time data, both of which include vehicle identification information and risk indicator data;

[0017] Vehicle identification information is read from historical and real-time data subsets to obtain corresponding risk indicator data;

[0018] Based on risk indicator data, a risk indicator set for key vehicles on highways is constructed according to five dimensions: driver information, historical violations, historical accidents, vehicle condition, and recent operation.

[0019] Based on the differences in the semantic expression of risk indicator data, it is divided into numerical risk indicator data and categorical risk indicator data.

[0020] For the labeled data types, numerical risk indicator data is normalized to a uniform numerical range, and categorical risk indicator data is one-hot encoded to convert it into a vectorized representation corresponding to the discrete state.

[0021] The processed risk indicator data is combined according to the five dimensions of the risk indicator set to form a historical standardized indicator input representation, and a real-time standardized indicator input representation is formed simultaneously.

[0022] Based on a subset of historical data, the distribution of risk levels of key vehicles in the historical samples is statistically analyzed to form a statistical result of the risk level distribution of historical samples. Based on a subset of real-time data, the vehicle operating time, road operating status and traffic load status are extracted to form operational context information.

[0023] Optionally, the generation of the structured sample context representation includes:

[0024] Based on the historical standardized indicator input representation, the risk indicator data in the risk indicator set is aggregated according to the five dimensions of the risk indicator set, so that each dimension forms a set of dimension-level risk indicator data.

[0025] For each set of dimensional risk indicator data, a joint representation construction process is performed to merge all risk indicator data within the same dimension into the corresponding dimensional context representation.

[0026] After completing the construction of the dimension context representation, a hierarchical relationship is established between the dimension context representation and the indicator representation within that dimension to form a structured context input structure for the indicator group.

[0027] The structured context input, consisting of context representations of each dimension and their corresponding indicator groups, is organized into a structured sample context representation.

[0028] Optionally, the generation of the hierarchical task inference structure includes:

[0029] In the TabPFN model, a priori task for identifying key vehicle hazard types is constructed based on structured sample context representation, key vehicle type spatial constraints are applied, and type constraint context is generated.

[0030] Based on type constraint context, a priori task for mapping the risk levels of key vehicles is constructed, and the mapping relationship of traffic safety risk levels is modeled.

[0031] The prior knowledge of identifying the types of hidden dangers of key vehicles and the prior knowledge of mapping the levels of hidden dangers of key vehicles are organized in sequence into a hierarchical risk task prior structure.

[0032] The structured sample context representation is input into the hierarchical risk task prior structure to complete the conditional binding between the hierarchical risk task prior structure and the structured sample context representation, thereby generating the hierarchical task inference structure.

[0033] Optionally, the generation of the prior modulation TabPFN model includes:

[0034] Based on operational context information, a priori modulation context representation is constructed to characterize the overall situational impact of the highway operating environment on the inference of traffic safety hazard risks.

[0035] The prior modulation context representation is input into the hierarchical task inference structure and bound to the task prior distribution parameters corresponding to the hierarchical risk task prior structure;

[0036] Modulation processing is performed on the corresponding task prior distribution in the hierarchical risk task prior structure based on the prior modulation context representation;

[0037] The task prior distribution parameters after modulation processing are written into the task prior parameter space of the TabPFN model, replacing the task prior distribution parameters before modulation processing, and solidified into a prior modulated TabPFN model.

[0038] Optionally, the generation of the risk assessment results for key vehicle traffic safety hazards includes:

[0039] The structured sample context representation is input into the prior modulated TabPFN model, and the condition inference processing is performed based on the modulated hierarchical risk task prior structure. The results of the key vehicle hidden danger type discrimination and the key vehicle hidden danger level prediction are output respectively.

[0040] After completing the conditional inference process, the structured sample context representation remains unchanged. The context representation of each dimension is used as the dimension-level input. Combined with the prediction results of the risk level of key vehicles, the influence of the prior modulated TabPFN model on the risk level prediction results is analyzed to obtain the dimension contribution correlation information.

[0041] The contribution information of each dimension is organized in a unified manner to generate a risk profile result.

[0042] The results of identifying the types of key vehicle hazards, predicting the level of key vehicle hazards, and creating risk profiles are structured and encapsulated to generate risk assessment results for traffic safety hazards of key vehicles.

[0043] Optionally, the determination of the warning level interval table includes:

[0044] Based on the statistical results of risk level distribution of historical samples, a historical distribution reference structure is constructed according to the sample distribution density and cumulative distribution of each key vehicle hazard level in the historical samples.

[0045] While keeping the historical distribution reference structure unchanged, the prediction results of the hidden danger level of key vehicles are mapped to the corresponding location interval in the historical distribution reference structure to determine the relative interval range;

[0046] Based on the predetermined interval division rules in the historical distribution reference structure, the relative interval range is converted into warning level intervals to form a warning level interval table;

[0047] Within a continuous condition inference period, the same warning level interval table is used to perform warning level mapping processing on the prediction results of the hidden danger level of key vehicles.

[0048] Optionally, the generation of the real-time vehicle warning output result includes:

[0049] The real-time standardized indicator input is divided according to the five dimensions of the risk indicator set, and a real-time structured sample context representation is generated based on the same construction rules as the structured sample context representation.

[0050] While keeping the prior modulated TabPFN model structure unchanged, the real-time structured sample context representation is used as the input for conditional inference. The input is then used to perform conditional inference processing on the prior modulated TabPFN model to generate real-time key vehicle hazard type discrimination results, real-time key vehicle hazard level prediction results, and real-time risk profile results.

[0051] Input the real-time key vehicle hazard level prediction results into the warning level interval table, perform warning level mapping processing, and determine the warning level corresponding to the real-time key vehicle.

[0052] The results of real-time identification of key vehicle hazard types, warning levels, and real-time risk profiles are structured and integrated to form real-time vehicle warning output results.

[0053] The beneficial effects of this invention are:

[0054] First, this invention constructs a risk indicator set and introduces a structured sample context representation to uniformly model the traffic safety hazard risk status of vehicles operating on highways across five dimensions: driver information, historical violations, historical accidents, vehicle conditions, and recent operating conditions. This allows risk information to no longer participate in the analysis as discrete indicators, but rather as a hierarchical context structure for inference, thereby effectively improving the overall consistency and stability of the classification and risk identification of key vehicles.

[0055] Secondly, a hierarchical risk task prior structure is constructed in the TabPFN model, and the sequential relationship between the prior of the key vehicle hidden danger type discrimination task and the prior of the key vehicle hidden danger level mapping task is clarified. This enables the risk level prediction to be inferred under the vehicle type constraint, avoiding the judgment bias caused by the independence of type and level in the traditional multi-task model, and significantly enhancing the reliability and rationality of the risk level prediction results.

[0056] Furthermore, operational situation context information is introduced and mapped into a prior modulated context representation. Modulation processing is performed on the task prior distribution in the hierarchical risk task prior structure, so that the context representation of the same structured sample presents differentiated inference results under different operational situations, thereby improving the adaptability of traffic safety hazard risk analysis to changes in the real-time operating environment of highways.

[0057] Finally, by combining the statistical results of the risk level distribution of historical samples and performing stabilization mapping, a fixed warning level interval table is formed and consistently used in the real-time inference process. This achieves the stability and repeatability of the warning level determination rules, ensuring the timeliness of real-time warnings while avoiding the subjective problems caused by empirical threshold adjustments. This improves the engineering feasibility and application credibility of the classification and grading warning analysis of key vehicles on highways. Attached Figure Description

[0058] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0059] Figure 1 This is an overall flowchart of a method for classifying and grading early warning of traffic safety hazards of key vehicles on highways, as proposed in this invention.

[0060] Figure 2 This is a schematic diagram illustrating the construction of the structured sample context representation and the structured context input structure of the index group in this invention;

[0061] Figure 3 This is a schematic diagram of the hierarchical risk task prior structure and prior modulation mechanism in this invention. Detailed Implementation

[0062] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0063] refer to Figure 1-3 A method for classifying and grading traffic safety hazards of key vehicles on highways, comprising the following steps:

[0064] A dataset of vehicles operating on highways is acquired, comprising historical and real-time data subsets. Both subsets include vehicle identification information and risk indicator data. The risk indicator data is used to quantitatively characterize the traffic safety hazard risk status of vehicles operating on highways across five dimensions: driver information, historical violations, historical accidents, vehicle condition, and recent operating conditions. Based on this risk indicator data, a risk indicator set for key vehicles on highways is constructed. This set comprises dimensions of driver information, historical violations, historical accidents, vehicle condition, and recent operating conditions. Numerical normalization and categorical one-hot encoding are performed on the risk indicator data corresponding to the risk indicator set to obtain historical and real-time standardized indicator input representations. Furthermore, statistical results of the historical sample risk level distribution are obtained based on the historical data subset, and operational context information is extracted from the real-time data subset.

[0065] The historical standardized indicator input representation is divided into indicator group structured context input structure according to the five dimensions of the risk indicator set. Each dimension is mapped to a dimension context representation, and a hierarchical relationship is established between the dimension context representation and the indicator representation within that dimension to obtain the structured sample context representation.

[0066] The TabPFN model is invoked and improved, and a hierarchical risk task prior structure is constructed in the TabPFN model. The hierarchical risk task prior structure consists of the prior of the key vehicle hidden danger type discrimination task and the prior of the key vehicle hidden danger level mapping task. The structured sample context representation is input into the TabPFN model to complete the condition binding of the hierarchical risk task prior structure and generate the hierarchical task inference structure.

[0067] The runtime context information is mapped to a prior modulation context representation. The prior modulation context representation is input into the hierarchical task inference structure. Modulation processing is performed on the prior task distribution inside the TabPFN model to obtain the prior modulation TabPFN model.

[0068] The structured sample context representation is input into the prior modulated TabPFN model to perform conditional inference processing, and the output is the risk assessment result of key vehicle traffic safety hazards, including the key vehicle hazard type identification result, the key vehicle hazard level prediction result, and the risk profile result. The risk profile result is used to characterize the contribution and correlation information of the five dimensions of the risk indicator set to the prediction of the traffic safety hazard risk level.

[0069] Based on the prediction results of the risk level of key vehicles in the risk assessment results of key vehicle traffic safety hazards and the statistical results of the risk level distribution of historical samples, a stabilization mapping process is performed to determine the warning level interval table. The warning level interval table is used to characterize the range of key vehicle hazard level values ​​corresponding to each warning level.

[0070] The real-time standardized indicators are input to construct a real-time structured sample context representation according to the five dimensions of the risk indicator set. The real-time structured sample context representation is then input into the prior modulated TabPFN model to perform conditional inference processing, and the real-time key vehicle traffic safety hazard risk judgment results are output, including the real-time key vehicle hazard type discrimination results, the real-time key vehicle hazard level prediction results, and the real-time risk profile results. Based on the warning level interval table, the real-time key vehicle hazard level prediction results are used to determine the warning level, and the real-time vehicle warning output results are output. The real-time vehicle warning output results include the real-time key vehicle hazard type discrimination results, the warning level, and the real-time risk profile results.

[0071] In this embodiment, the generation of the historical standardized indicator input representation and the real-time standardized indicator input representation includes:

[0072] Acquire a set of vehicle data on highways, the set of vehicle data including a subset of historical data and a subset of real-time data, both of which include vehicle identification information and risk indicator data;

[0073] The risk indicator data is not directly derived from the original collected data, but is generated based on the original data of vehicles operating on the highway through preset risk quantification calculation rules. The risk quantification calculation rules are set for five dimensions: driver information, historical violations, historical accidents, vehicle conditions, and recent operating conditions, and are used to convert the original data into risk indicator data with a unified semantic meaning.

[0074] Among them, the risk indicator data for the driver information dimension is obtained by rule-based calculation of the driver's basic information and historical behavior records, and is used to characterize the degree of influence of the driver on traffic safety hazard risks; the risk indicator data for the historical violation dimension is obtained by statistical and quantitative processing of the vehicle's associated historical violation records, and is used to characterize the impact of past violations on the current risk status; the risk indicator data for the historical accident dimension is obtained by rule-based transformation of the vehicle or driver's associated historical accident records, and is used to characterize the cumulative effect of accident experience on traffic safety hazard risks; the risk indicator data for the vehicle condition dimension is obtained by quantitative processing of raw data such as vehicle technical condition, service life, and registration information, and is used to characterize the impact of the vehicle's own conditions on the risk status; the risk indicator data for the recent operation dimension is obtained by rule-based calculation of the vehicle's recent operation behavior and related operating environment data, and is used to characterize the immediate impact of short-term operation status on traffic safety hazard risks;

[0075] Vehicle identification information is read from historical and real-time data subsets, and corresponding risk indicator data is obtained based on the vehicle identification information. The risk indicator data is then collected according to the five dimensions of the risk indicator set, so that each vehicle operating on the highway corresponds to a complete set of risk indicator data.

[0076] Based on the risk indicator data collected according to the five dimensions of the risk indicator set, a risk indicator set for key vehicles on highways is constructed according to the five dimensions of driver information, historical violations, historical accidents, vehicle condition, and recent operation. Each risk indicator set corresponds to a vehicle operating on the highway, and each dimension in the risk indicator set contains risk indicator data corresponding to that dimension, which is used to uniformly characterize the traffic safety hazard risk status of the vehicle.

[0077] Based on the differences in the semantic expression of risk indicator data, risk indicator data is divided into numerical risk indicator data and categorical risk indicator data. Numerical risk indicator data is risk indicator data with a continuous range of numerical values, while categorical risk indicator data is risk indicator data with a discrete value state. Numerical risk indicator data and categorical risk indicator data are marked as different data types.

[0078] For the labeled data types, numerical normalization is performed on numerical risk indicator data to map it to a unified numerical range, and categorical one-hot encoding is performed on categorical risk indicator data to convert it into a vectorized representation corresponding to discrete states.

[0079] After completing numerical normalization and categorical one-hot coding, the risk indicator data are combined according to the five dimensions of the risk indicator set to form a historical standardized indicator input representation corresponding to the historical data subset, and a real-time standardized indicator input representation corresponding to the real-time data subset is formed simultaneously.

[0080] Based on the historical standardized indicator input, the corresponding historical data subset is used to statistically analyze the distribution of the risk level of each key vehicle in the historical sample, forming a statistical result of the risk level distribution of the historical sample. Based on the real-time data subset, the vehicle running time, road running status and traffic load status are extracted to form the operational situation context information.

[0081] In this embodiment, the generation of the structured sample context representation includes:

[0082] Based on the historical standardized indicator input representation, the risk indicator data in the risk indicator set is aggregated according to the five dimensions of the risk indicator set, so that each dimension forms a set of dimension-level risk indicator data.

[0083] For each set of dimensional risk indicator data, joint representation construction processing is performed to integrate all risk indicator data within the same dimension into the corresponding dimensional context representation, so that each dimensional context representation can be used to represent the overall traffic safety hazard risk status under that dimension.

[0084] After completing the construction of the dimension context representation, a hierarchical relationship is established between the dimension context representation and the indicator representation corresponding to the risk indicator data within that dimension. This allows the dimension context representation to enter the subsequent inference process structurally before the indicator representation, thus forming a structured context input structure for the indicator group.

[0085] The structured context input structure, consisting of context representations of each dimension and their corresponding indicator representations, is organized into a structured sample context representation for subsequent condition binding and inference processing of the prior structure of the hierarchical risk task.

[0086] In this embodiment, the generation of the hierarchical task inference structure includes:

[0087] In the TabPFN model, a prior for the key vehicle hazard type discrimination task is constructed based on the structured sample context representation. This prior is then used to constrain the key vehicle type space of the structured sample context representation, generating a type constraint context.

[0088] In this context, the type space constraint of the key vehicle hazard type discrimination task prior on the structured sample context representation does not act on the original input data layer, nor does it directly limit the final output result. Instead, it acts on the intermediate inference stage in the hierarchical risk task prior structure. Specifically, in the conditional inference process, the key vehicle hazard type discrimination task prior first performs prior constraint modeling on the key vehicle type corresponding to the structured sample context representation, and forms a type constraint context based on the prior constraint. The type constraint context is used to limit the effective state space of the key vehicle hazard level mapping task prior, so that the subsequent risk level mapping is only carried out within the risk level state range that is consistent with the constrained vehicle type, thereby avoiding the participation of risk level mapping that does not conform to the characteristics of the vehicle type in the inference process.

[0089] After completing the prior construction of the key vehicle hidden danger type identification task, the key vehicle hidden danger level mapping task prior is constructed based on the type constraint context, so that the key vehicle hidden danger level mapping task prior models the mapping relationship of traffic safety hidden danger risk level under type constraint conditions.

[0090] The priors for identifying the types of hidden dangers of key vehicles and mapping the levels of hidden dangers of key vehicles are organized in a hierarchical risk task prior structure, so that the priors for identifying the types of hidden dangers of key vehicles participate in the conditional inference process of the TabPFN model in a structural manner before the priors for mapping the levels of hidden dangers of key vehicles.

[0091] The structured sample context representation is input into the hierarchical risk task prior structure to complete the conditional binding between the hierarchical risk task prior structure and the structured sample context representation, generating the hierarchical task inference structure for subsequent prior modulation and conditional inference processing.

[0092] In this embodiment, the generation of the priori modulation TabPFN model includes:

[0093] Based on operational situation context information, a priori modulation context representation is constructed. The operational situation context information consists of vehicle operating time, road operating status and traffic load status, so that the priori modulation context representation can be used to characterize the overall situational impact of the highway operating environment on the inference of traffic safety hazard risks.

[0094] The process of constructing the prior modulation context representation includes: performing time period state encoding on the vehicle running segment in the operational situation context information, performing road state encoding on the road operating state, performing load state encoding on the traffic load state, combining the time period state encoding corresponding to the vehicle running segment, the road state encoding corresponding to the road operating state, and the load state encoding corresponding to the traffic load state to form an operational situation combined representation, performing prior mapping processing based on the operational situation combined representation to generate a prior modulation context representation for modulating the prior distribution of tasks in the hierarchical risk task prior structure;

[0095] The prior modulation context representation is input into the hierarchical task inference structure, and the prior modulation context representation is bound to the task prior distribution parameters corresponding to the hierarchical risk task prior structure, so that the prior modulation context representation is not used as a component of the structured sample context representation in the inference input.

[0096] Based on the prior modulation context representation, the prior distribution of the task prior corresponding to the key vehicle hidden danger type discrimination task prior and the key vehicle hidden danger level mapping task prior in the hierarchical risk task prior structure is modulated so that the same structured sample context representation corresponds to different task prior distribution states under different operating conditions.

[0097] The task prior distribution parameters corresponding to the key vehicle hidden danger type discrimination task prior and the key vehicle hidden danger level mapping task prior after the modulation processing are written into the task prior parameter space of the TabPFN model, replacing the task prior distribution parameters before the modulation processing. The TabPFN model with the completed parameter writing is solidified into a prior modulated TabPFN model, and the prior modulated TabPFN model is used as the inference model input for subsequent conditional inference processing.

[0098] In this embodiment, the generation of the risk assessment result for key vehicle traffic safety hazards includes:

[0099] The structured sample context representation is input into the prior modulated TabPFN model. In the prior modulated TabPFN model, condition inference processing is performed based on the modulated hierarchical risk task prior structure. The model outputs the key vehicle hazard type discrimination result and the key vehicle hazard level prediction result corresponding to the structured sample context representation. The key vehicle hazard type discrimination result is used to characterize the key vehicle category corresponding to the current structured sample context representation, and the key vehicle hazard level prediction result is used to characterize the risk level value of the corresponding vehicle.

[0100] After completing the conditional inference process, the structured sample context representation is kept unchanged. Each dimension of the structured sample context representation is used as a dimension-level input. Combined with the prediction results of the risk level of key vehicles, the influence of each dimension of the context representation on the risk level prediction results in the conditional inference process of the prior modulated TabPFN model is analyzed to obtain the dimension contribution correlation information corresponding to each dimension of the context representation.

[0101] The correlation analysis is not a post-analysis independent of the model inference process, but rather based on the intermediate inference state formed during the conditional inference process of the prior modulated TabPFN model. Specifically, while keeping the structured sample context representation unchanged, the relative influence of each dimension's context representation on the prediction results of the risk level of key vehicles is analyzed during the conditional inference process to obtain the dimensional contribution correlation information corresponding to each dimension's context representation. The dimensional contribution correlation information uses the dimension as the basic analysis unit to characterize the relative strength of the influence of different dimensional context representations in the risk level prediction process. The result is a quantitative representation or sequential relationship that reflects the degree of contribution of each dimension to the risk level prediction results, so that the risk profile results are reflected as a dimensional contribution structure, rather than an isolated interpretation of a single risk indicator.

[0102] The contribution and correlation information of the driver information dimension, historical violation dimension, historical accident dimension, vehicle condition dimension and recent operation dimension are uniformly organized to generate risk profile results. The risk profile results represent the contribution and correlation of the five dimensions of the risk indicator set in the prediction results of the key vehicle hidden danger level, with the dimensions as the basic unit.

[0103] The results of identifying the types of key vehicle hazards, predicting the level of key vehicle hazards, and creating risk profiles are encapsulated in a structured manner to generate risk assessment results for key vehicle traffic safety hazards that correspond one-to-one with the structured sample context representation, for use in subsequent stabilization mapping processing and real-time early warning output.

[0104] In this embodiment, the determination of the warning level interval table includes:

[0105] Based on the statistical results of the risk level distribution of historical samples, according to the sample distribution density and cumulative distribution of each key vehicle hazard level in the historical samples, a historical distribution reference structure for traffic safety hazard risk levels is constructed so that the historical distribution reference structure can be used to characterize the stable distribution state of different risk levels in the overall sample space in the historical samples.

[0106] While keeping the historical distribution reference structure unchanged, the prediction results of the key vehicle hidden danger level are mapped to the corresponding position interval in the historical distribution reference structure, and the relative interval range of the prediction results of the key vehicle hidden danger level in the historical distribution is determined based on the mapped position.

[0107] Based on the predetermined interval division rules in the historical distribution reference structure, the relative interval range corresponding to the prediction results of the key vehicle hidden danger level is converted into the warning level interval, and a warning level interval table is formed accordingly, so that the warning level interval table clearly represents the value range of the key vehicle hidden danger level corresponding to each warning level.

[0108] The interval division rules are not based on human experience or rely on manual threshold adjustments. Instead, they are automatically generated from the statistical results of historical sample risk level distribution. Specifically, based on the overall distribution of the predicted risk levels of key vehicles in historical samples, the risk level value space in the historical distribution reference structure is statistically analyzed. Stable interval division positions are determined based on the distribution density changes and cumulative distribution characteristics of each risk level in historical samples, thus forming the interval division rules. These interval division rules are solidified and saved as part of the historical distribution reference structure after generation and remain unchanged during subsequent conditional inference processes. This ensures that the mapping process from the predicted risk levels of key vehicles to the warning levels is always based on the same distribution benchmark, thereby avoiding frequent changes in warning levels due to real-time data fluctuations or human intervention.

[0109] Within a continuous inference period, the same warning level interval table is used to perform warning level mapping processing on the prediction results of the hidden danger level of key vehicles, so as to ensure the consistency and stability of the rules for determining the warning level in different inference periods.

[0110] In this embodiment, the generation of the real-time vehicle warning output result includes:

[0111] The real-time standardized indicator input representation is divided into five dimensions of the risk indicator set. Based on the same construction rules as the structured sample context representation, the real-time standardized indicator input representation corresponding to each dimension is mapped to the dimension context representation. A hierarchical relationship consistent with the structured sample context representation is established between the dimension context representation and the indicator representation within that dimension, thereby generating the real-time structured sample context representation.

[0112] While keeping the prior modulated TabPFN model structure unchanged, the real-time structured sample context representation is used as the input for conditional inference. The prior modulated TabPFN model is then used to perform conditional inference processing, generating real-time key vehicle hazard type discrimination results, real-time key vehicle hazard level prediction results, and real-time risk profile results corresponding to the real-time structured sample context representation.

[0113] Input the real-time key vehicle hidden danger level prediction results into the warning level interval table. Based on the correspondence between the key vehicle hidden danger level value range and the warning level determined in the warning level interval table, perform the warning level mapping process to determine the warning level corresponding to the real-time key vehicle.

[0114] The results of real-time identification of key vehicle hazard types, warning levels, and real-time risk profiles are structured and integrated to form real-time vehicle warning output results, which are used to characterize the traffic safety hazard risk status of vehicles operating on highways under the current operating conditions.

[0115] Example 1:

[0116] To verify the feasibility of this invention in practice, it was applied to a key vehicle classification and grading early warning analysis task in a highway operation management scenario. In this scenario, the highway management system needs to identify, grade, and issue early warnings for continuously operating vehicles without increasing the intensity of manual intervention, in order to solve the problems of single risk identification dimensions, unstable early warning thresholds, insufficient interpretability, and poor consistency in real-time applications in existing technologies.

[0117] In this application scenario, vehicles operating on highways continuously generate a dataset of operational vehicle data, which consists of a historical data subset and a real-time data subset. The historical data subset includes vehicle identification information and risk indicator data. The risk indicator data covers five dimensions: driver information, historical violations, historical accidents, vehicle condition, and recent operating status, used to quantify the long-term traffic safety risks posed by vehicles. The real-time data subset also contains vehicle identification information and risk indicator data, reflecting the immediate risk status of vehicles under their current operating conditions. The system continuously receives and maintains these datasets in the background, ensuring that each vehicle operating on the highway can generate a complete and continuous risk data description.

[0118] In practical applications, the system constructs a risk indicator set based on the operational vehicle dataset and performs numerical normalization and categorical one-hot encoding on the risk indicator data to form historical and real-time standardized indicator input representations. Through this processing method, risk indicator data with different dimensions and value spaces are uniformly mapped to a comparable data representation space, providing stable input for subsequent structured modeling. Based on this, the system aggregates the historical standardized indicator input representations according to the five dimensions of the risk indicator set, jointly mapping the risk indicator data within each dimension to a dimension context representation. A hierarchical relationship is established between the dimension context representation and the indicator representations within each dimension, thereby constructing a structured sample context representation. This ensures that risk information reflects the dimensional hierarchy and internal relationships at the input structure level.

[0119] During the risk inference phase, the system constructs a hierarchical risk task prior structure within the TabPFN model. The prior for identifying key vehicle hazard types is placed upstream in this structure to impose type space constraints on the structured sample context representation. Then, under these type constraints, a prior for mapping key vehicle hazard levels is constructed, establishing an intrinsic link between the risk level inference process and the vehicle type identification results. Once this hierarchical risk task prior structure and the structured sample context representation are conditionally bound, a stable hierarchical task inference structure is formed, providing a foundation for subsequent dynamic modulation.

[0120] To address the issue of the distinct time-varying and situational changes in the highway operating environment, the system further utilizes vehicle operating time, road operating status, and traffic load status to construct operational situation context information, which is then mapped into a priori modulated context representation. This priori modulated context representation is not used as ordinary input features for inference; instead, it is used to modulate the task prior distribution in the hierarchical risk task prior structure. This allows the same structured sample context representation to correspond to different risk inference biases under different operational situation conditions, thus obtaining the priori modulated TabPFN model. After performing conditional inference processing based on this model, the system outputs the risk assessment results for key vehicle traffic safety hazards. These results include key vehicle hazard type identification results, key vehicle hazard level prediction results, and risk profile results. The risk profile results use dimensions as the basic unit, representing the contribution and correlation of five risk dimensions in risk level prediction.

[0121] During the early warning output phase, the system constructs a historical distribution reference structure based on the statistical results of historical sample risk level distributions, maintaining stability within a continuous inference period. It maps the predicted risk levels of key vehicles to the corresponding historical distribution intervals, forming an early warning level interval table. This interval table is used consistently during real-time applications, thus avoiding early warning fluctuations caused by frequent threshold adjustments. Real-time standardized indicator inputs are represented by a real-time structured sample context representation constructed according to rules consistent with the historical phase. This representation is then input into a priori modulated TabPFN model for conditional inference processing, ultimately outputting real-time vehicle early warning results to support highway operation and management decisions.

[0122] In this implementation process, the traditional rule-based threshold method and the conventional machine learning classification method were compared to conduct traffic safety hazard risk analysis on the same batch of operating vehicle data, and the following experimental data comparison results were obtained.

[0123] Table 1. Comparison of the effects of classification and early warning analysis on key vehicles on highways.

[0124] Accuracy of key vehicle identification 0.71 0.78 0.83 Consistency rate of risk level assessment 0.68 0.75 0.81 Early warning level stability rate 0.64 0.72 0.86 High-risk vehicle recall rate 0.66 0.73 0.79 The warning results can explain the coverage. 0.30 0.45 0.85 Continuous periodic early warning volatility 0.22 0.18 0.09

[0125] As shown in Table 1, the traditional rule-based threshold method performs relatively poorly in terms of accuracy in identifying key vehicles and consistency in risk level determination. This is mainly because the method relies on fixed empirical rules, making it difficult to simultaneously consider the correlations between multi-dimensional risk information, and its warning level fluctuates significantly with changes in operational status. Conventional machine learning methods have improved accuracy and recall, but due to the lack of structured input modeling and a stable risk classification mapping mechanism, the stability of warning levels and interpretability coverage remain limited.

[0126] In comparison, the method of this invention achieves reasonable improvements in both the accuracy of key vehicle identification and the consistency rate of risk level determination, with the improvement remaining within an acceptable range for engineering purposes and without any abnormally exaggerated effects. Simultaneously, the stability rate of warning levels is significantly improved, and the volatility of continuous periodic warnings is significantly reduced, indicating that the stabilization mapping mechanism constructed using historical sample risk level distribution statistics effectively suppresses the instability of warnings caused by short-term data disturbances. Regarding interpretability, this invention uses dimensional risk profiling results to correlate and characterize risk level predictions, enabling the warning results to clearly reflect the contribution of different risk dimensions, thereby significantly improving the understandability and verifiability of the warning results.

[0127] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for classifying and grading traffic safety hazards of key vehicles on highways, characterized in that, Includes the following steps: The system acquires a set of data on vehicles operating on highways, processes it to obtain the statistical results of the risk level distribution of historical samples and the context information of the operating status, and constructs a set of risk indicators. It then performs numerical normalization and categorical one-hot coding to obtain historical standardized indicator input representations and real-time standardized indicator input representations. The historical standardized indicator input representation is divided into indicator group structured context input structure according to the dimension of the risk indicator set, and mapped to dimension context representation to obtain structured sample context representation; The TabPFN model is invoked and improved to construct a hierarchical risk task prior structure. The structured sample context representation is input to complete the condition binding and generate a hierarchical task inference structure. The operational situation context information is mapped to a priori modulation context representation, input into the hierarchical task inference structure, and modulation processing is performed to obtain the priori modulation TabPFN model. The structured sample context representation is input into the prior modulated TabPFN model to perform conditional inference processing, and the output is the risk assessment result of traffic safety hazards of key vehicles; Based on the risk assessment results of key vehicle traffic safety hazards and the statistical results of historical sample risk level distribution, a stabilization mapping process is performed to determine the warning level interval table; Based on the real-time standardized indicator input representation, a real-time structured sample context representation is constructed. The input prior modulated TabPFN model is used to perform conditional inference processing, generate real-time key vehicle traffic safety hazard risk assessment results, determine the warning level according to the warning level interval table, and generate real-time vehicle warning output results. The generation hierarchical task inference structure includes: In the TabPFN model, a priori task for identifying key vehicle hazard types is constructed based on structured sample context representation, key vehicle type spatial constraints are applied, and type constraint context is generated. Based on type constraint context, a priori task for mapping the risk levels of key vehicles is constructed, and the mapping relationship of traffic safety risk levels is modeled. The prior knowledge of identifying the types of hidden dangers of key vehicles and the prior knowledge of mapping the levels of hidden dangers of key vehicles are organized in sequence into a hierarchical risk task prior structure. The structured sample context representation is input into the hierarchical risk task prior structure to complete the conditional binding between the hierarchical risk task prior structure and the structured sample context representation, thereby generating the hierarchical task inference structure. The obtained prior modulation TabPFN model includes: Based on operational context information, a priori modulation context representation is constructed to characterize the overall situational impact of the highway operating environment on the inference of traffic safety hazard risks. The prior modulation context representation is input into the hierarchical task inference structure and bound to the task prior distribution parameters corresponding to the hierarchical risk task prior structure; Modulation processing is performed on the corresponding task prior distribution in the hierarchical risk task prior structure based on the prior modulation context representation; The task prior distribution parameters after modulation processing are written into the task prior parameter space of the TabPFN model, replacing the task prior distribution parameters before modulation processing, and solidified into a prior modulated TabPFN model.

2. The method for classifying and grading traffic safety hazards of key vehicles on highways according to claim 1, characterized in that, The generation of the historical standardized indicator input representation and the real-time standardized indicator input representation includes: Acquire a set of vehicle data on highways, the set of vehicle data including a subset of historical data and a subset of real-time data, both of which include vehicle identification information and risk indicator data; Vehicle identification information is read from historical and real-time data subsets to obtain corresponding risk indicator data; Based on risk indicator data, a risk indicator set for key vehicles on highways is constructed according to five dimensions: driver information, historical violations, historical accidents, vehicle condition, and recent operation. Based on the differences in the semantic expression of risk indicator data, it is divided into numerical risk indicator data and categorical risk indicator data. For the labeled data types, numerical risk indicator data is normalized to a uniform numerical range, and categorical risk indicator data is one-hot encoded to convert it into a vectorized representation corresponding to the discrete state. The processed risk indicator data is combined according to the five dimensions of the risk indicator set to form a historical standardized indicator input representation, and a real-time standardized indicator input representation is formed simultaneously. Based on a subset of historical data, the distribution of risk levels of key vehicles in the historical samples is statistically analyzed to form a statistical result of the risk level distribution of historical samples. Based on a subset of real-time data, the vehicle operating time, road operating status and traffic load status are extracted to form operational context information.

3. The method for classifying and grading early warning of traffic safety hazards of key vehicles on highways according to claim 1, characterized in that, The generation of the structured sample context representation includes: Based on the historical standardized indicator input representation, the risk indicator data in the risk indicator set is aggregated according to the five dimensions of the risk indicator set, so that each dimension forms a set of dimension-level risk indicator data. For each set of dimensional risk indicator data, a joint representation construction process is performed to merge all risk indicator data within the same dimension into the corresponding dimensional context representation. After completing the construction of the dimension context representation, a hierarchical relationship is established between the dimension context representation and the indicator representation within that dimension to form a structured context input structure for the indicator group. The structured context input, consisting of context representations of each dimension and their corresponding indicator groups, is organized into a structured sample context representation.

4. The method for classifying and grading early warning of traffic safety hazards of key vehicles on highways according to claim 1, characterized in that, The generation of the risk assessment results for key vehicle traffic safety hazards includes: The structured sample context representation is input into the prior modulated TabPFN model, and the condition inference processing is performed based on the modulated hierarchical risk task prior structure. The results of the key vehicle hidden danger type discrimination and the key vehicle hidden danger level prediction are output respectively. After completing the conditional inference process, the structured sample context representation remains unchanged. The context representation of each dimension is used as the dimension-level input. Combined with the prediction results of the risk level of key vehicles, the influence of the prior modulated TabPFN model on the risk level prediction results is analyzed to obtain the dimension contribution correlation information. The contribution information of each dimension is organized in a unified manner to generate a risk profile result. The results of identifying the types of key vehicle hazards, predicting the level of key vehicle hazards, and creating risk profiles are structured and encapsulated to generate risk assessment results for traffic safety hazards of key vehicles.

5. The method for classifying and grading early warning of traffic safety hazards of key vehicles on highways according to claim 1, characterized in that, The determination of the warning level interval table includes: Based on the statistical results of risk level distribution of historical samples, a historical distribution reference structure is constructed according to the sample distribution density and cumulative distribution of each key vehicle hazard level in the historical samples. While keeping the historical distribution reference structure unchanged, the prediction results of the hidden danger level of key vehicles are mapped to the corresponding location interval in the historical distribution reference structure to determine the relative interval range; Based on the predetermined interval division rules in the historical distribution reference structure, the relative interval range is converted into warning level intervals to form a warning level interval table; Within a continuous condition inference period, the same warning level interval table is used to perform warning level mapping processing on the prediction results of the hidden danger level of key vehicles.

6. The method for classifying and grading traffic safety hazards of key vehicles on highways according to claim 1, characterized in that, The generation of the real-time vehicle warning output includes: The real-time standardized indicator input is divided according to the five dimensions of the risk indicator set, and a real-time structured sample context representation is generated based on the same construction rules as the structured sample context representation. While keeping the prior modulated TabPFN model structure unchanged, the real-time structured sample context representation is used as the input for conditional inference. The input is then used to perform conditional inference processing on the prior modulated TabPFN model to generate real-time key vehicle hazard type discrimination results, real-time key vehicle hazard level prediction results, and real-time risk profile results. Input the real-time key vehicle hazard level prediction results into the warning level interval table, perform warning level mapping processing, and determine the warning level corresponding to the real-time key vehicle. The results of real-time identification of key vehicle hazard types, warning levels, and real-time risk profiles are structured and integrated to form real-time vehicle warning output results.