Traffic signal lamp adaptive timing method based on improved Faster-RCNN

By improving the Faster-RCNN model, combining the direction perception module and the self-channel space attention mechanism, the problem of low timing efficiency of traditional signal lights is solved, efficient detection and accurate analysis of traffic information at intersections is achieved, and traffic efficiency is significantly improved. Support the development of smart cities.

CN119107824APending Publication Date: 2024-12-10HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411157772.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

Traditional fixed traffic lights cannot effectively improve the traffic efficiency at intersections. The existing target detection algorithms are not effective when dealing with signal lights timing problems, especially the accuracy and real-time detection of small targets need to be improved.

Method used

Based on the improved Faster-RCNN model, model pruning and knowledge distillation techniques are adopted by adding direction perception modules and self-channel spatial attention mechanisms to the feature extraction network, combining unique convolutional structures and improved region of interest alignment. Build a traffic information detection model that can efficiently detect the condition of road vehicles, and is used to adaptively adjust the timing of traffic lights.

Benefits of technology

It improves the accuracy and real-timeness of small target detection, provides reliable traffic information for signal light matching, significantly improves the traffic efficiency of intersections, alleviates urban traffic pressure, and supports the development of smart cities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119107824A_ABST
    Figure CN119107824A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic signal lamp adaptive timing method based on an improved Faster-RCNN. The method comprises the following steps: carrying out manual labeling and data enhancement on collected vehicle information; a traffic information detection model based on the improved Faster-RCNN is constructed, a direction sensing module SEMA is added behind a first convolutional layer, and the learning ability for important features is enhanced; a unique convolution structure is adopted, and an attention mechanism SCB is added; the result of each layer of the FPN is transmitted into H-RPN, and a repeated bounding box is removed through EIOU-NMS; an improved region-of-interest alignment mode refROIAlign is adopted to improve the accuracy of region alignment; performing parameter compression on the Faster-RCNN model by adopting a model pruning method; an independent virtual coil is arranged for each lane, so that vehicles on different lanes can be detected. According to the method, vehicles in the intersection and small target vehicles far away from the intersection can be detected more accurately, the detection speed is high, the detection is more accurate, real-time traffic information can be provided for traffic signal lamp timing efficiently, and the traffic efficiency of the intersection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of computer vision target detection, and in particular relates to a traffic light adaptive timing method based on improved Faster-RCNN. Background Art

[0002] With the development of economy and technology, the manufacturing cost of vehicles has decreased, the purchasing power of ordinary people has increased, and cars have become more and more popular. While this brings us convenience, it also brings huge pressure to the urban traffic environment. Traffic lights are one of the important tools for urban traffic management, but the traditional fixed timing cannot effectively improve the traffic efficiency of intersections. Therefore, in the current context, the formulation of a reasonable traffic light timing plan is particularly important.

[0003] In recent years, deep learning has developed rapidly. Although target detection algorithms based on deep learning have been well applied in many fields, these existing target detection algorithms cannot handle the problem of traffic light timing well. For example, the common YOLO series and SSD single-stage target detection methods have poor detection effects on small targets at a distance, affecting the accuracy of the final results. The real-time performance of two-stage detection methods such as RCNN cannot be guaranteed and the accuracy needs to be improved, but its effect on small target detection is better than that of single-stage target detection.

[0004] The present invention also realizes the detection of traffic information by improving the neural network model of deep learning. It can efficiently detect the status of vehicles on the road, such as vehicle density and vehicle queue length, detect and calculate the total vehicle capacity of the road, and accurately detect small target vehicle information at a slightly longer distance. By integrating this information and calculating the weight, a reasonable solution for traffic light timing can be provided. Compared with traditional fixed timing, this method can improve the traffic efficiency of intersections, alleviate urban traffic pressure, and is of great significance to the creation of smart cities. Summary of the invention

[0005] Purpose of the invention: In order to solve the problem of low traffic efficiency at urban intersections, the present invention proposes a traffic light adaptive timing method based on improved Faster-RCNN, which provides reliable and accurate road traffic information for traffic lights, and uses the obtained traffic information to adaptively time traffic lights.

[0006] Technical solution: The method for adaptively timing a traffic light based on an improved Faster-RCNN described in the present invention comprises the following steps:

[0007] (1) Collect and save vehicle information at intersections and classify vehicles;

