A method for vehicle safety status recognition and early warning based on the driving trajectory of large vehicles

By combining computer vision and machine learning technologies with YOLOv8, DeepSORT, and SVM classifiers, accurate identification and real-time early warning of the driving trajectory of large vehicles were achieved, solving the blind spots and real-time problems of traditional traffic monitoring systems and reducing the traffic accident rate.

CN118485975BActive Publication Date: 2026-07-31SOUTH CHINA UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SOUTH CHINA UNIV OF TECH
Filing Date
2024-05-24
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Traditional traffic safety monitoring systems suffer from limited monitoring range and poor real-time performance, resulting in low accuracy in identifying the safety status of large vehicles and a high rate of traffic accidents.

Method used

By employing computer vision and machine learning technologies, this method identifies the driving trajectories of large vehicles, detects and tracks vehicles using YOLOv8 and DeepSORT algorithms, and classifies trajectory feature data using an SVM classifier to achieve the identification and early warning of safe and dangerous states.

Benefits of technology

It has improved the accuracy of identifying the driving trajectory of large vehicles and the ability to provide real-time early warning of safety status, reduced the incidence of traffic accidents, filled the blind spots of traditional monitoring systems, and improved the level of road traffic safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118485975B_ABST
    Figure CN118485975B_ABST
Patent Text Reader

Abstract

This invention relates to a method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles. Specifically, it relates to a method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles. The purpose of this invention is to solve the problems of blind spots and poor real-time performance in traditional traffic safety monitoring systems, which lead to low accuracy in vehicle safety status identification and high traffic accident rates. The process is as follows: Step 1: Identify the driving trajectory of large vehicles from video data on highways and output a trajectory feature dataset; Step 2: Classify the trajectory feature dataset into large vehicle categories, dividing them into safe-state samples and dangerous-state samples; Step 3: Obtain a trained SVM classifier based on the safe-state and dangerous-state samples; Step 4: Classify the video data on the highway to be tested using the trained SVM classifier, with the classification result being either a safe-state sample or a dangerous-state sample. If it is a dangerous-state sample, an early warning is issued.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic safety, and more specifically to a method for vehicle safety status recognition and early warning based on the driving trajectory of large vehicles. Background Technology

[0002] Currently, traditional traffic safety monitoring systems mainly rely on manual patrols or fixed camera surveillance, which suffers from limited monitoring range, numerous blind spots, and insufficient real-time performance. Furthermore, most safety monitoring systems for large vehicles are limited to static vehicle information or sensor-based real-time monitoring, failing to achieve dynamic identification and real-time warnings of vehicle trajectories.

[0003] In recent years, with the development of computer vision and deep learning technologies, significant progress has been made in vehicle detection and tracking technologies based on video data. Algorithms such as YOLOv8 and DeepSORT can accurately detect and track vehicles in video data, providing a feasible solution for vehicle trajectory recognition. However, safety status early warning for large vehicles still faces many challenges, including the effective extraction of trajectory data and the accurate judgment of safety status.

[0004] In summary, research on large vehicle trajectory recognition and safety status early warning technologies is of great significance and has broad prospects. This invention aims to overcome the limitations of existing technologies and provide a comprehensive and effective traffic safety solution to ensure safe and smooth road traffic. Summary of the Invention

[0005] The purpose of this invention is to address the problems of blind spots and poor real-time performance in traditional traffic safety monitoring systems, which lead to low accuracy in vehicle safety status identification and high traffic accident rates. Therefore, this invention proposes a vehicle safety status identification and early warning method based on the driving trajectory of large vehicles.

[0006] The specific process of a vehicle safety status recognition and early warning method based on the driving trajectory of large vehicles is as follows:

[0007] Step 1: Identify the video data on the highway, identify the driving trajectories of large vehicles, and output the trajectory feature dataset.

[0008] Step 2: Classify the trajectory feature dataset into large vehicle categories, dividing them into safe-state samples and dangerous-state samples;

[0009] Step 3: Obtain the trained SVM classifier based on safe-state samples and dangerous-state samples;

[0010] Step 4: Classify the video data on the highway to be tested based on the trained SVM classifier. The classification result is either a safe sample or a dangerous sample. If it is a dangerous sample, issue an early warning.

[0011] The beneficial effects of this invention are as follows:

[0012] This invention aims to improve traffic safety and reduce the incidence of traffic accidents by using advanced computer vision and machine learning technologies to accurately identify the driving trajectory of large vehicles and provide real-time early warning of their safety status.

[0013] This invention utilizes advanced computer vision and machine learning technologies to accurately capture and extract the driving trajectory information of large vehicles by analyzing video data from highways. Subsequently, machine learning algorithms are used to classify these trajectory data, categorizing vehicles into safe and hazardous states, thus achieving dynamic identification and classification of vehicle safety status. Furthermore, a trained Support Vector Machine (SVM) classifier enables real-time classification of the video data under test, providing timely warnings of potential dangerous behaviors and effectively reducing the incidence of traffic accidents. This comprehensive solution not only improves traffic safety but also fills the blind spots of traditional traffic monitoring systems, safeguarding road traffic safety and smooth flow, and has significant social implications and broad application prospects. Attached Figure Description

[0014] Figure 1 This is a flowchart of the present invention;

[0015] Figure 2 A rendering of a large vehicle recognition system;

