Edge computing-based intelligent decision-making method and system for traffic lights integrating AI video analytics
By collecting and analyzing traffic video streams in real time through edge computing devices, generating traffic state vectors, and dynamically adjusting traffic light control parameters, the problems of delayed response and insufficient safety risks in existing traffic light systems are solved, thereby improving traffic efficiency and pedestrian safety at urban intersections.
Patent Information
- Application Number
- CN202510496389.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-04-21
AI Technical Summary
Existing intelligent traffic light control systems suffer from poor real-time response, insufficient information utilization, and inadequate control strategy flexibility, resulting in low intersection traffic efficiency, increased pedestrian crossing risks, and difficulty in adapting to precise management in complex urban traffic scenarios.
Traffic video streams are collected in real time by edge computing devices, dynamic traffic features are extracted, and a pre-trained spatiotemporal analysis model is called for multimodal fusion processing to generate traffic state vectors. Candidate control strategies in the decision rule base are matched, and traffic light control parameters are dynamically adjusted through the strategy optimization model. The model weights are updated in combination with real-time feedback data.
It enables the rapid generation of control strategies adapted to current road conditions during peak hours or in the event of sudden congestion, improving the response speed and decision-making accuracy of traffic signal control, optimizing traffic efficiency and safety, and adapting to seasonal changes and long-term evolution trends in traffic flow.
Smart Images