[0008] (2) Manually label and enhance the collected vehicle information, and divide it into training set, validation set, and test set according to a certain ratio;

[0009] (3) Construct a traffic information detection model based on the improved Faster-RCNN; the feature extraction network RMA-resnet in the improved Faster-RCNN adds a direction perception module SEMA after the first convolution layer to enhance the learning ability of important features; and adopts a unique convolution structure and adds an attention mechanism SCB; the results of each layer of FPN in Faster-RCNN are respectively passed to H-RPN and repeated bounding boxes are removed through EIOU-NMS; the improved region of interest alignment method refROIAlign is used to improve the accuracy of region alignment; the model pruning method is used to compress the parameters of the Faster-RCNN model; a separate virtual coil is set for each lane to detect vehicles in different lanes;

[0010] (4) Use the training set to train the traffic information detection model based on the improved Faster-RCNN and verify it through the validation set to obtain the optimal traffic information detection model;

[0011] (5) Input the test set into the traffic information detection model with the optimal weight, output the result of traffic information detection; and perform adaptive timing on traffic lights.

[0012] Furthermore, the vehicle information in step (1) includes vehicle capacity and vehicle body length; the vehicle categories include small cars, medium-sized cars and buses, medium-sized trucks, large buses, and large trucks.

[0013] Furthermore, the implementation process of step (2) is as follows:

[0014] The collected image data is cleaned, including removing duplicate images, removing damaged images, removing blurred images, and adjusting image size and resolution; data enhancement is performed after image cleaning, by rotating, cropping, adding noise to the logarithmic image, and adjusting its brightness, contrast, and color to achieve the effect of data enhancement; the labelimg tool is used to annotate the processed images, create a vehicle information dataset, and convert it into VOC format.

[0015] Furthermore, the implementation process of adding the direction perception module SEMA after the first convolutional layer in step (3) is as follows:

[0016] After the first convolution layer, two adaptive maximum pooling kernels are used to aggregate features based on the horizontal and vertical directions of the input feature map, generating two independent direction-aware attention feature maps.

[0017]

[0018] It means keeping the vertical dimension unchanged and taking weighted average of the Cth channel in the horizontal dimension to obtain the attention tensor; It means keeping the horizontal dimension unchanged and taking weighted average of the Cth channel in the vertical dimension to obtain the attention tensor;

[0019] The activation function RELU is used to increase nonlinearity of the obtained direction-aware attention feature map to prevent overfitting; the two intermediate attention weight tensors are expanded to the same dimension as the input feature map X through the expand_as(X) operation; the self-attention mechanism SelfAttention is introduced into the model; the two feature maps that pass the activation function, the original feature map and the result of the self-attention mechanism are multiplied in sequence to enhance the representation ability of the input feature map:

[0020] Y c (i,j)=X c (i,j)×F ch (i,j)×F cw (i,j)×A c (i,j)

[0021] Among them, X c (i,j) is the input feature map tensor, F ch (i,j),F cw (i, j) are the vertical and horizontal dimensions that remain unchanged and expanded as input features Figure 1 A tensor with directional information of the same dimension, A c (i,j) is the result after self-attention.

[0022] Furthermore, the unique convolution structure in step (3) is:

[0023] The feature map is divided into three groups according to the channel, and group convolution is performed on them; the result is convolved point by point to update its channel number and channel shuffling is used to exchange information between different groups to achieve the effect of enhancing the training between features; the original feature map is subjected to hollow convolution to increase its receptive field and up-sampled to extract more details; the results of the two operations are added element by element and the final feature map is obtained through the attention mechanism SCB.

[0024] Furthermore, the attention mechanism SCB structure in step (3) is:

[0025] The feature map is upsampled, and the results are subjected to maximum pooling and average pooling respectively to generate context descriptions of different spaces; two 1×1×C feature maps are passed through a fully connected layer and the result is multiplied with the weight of the upsampled feature map; the two weighted feature maps are added element by element and a feature map is obtained through an activation function, and the feature map is fused with the original feature map to generate a channel feature map; the channel feature map is used as input and passed through two convolutional layers for spatial information fusion; spatial attention features are generated through global average pooling and activation functions; the input feature map is projected with three 1×1 convolutions, and the input features are projected into Q, K, and V to realize the self-attention mechanism; the result is subjected to a shift operation after being fully connected to improve the robustness and generalization ability of the model and is added element by element with the result of the self-attention channel; the results of the two branches are multiplied with the original feature map to realize the attention mechanism SCB.