[0016] Figure 3 The image shows a comparison of the effects of different methods in classifying and predicting vehicle safety status. Blue represents the accuracy of the method proposed in this invention in classifying and predicting vehicle safety status, while orange represents the prediction accuracy of the random forest method. Detailed Implementation

[0017] Specific Implementation Method 1: The specific process of this implementation method for vehicle safety status recognition and early warning based on the driving trajectory of large vehicles is as follows:

[0018] Step 1: Identify the video data on the highway, identify the driving trajectories of large vehicles, and output the trajectory feature dataset.

[0019] Step 2: Classify the trajectory feature dataset into large vehicle categories, dividing them into safe-state samples and dangerous-state samples;

[0020] Step 3: Obtain the trained SVM classifier based on safe-state samples and dangerous-state samples;

[0021] Step 4: Classify the video data on the highway to be tested based on the trained SVM classifier. The classification result is either a safe sample or a dangerous sample. If it is a dangerous sample, issue an early warning.

[0022] Specific Implementation Method Two: This implementation method differs from Specific Implementation Method One in that: in step one, video data on the highway is identified to determine the driving trajectory of large vehicles and output a trajectory feature dataset.

[0023] The specific process is as follows:

[0024] Step 11: Obtaining raw video frames: First, obtain continuous video frames from the vehicle driving video. This is the first step in all target tracking algorithms.

[0025] Step 1-2, Target Detection: Use a pre-trained deep learning model (such as YOLO, SSD, etc.) to detect targets in video frames; find all targets in each frame and generate a bounding box for each target (the width, height, and coordinate information of the detection box; calculate the center position of the target based on the width, height, and coordinate information of the detection box).

[0026] The target is a large vehicle;

[0027] The large vehicles are automobiles with a gross vehicle weight greater than 4,500 kg, a length greater than or equal to 6 meters, or a passenger capacity greater than or equal to 20 people.

[0028] Step 13: Use the DeepSort algorithm to process each detected target to form the target's motion trajectory;

[0029] Step 14: Perform coordinate transformation on the motion trajectory of the target to form a large vehicle trajectory feature dataset containing spatiotemporal data. The dataset includes vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, vehicle jerk, vehicle lateral offset, etc.; speed, acceleration, jerk, lateral offset and their respective square and fourth powers, 12 features.

[0030] The other steps and parameters are the same as in Specific Implementation Method 1.

[0031] Specific Implementation Method Three: This implementation method differs from Specific Implementation Method One or Two in that: in steps one and three, the DeepSort algorithm is used to process each detected target and form the target's motion trajectory; the specific process is as follows:

[0032] Step 131, Feature Extraction:

[0033] Extract features from the bounding box of each detected target, including appearance features and motion features, for subsequent target matching and tracking;

[0034] The apparent features include color, texture, etc.

[0035] The motion characteristics include speed, acceleration, etc.

[0036] Step 132, Target Matching: Use a Kalman filter to predict the position of each target in the next frame, and use the Hungarian algorithm and cascaded matching algorithm to find the same targets in the previous and next frames, and assign a unique ID to each target;

[0037] The goal of this step is to find the correspondence of the same target in each frame and assign a unique ID to each tracked target;

[0038] Step 133, Target Tracking: Based on the matching results, connect the same targets in each frame to form the target's motion trajectory (position, time, and vehicle number), thereby achieving multi-target tracking;

[0039] The advantages of the DeepSort algorithm lie in its combination of the high accuracy of deep learning models for target detection, the high robustness of Kalman filters for target state prediction, and the efficiency of the Hungarian algorithm for data association, achieving a good balance between accuracy and real-time performance. Furthermore, the DeepSort algorithm is simple to implement, computationally efficient, meets real-time requirements, and is suitable for multi-target tracking tasks in various scenarios.

[0040] Other steps and parameters are the same as in specific implementation method one or two.

[0041] Specific Implementation Method Four: This implementation method differs from Specific Implementation Methods One to Three in that the process for acquiring vehicle speed, vehicle acceleration, vehicle jerk, and vehicle lateral offset features in steps one and four is as follows:

[0042] Calculate vehicle speed, vehicle acceleration, vehicle jerk, and vehicle lateral offset based on vehicle position coordinates and time.

[0043] The other steps and parameters are the same as those in one of the specific implementation methods one to three.

[0044] Specific Implementation Method Five: This implementation method differs from Specific Implementation Methods One to Four in that the coordinate transformation process for the formed target's motion trajectory in step one to four is as follows:

[0045] A linear transformation based on three-dimensional homogeneous vectors is used to convert images taken on the road to images in the world coordinate system plane, thus completing the coordinate transformation.

[0046] The other steps and parameters are the same as those in one of the specific implementation methods one to four.

[0047] Specific Implementation Method Six: This implementation method differs from Specific Implementation Methods One through Five in that: in step two, the trajectory feature dataset is classified into large vehicles, divided into safe-state samples and dangerous-state samples; the specific process is as follows:

[0048] Step 2.1: Define the collision time TTC, post-collision time PET, and the area A of the intersection of the motion paths of the two large vehicles.

[0049] Time to Collision (TTC) calculates the time required for two vehicles to collide while maintaining their current speed and path. TTC is an important parameter for predicting collision risk.

[0050] The collision time TTC expression is:

[0051]

[0052] Where d is the straight-line distance between two adjacent vehicles, and v rel It is the relative speed between two adjacent vehicles;

