A system for optimizing urban traffic
By integrating multi-sensor data and iteratively optimizing the process, the problem of insufficient prediction in dynamic traffic conditions by traditional traffic optimization methods has been solved, achieving higher accuracy and adaptability, and improving the flexibility and stability of urban traffic systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUFANG TECH (JIANGSU) CO LTD
- Filing Date
- 2023-12-26
- Publication Date
- 2026-06-02
AI Technical Summary
Traditional urban traffic optimization methods rely on a single data source and static rule prediction, which makes it difficult to flexibly cope with complex traffic conditions and dynamic changes, resulting in insufficient prediction accuracy and an inability to dynamically adapt to traffic changes.
Multiple sensors are used to collect vehicle traffic data, and decision tree algorithms and YOLO neural network models are used for prediction. Data fusion and iterative optimization are performed through comparison and optimization modules, including pruning optimization and image data enhancement processing, until the traffic flow threshold is met.
It improves the accuracy and robustness of vehicle quantity prediction, has adaptive capabilities, can flexibly adjust traffic optimization measures, and enhances the dynamic adaptability and predictive stability of the traffic system.
Smart Images

Figure CN117671958B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traffic optimization technology, specifically to an urban traffic optimization system. Background Technology
[0002] Traditional urban traffic optimization methods typically rely on a single data source and static rule-based predictions. Their processes are relatively fixed and struggle to flexibly handle complex and dynamically changing traffic conditions. Typically, sensors or traffic cameras collect traffic data, which is then transmitted to a central processing system. This system usually employs simple statistical methods or rules for data processing and analysis, such as using simple rules based on historical data to predict future traffic conditions, or using static threshold settings for traffic control. Based on the predictions, the system executes traffic optimization measures based on preset rules, such as adjusting traffic light durations.
[0003] However, traditional methods rely on limited data and relatively simple analytical models, resulting in disadvantages such as insufficient prediction accuracy, lack of intelligent adjustment, and inability to dynamically adapt to traffic changes. Traditional methods struggle to accurately predict and optimize complex traffic data, thus limiting their effectiveness in addressing traffic congestion and emergencies. Furthermore, traditional methods typically implement traffic optimization measures statically, failing to adjust in real-time and dynamically adapt to traffic changes, thereby failing to fully realize the potential of traffic optimization. Summary of the Invention
[0004] The purpose of this invention is to provide an urban traffic optimization system to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: an urban traffic optimization system, comprising a sensor integration module, a camera monitoring module, and a comparison and optimization module, wherein:
[0006] The sensor integration module uses multiple sensors to collect vehicle traffic sensing data and uses a decision tree algorithm model to predict the number of vehicles based on the vehicle traffic sensing data; the camera monitoring module uses a camera to collect vehicle traffic image data and uses a YOLO neural network model to predict the number of vehicles based on the vehicle traffic image data.
[0007] The comparison and optimization module collects the vehicle number threshold range specified by traffic flow management, and receives the vehicle number predicted by the sensor integration module and the camera monitoring module. It then sums and averages the sums and averages, compares the sums and averages with the threshold range, and determines the sums and averages as the final result if the sums and averages do not exceed the threshold.
[0008] When the summation and average result exceeds the threshold, the decision tree algorithm in the sensor integration module is pruned and optimized, and the image data enhancement of the camera monitoring module is optimized. The optimized prediction results are summed and averaged again, and this process is repeated multiple times until the summation and average result does not exceed the threshold.
[0009] As a further improvement to this technical solution, the sensor integration module includes a sensor data acquisition unit and a sensor data analysis unit. The sensor data acquisition unit uses multiple sensors to collect vehicle traffic sensing data and sends the collected vehicle traffic sensing data to the sensor data analysis unit. The sensor data analysis unit uses a decision tree algorithm to predict the number of vehicles based on the vehicle traffic sensing data and sends the prediction results to the comparison and optimization module.
[0010] As a further improvement to this technical solution, the camera monitoring module includes an image acquisition unit and an image analysis unit. The image acquisition unit uses a high-resolution and high-frame-rate camera to collect vehicle traffic image data and sends the image data to the image analysis unit. The image analysis unit preprocesses the image data and uses the YOLO neural network algorithm to predict the number of vehicles in the image data, and sends the prediction result to the comparison and optimization module.
[0011] As a further improvement to this technical solution, the comparison and optimization module includes a result comparison unit and a method optimization unit. The result comparison unit obtains the vehicle number threshold through local traffic planning standards and sums and averages the vehicle number results predicted by the sensor data analysis unit and the image analysis unit. If the summed and averaged result does not exceed the threshold, the summed and averaged result is determined as the final result; if the summed and averaged result exceeds the threshold, the method optimization unit will optimize the methods in the sensor data analysis unit and the image analysis unit.
[0012] As a further improvement to this technical solution, the sensor data acquisition unit utilizes multiple sensors to collect vehicle traffic sensing data, specifically including:
[0013] Ground induction coil sensor: A ground induction coil is a coil buried under the road surface. When a vehicle approaches the sensor, the metal parts of the vehicle will change the inductance of the coil, causing a change in the induced current in the coil, thus detecting the presence of the vehicle. It can accurately detect the presence and movement of vehicles and monitor traffic flow.
[0014] Infrared sensor: Infrared sensor uses infrared light to detect the presence and movement of objects. When a vehicle enters the range of the infrared sensor, the sensor will detect passive or active infrared radiation to determine the vehicle's position and speed.
[0015] Radar sensor: Radar sensor uses electromagnetic waves to detect the position and movement of surrounding objects. When the radar sensor emits electromagnetic waves, it receives the wave's rebound and determines the presence and movement of a vehicle based on the rebound time and intensity. It is suitable for long-distance monitoring under different weather conditions.
[0016] Ultrasonic sensors: Ultrasonic sensors use the echo of ultrasonic waves to detect the position and movement of objects. When an ultrasonic sensor emits sound waves and receives the echo, it determines the presence and movement of a vehicle based on the time and intensity of the echo. It is suitable for scenarios with high requirements for distance and position accuracy.
[0017] As a further improvement to this technical solution, the sensor data analysis unit uses a decision tree algorithm to predict the number of vehicles based on vehicle traffic sensor data, specifically including:
[0018] The decision tree starts from the root node and calculates the information gain of each feature with respect to the loss function. Information gain is a metric used to evaluate the ability of an attribute to classify a sample set. The optimal splitting feature and split point are selected; the split point is a value of that feature that divides the dataset into two subsets. Based on this splitting feature and split point, the current node is split into two child nodes, each containing only data whose feature values are greater than or less than the split point. For each child node, the contribution of the feature to the loss function is repeatedly calculated, and the optimal splitting feature and split point are selected to grow the tree until a stopping condition is met. The stopping condition includes the absence of features within the node that can generate further information gain for splitting. When the stopping condition is met, the recursive growth process ends, and the node at this point is determined as a leaf node, representing the final prediction result.
[0019] As a further improvement to this technical solution, the image analysis unit uses the YOLO neural network algorithm to predict the number of vehicles in the image data, specifically including:
[0020] During training, the YOLO network divides the image into an SxS grid, with each grid cell responsible for predicting the objects contained within that grid. For each grid cell, YOLO predicts B bounding boxes and the probability of each object's class within those bounding boxes, where B represents the number of bounding boxes predicted by each grid cell. The bounding boxes are represented by coordinates. During training, YOLO uses a loss function to measure the difference between the predicted and actual bounding boxes. This loss function incorporates the errors in the bounding box coordinates, confidence errors, and classification errors, and optimizes the network weights using gradient descent to update the network's training parameters.
[0021] The image to be detected is input into a pre-trained YOLO neural network model. The YOLO network performs forward propagation calculations on the image, detects vehicles in the image, and predicts bounding boxes and confidence scores for each detected vehicle. The bounding boxes include the location of the boxes and the confidence score for each bounding box containing a vehicle. The non-maximum suppression algorithm is applied to process overlapping bounding boxes to ensure that each vehicle is counted only once. The total number of vehicles in the image is obtained by counting the filtered and non-maximum suppression-processed detection results.
[0022] As a further improvement to this technical solution, the method optimization unit optimizes the methods in the sensor data analysis unit and the image analysis unit, specifically including:
[0023] For the sensor data analysis unit, for each leaf node, the change in accuracy on the test set before and after pruning is calculated. The accuracy is calculated by dividing the number of accurately predicted samples by the number of samples in the test set and multiplying by the number of samples in the test set. If the performance does not decrease after pruning, the leaf node is pruned to become the parent node of a new leaf node and predicted as the class with the highest frequency on the test set. Otherwise, the performance of the next leaf node after pruning is evaluated. Pruning is carried out progressively upwards until the performance of all leaf nodes after pruning results in an accuracy of less than 90%.
[0024] For the image analysis unit, data augmentation processing is performed on the historical data. Images are rotated at random and fixed angles to simulate different vehicle orientations in real-world scenarios. Images are mirrored horizontally or vertically to allow the model to learn the appearance features of vehicles in different directions, increasing the spatial diversity of the data. Images are scaled randomly and at fixed ratios to simulate changes in vehicle size at different distances. Images are cropped randomly and at fixed positions to simulate partial occlusion or truncation of vehicles. Random noise is added to the images to improve the model's robustness to noise interference, making it better able to handle real-world noise conditions. Finally, the color channels of the images are adjusted to increase the model's adaptability to different lighting conditions.
[0025] Compared with the prior art, the beneficial effects of the present invention are:
[0026] 1. This urban traffic optimization system utilizes multiple sensors to collect vehicle traffic sensing data and uses a decision tree algorithm model to predict the number of vehicles based on the vehicle traffic sensing data. It also uses cameras to collect vehicle traffic image data and uses a YOLO neural network model to predict the number of vehicles based on the vehicle traffic image data. The prediction results from both methods are averaged and summed, and then compared with the vehicle number threshold range specified by traffic flow management to determine the final result. This multimodal data fusion can provide more comprehensive and multi-faceted traffic information, improving the accuracy and robustness of vehicle number prediction.
[0027] 2. After averaging the results, if the average summation exceeds a threshold, this urban traffic optimization system performs optimization processing using both a decision tree algorithm model and a YOLO neural network model. The decision tree algorithm undergoes pruning optimization, while the image data in the YOLO neural network model undergoes data augmentation optimization. The optimized prediction results are then summed and averaged again, iterating multiple times until the average summation does not exceed the threshold. This gives the system a certain degree of adaptability, allowing for flexible adjustments and processing of traffic optimization based on actual conditions. This iterative optimization method can improve the stability and accuracy of predictions. Attached Figure Description
[0028] Figure 1 This is a schematic diagram of the overall modules of the present invention;
[0029] Figure 2 This is a schematic diagram of the sensor integration module unit of the present invention;
[0030] Figure 3 This is a schematic diagram of the camera monitoring module unit of the present invention;
[0031] Figure 4 This is a schematic diagram of the comparison and optimization module unit of the present invention.
[0032] In the diagram: 100, Sensor integration module; 101, Sensor data acquisition unit; 102, Sensor data analysis unit; 200, Camera monitoring module; 201, Image acquisition unit; 202, Image analysis unit; 300, Comparison and optimization module; 301, Result comparison unit; 302, Method optimization unit. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] Please see Figures 1-4 The present invention provides a technical solution: an urban traffic optimization system, including a sensor integration module 100, a camera monitoring module 200, and a comparison and optimization module 300.
[0035] The sensor data acquisition unit 101 in the sensor integration module 100 will collect vehicle traffic sensing data using multiple sensors, including:
[0036] Ground induction coil sensor: A ground induction coil is a coil buried under the road surface. When a vehicle approaches the sensor, the metal parts of the vehicle will change the inductance of the coil, causing a change in the induced current in the coil, thereby detecting the presence of the vehicle. It can accurately detect the presence and movement of vehicles and effectively monitor traffic flow.
[0037] Infrared sensor: Infrared sensor uses infrared light to detect the presence and movement of objects. When a vehicle enters the range of the infrared sensor, the sensor will detect passive or active infrared radiation, thereby determining the vehicle's position and speed.
[0038] Radar sensor: Radar sensor uses electromagnetic waves to detect the position and movement of surrounding objects. When the radar sensor emits electromagnetic waves, it receives the wave's rebound and determines the presence and movement of a vehicle based on the rebound time and intensity. It can effectively monitor vehicles moving at long distances and at high speeds and is suitable for long-distance monitoring under different weather conditions.
[0039] Ultrasonic sensors: Ultrasonic sensors use the echo of ultrasonic waves to detect the position and movement of objects. When an ultrasonic sensor emits sound waves and receives the echo, it determines the presence and movement of a vehicle based on the time and intensity of the echo. It is suitable for scenarios with high requirements for distance and position accuracy, such as vehicle monitoring in parking lots and specific areas.
[0040] Sensor data acquired by multiple sensors is sent to sensor data analysis unit 102. Sensor data analysis unit 102 uses a decision tree algorithm to predict the number of vehicles based on the sensor data, specifically including:
[0041] Data preprocessing: Raw data is collected using public databases. The raw data features include data from various sensors and the number of vehicles. Since the raw data contains noise and outliers, it needs to be preprocessed before it can be used for prediction. This includes steps such as data cleaning, outlier removal, and data smoothing to ensure the quality and accuracy of the data.
[0042] Data partitioning: The processed dataset is split into two parts, with 80% as the training set and 20% as the test set. The training set is used for model training, and the test set is used for model evaluation.
[0043] Model Training: The decision tree starts from the root node. By calculating the contribution (information gain) of each feature to the loss function, the best splitting feature and split point are selected. The split point is a value of the feature that divides the dataset into two subsets. Based on this splitting feature and split point, the current node is split into two child nodes, each containing only data that meets the splitting condition (feature value greater than or less than the split point). For each child node, the contribution of the feature to the loss function is repeatedly calculated, and the best splitting feature and split point are selected to grow the tree until a stopping condition is met. The stopping condition includes that no feature within the node can generate further information gain for splitting. When the stopping condition is met, the recursive growth process ends, and the node at this point is determined as a leaf node, representing the final prediction result.
[0044] Model application: The sensor data sent by the sensor data acquisition unit 101 is input into the trained decision tree algorithm model. Starting from the root node, the feature value of the sample is compared with the value of the partition feature corresponding to the node. Based on the different values, the sample is moved along the corresponding child node. The previous step is repeated. Based on the partition feature and value of the current node, the sample is moved to the next child node until the leaf node is reached. The leaf node corresponds to the number of vehicles.
[0045] The sensor data analysis unit 102 sends the predicted number of vehicles to the result comparison unit 301 in the comparison and optimization module 300.
[0046] The image acquisition unit 201 in the camera monitoring module 200 collects vehicle traffic image data using a high-resolution and high-frame-rate camera. High resolution ensures clear images, which is very useful for identifying vehicle license plates, traffic violations, and accident analysis; high frame rate ensures smooth video, which is especially important for capturing fast-moving vehicles and helps avoid blurry frames during video analysis. The image acquisition unit 201 sends the acquired image data to the image analysis unit 202.
[0047] The image analysis unit 202 first preprocesses the acquired image data, specifically including:
[0048] Converting an image to grayscale: Converting an image to grayscale can effectively reduce computational costs. Grayscale images only contain brightness information and have a smaller data volume compared to color images, which speeds up computation during image processing and feature extraction.
[0049] Image filters such as Gaussian blur are used to reduce noise: Images contain noise from camera sensors or during transmission. By applying filters such as Gaussian blur, the impact of this noise is reduced, thereby improving image quality. Gaussian blur uses a Gaussian function to blur the image, removing high-frequency noise and making vehicle outlines clearer and easier to identify.
[0050] Edge detection algorithms are used to highlight the vehicle's outline: Edge detection is used to find edge information in an image. Edges represent the vehicle's outline. Edge detection algorithms include the Canny edge detector, which uses the intensity gradient in the image to detect edges and can accurately mark the vehicle's outline, providing important information for subsequent vehicle detection.
[0051] Highlighting the contrast between foreground and background: Binarization converts the image into a black and white image, which helps to highlight the outline of the vehicle and clearly define the foreground and background, providing a more explicit input for vehicle detection.
[0052] After image preprocessing, the image analysis unit 202 uses the YOLO neural network deep learning method to predict the number of vehicles. YOLO is a real-time object detection algorithm, specifically including:
[0053] Historical data preparation: Collect historical image data from public databases. The historical image data includes images of vehicles from various angles, sizes and types, as well as images under different lighting and background conditions.
[0054] Model Training: During training, the YOLO network divides the image into an SxS grid, with each grid cell responsible for predicting the objects contained within that grid. For each grid cell, YOLO predicts B bounding boxes and the class probabilities of the objects contained within these bounding boxes, where B represents the number of bounding boxes predicted by each grid cell. Bounding boxes are typically represented by coordinates (x, y, w, h), where (x, y) are the coordinates of the center of the rectangle, and w and h are the width and height of the rectangle. During training, YOLO uses a loss function to measure the difference between the predicted and actual bounding boxes. The loss function combines the error in the bounding box coordinates (measured using mean squared error), confidence error, and classification error, and optimizes the network weights using methods such as gradient descent to make the network output closer to reality.
[0055] Vehicle Count Prediction: The image to be detected (i.e., the image preprocessed by image analysis unit 202) is input into the trained YOLO neural network model. The YOLO network performs forward propagation calculations on the image according to the weights obtained during training. YOLO detects vehicles in the image and predicts bounding boxes and confidence scores for each detected vehicle. The bounding boxes include the position of the box ((x,y) coordinates, width, and height) and the confidence score of each bounding box containing a vehicle. The non-maximum suppression algorithm is applied to process overlapping bounding boxes to ensure that each vehicle is counted only once. The total number of vehicles in the image is obtained by counting the detection results after filtering and processing with the non-maximum suppression algorithm.
[0056] The image analysis unit 202 sends the predicted number of vehicles to the result comparison unit 301 in the comparison and optimization module 300.
[0057] The result comparison unit 301 receives the vehicle count results sent by the sensor data analysis unit 102 and the image analysis unit 202, sums and averages the vehicle counts from both units, and compares the summed and averaged result with a threshold value. This threshold value is a vehicle count threshold value stipulated by traffic flow management and is obtained through local traffic planning standards. The comparison process specifically includes:
[0058] If the summation and averaging result does not exceed the threshold, then the result is determined as the final prediction result;
[0059] When the summation and averaging result exceeds the threshold, the method optimization unit 302 is activated. The method optimization unit 302 will optimize the methods in the sensor data analysis unit 102 and the image analysis unit 202, as follows:
[0060] For the sensor data analysis unit 102, the decision tree algorithm is optimized. For each leaf node, the difference in prediction performance on the test set before and after pruning is calculated, i.e., the change in accuracy. The number of accurately predicted samples between the label array predicted by the model and the label array of the test set is calculated. The accuracy is obtained by dividing the number of accurately predicted samples by the number of samples in the test set and multiplying by the percentage. If the performance does not decrease after pruning, the leaf node is pruned to become the parent node of a leaf node and the node is predicted as the category with the highest frequency on the test set. Otherwise, the performance of the next leaf node after pruning is judged. Pruning is carried out step by step until no further pruning is possible, i.e., when the performance of all leaf nodes after pruning leads to an accuracy of less than 90%.
[0061] For the image analysis unit 202, data augmentation processing is performed on the historical data. This includes rotating the image at random or fixed angles to simulate different vehicle orientations in real-world scenarios, helping the model learn vehicle features from different angles; mirroring the image horizontally or vertically to allow the model to learn the appearance features of vehicles in different directions, increasing the spatial diversity of the data; scaling the image randomly or at a fixed ratio to simulate changes in vehicle size at different distances, helping the model learn to detect and recognize vehicles at different scales; cropping the image randomly or at fixed positions to simulate partially occluded or cut-off vehicles, enabling the model to detect partially occluded vehicles; adding random noise, such as Gaussian noise or uniform noise, to the image to improve the model's robustness to noise interference, making it better able to handle real-world noise conditions, and also deblurring blurred images; and adjusting the image's color channels, such as changing brightness, contrast, and color balance, to increase the model's adaptability to different lighting conditions.
[0062] After optimizing the two methods, the method optimization unit 302 performs another summation and average, and compares it with the threshold. This process is repeated multiple times until the summation and average result does not exceed the threshold.
[0063] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. An urban traffic optimization system, characterized in that: It includes a sensor integration module (100), a camera monitoring module (200), and a comparison and optimization module (300), wherein: The sensor integration module (100) uses multiple sensors to collect vehicle traffic sensing data and uses a decision tree algorithm model to predict the number of vehicles based on the vehicle traffic sensing data; the camera monitoring module (200) uses a camera to collect vehicle traffic image data and uses a YOLO neural network model to predict the number of vehicles based on the vehicle traffic image data. The comparison and optimization module (300) collects the vehicle number threshold range specified by traffic flow management, and accepts the vehicle number predicted by the sensor integration module (100) and the camera monitoring module (200), performs summation and averaging, compares the summation and averaging result with the threshold range, and determines the summation and averaging result as the final result when the summation and averaging result does not exceed the threshold. When the summation and average result exceeds the threshold, the decision tree algorithm in the sensor integration module (100) is pruned and optimized, and the image data enhancement of the camera monitoring module (200) is optimized. The optimized prediction result is summed and averaged again, and the process is repeated multiple times until the summation and average result does not exceed the threshold. The sensor integration module (100) includes a sensor data acquisition unit (101) and a sensor data analysis unit (102). The sensor data analysis unit (102) uses a decision tree algorithm to predict the number of vehicles based on vehicle traffic sensor data, specifically including: The decision tree starts from the root node and calculates the information gain of each feature with respect to the loss function. Information gain is a metric used to evaluate the ability of an attribute to classify a sample set. The optimal splitting feature and split point are selected; the split point is a value of that feature that divides the dataset into two subsets. Based on this splitting feature and split point, the current node is split into two child nodes, each containing only data whose feature values are greater than or less than the split point. For each child node, the contribution of the feature to the loss function is repeatedly calculated, and the optimal splitting feature and split point are selected to grow the tree until a stopping condition is met. The stopping condition includes the absence of features within the node that can generate further information gain for splitting. When the stopping condition is met, the recursive growth process ends, and the node at this point is determined as a leaf node, representing the final prediction result. The camera monitoring module (200) includes an image acquisition unit (201) and an image analysis unit (202). The image analysis unit (202) uses the YOLO neural network algorithm to predict the number of vehicles in the image data, specifically including: During training, the YOLO network divides the image into an SxS grid, with each grid cell responsible for predicting the objects contained within that grid. For each grid cell, YOLO predicts B bounding boxes and the probability of each object's class within those bounding boxes, where B represents the number of bounding boxes predicted by each grid cell. The bounding boxes are represented by coordinates. During training, YOLO uses a loss function to measure the difference between the predicted and actual bounding boxes. This loss function incorporates the errors in the bounding box coordinates, confidence errors, and classification errors, and optimizes the network weights using gradient descent to update the network's training parameters. The image to be detected is input into a pre-trained YOLO neural network model. The YOLO network performs forward propagation calculations on the image, detects vehicles in the image, and predicts bounding boxes and confidence scores for each detected vehicle. The bounding boxes include the location of the boxes and the confidence score for each vehicle contained in a bounding box. The non-maximum suppression algorithm is applied to process overlapping bounding boxes to ensure that each vehicle is counted only once. The total number of vehicles in the image is obtained by counting the filtered and non-maximum suppression-processed detection results. The comparison and optimization module (300) includes a result comparison unit (301) and a method optimization unit (302). The method optimization unit (302) optimizes the methods in the sensor data analysis unit (102) and the image analysis unit (202), specifically including: For the sensor data analysis unit (102), for each leaf node, the change in accuracy on the test set before and after pruning is calculated, where the accuracy is the number of accurately predicted samples between the label array predicted by the model and the label array of the test set, and the number of accurately predicted samples is divided by the number of samples in the test set and multiplied by a percentage. If the performance does not decrease after pruning, the leaf node is pruned into the parent node of a leaf node and the node is predicted as the category with the highest frequency on the test set. Otherwise, the performance of the next leaf node after pruning is judged. Pruning is carried out step by step until the performance of all leaf nodes after pruning results in an accuracy of <90%. For the image analysis unit (202), data augmentation processing is performed on the historical data, and the image is rotated at random and fixed angles to simulate the different orientations of vehicles in real-world scenarios; the image is mirrored horizontally or vertically to enable the model to learn the appearance features of vehicles in different directions, increasing the spatial diversity of the data; the image is scaled at random and fixed ratios to simulate the size changes of vehicles at different distances; the image is cropped at random and fixed positions to simulate the situation where some vehicles are occluded or cut off; random noise is added to the image to improve the robustness of the model to noise interference, making the model better able to cope with real-world noise conditions; and the color channels of the image are adjusted to increase the model's adaptability to different lighting conditions.
2. The urban traffic optimization system according to claim 1, characterized in that: The sensor data acquisition unit (101) uses multiple sensors to collect vehicle traffic sensing data and sends the collected vehicle traffic sensing data to the sensor data analysis unit (102); the sensor data analysis unit (102) uses a decision tree algorithm to predict the number of vehicles based on the vehicle traffic sensing data and sends the prediction results to the comparison and optimization module (300).
3. The urban traffic optimization system according to claim 2, characterized in that: The image acquisition unit (201) uses a high-resolution and high-frame-rate camera to collect vehicle traffic image data and sends the image data to the image analysis unit (202); the image analysis unit (202) preprocesses the image data and uses the YOLO neural network algorithm to predict the number of vehicles in the image data, and sends the prediction result to the comparison and optimization module (300).
4. The urban traffic optimization system according to claim 3, characterized in that: The comparison and optimization module (300) includes a result comparison unit (301) and a method optimization unit (302). The result comparison unit (301) obtains the vehicle number threshold through the local traffic planning standard, and sums and averages the vehicle number results predicted by the sensor data analysis unit (102) and the image analysis unit (202). If the summation and average result does not exceed the threshold, the summation and average result is determined as the final result. If the summation and averaging result exceeds the threshold, the method optimization unit (302) will optimize the methods in the sensor data analysis unit (102) and the image analysis unit (202).
5. The urban traffic optimization system according to claim 2, characterized in that: The sensor data acquisition unit (101) collects vehicle traffic sensing data using multiple sensors, specifically including: Ground induction coil sensor: A ground induction coil is a coil buried under the road surface. When a vehicle approaches the sensor, the metal parts of the vehicle will change the inductance of the coil, causing a change in the induced current in the coil, thus detecting the presence of the vehicle. It can accurately detect the presence and movement of vehicles and monitor traffic flow. Infrared sensor: Infrared sensor uses infrared light to detect the presence and movement of objects. When a vehicle enters the range of the infrared sensor, the sensor will detect passive or active infrared radiation to determine the vehicle's position and speed. Radar sensor: Radar sensor uses electromagnetic waves to detect the position and movement of surrounding objects. When the radar sensor emits electromagnetic waves, it receives the wave's rebound and determines the presence and movement of a vehicle based on the rebound time and intensity. It is suitable for long-distance monitoring under different weather conditions. Ultrasonic sensors: Ultrasonic sensors use the echo of ultrasonic waves to detect the position and movement of objects. When an ultrasonic sensor emits sound waves and receives the echo, it determines the presence and movement of a vehicle based on the time and intensity of the echo. It is suitable for scenarios with high requirements for distance and position accuracy.