Traffic detection system and method
Correlation analysis and prediction of highway traffic data are carried out through factor analysis and deep learning models, which solves the problem of insufficient data correlation analysis in traffic management, realizes real-time traffic prediction and risk warning, and improves the efficiency and safety of traffic management. .
Patent Information
- Application Number
- CN202410788508.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2044-06-19
AI Technical Summary
The lack of effective analysis of the correlation between traffic data in highway traffic management results in insufficient real-time status risk assessment and multi-platform coordination and control capabilities, and the inability to accurately predict traffic congestion and accidents, affecting the timeliness and effectiveness of traffic control and prediction.
Use factor analysis to extract common factors of traffic data, build a decision tree model for feature type classification and data fusion, and use convolutional neural networks and recursive neural networks to build traffic prediction models, perform data preprocessing and optimization, to generate real-time traffic predictions result.
It realizes the correlation analysis and prediction of traffic data, improves the efficiency and timeliness of traffic management, can accurately identify vehicles and predict traffic conditions, promptly reminds drivers to pay attention to high-risk areas and time periods, and improves traffic safety and driving experience. .
Smart Images

Figure CN118366312B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic management, and in particular to a traffic detection system and method. Background Art
[0002] At present, the two main pain points of highway travel are safety and congestion. The reasons for safety and congestion are unreasonable road design and planning, which cannot meet travel requirements, and inconsistent vehicle speeds, resulting in poor traffic flow. Timely real-time management of traffic can effectively alleviate congestion and safety problems. Real-time traffic management needs to be combined with real-time road traffic conditions and vehicle information for processing to obtain an effective management plan, which also puts higher requirements on the processing of traffic data. In addition, the steep increase in the number of collected data, insufficient mining of the value of various traffic data, lack of sufficient data analysis and prediction capabilities, and inability to accurately predict emergencies such as traffic congestion and accidents, affecting the timeliness and effectiveness of traffic control and emergency response, and affecting the subsequent traffic prediction and timely formulation of real-time traffic management plans. In addition, there is a correlation between various traffic data, which affects each other and works together to form the final traffic detection results. According to different needs, different types of traffic data need to be collected, resulting in a large number of various types of traffic required in traffic detection, and the lack of effective analysis of the correlation between various types of traffic data affects the subsequent real-time status risk assessment and multi-platform coordinated control. Summary of the invention
[0003] In order to overcome the shortcomings of the prior art in highway management, which lacks effective analysis of the correlation between traffic data, resulting in subsequent real-time status risk assessment and multi-platform coordinated control, the main purpose of the present invention is to provide a traffic detection system and method.
[0004] To achieve the above object, the present invention adopts the following technical solution, a traffic detection method, comprising the following steps:
[0005] Collect real-time traffic data of highways, perform preprocessing and feature extraction, and obtain traffic feature data;
[0006] The common factors of the preprocessed traffic characteristic data are extracted through factor analysis, and a decision tree model is constructed based on the extracted common factors;
[0007] Classify the traffic characteristic data into characteristic types according to the decision tree model to obtain characteristic classification data;
[0008] The feature classification data are fused through decision rules to generate fused traffic data;
[0009] The fused traffic data is input into the constructed traffic prediction model to obtain real-time traffic prediction results.
[0010] The step of inputting the fused traffic data into the constructed traffic prediction model to obtain a real-time traffic prediction result includes the following steps:
[0011] A traffic prediction model is constructed based on convolutional neural networks and recurrent neural networks, and the traffic prediction model is trained and optimized using traffic data collected under preset conditions to obtain an optimized traffic prediction model;
[0012] According to the input requirements of the traffic prediction model, the fused traffic data is formatted, and the obtained formatted fused traffic data is input into the optimized traffic prediction model to obtain real-time traffic prediction results.
[0013] The method of extracting the common factors of the pre-processed real-time traffic data by factor analysis comprises the following steps:
[0014] Performing standardization processing on the preprocessed real-time traffic data to obtain standardized real-time traffic data;
[0015] Calculate the covariance matrix between the standardized real-time traffic data to determine the number of potential factors, and determine the number of factors through the explained variance contribution rate, Kaiser criterion, and Scree diagram;
[0016] The standardized real-time traffic data is processed by maximum likelihood estimation to obtain the factor loading matrix and eigenvalues. The factor loading matrix is rotated and the common factors and their meanings are confirmed based on the eigenvalues.
[0017] The step of fusing the feature classification data through decision rules to generate fused traffic data includes the following steps:
[0018] Design fusion rules based on the output of the decision tree model;
[0019] Determine the weight of feature classification data based on historical traffic data analysis;
[0020] Standardize the feature classification data to obtain standardized feature classification data with consistent scale and magnitude;
[0021] Processing the standardized feature classification data according to the determined fusion rules and feature weights to obtain fused feature data;
[0022] The fused feature data is reduced in dimension through principal component analysis to obtain the traffic data after dimension reduction and fusion.
[0023] The traffic data includes vehicle flow data, vehicle type data, vehicle speed data, traffic accident data and road condition data.
[0024] The collection of traffic data includes the following steps:
[0025] According to the image acquisition devices installed on both sides of the road, vehicle image data is acquired in real time;
[0026] Preprocess the real-time image, including denoising and image enhancement, to obtain effective image data;
[0027] The effective image data uses the target detection algorithm to identify the vehicle in the real-time image and obtain the vehicle type data; the effective image data is subjected to boundary processing, and the individual objects in the image are identified and segmented through the instance segmentation network, the precise boundary of each object is confirmed, and accurate vehicle information is obtained;
[0028] Track the vehicle in continuous image frames through target tracking to obtain the vehicle's motion trajectory and traffic flow data;
[0029] Extract features from effective image data based on texture features, edge detection, and shape features to obtain road condition data;
[0030] Based on time series, vehicle type data and road condition data are integrated to obtain real-time traffic data.
[0031] The target tracking includes:
[0032] The Kalman filter algorithm is used to predict and correct the position of the target vehicle; combined with the Hungarian algorithm, the target tracking algorithm is used to further achieve target association; wherein the target tracking algorithm includes the following steps:
[0033] Extract the location information of the target vehicle from the video frame through YOLO-V5;
[0034] Initialize a trajectory for each detected target vehicle; initialization includes assigning a unique ID to the target and recording its initial position and other relevant information;
[0035] Based on the current speed and motion model of the target vehicle, the trajectory of each target vehicle is predicted to infer the position of the target vehicle at the next time step;
[0036] The currently detected target is associated with the trajectory in the previous frame using the Hungarian algorithm;
[0037] According to the association result, the trajectory information of the target vehicle is updated;
[0038] Expired tracks are periodically deleted to ensure that the system does not continue to track targets that no longer exist.
[0039] The high-risk areas and time periods in the traffic forecast results are marked with early warnings including:
[0040] Construct new features based on business understanding, including generating an indicator of whether it is a peak hour based on time and an indicator of whether the weather conditions are unfavorable for driving based on weather conditions;
[0041] The random forest algorithm is used to reduce the dimension of the constructed features, and the stepwise regression method is used to eliminate the features that have no contribution to the prediction and have low linear relationship in the traffic prediction model.
[0042] The real-time traffic data collection of the expressway includes: image acquisition equipment, geomagnetic sensors, laser radar, infrared sensors, and wireless communication equipment installed on the vehicle;
[0043] The image acquisition device acquires vehicle images; the geomagnetic sensor acquires vehicle flow; the lidar acquires vehicle position and motion information by sending laser beams and measuring their reflections; the infrared sensor is used to detect the presence of vehicles and record vehicle flow data; the wireless communication device communicates with road equipment to acquire vehicle information in real time, including quantity, speed, and direction of travel.
[0044] A traffic detection system, comprising:
[0045] Data acquisition module, used for preprocessing and feature extraction to obtain traffic feature data;
[0046] The data processing module extracts the common factors of the pre-processed real-time traffic data through factor analysis, and builds a decision tree model based on the common factors; classifies the traffic feature data into feature types according to the decision tree model to obtain feature classification data; and fuses the feature classification data through decision rules to generate fused traffic data;
[0047] Model building module, which builds a traffic prediction model based on convolutional neural network and recursive neural network, trains and optimizes the traffic prediction model using traffic data collected under preset conditions, and obtains an optimized traffic prediction model;
[0048] The prediction module formats the fused traffic data according to the input requirements of the traffic prediction model, inputs the obtained formatted fused traffic data into the optimized traffic prediction model, obtains real-time traffic prediction results, transmits the real-time traffic prediction results to the traffic data sharing platform, and issues early warning signs for high-risk areas and time periods in the traffic prediction results, and displays the early warning signs through warning devices on the highway.
[0049] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention realizes real-time traffic data collection: through a variety of sensors and devices, various data of vehicles can be obtained in real time, and the data is preprocessed and fused: the collected real-time traffic data is preprocessed and feature extracted, the common factors of traffic feature data are extracted according to the factor numerator, the correlation between traffic data is found, and a decision tree is constructed according to the common factors, the traffic feature data is classified, and various types of traffic data are obtained, and then data fusion is performed for subsequent processing and analysis, as well as traffic prediction model construction and optimization: a traffic prediction model is constructed using deep learning models such as convolutional neural networks and recursive neural networks, and the traffic data collected by preset conditions are trained and optimized to improve the prediction accuracy and generalization ability. The fused traffic data is input into the pre-trained traffic prediction model, and the traffic prediction results can be obtained in real time, and the high-risk areas and time periods are warned, and the driver is reminded to pay attention to safety in time. It can collect, process and predict traffic data in real time, and timely feedback traffic status and warning information, which improves the efficiency and timeliness of traffic management on highways. Through deep learning models and target detection and tracking algorithms, vehicles can be accurately identified, traffic conditions can be predicted, and the accuracy of prediction results is improved. By integrating multiple data sources and collection devices, more comprehensive and richer traffic data can be obtained, providing a more global perspective and richer information for traffic forecasting. In addition, through early warning signs and prompt devices, drivers can be reminded to pay attention to high-risk areas and time periods in a timely manner, and adjust driving speeds and lanes in a timely manner, improving traffic safety and driving experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 It is a schematic diagram of the process structure of the present invention;
[0051] Figure 2 It is a schematic diagram of the process of extracting common factors in the present invention;
[0052] Figure 3 It is a flow chart of data fusion in the present invention;
[0053] Figure 4 It is a schematic diagram of the flow of traffic data collection of the present invention. DETAILED DESCRIPTION
[0054] The present invention will be further described below in conjunction with the accompanying drawings and implementation modes.
[0055] In order to achieve real-time monitoring and prediction of highway traffic conditions, a traffic detection system adopts a series of advanced data processing and machine learning technologies. The following is a detailed implementation plan of the technology:
[0056] First, multi-dimensional traffic data of highways is collected in real time, such as traffic volume, speed, vehicle type, etc. Then, these data are preprocessed, including cleaning, denoising and filling missing values, to ensure the quality and integrity of the data.
[0057] Subsequently, feature extraction is performed to mine feature data that have a significant impact on traffic conditions. These feature data will serve as input for subsequent analysis to improve the accuracy and efficiency of the prediction model.
[0058] On the basis of feature extraction, factor analysis technology is used to identify common factors in traffic feature data, which can represent the main change trends in the data. Based on these common factors, a decision tree model is constructed, which can effectively classify the feature types of traffic feature data.
[0059] The classified feature data are fused through decision rules to generate richer and more comprehensive traffic data sets. These data sets not only contain the original traffic features, but also incorporate the feature type information obtained through the decision tree model, providing a more comprehensive input for traffic prediction.
[0060] Finally, the fused traffic data is input into the constructed traffic prediction model, which can output real-time traffic condition prediction results. Such prediction results are crucial for traffic management and planning, and can help relevant departments make timely decisions to optimize traffic flow, reduce congestion, and improve road use efficiency.
[0061] Through this comprehensive data processing and machine learning method, not only can the traffic conditions of highways be monitored in real time, but future traffic trends can also be accurately predicted, providing strong technical support for the construction of intelligent transportation systems.
[0062] Example 1
[0063] See also Figure 1-Figure 3 ,A specific implementation case is the traffic prediction system for urban ,highways, which conducts real-time detection of the road conditions on the ,highways. The system collects real-time traffic data, including vehicle flow, road speed, etc., and pre-processes and fuses these ,raw data to obtain the fused traffic data.
[0064] First, real-time traffic data can be collected through various sensors, surveillance cameras, vehicle-mounted GPS and other equipment installed on the highway to obtain traffic status information on the highway and transmit the data to the traffic management center or cloud platform.
[0065] The collected real-time traffic data needs to be preprocessed, including cleaning the data, removing outliers and duplicate records, filling missing values, and aligning time series. The preprocessing process can be completed through data processing techniques and algorithms, such as using data mining algorithms to identify and process outliers, fill missing values, etc. For feature extraction, various techniques may be used, such as statistical methods, time series analysis, etc., to extract useful traffic features, such as flow rate of change, speed fluctuations, peak hour flow, etc.
[0066] The common factors of the pre-processed real-time traffic data are extracted by factor analysis, and a decision tree model is constructed based on the common factors; wherein factor analysis is used to discover potential structures or patterns in the data. In this embodiment, factor analysis is used to identify common factors in real-time traffic feature data, such as traffic flow and road conditions, and the construction of a decision tree model may classify traffic data into different situations or states, such as smooth, congested, accidents, etc., based on the results of the factor analysis.
[0067] Next, the feature classification data is fused. In this embodiment, the feature classification data is fused through decision rules to generate more comprehensive traffic data and provide more information for subsequent prediction models. The purpose of fusion is to integrate information from different data sources to provide more comprehensive and accurate traffic intelligence. Fusion can be achieved through data fusion algorithms, such as weighted average method, decision fusion algorithm, etc., to obtain fused traffic data.
[0068] For the fused traffic data, the convolutional neural network CNN and the recurrent neural network RNN can be used to build a traffic prediction model. CNN can be used to extract features and capture spatial correlation, while RNN is suitable for processing sequence data and capturing temporal correlation. By combining these two neural networks, a powerful traffic prediction model can be established. In order to train and optimize the traffic prediction model, traffic data collected under preset conditions can be used, such as historical traffic data, weather information, holidays and other factors. These data can be used together with the real-time collected traffic data to train and optimize the traffic prediction model through supervised learning to obtain more accurate prediction results, and the common factors of traffic flow data, vehicle type data, vehicle speed data, traffic accident data and road condition data are obtained through factor analysis. These common factors contain the common features of these data, and then the network training based on the common factors can enhance the generalization ability.
[0069] Finally, according to the input requirements of the traffic prediction model, the fused data is formatted and input into the optimized traffic prediction model to obtain real-time traffic prediction results. These prediction results can be used in traffic management, route planning, traffic congestion warning, etc. to improve the efficiency and convenience of the urban transportation system.
[0070] In general, by collecting real-time traffic data, preprocessing, feature classification and data fusion, building and optimizing traffic prediction models, real-time traffic detection on highways can be achieved, facilitating timely adjustment of traffic management methods and strategies. Such a traffic detection system can help city managers and traffic participants better understand and respond to traffic conditions, and improve the efficiency and sustainability of transportation.
[0071] Example 2
[0072] See also Figure 1 , a traffic detection method, after collecting real-time traffic data, performs a series of advanced preprocessing operations on it, successfully integrates traffic information from various sources, and forms a comprehensive set of integrated traffic data. Data collection: collects various traffic data sources, including but not limited to traffic cameras, sensors, GPS devices, mobile applications, and social media. The collected raw data is cleaned and preprocessed, including removing duplicate data, filling missing data, correcting erroneous data, etc. At the same time, it is also necessary to unify the data from different data sources to ensure that their formats and structures are consistent. Then, feature extraction is performed on the preprocessed factual traffic data, using existing feature extraction methods, such as statistical methods, time series analysis, etc., to extract useful traffic features, such as traffic flow, trends in road congestion, etc.
[0073] The common factors of the pre-processed real-time traffic data are extracted through factor analysis. The specific process is as follows: the pre-processed real-time traffic data is standardized to obtain the standardized real-time traffic data; the covariance matrix between the standardized real-time traffic data is calculated to determine the number of potential factors, and the number of factors is determined by explaining the variance contribution rate, Kaiser criterion, and Scree diagram; the standardized real-time traffic data is processed through maximum likelihood estimation to obtain the factor loading matrix and eigenvalues, and the factor loading matrix is rotated. According to the eigenvalues, the common factors and the meaning of the common factors are confirmed, and the decision tree model is constructed according to the confirmed common factors;
[0074] Classify the traffic characteristic data into characteristic types according to the decision tree model to obtain characteristic classification data;
[0075] The feature classification data is fused through decision rules to generate fused traffic data; the more specific steps are to design fusion rules based on the output of the decision tree model; determine the weights of the feature classification data based on historical traffic data analysis; standardize the feature classification data to obtain standardized feature classification data with consistent scale and magnitude; process the standardized feature classification data according to the determined fusion rules and feature weights to obtain fused feature data; and perform dimensionality reduction on the fused feature data through principal component analysis to obtain fused traffic data.
[0076] Then, the fused traffic data was thoroughly preprocessed again to ensure data quality and eliminate any factors that may affect the accuracy of the prediction model. After that, a new traffic prediction model was built based on the convolutional neural network (CNN) and the recurrent neural network (RNN). In the pre-conditioning and optimization process, the traffic prediction model was carefully trained and optimized using a large amount of traffic data collected in the early stage, and finally an optimized and more efficient traffic prediction model was successfully built.
[0077] Among them, building a traffic prediction model based on convolutional neural network (CNN) and recurrent neural network (RNN) can be divided into the following steps:
[0078] To extract features from the preprocessed fused traffic data, CNN can be used to extract features from traffic images, or RNN can be used to extract features from time series data, or both can be combined for feature extraction.
[0079] To build a hybrid neural network model that combines CNN and RNN, you can use multiple convolutional layers for feature extraction, and then input the extracted features into RNN for time series modeling. You can also connect CNN and RNN in parallel, or use CNN to extract spatial features and RNN to extract temporal features.
[0080] Using the collected traffic data set, the data is divided into training set, validation set and test set. Then the training set is used to train the traffic prediction model, the validation set is used to adjust the parameters and evaluate the performance of the traffic prediction model, and finally the test set is used to evaluate the traffic prediction model.
[0081] Evaluate the trained traffic prediction model, including evaluating the accuracy, prediction precision, generalization ability and other indicators of the traffic prediction model. According to the evaluation results, tune the traffic prediction model, and adjust the structure, parameter settings, loss function, etc. of the traffic prediction model to further improve the performance of the traffic prediction model.
[0082] After completing the training and tuning of the traffic prediction model, the model can be deployed to the actual traffic prediction system for application. According to actual needs, traffic data can be input in real time, and the traffic prediction model will output predicted traffic flow, congestion and other information for traffic management and planning.
[0083] Through the above steps, a traffic prediction model integrating CNN and RNN is constructed to achieve accurate prediction of traffic conditions and provide decision support for traffic management and planning.
[0084] Next, the processed and integrated traffic data is input into the optimized traffic prediction model to quickly obtain real-time traffic prediction results. These results not only reflect the traffic conditions of major road networks in real time, but also predict the possible conditions in the future in real time.
[0085] To further improve traffic safety, real-time traffic forecast results are sent to the traffic data sharing platform, and these forecast results are deeply analyzed to identify nearby high-risk areas and time periods, and to issue warning signs. These sign information will be immediately broadcast through warning devices on the highway to issue high-risk warnings to drivers, effectively improving road traffic safety.
[0086] Example 3
[0087] Based on Example 1, a detailed description is given for the fusion of traffic data, wherein the fusion of traffic data is to match and fuse the traffic data according to key features, and the specific steps include:
[0088] Transform and integrate traffic data from different data sources to enable effective traffic data fusion. This may involve operations such as traffic data format conversion, coordinate system conversion, and time stamp unification.
[0089] Data matching and association are performed based on shared attributes of traffic data such as time, geographic location, etc. This can be achieved by using methods such as data matching algorithms, spatial analysis, and time series analysis.
[0090] Process and analyze the associated traffic data to extract useful information and features. This may include data aggregation, data transformation, data mining, and machine learning techniques.
[0091] The processed and analyzed data are fused and integrated to generate a comprehensive traffic data set. This can be achieved through techniques such as statistical methods, model fusion, and decision rules.
[0092] The fused traffic data is visualized and displayed so that users can intuitively understand and analyze the traffic situation. This can be achieved through map display, chart display, interactive interface, etc.
[0093] It is worth noting that the fusion process of traffic data also needs to consider data security and privacy protection to ensure that sensitive information is properly protected. In addition, because traffic data is dynamic, it is necessary to establish a corresponding data update and maintenance mechanism so that the fused data can reflect the latest traffic conditions in a timely manner.
[0094] The traffic data involved include traffic flow data, vehicle type data, vehicle speed data, traffic accident data and road condition data.
[0095] For the collection of traffic data, see Figure 4 In this example, the following steps are specifically included:
[0096] According to the image acquisition devices installed on both sides of the highway, vehicle image data is acquired in real time;
[0097] Preprocess the real-time image, including denoising and image enhancement, to obtain effective image data;
[0098] The effective image data uses the target detection algorithm to identify the vehicle in the real-time image and obtain the vehicle type data; the effective image data is subjected to boundary processing, and the individual objects in the image are identified and segmented through the instance segmentation network, the precise boundary of each object is confirmed, and accurate vehicle information is obtained;
[0099] Track the vehicle in continuous image frames through target tracking to obtain the vehicle's motion trajectory and traffic flow data;
[0100] Feature extraction is performed on effective image data based on geographic features, edge detection, and shape features to obtain road condition data.
[0101] In order to achieve a more accurate target tracking effect, target tracking specifically includes:
[0102] The Kalman filter algorithm is used to predict and correct the position of the target vehicle; combined with the Hungarian algorithm, the target tracking algorithm is used to further achieve target association; the real-time target tracking algorithm includes the following steps:
[0103] Extract the location information of the target vehicle from the video frame using the YOLO-v5 algorithm;
[0104] Initialize a track for each detected target vehicle; initialization usually includes assigning a unique ID to the target and recording its initial position and other relevant information;
[0105] Based on the current speed and motion model of the target vehicle, the trajectory of each target vehicle is predicted to infer the position of the target vehicle at the next time step;
[0106] The currently detected target is associated with the trajectory in the previous frame using the Hungarian algorithm;
[0107] According to the association result, the trajectory information of the target vehicle is updated;
[0108] Expired tracks are periodically deleted to ensure that the system does not continue to track targets that no longer exist.
[0109] The high-risk areas and time periods in the traffic forecast results are marked with early warnings including:
[0110] Construct new features based on business understanding, including generating an indicator of whether it is a peak hour based on time and an indicator of whether the weather conditions are unfavorable for driving based on weather conditions;
[0111] The random forest algorithm is used to reduce the dimension of the constructed features, and the stepwise regression method is used to eliminate the features that have no contribution to the prediction and have low linear relationship in the traffic prediction model.
[0112] Among them, the methods of collecting real-time traffic data include: image acquisition equipment, geomagnetic sensors, laser radar, infrared sensors, and wireless communication equipment installed on vehicles;
[0113] The image acquisition device acquires vehicle images; the geomagnetic sensor acquires vehicle flow; the laser radar acquires the position and movement information of the vehicle by sending a laser beam and measuring its reflection; the infrared sensor is used to detect the presence of the vehicle and record the vehicle flow data; the wireless communication device communicates with the road equipment and acquires vehicle information in real time, including the number, speed and driving direction.
[0114] Example 4
[0115] On the basis of Example 1, a traffic detection system corresponding to the traffic detection method in Example 1 specifically includes:
[0116] Data acquisition module, used for preprocessing and feature extraction to obtain traffic feature data;
[0117] The data processing module extracts the common factors of the pre-processed real-time traffic data through factor analysis, and builds a decision tree model based on the common factors; classifies the traffic feature data into feature types according to the decision tree model to obtain feature classification data; and fuses the feature classification data through decision rules to generate fused traffic data;
[0118] Model building module, which builds a traffic prediction model based on convolutional neural network and recursive neural network, trains and optimizes the traffic prediction model using traffic data collected under preset conditions, and obtains an optimized traffic prediction model;
[0119] The prediction module formats the fused data according to the input requirements of the traffic prediction model, inputs the obtained formatted fused traffic data into the optimized traffic prediction model, obtains real-time traffic prediction results, transmits the real-time traffic prediction results to the traffic data sharing platform, and issues early warning signs for high-risk areas and time periods in the traffic prediction results, and displays the early warning signs through warning devices on the highway.
[0120] Example 5
[0121] In actual applications, the traffic detection method collects real-time traffic data, uses image acquisition equipment to obtain image data of vehicles on the road, and uses geomagnetic sensors to obtain traffic flow data. Laser radar is used to send laser beams and measure their reflections to obtain vehicle position and movement information. Infrared sensors are used to detect the presence of vehicles and record traffic flow data. Wireless communication devices installed on vehicles are used to communicate with road equipment to obtain real-time vehicle information, including quantity, speed, and driving direction.
[0122] Preprocessing and feature extraction of real-time traffic data: Preprocess the collected image data, including denoising and image enhancement, to ensure the acquisition of valid image data. Use target detection algorithms to identify vehicles in real-time images and obtain vehicle type data. Standardize real-time traffic data to ensure data consistency and comparability. Extract geographic features, edge detection, and shape features to obtain road condition data. Integrate vehicle type data and road condition data based on time series to obtain real-time traffic feature data.
[0123] The pre-processed real-time traffic characteristic data is subjected to factor analysis to extract common factors and determine the number of potential factors. A decision tree model is constructed based on the factor analysis results to classify the traffic characteristic data into characteristic types and obtain characteristic classification data.
[0124] Then, for the fusion part, the feature classification data is standardized to obtain standardized feature classification data. Then, the fusion rules are designed based on the output of the decision tree model. The weight of the feature classification data is determined based on the historical traffic data analysis. The standardized feature classification data is processed according to the fusion rules and feature weights to obtain fused feature data.
[0125] The traffic prediction model is constructed using convolutional neural networks (CNN) and recurrent neural networks (RNN). CNN can be used to extract features and capture spatial correlations, while RNN is suitable for processing sequence data and capturing temporal correlations. By combining these two neural networks, a powerful traffic prediction model can be built. In order to train and optimize the traffic prediction model, traffic data collected under preset conditions can be used, such as historical traffic data, weather information, holidays and other factors. These data can be used together with real-time collected traffic data to train and optimize the traffic prediction model through supervised learning to obtain more accurate prediction results.
[0126] Finally, according to the input requirements of the traffic prediction model, the fused data is formatted and input into the optimized traffic prediction model to obtain real-time traffic prediction results. These prediction results can be used in traffic management, route planning, traffic congestion warning, etc. to improve the efficiency and convenience of the urban transportation system.
[0127] Example 6
[0128] The following is a specific embodiment to illustrate the detailed application of the above-mentioned traffic detection method: Time period: April 1, 2023 to April 30, 2023, 24 hours a day uninterrupted collection.
[0129] The use environment is a city expressway with a total length of 30 kilometers and six lanes in both directions.
[0130] For image acquisition equipment, a high-definition camera is installed every 500 meters, a total of 60 units, covering the entire highway. For geomagnetic sensors, one is installed every 100 meters, a total of 290 units; laser radar: one is installed every 1 kilometer, a total of 30 units. Infrared sensors are installed every 200 meters, a total of 145 units. Wireless communication equipment is installed on all passing vehicles for real-time transmission of vehicle information.
[0131] The collected image data is de-noised and enhanced, and a convolutional neural network is used for vehicle detection and type recognition. Geomagnetic sensor data is used to calculate vehicle flow. LiDAR and infrared sensor data are used to measure vehicle speed and location. Wireless communication device data is used to obtain vehicle driving direction.
[0132] The preprocessed data were standardized. The covariance matrix was calculated, and the number of factors was determined to be 5 by the Kaiser criterion. The factor loading matrix was extracted using maximum likelihood estimation, and the common factors were confirmed by rotation.
[0133] The output of the decision tree model is used to design fusion rules. Historical traffic data analysis is used to determine feature weights. Standardized feature classification data is processed to generate fused feature data. Principal component analysis is used to reduce the dimension of the fused data. Convolutional neural networks and recursive neural networks are used to build prediction models.
[0134] The data from April 1 to April 20 is used as the training set, and the data from April 21 to April 30 is used as the test set. The model is trained and optimized, and the mean square error is used as the evaluation indicator.
[0135] Construct new features, such as peak hour markers and adverse weather condition markers. Use the random forest algorithm to reduce feature dimensionality. Use stepwise regression to remove features that have low contribution to prediction.
[0136] The mean square error of the model on the test set is 0.5, indicating that the prediction result is accurate. Early warning marks are provided for high-risk areas and time periods, which improves the efficiency of traffic management. Through this example, we can see the specific application of the traffic detection method and how to improve the accuracy of traffic prediction by integrating different sensor data and processing steps.
[0137] It should be noted that, in the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0138] The above embodiments are merely examples of the present invention and do not limit the protection scope of the present invention. All designs that are the same or similar to the present invention fall within the protection scope of the present invention.
Claims
1. A traffic detection method, characterized in that: The following steps are involved: Collect real-time traffic data of highways, perform preprocessing and feature extraction, and obtain traffic feature data; The common factors of the preprocessed traffic characteristic data are extracted through factor analysis, and a decision tree model is constructed based on the extracted common factors; Classify the traffic characteristic data into characteristic types according to the decision tree model to obtain characteristic classification data; The feature classification data are fused through decision rules to generate fused traffic data; Input the integrated traffic data into the constructed traffic prediction model to obtain real-time traffic prediction results; The collecting of real-time traffic data of the expressway comprises the following steps: According to the image acquisition devices installed on both sides of the highway, vehicle image data is acquired in real time; Preprocess the real-time image, including denoising and image enhancement, to obtain effective image data; The effective image data uses the target detection algorithm to identify the vehicle in the real-time image and obtain the vehicle type data; the effective image data is subjected to boundary processing, and the individual objects in the image are identified and segmented through the instance segmentation network, the precise boundary of each object is confirmed, and accurate vehicle information is obtained; Track the vehicle in continuous image frames through target tracking to obtain the vehicle's motion trajectory and traffic flow data; Extract features from effective image data based on texture features, edge detection, and shape features to obtain road condition data; Based on time series, vehicle type data and road condition data are integrated to obtain real-time traffic characteristic data; The target tracking includes: The Kalman filter algorithm is used to predict and correct the position of the target vehicle; combined with the Hungarian algorithm, the target tracking algorithm is used to further achieve target association; wherein the target tracking algorithm includes the following steps: Use YOLO-V5 to extract the location information of the target vehicle from the video frame; Initialize a track for each detected target vehicle; initialization usually includes assigning a unique ID to the target and recording its initial position and other relevant information; Based on the current speed and motion model of the target vehicle, the trajectory of each target vehicle is predicted to infer the position of the target vehicle at the next time step; The currently detected target is associated with the trajectory in the previous frame using the Hungarian algorithm; According to the association result, the trajectory information of the target vehicle is updated; Regularly delete expired tracks to ensure the system does not continue to track targets that no longer exist; The step of inputting the fused traffic data into the constructed traffic prediction model to obtain real-time traffic prediction results includes the following steps: A traffic prediction model is constructed based on convolutional neural networks and recurrent neural networks, and the traffic prediction model is trained and optimized using traffic data collected under preset conditions to obtain an optimized traffic prediction model; According to the input requirements of the traffic prediction model, the fused traffic data is formatted, and the obtained formatted fused traffic data is input into the optimized traffic prediction model to obtain real-time traffic prediction results; The method of extracting common factors of the pre-processed real-time traffic data by factor analysis includes the following steps: Standardize the preprocessed traffic characteristic data to obtain standardized real-time traffic data; Calculate the covariance matrix between the standardized real-time traffic data, and determine the number of factors by explaining the variance contribution rate, Kaiser criterion, and Scree diagram; The standardized real-time traffic data is processed by maximum likelihood estimation to obtain the factor loading matrix and eigenvalues, and the factor loading matrix is rotated. According to the eigenvalues, the common factors and their meanings are confirmed. The step of fusing the feature classification data through decision rules to generate fused traffic data includes the following steps: Design fusion rules based on the output of the decision tree model; Determine the weight of feature classification data based on historical traffic data analysis; Standardize the feature classification data to obtain standardized feature classification data with consistent scale and magnitude; Processing the standardized feature classification data according to the determined fusion rules and feature weights to obtain fused feature data; The fusion feature data is reduced in dimension through principal component analysis to obtain fused traffic data; The traffic forecast results provide early warning marks for medium and high risk areas and time periods, including the following steps: Construct new features based on business understanding, including generating an indicator of whether it is a peak hour based on time and an indicator of whether the weather conditions are unfavorable for driving based on weather conditions; The random forest algorithm is used to reduce the dimension of the constructed features, and the stepwise regression method is used to eliminate the features that are irrelevant to the prediction contribution and have a low linear relationship in the traffic prediction model, so as to obtain effective prediction results, and early warning signs are issued based on the effective prediction results.
2. A traffic detection method according to claim 1, characterized in that: The traffic data includes vehicle flow data, vehicle type data, vehicle speed data, traffic accident data and road condition data.
3. A traffic detection method according to claim 1, characterized in that: The real-time traffic data collection method includes: image collection equipment, geomagnetic sensors, laser radar, infrared sensors, and wireless communication equipment installed on the vehicle; The image acquisition device acquires vehicle images; the geomagnetic sensor acquires vehicle flow; the lidar acquires vehicle position and motion information by sending laser beams and measuring their reflections; the infrared sensor is used to detect the presence of vehicles and record vehicle flow data; the wireless communication device communicates with road equipment to acquire vehicle information in real time, including quantity, speed and direction of travel.