[0053] Post Encounter Time (PET) measures the time required for two vehicles to approach and pass their closest point until a safe distance is restored. This metric reflects the duration of risk following a potential conflict.

[0054] The post-collision time PET expression is:

[0055]

[0056] Where d is the straight-line distance between two adjacent vehicles, a1 is the acceleration of the rear vehicle in the two adjacent vehicles, a2 is the acceleration of the front vehicle in the two adjacent vehicles, and a1-a2 is the relative acceleration between the two adjacent vehicles.

[0057] Critical Conflict Area (A) represents the area of ​​the intersection of the movement paths of the two vehicles;

[0058] The expression A is:

[0059] A=Area of ​​Intersection(path1,path2)

[0060] Where path1 is the movement path of the rear vehicle among two adjacent vehicles, path2 is the movement path of the front vehicle among two adjacent vehicles, Intersection is the intersection, and Area is the area;

[0061] Step 22: Based on TTC, PET, and the area A of the intersection of the movement paths of the two large vehicles, a risk scoring function R is constructed to comprehensively assess potential safety risks.

[0062] R=ω1×f(TTC)+ω2×f(PET)+ω3×f(A)

[0063] Where f() is the reciprocal;

[0064] The smaller the TTC (Total Collision Tightness), the higher the risk of a collision.

[0065] The smaller the PET value, the longer the duration of the post-event risk.

[0066] The larger the critical conflict zone, the higher the potential for conflict.

[0067] ω1, ω2, and ω3 are weights, and ω1 + ω2 + ω3 = 1;

[0068] Steps 2 and 3: Define the threshold R for risk scoring. threshold When the actual calculated risk scoring function R exceeds the threshold R threshold At that time, two adjacent vehicles will be labeled as dangerous samples in the dataset, providing an initial dataset for the construction of subsequent models;

[0069] When the actual calculated risk scoring function R is less than or equal to the threshold R threshold At that time, two vehicles will be labeled as safe state samples in the dataset.

[0070] Using the collected traffic flow data, we applied this risk function to calculate the risk score for each vehicle and validated the model's accuracy using a logistic regression machine learning algorithm. Through training and evaluation, our model performed excellently in predicting high-risk conditions in traffic flow, achieving an accuracy of 88.89%.

[0071] The other steps and parameters are the same as those in one of the specific implementation methods one to six.

[0072] Specific Implementation Method Seven: This implementation method differs from Specific Implementation Methods One through Five in that: in step three, the trained SVM classifier is obtained based on safe-state samples and dangerous-state samples; the specific process is as follows:

[0073] Step 3: 1. Convert the safe-state and hazardous-state sample data into the data format required by the support vector machine model;

[0074] Step 32: Normalize the vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, vehicle jerk, vehicle lateral offset and other feature variables obtained in Step 14 to the range of [0, 1], so as to reduce the impact of high-dimensional data on low-dimensional data.

[0075] To normalize the vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, and vehicle lateral offset to the range [0, 1], thus reducing the influence of high-dimensional data on low-dimensional data, the method used here is to subtract the minimum value from each feature value and then divide it by its range (maximum value minus minimum value); the formula is as follows:

[0076]

[0077] Here are examples of velocity and acceleration normalization:

[0078] Example 1: Velocity normalization:

[0079] Suppose we have the following vehicle speed data (unit: m / s): [10, 20, 30, 40, 50]

[0080] Minimum speed: 10m / s

[0081] Maximum speed: 50m / s

[0082] For a vehicle traveling at 30 m / s, the normalization process is as follows:

[0083]

[0084] Therefore, the normalized value of the speed 30m / s is 0.5.

[0085] Example 2: Acceleration normalization:

[0086] Suppose we have the following vehicle acceleration data (unit: m / s²) 2 ): [1,2,3,4,5]

[0087] Minimum acceleration: 1 m / s² 2

[0088] Maximum acceleration: 5 m / s² 2

[0089] For an acceleration of 3 m / s² 2 The normalization process for the vehicles is as follows:

[0090]

[0091] Therefore, the normalized value of the speed 30m / s is 0.5.

[0092] Therefore, the acceleration is 3 m / s². 2 The normalized value is 0.5.

[0093] This method normalizes all feature variables to the range of [0,1], which helps reduce the impact of differences in data dimensionality and improves the effectiveness and stability of model training.

[0094] Step 3: Based on the normalized vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, vehicle jerk, vehicle lateral offset and other feature variables, obtain the trained SVM classifier.

[0095] The other steps and parameters are the same as those in one of the specific implementation methods one to six.

[0096] Specific Implementation Method Eight: This implementation method differs from Specific Implementation Methods One through Seven in that: in step three, a trained SVM classifier is obtained based on feature variables such as the normalized vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, vehicle jerk, and vehicle lateral offset; the specific steps are as follows:

[0097] Step 331: Calculate the F(i) values ​​for all feature variables (10 F values ​​for 10 feature variables, independent of the number of data samples):

[0098]

[0099] In the formula It is the average of the i-th feature variable (such as velocity or acceleration) of all samples;

[0100] It is the average value of the i-th feature variable (such as velocity or acceleration) of the safe-state sample;

[0101] It is the average value of the i-th characteristic variable (such as velocity or acceleration) of the hazardous sample;

[0102] N p and N n These represent the number of samples in the safe state and the number of samples in the hazardous state, respectively.

