Urban intelligent traffic control method and system
Through the improved YOLOv5s network, the geometric attention mechanism and the receptive field module are used to improve the detection accuracy of electric vehicles and pedestrians, solve the problem of inaccurate detection, and achieve more accurate traffic light adjustment and traffic flow optimization.
Patent Information
- Application Number
- CN202410848663.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-06-27
AI Technical Summary
In the existing technology, the detection of electric vehicles and pedestrians on non-motorized lanes is inaccurate, resulting in inaccurate traffic light control results and inability to effectively optimize traffic flow and reduce congestion.
Using the improved YOLOv5s network, the geometric attention mechanism module and the receptive field module are added to the backbone network and fusion network to improve the detection accuracy of electric vehicles and pedestrians, obtain more accurate motion trajectories and speeds, and adjust the signal duration.
It improves the detection accuracy of electric vehicles and pedestrians, provides more reliable feature representation, and ensures the accuracy of signal light adjustment and optimization of traffic flow.
Smart Images

Figure CN118800084A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of urban intelligent traffic control, and in particular to an urban intelligent traffic control method and system. Background Art
[0002] With the rapid increase in urban population and the number of vehicles, the problem of road traffic congestion has become increasingly prominent. Therefore, a traffic light control system is needed that can adjust the duration of traffic lights according to real-time traffic flow, improve the quality of traffic management, reduce vehicle parking waiting time, and alleviate urban traffic congestion.
[0003] In the prior art, when traffic lights are intelligently controlled, vehicles or pedestrians on the road are first detected, and then the movement trajectory and speed of the vehicles or pedestrians are obtained based on the detection results. Then, the estimated time for the vehicles or pedestrians to pass through the traffic intersection is obtained based on the movement trajectory and speed of the vehicles or pedestrians. Finally, the duration of the traffic lights corresponding to the traffic intersection is adjusted according to the estimated time.
[0004] However, during peak hours, electric vehicles and pedestrians on non-motorized vehicle lanes tend to be densely packed on urban roads. This is reflected in the image as the electric vehicle body or part of the pedestrian's body is obscured. As a result, traditional vehicle detection systems may fail to accurately capture the characteristics of electric vehicles or pedestrians, resulting in inaccurate detection results. Adjusting the timing of traffic lights based on inaccurate detection results makes it difficult to optimize traffic flow and reduce congestion. Summary of the invention
[0005] Based on this, in order to solve the technical problem of inaccurate detection of electric vehicles or pedestrians on non-motorized vehicle lanes in road condition images in the prior art, this specification provides an urban intelligent traffic control method and system.
[0006] This manual adopts the following technical solutions:
[0007] This specification provides an urban intelligent traffic control method, including:
[0008] Obtaining a number of road condition images taken at a traffic intersection within a preset time period;
[0009] Constructing an improved YOLOv5s network including a backbone network Backbone, a fusion network Neck and a prediction classifier Head; the improved YOLOv5s network is constructed by adding a geometric attention mechanism module and a receptive field module connected in sequence to the connection part of the backbone network Backbone and the fusion network Neck of the original YOLOv5s network; training the improved YOLOv5s network to obtain a detection model for detecting traffic targets in road condition images;
[0010] Use the traffic vehicle detection model to detect vehicles in several road condition images: obtain low-level pixel feature maps containing geometric features in the road condition images through the backbone network Backbone; use the geometric attention mechanism module to perform weighted attention on the geometric circular features in the low-level pixel feature map to obtain the head enhanced feature map; use the receptive field module to perceive the neighborhood of the weighted attention geometric circular features at different scales to obtain the enhanced low-level pixel feature map; use the fusion network Neck and the detection head Head to extract features from the enhanced low-level pixel feature map, and output the type and location of traffic targets in several road condition images;
[0011] Based on the types and locations of traffic targets in several road condition images, vehicles and pedestrians are tracked to obtain the movement trajectories and speeds of vehicles and pedestrians within a preset time period; based on the movement trajectories and speeds, the estimated time for vehicles to pass through traffic intersections is obtained, and the duration of traffic lights corresponding to the traffic intersections is adjusted according to the estimated time.
[0012] Furthermore, the geometric attention mechanism module specifically includes:
[0013] A geometric descriptor generator, the geometric descriptor generator is used to filter or convolve the low-level pixel feature map using a convolution kernel that responds to the circular feature to obtain a response map of the circular feature of the low-level pixel feature map; the response map is a two-dimensional tensor, each value in the two-dimensional tensor ranges from 0 to 1, to indicate the strength of the response of the corresponding position to the circular feature;
[0014] An attention mechanism layer connected to the output of the geometric descriptor generator is used to multiply the two-dimensional tensor with the low-level pixel feature map to increase the weight of features in the low-level pixel feature map that are more responsive to circular features.
[0015] Furthermore, the receptive field module is at least one of an ASPP module, an RFB module, and a PPM module.
[0016] Furthermore, the adjusting the duration of the traffic light corresponding to the traffic intersection according to the estimated time specifically includes:
[0017] Calculate the estimated time each vehicle will take to pass the intersection based on vehicle tracking and prediction data;
[0018] Use optimization algorithms to obtain the signal light combination time that minimizes the time it takes for all vehicles to pass through the intersection;
[0019] The signal light duration is adjusted based on the signal light combination time.
[0020] This specification provides an urban intelligent traffic control system, including:
[0021] A data acquisition module, used to obtain a number of road condition images taken at a traffic intersection within a preset time period;
[0022] A traffic target detection module is used to construct an improved YOLOv5s network including a backbone network Backbone, a fusion network Neck and a prediction classifier Head; the improved YOLOv5s network is constructed by adding a geometric attention mechanism module and a receptive field module connected in sequence to the connection part of the backbone network Backbone and the fusion network Neck of the original YOLOv5s network; the improved YOLOv5s network is trained to obtain a detection model for detecting vehicles in road condition images;
[0023] Use the traffic vehicle detection model to detect vehicles in several road condition images: obtain low-level pixel feature maps containing geometric features in the road condition images through the backbone network Backbone; use the geometric attention mechanism module to perform weighted attention on the geometric circular features in the low-level pixel feature map to obtain the head enhanced feature map; use the receptive field module to perceive the neighborhood of the weighted attention geometric circular features at different scales to obtain the enhanced low-level pixel feature map; use the fusion network Neck and the detection head Head to extract features from the enhanced low-level pixel feature map, and output the type and location of traffic targets in several road condition images;
[0024] The traffic light control module is used to track vehicles and pedestrians based on the types and locations of traffic targets in a number of road condition images to obtain the movement trajectory and movement speed of vehicles and pedestrians within a preset time period; based on the movement trajectory and movement speed, the estimated time for the vehicle to pass the traffic intersection is obtained, and the traffic light duration corresponding to the traffic intersection is adjusted according to the estimated time.
[0025] Furthermore, the vehicle detection module is used to construct a geometric attention mechanism module, and the geometric attention mechanism module includes:
[0026] A geometric descriptor generator, the geometric descriptor generator is used to filter or convolve the low-level pixel feature map using a convolution kernel that responds to the circular feature to obtain a response map of the circular feature of the low-level pixel feature map; the response map is a two-dimensional tensor, each value in the two-dimensional tensor ranges from 0 to 1, to indicate the strength of the response of the corresponding position to the circular feature;
[0027] An attention mechanism layer connected to the output of the geometric descriptor generator is used to multiply the two-dimensional tensor with the low-level pixel feature map to increase the weight of features in the low-level pixel feature map that are more responsive to circular features.
[0028] Furthermore, the vehicle detection module is used to construct a receptive field module, and the receptive field module is at least one of an ASPP module, an RFB module, and a PPM module.
[0029] Furthermore, the signal light control module is specifically used for:
[0030] Calculate the estimated time each vehicle will take to pass the intersection based on vehicle tracking and prediction data;
[0031] Use optimization algorithms to obtain the signal light combination time that minimizes the time it takes for all vehicles to pass through the intersection;
[0032] The signal light duration is adjusted based on the signal light combination time.
[0033] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0034] The present invention firstly outputs low-level pixel feature maps of different scales through the backbone network Backbone. These feature maps capture multi-level detail information including geometric shapes in the road condition image. Since the human head is approximately circular, the geometric attention mechanism is used to focus on the approximately circular geometric features in the low-level pixel feature map, so that the model can pay more attention to the relevant features of the head area, thereby improving the model's perception and understanding of the head area.
[0035] Then, the neighborhood of the weighted focused geometric circular feature is perceived at different scales through the receptive field module, which can more accurately obtain the electric vehicle features or pedestrian features around the head, avoiding the interference of other non-electric vehicle factors. This helps to obtain more accurate and rich low-level pixel features of electric vehicles or pedestrians, providing a more reliable feature representation for subsequent vehicle or pedestrian detection, tracking and recognition tasks, so as to obtain more accurate detection results. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0037] Figure 1 A flow chart of a city intelligent traffic control method provided in this specification;
[0038] Figure 2 Schematic diagram of the original YOLOv5s model framework provided for this manual;
[0039] Figure 3 Schematic diagram of the improved YOLOv5s model framework provided for this specification. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solutions and advantages of this specification more clear, the technical solutions of this application will be clearly and completely described below in combination with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in the specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] The current process of intelligently adjusting the timing of traffic lights first involves detecting and classifying traffic targets including vehicles and pedestrians on the road, and then predicting the time it takes for vehicles and pedestrians to pass through traffic intersections by analyzing their movement trajectories and speeds. Finally, combined with real-time traffic data and optimization algorithms, the duration of the traffic lights corresponding to the traffic intersections is adjusted to optimize traffic flow and improve the efficiency of the intersections. Accurate detection of traffic targets on the road is an important basis for obtaining the movement trajectory of vehicles or pedestrians. However, in the face of high density, traditional vehicle detection methods may have difficulty in effectively identifying the position and characteristics of electric vehicles or pedestrians due to occlusion, which in turn affects the acquisition of accurate movement trajectories.
[0042] Based on this, this specification proposes a new detection method, which uses the head of an electric vehicle driver or pedestrian in the image as the key search mark, detects electric vehicle features or pedestrian features in the vicinity of the head, and by focusing on the head area, it can overcome the challenges brought by vehicle occlusion and achieve more accurate recognition, thereby providing more reliable support for traffic light adjustment.
[0043] Figure 1 The process of the urban intelligent traffic control method provided by the embodiment of the present application is shown. Figure 1 The urban intelligent traffic control method is described in detail, and specifically comprises the following steps:
[0044] S1. Obtaining a plurality of road condition images taken at a traffic intersection within a preset time period.
[0045] First, determine the appropriate location to install the surveillance camera at the traffic intersection that needs to be monitored. The camera should be installed in a location that can fully cover the traffic conditions at the traffic intersection and ensure clear images. According to the monitoring needs, set the camera parameters, such as shooting angle, resolution, frame rate, etc., to ensure that the camera can stably capture road images within the preset time period. Make a monitoring plan and determine the preset time period when the road images need to be obtained. This may be during peak traffic hours, as well as other specific time periods. According to the monitoring plan, set the recording or shooting mode on the surveillance camera, which can be a continuous recording mode, or set the timer shooting function to capture images at a preset time period.
[0046] S2. Detect the type and location of traffic targets in several road condition images.
[0047] Select the YOLOv5s network to obtain the type and location of the vehicle in the road image. YOLO (You Only Look Once) is a real-time target detection algorithm. YOLOv5s is the fifth version of the YOLO algorithm. Its network structure is as follows: Figure 2 As shown in the figure, it includes a backbone network Backbone, a fusion network Neck and a prediction classifier Head. The backbone network Backbone extracts hierarchical features of the image and outputs a series of feature maps. These feature maps represent the features of different areas in the image, and as the depth of the network increases, the size of the feature map gradually decreases, but the number of channels increases. This design allows the network to capture detail information (such as edges and textures) in the early layers and capture more abstract concepts (such as shapes and object parts) in the later layers. The fusion network Neck is located between the backbone network Backbone and the prediction classifier Head. Its main function is to fuse and dimensionally adapt the features from the backbone network to provide better feature representation to the prediction classifier Head for target detection.
[0048] S2.1. Build an improved YOLOv5s network.
[0049] The improved YOLOv5s network is constructed by adding a geometric attention mechanism module and a receptive field module connected in sequence to the connection part of the backbone network Backbone and the fusion network Neck of the original YOLOv5s network. The schematic diagram of its network structure is shown in the figure. Figure 3 As shown in the figure. Since the low-level pixel features obtained by the backbone network Backbone reflect the multi-level detail information in the road condition image, that is, more detailed and local information, such as geometric shapes, subtle textures, edges, colors, etc., this information helps to identify and locate subtle features in the image. Therefore, adding a geometric attention mechanism module at the output of the backbone network Backbone and the input of the fusion network Neck can enable the model to pay more attention to the relevant features of the head area, so that the low-level pixel features related to the head area are significantly enhanced, thereby improving the model's perception and understanding of the head area. The receptive field module scans the neighborhood of the head position through receptive fields of different sizes, which can more accurately obtain electric vehicle features or pedestrians around the head, avoiding the introduction of interference from other factors.
[0050] S2.1.1 Geometric Attention Mechanism G-Attention
[0051] The geometric attention mechanism module is an attention mechanism that introduces spatial information, which can help the model focus on a specific geometric area. In this case, adding the geometric attention mechanism module can make the model pay more attention to the relevant features near the head area of the electric vehicle driver and strengthen the learning and understanding of the relevant features of the head area. The design of the geometric attention mechanism module involves two key components: the geometric descriptor generator and the attention mechanism layer. These two components work together to enhance the model's attention to specific areas and adjust the distribution of attention, thereby improving the model's performance in object detection tasks.
[0052] The geometry descriptor generator is the first step of the geometry attention mechanism module, and its main task is to extract geometric features from low-level pixel feature maps. To achieve this goal, the geometry descriptor generator filters or convolves the low-level pixel feature map with convolution kernels that respond to circular features to detect or match specific circular geometric shapes, textures, or structures. These convolution kernels can be filters of different orientations, scales, or shapes to capture various geometric information in the image.
[0053] The attention mechanism layer is the second step of the geometric attention mechanism module. Its goal is to adjust the attention weights based on the detection results of the geometric descriptor generator on the low-level pixel feature map. This process can be implemented in various ways. Common methods include using an attention mechanism model (such as a self-attention mechanism or an attention mechanism network) to calculate the attention weights of each pixel. These weights reflect the degree of attention of the model to different positions, so that the model's visual attention can be adjusted to focus more on the information in a specific area. An optional attention mechanism layer is the CBAM attention mechanism layer. The CBAM attention mechanism layer automatically weights important features and suppresses unimportant features through the channel attention module and the spatial attention module, thereby improving the computational efficiency of the network and reducing the waste of computational resources. Its steps include: 1. Feature map calculation: Use the geometric convolution kernel to filter or convolve the low-level pixel feature map to obtain a response map of the geometric shape. This map is usually a two-dimensional tensor, in which each value indicates whether the corresponding position has the characteristics of the geometric shape. 2. Feature map normalization: The geometric shape response map is softmax normalized so that its value range is between 0 and 1 to indicate the strength of the corresponding position and the circular feature response. 3. Attention weight calculation: Use the normalized feature map as the input of the attention mechanism to calculate the attention weight of each position. This can be achieved by a simple element-by-element multiplication, that is, multiplying the normalized map with the low-level pixel feature map. In this way, the features at each position will be weighted according to the corresponding attention weight to obtain the weighted features.
[0054] The geometric attention mechanism module connects the geometric descriptor generator and the attention mechanism layer to each other, which enables the detection and attention adjustment of geometric information in the low-level pixel feature map. This design enables the model to more effectively capture and utilize the geometric structure and shape information in the image, thereby improving the performance of the model in tasks such as object detection.
[0055] S2.1.2 Receptive Field Module
[0056] The receptive field module can be an RFB module, an ASPP module, or a PPM module, and there is no limitation here. Taking the RFB receptive field module as an example, it obtains receptive fields of different sizes through multi-scale pooling and dilated convolution to capture features of different scales in the region of interest.
[0057] Multi-branch pooling achieves multi-scale feature capture. By using convolution kernels and pooling layers with different sizes, multi-branch pooling can simulate multiple receptive field sizes, allowing the network to focus on the overall structure and local details of the image at the same time. This multi-scale feature capture method helps improve the model's understanding and representation of image content. In multi-branch pooling, each branch uses convolution kernels and pooling layers of different sizes to process the input feature map, which can capture image features at different scales.
[0058] Dilated convolution, also known as hole convolution, is a technique that expands the receptive field by increasing the spacing between elements in the convolution kernel. This method does not increase the number of model parameters or the amount of computation, but can effectively increase the receptive range of each neuron. By adjusting the sampling range of the convolution kernel, dilated convolution can capture a wider range of contextual information, thereby improving the model's ability to understand each part of the image.
[0059] The final feature representation is generated by combining and adjusting the outputs of different branches. An expanded convolutional layer is used instead of a fixed pooling strategy. The fixed pooling strategy limits the diversity of the receptive field size and affects the fusion of features. This step ensures that the model can utilize information from different receptive fields and improve the recognition ability of the model.
[0060] S2.2. Train the improved YOLOv5s network to obtain a detection model for detecting vehicles in road condition images.
[0061] To collect road condition image data and avoid the data set having too few images and insufficient diversity, which would affect the model training effect and generalization performance, the embodiment of the present application uses affine transformation and noise addition to expand the road condition image data. The LabelImg image annotation software is used to mark the vehicle targets in all road condition images, and the image data and label files are converted and integrated according to the YOLO data set format. The integrated data set is divided into a training set and a test set in proportion.
[0062] The improved YOLOv5s network constructed by training is trained using the training set. The loss function used in the training process is the cross entropy loss function. The trained model is tested using the test set, and fine-tuning is performed based on the test results to finally obtain a detection model for detecting vehicles in road condition images.
[0063] S2.3. Use the detection model to detect the type and location of traffic targets in several road condition images.
[0064] The vehicle detection model is used to detect traffic targets in several road condition images. The low-level pixel feature map of the road condition image is obtained through the backbone network Backbone, and the head low-level pixel features in the low-level pixel feature map are enhanced through the geometric attention mechanism module. The receptive field module uses receptive fields of different sizes to scan the neighborhood of the head low-level pixel features to obtain an enhanced low-level pixel feature map. The traffic target information in the road condition image is classified and located through the detection head Head, and the type and location of the traffic targets in several road condition images are output.
[0065] The purpose of adding an attention mechanism module before the receptive field module is to introduce weighted attention to specific areas or features to enhance the function and effect of the receptive field module. Specifically, the attention mechanism can improve the performance and effect of the receptive field module in the following ways:
[0066] 1. Enhance the importance of specific features: The attention mechanism can learn and adjust the weight of each position or feature channel, so that more attention is paid to important features in a specific task or situation. This weighting can help the receptive field module focus on processing areas or features that are critical to the task, thereby improving the overall feature extraction quality and efficiency.
[0067] 2. Improve attention in space and scale: The attention mechanism can not only enhance the features of specific locations, but also adjust the degree of attention of the receptive field module to different scales and spatial ranges according to task requirements. This flexibility helps the model capture key features more accurately when processing multi-scale inputs.
[0068] 3. Reduce the impact of redundant information: Through the attention mechanism, the model can selectively ignore or reduce the impact of irrelevant areas or features, reducing the negative impact of redundant information on model performance.
[0069] 4. Enhance the generalization ability of the model: The introduction of the attention mechanism helps to improve the generalization ability of the model, making it more stable and reliable in different scenarios and data sets.
[0070] S3. Tracking the vehicle based on the type and position of the vehicle in the plurality of road condition images to obtain the moving trajectory and moving speed of the vehicle within a preset time period.
[0071] Use multi-target tracking algorithms (such as SORT, DeepSORT, etc.) to track the same vehicle / pedestrian in consecutive frames. For each tracked vehicle, calculate its motion trajectory based on its position changes in consecutive frames; estimate the vehicle's movement speed by analyzing the vehicle's position changes and time intervals on the trajectory.
[0072] Specifically, for the vehicle detected in the current frame, it is necessary to match it with the tracked vehicle in the previous frame; this involves calculating the similarity between the currently detected vehicle and the vehicle in the previous frame (such as appearance features, motion status, etc.). Data association usually uses the Hungarian algorithm or a similar optimization method to solve the assignment problem to ensure that each detected vehicle can be correctly associated with a previous vehicle or marked as a new vehicle. According to the results of data association, the tracking status of the vehicle is updated, which includes maintaining the ID, trajectory, speed and other information of each tracked vehicle. For vehicles that have not been matched for a long time, it is necessary to determine whether they have left the field of view and remove them from the tracking list in a timely manner.
[0073] S4. Obtain an estimated time for the vehicle to pass through a traffic intersection based on the moving trajectory and the moving speed, and adjust the duration of the traffic light corresponding to the traffic intersection according to the estimated time.
[0074] The estimated time to pass the traffic intersection can be calculated based on the total road length and the moving speed. The moving trajectory and moving speed of the vehicle within a preset time period can be input into the trained LSTM network to obtain the estimated time to pass the traffic intersection. The embodiments of the present application are not limited here.
[0075] After obtaining the estimated time to pass the traffic intersection, optimization algorithms such as linear programming, integer programming, and dynamic programming are used to obtain the signal light combination time that minimizes the time it takes for vehicles to pass the intersection. The optimization goal is usually to maximize the efficiency of vehicles passing through the intersection and reduce vehicle waiting time; the signal light duration is adjusted based on the signal light combination time.
[0076] When applying the urban intelligent traffic control method provided in this manual, it is not necessary to Figure 1 The steps are executed in the order shown. The specific execution order of the steps can be determined according to needs, and this manual does not limit this.
[0077] The above is a city intelligent traffic control method provided by one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding city intelligent traffic control system, including:
[0078] Data collection equipment: A camera is set up next to the traffic light at the intersection. This camera is used to collect images of different lanes in real time. This can cover the main lanes in the east-west and north-south directions at the intersection and lanes of other connecting roads. Alternatively, traffic monitoring equipment such as traffic cameras and sensors can be used to monitor vehicle flow in the vicinity of the traffic light to be adjusted.
[0079] A central processing unit, the central processing unit comprising:
[0080] A data acquisition module, used to obtain a number of road condition images taken at a traffic intersection within a preset time period;
[0081] The traffic target detection module is used to construct an improved YOLOv5s network including a backbone network Backbone, a fusion network Neck and a prediction classifier Head; the improved YOLOv5s network is constructed by adding a geometric attention mechanism module and a receptive field module connected in sequence to the connection part of the backbone network Backbone and the fusion network Neck of the original YOLOv5s network; the improved YOLOv5s network is trained to obtain a detection model for detecting vehicles in road condition images.
[0082] The traffic vehicle detection model is used to detect vehicles in several road condition images: the low-level pixel feature map containing geometric features in the road condition image is obtained through the backbone network Backbone; the geometric circular features in the low-level pixel feature map are weightedly paid attention to through the geometric attention mechanism module to obtain the head enhanced feature map; the neighborhood of the weighted attention geometric circular features is perceived at different scales through the receptive field module to obtain the enhanced low-level pixel feature map; the enhanced low-level pixel feature map is extracted through the fusion network Neck and the detection head Head, and the type and location of traffic targets in several road condition images are output.
[0083] The traffic light control module is used to track vehicles and pedestrians based on the types and locations of traffic targets in several road condition images to obtain the movement trajectory and movement speed of vehicles and pedestrians within a preset time period; based on the movement trajectory and movement speed, the estimated time for the vehicle to pass the traffic intersection is obtained, and the duration of the traffic light corresponding to the traffic intersection is adjusted according to the estimated time.
[0084] For the specific limitations of the urban intelligent traffic control system, please refer to the limitations of the urban intelligent traffic control method above, which will not be repeated here.
[0085] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0086] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A method for urban intelligent traffic control, characterized in that: include: Obtaining a number of road condition images taken at a traffic intersection within a preset time period; Constructing an improved YOLOv5s network including a backbone network Backbone, a fusion network Neck and a prediction classifier Head; the improved YOLOv5s network is constructed by adding a geometric attention mechanism module and a receptive field module connected in sequence to the connection part of the backbone network Backbone and the fusion network Neck of the original YOLOv5s network; training the improved YOLOv5s network to obtain a detection model for detecting traffic targets in road condition images; Use the traffic vehicle detection model to detect vehicles in several road condition images: obtain low-level pixel feature maps containing geometric features in the road condition images through the backbone network Backbone; use the geometric attention mechanism module to perform weighted attention on the geometric circular features in the low-level pixel feature map to obtain the head enhanced feature map; use the receptive field module to perceive the neighborhood of the weighted attention geometric circular features at different scales to obtain the enhanced low-level pixel feature map; use the fusion network Neck and the detection head Head to extract features from the enhanced low-level pixel feature map, and output the type and location of traffic targets in several road condition images; Based on the types and locations of traffic targets in several road condition images, vehicles and pedestrians are tracked to obtain the movement trajectories and speeds of vehicles and pedestrians within a preset time period; based on the movement trajectories and speeds, the estimated time for vehicles to pass through traffic intersections is obtained, and the duration of traffic lights corresponding to the traffic intersections is adjusted according to the estimated time.
2. The urban intelligent traffic control method according to claim 1, characterized in that: The geometric attention mechanism module specifically includes: A geometric descriptor generator, the geometric descriptor generator is used to filter or convolve the low-level pixel feature map using a convolution kernel that responds to the circular feature to obtain a response map of the circular feature of the low-level pixel feature map; the response map is a two-dimensional tensor, each value in the two-dimensional tensor ranges from 0 to 1, to indicate the strength of the response of the corresponding position to the circular feature; An attention mechanism layer connected to the output of the geometric descriptor generator is used to multiply the two-dimensional tensor with the low-level pixel feature map to increase the weight of features in the low-level pixel feature map that are more responsive to circular features.
3. The urban intelligent traffic control method according to claim 1, characterized in that: The receptive field module is at least one of an ASPP module, an RFB module, and a PPM module.
4. The urban intelligent traffic control method according to claim 1, characterized in that: The adjusting of the duration of the signal light corresponding to the traffic intersection according to the estimated time specifically includes: Calculate the estimated time each vehicle will take to pass the intersection based on vehicle tracking and prediction data; Use optimization algorithms to obtain the signal light combination time that minimizes the time it takes for all vehicles to pass through the intersection; The signal light duration is adjusted based on the signal light combination time.
5. An urban intelligent traffic control system, characterized in that: include: A data acquisition module, used to obtain a number of road condition images taken at a traffic intersection within a preset time period; A traffic target detection module is used to construct an improved YOLOv5s network including a backbone network Backbone, a fusion network Neck and a prediction classifier Head; the improved YOLOv5s network is constructed by adding a geometric attention mechanism module and a receptive field module connected in sequence to the connection part of the backbone network Backbone and the fusion network Neck of the original YOLOv5s network; the improved YOLOv5s network is trained to obtain a detection model for detecting vehicles in road condition images; Use the traffic vehicle detection model to detect vehicles in several road condition images: obtain low-level pixel feature maps containing geometric features in the road condition images through the backbone network Backbone; use the geometric attention mechanism module to perform weighted attention on the geometric circular features in the low-level pixel feature map to obtain the head enhanced feature map; use the receptive field module to perceive the neighborhood of the weighted attention geometric circular features at different scales to obtain the enhanced low-level pixel feature map; use the fusion network Neck and the detection head Head to extract features from the enhanced low-level pixel feature map, and output the type and location of traffic targets in several road condition images; The traffic light control module is used to track vehicles and pedestrians based on the types and locations of traffic targets in several road condition images to obtain the movement trajectory and movement speed of vehicles and pedestrians within a preset time period; based on the movement trajectory and movement speed, the estimated time for the vehicle to pass the traffic intersection is obtained, and the duration of the traffic light corresponding to the traffic intersection is adjusted according to the estimated time.
6. The urban intelligent traffic control system according to claim 5, characterized in that: The vehicle detection module is used to construct a geometric attention mechanism module, and the geometric attention mechanism module includes: A geometric descriptor generator, the geometric descriptor generator is used to filter or convolve the low-level pixel feature map using a convolution kernel that responds to the circular feature to obtain a response map of the circular feature of the low-level pixel feature map; the response map is a two-dimensional tensor, each value in the two-dimensional tensor ranges from 0 to 1, to indicate the strength of the response of the corresponding position to the circular feature; An attention mechanism layer connected to the output of the geometric descriptor generator is used to multiply the two-dimensional tensor with the low-level pixel feature map to increase the weight of features in the low-level pixel feature map that are more responsive to circular features.
7. The urban intelligent traffic control system according to claim 5, characterized in that: The vehicle detection module is used to construct a receptive field module, and the receptive field module is at least one of an ASPP module, an RFB module, and a PPM module.
8. The urban intelligent traffic control system according to claim 5, characterized in that: The signal light control module is specifically used for: Calculate the estimated time each vehicle will take to pass the intersection based on vehicle tracking and prediction data; Use optimization algorithms to obtain the signal light combination time that minimizes the time it takes for all vehicles to pass through the intersection; The signal light duration is adjusted based on the signal light combination time.
Citation Information
Patent Citations
A moving target detection and tracking method for urban traffic
CN109697420A
Urban intelligent traffic computer control system and method
CN112785840A
Traffic monitoring system and method based on intelligent traffic Internet of Things
CN113674527A
Urban main road traffic flow statistical method based on deep learning
CN114387310A
Intelligent traffic control system based on YOLO visual perception and control method thereof
CN115909723A
