Traffic signal control method based on machine vision perception and time-space sequence prediction
By combining machine vision perception with spatiotemporal sequence prediction to improve particle swarm optimization and proportional-integral-derivative control algorithms, the duration of traffic lights is adjusted in real time. This solves the problems of insufficient prediction accuracy and inadequate consideration of carbon emissions in existing traffic signal control, and achieves efficient and low-carbon traffic flow optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHAANXI UNIV OF SCI & TECH
- Filing Date
- 2026-02-02
- Publication Date
- 2026-05-01
AI Technical Summary
Existing traffic signal control technologies are prone to causing traffic congestion during peak hours and wasting resources during off-peak hours. They also suffer from insufficient prediction accuracy, low computational efficiency, and do not fully consider carbon emission constraints, resulting in limited rationality and adaptability of timing schemes.
By combining machine vision perception with spatiotemporal sequence prediction, and improving particle swarm optimization and proportional-integral-derivative control algorithms, PCA-LSTM and WPSO-PID models are constructed to adjust traffic light durations in real time, optimize traffic flow parameters, and reduce carbon emissions.
It improves the accuracy and efficiency of traffic flow prediction, reduces vehicle delay time and queue length, lowers carbon emissions, and is highly adaptable to various urban traffic intersections.
Smart Images