[0103] x k,ip It is the value of the k-th accident sample in the i-th feature variable, where k = 1, 2, ..., N p N p ≥1;

[0104] x t,in It is the value of the t-th non-accident sample in the i-th feature variable, where t = 1, 2, ..., N n N n ≥1;

[0105] Step 332: Sort all M feature variables in descending order of their F values, and use this as the first subset of feature variables (M feature variables);

[0106] Determine if there is only one feature variable in the first subset of feature variables. If there is, end the process. If there is more than one, remove the feature variable with the lowest F value from the first subset of feature variables and use it as the second subset of feature variables (M-1 feature variables).

[0107] Determine if there is only one feature variable in the second subset of feature variables. If there is, end the process. If there is more than one, remove the feature variable with the lowest F value from the second subset of feature variables and use it as the third subset of feature variables (M-2 feature variables).

[0108] Continue until only one feature variable remains in the feature variable subset, which is then designated as the Mth feature variable subset (1 feature variable).

[0109] Step 3

[0110] The first subset of feature variables is divided into n units, and the number of feature variables in each unit is M.

[0111] The second subset of feature variables is divided into n units, and each unit contains M-1 feature variables;

[0112] The third subset of feature variables is divided into n units, and each unit contains M-2 feature variables;

[0113] The Mth subset of feature variables is divided into n units, each unit containing 1 feature variable;

[0114] In this invention, n = 5;

[0115] The Gaussian kernel function is selected as the kernel function, and the kernel function parameter pair is (γ, C);

[0116] The range of values ​​for γ is γ∈{2} -10 ,2 -9 ,2 -8 ,2 -7 ,…,2 7 ,2 8 ,2 9 ,2 10}

[0117] The range of values ​​for C is C∈{2}-10 ,2 -9 ,2 -8 ,2 -7 ,…,2 7 ,2 8 ,2 9 ,2 10}

[0118] After cross-validating the feature variables of n units in the first subset of feature variables with different kernel function parameters, the SVM classifier is used as the input of the SVM classifier, and the output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the first subset of feature variables.

[0119] After cross-validating the feature variables of n units in the second subset of feature variables with different kernel function parameters, the SVM classifier is used as the input of the SVM classifier, and the output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the second subset of feature variables.

[0120] After cross-validating the feature variables of n units in the third subset of feature variables with different kernel function parameters, the SVM classifier is used as the input of the SVM classifier, and the output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the third subset of feature variables.

[0121] The feature variables of n units in the Mth feature variable subset and different kernel function parameters are cross-validated and used as the input of the SVM classifier. The output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the Mth feature variable subset.

[0122] The subset of feature variables and kernel function parameter pair corresponding to the maximum output accuracy of the SVM classifier are taken as the optimal subset of feature variables and kernel function parameter pair;

[0123] Step 334: Train the SVM classifier based on the optimal subset of feature variables and kernel function parameters to obtain the trained SVM classifier.

[0124] The other steps and parameters are the same as those in any of the specific implementation methods one to seven.

[0125] Specific Implementation Method Nine: This implementation method differs from Specific Implementation Methods One through Eight in that: in step four, the video data on the highway to be tested is classified based on the trained SVM classifier. The classification result is either a safe sample or a dangerous sample. If it is a dangerous sample, an early warning is issued. The specific process is as follows:

[0126] Acquire video data from the highway under test, identify the driving trajectory of large vehicles, and output trajectory feature data;

[0127] The trajectory feature data includes vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, vehicle lateral offset, and other feature variables.

[0128] Convert trajectory feature data into the data format required by the support vector machine model;

[0129] The converted trajectory feature data are normalized to the range of [0,1] to reduce the impact of high-dimensional data on low-dimensional data;

[0130] The normalized trajectory feature data is input into the trained SVM classifier, and the output trajectory feature data is either a safe state sample or a dangerous state sample.

[0131] If the output trajectory feature data is a dangerous sample, the warning sign will immediately issue a warning signal to alert the driver and remind the driver to take appropriate measures to prevent traffic accidents.

[0132] The other steps and parameters are the same as those in one of the specific implementation methods one to eight.

[0133] Specific Implementation Method 10: This implementation method differs from Specific Implementation Methods 1 to 9 in that the indicator light sign is located 50 meters in front of the detection camera.

[0134] The other steps and parameters are the same as those in any of the specific implementation methods one to nine.

[0135] The beneficial effects of the present invention are verified using the following embodiments:

[0136] Example 1:

[0137] Step 1 involves identifying video data from the highway to determine the driving trajectories of large vehicles and outputting a trajectory feature dataset.

[0138] The specific process is as follows:

[0139] 11. Obtaining raw video frames: The first step is to obtain continuous video frames from the vehicle's driving video. This is the first step in all target tracking algorithms.

[0140] 12. Target Detection: Use pre-trained deep learning models (such as YOLO, SSD, etc.) to detect targets in video frames; find all targets in each frame and generate a bounding box for each target (the width, height and coordinate information of the detection box, and calculate the center position of the target based on the width, height and coordinate information of the detection box).

[0141] The target is a large vehicle;

[0142] The large vehicles are automobiles with a gross vehicle weight greater than 4,500 kg, a length greater than or equal to 6 meters, or a passenger capacity greater than or equal to 20 people.

[0143] 13. The DeepSort algorithm is used to process each detected target to form the target's motion trajectory; the specific process is as follows:

[0144] 131. Feature Extraction:

[0145] Extract features from the bounding box of each detected target, including appearance features and motion features, for subsequent target matching and tracking;

[0146] The apparent features include color, texture, etc.

[0147] The motion characteristics include speed, acceleration, etc.

[0148] 132. Target Matching: Use a Kalman filter to predict the position of each target in the next frame, and use the Hungarian algorithm and cascaded matching algorithm to find the same targets in the previous and next frames, and assign a unique ID to each target;

[0149] The goal of this step is to find the correspondence of the same target in each frame and assign a unique ID to each tracked target;

[0150] 133. Target Tracking: Based on the matching results, connect the same targets in each frame to form the target's motion trajectory (position, time, and vehicle number), thereby achieving multi-target tracking;

[0151] The advantages of the DeepSort algorithm lie in its combination of the high accuracy of deep learning models for target detection, the high robustness of Kalman filters for target state prediction, and the efficiency of the Hungarian algorithm for data association, achieving a good balance between accuracy and real-time performance. Furthermore, the DeepSort algorithm is simple to implement, computationally efficient, meets real-time requirements, and is suitable for multi-target tracking tasks in various scenarios.

[0152] 14. Perform coordinate transformation on the motion trajectory of the target to form a large vehicle trajectory feature dataset containing spatiotemporal data. The dataset includes features such as vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, and vehicle lateral offset.

[0153] The specific format of the dataset is shown in the table below:

[0154] Table 1 Parameter Annotation Table

[0155]

[0156] The process for obtaining the vehicle speed, vehicle acceleration, and vehicle lateral offset features is as follows:

[0157] Calculate vehicle speed, vehicle acceleration, and vehicle lateral offset based on vehicle position coordinates and time.

[0158] The process of performing coordinate transformation on the formed target's trajectory is as follows:

[0159] A linear transformation based on three-dimensional homogeneous vectors is used to convert images taken on the road to images in the world coordinate system plane, thus completing the coordinate transformation.

[0160] The process of obtaining vehicle speed, vehicle acceleration, and vehicle lateral offset features in step one of the four steps is as follows:

[0161] Calculate vehicle speed, vehicle acceleration, and vehicle lateral offset based on vehicle position coordinates and time.

[0162] The process of performing coordinate transformation on the formed target's trajectory in step one of the four steps is as follows:

[0163] A linear transformation based on three-dimensional homogeneous vectors is used to convert images taken on the road to images in the world coordinate system plane, thus completing the coordinate transformation.

[0164] II. Classify large vehicles from the trajectory feature dataset into safe-state samples and dangerous-state samples; the specific process is as follows:

[0165] 21. Define the collision time TTC, post-collision time PET, and the area A of the intersection of the motion paths of the two large vehicles:

[0166] Time to Collision (TTC) calculates the time required for two vehicles to collide while maintaining their current speed and path. TTC is an important parameter for predicting collision risk.

[0167] The collision time TTC expression is:

[0168]

[0169] Where d is the straight-line distance between the two vehicles, and v rel It is the relative speed between the two vehicles;

[0170] Post Encounter Time (PET) measures the time required for two vehicles to approach and pass their closest point until a safe distance is restored. This metric reflects the duration of risk following a potential conflict.

[0171] The post-collision time PET expression is:

[0172]

[0173] Where d is the straight-line distance between the rear vehicle and the front vehicle, a1 is the acceleration of the rear vehicle, a2 is the acceleration of the front vehicle, and a1-a2 is the relative acceleration between the rear vehicle and the front vehicle.

[0174] Critical Conflict Area (A) represents the area of ​​the intersection of the movement paths of the two vehicles;

[0175] The expression A is:

[0176] A=Area of ​​Intersection(path1, path2)

[0177] Where path1 is the movement path of the following vehicle, path2 is the movement path of the preceding vehicle, Intersection is the intersection, and Area is the area;

[0178] 22. Based on TTC, PET, and the area A of the intersection of the movement paths of the two large vehicles, a risk scoring function R is constructed to comprehensively assess potential safety risks:

[0179] R=ω1×f(TTC)+ω2×f(PET)+ω3×f(A)

[0180] Where f() is the reciprocal;

[0181] The smaller the TTC (Total Collision Tightness), the higher the risk of a collision.

[0182] The smaller the PET value, the longer the duration of the post-event risk.

[0183] The larger the critical conflict zone, the higher the potential for conflict.

[0184] ω1, ω2, and ω3 are weights, and ω1 + ω2 + ω3 = 1;

[0185] Steps 2 and 3: Define the threshold R for risk scoring. threshold When the actual calculated risk scoring function R exceeds the threshold R threshold At that time, two vehicles will be labeled as hazardous samples in the dataset, providing an initial dataset for the construction of the subsequent model;

[0186] When the actual calculated risk scoring function R is less than or equal to the threshold R threshold At that time, two vehicles will be labeled as safe state samples in the dataset.

[0187] Using the collected traffic flow data, we applied this risk function to calculate the risk score for each vehicle and validated the model's accuracy using a logistic regression machine learning algorithm. Through training and evaluation, our model performed excellently in predicting high-risk conditions in traffic flow, achieving an accuracy of 88.89%.

[0188] III. Obtaining a trained SVM classifier based on safe-state and dangerous-state samples; the specific process is as follows:

[0189] Step 3: 1. Convert the safe-state and hazardous-state sample data into the data format required by the support vector machine model;

[0190] Step 32: Normalize the vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, vehicle lateral offset and other feature variables obtained in Step 14 to the range of [0, 1], so as to reduce the impact of high-dimensional data on low-dimensional data.

[0191] To normalize the vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, and vehicle lateral offset to the range [0, 1], thus reducing the influence of high-dimensional data on low-dimensional data, the method used here is to subtract the minimum value from each feature value and then divide it by its range (maximum value minus minimum value); the formula is as follows:

[0192]

[0193] Here are examples of velocity and acceleration normalization:

[0194] Example 1: Velocity normalization:

[0195] Suppose we have the following vehicle speed data (unit: m / s): [10, 20, 30, 40, 50]

[0196] Minimum speed: 10m / s

[0197] Maximum speed: 50m / s

[0198] For a vehicle traveling at 30 m / s, the normalization process is as follows:

[0199]

[0200] Therefore, the normalized value of the speed 30m / s is 0.5.

[0201] Example 2: Acceleration normalization:

[0202] Suppose we have the following vehicle acceleration data (unit: m / s²)2 ): [1,2,3,4,5]

[0203] Minimum acceleration: 1 m / s² 2

[0204] Maximum acceleration: 5 m / s² 2

[0205] For an acceleration of 3 m / s² 2 The normalization process for the vehicles is as follows:

[0206]

[0207] Therefore, the normalized value of the speed 30m / s is 0.5.

[0208] Therefore, the acceleration is 3 m / s². 2 The normalized value is 0.5.

[0209] This method normalizes all feature variables to the range of [0,1], which helps reduce the impact of differences in data dimensionality and improves the effectiveness and stability of model training.

[0210] 33. Based on the normalized vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, vehicle lateral offset, and other feature variables, a trained SVM classifier is obtained. The specific steps are as follows:

[0211] 331. Calculate the F(i) values ​​for all feature variables (10 F values ​​for 10 feature variables, regardless of the number of data samples):

[0212]

[0213] In the formula It is the average of the i-th feature variable (such as velocity or acceleration) of all samples;

[0214] It is the average value of the i-th feature variable (such as velocity or acceleration) of the safe-state sample;

[0215] It is the average value of the i-th characteristic variable (such as velocity or acceleration) of the hazardous sample;

[0216] N p and N n These represent the number of samples in the safe state and the number of samples in the hazardous state, respectively.

[0217] x k,ip It is the value of the k-th accident sample in the i-th feature variable, where k = 1, 2, ..., N pN p ≥1;

[0218] x t,in It is the value of the t-th non-accident sample in the i-th feature variable, where t = 1, 2, ..., N n N n ≥1;

[0219] 332. Arrange all M feature variables in descending order of their F values, and form the first subset of feature variables (M feature variables);

[0220] Determine if there is only one feature variable in the first subset of feature variables. If there is, end the process. If there is more than one, remove the feature variable with the lowest F value from the first subset of feature variables and use it as the second subset of feature variables (M-1 feature variables).

[0221] Determine if there is only one feature variable in the second subset of feature variables. If there is, end the process. If there is more than one, remove the feature variable with the lowest F value from the second subset of feature variables and use it as the third subset of feature variables (M-2 feature variables).

[0222] Continue until only one feature variable remains in the feature variable subset, which is then designated as the Mth feature variable subset (1 feature variable). 333

[0224] The first subset of feature variables is divided into n units, and the number of feature variables in each unit is M.

[0225] The second subset of feature variables is divided into n units, and each unit contains M-1 feature variables;

[0226] The third subset of feature variables is divided into n units, and each unit contains M-2 feature variables;

[0227] The Mth subset of feature variables is divided into n units, each unit containing 1 feature variable;

[0228] In this invention, n = 5;

[0229] The Gaussian kernel function is selected as the kernel function, and the kernel function parameter pair is (γ, C);

[0230] The range of values ​​for γ is γ∈{2} -10 ,2 -9 ,2 -8 ,2 -7 ,…,2 7 ,2 8 ,2 9 ,2 10}

[0231] The range of values ​​for C is C∈{2} -10 ,2 -9 ,2 -8 ,2 -7 ,…,2 7 ,2 8 ,2 9 ,2 10}

[0232] After cross-validating the feature variables of n units in the first subset of feature variables with different kernel function parameters, the SVM classifier is used as the input of the SVM classifier. The output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the first subset of feature variables.

[0233] After cross-validating the feature variables of n units in the second subset of feature variables with different kernel function parameters, the SVM classifier is used as the input of the SVM classifier, and the output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the second subset of feature variables.

[0234] After cross-validating the feature variables of n units in the third subset of feature variables with different kernel function parameters, the SVM classifier is used as the input of the SVM classifier, and the output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the third subset of feature variables.

[0235] The feature variables of n units in the Mth feature variable subset and different kernel function parameters are cross-validated and used as the input of the SVM classifier. The output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the Mth feature variable subset.

[0236] The subset of feature variables and kernel function parameter pair corresponding to the maximum output accuracy of the SVM classifier are taken as the optimal subset of feature variables and kernel function parameter pair;

[0237] 334. Train the SVM classifier based on the optimal subset of feature variables and kernel function parameters to obtain a well-trained SVM classifier.