[0026] Furthermore, the process of passing the results of each layer of FPN in Faster-RCNN to H-RPN and removing duplicate bounding boxes through EIOU-NMS is as follows:

[0027] The initial offset obtained through the feature map is aligned to obtain the regression feature map and the classification feature map; the secondary offset is obtained through the regression feature map and combined with the initial offset to obtain the fine offset, and the fine offset is described based on the point representation to obtain the fine region proposal; the classification score is obtained through the classification feature map, and the regression feature map is passed through the lightweight IOU-mask branch to obtain the IOU mask, and the two are averaged to obtain the IOU-class-score to improve the influence of the category on the region candidate box; the fine region proposal is put into EIOU-NMS together with the IOU and IOU-class-score to obtain two results and then put them into EIOU-NMS again to remove duplicate bounding boxes to obtain the region proposal of H-RPN.

[0028] Furthermore, the improved region of interest alignment method refROIAlign increases the sampling point density by adding interpolation points on the boundary and adjusting the step size, thereby improving the accuracy of region alignment; and after the alignment is performed, the k-means clustering algorithm is used on the initial frame to obtain the final result.

[0029] Furthermore, the implementation process of using the model pruning method to compress the parameters of the Faster-RCNN model in step (3) is as follows:

[0030] According to the characteristics of network weight distribution, neurons with smaller weights are adaptively pruned; knowledge distillation technology is used to perform feature extraction network distillation, region proposal distillation, and classification regression head distillation.

[0031] Furthermore, the loss function of the traffic information detection model based on the improved Faster-RCNN in step (4) is:

[0032]

[0033] Among them, N cls is the classification loss, N reg is the regression loss, λ is a weight parameter used to balance the loss in the loss function, p i is the probability of predicting the target, is the Ground-Truth label, a is the balancing factor used to adjust the weights of positive and negative samples, γ is the adjustment factor used to reduce the contribution of easy-to-classify samples to the loss, and t i is the predicted offset, is the actual offset, x is the difference between the predicted offset and the actual offset, and σ is the smoothing parameter.

[0034] Beneficial effects: Compared with the prior art, the improved Faster-RCNN model proposed in the present invention aggregates the features of the input feature map in the horizontal and vertical directions to generate two independent direction-aware attention feature maps, and expands them into the input feature map. Figure 1 The method improves the learning ability of important features by using a unique convolutional structure and an attention mechanism SCB to extract features and improve the accuracy of small target detection. H-RPN is used for region proposal, and a more accurate offset is obtained by combining the initial offset with the secondary offset of the regression feature map and obtaining a refined region proposal. The refined region proposal is respectively combined with IOU and IOU-class-score through EIOU-NMS to obtain a more accurate region proposal, which increases the influence of the classification score on the candidate frame and solves the problem that the candidate frame cannot be used when the classification score is high but the IOU is very low. After obtaining the region proposal, refROIAlign is used instead of the original ROIPooling to improve the accuracy of small target detection. The present invention realizes the detection of road traffic information, can accurately and efficiently obtain traffic information at intersections, provide reliable data for traffic light timing, and provides a traffic light timing scheme, which can greatly improve the traffic efficiency of intersections and is conducive to the development of smart cities. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 Schematic diagram of the traffic information detection model based on the improved Faster-RCNN;

[0036] Figure 2 Schematic diagram of the unique convolutional structure constructed for the present invention;

[0037] Figure 3The structure diagram of the SCB attention mechanism constructed for the present invention;

[0038] Figure 4 Schematic diagram of the structure of H-RPN. DETAILED DESCRIPTION

[0039] The present invention will be further described in detail below in conjunction with the accompanying drawings.

[0040] The present invention provides a traffic light adaptive timing method based on improved Faster-RCNN, which specifically includes the following steps:

[0041] Step 1: Collect and save vehicle information images at the intersection, and divide vehicles into five categories according to traffic capacity and vehicle length: small cars, medium-sized cars and buses, medium-sized trucks, large buses, and large trucks.

[0042] Step 2: Manually annotate the collected vehicle data and convert it into VOC format, and divide it into training set, validation set and test set according to a certain ratio.

