Method suitable for all-weather real-time signal control, storage medium and electronic equipment
By integrating the lightweight cross-scale feature fusion module, dynamic detection head and CBAM attention mechanism improved YOLOv8 detection algorithm, combined with the Bot-SORT tracking algorithm and the cyclic maximum pressure control model, the problem of low traffic information perception accuracy in severe weather is solved, and real-time and efficient signal optimization and traffic flow detection are achieved in all-weather real-time and efficient.
Patent Information
- Application Number
- CN202510832840.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-08-15
AI Technical Summary
The existing vehicle flow information perception methods have low accuracy under severe weather conditions, resulting in a significant decrease in detection accuracy of the traffic signal control system in severe weather such as rain, fog, night, etc., and it is impossible to achieve real-time and efficient signal optimization.
The YOLOv8 detection algorithm is adopted that integrates lightweight cross-scale feature fusion module, dynamic detection head and CBAM attention mechanism, combined with the Bot-SORT tracking algorithm and the cyclic maximum pressure control model, to construct a signal optimization model, update the signal timing scheme in real time, and dynamically switch signal lights using the signal controller.
Achieve high-precision traffic information perception in bad weather conditions, improve traffic flow detection accuracy, reduce queue length and average delays, and ensure the real-time response capabilities of the signal control system.
Smart Images