[0238] Vehicle speed V, acceleration A, jerk J, lateral offset D, and their sum of squares to the fourth power were selected as explanatory variables. The final collected data included 850 accident samples and corresponding non-accident samples. 70% of the samples were randomly assigned to the training group, and the remaining 30% were assigned to the test group. The variable selection results are shown in the table below:

[0239] Table 2: Variable Selection Status

[0240]

[0241] Prediction Results: Table 3 shows the evaluation indicators.

[0242]

[0243] IV. Classify the video data from the highway under test using a pre-trained SVM classifier. The classification result is either a safe sample or a dangerous sample. If it is a dangerous sample, issue an early warning. The specific process is as follows:

[0244] Acquire video data from the highway under test, identify the driving trajectory of large vehicles, and output trajectory feature data;

[0245] The trajectory feature data includes vehicle ID, vehicle position coordinates (the center position of the vehicle in each frame is transformed to obtain accurate position coordinates), time, vehicle speed, vehicle acceleration, vehicle lateral offset, and other feature variables.

[0246] Convert trajectory feature data into the data format required by the support vector machine model;

[0247] The converted trajectory feature data are normalized to the range of [0,1] to reduce the impact of high-dimensional data on low-dimensional data;

[0248] The normalized trajectory feature data is input into the trained SVM classifier, and the output trajectory feature data is either a safe state sample or a dangerous state sample.

[0249] If the output trajectory feature data is a dangerous sample, the warning sign will immediately issue a warning signal to alert the driver and remind the driver to take appropriate measures to prevent traffic accidents.

[0250] The warning sign is located 50 meters in front of the detection camera.

[0251] The design of warning signs should clearly display warning information, which may include warning icons, text prompts, etc. Finally, the warning signs should be integrated into the overall warning system and system-level testing should be conducted to ensure that they work properly under various conditions and effectively convey warning information.

[0252] This invention may have other embodiments. Without departing from the spirit and essence of this invention, those skilled in the art can make various corresponding changes and modifications according to this invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.

Claims

1. A method for vehicle safety status recognition and early warning based on the driving trajectory of large vehicles, characterized in that: The specific process of the method is as follows: Step 1: Identify the video data on the highway, identify the driving trajectories of large vehicles, and output the trajectory feature dataset. Step 2: Classify the trajectory feature dataset into large vehicle categories, dividing them into safe-state samples and dangerous-state samples; Step 3: Obtain the trained SVM classifier based on safe-state samples and dangerous-state samples; Step 4: Classify the video data on the highway to be tested based on the trained SVM classifier. The classification result is either a safe sample or a dangerous sample. If it is a dangerous sample, issue an early warning. In step two, the trajectory feature dataset is classified into large vehicles, divided into safe-state samples and dangerous-state samples; the specific process is as follows: Step 2.1: Define the collision time TTC, post-collision time PET, and the area A of the intersection of the motion paths of the two large vehicles. The collision time TTC expression is: in It is the straight-line distance between two adjacent vehicles. It is the relative speed between two adjacent vehicles; The post-collision time PET expression is: in, The straight-line distance between two adjacent vehicles. Let be the acceleration of the rear vehicle in a pair of adjacent vehicles. Let be the acceleration of the vehicle in front of the vehicle in a pair of adjacent vehicles. This represents the relative acceleration between two adjacent vehicles. The expression A is: in, This represents the movement path of the rear vehicle in a pair of adjacent vehicles. This represents the movement path of the vehicle in front of two adjacent vehicles. For intersection, For area; Step 22: Based on TTC, PET, and the area A of the intersection of the motion paths of the two large vehicles, a risk scoring function was constructed. : in To take the reciprocal; = ; = ; = ; , , As weight, + + =1; Steps 2 and 3: Define the threshold for risk scoring When the actual calculated risk scoring function Exceeding the threshold At that time, two adjacent vehicles will be identified as dangerous samples in the dataset; When the actual calculated risk scoring function Less than or equal to the threshold At that time, two vehicles will be labeled as safe state samples in the dataset.

2. The method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles according to claim 1, characterized in that: In step one, video data on the highway is identified to determine the driving trajectory of large vehicles and output a trajectory feature dataset. The specific process is as follows: Step 11: Obtain raw video frames: First, obtain consecutive video frames from the vehicle driving video; Step 1-2, Object Detection: Use a pre-trained deep learning model to detect objects in video frames; find all objects in each frame and generate a bounding box for each object; The target is a large vehicle; The large vehicles are automobiles with a gross vehicle weight greater than 4,500 kg, a length greater than or equal to 6 meters, or a passenger capacity greater than or equal to 20 people. Step 13: Use the DeepSort algorithm to process each detected target to form the target's motion trajectory; Step 14: Perform coordinate transformation on the motion trajectory of the target to form a large vehicle trajectory feature dataset containing spatiotemporal data. The dataset includes features such as vehicle ID, vehicle position coordinates, time, vehicle speed, vehicle acceleration, and vehicle lateral offset.

3. The method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles according to claim 2, characterized in that: In steps one and three, the DeepSort algorithm is used to process each detected target to form the target's motion trajectory; the specific process is as follows: Step 131: Feature Extraction Extract features from the bounding box of each detected target, including appearance features and motion features; The apparent features are color and texture; The motion characteristics are velocity and acceleration; Step 132, Target Matching: Use a Kalman filter to predict the position of each target in the next frame, and use the Hungarian algorithm and cascaded matching algorithm to find the same targets in the previous and next frames, and assign a unique ID to each target; Step 133: Target Tracking: Based on the matching results, connect the same targets in each frame to form the target's motion trajectory.