[0043] The collected images are cleaned to remove damaged, blurred and similar images, which improves the quality of image data, ensures the accuracy and reliability of the data, and provides a reliable basis for subsequent data processing and analysis.

[0044] The collected images are enhanced by rotating, cropping, adding noise, and adjusting the brightness, contrast, and color of the images. This can increase the number and diversity of training samples, enhance the learning ability and robustness of the model, and improve the performance and generalization ability of the model.

[0045] The collected images are divided into training set, validation set and test set according to 8:1:1; the training set is used for model parameter learning, the validation set is used to adjust the model's hyperparameters, and the test set is used to finally evaluate the model's performance. By dividing the data set, it is possible to effectively avoid using the same data multiple times during the model selection and parameter adjustment process, and to more accurately evaluate the model's performance.

[0046] Step 3: If Figure 1As shown in the figure, a traffic information detection model based on the improved faster region convolutional neural network (Faster Region-based Convolutional Neural Network, Faster-RCNN) is constructed. The feature extraction network of the improved Faster-RCNN is a rapid mobile attention residual network (Rapid Movable attentionresnet, RMA-resnet), which aggregates the horizontal and vertical features of the input feature map after the first convolution layer to generate two independent direction-aware attention feature maps, and expands them to the input feature map. Figure 1 The proposed method adopts a unique convolutional structure and adds a self-channel space attention mechanism convolutional block (Self-Channel-Space Attention Convolutional Block, SCB); the region proposals in the original Region Proposal Network (RPN) are respectively obtained according to the intersection over union (IOU) and the intersection over union class score (IOU-class-score) through enhanced intersection over union non-maximum suppression (Enhanced Intersection over Union Non-Maximum Suppression, EIOU-NMS) to obtain a high-precision region proposal network (High Accuracy Region Proposal Network, H-RPN); the results of each layer of the Feature Pyramid Networks (FPN) are respectively passed to the H-RPN and the duplicate bounding boxes are removed through EIOU-NMS; the original region of interest pooling (ROIPooling) in Faster-RCNN is replaced by refined region of interest alignment (Refine Region of InterestAlign, refROIAlign); set a separate virtual coil for each lane to detect vehicles in different lanes.

[0047] (3.1) Two adaptive maximum pooling kernels are used after the first convolution layer of the original residual network to perform feature aggregation based on the horizontal and vertical directions of the input feature map, respectively, to generate two independent direction-aware attention feature maps; in order to better utilize the feature tensor with direction perception and detailed position information, it is necessary to use the activation function RELU to increase the nonlinearity of the obtained aggregated feature map to prevent overfitting; the two intermediate attention weight tensors are expanded to the same dimension as the input feature map X through the expand_as(X) operation; the self-attention mechanism SelfAttention is introduced into the model; the two feature maps that pass the activation function, the original feature map and the result of the self-attention mechanism are multiplied in turn to enhance the representation ability of the input feature map.

[0048] Feature aggregation in the horizontal and vertical directions is achieved by the following formula:

[0049]

[0050] It means keeping the vertical dimension unchanged and taking the weighted average of the Cth channel in the horizontal dimension to obtain the attention tensor.

[0051]

[0052] It means keeping the horizontal dimension unchanged and taking the weighted average of the Cth channel in the vertical dimension to obtain the attention tensor.

[0053] The overall method is implemented by the following formula:

[0054] Yc(i,j)=Xc(i,j)×Fch(i,j)×Fcw(i,j)×Ac(i,j)

[0055] Among them, Xc(i,j) is the input feature map tensor, Fch(i,j) and Fcw(i,j) are the vertical and horizontal dimensions that remain unchanged and expanded to the input feature map. Figure 1 The dimension is a tensor with directional information, and Ac(i,j) is the result after self-attention.

[0056] (3.2) Figure 2 As shown in the figure, the feature map is divided into three groups according to the channel, and group convolution is performed on them; the result is convolved point by point to update its channel number and channel shuffling is used to exchange information between different groups to achieve the effect of enhancing the training between features; the original feature map is convolved with a hole to increase its receptive field and upsampling is used to extract more details; the results of the two operations are added element by element and the final feature map is obtained through the SCB attention mechanism; the result is passed to FPN to realize multi-scale feature fusion, and the result of each layer of FPN is passed to H-RPN.