Figure CN120496340A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic signal control, and in particular to a method, storage medium and electronic equipment applicable to all-weather real-time signal control. Background Art
[0002] The rapid growth in vehicle ownership has led to frequent congestion at urban intersections, posing significant challenges to traffic management. Traditional traffic signal control systems are primarily categorized into three types: fixed timing, inductive timing, and adaptive timing. Fixed timing relies on historical data and lacks real-time response capabilities. Inductive timing, which uses buried sensors such as geomagnetic coils, can only provide vehicle linear passing signals, but lacks sufficient information on queue length and fine-grained dynamics, and is susceptible to road wear and moisture erosion. Signal control methods based on the Internet of Vehicles (CV) network utilize onboard units (OBUs) to obtain high-resolution information such as vehicle position and speed, significantly improving timing optimization. However, these methods are limited by insufficient market penetration and the separation of data ownership and privacy management, hindering large-scale adoption.
[0003] In recent years, computer vision technology has developed rapidly in the transportation field. Roadside cameras have low deployment costs, wide coverage, and no penetration issues. However, traditional cameras can only provide rough traffic statistics and lack the ability to obtain fine-grained dynamic information such as vehicle ID, location, and speed. In addition, the detection accuracy drops significantly in severe weather conditions such as rain, fog, and night.
[0004] Therefore, there is an urgent need for a method, storage medium and electronic equipment suitable for all-weather real-time signal control to solve the problem that conventional traffic information perception methods have low accuracy in obtaining traffic information under severe weather conditions. Summary of the Invention
[0005] In response to the deficiencies in the prior art, the present invention provides a method, storage medium, and electronic device suitable for all-weather real-time signal control, so as to solve the problem that conventional traffic information perception methods have low accuracy in obtaining traffic information under adverse weather conditions.
[0006] To achieve the above object, the present invention adopts the following technical solutions:
[0007] A method for all-weather real-time signal control, comprising the following steps:
[0008] Step 1: Place a camera in each of the four directions of the intersection (east, west, south, and north) to obtain real-time images of the intersection through the network;
[0009] Step 2: For the environmental image obtained in step 1, multi-scale traffic object detection is performed using the improved YOLOv8 detection algorithm that integrates a lightweight cross-scale feature fusion module, a dynamic detection head, and a CBAM attention mechanism;
[0010] Step 3: Input the detection results in step 2 into the Bot-SORT tracking algorithm to obtain the traffic flow dynamic information of each lane at the traffic intersection;
[0011] Step 4: Based on the cyclic maximum pressure control model, a rolling horizon optimization mechanism is introduced to construct a signal optimization model. The traffic flow dynamic information obtained in Step 3 is input into the signal optimization model. The optimal release duration and phase sequence of each phase are calculated and updated in real time, and the optimal signal timing plan is generated.
[0012] Step 5: Send the optimal signal timing plan generated in step 4 to the signal controller via a network instruction, and use the signal controller to dynamically switch the traffic lights at the traffic intersection according to the optimal signal timing plan.
[0013] To optimize the above technical solutions, specific measures taken also include:
[0014] Furthermore, the YOLOv8 detection algorithm has improvements on the integrated lightweight cross-scale feature fusion module, including: embedding four 1*1 convolution kernels CBS in the neck layer of the original YOLOv8 structure, wherein the first CBS module is set in the top branch of the neck, and performs convolution operations on high-level features in advance before upsampling the top-level semantic features and concat fusion with the upper-level feature map; the second CBS module is set in the middle branch of the neck, and performs convolution operations on the middle-level feature map before the middle-level feature map is sent to concat with the shallow-level features; the third CBS module is set in the bottom branch of the neck, and performs convolution operations on the shallowest feature map before the shallowest feature map is sent to concat with the shallowest feature; the fourth CBS module is set in the middle and lower fusion channel of the neck, as a convolution layer between concat and upsample.
[0015] Furthermore, the improvement of the YOLOv8 detection algorithm regarding the integration of the dynamic detection head includes: replacing the original three detect modules with DyHead detect modules in the Head layer of the original YOLOv8 structure, wherein the first DyHead detect at the top is located at the end of the highest-resolution feature branch, and its input comes from the C2f output after upsampling and fusion of high-level semantic features; the second DyHead detect in the middle receives the C2f output after fusion of medium-scale features, and its source is the middle-level feature map after multi-layer CBS convolution, C2f processing and CBAM attention mechanism enhancement; the third DyHead detect at the bottom is embedded in the bottom-level branch, and its input comes from the fusion result of the bottom-level features and the output features of the previous layer after concat, and then processed by C2f.
[0016] Furthermore, the improvement of the YOLOv8 detection algorithm regarding the integration of the CBAM attention mechanism includes: introducing a CBAM attention mechanism module after the two Concat modules of the original YOLOv8 structure, wherein the first CBAM attention mechanism module is located in the mid-scale feature path, set after the feature fusion Concat module and before entering the semantic extraction module C2f; the second CBAM attention mechanism module is set after the lowest-level feature Concat and before entering the C2f module.
[0017] Furthermore, the planning time domain T is set in the signal optimization model, and its signal optimization objective function is:
[0018]
[0019] Where A 2 represents the set of all lane groups considered, s ij (t+τ) is the binary decision variable for enabling lane (i, j) at time t+τ, τ represents the time step index in the planning horizon, represents the effective saturation flow rate of the (i, j) passage path, w ij (t) represents the queue pressure of lane (i, j) at time t, where i in (i, j) represents the direction of the vehicle entering the intersection and j represents the direction of the vehicle leaving the intersection;
[0020] Queuing pressure ij The calculation formula of (t) is as follows:
[0021]
[0022] Where x ij (t) is the queue length on lane (i, j) at time t, k∈Out jUsed to identify all possible downstream paths of j, r jk is the steering ratio of the vehicle from lane j to downstream lane k;
[0023] Effective saturation flow rate The calculation formula is as follows:
[0024]
[0025] Where Q ij is the nominal saturation flow rate of the (i, j) passage path, L ij (t+τ) represents the time loss caused by phase switching at time t+τ, L ij The calculation formula for (t+τ) is as follows:
[0026]
[0027] Where, is the total time loss of the path (i, j) when the phase is switched, P represents the set of all phases, |P| represents the number of phases, z p (t) is an indicator variable indicating whether phase p is enabled at time t.
[0028] Furthermore, the rolling time domain optimization mechanism is as follows: in each decision, only the first phase in the current cycle of step 1 to step 5 is executed, and the remaining phases are replanned based on the latest traffic dynamic information during the next cycle.
[0029] Furthermore, the traffic flow dynamic information includes vehicle unique ID, location information, movement speed and real-time queue length.
[0030] Furthermore, it also includes: when the multi-scale traffic target detection fails in step 2, or when the traffic flow dynamic information of each lane of the traffic intersection fails in step 3, automatically falling back to the traditional sensing control mode and periodically evaluating the recovery conditions.
[0031] Furthermore, a computer-readable storage medium stores a computer program, characterized in that the computer program enables a computer to execute the above-mentioned method applicable to all-weather real-time signal control.
[0032] Furthermore, an electronic device is characterized in that it includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements a method suitable for all-weather real-time signal control as described above.
[0033] The beneficial effects of the present invention are:
[0034] The present invention integrates a lightweight cross-scale feature fusion module and embeds four 1*1 convolution kernels (CBS) in the neck layer of the original YOLOv8 structure. The four convolution kernels (CBS) are embedded in the improved network architecture to fuse features of different scales to capture finer details. This can effectively improve network performance while ensuring computational efficiency, enabling real-time traffic flow detection in complex environments such as rain, fog, and at night.
[0035] By integrating a dynamic detection head, the present invention replaces the original three detect modules with a DyHead detect module. The first DyHead detect at the top can provide strong spatial detail preservation capabilities and is suitable for detecting small-scale targets. The second DyHead detect can implement multiple dynamic modeling strategies such as channel attention, spatial attention, and scale selection, which helps to improve the robustness for medium-scale targets, especially in complex backgrounds or scenes with dense targets. The third DyHead detect can not only dynamically model deep semantics, but also enhance the perception of large-scale targets through inter-layer interaction, enabling the detection head to have better generalization capabilities and precision control for multi-scale targets.
[0036] The present invention integrates the CBAM attention mechanism and introduces a CBAM attention mechanism module after the two Concat modules of the original YOLOv8 structure. The first CBAM attention mechanism module helps to immediately identify important feature areas after fusion and suppress background interference, thereby optimizing the representation ability of medium-scale semantics and enhancing the model's recognition effect on medium-sized targets. The second CBAM attention mechanism module can guide the model to focus on significant information such as small target areas, edge details and texture features. Since shallow features are more biased towards spatial details, the introduction of the CBAM attention mechanism module can improve the accuracy of small target detection and reduce the risk of false detection due to texture interference. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flow chart of a method for all-weather real-time signal control proposed by the present invention;
[0038] Figure 2 This is a schematic diagram of the structure of an improved YOLOv8 suitable for all-weather real-time signal control method proposed in the present invention;
[0039] Figure 3 This is a schematic diagram of the structure of the original YOLOv8;
[0040] Figure 4 This is a structural schematic diagram of three perception modules of a dynamic detection head suitable for all-weather real-time signal control method proposed by the present invention. DETAILED DESCRIPTION
[0041] The present invention will now be described in further detail with reference to the accompanying drawings.
[0042] As attached Figure 1 As shown, a method for all-weather real-time signal control according to an embodiment of the present invention includes the following steps:
[0043] Step 1: Place a high-definition camera in each of the four directions of the intersection (east, west, south, and north) to obtain real-time environmental images of the intersection through the network;
[0044] Step 2: For the environmental image acquired in Step 1, multi-scale traffic object detection is performed using the improved YOLOv8 detection algorithm that integrates a lightweight cross-scale feature fusion module (CCFM), a dynamic detection head (Dynamic Head), and a CBAM (Convolutional Block Attention Module) mechanism;
[0045] Step 3: Input the detection results in step 2 into the Bot-SORT tracking algorithm to obtain the traffic flow dynamic information of each lane at the traffic intersection;
[0046] Step 4: Based on the cyclic maximum pressure control model, a rolling horizon optimization mechanism is introduced to construct a signal optimization model. The traffic flow dynamic information obtained in Step 3 is input into the signal optimization model. The optimal release duration and phase sequence of each phase are calculated and updated in real time, and the optimal signal timing plan is generated.
[0047] Step 5: Send the optimal signal timing plan generated in step 4 to the signal controller via a network instruction, and use the signal controller to dynamically switch the traffic lights at the traffic intersection according to the optimal signal timing plan.
[0048] As attached Figure 2 and attached Figure 3As shown in the figure, the improvement of the above-mentioned YOLOv8 detection algorithm on the integrated lightweight cross-scale feature fusion module includes: embedding four 1*1 convolution kernels CBS in the neck layer of the original YOLOv8 structure, wherein the first CBS module is set in the top branch of the neck, and before the top semantic features are upsampled and concat-fused with the upper feature map, the high-level features are convolved in advance. This can improve the spatial resolution and detail retention ability of the upsampled features, so that they have stronger alignment ability when fused with the middle-level features and reduce the confusion of the fusion information; the second CBS module is set in the middle branch of the neck, and the convolution operation is performed before the middle-level feature map is sent to the concat-fused shallow-level features. This operation enhances the middle-level The expressive power of semantic features makes it easier to form meaningful fusion with shallow features, improving the overall context modeling effect. The third CBS module is set in the bottom branch of the neck and performs a convolution operation before the shallowest feature map is sent to the concat with the shallowest feature. This is mainly to improve the discriminative ability of shallow features. At the same time, it serves as the input preparation of the CBAM module, allowing the attention mechanism to focus more on key areas in the shallow layer, further improving the spatial expression of the fused features. The fourth CBS module is set in the fusion channel of the middle and lower layers of the neck. As a convolution layer between the concat and upsample, it plays a role in further refining the fused features, adjusting the channel structure, and enhancing local semantics. It also provides a more stable feature foundation for CBAM's attention modeling. Among them, the same modules mentioned above can be named in any order from top to bottom: top layer, upper layer, middle layer, shallow layer, and shallowest layer, with any hierarchical relationship.
[0049] In this solution, during traffic flow detection, vehicles appear at different sizes in different frames, especially in changeable weather conditions. Multi-scale object detection is essential in these situations. By incorporating the CCFM module, four convolutional bases (CBS) are embedded in an improved network architecture, fusing features at different scales to capture finer details. This effectively improves network performance while maintaining computational efficiency, enabling real-time traffic flow detection even in complex environments such as rain, fog, and at night.
[0050] The above-mentioned YOLOv8 detection algorithm, regarding the improvement of the integrated dynamic detection head, includes: replacing the original three detect modules with DyHead detect modules in the Head layer of the original YOLOv8 structure, where the first DyHeaddetect at the top is located at the end of the highest resolution feature branch, and its input comes from the C2f output after upsampling and fusion of high-level semantic features. This part of the feature has a strong ability to retain spatial details and is suitable for detecting small-scale targets. Introducing DyHeaddetect to this position can also cooperate with the use of Houshu dynamic attention mechanism to more effectively mine the semantic connection between fine-grained features and improve the detection accuracy of small targets; the second DyHead detect in the middle receives the C2f output after medium-scale feature fusion, which comes from the middle-level feature map after multi-layer CBS convolution, C2f processing and CBAM attention mechanism enhancement. DyHead detect can implement multiple dynamic modeling strategies such as channel attention, spatial attention and scale selection here, which helps to improve the robustness to medium-scale targets, especially in complex backgrounds or target-dense scenes; the third DyHead at the bottom Detect is embedded in the bottom-level branch. The input of this branch comes from the concat of the bottom-level features and the output features of the previous layer. The fusion result after C2f processing has strong semantic expression ability and relatively low spatial resolution. DyHeaddetect can not only dynamically model deep semantics, but also improve the perception ability of large-scale targets through inter-layer interaction, so that the detection head has better generalization ability and precision control for multi-scale targets.
[0051] As attached Figure 4 As shown, based on the above scheme, the network structure of the dynamic detection head can be integrated into three perception modules, π l The module optimizes the feature map through instance-specific attention to enhance the model's ability to detect and locate individual vehicles in complex environments, solving the problem that traditional algorithms cannot identify overlapping or partially occluded vehicles; s The module is used to solve the problem of scale variation of traffic objects. Vehicles in traffic scenes may appear in different sizes due to their positions, camera angles or distances. s Ensure that the network can adapt to these scale differences. cThe module improves the network's ability to distinguish between different categories of objects (such as vehicles and traffic signs). By utilizing category-specific attention modules, the risk of YOLOv8 misclassifying non-vehicle objects is reduced and the network's ability to focus on relevant targets is enhanced. This improvement can be referenced by the Microsoft team's method of using multiple attention mechanisms to unify object detection heads. By applying attention mechanisms from three different perspectives, including scale-aware attention, spatial-aware attention, and task-aware attention, the expressive power of the model's target detection head is significantly improved without increasing the amount of computation.
[0052] The above-mentioned YOLOv8 detection algorithm, regarding the improvement of the integrated CBAM attention mechanism, includes: introducing the CBAM attention mechanism module after the two Concat modules of the original YOLOv8 structure, where the first CBAM attention mechanism module on the left is located in the mid-scale feature path, set after the feature fusion Concat module and before entering the semantic extraction module C2f. The process of this path is: the feature map formed by upsampling and skip connection fusion is first spliced through the Concat module, and then sent to the CBAM attention mechanism module to enhance important spatial and channel features, and then further refined through the C2f module. Finally, convolution compression and normalization operations are performed through the CBS module. The CBAM attention mechanism module set at this position helps to immediately identify important feature areas after fusion and suppress background interference, thereby optimizing the representation ability of mid-scale semantics and enhancing the model's recognition effect on medium-sized targets; the second CBAM attention mechanism module on the right is set after the lowest-level feature Concat and before entering the C2f module. The entire path is: Concat→CBAM→C2f. This module directly acts on high-resolution shallow feature maps. Before entering the C2f module for further abstraction, it uses the CBAM attention mechanism module to guide the model to focus on salient information such as small target areas, edge details, and texture features. Since shallow features focus more on spatial details, introducing the CBAM attention mechanism module can improve the accuracy of small target detection and reduce the risk of false detection due to texture interference.
[0053] In this solution, in the traffic detection scenario, the CBAM attention mechanism module presents a relatively good balance between efficiency and accuracy. The channel attention mechanism allows the model to identify the multi-scale traffic information contained in different channels, thereby improving the perception of key semantics such as vehicle outlines and driving directions. The spatial attention mechanism focuses on the spatial location of actual traffic elements in the image, effectively filtering out irrelevant background such as open roads and areas with few pedestrians. This step-by-step guided attention mechanism can help the model accurately locate and identify vehicle targets in complex and dynamic traffic environments, and can also avoid the waste of computing resources in useless areas. The lightweight structure of the CBAM attention mechanism module is very suitable for real-time traffic detection tasks. It can improve the model's attention to the target and detection accuracy while maintaining high-speed processing.
[0054] In the above signal optimization model, the planning time domain T is set, and the signal optimization objective function is:
[0055]
[0056] Where A 2 represents the set of all lane groups considered, s ij (t+τ) is a binary decision variable for enabling lane (i, j) at time t+τ, indicating whether lane (i, j) is enabled at time t+τ. τ represents the time step index in the planning domain. represents the effective saturation flow rate of the (i, j) passage path, w ij (t) represents the queue pressure of lane (i, j) at time t, where i in (i, j) represents the direction of the vehicle entering the intersection, such as east, south, west, north, and other different directions of vehicles, and j represents the direction of the vehicle leaving the intersection, that is, the direction of the next road that the vehicle will drive towards after entering the intersection from the entrance road.
[0057] Queuing pressure ij The calculation formula of (t) is as follows:
[0058]
[0059] Where x ij (t) is the queue length on lane (i, j) at time t, k∈Out j Used to identify all possible downstream paths of j, r jk is the steering ratio of the vehicle from lane j to downstream lane k.
[0060] Effective saturation flow rate The calculation formula is as follows:
[0061]
[0062] Where Q ij is the nominal saturation flow rate of the (i, j) passage path, L ij (t+τ) represents the time loss caused by phase switching at time t+τ. ij The calculation formula for (t+τ) is as follows:
[0063]
[0064] Where, is the total time loss of the path (i, j) when the phase is switched, P represents the set of all phases, |P| represents the number of phases, z p (t) is an indicator variable indicating whether phase p is enabled at time t.
[0065] The signal optimization objective function is re-optimized after each cycle to achieve rolling optimization. The cyclic maximum pressure control model must also meet the following constraints: only one signal phase is enabled at any time, and a full cycle is completed within the planning time domain T.
[0066] The above-mentioned rolling horizon optimization mechanism is as follows: at each decision-making stage, only the first phase within the current cycle of steps 1 to 5 is executed. The remaining phases are replanned in the next cycle based on the latest traffic dynamics information to reduce lag errors.
[0067] The above-mentioned traffic dynamic information includes but is not limited to vehicle unique ID, location information, movement speed and real-time queue length.
[0068] The above-mentioned solution also includes: when multi-scale traffic target detection fails in step 2, or when the traffic flow dynamic information of each lane of the traffic intersection fails in step 3, it automatically falls back to the traditional sensing control mode and periodically evaluates the recovery conditions to ensure the safe and stable operation of the system in extreme environments.
[0069] A specific embodiment of the present invention is as follows:
[0070] The present invention forms a closed-loop control process from environmental image acquisition, target detection and tracking, signal timing optimization to solution issuance and execution, as follows:
[0071] Step 1: Deploy a high-definition camera in each of the four directions of the intersection: east, west, south, and north. The cameras are installed at a height of approximately 10 meters and an angle of approximately 45 degrees, covering the entire intersection entrance. They feature 1080P resolution, a 30fps frame rate, night vision, and rainproof capabilities. The real-time video stream of the captured environment is transmitted via the 5G communication network to the roadside edge server for processing.
[0072] Step 2: Use the improved YOLOv8 detection algorithm to perform multi-scale traffic target detection, specifically:
[0073] (1) The input end receives each frame of the environment image and first performs feature extraction and multi-scale fusion through a lightweight cross-scale feature fusion module;
[0074] (2) After feature extraction and fusion, it enters the dynamic detection head and passes through the scale-aware attention, space-aware attention, and task-aware attention modules in sequence to integrate different scales, position information, and category features to improve the accuracy of target detection;
[0075] (3) In order to improve the reasoning speed and robustness, the CBAM attention mechanism is further introduced after the detection head. The channel attention module is first used to implement weighted modeling for the different channels of each layer of feature map to highlight the key semantic information channels. Then, the position of the key area in the feature map is weighted by the spatial CBAM attention mechanism module to emphasize the key spatial information in the image. This mechanism allows the network to adaptively enhance key information locally and globally while suppressing irrelevant background or noise areas. After processing by the above detection modules, the output includes the category, bounding box position and confidence information of each vehicle.
[0076] During the construction of the pyramid network architecture, CBAM models the saliency of feature maps in the channel dimension and spatial dimension, guiding the model to focus on areas that are more discriminative for the current task, thereby improving detection accuracy and reducing redundant calculations.
[0077] Step 3, vehicle tracking and traffic flow dynamic data extraction is to input the detected vehicle information results into the Bot-SORT multi-target tracking algorithm. On each frame of the image, the IOU matching is performed with the Kalman prediction value for correlation matching. The trajectory of the successfully matched vehicle is updated, and the unmatched target is created. At the same time, a globally unique ID is assigned to each vehicle, and its position information is continuously tracked. The vehicle's movement speed, lane affiliation, and current queue length are calculated in real time based on the trajectory information. The final output includes the vehicle ID, the current frame vehicle center point position coordinates, the vehicle's speed, the lane number, and the corresponding queue length x ij The traffic flow dynamic information of (t) serves as the real-time input of the subsequent signal optimization module.
[0078] Step 4: Based on the cyclic maximum pressure control model, a rolling time domain optimization mechanism is introduced to construct a signal optimization model. The traffic flow dynamic information obtained in Step 3 is input into the signal optimization model. The optimal release duration and phase sequence of each phase are calculated and updated in real time, and the optimal signal timing plan is generated. The rolling time domain optimization mechanism is used in traffic signal control. After each solution of the optimal signal timing plan within the planning time domain T, only the first phase of the current cycle (i.e., the first phase control) is executed. The remaining phases are replanned based on the latest traffic status when making decisions in the next cycle to reduce lag errors. Through this continuous rolling optimization method, a rapid response to changes in traffic conditions is achieved, ensuring that the traffic signal control plan always matches the actual traffic conditions.
[0079] Specifically, set the planning time domain T and define the objective function:
[0080]
[0081] The effective saturation flow rate is defined as:
[0082]
[0083] w ij (t): Queuing pressure, calculated as:
[0084]
[0085] Where x ij (t) is the queue length on lane (i, j) at time t; k∈Out j Used to identify all possible downstream paths of j; r jk is the steering ratio of the vehicle from lane j to downstream path k; Q ij is the nominal saturation flow rate of lane (i, j); L ij (t+τ) is the phase switching delay, which is defined as follows:
[0086]
[0087] Where, is the time lost during complete phase switching, z p (t) is the activation indicator variable of the p-th phase at time t, P represents the set of all phases, and |P| represents the number of phases.
[0088] The above signal optimization model may further include the following constraints to ensure that a full cycle is completed within the time domain T:
[0089] Phase exclusive constraint: Only one signal phase is allowed to be active at each moment. The constraints are as follows:
[0090]
[0091] Where z p (t+τ) is the activation indicator variable of the p-th phase at time t+τ;
[0092] Phase sequence constraints: Phase switching complies with sequence constraints to avoid disordered jumps. The constraints are as follows:
[0093]
[0094] Complete cycle constraint: Ensure that all |P| phases are activated at least once in a cycle. The constraints are as follows:
[0095] p(t)≥|P|-(Cc(t)), if z p(t) =1
[0096] Where p(t) is the signal light phase at time t, C is the maximum allowed signal cycle length, c(t) is the elapsed time of the current cycle, and |P| is the total number of phases.
[0097] Timer reset constraint, define a binary variable φ(t+τ)∈0,1 to indicate whether to restart the cycle:
[0098]
[0099] When φ(t+τ)=0, the cycle continues and c increases by 1; when φ(t+τ)=1, the cycle restarts and c returns to 1:
[0100]
[0101] The timer linearization constraint converts the above equation into a linear inequality usable by MILP:
[0102]
[0103] Where M is a sufficiently large constant;
[0104] Phase-lane mapping constraint, mapping the phase activation variable to a specific lane passage decision s ij (t+τ):
[0105]
[0106] Where s ij (t+τ) is an indicator of the choice in stage 1. Binary variable Represents the relationship between stage p and i, j. When p activates the corresponding move, is 1 if the value is set, otherwise it is 0.
[0107] The above solution can use the Gurobi optimizer and be modeled as a mixed integer linear program (MILP). The solution time is controlled within 200ms each time to ensure the real-time performance of rolling updates.
[0108] This invention can improve signal control performance in normal and mildly adverse weather conditions, reduce queue lengths, and reduce average delays. It solves the problems of traditional fixed timing and inductive control in existing traffic signal control methods, such as delayed response to sudden changes in traffic volume, large queues and delays, and the sharp decline in accuracy of detection based on a single visual algorithm in adverse weather conditions such as fog, rain, and night, resulting in signal timing failure. All-weather high-precision perception: Integrating cross-scale and dual-level attention mechanisms, detecting mAP in 27 complex scenarios such as fog, rain, and night 50 The system achieved a 20.5% improvement in average delays and a 26.95% reduction in maximum queue lengths under normal and mildly adverse weather conditions, achieving an F1 score of 83.46%. Real-time dynamic timing: Based on rolling cycle maximum pressure optimization, the system reduced average delays by 26.95% and maximum queue lengths by 65.15% under normal and mildly adverse weather conditions. Combining high-precision perception and real-time optimization capabilities, it is suitable for intelligent transportation systems at urban intersections.
[0109] In another embodiment based on the above, the present invention proposes a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the above-mentioned method applicable to all-weather real-time signal control.
[0110] In another embodiment based on the above, the present invention proposes an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements a method suitable for all-weather real-time signal control as described above.
[0111] In the embodiments disclosed herein, computer storage media can be tangible media that can contain or store programs for use by or in conjunction with an instruction execution system, device, or apparatus. Computer storage media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. More specific examples of computer storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0112] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. The above are only preferred embodiments of the present invention, and the scope of protection of the present invention is not limited to the above embodiments. All technical solutions that fall under the concept of the present invention belong to the scope of protection of the present invention. It should be pointed out that for those skilled in the art in this field, a number of improvements and modifications without departing from the principles of the present invention should be regarded as the scope of protection of the present invention.
Claims
1. A method for all-weather real-time signal control, characterized in that: The steps include: Step 1: Place a camera in each of the four directions of the intersection (east, west, south, and north) to obtain real-time images of the intersection through the network; Step 2: For the environmental image obtained in step 1, multi-scale traffic object detection is performed using the improved YOLOv8 detection algorithm that integrates a lightweight cross-scale feature fusion module, a dynamic detection head, and a CBAM attention mechanism; Step 3: Input the detection results in step 2 into the Bot-SORT tracking algorithm to obtain the traffic flow dynamic information of each lane at the traffic intersection; Step 4: Based on the cyclic maximum pressure control model, a rolling horizon optimization mechanism is introduced to construct a signal optimization model. The traffic flow dynamic information obtained in Step 3 is input into the signal optimization model. The optimal release duration and phase sequence of each phase are calculated and updated in real time, and the optimal signal timing plan is generated. Step 5: Send the optimal signal timing plan generated in step 4 to the signal controller via a network instruction, and use the signal controller to dynamically switch the traffic lights at the traffic intersection according to the optimal signal timing plan.
2. The method for all-weather real-time signal control according to claim 1, characterized in that: The YOLOv8 detection algorithm is improved by integrating a lightweight cross-scale feature fusion module, including: embedding four 1*1 convolution kernels (CBS) in the neck layer of the original YOLOv8 structure, wherein the first CBS module is set in the top branch of the neck, and performs a convolution operation on the high-level features in advance before upsampling the top-level semantic features and concatenating them with the upper-level feature maps; the second CBS module is set in the middle branch of the neck, and performs a convolution operation on the middle-level feature maps before they are sent to concatenate with the shallow-level features; the third CBS module is set in the bottom branch of the neck, and performs a convolution operation on the shallowest-level feature maps before they are sent to concatenate with the shallowest-level features; and the fourth CBS module is set in the middle and lower-level fusion channel of the neck, serving as a convolution layer between concatenation and upsampling.
3. The method for all-weather real-time signal control according to claim 1, characterized in that: The improvements to the YOLOv8 detection algorithm regarding the integration of the dynamic detection head include: replacing the original three detect modules with DyHead detect modules in the Head layer of the original YOLOv8 structure, where the first DyHead detect at the top is located at the end of the highest-resolution feature branch, and its input comes from the C2f output after upsampling and fusion of high-level semantic features; the second DyHead detect in the middle receives the C2f output after fusion of medium-scale features, which is derived from the mid-level feature map after multi-layer CBS convolution, C2f processing, and CBAM attention mechanism enhancement; and the third DyHead detect at the bottom is embedded in the bottom-level branch, and its input comes from the fusion result of the bottom-level features and the output features of the previous layer after concat, processed by C2f.
4. The method for all-weather real-time signal control according to claim 1, characterized in that: The improvement of the YOLOv8 detection algorithm regarding the integration of the CBAM attention mechanism includes: introducing a CBAM attention mechanism module after the two Concat modules of the original YOLOv8 structure, wherein the first CBAM attention mechanism module is located in the mid-scale feature path, set after the feature fusion Concat module and before entering the semantic extraction module C2f; the second CBAM attention mechanism module is set after the bottom-level feature Concat and before entering the C2f module.
5. The method for all-weather real-time signal control according to claim 1, characterized in that: The signal optimization model sets the planning time domain T, and its signal optimization objective function is: Where A 2 represents the set of all lane groups considered, s ij (t+τ) is the binary decision variable for enabling lane (i, j) at time t+τ, τ represents the time step index in the planning horizon, represents the effective saturation flow rate of the (i, j) passage path, w ij (t) represents the queue pressure of lane (i, j) at time t, where i in (i, j) represents the direction of the vehicle entering the intersection and j represents the direction of the vehicle leaving the intersection; Queuing pressure ij The calculation formula of (t) is as follows: Where x ij (t) is the queue length on lane (i, j) at time t, k∈Out j Used to identify all possible downstream paths of j, r jk is the steering ratio of the vehicle from lane j to downstream lane k; Effective saturation flow rate The calculation formula is as follows: Where Q ij is the nominal saturation flow rate of the (i, j) passage path, L ij (t+τ) represents the time loss caused by phase switching at time t+τ; L ij The calculation formula for (t+τ) is as follows: Where, is the total time loss of the path (i, j) when the phase is switched, P represents the set of all phases, |P| represents the number of phases, z p (t) is an indicator variable indicating whether phase p is enabled at time t.
6. The method for all-weather real-time signal control according to claim 1, characterized in that: The rolling horizon optimization mechanism is as follows: in each decision, only the first phase in the current cycle of steps 1 to 5 is executed, and the remaining phases are replanned based on the latest traffic dynamic information during the next cycle.
7. The method for all-weather real-time signal control according to claim 1, characterized in that: The traffic flow dynamic information includes vehicle unique ID, location information, movement speed and real-time queue length.
8. The method for all-weather real-time signal control according to claim 1, characterized in that: Also includes: If multi-scale traffic target detection fails in step 2, or if traffic flow dynamic information for each lane of the traffic intersection fails in step 3, the system automatically falls back to the traditional sensing control mode and periodically evaluates the recovery conditions.
9. A computer-readable storage medium storing a computer program, characterized in that: The computer program enables a computer to execute a method applicable to all-weather real-time signal control as described in any one of claims 1 to 8.
10. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for all-weather real-time signal control according to any one of claims 1 to 8 is implemented.