4. The method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles according to claim 3, characterized in that: The process of obtaining vehicle speed, vehicle acceleration, vehicle jerk, and vehicle lateral offset features in step one of the four steps is as follows: Calculate vehicle speed, vehicle acceleration, vehicle jerk, and vehicle lateral offset based on vehicle position coordinates and time.

5. The method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles according to claim 4, characterized in that: The process of performing coordinate transformation on the formed target's trajectory in step one of the four steps is as follows: A linear transformation based on three-dimensional homogeneous vectors is used to convert images taken on the road to images in the world coordinate system plane, thus completing the coordinate transformation.

6. The method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles according to claim 5, characterized in that: In step three, a trained SVM classifier is obtained based on safe-state samples and dangerous-state samples; the specific process is as follows: Step 3:

1. Convert the safe-state and hazardous-state sample data into the data format required by the support vector machine model; Step 32: Normalize the characteristic variables obtained in Step 14, such as vehicle ID, vehicle position coordinates, time, vehicle speed, vehicle acceleration, vehicle jerk, and vehicle lateral offset, to the range [0,1]. Step 3: Based on the normalized vehicle ID, vehicle position coordinates, time, vehicle speed, vehicle acceleration, vehicle jerk, and vehicle lateral offset. By considering features and variables, a trained SVM classifier can be obtained.

7. The method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles according to claim 6, characterized in that: In step three, a trained SVM classifier is obtained based on normalized vehicle ID, vehicle position coordinates, time, vehicle speed, vehicle acceleration, vehicle jerk, and vehicle lateral offset, among other feature variables. The specific steps are as follows: Step 331: Calculate the sum of all feature variables. value: In the formula It is the first of all samples The average of the characteristic variables; It is the first safe-state sample The average of the characteristic variables; It is the first dangerous sample The average of the characteristic variables; and These represent the number of samples in the safe state and the number of samples in the hazardous state, respectively. It is the first The first of the characteristic variables The value of each accident sample, , ; It is the first The first of the characteristic variables The value of a non-accident sample. , ; Step 332 Arrange all M feature variables in descending order of their F values, and use this as the first subset of feature variables; Determine if there is only one feature variable in the first subset of feature variables. If there is, end the process. If there is more than one, remove the feature variable with the lowest F value from the first subset of feature variables and use it as the second subset of feature variables. Determine if there is only one feature variable in the second subset of feature variables. If there is, end the process. If there is more than one, remove the feature variable with the lowest F value from the second subset of feature variables and use it as the third subset of feature variables. Continue until only one feature variable remains in the feature variable subset, which is then designated as the Mth feature variable subset; Step 3 Split the first subset of feature variables into There are M units, and each unit has M feature variables; Split the second subset of feature variables into There are M-1 units, and each unit contains M-1 feature variables; Split the third subset of feature variables into There are M-2 units, and each unit contains M-2 feature variables; Split the Mth subset of feature variables into There are 1 unit, and each unit contains 1 feature variable; The Gaussian kernel function is selected as the kernel function, and the kernel function parameter pair is... ; The range of values ​​is The range of values ​​is The first subset of feature variables After cross-validating the feature variables of each unit with different kernel function parameters, the SVM classifier is used as the input of the SVM classifier. The output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the first subset of feature variables. The second subset of feature variables After cross-validating the feature variables of each unit with different kernel function parameters, the SVM classifier is used as the input of the SVM classifier. The output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the second subset of feature variables. The third subset of characteristic variables After cross-validation of the feature variables of each unit and different kernel function parameters, the SVM classifier is used as the input of the SVM classifier. The output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the third subset of feature variables. The Mth subset of feature variables After cross-validation of the feature variables of each unit and different kernel function parameters, the SVM classifier is used as the input of the SVM classifier. The output accuracy of the SVM classifier is taken as the SVM classifier accuracy corresponding to the Mth subset of feature variables. The subset of feature variables and kernel function parameter pair corresponding to the maximum output accuracy of the SVM classifier are taken as the optimal subset of feature variables and kernel function parameter pair; Step 334: Train the SVM classifier based on the optimal subset of feature variables and kernel function parameters to obtain the trained SVM classifier.

8. The method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles according to claim 7, characterized in that: In step four, the video data from the highway under test is classified based on the trained SVM classifier. The classification result is either a safe sample or a dangerous sample. If it is a dangerous sample, an early warning is issued. The specific process is as follows: Acquire video data from the highway under test, identify the driving trajectory of large vehicles, and output trajectory feature data; The trajectory feature data includes feature variables such as vehicle ID, vehicle position coordinates, time, vehicle speed, vehicle acceleration, and vehicle lateral offset; Convert trajectory feature data into the data format required by the support vector machine model; The converted trajectory feature data are normalized to the range [0,1]. The normalized trajectory feature data is input into the trained SVM classifier, and the output trajectory feature data is either a safe state sample or a dangerous state sample. If the output trajectory feature data is a dangerous sample, the warning light sign will immediately issue a warning signal to alert the driver.

9. A method for vehicle safety status identification and early warning based on the driving trajectory of large vehicles according to claim 8, characterized in that: The warning sign is located 50 meters in front of the detection camera.