[0057] Attention mechanism SCB Figure 3 As shown, the specific implementation steps are as follows:

[0058] The feature map is upsampled, and the results are subjected to maximum pooling and average pooling respectively to generate context descriptions of different spaces; two 1×1×C feature maps are passed through a fully connected layer and the result is multiplied with the weight of the upsampled feature map; the two weighted feature maps are added element by element and a feature map is obtained through an activation function, and the feature map is fused with the original feature map to generate a channel feature map; the channel feature map is used as input and passed through two convolutional layers for spatial information fusion; spatial attention features are generated through global average pooling and activation functions; the input feature map is projected with three 1×1 convolutions, and the input features are projected into Q, K, and V to realize the self-attention mechanism; the result is subjected to a shift operation after being fully connected to improve the robustness and generalization ability of the model and added element by element with the result of the self-attention channel; the results of the two branches are multiplied with the original feature map to realize the SCB attention mechanism.

[0059] (3.3) Figure 4 As shown in the figure, the initial offset is obtained through the feature map and feature alignment is performed to obtain the regression feature map and the classification feature map; the secondary offset is obtained through the regression feature map and combined with the initial offset to obtain the fine offset, and the fine offset is described based on the point representation to obtain the fine region proposal; the classification score is obtained through the classification feature map, and the regression feature map is passed through a lightweight IOU-mask branch to obtain the IOU mask, and the two are averaged to obtain the IOU-class-score, which improves the influence of the category on the region candidate box; the fine region proposal is put into EIOU-NMS together with the IOU and IOU-class-score to obtain two results and then put them into EIOU-NMS again to remove duplicate bounding boxes to obtain the region proposal of H-RPN.

[0060] The lightweight IOU-mask is able to correct the misclassification scores of high-quality region proposals by directly refining the suboptimal distribution of the classification score map.

[0061] (3.4) The improved region of interest alignment method refROIAlign is used to improve the accuracy of small target detection. The sampling point density is increased by adding interpolation points on the boundary and adjusting the step size to improve the accuracy of region alignment. Each ROI is then mapped to the corresponding position on the feature map, and the region is pooled to extract a fixed-size feature vector. The k-means clustering algorithm is then used to cluster the initial frame. Finally, the target is classified and precisely located to obtain accurate results.

[0062] (3.5) The Faster-RCNN model is pruned using the model pruning method to compress the parameters. According to the characteristics of the network weight distribution, neurons with smaller weights are adaptively pruned. The knowledge distillation technology is used to perform feature extraction network distillation, region proposal distillation, and classification regression head distillation, which reduces the computational complexity while maintaining high detection performance. Finally, virtual coils are drawn for each lane in each phase to detect the length of vehicle queues and traffic capacity in different phases.

[0063] Step 4: Use the training set to train the traffic information detection model based on the improved Faster-RCNN, and verify it through the validation set to obtain the optimal traffic information detection model.

[0064] The loss function of the traffic information detection model is the sum of the classification loss and the regression loss:

[0065]

[0066] Among them, N cls is the classification loss, N reg is the regression loss, λ is a weight parameter used to balance the loss in the loss function, p i is the probability of predicting the target, is the Ground-Truth label, a is the balancing factor used to adjust the weights of positive and negative samples, γ is the adjustment factor used to reduce the contribution of easy-to-classify samples to the loss, and t i is the predicted offset, is the actual offset, x is the difference between the predicted offset and the actual offset, and σ is the smoothing parameter.

[0067] Step 5: Input the test set into the optimal traffic information detection model, output the result of traffic information detection, and perform adaptive timing on traffic lights based on the obtained traffic information.

[0068] The optimal traffic information detection model detects the vehicle's capacity, vehicle length, and number of vehicles. The model then obtains the attributes of each vehicle in different lanes based on the type of vehicle detected at the intersection, and ultimately obtains the total capacity, queue length, and traffic flow.

[0069] The queue length of vehicles in the lane of each phase is detected according to the optimal traffic information detection model. The present invention studies a four-phase intersection, namely north-south straight, north-south left turn, east-west straight and east-west left turn. The minimum green light time is set for each phase, and the queue length of vehicles at each intersection is detected before entering the next phase. The time that the green light time needs to be extended is calculated and recorded based on the ratio of the queue length of the newly added vehicles. The final green light time of each phase is the sum of the minimum green light time and the four extension times.