Figure CN121963502A_ABST
Abstract
Description
Traffic signal control method based on machine vision perception and spatiotemporal series prediction Technical Field
[0001] This invention relates to the field of intelligent traffic signal control technology, and in particular to a traffic signal control method based on machine vision perception and spatiotemporal sequence prediction. Background Technology
[0002] With the acceleration of urbanization and the continuous growth of motor vehicle ownership, urban traffic congestion has become increasingly severe, not only reducing residents' travel efficiency but also leading to a large amount of additional carbon emissions, which contradicts the national "dual-carbon" strategic goal. Existing traffic signal control methods mainly include fixed-time control and traditional adaptive-time control: Fixed-time control uses a preset signal light duration allocation scheme, which cannot adapt to the dynamic changes in traffic flow, easily causing traffic congestion during peak hours and wasting resources during off-peak hours; traditional adaptive-time control relies heavily on sensors such as inductive coils to collect data, resulting in high installation and maintenance costs and incomplete data coverage.
[0003] In recent years, some intelligent traffic signal systems have introduced technologies such as the Internet of Things and vehicle-road cooperation. However, such systems have extremely high requirements for communication infrastructure and are difficult to promote in areas with inadequate communication facilities. At the same time, existing traffic flow prediction models mostly use a single LSTM or statistical method, which has problems such as insufficient prediction accuracy and low computational efficiency. Timing optimization algorithms mostly use particle swarm optimization (PSO) or PID algorithms alone, which are difficult to balance global optimization and real-time response capabilities, and do not fully consider carbon emission constraints, resulting in limited rationality and adaptability of timing schemes.
[0004] Therefore, there is an urgent need for an intelligent traffic signal control method that does not rely on advanced communication technologies, has high prediction accuracy, good timing optimization effect, and takes into account low-carbon goals, in order to overcome the shortcomings of existing technologies. Summary of the Invention
[0005] The purpose of this invention is to at least solve one of the technical problems existing in the prior art, and to provide a traffic signal control method based on machine vision perception and spatiotemporal sequence prediction, which can solve the above-mentioned problem.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a traffic signal control method based on machine vision perception and spatiotemporal sequence prediction, comprising the following steps: S1, Machine vision perception: acquiring real-time image data of traffic intersections through image acquisition equipment, preprocessing the image data, and extracting key traffic flow parameters; S2, Spatiotemporal sequence prediction: constructing a PCA-LSTM traffic flow prediction model based on principal component analysis (PCA) and long short-term memory neural network (LSTM), inputting preprocessed historical traffic flow data, and outputting short-term traffic flow prediction results; S3, Timing optimization calculation: constructing a WPSO-PID timing optimization model based on the improved particle swarm optimization (WPSO) algorithm and proportional-integral-derivative (PID) control algorithm, using the traffic flow prediction results as input, and combining traffic congestion evaluation indicators to calculate the optimal traffic signal timing scheme; S4, Signal control execution: adjusting the green, red, and yellow light durations of traffic lights at traffic intersections in real time according to the optimal traffic signal timing scheme, to achieve coordinated traffic signal control for single or multiple intersections.
[0007] Preferably, the image preprocessing in step S1 further includes an edge detection sub-step: using the Canny edge detection algorithm to extract edges from the grayscale image to enhance the distinction between the vehicle outline and the background, wherein the high threshold of the Canny algorithm is set to 80 and the low threshold is set to 40.
[0008] Preferably, in the PCA dimensionality reduction process described in step S2, the top N principal components with a cumulative contribution rate of ≥90% of the feature vectors are selected to construct a projection matrix, where N is an integer from 3 to 5, and the specific value is dynamically adjusted according to the dimensionality redundancy of the traffic flow data.
[0009] Preferably, the fitness function formula in step S3 is F=L+0.3D+0.2S-0.5T, where L is the average queue length of vehicles (unit: m), D is the average delay time of vehicles (unit: s), S is the average number of vehicle stops, T is the vehicle throughput, and the weighting coefficients are determined through calibration using 100 sets of simulation experiments.
[0010] Preferably, the specific strategy for multi-intersection collaborative control in step S4 is as follows: using the traffic flow prediction results of each intersection in the area as constraints, a regional traffic flow equilibrium objective function is constructed, and the green light duration allocation scheme of each intersection is solved synchronously through the WPSO-PID timing optimization model to ensure smooth traffic flow connection between adjacent intersections and avoid secondary congestion in the area.
[0011] Preferably, the image acquisition device in step S1 is installed at a height of 5-8m, with a horizontal viewing angle ≥120° and a vertical viewing angle ≥90°, ensuring coverage of vehicle queuing areas in all directions of the intersection. The key traffic flow parameters also include traffic density and average vehicle speed. The unit for traffic density is veh / 100m, and the unit for average vehicle speed is km / h.
[0012] Preferably, the historical traffic flow data in step S2 has a time span of ≥3 months, a data sampling interval of 5 minutes, and outlier processing is performed before inputting it into the PCA-LSTM model: outliers are removed using the 3σ criterion.
[0013] Preferably, the intersection phase in step S3 is set to four phases, specifically: east-west straight and right turn is phase 1, east-west left turn is phase 2, north-south straight and right turn is phase 3, and north-south left turn is phase 4. The yellow light transition time between each phase is 3-5 seconds, which is dynamically adjusted according to the intersection speed limit.
[0014] The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction also includes a carbon emission calculation step: based on the optimized traffic flow parameters, the formula is used: The total carbon emissions per unit time at the intersection are calculated, where k is the carbon emission coefficient per unit vehicle per unit time, with units of kg / veh·h, ti is the average dwell time of vehicles in the i-th phase, with units of h, and qi is the traffic flow in the i-th phase, with units of veh / h. The total carbon emissions are used as an auxiliary evaluation index for timing optimization.
[0015] Preferably, the real-time adjustment cycle in step S4 is 15-30 minutes, which is dynamically adjusted according to the fluctuation range of the traffic flow prediction results: when the deviation between the predicted value and the real-time value is ≥20%, the adjustment cycle is shortened to 15 minutes; when the deviation is <20%, the adjustment cycle is set to 30 minutes.
[0016] Compared with existing technologies, the beneficial effects of this invention are: 1. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction has higher perception accuracy: It integrates multi-step image processing technologies such as grayscale, edge detection, and binarization to accurately extract parameters such as vehicle queue length and traffic density, with comprehensive data coverage and low acquisition cost; 2. The prediction performance is better: The PCA-LSTM model improves prediction accuracy by 2%-5% and computational efficiency by 15.01% compared with the traditional LSTM through abnormal data processing and dynamic principal component selection.
[0017] 2. This traffic signal control method based on machine vision perception and spatiotemporal sequence prediction offers more comprehensive timing optimization: The WPSO-PID algorithm combines traffic efficiency indicators and carbon emission constraints, and the fitness function weights are calibrated through simulation. At a single intersection, peak-hour vehicle delay time is reduced by 20.16% and queue length by 32.04%, while at multiple intersections, off-peak queue length is reduced by 23.57%, resulting in more efficient collaborative control: Clear collaborative strategies for multiple intersections are defined to avoid secondary congestion within the area and improve overall traffic efficiency.
[0018] 3. This traffic signal control method based on machine vision perception and spatiotemporal sequence prediction has a wider range of applications: it does not rely on 5G IoT or vehicle-road cooperative technology, and can be deployed based on existing hardware. The signal adjustment cycle and phase transition duration dynamically adapt to traffic flow changes, making it suitable for various urban traffic intersections. It has significant low-carbon benefits: by optimizing traffic flow, it reduces vehicle start-stop and dwell time, effectively reducing carbon emissions and contributing to the implementation of the dual-carbon strategy. Attached Figure Description
[0019] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 is a schematic diagram of the hardware configuration circuit of the present invention; Figure 2 is a schematic diagram of the digital tube interface of the traffic light display module of the present invention; Figure 3 is a schematic diagram of the basic operation flow of image processing of the present invention; Figure 4 is a schematic diagram of the implementation of particle position in the scene of the present invention; Figure 5 is a schematic diagram of the principle block diagram of the PID control system of the present invention; Figure 6 is a schematic diagram of the timing flow of the WPSO-PID algorithm of the present invention; Figure 7 is a schematic diagram of the timing flow of the traffic control system of the present invention; Figure 8 is a schematic diagram of the fusion of WPSO and PID of the present invention; Figure 9 is a curve showing the change of average vehicle delay time during peak hours of the present invention; Figure 10 is a curve showing the change of average number of vehicle stops during peak hours of the present invention; Figure 11 is a curve showing the change of average queue length during peak hours of the present invention; Figure 12 is a curve showing the change of vehicle throughput during peak hours of the present invention; Figure 13 is a curve showing the change of average vehicle delay time during off-peak hours of the present invention; Figure 14 is a curve showing the change of average number of vehicle stops during off-peak hours of the present invention; Figure 15 is a curve showing the change of average queue length during off-peak hours of the present invention; Figure 16 is a curve showing the change of vehicle throughput during off-peak hours of the present invention. Detailed Implementation
[0020] This section will describe in detail specific embodiments of the present invention. Preferred embodiments of the present invention are shown in the accompanying drawings. The purpose of the drawings is to supplement the textual description with graphics, so that people can intuitively and vividly understand each technical feature and overall technical solution of the present invention, but they should not be construed as limiting the scope of protection of the present invention.
[0021] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.
[0022] In the description of this invention, terms such as greater than, less than, and exceeding are understood to exclude the stated number, while terms such as above, below, and within are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0023] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.
[0024] Please refer to Figures 1-16. This invention provides a technical solution: a traffic signal control method based on machine vision perception and spatiotemporal sequence prediction, comprising the following steps: S1, Machine vision perception: As shown in Figure 3, a high-definition camera is used to collect real-time images of traffic intersections, and key traffic flow parameters are extracted through multi-step image processing technology. The image acquisition device is installed at a height of 5-8m, with a horizontal viewing angle ≥120° and a vertical viewing angle ≥90°, ensuring coverage of vehicle queuing areas in all directions of the intersection. The key traffic flow parameters also include vehicle density and average vehicle speed. Density unit: veh / 100m, average vehicle speed unit: km / h; When processing images captured by the camera, the first step is to convert the image to grayscale, transforming it into a grayscale image. Since the method used utilizes the image's edge information, the next step is to perform edge-mapping processing to obtain the corresponding edge images. Additionally, for easier subsequent processing, binarization is required to better extract and segment the target. Grayscale processing: A weighted average method is used: Gray = 0.299R + 0.587G + 0.114B to convert RGB values... The image is converted to grayscale to fully utilize the human eye's high sensitivity to green light, improving the distinction between vehicles and the background. Edge detection: The Canny algorithm (high threshold 80, low threshold 40) is used to extract vehicle contour edges, enhancing the recognition of target areas. ROI extraction: Focusing on vehicle queue areas at each entrance of the intersection, irrelevant areas such as sidewalks and green belts are excluded to reduce data processing volume. Binarization: A threshold T=170 is set to convert the grayscale image to a binary image, with pixels greater than the threshold set to 1 (vehicle area) and pixels less than the threshold set to 0 (background area). Key parameter extraction: Based on the binary image, core parameters such as vehicle queue length, traffic density, and average vehicle speed are extracted to provide data support for subsequent prediction and timing. S2, Spatiotemporal sequence prediction: A PCA-LSTM traffic flow prediction model is constructed to achieve accurate short-term traffic flow prediction. Data preprocessing: At least 3 months of historical traffic flow data (5-minute sampling interval) are collected, outliers are removed using the 3σ criterion, and missing data is supplemented using linear interpolation. Data normalization: A formula is used... To eliminate the influence of dimensions, where X is the original traffic flow data, μ is the 5-minute average traffic volume for a specific traffic direction, and σ is the corresponding standard deviation; PCA dimensionality reduction: calculate the covariance matrix of the traffic flow data, solve for the eigenvalues and eigenvectors and sort them, select the top 3-5 principal components with a cumulative contribution rate ≥90% to construct the projection matrix, and reduce the 12-dimensional traffic flow data (4 entrances / exits × 3 driving directions) to a low-dimensional space; LSTM model training: set the model parameters as follows: number of input layers 1, number of hidden layers 16, output layer forgetting ratio 0.3, dataset size 32, number of iterations 100, learning rate 0.01, divide the dimensionality-reduced dataset into training and testing sets in a 7:3 ratio, and train the model; Traffic flow prediction: input the real-time preprocessed traffic flow data and output the traffic flow prediction results for the next 15-30 minutes; S3, timing optimization calculation: construct the WPSO-PID timing optimization model to achieve dynamic optimal timing; WPSO algorithm improvement: adopt an adaptive inertia weight strategy, the formula is:
[0025] ID parameter optimization: Kp, Ki, and Kd are used as particles in the WPSO algorithm, with the fitness function F=L+0.3D+0.2S-0.5T as the objective, where L is the average queue length (m), D is the average delay time (s), S is the average number of vehicle stops, and T is the vehicle throughput. The weighting coefficients are determined through calibrated experiments using 100 sets of simulations to search for the optimal parameter combination (Kp=1.237, Ki=0.03, Kd=0.027). Phase settings: A four-phase scheme is adopted, specifically: east-west straight and right turns are phase 1, east-west left turns are phase 2, north-south straight and right turns are phase 3, and north-south left turns are phase 4. The yellow light transition time between each phase is 3-5 seconds, dynamically adjusted according to the intersection speed limit. The interval between each phase is 3-5 seconds (dynamically adjusted according to the speed limit). Carbon emission calculation: The formula is used. Calculate the total carbon emissions per unit time and use it as an auxiliary evaluation indicator; where k is the carbon emission coefficient per unit vehicle per unit time, with units of kg / veh·h, ti is the average dwell time of vehicles in the i-th phase, with units of h, and qi is the traffic flow in the i-th phase, with units of veh / h. The total carbon emissions are used as an auxiliary evaluation indicator for timing optimization. Timing scheme calculation: Using traffic flow prediction results as the controlled variable and green light duration as the manipulated variable, the optimal green light duration allocation scheme is obtained through iteration using an optimized PID controller and WPSO algorithm. S4, Signal control execution module: Implements signal control for single or multiple intersections according to the timing scheme: Single intersection control: Adjusts the signal light duration in real time at 15-30 minute intervals. When traffic flow fluctuations are large (the deviation between the predicted value and the real-time value is ≥20%), the interval is shortened to 15 minutes, and when fluctuations are small, it is set to 30 minutes. Multi-intersection collaborative control: Constructs a regional traffic flow equilibrium objective function based on the traffic flow prediction results of each intersection in the area, and simultaneously optimizes the timing scheme of each intersection to ensure smooth traffic flow and avoid secondary congestion.
[0026] Example: Implementation Environment Setup Hardware Configuration: Image Acquisition Device: Predator-D camera (resolution 652×582, transmission speed 60 frames / second), installation height 6m, lens horizontal viewing angle 120°, vertical viewing angle 90°, covering the four entrance directions of east, west, south, and north; Main Control Unit: Freescale MK60 chip (core frequency 100MHz), used for data processing, model operation, and signal control; Display Module: 4 sets of red, green, and yellow tri-color indicator lights, and 12 8mm LED digital tubes forming a countdown display module; Auxiliary Hardware: 74HC244 buffer, 0.8-inch common anode digital tube, etc., forming a minimum control system, the circuit diagram of which is shown in Figure 1.
[0027] Software Platform: Image Processing: Grayscale conversion, edge detection, ROI extraction, binarization, and other operations are implemented based on OpenCV; Model Training and Running: PCA-LSTM and WPSO-PID models are built based on the Python+TensorFlow framework; Simulation Verification: The VISSIM-Matlab co-simulation platform is used, and interaction is achieved through the VISSIMCOM interface; Control Execution: The control program is written in C language and burned into the MK60 chip to realize the control of traffic light duration and countdown display, as shown in Figure 2.
[0028] Specific implementation steps: Image acquisition using machine vision perception: Real-time acquisition of traffic images of the Qujiang East Road intersection in Xi'an (60 frames / second) using a Predator-D camera; Grayscale processing: Converting RGB images to grayscale images using the formula Gray=0.299R+0.587G+0.114B; Edge detection: Running the Canny algorithm (high threshold 80, low threshold 40) to extract vehicle contour edges; ROI extraction: Defining the queuing areas of vehicles in each direction of the Qujiang East Road intersection as ROIs based on the intersection plan; Binarization processing: Setting the threshold T=170 to obtain a binarized image; Parameter extraction: Calculating the queue length, traffic density (veh / 100m), and average vehicle speed (km / h) for each direction of the intersection, summarizing the data every 5 minutes.
[0029] PCA-LSTM Traffic Flow Prediction Implementation: Data Preparation: Collected 3 months of historical traffic flow data (5-minute sampling interval) from the Qujiang East Road intersection, totaling 8640 data sets; Data Preprocessing: Outliers were removed using the 3σ criterion, and missing data were supplemented using linear interpolation; Data Normalization: A formula was used... Data normalization was performed; PCA dimensionality reduction: the covariance matrix was calculated, and the top 3 principal components with a cumulative contribution rate of 92% were selected to construct the projection matrix, reducing the 12-dimensional data to 3-dimensionality; LSTM model training: the model was trained according to the set parameters, and RMSE and MAE were used as evaluation indicators during the training process; prediction validation: real-time data was input, and traffic flow prediction results for the next 30 minutes were output. The RMSE of the PCA-LSTM model was 4.51, the MAE was 3.21, and the training time was 9.91 seconds; WPSO-PID timing optimization implementation: algorithm parameter settings: WPSO algorithm population size 30, number of iterations 1 00, PID optimal parameters Kp=1.237, Ki=0.03, Kd=0.027; Fitness function calculation: Substitute the average queue length, delay time, number of stops, and throughput data, and calculate the fitness value according to the formula F=L+0.3D+0.2S-0.5T; Phase setting: Adopt a four-phase scheme with a phase interval of 4 seconds (corresponding to an intersection speed limit of 50km / h); Carbon emission calculation: Take k=0.2kg / (veh⋅h), calculate the total carbon emission per unit time as an auxiliary evaluation indicator; Timing scheme calculation: After 100 iterations of the WPSO algorithm, obtain the optimal green light duration for each phase.
[0030] Signal Control Execution and Verification: Single Intersection Control: The timing scheme is written into the MK60 chip, and the signal light duration is adjusted in a 30-minute cycle (shortened to 15 minutes when traffic flow fluctuates greatly); Simulation verification shows that the average delay time at the east entrance during peak hours is reduced from 60s to 40s, and the queue length is reduced from 62.1m to 40.2m; Multi-Intersection Cooperative Control: The timing scheme of the three adjacent intersections on Qujiang Road is selected and optimized synchronously. The average delay time in the peak area is reduced by 22.08%, and the average queue length in the off-peak area is reduced by 23.57%; Physical Model Verification: A physical model of a single intersection is built to simulate different traffic flow scenarios. The verification results show that this method can effectively alleviate congestion and reduce vehicle carbon emissions.
[0031] This embodiment takes the Qujiang Road intersection in Xi'an as the research object. It accurately acquires traffic flow data through machine vision perception, uses the PCA-LSTM model to achieve high-precision and high-efficiency traffic flow prediction, and optimizes the timing scheme using the WPSO-PID algorithm to achieve a balance between traffic efficiency and low-carbon goals. Verification of single-intersection and multi-intersection control shows that this invention can significantly improve traffic congestion and reduce carbon emissions during both peak and off-peak hours, without relying on advanced communication technologies.
[0032] Figure 9 shows the curve of average delay time during peak hours as a function of iteration number. As can be seen, compared to the PSO algorithm, the WPSO algorithm reduces the average delay by 3.79%, while the WPSO-PID algorithm reduces it by 20.16%. Therefore, the optimal solution for average delay using the WPSO-PID algorithm is better than both the PSO and WPSO algorithms. Figure 10 shows the curve of average number of stops during peak hours as a function of iteration number. As can be seen, compared to the PSO algorithm, the WPSO algorithm improves the convergence of average number of stops by 12.20%, while the WPSO-PID algorithm improves it by 19.51%. Therefore, the optimal solution for average number of stops using the WPSO-PID algorithm is better than both the PSO and WPSO algorithms. Figure 11 shows the curve of average queue length during peak hours as a function of iteration number. As can be seen, compared to the PSO algorithm, the WPSO algorithm reduces the average queue length convergence by 15.01%, while the WPSO-PID algorithm reduces it by 32.04%. Therefore, the optimal solution for average queue length of the WPSO-PID algorithm is better than that of the PSO and WPSO algorithms. Figure 12 shows the curve of peak-hour traffic throughput changing with the number of iterations. It can be seen that compared to the PSO algorithm, the WPSO algorithm reduces the convergence effect of vehicle throughput by 4%, while the WPSO-PID algorithm reduces it by 7%. Therefore, the optimal solution for vehicle throughput of the WPSO-PID algorithm is better than that of the PSO and WPSO algorithms. Figure 13 shows the curve of off-peak traffic average delay time changing with the number of iterations. It can be seen that compared to the PSO algorithm, the WPSO algorithm reduces the average delay by 2.16%, while the WPSO-PID algorithm reduces it by 7.33%. Therefore, the optimal solution for average delay of the WPSO-PID algorithm is better than that of the PSO and WPSO algorithms. Figure 14 shows the curve of off-peak traffic average number of stops changing with the number of iterations. It can be seen that compared to the PSO algorithm, the WPSO algorithm improves the convergence effect of average number of stops by 25.71%, while the WPSO-PID algorithm improves it by 30.00%. Therefore, the optimal solution for the average number of stops using the WPSO-PID algorithm is better than that of the PSO and WPSO algorithms. Figure 15 shows the curve of the average queue length during off-peak hours changing with the number of iterations. As can be seen from the figure, compared to the PSO algorithm, the WPSO algorithm reduces the average queue length convergence by 25.22%, while the WPSO-PID algorithm reduces it by 40.36%. Therefore, the optimal solution for the average queue length using the WPSO-PID algorithm is better than that of the PSO and WPSO algorithms. Figure 16 shows the curve of the vehicle throughput during off-peak hours changing with the number of iterations. As can be seen from the figure, compared to the PSO algorithm, the WPSO algorithm reduces the vehicle throughput convergence by 2.64%, while the WPSO-PID algorithm reduces it by 6.82%.Therefore, the optimal solution for vehicle throughput obtained by the WPSO-PID algorithm is better than that of the PSO and WPSO algorithms.
[0033] The embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A traffic signal control method based on machine vision perception and spatiotemporal sequence prediction, characterized in that: Includes the following steps: S1. Machine Vision Perception: Real-time image data of traffic intersections is acquired through image acquisition devices, and the image data is preprocessed to extract key traffic flow parameters. S2. Spatiotemporal Sequence Prediction: A PCA-LSTM traffic flow prediction model is constructed based on Principal Component Analysis (PCA) and Long Short-Term Memory (LSTM) neural networks. Preprocessed historical traffic flow data is input, and short-term traffic flow prediction results are output. S3. Timing Optimization Calculation: A WPSO-PID timing optimization model is constructed based on an improved Particle Swarm Optimization (WPSO) algorithm and a Proportional-Integral-Derivative (PID) control algorithm. The optimal traffic signal timing scheme is calculated using the traffic flow prediction results as input and combined with traffic congestion evaluation indicators. S4. Signal Control Execution: Based on the optimal traffic signal timing scheme, the durations of green, red, and yellow lights at traffic intersections are adjusted in real time to achieve coordinated traffic signal control at single or multiple intersections.
2. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction according to claim 1, characterized in that: The image preprocessing in step S1 also includes an edge detection sub-step: using the Canny edge detection algorithm to extract edges from the grayscale image to enhance the distinction between the vehicle outline and the background. The high threshold of the Canny algorithm is set to 80, and the low threshold is set to 40.
3. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction according to claim 2, characterized in that: In step S2, during the PCA dimensionality reduction process, the top N principal components with a cumulative contribution rate of ≥90% of the feature vectors are selected to construct the projection matrix, where N is an integer from 3 to 5, and the specific value is dynamically adjusted according to the dimensionality redundancy of the traffic flow data.
4. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction according to claim 3, characterized in that: The fitness function formula mentioned in step S3 is F=L+0.3D+0.2S-0.5T, where L is the average queue length of vehicles (unit: m), D is the average delay time of vehicles (unit: s), S is the average number of vehicle stops, T is the vehicle throughput, and the weighting coefficients are determined through calibration using 100 sets of simulation experiments.
5. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction according to claim 4, characterized in that: The specific strategy for multi-intersection collaborative control in step S4 is as follows: using the traffic flow prediction results of each intersection in the area as constraints, a regional traffic flow equilibrium objective function is constructed, and the green light duration allocation scheme of each intersection is solved synchronously through the WPSO-PID timing optimization model to ensure smooth traffic flow connection between adjacent intersections and avoid secondary congestion in the area.
6. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction according to claim 5, characterized in that: The image acquisition device mentioned in step S1 is installed at a height of 5-8m, with a horizontal viewing angle of ≥120° and a vertical viewing angle of ≥90°, ensuring coverage of vehicle queuing areas in all directions of the intersection. The key traffic flow parameters also include traffic flow density and average vehicle speed. The unit for traffic flow density is veh / 100m, and the unit for average vehicle speed is km / h.
7. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction according to claim 6, characterized in that: The historical traffic flow data mentioned in step S2 has a time span of ≥3 months, a data sampling interval of 5 minutes, and outlier processing is performed before inputting it into the PCA-LSTM model: outliers are removed using the 3σ criterion.
8. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction according to claim 7, characterized in that: The intersection phases mentioned in step S3 are set to four phases, specifically: east-west straight and right turns are phase 1, east-west left turns are phase 2, north-south straight and right turns are phase 3, and north-south left turns are phase 4. The yellow light transition time between each phase is 3-5 seconds, which is dynamically adjusted according to the intersection speed limit.
9. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction according to claim 7, characterized in that: It also includes carbon emission calculation steps: based on optimized traffic flow parameters, using the formula: The total carbon emissions per unit time at the intersection are calculated, where k is the carbon emission coefficient per unit vehicle per unit time, with units of kg / veh·h, ti is the average dwell time of vehicles in the i-th phase, with units of h, and qi is the traffic flow in the i-th phase, with units of veh / h. The total carbon emissions are used as an auxiliary evaluation index for timing optimization.
10. The traffic signal control method based on machine vision perception and spatiotemporal sequence prediction according to claim 7, characterized in that: The real-time adjustment cycle in step S4 is 15-30 minutes, which is dynamically adjusted according to the fluctuation range of the traffic flow prediction results: when the deviation between the predicted value and the real-time value is ≥20%, the adjustment cycle is shortened to 15 minutes; when the deviation is <20%, the adjustment cycle is set to 30 minutes.