Traffic light control method, device and medium based on deep learning
Through the combination of deep learning and radar, the vehicle information is obtained in real time and the phase duration of the signal lights is dynamically adjusted, which solves the problem that traffic lights cannot adapt to traffic flow and improves traffic fluency and traffic efficiency.
Patent Information
- Application Number
- CN202411902452.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2044-12-23
AI Technical Summary
The phase duration of existing traffic lights is fixed, making it difficult to adapt to actual traffic flow, resulting in traffic congestion and low traffic efficiency.
Deep learning-based target detection and tracking algorithm is used to combine radar technology to obtain vehicle information in real time and dynamically adjust the phase time of the signal light, including the YOLOv5 algorithm and the DeepSORT algorithm, and optimize the phase time with image and radar data.
Effectively avoid traffic congestion, improve traffic fluency and traffic efficiency, reduce the waiting time for vehicles in queues, and reduce the probability of traffic accidents.
Smart Images

Figure CN119380562B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of traffic control technology. Specifically, the present application relates to a traffic light control method, device and medium based on deep learning. Background Art
[0002] With the improvement of people's living standards, cars have become their primary means of transportation. As car use continues to grow, traffic jams are common at intersections with heavy traffic. It's common to see long lines of cars on the red side of a red light, while no cars are passing on the green side. Although these intersections are equipped with traffic lights, their fixed phase duration makes it difficult to effectively adapt to the actual traffic flow. Consequently, lanes with heavy traffic are often severely blocked, leaving other lanes empty, leading to traffic jams and reducing traffic flow and efficiency. Summary of the Invention
[0003] The present invention provides a deep learning-based traffic light control method, device, and medium. This method addresses the problem that existing traffic lights have fixed phase durations, cannot adapt to actual traffic flow, and are prone to traffic congestion, poor traffic flow, and low traffic efficiency. To achieve this goal, the present invention provides the following solutions.
[0004] According to one aspect of an embodiment of the present application, a traffic light control method based on deep learning is provided, the method comprising:
[0005] Determining phase information of a traffic light, and obtaining vehicle information corresponding to the phase information using a preset algorithm and radar, wherein the phase information includes a current phase and a next phase for indicating vehicle passage, the preset algorithm includes a target detection algorithm and a target tracking algorithm based on a deep learning algorithm, and the vehicle information includes the number and type of vehicles;
[0006] The phase duration corresponding to the current phase is determined according to conditions satisfied by the vehicle information, where the conditions include any one of a phase optimization condition and an uneven traffic flow condition.
[0007] In one possible implementation, the deep learning algorithm includes a YOLOv5 algorithm and a DeepSORT algorithm, and obtaining the preset algorithm includes:
[0008] Adjusting the YOLOv5 algorithm and generating the target detection algorithm using the adjusted YOLOv5 algorithm, wherein the adjustment includes replacing the upsampling operator in the YOLOv5 algorithm with a CARAFE upsampling operator and using Dyhead as the detection head of the YOLOv5 algorithm;
[0009] The target tracking algorithm is obtained by using the DeepSORT algorithm.
[0010] In one possible implementation, the acquiring the vehicle information corresponding to the phase information by using a preset algorithm and a radar includes:
[0011] Collecting images of vehicles on lanes, processing the images using the preset algorithm to obtain first vehicle information on each lane, and obtaining second vehicle information on each lane using radar;
[0012] A lane corresponding to the phase information is determined, and vehicle information corresponding to the phase information is acquired based on the lane, the first vehicle information, and the second vehicle information.
[0013] In one possible implementation, the condition is a phase optimization condition, and determining the phase duration corresponding to the current phase according to the condition satisfied by the vehicle information includes:
[0014] Determine the number of vehicles in the queue based on the vehicle information corresponding to the preset algorithm and the vehicle information corresponding to the radar;
[0015] Obtaining the travel time corresponding to the number of vehicles in the queue, and calculating an average travel time based on the travel time and the number of vehicles corresponding to the current phase and the next phase, where the time period corresponding to the average travel time includes the time period of the current phase and the next phase;
[0016] The phase duration corresponding to the current phase is determined according to the average travel time and the number of vehicles corresponding to the current phase.
[0017] In one possible implementation, the condition is an uneven traffic flow condition, and determining the phase duration corresponding to the current phase based on the condition satisfied by the vehicle information includes:
[0018] Determine the number of queued vehicles in the current phase and the next phase according to the vehicle information corresponding to the preset algorithm and the vehicle information corresponding to the radar;
[0019] The phase duration corresponding to the current phase is determined based on the number of vehicles in the queue, the phase transition time, and a comparison result between the number of vehicles corresponding to the next phase and the number of vehicles corresponding to the current phase.
[0020] In one possible implementation, the method includes:
[0021] If it is determined that the phase duration is less than the predetermined maximum green light duration, obtaining vehicle joining information of the vehicle formation corresponding to the current phase, the vehicle joining information including the joining time, speed, and type of the vehicle to be joined;
[0022] The phase duration corresponding to the current phase is adjusted according to the vehicle joining information, the speed of the vehicles in the vehicle formation, and the maximum green light duration.
[0023] In one possible implementation, the method includes:
[0024] If it is determined that the current phase meets the idle interruption condition, the current phase is interrupted and switched to the next phase. The idle interruption condition includes at least one of the following: the actual passage time corresponding to the current phase is less than the phase time, and the number of vehicles corresponding to other phases is more than the number of vehicles in the current phase and greater than a preset number.
[0025] In one possible implementation, the method includes:
[0026] Acquire vehicle monitoring information of an overflow area corresponding to the current phase, where the overflow area is determined based on an acquisition range of the vehicle information, and the vehicle monitoring information includes a vehicle ratio and a vehicle dwell time;
[0027] If it is determined that the vehicle corresponding to the overflow area meets the overflow condition, the phase duration is adjusted according to a predetermined overflow control method. The overflow condition includes that the vehicle proportion is greater than the preset proportion and the vehicle stay time reaches a preset threshold. The overflow control method includes reducing the phase duration of the phase corresponding to the overflow area.
[0028] According to one aspect of an embodiment of the present application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described above.
[0029] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described above are implemented.
[0030] The beneficial effects of the technical solution provided by the embodiments of the present application are:
[0031] The deep learning-based traffic light control method provided in this application determines the phase information of traffic lights, and uses a target detection algorithm, a target tracking algorithm, and a radar based on a deep learning algorithm to obtain vehicle information corresponding to the phase information; the phase duration corresponding to the current phase is determined based on the conditions satisfied by the vehicle information. The embodiment of this application can obtain actual data on vehicle flow, and flexibly adjust the phase duration based on the actual data, effectively avoiding traffic congestion, improving traffic smoothness, and improving traffic efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following is a brief introduction to the drawings required for describing the embodiments of the present application.
[0033] Figure 1 A flowchart of a traffic light control method based on deep learning provided in an embodiment of the present application;
[0034] Figure 2 A flowchart of the execution of the traffic light control method based on deep learning provided in an embodiment of the present application;
[0035] Figure 3 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The following describes the embodiments of the present application in conjunction with the accompanying drawings. It should be understood that the embodiments described below in conjunction with the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0037] Those skilled in the art will understand that, unless otherwise stated, the singular forms "a," "an," "said," and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application mean that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements, and / or components, but do not exclude implementation as other features, information, data, steps, operations, elements, components, and / or combinations thereof supported by the present technical field. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, the element can be directly connected or coupled to the other element, or it can refer to the element and the other element establishing a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" indicates implementation as "A," or implementation as "A," or implementation as "A and B."
[0038] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0039] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on, or combine with each other, and the same terms, similar features, and similar implementation steps in different embodiments will not be repeated.
[0040] The traffic light control method, device and medium based on deep learning provided in this application are intended to solve at least one technical problem existing in the prior art.
[0041] In an embodiment of the present application, a traffic light control method based on deep learning is provided. The method can be used at the control end of a traffic light and other terminals that can be used to obtain vehicle information at intersections and adjust phase duration according to the vehicle information. The control end can be a control module of the traffic light, a control center connected to the traffic light, a cloud, and other devices.
[0042] Alternatively, as Figure 1 、 Figure 2 As shown, the traffic signal control method based on deep learning in this application includes:
[0043] S101: Determine the phase information of the traffic light, and use a preset algorithm and radar to obtain vehicle information corresponding to the phase information.
[0044] Optionally, the phase information includes a current phase and a next phase for indicating vehicle passage. The traffic light is provided at an intersection formed by at least two intersecting lanes. The current phase and the next phase may be green light phases corresponding to a certain direction of the intersection. The current phase and the next phase indicate different lanes available for passage.
[0045] Optionally, the preset algorithm includes a target detection algorithm and a target tracking algorithm based on a deep learning algorithm, and the vehicle information includes the number and type of vehicles. The images captured by the camera are processed using the preset algorithm to obtain the vehicle information. Multiple cameras can be installed at the intersection, and these multiple cameras can be used to capture images of vehicles in different lanes.
[0046] Optionally, vehicle information can also include vehicle location information. A target detection algorithm can be used to generate a target detector, and a target tracking algorithm can be used to generate a target tracker. The target detector detects vehicles in the image, and the target tracker identifies identical vehicles in previous and subsequent frames to optimize the target detector and reduce missed and false vehicle detections. Radar is used to precisely calibrate each vehicle on the lane and obtain vehicle type and location information.
[0047] Optionally, the vehicle information may further include the vehicle's location information, which is obtained based on the processing result of the preset algorithm or the scanning result of the radar.
[0048] In one embodiment, the target detector, target tracker, and radar points are initialized, and the traffic light is initialized. The traffic light can be initialized to a full red phase during initialization. After initialization is complete, phase information is obtained. The traffic light phase change rule can be predetermined.
[0049] Optionally, the deep learning algorithm includes the YOLOv5 algorithm and the DeepSORT algorithm, and obtaining the preset algorithm includes: adjusting the YOLOv5 algorithm, and using the adjusted YOLOv5 algorithm to generate a target detection algorithm, the adjustment including: using the CARAFE upsampling operator to replace the upsampling operator in the YOLOv5 algorithm, and using Dyhead as the detection head of the YOLOv5 algorithm; and using the DeepSORT algorithm to obtain the target tracking algorithm.
[0050] Alternatively, the target detection algorithm can be based on other deep learning algorithms such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs). Vehicle recognition and detection can also be performed using optical flow methods and other algorithms that can be used for vehicle detection. Furthermore, images used for vehicle detection can be collected using cameras, drones, or other mobile or immovable devices.
[0051] In one embodiment, the object detection algorithm is based on the YOLOv5 algorithm. It performs data augmentation on the image input stage, including random cropping, scaling, and blending of labeled features to enhance detection capabilities. The C3 bottleneck architecture, comprising a Cross-Stage Part (CSP) structure, bottleneck blocks, and an SPPF (Spatial Pyramid Pooling) module, is implemented in the algorithm's backbone network to address duplicate feature extraction. Feature fusion is achieved using a Neck structure that combines an FPN (Feature Pyramid Network) and a PAN (Path Aggregation Network) to form a Parallel and Asymmetric Feature Pyramid Network (PAFPN). After obtaining the features output by the FPN, the algorithm's head network performs detection and outputs the detected vehicle location, improving the effectiveness of vehicle detection at varying distances. Furthermore, to enhance the receptive field and improve feature extraction for distant and occluded vehicles, the CARAFE (Content-Aware ReAssembly of FEatures) upsampling operator is used instead of the original nearest neighbor interpolation upsampling. This operator calculates weights and performs weighted averaging, taking into account local contextual information, to produce more refined and accurate upsampling results. Furthermore, the Dyhead detection head is used instead of the original head structure of the network. The Dyhead structure dynamically learns and adjusts the head structure within the network to adapt to the feature representation and prediction requirements of different targets.
[0052] The target tracking algorithm is based on the DeepSORT algorithm. As an improved version of the SORT tracking algorithm, DeepSORT uses essentially the same trajectory processing and Kalman filtering framework as SORT. However, it introduces the target's motion and appearance information as correlation metrics and combines it with a cascade matching strategy, significantly improving the accuracy and efficiency of target tracking.
[0053] Optionally, to improve the accuracy of vehicle information, a preset algorithm and radar are used to obtain vehicle information corresponding to phase information. This includes: capturing images of vehicles in lanes, processing the images using a preset algorithm to obtain first vehicle information for each lane, and obtaining second vehicle information for each lane using radar; determining the lane corresponding to the phase information, and obtaining vehicle information corresponding to the phase information based on the lane, first vehicle information, and second vehicle information. Vehicle information is obtained by combining image recognition results with radar scanning results.
[0054] Optionally, when combining the image recognition result with the radar scanning result, the image recognition result and the radar scanning result may be weighted, and the weighted processing result may be determined as the vehicle information corresponding to the phase information.
[0055] S102: Determine the phase duration corresponding to the current phase according to the conditions satisfied by the vehicle information.
[0056] Optionally, the condition includes any one of a phase optimization condition and a traffic flow unevenness condition, and a corresponding phase duration acquisition method is selected according to the satisfied phase optimization condition.
[0057] Optionally, when the condition is a phase optimization condition, the phase duration corresponding to the current phase is determined based on the conditions satisfied by the vehicle information, including: determining the number of vehicles in the queue based on the vehicle information corresponding to the preset algorithm and the vehicle information corresponding to the radar; obtaining the passage time corresponding to the number of vehicles in the queue, and calculating the average passage time based on the passage time and the number of vehicles corresponding to the current phase and the next phase, the time period corresponding to the average passage time includes the time period of the current phase and the next phase; determining the phase duration corresponding to the current phase based on the average passage time and the number of vehicles corresponding to the current phase.
[0058] Phase optimization conditions require that both the transit time corresponding to the number of vehicles in the current phase and the transit time corresponding to the number of vehicles in the next phase be less than the maximum green light duration. The transit time is the time required for all vehicles in the queue to pass through the intersection, which can be described as the expected time from the start of the first vehicle in the lane corresponding to the phase until the last vehicle in the queue reaches the intersection.
[0059] In one embodiment, queued vehicles can be identified based on the distance and speed between each vehicle in the lane and the vehicle in front. Specifically, if there is at least one vehicle within S1 meters (S1 can be defined as the length of space between a car and the front when queuing) in the lane ahead of the vehicle, and both the speed of this vehicle and the vehicle in front is less than a preset speed value (which can be set to 2 m / s) and is approaching a stop (e.g., gradually decreasing speed), then the vehicle is tracked and its ID number (e.g., license plate number) is marked as a queued vehicle.
[0060] Optionally, the number of queued vehicles indicates the number of vehicles queued in a lane. The number of queued vehicles corresponding to the current phase and the number of queued vehicles corresponding to the next phase are determined based on vehicle information. When a phase corresponds to two or more lanes, it is further possible to determine whether the number of vehicles in these lanes is similar (e.g., the difference in the number of queued lanes is less than a preset difference). If so, the largest number of queued vehicles can be determined as the number of queued vehicles corresponding to the phase, or the average number of queued vehicles can be used as the number of queued vehicles corresponding to the phase.
[0061] In one embodiment, the cameras corresponding to each direction of the intersection will capture a frame of image information at a fixed time interval Δt (the value of which can be set according to traffic demand or actual environment), and count the vehicles in each lane based on the image. At the same time, the radar corresponding to each direction will also count the vehicles in each lane (the algorithm and radar results can return the number and type of vehicles). Determine the release direction corresponding to the current phase and the lanes that match the release direction, and obtain the number of queued vehicles in these lanes. Number of vehicles in queue The calculation formula is as follows:
[0062]
[0063] In the above formula Represents the number of queued vehicles returned by image recognition, Indicates the number of queued vehicles returned by the radar, 、 It represents the weighted value, and the sum of the two is equal to 1, where > ( It can be 0.3, can be 0.7).
[0064] Optionally, after obtaining the number of vehicles in the queue, the travel time can be calculated based on the number of vehicles in the queue, the average time it takes for each vehicle to pass through the intersection, and the vehicle starting time.
[0065] In one embodiment, the duration of the passage can be =a +b is used to calculate the travel time. It represents the travel time corresponding to the nth phase, a represents the average time required for each vehicle to pass through the intersection (which can be 2.5s), and b represents the average vehicle reaction time, that is, the average time it takes from the change of the traffic light to instruct the vehicle to pass to the start of the vehicle (which can be 0.5s). is the number of queued vehicles corresponding to the nth phase. Can indicate the current phase, Can indicate the next phase.
[0066] Optionally, the number of vehicles corresponding to each phase includes the number of queued vehicles corresponding to that phase and the number of non-queued vehicles in the lane corresponding to that number of queued vehicles (which may be referred to as the number of non-queued vehicles). A predicted travel time corresponding to the number of non-queued vehicles is obtained, and an average travel time is calculated based on the number of queued vehicles, the number of non-queued vehicles, the travel time, and the predicted travel time.
[0067] In one embodiment, the calculation formula for the average travel time may be:
[0068]
[0069] in, represents the average travel time, Indicates the vehicle reaction time (the time from the first vehicle in the lane changing from the phase to the indication of passing to the vehicle starting), Indicates the duration of travel corresponding to the current phase, Indicates the duration of travel corresponding to the next phase, Indicates the passage time of vehicles not in queue. represents the i-th vehicle not in the queue, Indicates the time required for vehicles not in the queue to pass through the intersection (can be a fixed value, such as 2.5s), Indicates the number of queued vehicles corresponding to the current phase, Indicates the number of vehicles in the queue corresponding to the next phase. n indicates the number of vehicles not in the queue. max Release as many vehicles as possible within the time limit to avoid a second waiting situation, and ensure that the release of vehicles in the next phase is not affected. The value of is less than the first preset value, so that Under the condition that the number n of released vehicles is less than the first preset value, the phase duration is optimized.
[0070] Optionally, after obtaining the average travel time, Calculate the phase duration corresponding to the current phase, where t represents the phase duration corresponding to the current phase.
[0071] Optionally, when the condition is an uneven traffic flow condition, the phase duration corresponding to the current phase is determined based on the conditions satisfied by the vehicle information, including: determining the number of queuing vehicles in the current phase and the next phase based on the vehicle information corresponding to the preset algorithm and the vehicle information corresponding to the radar; determining the phase duration corresponding to the current phase based on the comparison result of the number of queuing vehicles, the phase transition time, and the number of vehicles corresponding to the next phase and the number of vehicles corresponding to the current phase.
[0072] Optionally, the traffic unevenness condition is applied to a scenario where the current phase corresponds to at least two lanes, which includes that among the lanes corresponding to the current phase, there is at least one lane that is far from reaching the required maximum green light time. (For example, the lane's travel time is is less than the first preset ratio), the time required for other lanes to reach, exceed or approach the maximum green light time (For example, the travel time of other lanes The ratio of is greater than the second preset ratio, and the second preset ratio is greater than the first preset ratio), which means that the number of vehicles in the two lanes in this phase is extremely different. In addition, the difference in the number of vehicles in different lanes corresponding to the next phase is less than the first preset difference (that is, the number of vehicles in different lanes is uniform). For example, the current phase allows north-south straight-through vehicles, while the next phase allows east-west straight-through vehicles. If there are more vehicles in one lane in the north-south direction, the required phase duration is almost reached. The other lane has fewer or almost no vehicles, far from the point where the phase duration needs to be set to If the number of vehicles on the east-west lanes is evenly distributed, then the traffic flow unevenness condition is met. The maximum duration of a green light allowed at an intersection.
[0073] Alternatively, if the condition for uneven traffic flow is met, only the lane with the fewest vehicles among the lanes corresponding to the current phase can be selected, and the number of vehicles queued in this lane can be determined as the minimum number of vehicles queued. This minimum number of vehicles queued and the number of vehicles queued in the next phase can be used to calculate the phase duration of the current phase when the current phase and the next phase reach an equilibrium state (calculating the equilibrium state based on minimizing travel time). If there are two lanes corresponding to the next phase, the equilibrium state can be calculated using the following formula:
[0074]
[0075] In this formula, t represents the phase duration value of the current phase when the equilibrium state is reached. Indicates the minimum number of vehicles in the queue, Indicates the number of queued vehicles in the two lanes corresponding to the next phase. a represents the average time it takes for queued vehicles to pass through the intersection, and b represents the average time it takes for vehicles to react. Indicates the reaction time required for the first vehicle in the lane corresponding to the current phase to start from the phase transition to the current phase and then to the first vehicle to start. Indicates the phase transition time from the current phase to the next phase (can be a fixed value).
[0076] Optionally, after obtaining the phase duration value when reaching the equilibrium state, obtain the comparison result of the number of vehicles in the current phase and the next phase (such as obtaining the ratio of the number of vehicles in the lane corresponding to the current phase to the number of vehicles in the lane corresponding to the next phase). If the ratio of the number of vehicles in the lane with the largest number of vehicles in the current phase to the number of vehicles in each lane of the next phase is greater than a third preset value (that is, it is detected that all lanes corresponding to the next phase are empty or the number of vehicles is much smaller than the number of vehicles returned by the target detection result of the current phase, indicating that there are fewer vehicles in the next phase, and the third preset value is greater than 1, and can be 1.5 or other values), then the phase duration of the current phase can be If the number of vehicles in the next phase is determined to be greater based on the vehicle number comparison result (e.g., the ratio of the number of vehicles in the lane with the largest number of vehicles in the current phase to the number of vehicles in each lane in the next phase is less than or equal to the third preset value), then the phase duration of the current phase is less than , and is greater than the phase duration value in the equilibrium state.
[0077] Optionally, in order to further improve traffic efficiency, the method of the present application includes: if it is determined that the phase duration is less than the predetermined maximum green light duration, obtaining the vehicle joining information of the vehicle formation corresponding to the current phase, the vehicle joining information including the joining time and speed of the vehicle to be joined; adjusting the phase duration corresponding to the current phase according to the vehicle joining information, the speed of the vehicles in the vehicle formation and the maximum green light duration.
[0078] Optionally, a vehicle platoon is a formation of moving vehicles, wherein if the vehicles in the corresponding lanes meet any of the platooning conditions, the vehicle is determined to be a member of the platoon. The platooning conditions include: 1. There is at least one vehicle within S2 meters (the size of S2 can be determined based on actual road conditions) in front of the vehicle's lane. 2. The vehicle was a queued vehicle in the previous time period (the length of the time period can be a fixed value or determined based on actual road conditions), and the vehicle's current speed is greater than a predetermined vehicle travel threshold (i.e., the vehicle is in motion). If the detected vehicle is determined to be a member of a platoon, the vehicle's ID number is marked, indicating that it is a platooning vehicle.
[0079] Optionally, vehicle joining information can be constantly acquired and used to determine whether the vehicle to be added is joining the platoon within a preset time period. If so, the phase duration can be adjusted. Alternatively, vehicle joining information can be acquired upon determining that the vehicle is currently within a preset time period, and the phase duration can be adjusted based on the vehicle joining information. Specifically, the preset time period can be 10 seconds before the end of the current phase.
[0080] In one embodiment, if the phase duration of the current phase is determined to be less than the maximum green light duration, When the phase delay mechanism is activated, the system uses radar scanning and image recognition to continuously monitor the last vehicle in the platoon (the last vehicle is defined as the last vehicle in the platoon on the road corresponding to the phase). If the current phase enters the final 10-second countdown and a new vehicle enters the platoon after the last vehicle, the phase duration can be extended based on the type of vehicle.
[0081] Optionally, the vehicle to be joined that is closest to the vehicle formation on the same lane can be obtained based on the vehicle joining information, and the time it takes for the vehicle to be joined to arrive at the queue position can be calculated based on the speed of the vehicle to be joined, the speed of the nearest vehicle in the vehicle formation (closest to the vehicle to be joined), and the distance between the two. The phase duration corresponding to the current phase is adjusted based on the time.
[0082] In one embodiment, in the same lane, the speed of the vehicle closest to the platoon to be joined is , the speed of the nearest vehicle in the vehicle formation corresponding to this lane is , the distance between the two workshops is , then the time for the vehicle to be added to arrive at the queue position can be obtained , the relevant calculation formula is:
[0083]
[0084] when < hour( If the delay threshold is reached, the delay program starts, increasing the phase duration based on the type of vehicle to be added. For example, for each ordinary car, a smaller time, such as 2 seconds, can be added, while for large trucks and buses, a larger time, such as 4 seconds, can be added. At the same time, the number of vehicles in other lanes corresponding to the current phase is counted. This step will continue until the phase duration (the total time refers to the green light time of the current lane) reaches the maximum green light duration. until.
[0085] Optionally, the phase can also be adjusted through an idle interruption mechanism. The traffic light control method of the present application includes: if it is determined that the current phase meets the idle interruption condition, the current phase is interrupted and switched to the next phase. The idle interruption condition includes at least one of the following: the actual passage time corresponding to the current phase is less than the phase time, and the number of vehicles corresponding to other phases is more than the number of vehicles corresponding to the current phase and is greater than a preset number.
[0086] Alternatively, the actual travel time can be expressed as the time from the current phase to the beginning of a preset range (e.g., 100 meters) for all corresponding lanes with no vehicles within it, and vehicles outside this range are farther away from it (e.g., greater than 50 meters). The size and position of this preset range can be determined based on the detection range of the camera or radar.
[0087] Optionally, after switching to the next phase, the phase duration of the next phase may be calculated according to the phase duration calculation method of the current phase.
[0088] Optionally, the phase duration can also be adjusted through overflow judgment and processing. Specifically, the vehicle monitoring information of the overflow area corresponding to the current phase is obtained. The overflow area is determined based on the acquisition range of the vehicle information. The vehicle monitoring information includes the vehicle proportion and the vehicle residence time. If it is determined that the vehicle corresponding to the overflow area meets the overflow conditions, the phase duration is adjusted according to the predetermined overflow control method. The overflow conditions include that the vehicle proportion is greater than the preset proportion and the vehicle residence time reaches a preset threshold.
[0089] Optionally, the vehicle information acquisition range can be derived from the camera or radar's sensing range, and the overflow area can be determined based on this acquisition range. This overflow area corresponds to the area where the queued vehicles are located on both sides of the intersection. Queued vehicles passing the traffic light enter this overflow area. Specifically, at an intersection, each sensing device (including cameras and radars) is only responsible for capturing the overflow area facing it. A three-way intersection is responsible not only for capturing the overflow area facing it, but also for selecting the camera to capture the lateral area based on the viewing angle. The overflow area should include both the intersection and the exit lane.
[0090] Optionally, the vehicle proportion can be determined by the sum of the overflow area in the image captured by the camera and the area of the vehicle detection frame in the overflow area. Calculate the vehicle proportion, where the vehicle proportion is The area of the overflow region is S, and the sum of the areas of the vehicle detection frames (vehicle detection frames) in the overflow region is V sum .when Greater than hour( Overflow judgment condition 1 is met. When a vehicle enters the overflow zone, it is tracked based on its ID number. Overflow judgment condition 2 is met when multiple vehicles (the number of vehicles can vary depending on vehicle type) are detected and their residence time in the overflow zone reaches a preset threshold. When both conditions 1 and 2 are met, overflow is determined to have occurred in that direction, and the phase duration is adjusted according to the predetermined overflow control method.
[0091] Optionally, after overflow is determined, the lane to which the vehicle passing through the overflow area arrives is obtained, the phase corresponding to the lane is determined, and the phase duration corresponding to the phase is reduced. The reduction ratio can be ( According to the proportion of vehicles etc.), or adjust the phase time to the minimum green light duration At the same time, each time the switch is about to be made to the corresponding phase, the overflow judgment is repeated. If the overflow is determined to be mitigated (the overflow conditions are not met or only one of the overflow conditions is met), the release logic is restored (the phase duration is recalculated).
[0092] The following combination Figure 2 The traffic signal light control method of the present application is further explained.
[0093] In one embodiment, cameras and radars are used to monitor vehicles in each lane related to the intersection. Initialize the target detector and target tracker, initialize the signal light phase, transmit the image of the lane taken by the camera to the target detector, and obtain the vehicle information in each direction based on the information returned by the target detector. Calculate the average travel time based on the vehicle information, and calculate the phase length of the current phase based on the average travel time. When executing the current phase, continuously judge whether the empty release interruption conditions are met and overflow occurs, and adjust the phase length based on the judgment result. When overflow occurs, reduce the release time of the relevant phase, and when there are 10 seconds left in the current phase, detect whether there is a vehicle entering the end of the formation. If so, start the delay mechanism and adjust the phase length until the current phase ends.
[0094] This application uses a deep learning algorithm to analyze images collected by road cameras in real time, and with the help of intersection radar equipment, obtains real-time traffic flow situation information for each lane and each phase, thereby dynamically adjusting the phase duration of the traffic light. This dynamic optimization can respond more flexibly to changes in traffic flow and improve the adaptability and efficiency of traffic lights. Compared with the traditional phase fixed-length timing method, it has higher flexibility and can adaptively make corresponding decisions based on the road conditions at the intersection. The variable-length phase duration method replaces the fixed-length phase method, which can effectively reduce the waiting time of vehicles in queues at intersections and the occurrence of secondary parking. At the same time, this application does not require phase skipping, is more in line with the safety requirements and traffic rules of intersections, and better fits the driving habits of drivers. The logic of the present invention is relatively simple and has a wide range of applications, making it easy to deploy at most intersections.
[0095] The deep learning-based traffic light control method provided in this application analyzes traffic conditions in real time, flexibly adjusting the phase duration of traffic lights to adapt to varying traffic flow. This optimized phase duration allocation mechanism can reduce waiting times at intersections and improve traffic efficiency. By reducing secondary stops and congestion, it can also reduce the probability of traffic accidents and improve driving safety.
[0096] In an optional embodiment, an electronic device is provided, such as Figure 3 As shown, Figure 3The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data exchange between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the number of transceivers 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0097] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, or a combination of a DSP and a microprocessor.
[0098] Bus 4002 may include a path for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, for example. Bus 4002 may be divided into an address bus, a data bus, a control bus, and so on. For ease of illustration, the figure shows only a single thick line, but this does not imply that there is only one bus or only one type of bus.
[0099] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0100] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.
[0101] Among them, the electronic device can be any electronic product that can interact with an object, such as a personal computer, tablet computer, smart phone, personal digital assistant (PDA), game console, interactive network television (IPTV), smart wearable device, etc.
[0102] The electronic device may further include a network device and / or an object device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers.
[0103] The network where the electronic device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.
[0104] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding contents of the aforementioned method embodiment.
[0105] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it can implement the steps and corresponding contents of the aforementioned method embodiment.
[0106] In the specification and claims of this application and the accompanying drawings, the terms "first," "second," "third," "fourth," "1," "2," and so on (if any) are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present application described herein can be practiced in an order other than that shown or described.
[0107] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the order of implementation of these steps is not limited to the order indicated by the arrows. Unless otherwise clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart can include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage in these sub-steps or stages can also be executed at different times respectively. Under different scenarios at the execution time, the execution order of these sub-steps or stages can be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0108] The above description is only an optional implementation method for some implementation scenarios of this application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of this application, the use of other similar implementation methods based on the technical ideas of this application also falls within the protection scope of the embodiments of this application.
Claims
1. A traffic light control method based on deep learning, characterized in that: The method comprises: Determining phase information of a traffic light, and obtaining vehicle information corresponding to the phase information using a preset algorithm and radar, wherein the phase information includes a current phase and a next phase for indicating vehicle passage, the preset algorithm includes a target detection algorithm and a target tracking algorithm based on a deep learning algorithm, and the vehicle information includes the number and type of vehicles; Determining a phase duration corresponding to a current phase based on conditions satisfied by the vehicle information, the conditions including an uneven traffic flow condition, the uneven traffic flow condition including that a difference in the number of vehicles between different lanes corresponding to a next phase is less than a first preset difference, that a ratio of a passage duration corresponding to at least one lane in the lanes corresponding to the current phase to a maximum green light time is less than a first preset ratio, and that a ratio of a passage duration corresponding to other lanes in the lanes corresponding to the current phase to the maximum green light time is greater than a second preset ratio, and that the second preset ratio is greater than the first preset ratio; When the condition is an uneven traffic flow condition, determining the phase duration corresponding to the current phase according to the condition satisfied by the vehicle information includes: Determine the number of queued vehicles in the current phase and the next phase according to the vehicle information corresponding to the preset algorithm and the vehicle information corresponding to the radar; Determining the phase duration corresponding to the current phase based on the number of vehicles in the queues of the current phase and the next phase, the phase transition time, and a comparison result between the number of vehicles corresponding to the next phase and the number of vehicles corresponding to the current phase, wherein the number of vehicles includes the number of vehicles in the queue and the number of vehicles not in the queue; The determining of the phase duration corresponding to the current phase according to the number of queued vehicles in the current phase and the next phase, the phase transition time, and a comparison result between the number of vehicles corresponding to the next phase and the number of vehicles corresponding to the current phase includes: Obtain the minimum number of queued vehicles corresponding to the current phase. Calculate the phase duration of the current phase when the current and next phases reach a state of equilibrium based on the minimum number of queued vehicles and the number of queued vehicles corresponding to the next phase. The number of lanes corresponding to the next phase is two. The equilibrium state is calculated as follows: = Where t represents the phase duration of the current phase when the equilibrium state is reached, Indicates the minimum number of vehicles in the queue, Indicates the number of queued vehicles in one of the two lanes corresponding to the next phase, represents the number of queued vehicles in the other lane of the two lanes corresponding to the next phase, a represents the average time it takes for queued vehicles to pass through the intersection, and b represents the average time it takes for vehicles to react. Indicates the phase transition time from the current phase to the next phase; The phase duration corresponding to the current phase is determined according to the phase duration value and the comparison result of the number of vehicles in the current phase and the next phase.
2. The traffic light control method based on deep learning according to claim 1 is characterized in that: The deep learning algorithm includes the YOLOv5 algorithm and the DeepSORT algorithm. The acquisition of the preset algorithm includes: Adjusting the YOLOv5 algorithm and generating the target detection algorithm using the adjusted YOLOv5 algorithm, wherein the adjustment includes replacing the upsampling operator in the YOLOv5 algorithm with a CARAFE upsampling operator and using Dyhead as the detection head of the YOLOv5 algorithm; The target tracking algorithm is obtained by using the DeepSORT algorithm.
3. The traffic signal light control method based on deep learning according to claim 1 is characterized in that: The method of obtaining vehicle information corresponding to the phase information by using a preset algorithm and radar includes: Collecting images of vehicles on lanes, processing the images using the preset algorithm to obtain first vehicle information on each lane, and obtaining second vehicle information on each lane using radar; A lane corresponding to the phase information is determined, and vehicle information corresponding to the phase information is acquired based on the lane, the first vehicle information, and the second vehicle information.
4. The traffic signal light control method based on deep learning according to claim 1 is characterized in that: The method comprises: If it is determined that the phase duration is less than the predetermined maximum green light duration, obtaining vehicle joining information of the vehicle formation corresponding to the current phase, the vehicle joining information including the joining time, speed, and type of the vehicle to be joined; The phase duration corresponding to the current phase is adjusted according to the vehicle joining information, the speed of the vehicles in the vehicle formation, and the maximum green light duration.
5. The traffic signal light control method based on deep learning according to claim 1 is characterized in that: The method comprises: If it is determined that the current phase meets the idle interruption condition, the current phase is interrupted and switched to the next phase. The idle interruption condition includes at least one of the following: the actual passage time corresponding to the current phase is less than the phase time, and the number of vehicles corresponding to other phases is more than the number of vehicles in the current phase and greater than a preset number.
6. The traffic signal light control method based on deep learning according to claim 1, characterized in that: The method comprises: Acquire vehicle monitoring information of an overflow area corresponding to the current phase, where the overflow area is determined based on an acquisition range of the vehicle information, and the vehicle monitoring information includes a vehicle ratio and a vehicle dwell time; If it is determined that the vehicle corresponding to the overflow area meets the overflow condition, the phase duration is adjusted according to a predetermined overflow control method. The overflow condition includes that the vehicle proportion is greater than the preset proportion and the vehicle stay time reaches a preset threshold. The overflow control method includes reducing the phase duration of the phase corresponding to the overflow area.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Single intersection adaptive control method based on phase scheme decision
CN107862878A
Intersection traffic signal real-time optimization control system and method thereof
CN113421445A
Microscopic vehicle track sensing equipment based on multi-sensor machine vision fusion
CN114693909A