[0070] The timing scheme of the traffic lights obtained according to the present invention was simulated and tested using SUMO simulation software. Through experimental tests, compared with the traditional fixed timing, the average vehicle delay time was reduced by 12.07%, and the average number of vehicle stops was reduced by 11.86%. The traffic information detection model proposed by the present invention has an mAP improvement of 0.96 percentage points compared to the traditional detection model, which further reflects the performance of the model proposed by the present invention. The traffic information detection method based on the model can more accurately and quickly detect the types of different vehicles, analyze the traffic information on the road, such as vehicle capacity, vehicle queue length, etc., and provide reliable data support for the timing optimization of traffic lights, thereby effectively alleviating urban traffic pressure and promoting the rapid development of smart cities.

[0071] The technical solution of the present invention has been described in conjunction with the specific experimental process shown in the accompanying drawings, but the protection scope of the present invention is not limited to these specific implementations. Under the premise of following the principles of the present invention, technicians in this field can make equivalent changes or substitutions to the relevant technical features, and these changes or substitutions will fall within the protection scope of the present invention. The above embodiments only represent the preferred technical solutions of the present invention. In the absence of mutual conflicts, the embodiments and features in this application can be combined arbitrarily. The protection scope of the present invention shall be based on the technical solutions recorded in the claims, including solutions for equivalent substitution of these technical features.

Claims

1. A traffic light adaptive timing method based on improved Faster-RCNN, characterized in that: The steps include: (1) Collect and save vehicle information at intersections and classify vehicles; (2) Manually label and enhance the collected vehicle information, and divide it into training set, validation set, and test set according to a certain ratio; (3) Construct a traffic information detection model based on the improved Faster-RCNN; the feature extraction network RMA-resnet in the improved Faster-RCNN adds a direction perception module SEMA after the first convolution layer to enhance the learning ability of important features; and adopts a unique convolution structure and adds an attention mechanism SCB; the results of each layer of FPN in Faster-RCNN are respectively passed to H-RPN and repeated bounding boxes are removed through EIOU-NMS; the improved region of interest alignment method refROIAlign is used to improve the accuracy of region alignment; the model pruning method is used to compress the parameters of the Faster-RCNN model; a separate virtual coil is set for each lane to detect vehicles in different lanes; (4) Use the training set to train the traffic information detection model based on the improved Faster-RCNN and verify it through the validation set to obtain the optimal traffic information detection model; (5) Input the test set into the traffic information detection model with the optimal weight and output the result of traffic information detection; perform adaptive timing on traffic lights.

2. The method for adaptive timing of traffic lights based on improved Faster-RCNN according to claim 1, characterized in that: The vehicle information in step (1) includes vehicle capacity and vehicle body length; the vehicle categories include small cars, medium-sized cars and buses, medium-sized trucks, large buses, and large trucks.

3. The method for adaptive timing of traffic lights based on improved Faster-RCNN according to claim 1, characterized in that: The implementation process of step (2) is as follows: The collected image data is cleaned, including removing duplicate images, removing damaged images, removing blurred images, and adjusting image size and resolution; after image cleaning, data enhancement is performed, by rotating, cropping, adding noise to the logarithmic image, and adjusting its brightness, contrast, and color to achieve the effect of data enhancement; Use the labelimg tool to annotate the processed images, create a vehicle information dataset, and convert it into VOC format.

4. The method for adaptive timing of traffic lights based on improved Faster-RCNN according to claim 1, characterized in that: The implementation process of adding the direction perception module SEMA after the first convolutional layer in step (3) is as follows: After the first convolution layer, two adaptive maximum pooling kernels are used to aggregate features based on the horizontal and vertical directions of the input feature map, generating two independent direction-aware attention feature maps. It means keeping the vertical dimension unchanged and taking weighted average of the Cth channel in the horizontal dimension to obtain the attention tensor; It means keeping the horizontal dimension unchanged and taking weighted average of the Cth channel in the vertical dimension to obtain the attention tensor; The activation function RELU is used to increase nonlinearity of the obtained direction-aware attention feature map to prevent overfitting; the two intermediate attention weight tensors are expanded to the same dimension as the input feature map X through the expand_as(X) operation; the self-attention mechanism SelfAttention is introduced into the model; the two feature maps that pass the activation function, the original feature map and the result of the self-attention mechanism are multiplied in sequence to enhance the representation ability of the input feature map: Y c (i,j)=X c (i,j)×F ch (i,j)×F cw (i,j)×A c (i,j) Among them, X c (i,j) is the input feature map tensor, F ch (i,j),F cw (i, j) are respectively the tensors with unchanged vertical and horizontal dimensions and expanded to have directional information of the same dimension as the input feature map. c (i,j) is the result after self-attention.