Figure CN120089002B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing, and more specifically, to an edge computing intelligent decision-making method and system for traffic lights that integrates AI video analytics. Background Technology
[0002] Intelligent traffic light control aims to optimize intersection efficiency and safety by dynamically adjusting signal light parameters. Existing technologies typically employ fixed-cycle control strategies, such as relying on geomagnetic coils to detect traffic flow and set fixed green light durations. These methods struggle to adapt to real-time fluctuations in traffic flow and dynamic changes in pedestrian behavior. Some improved solutions analyze intersection surveillance video data via cloud servers to generate control commands, but network latency during video data transmission to the cloud causes signal light response delays, particularly in rainy or snowy weather or during sudden traffic surges during rush hours, failing to alleviate congestion promptly. Furthermore, while existing machine learning-based intelligent decision-making systems can process video data, their analysis dimensions are limited, resulting in blind spots in the generated signal light strategies, and most systems cannot adapt to long-term traffic flow patterns. In summary, existing technologies suffer from poor real-time response, insufficient information utilization, and inadequate control strategy flexibility, leading to low intersection efficiency, increased pedestrian crossing risks, and an inability to meet the precise management needs of complex urban traffic scenarios. Summary of the Invention
[0003] In view of this, this application provides an edge computing intelligent decision-making method and system for traffic lights that integrates AI video analysis.
[0004] According to one aspect of the present disclosure, an edge computing intelligent decision-making method for traffic lights integrating AI video analytics is provided. The method includes: acquiring real-time traffic video streams of a target intersection via an edge computing device and extracting a dynamic traffic feature set from the real-time traffic video streams, the dynamic traffic feature set including traffic flow distribution features, vehicle behavior trajectory features, and pedestrian movement trend features; invoking a pre-trained spatiotemporal analysis model to perform multimodal fusion processing on the dynamic traffic feature set to generate a traffic state vector of the target intersection, the traffic state vector being used to characterize the congestion level, vehicle passage priority, and pedestrian safety risk indicators of the target intersection; matching candidate control strategies in a preset decision rule base based on the traffic state vector, and adjusting the parameters of the candidate control strategies through a strategy optimization model to generate target traffic light control parameters; sending the target traffic light control parameters to the traffic signal control terminal of the target intersection, and monitoring the traffic state change data of the target intersection in real time to update the weight parameters of the spatiotemporal analysis model.
[0005] According to another aspect of the present disclosure, an edge computing traffic light intelligent decision-making system is provided, comprising: one or more processors; and one or more memories, wherein the memories store computer-readable code that, when executed by the one or more processors, causes the one or more processors to perform the method as described above.
[0006] This invention provides an edge computing-based intelligent traffic light decision-making method integrating AI video analytics. It uses edge computing devices to collect real-time traffic video streams from target intersections and extract dynamic traffic feature sets. A pre-trained spatiotemporal analysis model is then invoked to perform multimodal fusion processing on traffic flow distribution features, vehicle behavior trajectory features, and pedestrian movement trend features to generate a traffic state vector. Based on candidate strategies in a vector matching decision rule base, the target traffic light control parameters are dynamically adjusted through a strategy optimization model. Finally, the model weights are updated using real-time feedback data. This allows traffic signal control to simultaneously utilize multi-dimensional information such as real-time vehicle traffic status, pedestrian behavior patterns, and historical traffic patterns from the video stream for decision-making, effectively solving the problems of response lag and insufficient safety risk prediction caused by traditional timed control. Real-time edge processing and spatiotemporal feature fusion significantly reduce the latency of video data transmission to the cloud, ensuring the rapid generation of control strategies adapted to current road conditions even during peak hours or sudden congestion. A strategy optimization model dynamically weights and simulates candidate control strategies, achieving a balance between traffic efficiency and safety while adhering to traffic rules, thus avoiding subjective biases from manual parameter tuning. By continuously monitoring feedback data such as vehicle throughput and pedestrian waiting queues after traffic light activation, error indicators are constructed and a model update mechanism is triggered. This enables the system to adapt to seasonal changes and long-term evolution trends in traffic flow, maintaining the accuracy and robustness of the decision-making model, thereby comprehensively improving traffic efficiency at urban intersections, pedestrian safety, and the intelligence level of the traffic management system. Attached Figure Description
[0007] Figure 1 This is a schematic diagram of the architecture of a transportation application scenario provided in this application;
[0008] Figure 2 This is a flowchart illustrating an edge computing intelligent decision-making method for traffic lights that integrates AI video analytics, as provided in this application.
[0009] Figure 3 This is a schematic diagram of the structure of an edge computing traffic light intelligent decision-making system provided in an embodiment of this application. Detailed Implementation
[0010] To facilitate a clearer understanding of this application, the media data processing system that implements the media data processing method of this application is first introduced, such as... Figure 1As shown, this transportation application scenario includes edge computing device 10 and terminal cluster. The terminal cluster can include one or more terminals; the number of terminals is not limited here. Figure 1 As shown, the terminal cluster may specifically include terminal 1, terminal 2, ..., terminal n; it can be understood that terminal 1, terminal 2, terminal 3, ..., terminal n can all be network connected to edge computing device 10, so that each terminal can interact with edge computing device 10 through network connection. Edge computing device 10 is the edge computing traffic light intelligent decision-making system provided in the embodiments of this application.
[0011] It is understood that edge computing device 10 can refer to a device that performs edge computing-based intelligent decision-making for traffic lights. The terminal can specifically refer to a sensor that collects traffic environment information, such as a geomagnetic coil sensor, an image sensor, etc., but is not limited to these. Various terminals and edge computing devices 10 can be directly or indirectly connected via wired or wireless communication. Furthermore, the number of terminals and edge computing devices 10 can be one or at least two; this application does not impose any limitation. The information collected by the terminal is sent to the edge computing device 10 for edge computing and decision-making.
[0012] Further, please see Figure 2 This is a flowchart illustrating an edge computing-based intelligent decision-making method for traffic lights that integrates AI video analytics, provided in an embodiment of this application. Figure 2 As shown, this method can be derived from... Figure 1 The edge computing device 10 in the process executes the intelligent decision-making method for traffic lights that integrates AI video analytics, which may include the following steps:
[0013] Step S100: Collect real-time traffic video streams of the target intersection through edge computing devices, and extract dynamic traffic feature sets from the real-time traffic video streams. The dynamic traffic feature sets include traffic flow distribution features, vehicle behavior trajectory features, and pedestrian movement trend features.
[0014] Edge computing devices are computing devices that process and analyze data close to the data source. In this embodiment of the invention, they are used to acquire real-time traffic video streams of the target intersection. A real-time traffic video stream refers to a data stream that records the traffic situation at the target intersection in real time in the form of continuous video frames. The dynamic traffic feature set is a collection of features extracted from the real-time traffic video stream that reflects dynamic changes in traffic. Among these features, traffic flow distribution features describe the magnitude and distribution of traffic flow in different areas and time periods of the target intersection; vehicle behavior trajectory features record the vehicle's trajectory, speed changes, and other behavioral information at the intersection; and pedestrian movement trend features reflect the trends in pedestrian movement direction and density changes at the intersection.
[0015] In this embodiment of the invention, the edge computing device can be installed near the target intersection, such as on a traffic light pole, to ensure that traffic video of the intersection is captured. The captured real-time traffic video stream is transmitted to the processing module of the edge computing device through a high-speed data interface for subsequent processing. For example, at an intersection, the edge computing device can capture the driving conditions of vehicles in each direction lane and the movement of pedestrians on the crosswalk. By analyzing these video streams, traffic flow distribution characteristics can be extracted, such as the large traffic volume in a certain direction lane during the morning rush hour; vehicle behavior trajectory characteristics, such as a vehicle turning and accelerating at the intersection; and pedestrian movement trend characteristics, such as pedestrians quickly moving from one side of the crosswalk to the other when the green light is on.
[0016] As one implementation method, step S100, extracting the dynamic traffic feature set from the real-time traffic video stream, may specifically include:
[0017] Step S110: Perform frame segmentation processing on the real-time traffic video stream to obtain a continuous video frame sequence, and perform multi-target detection on each video frame in the video frame sequence to obtain the vehicle position coordinate set, pedestrian position coordinate set, and traffic sign bounding box data.
[0018] Frame segmentation is the process of dividing a continuous real-time traffic video stream into a series of independent video frames according to a preset time interval. The resulting continuous video frame sequence is composed of these segmented video frames arranged in chronological order. Multi-target detection refers to the process of simultaneously detecting multiple different targets in each video frame. In this embodiment of the invention, the main targets to be detected include vehicles, pedestrians, and traffic signs. The vehicle position coordinate set refers to the set of position coordinates of all detected vehicles in the video frame, the pedestrian position coordinate set is the set of position coordinates of all detected pedestrians, and the traffic sign bounding box data refers to the bounding box information used to identify the position and range of traffic signs (such as traffic lights, traffic signs, etc.) in the video frame.
[0019] In this embodiment of the invention, the video processing module of the edge computing device performs frame-by-frame processing on the acquired real-time traffic video stream. For example, the video stream is divided into frames at a frame rate of 25 frames per second, resulting in a series of continuous video frames. For each video frame, a deep learning-based multi-object detection algorithm, such as the YOLO (You Only Look Once) algorithm, is used to detect vehicles, pedestrians, and traffic signs. Through this algorithm, the position coordinates of vehicles can be obtained, for example, the coordinates of a vehicle in the video frame are (x1, y1); the position coordinates of pedestrians, for example, the coordinates of a pedestrian are (x2, y2); and the bounding box data of traffic signs, such as the bounding box coordinates of a traffic light are (x3, y3, x4, y4), where (x3, y3) are the coordinates of the upper left corner of the bounding box, and (x4, y4) are the coordinates of the lower right corner.
[0020] Step S120: The vehicle position coordinate set is spatiotemporally correlated using a trajectory tracking algorithm to generate a driving trajectory sequence for each vehicle, and the vehicle speed change curve, acceleration distribution characteristics, and lane occupancy frequency are calculated based on the driving trajectory sequence.
[0021] A trajectory tracking algorithm is used to track the motion trajectory of a target object in consecutive video frames. In this embodiment of the invention, it is used to perform spatiotemporal correlation on a set of vehicle position coordinates. Spatiotemporal correlation refers to associating the position coordinates of the same vehicle in different video frames according to time sequence, thereby generating a sequence of the vehicle's driving trajectory. The driving trajectory sequence is a sequence of the vehicle's position coordinates at different times, recording the vehicle's path at the target intersection. The vehicle speed change curve describes the change of vehicle speed over time, and is obtained by calculating the changes in vehicle position within the driving trajectory sequence. The acceleration distribution characteristic refers to the distribution of vehicle acceleration over different time periods, which can be calculated by differentiating the speed change curve. The lane occupancy frequency refers to the frequency with which vehicles occupy each lane, obtained by counting the number of times vehicles appear in different lanes.
[0022] In this embodiment of the invention, trajectory tracking algorithms such as Kalman filtering can be used to perform spatiotemporal correlation on the vehicle position coordinate set. For example, in multiple consecutive video frames, based on information such as vehicle position and speed, it is determined whether a vehicle in different frames is the same vehicle, and its position coordinates are correlated to generate a driving trajectory sequence for that vehicle. When calculating the vehicle speed change curve based on the driving trajectory sequence, the distance difference between the vehicle positions at two adjacent time points is first calculated, and then divided by the time interval to obtain the average speed within that time interval. The speeds for multiple time intervals are calculated sequentially to plot the speed change curve. For acceleration distribution characteristics, the speed change curve is numerically differentiated to obtain the acceleration values for different time intervals, and then the distribution of acceleration is analyzed. When calculating lane occupancy frequency, the number of frames in which a vehicle appears in each lane is counted, and then divided by the total number of frames to obtain the occupancy frequency of each lane.
[0023] Step S130: Perform group behavior analysis on the set of pedestrian location coordinates to extract the consistency characteristics of pedestrian movement direction, pedestrian density fluctuation characteristics, and pedestrian dwell time at crosswalks.
[0024] Group behavior analysis refers to the process of comprehensively analyzing the behavior of a group of pedestrians. In this embodiment of the invention, it is used to analyze a set of pedestrian location coordinates. Pedestrian movement direction consistency refers to the degree of consistency in the direction of movement among a group of pedestrians, which can be measured using existing methods such as calculating the angle between pedestrian movement directions. Pedestrian density fluctuation refers to the changes in pedestrian density over different time periods, which can be obtained by calculating changes in the number of pedestrians in different areas. Pedestrian crossing dwell time refers to the length of time pedestrians stay on a pedestrian crossing, which can be calculated by recording the time pedestrians enter and leave the pedestrian crossing.
[0025] For example, when performing group behavior analysis on a set of pedestrian location coordinates, pedestrians are first divided into different groups. For the consistency of pedestrian movement direction, the angle between the movement directions of pedestrians in each group is calculated. A smaller angle indicates a higher consistency in the movement direction of the group. For the fluctuation of pedestrian density, the target intersection is divided into multiple small areas, and the number of pedestrians in each area at different time periods is counted. The rate of change in the number of pedestrians is calculated to obtain the fluctuation of pedestrian density. When calculating the dwell time at a crosswalk, pedestrian location coordinates are used to determine whether a pedestrian has entered the crosswalk, and the entry and exit times are recorded; the difference between the two is the dwell time. For example, when a group of pedestrians enters a crosswalk within a certain period of time, by analyzing the changes in their position coordinates, it is found that most of the pedestrians move in the same direction, indicating a high degree of consistency in their movement direction. At the same time, by counting the number of pedestrians in the crosswalk area, it is found that the number of pedestrians first increases and then decreases over time, reflecting the fluctuation characteristics of pedestrian density. For a certain pedestrian, the time of entering and leaving the crosswalk is recorded, and the duration of their stay is found to be 10 seconds.
[0026] Step S140: Normalize the vehicle speed change curve, acceleration distribution characteristics, lane occupancy frequency, pedestrian movement direction consistency characteristics, pedestrian density fluctuation characteristics, and pedestrian crossing dwell time to generate a dynamic traffic feature set.
[0027] Normalization is the process of converting data from different ranges to the same range. In this embodiment of the invention, it is used to unify data with different characteristics, such as vehicle speed change curves, acceleration distribution characteristics, lane occupancy frequency, pedestrian movement direction consistency characteristics, pedestrian density fluctuation characteristics, and pedestrian crossing dwell time, making them comparable. The dynamic traffic feature set is a collection of these normalized features, which can more accurately reflect the traffic dynamics of the target intersection.
[0028] In this embodiment of the invention, min-maximum normalization can be used to process each feature. For vehicle speed variation curves, the minimum and maximum values in the curve are first identified. Then, the minimum value is subtracted from each speed value, and the result is divided by the difference between the maximum and minimum values to obtain the normalized speed value. A similar normalization method is used for acceleration distribution features, lane occupancy frequency, pedestrian movement direction consistency features, pedestrian density fluctuation features, and pedestrian crossing dwell time. For example, if the minimum value in the vehicle speed variation curve is 10 km / h, the maximum value is 60 km / h, and the speed at a certain moment is 30 km / h, then the normalized speed value is (30-10) / (60-10) = 0.4. All the normalized features are combined to obtain a dynamic traffic feature set.
[0029] Step S200: Call the pre-trained spatiotemporal analysis model to perform multimodal fusion processing on the dynamic traffic feature set to generate the traffic state vector of the target intersection. The traffic state vector is used to characterize the congestion level, vehicle passage priority and pedestrian safety risk indicators of the target intersection.
[0030] The pre-trained spatiotemporal analysis model is a model trained on a large amount of historical traffic data. It can analyze and process the input dynamic traffic feature set. Multimodal fusion processing refers to fusing different types of dynamic traffic features (such as vehicle-related features and pedestrian-related features) to obtain more comprehensive and accurate information. The traffic state vector is a vector containing multiple elements, where each element corresponds to a traffic state index at the target intersection. In this embodiment of the invention, it mainly includes congestion level, vehicle passage priority, and pedestrian safety risk index. The congestion level describes the degree of congestion at the target intersection and can be divided into different levels such as light congestion, moderate congestion, and heavy congestion; vehicle passage priority determines the passage order of different vehicles at the intersection; and the pedestrian safety risk index is used to assess the degree of safety risk to pedestrians at the intersection.
[0031] In this embodiment of the invention, the dynamic traffic feature set generated in step S100 is input into a pre-trained spatiotemporal analysis model. The spatiotemporal analysis model can be a combination model based on convolutional neural networks (CNN) and recurrent neural networks (RNN), a spatiotemporal graph convolutional network (ST-GCN), a Transformer architecture model, etc. The spatiotemporal analysis model performs multimodal fusion processing on the dynamic traffic feature set, comprehensively considering various feature information of vehicles and pedestrians. For example, the model combines features such as vehicle speed changes, lane occupancy, and pedestrian movement direction and density to determine the congestion level of the target intersection. If vehicle speeds are generally low, lane occupancy is high, and pedestrian movement is slow and dense, the model may determine that the intersection is in a severely congested level. For vehicle traffic priority, the model determines it based on factors such as vehicle direction and whether it is an emergency vehicle. For pedestrian safety risk indicators, the model evaluates factors such as pedestrian movement trends and distance from vehicles. Finally, the model outputs a traffic state vector containing congestion level, vehicle traffic priority, and pedestrian safety risk indicators.
[0032] As one implementation method, the pre-training process of the above-mentioned spatiotemporal analysis model includes:
[0033] Step S201: Collect historical traffic video datasets and corresponding labeled traffic status tags. The labeled traffic status tags include manually labeled congestion levels, vehicle traffic priority coefficients, and pedestrian accident records.
[0034] Historical traffic video datasets refer to collections of traffic video data from target intersections or other similar intersections gathered over a past period. Traffic status labels are tags that annotate the traffic status of each video segment in the historical traffic video dataset. The manually labeled congestion level is determined by manual assessment of the congestion level based on the traffic conditions in the video. Vehicle priority coefficients are numerical values used to measure the priority of vehicles at intersections. Pedestrian accident records refer to whether pedestrian accidents occurred in the video and related information.
[0035] Step S202: Perform spatiotemporal slicing on the historical traffic video dataset to generate a training sample sequence, and perform data augmentation on each training sample in the training sample sequence. The data augmentation includes simulating illumination changes, adding occlusions, and perturbing the video frame sampling rate.
[0036] Spatiotemporal slicing is the process of segmenting historical traffic video datasets according to temporal and spatial dimensions. The generated training sample sequence is a sequence composed of these segmented video clips. Data augmentation refers to a series of transformations applied to the training samples to increase the diversity and quantity of training data and improve the model's generalization ability. Illumination variation simulation involves adjusting parameters such as brightness and contrast in the video to simulate traffic scenes under different lighting conditions. Occlusion addition involves adding simulated occlusions, such as billboards and trees, to the video to simulate occlusion situations that may occur in actual traffic. Video frame sampling rate perturbation involves randomly adjusting the video sampling rate to simulate video acquisition at different frame rates.
[0037] In this embodiment of the invention, when performing spatiotemporal slicing on historical traffic video datasets, the videos are segmented according to preset time intervals (e.g., every 5 minutes) and spatial regions (e.g., dividing intersections into multiple sub-regions) to obtain a series of training samples. For each training sample, data augmentation processing is performed. For example, image processing algorithms are used to simulate lighting changes in the video, increasing or decreasing the video brightness by a preset ratio; virtual occlusion images are added to the video to simulate occlusion; and the video sampling rate is randomly adjusted, such as changing the original 25 frames per second sampling rate to 20 or 30 frames per second. This allows for obtaining more training samples from different scenarios, improving the model's adaptability to various real-world traffic conditions.
[0038] Step S203: Construct an initial spatiotemporal analysis model, which includes a parallel temporal feature extraction network and a spatial feature extraction network, as well as a cross-modal fusion layer.
[0039] The initial spatiotemporal analysis model is the foundational model for analyzing and processing traffic features. It consists of a temporal feature extraction network, a spatial feature extraction network, and a cross-modal fusion layer. The temporal feature extraction network extracts information about traffic features in the time dimension, such as the periodic fluctuations in traffic flow and the characteristics of sudden abnormal events. The spatial feature extraction network extracts information about traffic features in the spatial dimension, such as vehicle density gradient features and pedestrian gathering hotspots. The cross-modal fusion layer fuses the features extracted by the temporal and spatial feature extraction networks to obtain more comprehensive spatiotemporal feature information.
[0040] In this embodiment of the invention, a deep learning architecture can be used to construct an initial spatiotemporal analysis model. The temporal feature extraction network can use a Temporal Convolutional Network (TCN), which can effectively capture the temporal changes in traffic features. The spatial feature extraction network can use a region segmentation network, such as the U-Net network, which can divide the target intersection into multiple sub-regions and extract the spatial features of each sub-region. The cross-modal fusion layer can employ a cross-modal attention mechanism, achieving feature fusion by weighting temporal and spatial features. For example, a dynamic traffic feature set can be input into both the temporal and spatial feature extraction networks. The temporal feature extraction network extracts the periodic fluctuations of traffic flow over time, while the spatial feature extraction network extracts the density gradient features of vehicles in different sub-regions. The cross-modal fusion layer then fuses these two types of features to obtain more comprehensive spatiotemporal feature information.
[0041] Step S204: Iteratively train the initial spatiotemporal analysis model using a multi-task loss function, which includes a weighted sum of congestion level prediction error, vehicle traffic priority classification error, and pedestrian safety risk regression error.
[0042] The multi-task loss function is used to measure the model's error across multiple tasks. In this embodiment of the invention, it consists of a weighted sum of congestion level prediction error, vehicle priority classification error, and pedestrian safety risk regression error. The congestion level prediction error refers to the difference between the model's predicted congestion level and the actual labeled congestion level; the vehicle priority classification error refers to the difference between the model's classification result of vehicle priority and the actual labeled priority; and the pedestrian safety risk regression error refers to the difference between the model's predicted pedestrian safety risk index and the actual labeled pedestrian safety risk index. Weighting involves assigning different weights to each of these three errors and then summing them to obtain the total loss value. Iterative training refers to continuously adjusting the model's parameters to gradually reduce the value of the multi-task loss function, thereby improving the model's performance.
[0043] In this embodiment of the invention, an optimization algorithm such as stochastic gradient descent is used to iteratively train the initial spatiotemporal analysis model. In each training iteration, training samples are input into the model, and the model outputs predicted congestion levels, vehicle traffic priorities, and pedestrian safety risk indicators. Then, the errors of these three indicators are calculated: the congestion level prediction error, the vehicle traffic priority classification error, and the pedestrian safety risk regression error. The value of the multi-task loss function is calculated based on preset weights. The model parameters are adjusted using optimization algorithms to gradually reduce the value of the multi-task loss function.
[0044] Step S205: When the convergence speed of the multi-task loss function on the validation set is lower than a preset threshold, freeze the parameters of the temporal feature extraction network and only update the weights of the spatial feature extraction network.
[0045] The validation set is a dataset used to evaluate the model's performance during training; it is independent of the training set. Convergence speed refers to the rate at which the multi-task loss function decreases on the validation set with increasing training iterations. The preset threshold is a pre-defined value used to determine if the convergence speed is sufficient. Freezing the parameters of the temporal feature extraction network means not updating the parameters of the temporal feature extraction network during training, but only updating the weights of the spatial feature extraction network. This reduces the model's training complexity and allows the focus to optimize the performance of the spatial feature extraction network, utilizing the temporal feature information already learned by the temporal feature extraction network.
[0046] In this embodiment of the invention, during training, the model is periodically evaluated using a validation set, and the value of the multi-task loss function on the validation set is calculated. If the convergence speed of the multi-task loss function on the validation set is found to be lower than a preset threshold, it indicates that the temporal feature extraction network has learned relatively stable temporal feature information, and the parameters of the temporal feature extraction network can be frozen at this time. For example, assuming the preset threshold is 0.01, if the convergence speed of the multi-task loss function on the validation set is 0.005 in a certain training stage, which is lower than the preset threshold, the parameters of the temporal feature extraction network can be frozen, and only the weights of the spatial feature extraction network can be updated. This can avoid over-adjustment of the parameters of the temporal feature extraction network in subsequent training, while allowing the model to focus more on the learning and optimization of spatial features.
[0047] As one implementation method, step S200 involves calling a pre-trained spatiotemporal analysis model to perform multimodal fusion processing on the dynamic traffic feature set to generate a traffic state vector for the target intersection. Specifically, this may include:
[0048] Step S210: Input the dynamic traffic feature set into the time feature extraction branch of the spatiotemporal analysis model, and extract the periodic fluctuation features of traffic flow and sudden abnormal event features in the time dimension through the temporal convolutional network.
[0049] The temporal feature extraction branch is the part of the spatiotemporal analysis model used to extract traffic features in the time dimension. It can be composed of a Temporal Convolutional Network (TCN). A Temporal Convolutional Network is a convolutional neural network capable of capturing temporal dependencies in sequential data. In this embodiment of the invention, it is used to extract the periodic fluctuation features and sudden abnormal event features of traffic flow in the time dimension. Periodic fluctuation features refer to the regular changes in traffic flow within a preset time period, such as an increase in traffic flow during morning and evening rush hours. Sudden abnormal event features refer to sudden abnormal changes in traffic flow, such as a sharp decrease in traffic flow caused by a traffic accident.
[0050] In this embodiment of the invention, the dynamic traffic feature set generated in step S100 is input into the temporal feature extraction branch of the spatiotemporal analysis model. The temporal convolutional network processes the dynamic traffic feature set, extracting traffic flow features in the time dimension through convolution operations. For example, for traffic flow data, the temporal convolutional network can identify features such as the periodic increase in traffic flow during morning and evening peak hours, and the sudden decrease in traffic flow due to traffic accidents at a certain moment. By extracting these features, the model can better understand the changing patterns of traffic flow in the time dimension, providing more accurate information for subsequent traffic state analysis.
[0051] Step S220: Input the dynamic traffic feature set into the spatial feature extraction branch of the spatiotemporal analysis model, divide the target intersection into multiple sub-regions through the region segmentation network, and extract the vehicle density gradient features, pedestrian gathering hotspot features and traffic light visibility distribution of each sub-region.
[0052] The spatial feature extraction branch is the part of the spatiotemporal analysis model used to extract spatial information about traffic features. It consists of a region segmentation network. A region segmentation network is a network capable of segmenting and identifying different regions in an image or video. In this embodiment, it is used to divide the target intersection into multiple sub-regions. Vehicle density gradient features refer to the density variations of vehicles in different sub-regions, obtained by calculating the vehicle density difference between adjacent sub-regions. Pedestrian gathering hotspot features refer to the areas and degrees of pedestrian gathering at the intersection, obtained by counting the number of pedestrians in each sub-region. Traffic light visibility distribution refers to the visibility of traffic lights in different sub-regions, obtained by analyzing factors such as the brightness and occlusion of traffic lights in the video.
[0053] In this embodiment of the invention, a dynamic traffic feature set is input into the spatial feature extraction branch of the spatiotemporal analysis model. The region segmentation network divides the target intersection into multiple sub-regions, for example, dividing a crossroads into four quadrants and lanes. For each sub-region, vehicle density gradient features, pedestrian gathering hotspot features, and traffic light visibility distribution are extracted. For example, by counting the number of vehicles in each sub-region and calculating the vehicle density difference between adjacent sub-regions, vehicle density gradient features are obtained; by counting the number of pedestrians in each sub-region and identifying areas with a large number of pedestrians, pedestrian gathering hotspot features are determined; and by analyzing the brightness and occlusion of traffic lights in each sub-region in the video, the visibility distribution of traffic lights is evaluated. This spatial feature information helps the model better understand the spatial traffic conditions of the target intersection.
[0054] Step S230: Through a cross-modal attention mechanism, weights are assigned to periodic fluctuation features, sudden abnormal event features, vehicle density gradient features, pedestrian gathering hotspot features, and traffic light visibility distribution in the time dimension to generate a fused global spatiotemporal feature map.
[0055] Cross-modal attention mechanisms are mechanisms that can assign weights to features from different modalities (such as temporal and spatial modalities), weighting features according to their importance to highlight important feature information. In this embodiment of the invention, weights are assigned to different types of features, including periodic fluctuation features in the temporal dimension, sudden abnormal event features, vehicle density gradient features, pedestrian gathering hotspot features, and traffic light visibility distribution. The global spatiotemporal feature map is a feature map fused from these weighted features, containing comprehensive information about the target intersection in both temporal and spatial dimensions.
[0056] In this embodiment of the invention, the cross-modal attention mechanism assigns weights to these features based on their importance. For example, when traffic flow is in a normal periodic fluctuation, the periodic fluctuation feature in the time dimension may have a higher weight; while when a sudden abnormal event occurs, the weight of the sudden abnormal event feature increases. For spatial features, such as in pedestrian gathering hotspot areas, the weight of pedestrian gathering hotspot features will be relatively high. Through this weight allocation, different types of features are fused to generate a fused global spatiotemporal feature map. This global spatiotemporal feature map can more comprehensively and accurately reflect the traffic state of the target intersection, providing richer information for the subsequent generation of traffic state vectors.
[0057] Step S240: Map the global spatiotemporal feature map to the preset traffic state space, and output a traffic state vector containing congestion level score, vehicle passage priority weight and pedestrian safety risk index through a fully connected layer.
[0058] The predefined traffic state space is a predefined space representing traffic states, containing various possible traffic state indicators. A fully connected layer is a neural network layer that connects each element of the input feature map to each neuron in the output layer, mapping the input features to the output space through linear transformations and activation functions. The congestion level score is a quantitative assessment of the congestion level at the target intersection; vehicle priority weights are weights used to determine the order of vehicle passage; and the pedestrian safety risk index is a quantitative indicator of the safety risk to pedestrians at the intersection. The traffic state vector is a vector composed of the congestion level score, vehicle priority weights, and the pedestrian safety risk index, comprehensively reflecting the traffic state of the target intersection.
[0059] In this embodiment of the invention, the global spatiotemporal feature map generated in step S230 is input into the fully connected layer. The fully connected layer performs linear transformation and activation function processing on the global spatiotemporal feature map, mapping it to a preset traffic state space. Through this mapping, a traffic state vector containing a congestion level score, vehicle priority weights, and pedestrian safety risk index is output. For example, based on the information in the global spatiotemporal feature map, the fully connected layer calculates the congestion level score of the target intersection to be 7 (out of 10), the priority weight of a certain vehicle to be 0.8, and the pedestrian safety risk index to be 0.3, combining these values into a traffic state vector [7, 0.8, 0.3].
[0060] Step S300: Based on the traffic state vector matching, candidate control strategies in the preset decision rule base are matched, and the parameters of the candidate control strategies are adjusted through the strategy optimization model to generate target traffic light control parameters.
[0061] The pre-built decision rule base is a database containing various traffic states and corresponding control strategies. It formulates appropriate traffic light control strategies based on different traffic states. Candidate control strategies are control strategies matched from the decision rule base that correspond to the current traffic state vector. These strategies include basic control parameters such as green light duration and yellow light transition interval. The strategy optimization model is a trained model used to adjust and optimize the parameters of the candidate control strategies to improve traffic efficiency and safety. The target traffic light control parameters are the final parameters used to control the traffic lights at the target intersection, obtained after adjustment by the strategy optimization model.
[0062] In this embodiment of the invention, the traffic state vector generated in step S200 is matched with a preset decision rule base. For example, if the traffic state vector indicates that the target intersection is moderately congested, and the vehicle passage priority is high while the pedestrian safety risk is low, then a corresponding candidate control strategy is matched from the decision rule base, such as increasing the green light duration for the vehicle passage direction. These candidate control strategies are input into the strategy optimization model, which adjusts the parameters of the candidate control strategies based on the current traffic state vector. For example, by analyzing historical traffic data and real-time traffic conditions, the strategy optimization model adjusts the green light duration for the vehicle passage direction from the original 30 seconds to 40 seconds, ultimately generating the target traffic light control parameters.
[0063] As one implementation method, the training process of the above-mentioned strategy optimization model includes the following steps:
[0064] Step S301: Extract multiple historical traffic state vectors and corresponding actual execution control parameters from the historical traffic video dataset, and calculate the actual traffic efficiency and safety indicators of each actual execution control parameter in the subsequent time window.
[0065] Historical traffic state vectors are traffic state vectors extracted from historical traffic video datasets, corresponding to different time periods. They contain information such as the congestion level, vehicle priority, and pedestrian safety risk indicators at that time. Actual implemented control parameters refer to the traffic light control parameters actually used in historical traffic scenarios, such as green light duration and yellow light transition interval. Subsequent time windows refer to a time range after adopting a particular implemented control parameter, used to evaluate its effectiveness. Actual traffic efficiency refers to the actual traffic efficiency of the traffic system after adopting a particular implemented control parameter, such as the reduction rate of average vehicle delay and the increase in green light utilization. Safety indicators refer to the safety status of the traffic system after adopting the control parameter, such as the incidence of pedestrian crossing conflicts and the frequency of emergency braking.
[0066] In this embodiment of the invention, historical traffic state vectors and corresponding actual execution control parameters for multiple time periods are extracted from historical traffic video datasets. For example, for the morning rush hour of a certain day, the traffic state vector for that period is extracted, such as a congestion level of severe congestion, high vehicle priority, low pedestrian safety risk, and the actual traffic light control parameters used at that time, such as a green light duration of 25 seconds and a yellow light transition interval of 3 seconds. Then, the actual traffic efficiency and safety indicators of these actual execution control parameters in subsequent time windows (such as the next 10 minutes) are calculated. By statistically analyzing vehicle driving data and pedestrian movement data, indicators such as the average vehicle delay reduction rate, the improvement in green light utilization rate, the pedestrian crossing conflict incident rate, and the emergency braking frequency are calculated. For example, the calculated average vehicle delay reduction rate is 15%, the green light utilization rate improvement rate is 10%, the pedestrian crossing conflict incident rate is 0.5%, and the emergency braking frequency is 2 times / minute.
[0067] Step S302: Construct the neural network structure of the policy optimization model. The neural network structure includes a policy generator and a discriminator. The policy generator is used to generate control parameters based on the input traffic state vector, and the discriminator is used to evaluate the consistency between the distribution of the generated control parameters and the actual control parameters.
[0068] The neural network structure of the strategy optimization model consists of a strategy generator and a discriminator. The strategy generator is a neural network model that generates corresponding traffic light control parameters based on the input traffic state vector. The discriminator is also a neural network model, used to evaluate the consistency between the distribution of the control parameters generated by the strategy generator and the actual control parameters, that is, to determine whether the generated control parameters have similar distribution characteristics to the actual control parameters used.
[0069] In this embodiment of the invention, a neural network structure for the policy optimization model is constructed using a Generative Adversarial Network (GAN) architecture. The policy generator can employ a Multilayer Perceptron (MLP) structure, which receives a traffic state vector as input and outputs generated traffic light control parameters through a series of linear transformations and activation functions. The discriminator can also employ an MLP structure, receiving both the generated control parameters and the actual control parameters as input, and determining their distribution consistency through feature analysis of the input parameters. For example, the policy generator generates a set of traffic light control parameters based on the input traffic state vector [7, 0.8, 0.3], such as a green light duration of 35 seconds and a yellow light transition interval of 4 seconds; the discriminator compares these generated control parameters with the actual control parameters in historical data to evaluate their distribution consistency.
[0070] Step S303: Alternately optimize the policy generator and discriminator using an adversarial training algorithm until the discriminator can no longer distinguish the difference between the generated control parameters and the real control parameters.
[0071] In this embodiment of the invention, the goal of the policy generator is to generate control parameters that are as close as possible to the actual control parameters, while the goal of the discriminator is to accurately distinguish between the generated control parameters and the actual control parameters. When the discriminator cannot distinguish the difference between the generated control parameters and the actual control parameters, it indicates that the policy generator has learned the distribution characteristics of the actual control parameters, and the model has achieved good performance.
[0072] In this embodiment of the invention, an adversarial training algorithm is used to alternately optimize the policy generator and the discriminator. In each training iteration, the parameters of the discriminator are first fixed, and the parameters of the policy generator are updated to make the control parameters generated by the policy generator closer to the real control parameters, thereby deceiving the discriminator. Then, the parameters of the policy generator are fixed, and the parameters of the discriminator are updated to enable the discriminator to better identify the differences between the generated control parameters and the real control parameters.
[0073] Step S304: The trained policy generator is fused with the preset traffic rule constraints to generate a policy optimization model that can simultaneously satisfy efficiency optimization and rule compliance.
[0074] Preset traffic rule constraints refer to a series of pre-defined traffic rules and restrictions, such as minimum green light duration, maximum red light waiting time, and pedestrian priority principles. Integrating the trained strategy generator with these preset traffic rule constraints means incorporating these constraints into the process of generating control parameters, ensuring that the generated control parameters both improve traffic efficiency and comply with traffic rules.
[0075] As one implementation method, step S303, which alternately optimizes the policy generator and discriminator using an adversarial training algorithm, may specifically include:
[0076] Step S3031: Introduce a traffic rule penalty term into the loss function of the policy generator. The traffic rule penalty term is used to apply gradient penalties to the control parameters that violate the minimum green light duration, maximum red light waiting time, and pedestrian priority principle.
[0077] The loss function measures the difference between the model's output and the target value. In a policy generator, it measures the difference between the generated control parameters and the true control parameters. A traffic rule penalty term is an additional term introduced into the loss function to penalize control parameters that violate traffic rules. Gradient penalty refers to adjusting the gradient of the loss function to prevent the model from generating control parameters that violate traffic rules during training. Minimum green light duration refers to the shortest time the green light is on, maximum red light waiting time refers to the longest time vehicles or pedestrians can wait for a red light, and the pedestrian priority principle prioritizes pedestrians' right of way in traffic control.
[0078] In this embodiment of the invention, a traffic rule penalty term is introduced into the loss function of the policy generator. For example, when the green light duration in the generated control parameters is less than the minimum green light duration, the traffic rule penalty term increases the value of the loss function, thereby preventing the policy generator from generating such control parameters in subsequent training. Specifically, the traffic rule penalty term can be set as a function related to the degree of traffic rule violation. For example, for violations of the minimum green light duration, the value of the penalty term can be calculated based on the difference between the green light duration and the minimum green light duration. Through this gradient penalty mechanism, the policy generator can learn to generate control parameters that comply with traffic rules.
[0079] Step S3032: Add feature matching constraints to the loss function of the discriminator so that the generated control parameters maintain statistical distribution consistency with the real control parameters in the hidden layer feature space.
[0080] Feature matching constraint is a constraint added to the discriminator's loss function. It requires that the generated control parameters have similar statistical distribution characteristics to the true control parameters in the hidden layer feature space. The hidden layer feature space refers to the feature representation space of the hidden layers in a neural network. By analyzing the distribution of the generated and true control parameters in this space, their similarity can be assessed. Statistical distribution consistency means that the distributions of the generated and true control parameters in the hidden layer feature space have similar statistical characteristics, such as mean and variance.
[0081] In this embodiment of the invention, a feature matching constraint is added to the discriminator's loss function. When judging the generated control parameters and the true control parameters, the discriminator considers not only their surface features but also their distribution in the hidden layer feature space. For example, by calculating the difference between the mean and variance of the generated and true control parameters in the hidden layer feature space, this difference is added as a feature matching constraint term to the discriminator's loss function. Thus, during training, the discriminator encourages the control parameters generated by the policy generator to maintain statistical distribution consistency with the true control parameters in the hidden layer feature space, thereby improving the quality of the generated control parameters.
[0082] Step S3033: Update the weight parameters of the policy generator and discriminator through a moving average mechanism, and perform simulated environment testing on the generated control parameters after each iteration to screen effective samples.
[0083] The moving average mechanism is a method for updating model weight parameters. By weighting and averaging historical weight parameters, it makes the model's parameter updates smoother and more stable. In this embodiment of the invention, it is used to update the weight parameters of the policy generator and discriminator. Simulated environment testing refers to testing the generated control parameters in a virtual traffic environment to evaluate their effectiveness in real traffic scenarios. Valid samples refer to the generated control parameters that, after simulated environment testing, are considered to improve traffic efficiency and safety.
[0084] In this embodiment of the invention, a moving average mechanism is used to update the weight parameters of the policy generator and discriminator. For example, in each training iteration, the model weights are updated based on a weighted average of the current weight parameters and historical weight parameters, where the weights of the historical weight parameters gradually decrease over time. After each iteration, the generated control parameters are input into a simulated environment for testing. The simulated environment can be a virtual traffic scenario constructed based on real traffic data. By simulating the control process of traffic lights in this scenario, the effectiveness of the generated control parameters is evaluated. For example, metrics such as average vehicle delay time and pedestrian crossing time are calculated, and generated control parameters that can improve these metrics are selected as valid samples.
[0085] Step S3034: When the policy generator reaches the preset passage efficiency improvement rate in the simulation environment and the number of violations is lower than the tolerance threshold, the adversarial training process is terminated.
[0086] The preset traffic efficiency improvement rate is a pre-defined metric used to measure the degree to which the control parameters generated by the strategy generator improve traffic efficiency. It represents the percentage increase in traffic efficiency after adopting the generated control parameters. The number of violations refers to the number of times traffic rules are violated based on the generated control parameters, and the tolerance threshold is a pre-defined maximum allowed number of violations. When the strategy generator reaches the preset traffic efficiency improvement rate in the simulation environment and the number of violations is below the tolerance threshold, it indicates that the strategy generator has learned a good ability to generate control parameters, and the adversarial training process can be terminated. In this embodiment of the invention, during adversarial training, the control parameters generated by the strategy generator are continuously tested in the simulation environment.
[0087] As one implementation method, in step S300, the parameters of the candidate control strategy are adjusted through a strategy optimization model to generate the target traffic light control parameters, which may specifically include:
[0088] Step S310: Select at least two candidate control strategies with the highest matching degree with the traffic state vector from the decision rule base. The candidate control strategies include green light duration baseline parameters, yellow light transition interval threshold and pedestrian-only phase triggering conditions.
[0089] The decision rule base is a pre-built database containing various traffic states and corresponding control strategies. In this step, based on the traffic state vector generated in step S200, at least two candidate control strategies with the highest matching degree are selected from the decision rule base. Candidate control strategies refer to these selected control strategies, which include some basic control parameters, such as the green light duration baseline parameter (the basic duration of the green light), the yellow light transition interval threshold (the time interval between the yellow light transition from green to red), and the pedestrian-only phase triggering condition (under what conditions the pedestrian-only traffic light phase is triggered).
[0090] In this embodiment of the invention, traffic state vectors are input into a decision rule base for matching. For example, the traffic state vectors show that the congestion level of the target intersection is moderate, vehicle passage priority is high, and pedestrian safety risk is low. Based on this information, the two candidate control strategies with the highest matching degree are selected from the decision rule base. One strategy has a green light duration baseline parameter of 30 seconds, a yellow light transition interval threshold of 3 seconds, and a pedestrian-only phase trigger condition of more than 10 pedestrians; the other strategy has a green light duration baseline parameter of 35 seconds, a yellow light transition interval threshold of 4 seconds, and a pedestrian-only phase trigger condition of more than 15 pedestrians.
[0091] Step S320: Input each candidate control strategy and traffic state vector into the strategy evaluation module in the strategy optimization model, and calculate the expected traffic efficiency gain and safety risk attenuation coefficient of each candidate control strategy.
[0092] The strategy evaluation module in the strategy optimization model can be a multilayer perceptron structure, used to evaluate the effectiveness of candidate control strategies. It receives candidate control strategies and traffic state vectors as input, and through analysis of historical traffic data and real-time traffic conditions, calculates the expected traffic efficiency gain and safety risk attenuation coefficient for each candidate control strategy. The expected traffic efficiency gain refers to the improvement in traffic efficiency after adopting a candidate control strategy; the safety risk attenuation coefficient refers to the reduction in the safety risk of the traffic system after adopting the strategy.
[0093] In this embodiment of the invention, the candidate control strategies and traffic state vectors selected in step S310 are input into the strategy evaluation module. The strategy evaluation module analyzes the execution effect of each candidate control strategy in historical traffic scenarios, and calculates the expected traffic efficiency gain and safety risk attenuation coefficient by combining the current traffic state vector. For example, for the first candidate control strategy, analysis of historical data shows that under similar traffic conditions, the average vehicle delay reduction rate is 12% and the pedestrian crossing conflict incident rate is reduced by 0.3% after adopting this strategy. Therefore, the expected traffic efficiency gain is calculated to be 12%, and the safety risk attenuation coefficient is 0.3%. For the second candidate control strategy, the expected traffic efficiency gain is calculated to be 15%, and the safety risk attenuation coefficient is 0.4%.
[0094] Step S330: Dynamically weight each candidate control strategy according to the expected traffic efficiency gain and safety risk attenuation coefficient to generate an initial control parameter set.
[0095] Dynamic weighting refers to assigning different weights to each candidate control strategy based on the expected traffic efficiency gain and the safety risk attenuation coefficient. The parameters of each candidate control strategy are then combined according to these weights to generate an initial control parameter set. This initial control parameter set is a collection of dynamically weighted candidate control strategy parameters, comprehensively considering both traffic efficiency and safety risk factors. In this embodiment, different weights are set for the expected traffic efficiency gain and the safety risk attenuation coefficient, such as a weight of 0.6 for the expected traffic efficiency gain and a weight of 0.4 for the safety risk attenuation coefficient. For the first candidate control strategy, with an expected traffic efficiency gain of 12% and a safety risk attenuation coefficient of 0.3%, the overall weight of this strategy is 0.6 × 12% + 0.4 × 0.3% = 7.32%. For the second candidate control strategy, with an expected traffic efficiency gain of 15% and a safety risk attenuation coefficient of 0.4%, the overall weight of this strategy is 0.6 × 15% + 0.4 × 0.4% = 9.16%. Based on these combined weights, the parameters of the two candidate control strategies are combined to generate an initial set of control parameters. For example, the green light duration may be the result of a weighted average of the baseline parameters of the green light duration of the two strategies according to the combined weights.
[0096] Step S340: Simulate the execution effect of the initial set of control parameters in historical traffic scenarios using a reinforcement learning algorithm, and select control parameters that meet the preset efficiency threshold and have a safety risk below the critical value as target traffic light control parameters.
[0097] Reinforcement learning algorithms are algorithms that allow an agent to interact with its environment and continuously learn optimal strategies. In this embodiment of the invention, they are used to simulate the execution effect of an initial set of control parameters in historical traffic scenarios. Historical traffic scenarios refer to actual traffic conditions over a past period. By simulating the execution of the initial control parameters in these scenarios, their effectiveness can be evaluated. A preset efficiency threshold is a pre-defined minimum standard for measuring traffic efficiency, and a critical value is a pre-defined maximum standard for measuring traffic safety risk. Target traffic light control parameters are selected from the initial set of control parameters that meet the preset efficiency threshold and have a safety risk below the critical value. In this embodiment of the invention, a reinforcement learning algorithm is used to simulate the execution effect of the initial set of control parameters in historical traffic scenarios. A pre-stored historical traffic scenario dataset is loaded, which contains traffic flow state snapshots for multiple time periods and corresponding traffic light control parameter execution records. Each control parameter in the initial set of control parameters is spatiotemporally aligned and matched with the traffic flow state snapshots to generate a simulation task queue containing traffic light control parameter adjustment instructions and corresponding scenario identifiers. In a virtual simulation environment using reinforcement learning algorithms, simulation tasks are executed sequentially. The phase switching logic of the virtual traffic lights is dynamically modified based on traffic light control parameter adjustment instructions, and the changes in vehicle traffic trajectories and pedestrian movement path offsets are recorded. Based on the vehicle traffic trajectory change data, traffic efficiency indicators corresponding to each control parameter are calculated, such as the average vehicle delay reduction rate, the improvement in green light utilization, and the queue length attenuation coefficient. Simultaneously, safety risk indicators are extracted based on pedestrian movement path offsets, such as the pedestrian crossing conflict rate, emergency braking frequency, and the proportion of pedestrian waiting time exceeding limits. The traffic efficiency indicators are compared with preset efficiency thresholds to select a first set of candidate parameters whose traffic efficiency indicators exceed the thresholds. The safety risk indicators are then compared with critical values, and parameters with safety risk indicators exceeding the critical values are removed from the first set of candidate parameters to generate a second set of candidate parameters. If the second set of candidate parameters is empty, gradient perturbation optimization is performed on the parameters in the initial control parameter set to generate a new control parameter set. The spatiotemporal alignment matching and virtual simulation process are then re-executed until a non-empty second set of candidate parameters is obtained. Finally, based on the weighted score ranking of the traffic efficiency index and safety risk index of the parameters in the second candidate parameter set, the parameter with the highest score is selected as the target traffic light control parameter.
[0098] As one implementation method, step S320, calculating the expected traffic efficiency gain and safety risk attenuation coefficient for each candidate control strategy, may specifically include:
[0099] Step S321: Obtain the historical execution records corresponding to the candidate control strategy, and extract the traffic flow state change sequence triggered by the candidate control strategy within the historical time window from the historical execution records. The traffic flow state change sequence includes the average vehicle delay change rate, the cumulative value of the number of stops, and the frequency of pedestrian conflict events.
[0100] Historical execution records refer to the actual execution status of a candidate control strategy in past traffic scenarios, containing various changes in traffic flow status. A historical time window refers to a defined time period used to analyze the effectiveness of the candidate control strategy. The traffic flow status change sequence is a series of indicators extracted from the historical execution records reflecting changes in traffic flow status. Among these, the average vehicle delay change rate refers to the percentage change in average vehicle delay time after adopting the candidate control strategy; the cumulative number of stops refers to the total number of times vehicles stopped within the time period; and the pedestrian conflict event frequency refers to the frequency of pedestrian-vehicle conflict events within the time period.
[0101] In this embodiment of the invention, historical execution records corresponding to each candidate control strategy are obtained from a historical traffic dataset. For example, for a candidate control strategy, execution records of the strategy being used under similar traffic conditions in the past are found. From these records, a sequence of traffic flow state changes within a historical time window (e.g., 10 minutes) is extracted, such as the average vehicle delay rate decreasing from 20% to 15%, the cumulative number of stops decreasing from 50 to 40, and the frequency of pedestrian conflict events decreasing from 1 per minute to 0.5 per minute.
[0102] Step S322: Perform time window segmentation on the traffic flow state change sequence to generate multiple continuous sub-time period feature sets. Each sub-time period feature set includes the fluctuation range of the average vehicle delay change rate, the growth slope of the cumulative number of stops, and the distribution density of pedestrian conflict event frequency.
[0103] Time window segmentation is the process of dividing the traffic flow state change sequence into time intervals. The resulting set of multiple consecutive sub-time period features is composed of the traffic flow state features within these segmented sub-time periods. The fluctuation range of the average vehicle delay rate refers to the difference between the maximum and minimum values of the average vehicle delay rate within each sub-time period; the growth slope of the cumulative number of stops refers to the rate of change of the cumulative number of stops over time within each sub-time period; and the distribution density of pedestrian conflict event frequency refers to the distribution of pedestrian conflict event frequency within each sub-time period.
[0104] In this embodiment of the invention, the traffic flow state change sequence is segmented into time windows. For example, a 10-minute historical time window is divided into 10 sub-time periods per minute. For each sub-time period, the fluctuation range of the average vehicle delay rate, the growth slope of the cumulative number of stops, and the distribution density of pedestrian conflict events are calculated. For example, in the first sub-time period, the fluctuation range of the average vehicle delay rate is 2%, the growth slope of the cumulative number of stops is -1 times / minute, and the distribution density of pedestrian conflict events is 0.2 times / minute.
[0105] Step S323: Input the feature set of sub-time periods into the pre-trained traffic efficiency prediction model, extract traffic efficiency related features of different time granularities through the multi-scale temporal convolutional layer in the traffic efficiency prediction model, and generate traffic efficiency indicators of candidate control strategies after simulation based on the traffic efficiency related features.
[0106] The pre-trained traffic efficiency prediction model is a model trained on a large amount of historical traffic data, used to predict traffic efficiency indicators after the simulated execution of candidate control strategies. A multi-scale temporal convolutional layer is a convolutional layer in the traffic efficiency prediction model; it can extract traffic efficiency correlation features at different temporal granularities, that is, analyze the relationship between traffic flow status and traffic efficiency from different time scales. Traffic efficiency indicators refer to quantitative metrics that reflect traffic efficiency, such as the reduction rate of average vehicle delays and the improvement in green light utilization.
[0107] In this embodiment of the invention, the sub-time period feature set generated in step S322 is input into a pre-trained traffic efficiency prediction model. Multi-scale temporal convolutional layers process these feature sets to extract traffic efficiency-related features at different time granularities. For example, at shorter time scales, a sudden change in the average vehicle delay rate may be observed in relation to traffic efficiency; at longer time scales, the long-term trend of the cumulative number of stops may be observed in relation to traffic efficiency. Based on these traffic efficiency-related features, the model generates traffic efficiency indicators for candidate control strategies after simulation execution, such as a predicted reduction in average vehicle delay of 13% and an increase in green light utilization of 8%.
[0108] Step S324: Simultaneously input the feature set of the sub-time period into the safety risk assessment model, identify the spatiotemporal correlation pattern between the frequency of pedestrian conflict events and the sudden change in vehicle acceleration through the event prediction network in the safety risk assessment model, and output the safety risk index corresponding to the candidate control strategy.
[0109] A safety risk assessment model is used to evaluate the safety risks of a traffic system. It predicts safety risk indicators corresponding to candidate control strategies by analyzing various characteristics of traffic flow. An event prediction network, one network within the safety risk assessment model, identifies the spatiotemporal correlation patterns between pedestrian conflict event frequency and sudden changes in vehicle acceleration; that is, it analyzes the time and spatial locations where a correlation exists between pedestrian conflict event frequency and sudden changes in vehicle acceleration. Safety risk indicators are quantitative metrics reflecting the degree of safety risk in a traffic system, such as the incidence of pedestrian crossing conflicts and the frequency of emergency braking.
[0110] In this embodiment of the invention, the feature sets of sub-time periods are synchronously input into the safety risk assessment model. The event prediction network analyzes these feature sets to identify the spatiotemporal correlation pattern between the frequency of pedestrian conflict events and sudden changes in vehicle acceleration. For example, it is found that when vehicle acceleration suddenly increases, the frequency of pedestrian conflict events increases at certain designated intersection locations. Based on this correlation pattern, the model outputs safety risk indicators corresponding to candidate control strategies, such as predicting a pedestrian crossing conflict event rate of 0.4% and an emergency braking frequency of 1.5 times / minute.
[0111] Step S325: Calculate the expected traffic efficiency gain based on the difference between the traffic efficiency index and the historical benchmark traffic efficiency, and calculate the safety risk attenuation coefficient based on the degree of deviation of the safety risk index from the preset safety threshold. The expected traffic efficiency gain and the safety risk attenuation coefficient constitute the evaluation weight parameters of the candidate control strategy.
[0112] Historical baseline traffic efficiency refers to the traffic system's efficiency index before the adoption of candidate control strategies. Expected traffic efficiency gain refers to the improvement in traffic efficiency index relative to historical baseline traffic efficiency after adopting candidate control strategies, calculated as the difference between the two. Preset safety threshold is a pre-defined standard value used to measure the safety risk of the traffic system. Safety risk attenuation coefficient refers to the degree to which the safety risk index decreases relative to the preset safety threshold after adopting candidate control strategies, calculated by the deviation of the safety risk index from the preset safety threshold. Evaluation weight parameters are used to evaluate the merits of candidate control strategies, consisting of expected traffic efficiency gain and safety risk attenuation coefficient.
[0113] In this embodiment of the invention, it is assumed that the historical baseline traffic efficiency is an average vehicle delay reduction rate of 8%, and the preset safety threshold is a pedestrian crossing conflict event rate of 0.6%. For a candidate control strategy, its traffic efficiency index is an average vehicle delay reduction rate of 13%, and its safety risk index is a pedestrian crossing conflict event rate of 0.4%. Therefore, the expected traffic efficiency gain is 13% - 8% = 5%, and the safety risk attenuation coefficient is (0.6% - 0.4%) / 0.6% ≈ 33.3%. The expected traffic efficiency gain and the safety risk attenuation coefficient constitute the evaluation weight parameters of the candidate control strategy, used for subsequent evaluation and selection of the candidate control strategy.
[0114] As one implementation method, step S340 involves simulating the execution effect of the initial set of control parameters in historical traffic scenarios using a reinforcement learning algorithm, and selecting control parameters that meet a preset efficiency threshold and have a safety risk below a critical value as target traffic light control parameters. Specifically, this may include:
[0115] Step S341: Load the pre-stored historical traffic scene dataset, which contains traffic flow state snapshots for multiple time periods and corresponding traffic light control parameter execution records.
[0116] The pre-stored historical traffic scenario dataset is a dataset pre-stored in the database containing traffic flow state snapshots for multiple time periods and corresponding traffic light control parameter execution records. A traffic flow state snapshot refers to the traffic flow state information at a specific point in time, such as vehicle positions, speeds, and the number and positions of pedestrians; the traffic light control parameter execution records refer to the actual traffic light control parameters used during that time period, such as green light duration and yellow light transition interval.
[0117] In this embodiment of the invention, a pre-stored historical traffic scenario dataset is loaded from a database. This dataset can be obtained by collecting traffic data at the target intersection or other similar intersections over a long period. For example, the dataset contains snapshots of traffic flow status at different times of day over the past month and corresponding records of traffic light control parameter execution. These records can be used to subsequently simulate the execution effect of the initial set of control parameters under historical traffic scenarios.
[0118] Step S342: Perform spatiotemporal alignment matching between each control parameter in the initial control parameter set and the traffic flow state snapshot to generate a simulation task queue containing traffic light control parameter adjustment instructions and corresponding scene identifiers.
[0119] Spatiotemporal alignment matching refers to matching each control parameter in the initial control parameter set with a traffic flow state snapshot in time and space, ensuring that the control parameters can be accurately applied to the corresponding traffic scenarios. The simulation task queue is a queue of tasks containing traffic light control parameter adjustment instructions and corresponding scenario identifiers, used to execute in the virtual simulation environment of reinforcement learning algorithms. Traffic light control parameter adjustment instructions are instructions to adjust the control parameters of traffic lights, such as adjusting the green light duration from 30 seconds to 35 seconds; the corresponding scenario identifier is information used to identify the specific traffic scenario in which the control parameter is applied, such as time and location.
[0120] In this embodiment of the invention, each control parameter in the initial set of control parameters is spatiotemporally aligned and matched with a traffic flow state snapshot. For example, for a certain control parameter, a corresponding traffic flow state snapshot is found, which records the traffic flow state of the target intersection at a certain point in time. A simulation task queue containing traffic light control parameter adjustment instructions and corresponding scenario identifiers is generated. For example, one task in the task queue is: in a traffic scenario at time A and location B, adjust the green light duration of the traffic light from 30 seconds to 35 seconds.
[0121] Step S343: Execute the simulation task queue one by one in the virtual simulation environment of the reinforcement learning algorithm, dynamically modify the phase switching logic of the virtual traffic lights according to the traffic light control parameter adjustment instructions, and record the modified vehicle traffic trajectory change data and pedestrian movement path offset.
[0122] The virtual simulation environment for reinforcement learning algorithms is a virtual environment that simulates real traffic scenarios, allowing for the testing and evaluation of different traffic light control parameters. In this step, tasks in the simulation task queue are executed one by one, dynamically modifying the phase switching logic of the virtual traffic lights according to the traffic light control parameter adjustment instructions. The phase switching logic of the virtual traffic lights refers to the rules and timing of the switching between different colors, such as the duration of the green light and the transition duration of the yellow light. The modified vehicle trajectory changes and pedestrian path offsets are recorded. Vehicle trajectory changes refer to the changes in the vehicle's trajectory after the traffic light control parameters are adjusted, such as changes in speed and direction. Pedestrian path offsets refer to the deviation of the pedestrian's path relative to the original path after the traffic light control parameters are adjusted.
[0123] In this embodiment of the invention, a simulation task queue is executed in a virtual simulation environment of the reinforcement learning algorithm. For example, for one task, the green light duration of a virtual traffic light is adjusted from 30 seconds to 35 seconds. After the adjustment, the changes in vehicle trajectories in the virtual environment are observed. For instance, a vehicle that originally needed to stop and wait can now pass through the intersection directly after the green light duration is increased, and its speed also increases. Simultaneously, the offset of pedestrian movement paths is recorded. For example, pedestrians who originally needed to wait a long time on the roadside can now cross the crosswalk more quickly after the traffic light adjustment, and their movement path offset decreases.
[0124] Step S344: Calculate the traffic efficiency index corresponding to each control parameter based on the vehicle traffic trajectory change data. The traffic efficiency index includes the average vehicle delay reduction rate, the green light utilization rate improvement rate, and the queue length attenuation coefficient.
[0125] Traffic efficiency indicators are quantitative metrics used to measure traffic flow efficiency. In this embodiment of the invention, they include the average vehicle delay reduction rate, the improvement in green light utilization rate, and the queue length attenuation coefficient. The average vehicle delay reduction rate refers to the percentage reduction in average vehicle delay time after adopting a certain control parameter; the improvement in green light utilization rate refers to the percentage increase in the efficiency of green light time utilization after adopting the control parameter; and the queue length attenuation coefficient refers to the percentage decrease in queue length after adopting the control parameter. When calculating these traffic efficiency indicators based on vehicle trajectory change data, it is first necessary to clarify that the average vehicle delay time refers to the time a vehicle waits at an intersection. By analyzing the dwell time of vehicles at intersections in the vehicle trajectory change data, the average vehicle delay time before and after adopting the control parameter is statistically calculated, and then the average vehicle delay reduction rate is calculated. For example, if the average vehicle delay time was 30 seconds before adopting a certain control parameter, and the average delay time becomes 20 seconds after adopting it, then the average vehicle delay reduction rate is (30-20) / 30 approx 33.3%.
[0126] Green light utilization rate refers to the ratio of the number of vehicles actually passing through the intersection during the green light time to the theoretical number of vehicles that can pass through during the green light time. By statistically analyzing vehicle traffic trajectory changes, the actual number of vehicles passing through during the green light time is compared with the theoretical number of vehicles that can pass based on traffic flow theory. This comparison yields the improvement in green light utilization rate before and after implementing control parameters. For example, if the green light utilization rate was 60% before implementing control parameters and increased to 70% after, then the improvement in green light utilization rate is 70% - 60% = 10%.
[0127] Queue length refers to the length of the queue of vehicles waiting to pass through an intersection. The queue length before and after implementing control parameters is determined by analyzing vehicle traffic trajectory data, and a queue length attenuation coefficient is calculated. For example, if the queue length was 50 meters before implementing control parameters and decreased to 30 meters afterward, the queue length attenuation coefficient is (50-30) / 50 = 40%.
[0128] Step S345: Simultaneously extract safety risk indicators based on pedestrian movement path offset. Safety risk indicators include pedestrian crossing conflict rate, emergency braking frequency, and pedestrian waiting time exceeding limit.
[0129] Pedestrian path offset reflects changes in pedestrian movement paths after traffic light control parameters are adjusted, and safety risk indicators are extracted based on this. The pedestrian crossing conflict rate is the ratio of the number of pedestrian-vehicle conflict events to the total number of pedestrian crossings within a set time period. By analyzing pedestrian path offset and vehicle trajectory change data, it is determined whether pedestrian-vehicle conflicts have occurred. The number of conflict events and the total number of pedestrian crossings are counted to calculate the pedestrian crossing conflict rate. For example, if there are 200 pedestrian crossings in one hour and 2 pedestrian-vehicle conflict events occur, then the pedestrian crossing conflict rate is 2 / 200 = 1%.
[0130] Emergency braking frequency refers to the number of times a vehicle brakes suddenly due to pedestrians or other traffic situations within a set time period. Emergency braking behavior is identified by analyzing speed changes in vehicle trajectory data and pedestrian movement path deviations, and the number of emergency braking events is counted to obtain the emergency braking frequency. For example, if a vehicle brakes suddenly 10 times in one hour, the emergency braking frequency is 10 times / hour.
[0131] The pedestrian waiting time exceeding the limit ratio refers to the ratio of the number of pedestrians waiting longer than the preset waiting time to the total number of people crossing the street. The pedestrian waiting time is determined based on the pedestrian movement path offset. This waiting time is then compared to the preset waiting time, and the number of people waiting longer than the preset waiting time is counted against the total number of people crossing the street to calculate the pedestrian waiting time exceeding the limit ratio. For example, if the preset pedestrian waiting time is 30 seconds, and in a single count of 150 people crossing the street, 30 people waited longer than 30 seconds. Therefore, the pedestrian waiting time exceeding the limit ratio is 30 / 150 = 20%.
[0132] Step S346: Compare the traffic efficiency index with the preset efficiency threshold, select the first candidate parameter set whose traffic efficiency index exceeds the threshold, compare the safety risk index with the critical value, remove the parameters whose safety risk index is higher than the critical value from the first candidate parameter set, and generate the second candidate parameter set.
[0133] The preset efficiency threshold is a pre-set minimum standard for measuring traffic efficiency, and the critical value is a pre-set maximum standard for measuring safety risk. The traffic efficiency indicators calculated in step S344 are compared with the preset efficiency thresholds. For example, the preset thresholds for reducing average vehicle delay rate are 20%, increasing green light utilization rate is 5%, and decreasing queue length coefficient is 30%. For each control parameter, if the average vehicle delay reduction rate, the increase in green light utilization rate, and the decreasing queue length coefficient all exceed the corresponding threshold, then the control parameter is included in the first candidate parameter set.
[0134] Next, the safety risk indicators extracted in step S345 are compared with the critical values. Assuming the critical value for pedestrian crossing conflict incidents is 1.5%, the critical value for emergency braking frequency is 12 times / hour, and the critical value for pedestrian waiting time exceeding the limit is 25%, parameters with safety risk indicators below the critical values are selected from the first candidate parameter set, while parameters with safety risk indicators above the critical values are removed, generating a second candidate parameter set. For example, if the first candidate parameter set contains 5 control parameters, after comparing the traffic efficiency indicators, 3 parameters meet the requirements and enter the first candidate parameter set; after further comparing the safety risk indicators, one parameter has a pedestrian crossing conflict incident rate of 2%, which is higher than the critical value of 1.5%, and is removed, finally resulting in a second candidate parameter set containing 2 parameters.
[0135] Step S347: If the second candidate parameter set is empty, perform gradient perturbation optimization on the parameters in the initial control parameter set to generate a new control parameter set and re-execute the spatiotemporal alignment matching and virtual simulation process until a non-empty second candidate parameter set is obtained.
[0136] If the second candidate parameter set is empty, it means that none of the parameters in the initial control parameter set can simultaneously meet the requirements of traffic efficiency and safety risk. In this case, gradient perturbation optimization is performed on the parameters in the initial control parameter set. Gradient perturbation optimization is a gradient-based optimization method that makes small adjustments to the control parameters to make them change in a more optimal direction. For example, for the green light duration parameter, it can be slightly increased or decreased based on the gradient information of traffic efficiency and safety risk indicators.
[0137] After generating a new set of control parameters, the spatiotemporal alignment matching in step S342 is re-executed. Each control parameter in the new set is matched with a traffic flow state snapshot to generate a new simulation task queue. Then, the new simulation task queue is executed in the virtual simulation environment of the reinforcement learning algorithm, repeating steps S343-S346, which involves dynamically modifying the phase switching logic of the virtual traffic lights, recording vehicle trajectory changes and pedestrian path offsets, calculating traffic efficiency and safety risk indicators, and comparing and filtering them until a non-empty second candidate parameter set is obtained. For example, after multiple gradient perturbation optimizations and re-simulations, a non-empty second candidate parameter set containing three parameters is finally obtained.
[0138] Step S348: Based on the weighted score ranking of the traffic efficiency index and safety risk index of the parameters in the second candidate parameter set, select the parameter with the highest score as the target traffic light control parameter.
[0139] To comprehensively consider traffic efficiency and safety risks, a weighted scoring system is applied to the traffic efficiency and safety risk indicators in the second candidate parameter set. First, different weights are assigned to the traffic efficiency and safety risk indicators, for example, a weight of 0.6 for the traffic efficiency indicator and 0.4 for the safety risk indicator. For the traffic efficiency indicators, the average vehicle delay reduction rate, the improvement in green light utilization rate, and the queue length decay coefficient, weights can also be assigned separately, such as a weight of 0.4 for the average vehicle delay reduction rate, 0.3 for the improvement in green light utilization rate, and 0.3 for the queue length decay coefficient. Similarly, for the safety risk indicators, the pedestrian crossing conflict rate, the emergency braking frequency, and the proportion of pedestrian waiting time exceeding the limit, weights are also assigned, such as a weight of 0.5 for the pedestrian crossing conflict rate, 0.3 for the emergency braking frequency, and 0.2 for the proportion of pedestrian waiting time exceeding the limit.
[0140] Calculate a weighted score for each parameter. For example, for a certain parameter, the average vehicle delay reduction rate is 25%, the green light utilization rate is 8%, the queue length decay coefficient is 35%, the pedestrian crossing conflict rate is 1%, the emergency braking frequency is 10 times / hour, and the pedestrian waiting time exceeding the limit is 15%. The traffic efficiency score is calculated as follows: 0.4 × 25% + 0.3 × 8% + 0.3 × 35% = 0.1 + 0.024 + 0.105 = 0.229; the safety risk score is calculated as follows: 0.5 × (1 - 1%) + 0.3 × (1 - 10 / 12) + 0.2 × (1 - 15%) = 0.5 × 0.99 + 0.3 × (1 - 0.833) + 0.2 × 0.85 = 0.495 + 0.05 + 0.17 = 0.715; the total weighted score is calculated as follows: 0.6 × 0.229 + 0.4 × 0.715 = 0.1374 + 0.286 = 0.4234.
[0141] The parameters in the second candidate parameter set are sorted according to their weighted scores, and the parameter with the highest score is selected as the target traffic light control parameter. For example, if there are 3 parameters in the second candidate parameter set, and parameter A has the highest score after weighted scoring, then parameter A will be selected as the target traffic light control parameter.
[0142] Step S400: Send the target traffic light control parameters to the traffic signal control terminal of the target intersection, and monitor the traffic status change data of the target intersection in real time to update the weight parameters of the spatiotemporal analysis model.
[0143] A traffic signal control terminal is a device installed at the target intersection to control traffic lights. The target traffic light control parameters generated in step S300 are sent to this terminal, causing the traffic lights to switch phases according to the target traffic light control parameters. For example, the target traffic light control parameters are a green light duration of 40 seconds, a yellow light transition interval of 4 seconds, and a pedestrian-only phase trigger condition of more than 12 pedestrians. After receiving these parameters, the traffic signal control terminal will adjust the control logic of the traffic lights.
[0144] Real-time monitoring of traffic condition changes at the target intersection reflects the actual traffic situation after adopting the target traffic light control parameters. By monitoring this data, the weight parameters of the spatiotemporal analysis model are updated to improve the model's accuracy in predicting traffic conditions. For example, cameras and sensors installed at the intersection collect real-time traffic video, vehicle speed, and pedestrian volume data, which is then used for subsequent analysis and model updates.
[0145] As one implementation method, step S400, which involves real-time monitoring of traffic state changes at the target intersection to update the weight parameters of the spatiotemporal analysis model, may specifically include:
[0146] Step S410: After the target traffic light control parameters are executed, continuously collect the feedback video stream of the target intersection, and extract the vehicle throughput change characteristics, pedestrian waiting queue length characteristics, and traffic light switching delay time from the feedback video stream.
[0147] Feedback video stream refers to the traffic video stream continuously collected by cameras installed at the target intersection after the target traffic light control parameters are executed. Vehicle throughput characteristic refers to the change in the percentage of vehicles passing through the intersection over time after the target traffic light control parameters are adopted. The change in vehicle throughput is calculated by analyzing the number and time of vehicles passing through the intersection in the feedback video stream. For example, if the original vehicle throughput was 80% over a certain period, and after adopting the new control parameters, the vehicle throughput becomes 85%, then the vehicle throughput characteristic reflects this trend.
[0148] Pedestrian waiting queue length characteristics refer to the change in the length of the pedestrian waiting queue at the crosswalk over time after the target traffic light control parameters are executed. By processing and analyzing the feedback video stream, the boundaries of the pedestrian waiting queue are identified, the queue length is measured, and the queue length at different time points is statistically analyzed to obtain the pedestrian waiting queue length characteristics. For example, before the green light turns on, the pedestrian waiting queue length gradually increases, and after the green light turns on, the queue length gradually decreases.
[0149] Traffic light switching delay time refers to the difference between the actual switching time and the theoretical switching time of a traffic light. It is calculated by analyzing the color change times of the traffic lights in the feedback video stream and comparing them with the theoretical switching times in the target traffic light control parameters. For example, if the target traffic light control parameters specify that the green light should switch to yellow after 40 seconds, but the actual switching occurs after 42 seconds, then the traffic light switching delay time is 2 seconds.
[0150] Step S420: Perform a difference analysis on the characteristics of vehicle throughput change, pedestrian waiting queue length, and traffic light switching delay with the traffic state vector to generate a set of model error indices.
[0151] The traffic state vector, generated in step S200, characterizes the congestion level, vehicle priority, and pedestrian safety risk indicators of the target intersection. The vehicle throughput change characteristics, pedestrian waiting queue length characteristics, and traffic light switching delay time extracted in step S410 are compared with the traffic state vector using a difference analysis to evaluate the predictive accuracy of the spatiotemporal analysis model.
[0152] Specifically, the vehicle throughput change features, pedestrian waiting queue length features, and traffic light switching delay times extracted from the feedback video stream are first aligned with time windows to generate feedback time series data consistent with the prediction time range of the traffic state vector. For example, if the prediction time range of the traffic state vector is every 5 minutes, the vehicle throughput change features, pedestrian waiting queue length features, and traffic light switching delay times are also statistically analyzed and organized every 5 minutes to obtain the feedback time series data.
[0153] Then, the vehicle throughput rate variation features in the feedback time series data are compared frame by frame with the vehicle traffic priority weights in the traffic state vector to generate a vehicle traffic difference vector. This vehicle traffic difference vector contains the deviation between the actual throughput rate and the predicted priority weights within each time window. For example, if the traffic state vector predicts a throughput rate of 80% corresponding to the vehicle traffic priority weights within a certain time window, while the actual vehicle throughput rate is 75%, then the deviation within that time window is 80% - 75% = 5%.
[0154] Next, the pedestrian waiting queue length features in the feedback time series data are correlated and mapped with the pedestrian safety risk index in the traffic state vector. The frequency and duration of abnormal fluctuations in pedestrian waiting queue length outside the threshold range corresponding to the safety risk index are extracted. For example, when the pedestrian safety risk index is within a certain threshold range, the pedestrian waiting queue length should fluctuate within a set range; if it exceeds this range, it is considered an abnormal fluctuation, and the frequency and duration of abnormal fluctuations are statistically analyzed. Then, the traffic light switching delay time in the feedback time series data is coupled with the congestion level score in the traffic state vector to identify the cumulative delay deviation of the traffic light switching delay time within different congestion level score intervals. For example, in intervals with higher congestion level scores, the traffic light switching delay time may be longer, and the cumulative delay deviation within different congestion level score intervals is statistically analyzed. Finally, a three-dimensional error space is constructed based on the deviation magnitude, abnormal fluctuation frequency and duration proportion, and cumulative delay deviation in the vehicle traffic difference vector. The Euclidean distance and covariance relationship of each dimension of the error index are calculated in the three-dimensional error space. Based on Euclidean distance and covariance relationship, a set of model error indices is generated, including vehicle traffic consistency error, pedestrian safety prediction error and signal response delay error. This set is used to quantify the local bias and global offset trend of the spatiotemporal analysis model in real-time decision-making.
[0155] Step S421: Perform time window alignment processing on the vehicle throughput change features, pedestrian waiting queue length features, and traffic light switching delay time extracted from the feedback video stream to generate feedback time series data that is consistent with the prediction time range of the traffic state vector.
[0156] Time window alignment is performed to match the vehicle throughput variation features, pedestrian queue length features, and traffic light switching delays extracted from the feedback video stream with the prediction time range of the traffic state vector. The traffic state vector is predicted at time intervals, such as every 5 minutes. Therefore, the feature data extracted from the feedback video stream also needs to be processed and statistically analyzed according to the same time intervals.
[0157] To analyze the characteristics of vehicle throughput changes, the number of vehicles passing through the intersection within each time window is counted, and the vehicle throughput rate is calculated. For example, if 100 vehicles pass through the intersection within a 5-minute time window, and the theoretically passable number of vehicles within that time window is 120, then the vehicle throughput rate is approximately 100 / 120 (83.3%).
[0158] For the pedestrian waiting queue length characteristic, the length of the pedestrian waiting queue is measured at the end of each time window. For example, at the end of a 5-minute time window, the length of the pedestrian waiting queue is 20 meters.
[0159] For traffic light switching delay time, record the difference between the actual switching time and the theoretical switching time of the traffic light within each time window. For example, within a 5-minute time window, if a traffic light has a theoretical switching time of 3 minutes, but actually switches at 3 minutes and 20 seconds, then the traffic light switching delay time within that time window is 20 seconds.
[0160] These statistical data, organized by time window, are combined to generate feedback time series data that aligns with the predicted time range of the traffic state vector, facilitating subsequent discrepancy analysis.
[0161] Step S422: Compare the vehicle throughput change features in the feedback time series data with the vehicle traffic priority weights in the traffic state vector frame by frame to generate a vehicle traffic difference vector. The vehicle traffic difference vector contains the deviation between the actual throughput and the predicted priority weights in each time window.
[0162] Vehicle priority weights are numerical values in the traffic state vector that represent the priority of vehicles at intersections, and they are related to vehicle throughput. By comparing the vehicle throughput variation features in the feedback time series data with the vehicle priority weights in the traffic state vector frame by frame, we can discover the differences between the model's predicted vehicle traffic conditions and the actual situation.
[0163] Within each time window, the actual vehicle throughput is compared to the throughput predicted based on vehicle traffic priority weights. For example, if the vehicle traffic priority weights in the traffic state vector indicate that the vehicle throughput should be 85% within a certain time window, and the actual vehicle throughput is 80%, then the deviation within that time window is 85% - 80% = 5%. The deviation for each time window is recorded to form a vehicle traffic difference vector. This vector reflects the prediction error of vehicle traffic conditions in different time windows, helping to analyze the model's accuracy in vehicle traffic prediction.
[0164] Step S423: Associate and map the pedestrian waiting queue length feature in the feedback time series data with the pedestrian safety risk index in the traffic state vector, and extract the abnormal fluctuation frequency and duration of the pedestrian waiting queue length outside the threshold range corresponding to the safety risk index.
[0165] The pedestrian safety risk index is a metric in the traffic state vector used to assess the level of pedestrian safety risk at intersections, and it is related to the length of pedestrian waiting queues. Generally, when the pedestrian safety risk index is within different threshold ranges, the length of pedestrian waiting queues should fluctuate within the corresponding range.
[0166] First, different threshold ranges for the pedestrian safety risk index and the reasonable range for pedestrian waiting queue lengths corresponding to each range are determined. For example, when the pedestrian safety risk index is low, the pedestrian waiting queue length should be short; when the pedestrian safety risk index is high, the pedestrian waiting queue length may be long. Then, the pedestrian waiting queue length characteristics in the feedback time series data are correlated and mapped to these threshold ranges. For each time window, it is determined whether the pedestrian waiting queue length exceeds the reasonable range of the corresponding safety risk index threshold range. If it does, it is considered an abnormal fluctuation. The frequency of abnormal fluctuations is calculated, i.e., the ratio of the number of time windows with abnormal fluctuations to the total number of time windows. Simultaneously, the duration percentage of abnormal fluctuations is calculated, i.e., the ratio of the total duration of abnormal fluctuations to the total time. For example, if abnormal fluctuations occur in 2 out of 10 time windows, the total duration of abnormal fluctuations is 20 minutes, and the total time is 100 minutes, then the frequency of abnormal fluctuations is 2 / 10 = 20%, and the duration percentage of abnormal fluctuations is 20 / 100 = 20%. These indicators reflect the accuracy of the model in predicting pedestrian safety risks.
[0167] Step S424: Couple the signal light switching delay time in the feedback time series data with the congestion level score in the traffic state vector to identify the cumulative delay deviation of the signal light switching delay time in different intervals of the congestion level score.
[0168] Congestion level score is an indicator in the traffic state vector used to describe the degree of congestion at a target intersection. Traffic light switching delay time is correlated with the congestion level. Generally, in cases of higher congestion levels, the traffic light switching delay time may be longer.
[0169] The traffic light switching delay times in the feedback time series data are divided into different intervals according to the congestion level score. For example, the congestion level score is divided into three intervals: light congestion, moderate congestion, and heavy congestion. For each interval, the cumulative value of the traffic light switching delay time is calculated and compared with the theoretical traffic light switching delay time within that interval to obtain the cumulative delay deviation.
[0170] For example, in a lightly congested area, the theoretical cumulative traffic light switching delay time is 10 minutes, while the actual cumulative delay time is 12 minutes. Therefore, the cumulative delay deviation in this area is 12 - 10 = 2 minutes. This coupled analysis allows us to understand the difference between the actual traffic light switching delay time and the model prediction under different congestion levels, helping to identify shortcomings in the model's traffic light control capabilities.
[0171] Step S425: Construct a three-dimensional error space based on the deviation magnitude, abnormal fluctuation frequency and duration ratio, and cumulative delay deviation in the vehicle traffic difference vector, and calculate the Euclidean distance and covariance relationship of each dimension error index in the three-dimensional error space.
[0172] The three-dimensional error space is composed of three dimensions: the deviation magnitude, the frequency and duration of abnormal fluctuations in the vehicle traffic difference vector, and the cumulative delay deviation. In this space, each point represents the error situation within a time window or a statistical period.
[0173] Euclidean distance is an indicator used to measure the distance between two points in a three-dimensional error space, reflecting the overall degree of difference between different error scenarios. For two distinct error points (x_1, y_1, z_1) and (x_2, y_2, z_2), where x represents the deviation magnitude in the vehicle traffic difference vector, y represents the proportion of abnormal fluctuation frequency and duration, and z represents the cumulative delay deviation, the Euclidean distance d = \sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2}. By calculating the Euclidean distance between different time windows or statistical periods, the trend and stability of error changes can be analyzed.
[0174] Covariance is used to measure the correlation between dimensions in a three-dimensional error space. For example, calculating the covariance between the deviation magnitude and the proportion of abnormal fluctuation frequency and duration in the vehicle traffic difference vector indicates a positive correlation between the two dimensions if the covariance is positive (i.e., an increase in error in one dimension may also increase error in the other); a negative covariance indicates a negative correlation; and a covariance close to 0 indicates a weak correlation. By analyzing covariance, we can understand the mutual influence between errors in each dimension, providing a basis for model updates and optimizations.
[0175] Step S426: Generate a set of model error indices based on Euclidean distance and covariance relationship, which includes vehicle traffic consistency error, pedestrian safety prediction error and signal response delay error. The set of model error indices is used to quantify the local bias and global offset trend of the spatiotemporal analysis model in real-time decision-making.
[0176] Vehicle traffic consistency error reflects the degree of difference between the model's predicted vehicle traffic conditions and the actual situation. It can be determined by the deviation magnitude in the vehicle traffic difference vector and by correlation analysis in the three-dimensional error space. For example, the vehicle traffic consistency error can be calculated by comprehensively considering the average deviation magnitude of the vehicle traffic difference vector and its covariance relationship with other dimensions.
[0177] Pedestrian safety prediction error reflects the model's accuracy in predicting pedestrian safety risks. It is primarily calculated based on the proportion of abnormal fluctuation frequency and duration, as well as their relationship with other dimensions. For example, the higher the abnormal fluctuation frequency, the greater the proportion of duration, and the stronger the correlation with other error dimensions, the larger the pedestrian safety prediction error. Signal response delay error reflects the model's predictive accuracy in traffic light control. It is determined by the cumulative delay deviation and the analysis results in the three-dimensional error space. For example, the larger the cumulative delay deviation and the more complex the covariance relationship with other error dimensions, the larger the signal response delay error.
[0178] By combining vehicle traffic consistency error, pedestrian safety prediction error, and signal response delay error, a model error metric set is generated. This set can quantify the local bias of the spatiotemporal analysis model in real-time decision-making, such as the error situation in a certain time window or a certain traffic scenario; it can also reflect the global offset trend, such as the overall change trend of model error over time. By analyzing the model error metric set, the weight parameters of the spatiotemporal analysis model can be updated in a targeted manner, thereby improving the model's performance.
[0179] Step S430: Adjust the attention weight allocation parameters and the bias terms of the fully connected layer in the spatiotemporal analysis model according to the model error index set, and fine-tune the adjusted spatiotemporal analysis model using the incremental learning algorithm.
[0180] Attention weight allocation parameters are used to weight different features in the spatiotemporal analysis model to highlight important feature information. The bias terms of the fully connected layer are learnable parameters that influence the model's output. Based on the model error index set generated in step S420, the attention weight allocation parameters and the bias terms of the fully connected layer in the spatiotemporal analysis model are adjusted.
[0181] For example, if the model error metric set shows a large vehicle traffic consistency error, it indicates that the model may be insufficient in processing vehicle traffic-related features. In this case, the attention weight allocation parameters can be adjusted to increase the weight of vehicle traffic-related features, making the model pay more attention to these features. For the bias terms of fully connected layers, they can be adjusted according to the direction and magnitude of the error to reduce the error.
[0182] Incremental learning algorithms are used to fine-tune the adjusted spatiotemporal analysis model. In this embodiment of the invention, newly acquired traffic video stream data and a set of model error indicators are used as input to train the adjusted spatiotemporal analysis model. Through incremental learning, the model can adapt to new traffic conditions without forgetting previously learned knowledge, further improving the model's accuracy.
[0183] Step S440: When any indicator in the model error indicator set exceeds the preset update threshold, the full parameter retraining process of the spatiotemporal analysis model is triggered, and the updated model weight parameters are generated based on the latest traffic video stream.
[0184] The preset update threshold is a pre-defined standard used to determine whether a full-parameter retraining of the spatiotemporal analysis model is necessary. If any one of the vehicle traffic consistency error, pedestrian safety prediction error, or signal response delay error in the model error index set exceeds the preset update threshold, it indicates that the model's performance has degraded to the point where retraining is required.
[0185] The process triggers a full-parameter retraining of the spatiotemporal analysis model, starting from step S201 again. This involves collecting the latest traffic video stream data and corresponding traffic status labels, performing spatiotemporal slicing and data augmentation on the historical traffic video dataset, constructing the initial spatiotemporal analysis model, and iteratively training the model using a multi-task loss function. During retraining, the latest traffic data is used to update the model's weight parameters, enabling the model to better adapt to new traffic conditions.
[0186] For example, if the preset update threshold for vehicle traffic consistency error is 15%, and the vehicle traffic consistency error in the model error index set reaches 18%, exceeding the preset update threshold, then a full parameter retraining process is triggered. Through retraining, updated model weight parameters are generated, improving the accuracy and reliability of the spatiotemporal analysis model.
[0187] As one implementation method, the method provided in this application embodiment further includes the step of deploying a model lightweight module in an edge computing device, including:
[0188] Step S500: Perform channel pruning on the trained spatiotemporal analysis model, removing output channels in the convolutional layers whose absolute weight values are lower than a preset threshold.
[0189] Channel pruning is a model compression technique used to reduce the number of parameters and computational cost of a model, thereby improving its operational efficiency. In a trained spatiotemporal analysis model, convolutional layers contain multiple output channels, each corresponding to a feature map. By analyzing the absolute value of the weights of each output channel in the convolutional layer, output channels with absolute weight values below a preset threshold are removed.
[0190] A preset threshold is a pre-defined standard used to determine whether to remove a particular output channel. For example, setting the preset threshold to 0.01 means that for a given output channel in a convolutional layer, if the absolute value of its weight is less than 0.01, the channel is considered to contribute little to the model and will be removed. Channel pruning can reduce the number of model parameters and computational cost without significantly degrading model performance, making the model more suitable for running on edge computing devices.
[0191] Step S600: Perform quantization-aware training on the pruned model, convert the floating-point weight parameters into a preset integer format, and optimize the rounding error during the quantization process.
[0192] Quantization-aware training is a method that incorporates quantization operations during model training. It converts floating-point weight parameters into a preset integer format while optimizing rounding errors during quantization. Quantization-aware training is then performed on the pruned model after channel pruning.
[0193] A preset integer format refers to the number of integer bits used to convert floating-point weight parameters, such as an 8-bit integer format. In quantization-aware training, the model's training objective is not only to minimize prediction error but also to minimize rounding errors during quantization. By simulating quantization operations during training, the model can learn weight parameters that are more suitable for quantization. For example, using a quantization-aware training algorithm, the floating-point weight parameters are quantized in each training iteration, the quantization error is calculated, and this error is incorporated into the loss function for optimization. In this way, floating-point weight parameters are converted to a preset integer format, reducing quantization error and improving the model's quantization performance.
[0194] Step S700: Convert the quantized model into an instruction set format supported by the hardware accelerator, and load the model parameters into the cache area of the edge computing device through memory mapping.
[0195] Different hardware accelerators support different instruction set formats. Converting the quantized model to an instruction set format supported by the hardware accelerator allows for accelerated inference on edge computing devices. Memory mapping maps the contents of a file or device to the address space of a process. Through memory mapping, the quantized model parameters are loaded into the cache area of the edge computing device, enabling the model to quickly access these parameters during inference and improving inference efficiency. For example, the quantized model can be converted to the CUDA instruction set format supported by the GPU, and then the model parameters can be loaded into the GPU cache of the edge computing device through memory mapping. When performing model inference, the GPU can directly read the model parameters from the cache, speeding up inference.
[0196] Step S800: Enable dynamic computation graph optimization during the model inference stage to automatically skip redundant convolution operations based on the resolution of the real-time video stream.
[0197] Dynamic computation graph optimization (CGM) is an optimization method that dynamically adjusts the computation graph based on the characteristics of the input data during the model inference phase. In edge computing devices, the resolution of real-time video streams may vary. Based on the resolution of the real-time video stream, CGM can automatically skip redundant convolution operations, reducing unnecessary computation. For example, when the resolution of the real-time video stream is low, some convolution operations may have a small impact on the model's output, and these operations can be skipped. Through CGM, the inference efficiency of the model can be improved while ensuring its accuracy, thus reducing the computational burden on edge computing devices.
[0198] As one implementation method, the deployment process of the model lightweight module also includes:
[0199] Step S900: Configure a dual-model operation mode in the edge computing device. The dual-model operation mode includes a high-precision mode and an energy-saving mode. The high-precision mode uses an unpruned spatiotemporal analysis model, and the energy-saving mode uses a pruned and quantized lightweight model.
[0200] To meet the needs of different application scenarios, a dual-model operation mode is configured in the edge computing device. The high-precision mode uses an unpruned spatiotemporal analysis model, which has high accuracy but high computational and energy consumption. The energy-saving mode uses a pruned and quantized lightweight model, which has fewer parameters and lower computational cost, resulting in lower energy consumption, but its accuracy may decrease. For example, when traffic flow is high and high accuracy in traffic state prediction is required, the high-precision mode is selected, using the unpruned spatiotemporal analysis model for traffic state analysis; when traffic flow is low and energy consumption is high, the energy-saving mode is selected, using the pruned and quantized lightweight model for analysis.
[0201] Step S1000: Monitor the computing resource utilization rate and remaining battery power of the edge computing device in real time. When the resource utilization rate exceeds the first threshold or the battery power is lower than the second threshold, automatically switch to energy saving mode.
[0202] The system monitors the real-time utilization of computing resources in edge computing devices, such as CPU and GPU utilization, as well as remaining battery power. A first threshold is a pre-set standard for determining if computing resource utilization is too high, and a second threshold is a pre-set standard for determining if battery power is too low. When computing resource utilization exceeds the first threshold or battery power falls below the second threshold, it indicates that the edge computing device is experiencing resource strain or insufficient battery power, and it automatically switches to power-saving mode. For example, the first threshold can be set to 80%, and the second threshold to 20%. When the CPU utilization of the edge computing device reaches 85%, exceeding the first threshold, or the battery power drops to 15%, below the second threshold, it automatically switches from high-precision mode to power-saving mode, using a lightweight model with pruned quantization for computation to reduce computing resource consumption and energy usage.
[0203] Step S1100: In energy-saving mode, start the model output corrector and use the statistical distribution of historical traffic state vectors to compensate for the deviation of the output of the lightweight model.
[0204] In energy-saving mode, the output of the lightweight model, which has undergone quantization and pruning, may exhibit some bias. To improve the accuracy of the lightweight model's output, a model output corrector is activated. This corrector compensates for the bias in the lightweight model's output using the statistical distribution of historical traffic state vectors. First, a large number of historical traffic state vectors are collected, and their statistical distribution characteristics, such as mean and variance, are analyzed. Then, based on the output of the lightweight model and the statistical distribution of historical traffic state vectors, a bias compensation value is calculated. For example, if the congestion level score output by the lightweight model is lower than the mean of the historical statistical distribution, the congestion level score is adjusted upwards to compensate for the bias. This method improves the output accuracy of the lightweight model in energy-saving mode.
[0205] Step S1200: When the complexity of the traffic scene is detected to exceed the processing capacity of the lightweight model, the cloud collaborative reasoning mechanism is triggered to upload part of the video stream data to the cloud server and integrate the output of the cloud model to generate the final decision parameters.
[0206] Traffic scene complexity refers to the number of traffic elements and the complexity of their motion states within the scene. When the complexity of the traffic scene exceeds the processing capacity of the lightweight model, it indicates that the lightweight model may not be able to accurately analyze the current traffic state.
[0207] At this point, the cloud-based collaborative reasoning mechanism is triggered, uploading a portion of the video stream data to the cloud server. The cloud server possesses stronger computing power and more complex models, enabling it to handle more complex traffic scenarios. The cloud server uses its cloud model to analyze the uploaded video stream data and outputs the analysis results.
[0208] The outputs of the lightweight model and the cloud model are fused to generate the final decision parameters. For example, a weighted averaging method can be used, assigning different weights to the outputs of the lightweight model and the cloud model based on their accuracy and reliability, and then performing a weighted average to obtain the final decision parameters. Through cloud-based collaborative inference mechanisms, the processing capability and decision accuracy for complex traffic scenarios are improved while ensuring low power consumption of edge computing devices.
[0209] Please see Figure 3 This is a schematic diagram of the structure of an edge computing traffic light intelligent decision-making system provided in an embodiment of this application, including a processor 101 and a memory 103. The processor 101 and the memory 103 are connected, for example, via a bus 102. Optionally, the edge computing traffic light intelligent decision-making system 100 may further include a transceiver 104. It should be noted that in practical applications, the transceiver 104 is not limited to one, and the structure of this edge computing traffic light intelligent decision-making system 100 does not constitute a limitation on the embodiments of this application. The memory 103 stores computer-readable code, which, when executed by one or more processors 101, causes the one or more processors 101 to perform the method provided in the embodiments of this application.
Claims
1. An edge computing-based intelligent decision-making method for traffic lights integrating AI video analytics, characterized in that, The method includes: Real-time traffic video streams of the target intersection are collected by edge computing devices, and a set of dynamic traffic features is extracted from the real-time traffic video streams. The set of dynamic traffic features includes traffic flow distribution features, vehicle behavior trajectory features, and pedestrian movement trend features. The pre-trained spatiotemporal analysis model is invoked to perform multimodal fusion processing on the dynamic traffic feature set to generate the traffic state vector of the target intersection. The traffic state vector is used to characterize the congestion level, vehicle passage priority and pedestrian safety risk index of the target intersection. Based on the traffic state vector matching, candidate control strategies are selected from the preset decision rule base, and at least two candidate control strategies with the highest matching degree with the traffic state vector are selected from the decision rule base. The candidate control strategies include green light duration baseline parameters, yellow light transition interval threshold and pedestrian-only phase triggering conditions. Each candidate control strategy and the traffic state vector are input into the strategy evaluation module in the strategy optimization model to obtain the historical execution record corresponding to the candidate control strategy. The traffic flow state change sequence triggered by the candidate control strategy within the historical time window is extracted from the historical execution record. The traffic flow state change sequence includes the average vehicle delay change rate, the cumulative value of the number of stops, and the frequency of pedestrian conflict events. The traffic flow state change sequence is segmented into time windows to generate multiple consecutive sub-time period feature sets. Each sub-time period feature set includes the fluctuation range of the average vehicle delay change rate, the growth slope of the cumulative number of stops, and the distribution density of pedestrian conflict event frequency. The sub-time period feature set is input into a pre-trained traffic efficiency prediction model. Traffic efficiency correlation features at different time granularities are extracted through the multi-scale temporal convolutional layer in the traffic efficiency prediction model. Based on the traffic efficiency correlation features, the traffic efficiency index of the candidate control strategy after simulation execution is generated. The feature set of the sub-time period is synchronously input into the safety risk assessment model. The event prediction network in the safety risk assessment model is used to identify the spatiotemporal correlation pattern between the frequency of pedestrian conflict events and the sudden change in vehicle acceleration. The safety risk index corresponding to the candidate control strategy is then output. The expected traffic efficiency gain is calculated based on the difference between the traffic efficiency index and the historical benchmark traffic efficiency, and the safety risk attenuation coefficient is calculated based on the degree of deviation of the safety risk index from the preset safety threshold, wherein the expected traffic efficiency gain and the safety risk attenuation coefficient constitute the evaluation weight parameters of the candidate control strategy. Based on the expected traffic efficiency gain and safety risk attenuation coefficient, each candidate control strategy is dynamically weighted to generate an initial control parameter set. By simulating the execution effect of the initial set of control parameters in historical traffic scenarios using reinforcement learning algorithms, control parameters that meet the preset efficiency threshold and have a safety risk below the critical value are selected as target traffic light control parameters. The target traffic light control parameters are sent to the traffic signal control terminal of the target intersection, and the traffic status change data of the target intersection is monitored in real time to update the weight parameters of the spatiotemporal analysis model.
2. The method according to claim 1, characterized in that, The extraction of the dynamic traffic feature set from the real-time traffic video stream includes: The real-time traffic video stream is processed by frame segmentation to obtain a continuous video frame sequence. Multi-target detection is performed on each video frame in the video frame sequence to obtain vehicle position coordinate set, pedestrian position coordinate set and traffic sign bounding box data. The vehicle position coordinate set is spatiotemporally correlated using a trajectory tracking algorithm to generate a driving trajectory sequence for each vehicle, and the vehicle speed change curve, acceleration distribution characteristics, and lane occupancy frequency are calculated based on the driving trajectory sequence. Group behavior analysis was performed on the set of pedestrian location coordinates to extract the consistency characteristics of pedestrian movement direction, pedestrian density fluctuation characteristics, and dwell time at pedestrian crossings; The vehicle speed change curve, acceleration distribution characteristics, lane occupancy frequency, pedestrian movement direction consistency characteristics, pedestrian density fluctuation characteristics, and pedestrian crossing dwell time are normalized to generate the dynamic traffic feature set.
3. The method according to claim 2, characterized in that, The process of calling a pre-trained spatiotemporal analysis model to perform multimodal fusion processing on the dynamic traffic feature set to generate the traffic state vector of the target intersection includes: The dynamic traffic feature set is input into the time feature extraction branch of the spatiotemporal analysis model, and the periodic fluctuation features and sudden abnormal event features of traffic flow in the time dimension are extracted through the temporal convolutional network. The dynamic traffic feature set is input into the spatial feature extraction branch of the spatiotemporal analysis model. The target intersection is divided into multiple sub-regions through a region segmentation network, and the vehicle density gradient features, pedestrian gathering hotspot features, and traffic light visibility distribution of each sub-region are extracted respectively. By employing a cross-modal attention mechanism, weights are assigned to the periodic fluctuation features, sudden abnormal event features, vehicle density gradient features, pedestrian gathering hotspot features, and traffic light visibility distribution in the time dimension, thereby generating a fused global spatiotemporal feature map. The global spatiotemporal feature map is mapped to a preset traffic state space, and the traffic state vector containing congestion level score, vehicle passage priority weight and pedestrian safety risk index is output through a fully connected layer.
4. The method according to claim 1, characterized in that, The real-time monitoring of traffic state changes at the target intersection to update the weight parameters of the spatiotemporal analysis model includes: After the target traffic light control parameters are executed, the feedback video stream of the target intersection is continuously collected, and the vehicle throughput change characteristics, pedestrian waiting queue length characteristics, and traffic light switching delay time in the feedback video stream are extracted. The differences between the vehicle throughput change characteristics, pedestrian waiting queue length characteristics, and traffic light switching delay time and the traffic state vector are analyzed to generate a set of model error indices. The attention weight allocation parameters and bias terms of the fully connected layer in the spatiotemporal analysis model are adjusted according to the model error index set, and the adjusted spatiotemporal analysis model is fine-tuned using an incremental learning algorithm. When any indicator in the set of model error indicators exceeds the preset update threshold, the full parameter retraining process of the spatiotemporal analysis model is triggered, and updated model weight parameters are generated based on the latest traffic video stream.
5. The method according to claim 1, characterized in that, The pre-training process of the spatiotemporal analysis model includes: Collect historical traffic video datasets and corresponding labeled traffic status tags, including manually labeled congestion levels, vehicle priority coefficients, and pedestrian accident records; The historical traffic video dataset is spatiotemporally sliced to generate a training sample sequence, and each training sample in the training sample sequence is subjected to data augmentation processing, which includes illumination change simulation, occlusion addition, and video frame sampling rate perturbation. An initial spatiotemporal analysis model is constructed, which includes a parallel temporal feature extraction network and a spatial feature extraction network, as well as a cross-modal fusion layer; The initial spatiotemporal analysis model is iteratively trained using a multi-task loss function, which includes a weighted sum of congestion level prediction error, vehicle traffic priority classification error, and pedestrian safety risk regression error. When the convergence speed of the multi-task loss function on the validation set is lower than a preset threshold, the parameters of the temporal feature extraction network are frozen and only the weights of the spatial feature extraction network are updated.
6. The method according to claim 5, characterized in that, The training process of the policy optimization model includes: Multiple historical traffic state vectors and corresponding actual execution control parameters are extracted from the historical traffic video dataset, and the actual traffic efficiency and safety indicators of each actual execution control parameter in the subsequent time window are calculated. A neural network structure for constructing a strategy optimization model is provided. The neural network structure includes a strategy generator and a discriminator. The strategy generator is used to generate control parameters based on the input traffic state vector, and the discriminator is used to evaluate the consistency between the distribution of the generated control parameters and the actual control parameters. The policy generator and discriminator are alternately optimized using an adversarial training algorithm until the discriminator can no longer distinguish the difference between the generated control parameters and the real control parameters. The trained strategy generator is fused with preset traffic rule constraints to generate the strategy optimization model that can simultaneously satisfy efficiency optimization and rule compliance. The step of alternately optimizing the policy generator and discriminator through adversarial training algorithm includes: A traffic rule penalty term is introduced into the loss function of the policy generator. The traffic rule penalty term is used to apply gradient penalties to the control parameters that violate the minimum green light duration, maximum red light waiting time and pedestrian priority principle. Add a feature matching constraint to the loss function of the discriminator to ensure that the generated control parameters maintain a consistent statistical distribution with the real control parameters in the hidden layer feature space; The weight parameters of the policy generator and discriminator are updated using a moving average mechanism, and the generated control parameters are tested in a simulated environment after each iteration to screen for effective samples. When the policy generator reaches a preset passage efficiency improvement rate in the simulation environment and the number of violations is lower than the tolerance threshold, the adversarial training process is terminated.
7. The method according to claim 1, characterized in that, The method further includes the step of deploying a model lightweighting module in the edge computing device: Channel pruning is performed on the trained spatiotemporal analysis model to remove output channels in the convolutional layers whose absolute weight values are lower than a preset threshold. The pruned model is subjected to quantization-aware training, the floating-point weight parameters are converted into a preset integer format, and the rounding error in the quantization process is optimized. The quantized model is converted into an instruction set format supported by the hardware accelerator, and the model parameters are loaded into the cache area of the edge computing device through memory mapping. Dynamic computation graph optimization is enabled during the model inference phase to automatically skip redundant convolution operations based on the resolution of the real-time video stream.
8. The method according to claim 7, characterized in that, The deployment process of the model lightweight module also includes: The edge computing device is configured with a dual-model operation mode, which includes a high-precision mode and an energy-saving mode. The high-precision mode uses an unpruned spatiotemporal analysis model, and the energy-saving mode uses a pruned and quantized lightweight model. The edge computing device's computing resource utilization and remaining battery power are monitored in real time. When the resource utilization exceeds a first threshold or the battery power is lower than a second threshold, it automatically switches to energy-saving mode. In energy-saving mode, the model output corrector is activated to compensate for the deviation of the lightweight model output by using the statistical distribution of historical traffic state vectors. When the complexity of the traffic scene exceeds the processing capacity of the lightweight model, a cloud-based collaborative reasoning mechanism is triggered. This mechanism uploads a portion of the video stream data to the cloud server and integrates the output of the cloud model to generate the final decision parameters.
9. An edge computing intelligent decision-making system for traffic lights, characterized in that, include: One or more processors; and one or more memories, wherein the memories store computer-readable code that, when executed by the one or more processors, causes the one or more processors to perform the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Intelligent dynamic traffic light control method and system based on visual identification
CN117711191A
Intelligent traffic signal lamp control method and system, electronic equipment and medium
CN119252031A