A deep reinforcement learning traffic light control method
By optimizing traffic light control through deep reinforcement learning methods, and combining Multi-step DQN and Attentive experience replay, the congestion problem of traditional traffic lights under high traffic flow is solved, and more efficient traffic flow management is achieved.
Patent Information
- Application Number
- CN202311717211.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-12-13
AI Technical Summary
Traditional traffic signal control systems are ineffective at alleviating traffic congestion under high traffic flow conditions. Existing adaptive control methods are insufficient in traffic flow prediction and optimization, and cannot achieve intelligent traffic signal control.
A traffic signal control system is constructed using a deep reinforcement learning approach, combining the Multi-step DQN algorithm and Attentive experience replay. By utilizing control strategies based on the number of vehicles and the duration of traffic lights, traffic flow is optimized, reducing vehicle travel time and increasing intersection throughput.
It significantly reduced the average travel time of vehicles, increased the average throughput of intersections, and achieved more efficient traffic flow management.
Smart Images

Figure CN117708594B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of deep reinforcement learning and intelligent transportation technology, specifically to a deep reinforcement learning-based traffic light control method. Background Technology
[0002] With the rapid increase in the number of motor vehicles and the rapid development of urbanization in my country, traffic demand and volume have grown rapidly, making traffic congestion a complex global problem. The continuous growth of vehicles and the limited expansion of urban roads are the main causes of urban traffic congestion. To resolve the conflict between vehicles and roads, methods such as limiting the growth in vehicle numbers and increasing road infrastructure construction are commonly used. However, both methods have their limitations. Traffic signal control systems are one way to address this conflict. Currently, most cities still use traditional time-and-sequence traffic lights. When traffic flow is too high, these traditional time-and-sequence traffic lights cannot effectively handle traffic flow and thus alleviate traffic congestion.
[0003] Traditional Traffic Signal Control (TSC) can be divided into three main categories: timing control, sensor-based control, and adaptive control. Timing control is the most common type of traffic signal control system, setting the time interval between phases to a fixed value and operating under stable traffic conditions. Sensor-based control determines whether to maintain or change the current phase based on predefined timing rules and real-time traffic flow. Adaptive control is one of the most effective traffic signal control methods. Its essence lies in using advanced algorithms and concepts to train a network model to convergence, thereby achieving intelligent regulation of traffic signals. MaxPressure is one of the more advanced concepts in this field, which involves selecting an appropriate phase based on traffic conditions to minimize traffic congestion.
[0004] Currently, adaptive traffic lights are an effective method to reduce traffic congestion. Compared with traditional traffic lights, adaptive traffic lights have the following advantages: (1) They can dynamically adjust the traffic lights to adapt to actual traffic needs, thereby controlling traffic flow more effectively; (2) They can be optimized according to real-time traffic conditions, thereby reducing traffic congestion and improving the passage efficiency of vehicles and pedestrians; (3) They can achieve accurate traffic flow prediction and control, thereby improving traffic safety and reliability. Summary of the Invention
[0005] Purpose of the invention: The purpose of this invention is to provide a deep reinforcement learning-based traffic light control method that can more scientifically achieve intelligent regulation of traffic lights based on the road conditions between traffic nodes and the degree of mutual influence between adjacent nodes. This will help advance research in various fields of intelligent transportation and also help improve traffic congestion.
[0006] Technical solution: The deep reinforcement learning traffic light control method of the present invention includes the following steps:
[0007] (1) Preprocess the urban transportation network data;
[0008] (2) The model is constructed using the Multi-step DQN algorithm based on the preprocessed data;
[0009] (3) Accumulate the experience of n single steps, and then use the accumulated experience for learning;
[0010] (4) Update the network parameters of Multi-step DQN;
[0011] (5) Combine Attentive experience replay with DQN network to construct a deep reinforcement learning model;
[0012] (6) Import the traffic dataset and vehicle flow dataset into the deep reinforcement learning model, train it, and record the experimental results;
[0013] (7) Compare the experimental results in steps (2) and (5);
[0014] (8) Visualize the presentation.
[0015] Furthermore, step (1) includes the following steps:
[0016] (11) Collect information on all traffic nodes in the city to form a traffic dataset;
[0017] (12) The urban road network, including intersections, is collected in a 4x4 grid. Traffic flow data is based on cameras at intersections, forming a vehicle flow dataset;
[0018] (13) After cleaning the traffic dataset and the vehicle flow dataset using Multistep DQN, data extraction is performed.
[0019] Furthermore, step (2) is as follows:
[0020] (21) Set the state function to the number of vehicles entering and exiting the lane, and the action function to the control of the signal light duration. 0 means to keep the current phase, and 1 means to change the current phase.
[0021] (22) Set the reward function to a negative maximum pressure, where the maximum pressure is the difference between the number of vehicles entering and exiting the lane. The formula for the maximum pressure of a traffic movement is:
[0022] P i =N in -N out(1)
[0023] Based on traffic movement, the reward function is set to a negative reward value:
[0024] r i =-P i (2)
[0025] The total reward at the current intersection is the sum of the rewards for all traffic movements, that is:
[0026] R(s t a t )=∑r i (3);
[0027] Furthermore, step (3) is as follows:
[0028] The expression for the accumulated reward, i.e., the multi-step reward, is:
[0029]
[0030] The model is trained and the average travel time of vehicles and the maximum traffic volume at intersections are recorded.
[0031] Furthermore, step (4) is as follows:
[0032] The parameters are updated using gradient descent; the loss function is represented by mean squared error.
[0033] The expression for the multi-step objective value is:
[0034]
[0035] The loss function is calculated based on the target value, and its expression is:
[0036]
[0037] Furthermore, step (5) is as follows: by comparing the state distribution in the experience pool with the distribution of the current state, the experience with higher similarity is selected for replay;
[0038] Furthermore, in step (7), the average travel time of vehicles and the traffic volume at the intersection are compared between steps (2) and (5) to generate a follow-up file.
[0039] Furthermore, step (8) imports the playback file generated in step (7) into the Cityflow platform for display.
[0040] The device of the present invention includes a memory, a processor, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements any of the deep reinforcement learning traffic light control methods described in the present invention.
[0041] The present invention provides a storage medium storing a computer program, characterized in that the computer program is designed to implement any one of the deep reinforcement learning traffic light control methods described herein when it is run.
[0042] Beneficial effects: Compared with the prior art, the present invention has the following significant advantages: (1) It improves the network framework of DQN by accumulating the experience of n single steps into one, and then using the accumulated experience for learning, thereby accelerating the convergence speed of the network; (2) It combines Attentive experience replay with DQN network, giving priority to learning experience similar to the current state, so that the agent can learn a better strategy; (3) Compared with traditional control methods, MALight does a better job of reducing the average travel time of vehicles and increasing the average throughput of intersections. Attached Figure Description
[0043] Figure 1 This is a flowchart of the present invention;
[0044] Figure 2 This is a schematic diagram of an intersection according to the present invention.
[0045] Figure 3 This is a schematic diagram of the deep reinforcement learning framework constructed using the Multi-step DQN algorithm of this invention.
[0046] Figure 4 This is a schematic diagram illustrating the selection of experiences for Attentive experience replay in this invention.
[0047] Figure 5 This is a schematic diagram illustrating the visualization of the Cityflow platform of this invention. Detailed Implementation
[0048] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0049] like Figure 1 As shown, this embodiment of the invention provides a deep reinforcement learning traffic light control method, including the following steps:
[0050] (1) Preprocessing of urban traffic network data; including the following steps:
[0051] (11) Collect information on all traffic nodes in the city to form a traffic dataset;
[0052] (12) The urban road network, including intersections, is collected in a 4x4 grid. Traffic flow data is based on cameras at intersections, forming a vehicle flow dataset;
[0053] (13) After cleaning the traffic dataset and the vehicle flow dataset using Multistep DQN, data extraction is performed.
[0054] like Figure 2 As shown, (2) the model is constructed using the Multi-step DQN algorithm based on the preprocessed data; the details are as follows:
[0055] (21) Set the state function to the number of vehicles entering and exiting the lane, and the action function to the control of the signal light duration. 0 means to keep the current phase, and 1 means to change the current phase.
[0056] (22) Set the reward function to a negative maximum pressure, where the maximum pressure is the difference between the number of vehicles entering and exiting the lane. The formula for the maximum pressure of a traffic movement is:
[0057] P i =N in -N out (1)
[0058] Based on traffic movement, the reward function is set to a negative reward value:
[0059] r i =-P i (2)
[0060] The total reward at the current intersection is the sum of the rewards for all traffic movements, that is:
[0061] R(s t a t )=∑r i (3);
[0062] like Figure 3 As shown, (3) the experiences of n single steps are accumulated, and then the accumulated experiences are used for learning; the details are as follows:
[0063] The expression for the accumulated reward, i.e., the multi-step reward, is:
[0064]
[0065] The model is trained and the average travel time of vehicles and the maximum traffic volume at intersections are recorded.
[0066] (4) Update the network parameters of Multi-step DQN; the details are as follows:
[0067] The parameters are updated using gradient descent; the loss function is represented by mean squared error.
[0068] The expression for the multi-step objective value is:
[0069]
[0070] The loss function is calculated based on the target value, and its expression is:
[0071]
[0072] like Figure 4 As shown, (5) Attentive experience replay is combined with DQN network to construct a deep reinforcement learning model; specifically as follows: by comparing the distribution of states in the experience pool with the distribution of the current state, experiences with high similarity are selected for replay;
[0073] like Figure 5 As shown, (6) the traffic dataset and vehicle flow dataset are imported into the deep reinforcement learning model for training, and the experimental results are recorded;
[0074] (7) Compare the experimental results in steps (2) and (5); specifically: compare the average travel time of vehicles and the traffic volume at intersections in steps (2) and (5) to generate a follow-up file.
[0075] (8) Visualize the results. Specifically, import the playback file generated during training in step (7) into the Cityflow platform for display.
[0076] This invention also provides a device, including a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that the processor executes the program to implement any of the deep reinforcement learning traffic light control methods described in the present invention.
[0077] This invention also provides a storage medium storing a computer program designed to implement any of the deep reinforcement learning traffic light control methods described above when running.
Claims
1. A deep reinforcement learning-based traffic light control method, characterized in that, Includes the following steps: (1) Preprocess the urban traffic network data; (2) The model is constructed using the Multi-step DQN algorithm based on the preprocessed data; the details are as follows: (21) Set the state function to the number of vehicles entering and exiting the lane, and the action function to the control of the signal light duration. 0 means to keep the current phase, and 1 means to change the current phase. (22) Set the reward function to negative maximum pressure, where the maximum pressure is the difference between the number of vehicles entering and exiting the lane. The formula for the maximum pressure corresponding to a traffic movement is: (1); Based on traffic movement, the reward function is set to a negative reward value: (2); The total reward at the current intersection is the sum of the rewards for all traffic movements, that is: (3); (3) Accumulate the experience from n individual steps, and then use the accumulated experience for learning; the details are as follows: The expression for the accumulated reward, i.e., the multi-step reward, is: (4); The model is trained and the average travel time of vehicles and the maximum traffic volume at intersections are recorded. (4) Update the network parameters of Multi-step DQN; the details are as follows: The parameters are updated using gradient descent; the loss function is represented by mean squared error. The expression for the multi-step objective value is: = +…+ (5); = ; The loss function is calculated based on the target value, and its expression is: 2 (6); (5) Combine Attentive experience replay with DQN network to construct a deep reinforcement learning model; (6) Import the traffic dataset and vehicle flow dataset into the deep reinforcement learning model, train it, and record the experimental results; (7) Compare the experimental results in steps (2) and (5); (8) Visualize the presentation.
2. The deep reinforcement learning traffic light control method according to claim 1, characterized in that, Step (1) includes the following steps: (11) Collect information on all traffic nodes in the city to form a traffic dataset; (12) The urban road network, including intersections, is collected in a 4x4 grid; traffic flow data is based on cameras at intersections to form a traffic flow dataset; (13) After cleaning the traffic dataset and the vehicle flow dataset using Multi-step DQN, data extraction is performed.
3. The deep reinforcement learning traffic light control method according to claim 1, characterized in that, The specific steps (5) are as follows: by comparing the state distribution in the experience pool with the current state distribution, the experience with higher similarity is selected for replay.
4. The deep reinforcement learning traffic light control method according to claim 1, characterized in that, In step (7), the average travel time of vehicles and the traffic volume at the intersection are compared between steps (2) and (5) to generate a playback file.
5. The deep reinforcement learning traffic light control method according to claim 1, characterized in that, Step (8) involves importing the playback file generated during training in step (7) into the Cityflow platform for display.
6. An apparatus comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements a deep reinforcement learning traffic light control method as described in any one of claims 1-5.
7. A storage medium storing a computer program, characterized in that, The computer program is designed to implement, at runtime, a deep reinforcement learning traffic light control method according to any one of claims 1-5.