5. The method for adaptive timing of traffic lights based on improved Faster-RCNN according to claim 1, characterized in that: The unique convolution structure in step (3) is: The feature map is divided into three groups according to the channel, and group convolution is performed on them; the result is convolved point by point to update its channel number and channel shuffling is used to exchange information between different groups to achieve the effect of enhancing the training between features; the original feature map is subjected to hollow convolution to increase its receptive field and up-sampled to extract more details; the results of the two operations are added element by element and the final feature map is obtained through the attention mechanism SCB.

6. The method for adaptive timing of traffic lights based on improved Faster-RCNN according to claim 1, characterized in that: The attention mechanism SCB structure in step (3) is: The feature map is upsampled, and the results are subjected to maximum pooling and average pooling to generate context descriptions of different spaces; two 1×1×C feature maps are passed through a fully connected layer and the result is multiplied by the weight of the upsampled feature map; the two weighted feature maps are added element by element and the feature map is obtained through an activation function, and the feature map is fused with the original feature map to generate a channel feature map; the channel feature map is used as input and passed through two convolutional layers for spatial information fusion; spatial attention features are generated through global average pooling and activation functions; The input feature map is projected using three 1×1 convolutions, and the input features are projected into Q, K, and V to implement the self-attention mechanism; the result is fully connected and then subjected to a shift operation to improve the robustness and generalization ability of the model and added element-by-element with the result of the self-attention channel; the results of the two branches are multiplied with the original feature map to implement the attention mechanism SCB.

7. The method for adaptive timing of traffic lights based on improved Faster-RCNN according to claim 1, characterized in that: The process of passing the results of each layer of FPN in Faster-RCNN to H-RPN and removing duplicate bounding boxes through EIOU-NMS is as follows: The initial offset obtained through the feature map is aligned to obtain the regression feature map and the classification feature map; the secondary offset is obtained through the regression feature map and combined with the initial offset to obtain the fine offset, and the fine offset is described based on the point representation to obtain the fine region proposal; the classification score is obtained through the classification feature map, and the regression feature map is passed through the lightweight IOU-mask branch to obtain the IOU mask, and the two are averaged to obtain the IOU-class-score to improve the influence of the category on the region candidate box; the fine region proposal is put into EIOU-NMS together with the IOU and IOU-class-score to obtain two results and then put them into EIOU-NMS again to remove duplicate bounding boxes to obtain the region proposal of H-RPN.

8. The method for adaptive timing of traffic lights based on improved Faster-RCNN according to claim 1, characterized in that: The improved region of interest alignment method refROIAlign is to increase the sampling point density by adding interpolation points on the boundary and adjusting the step size to improve the accuracy of region alignment; After the alignment is performed, the k-means clustering algorithm is used on the initial frame to obtain the final result.

9. The method for adaptive timing of traffic lights based on improved Faster-RCNN according to claim 1, characterized in that: The implementation process of using the model pruning method to compress the parameters of the Faster-RCNN model in step (3) is as follows: According to the characteristics of network weight distribution, neurons with smaller weights are adaptively pruned; knowledge distillation technology is used to perform feature extraction network distillation, region proposal distillation, and classification regression head distillation.

10. The method for adaptive timing of traffic lights based on improved Faster-RCNN according to claim 1, characterized in that: The loss function of the traffic information detection model based on the improved Faster-RCNN in step (4) is: Among them, N cls is the classification loss, N reg is the regression loss, λ is a weight parameter used to balance the loss in the loss function, p i is the probability of predicting the target, is the Ground-Truth label, a is the balancing factor used to adjust the weights of positive and negative samples, γ is the adjustment factor used to reduce the contribution of easy-to-classify samples to the loss, and t i is the predicted offset, is the actual offset, x is the difference between the predicted offset and the actual offset, and σ is the smoothing parameter.