Traffic signal light countdown recognition system and construction method and application method thereof

By improving the YOLOv4 model, using ResNet50vd and Inception-CSP modules, combined with the multi-scale fusion module, the problem of low accuracy of traffic light detection in complex scenes has been solved, achieving higher recognition accuracy and speed, and improving the generalization of the model. sex and practicality.

CN113869239BActive Publication Date: 2024-09-24SICHUAN ZELANG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111160244.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2024-09-24
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

In complex scenarios, such as foggy or rainy days, the existing technology has low detection and recognition accuracy of traffic lights, posing great safety risks.

Method used

ResNet50vd is used as the feature extraction network to build the Inception-CSP module, using the matrix non-maximum suppression method and logistic regression, combined with the attention-based multi-scale fusion module, to improve the YOLOv4 model and improve the accuracy and speed of traffic light countdown recognition.

Benefits of technology

In complex environments, the recognition accuracy of traffic lights is significantly improved, the missed detection rate is reduced, and the generalization and practicality of the model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113869239B
    Figure CN113869239B
Patent Text Reader

Abstract

The present invention provides a traffic light countdown recognition system and a construction method and an application method thereof, which relate to the technical field of computer detection system design, wherein the construction method comprises the following steps: preparing a traffic light data set; a feature extraction network of a traffic light countdown recognition model; constructing an attention-based multi-scale fusion module; completing the construction of an end-to-end traffic light countdown recognition model, and preprocessing the training data set and labels, and training the end-to-end traffic light countdown recognition model. For newly collected pictures on the mobile terminal, they are input into the trained end-to-end traffic light countdown recognition model to obtain the recognition result of the traffic light countdown. The traffic light countdown recognition system provided by the present application has a higher model accuracy, a low missed detection rate, and a fast speed. It can have a better effect on the recognition of traffic lights in complex environments, and the model has higher generalization and practicality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer detection system design, and in particular to a traffic light countdown recognition system and a construction method and an application method thereof. Background Art

[0002] Traffic lights are important information in the process of vehicle assisted driving and autonomous driving. Affected by environmental factors, the current target detection model has low recognition accuracy and high missed detection rate for traffic lights, which poses a great safety hazard. Accurate and efficient traffic light detection and recognition algorithms are an important research direction for assisted driving and autonomous driving. With the continuous development of neural network technology, some scholars have used the NVIDIA Jetson Tegra X2 embedded platform to introduce a lightweight network MobileNet based on the improved feature extraction network of YOLOv3, which effectively improves the detection speed, but the detection effect of long-distance traffic lights needs to be improved.

[0003] In the prior art, although the neural network-based method has achieved a significant improvement in prediction speed, the detection and recognition accuracy of traffic lights in complex scenes, such as foggy and rainy days, is relatively low. Summary of the invention

[0004] The purpose of the present invention is to solve the technical problem that the prior art has low detection and recognition accuracy in complex scenarios.

[0005] In order to achieve the above object, the present invention adopts the following technical solutions:

[0006] A method for constructing a traffic light countdown recognition system comprises the following steps:

[0007] S1: Create a traffic light dataset: collect traffic light images, classify the images and create a dataset in VOC2007 format;

[0008] S2: Feature extraction network of the end-to-end traffic light countdown recognition model: ResNet50vd is selected as the backbone network for feature extraction, and the Inception-CSP module is constructed. The 3×3 standard convolution of the network stage 4 is replaced with a 3×3 deformable convolution DCN. The matrix non-maximum suppression method is then used to remove overlapping boxes, and logistic regression is used as the traffic light countdown classifier.

[0009] S3: Construct an attention-based multi-scale fusion module to achieve the fusion of multi-scale features;

[0010] S4: Complete the network construction and preprocess the training dataset and labels, and then use them as input to train the end-to-end traffic light countdown recognition model.

[0011] Preferably, the number of traffic light images collected in S1 is 8000, and during the classification process, the images are subjected to size normalization, random saturation adjustment, random contrast adjustment, random brightness adjustment and Mosaic data enhancement.

[0012] Preferably, in S3: the final output feature is obtained by adopting different weights w1 and w2 of Feature1 and Feature2, and CSPNet is added to PANet.

[0013] Preferably, the specific steps of S4 are:

[0014] S4.1: Calculate the loss function, which is obtained by weighting three loss functions, and the three loss functions are category loss Loss class , confidence loss Loss conf , coordinate deviation loss Loss coord , where Loss class Use binary cross entropy Loss, Loss conf Loss using binary cross entropy conf-obj and Loss conf_noobj , Loss coord Using CIOULoss, the weight ratio is 1:1:2, and the specific formula is:

[0015] Loss = 0.25 × Loss class +0.25×Loss conf +0.5×Loss coord ;

[0016] S4.2: Select the cosine learning rate and exponential moving average (EMA);

[0017] S4.3: Re-determine the prior box through the K-means algorithm.

[0018] Preferably, the relationship between the cosine learning rate in S4.2 and the number of training epochs of the model is as shown in the following formula:

[0019]

[0020] In the above formula, begin_rate is the initial learning rate, and epoch is the current round number;

[0021] The calculation formula of the exponential moving average EMA is:

[0022] W t =α×W t-1 +(1-α)×W(t≥1)

[0023] In the above formula, α is the attenuation coefficient, W t It is an exponential moving average with an initial value of 0.

[0024] Preferably, the distance function calculated in S4.3 is:

[0025] d(box,centroid)=1-IOU(box,centroid)

[0026] In the above formula, the rectangular box of the centroid cluster center, box represents the labeled rectangular box, and IOU represents the intersection-union ratio of box and centroid.

[0027] The present application also provides a traffic light countdown recognition system, which is constructed using the above-mentioned traffic light countdown recognition system construction method.

[0028] The present application also provides an application method of a traffic light countdown recognition system. Using the above-mentioned traffic light countdown recognition system, the traffic light countdown recognition system is deployed in a mobile terminal device to complete the recognition of the traffic light countdown in an actual scenario.

[0029] The method for constructing a traffic light countdown recognition system described above improves YOLOv4. Compared with the original YOLOv4, the end-to-end traffic light countdown recognition model of the present invention has higher accuracy, lower missed detection rate, and faster speed. It can have a better effect on traffic light recognition in complex environments, and the model has higher generalization and practicality. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 A flow chart of a traffic light countdown recognition method proposed by the present invention;

[0031] Figure 2 It is the ResNet50vd network structure in one embodiment of the present invention;

[0032] Figure 3 An improved Inception-CSP structure in one embodiment of the present invention;

[0033] Figure 4 It is an attention-based multi-scale fusion module in one embodiment of the present invention;

[0034] Figure 5 An improved CSPNet structure in one embodiment of the present invention;

[0035] Figure 6 This is an expanded diagram of an improved PANet in one embodiment of the present invention.

[0036] Figure 7 The following is the application flow chart of the method in this paper. DETAILED DESCRIPTION

[0037] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways than those described herein. Therefore, the present invention is not limited to the specific embodiments of the following disclosure.

[0038] Partial English interpretation:

[0039] LabelImg: A visual image calibration tool

[0040] Feature:

[0041] PANet: Path Aggregation Network

[0042] CSPNet: Cross Stage Partial Network

[0043] DCN: Deep Cross Network

[0044] Matrix NMS: Matrix Non-Maximum Suppression

[0045] AMF: Attention-based Multi-Scale Fusion

[0046] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below in conjunction with specific embodiments.

[0047] See also Figure 1 , a method for constructing a traffic light countdown recognition system, comprising the following steps:

[0048] S1: Create a traffic light dataset in complex scenarios:

[0049] Specifically, firstly, pictures of traffic lights in various environments, scenes and weather conditions are collected. In one embodiment, the pictures are from online picture libraries such as Google Gallery, 360 Gallery, and Baidu, and 8,000 countdown pictures are obtained from the above-mentioned picture libraries; then the pictures are preprocessed. In one embodiment, LabelImg is first used to mark the categories and positions of the traffic light countdown targets in the collected pictures, and the pictures are made into VOC2007 format, in which the data set has a total of 20 categories, specifically, including 10 categories of green light countdown 0-9 and 10 categories of red light countdown 0-9. While classifying, the data set is enhanced. In one embodiment, the pictures are resized normalized, randomly saturated, randomly contrasted, randomly brightened, and enhanced with Mosaic data, and finally a traffic light countdown data set is obtained.

[0050] In one embodiment, the size of the collected images is normalized to 416×416 because the sizes are different. The random saturation adjustment is to first set the threshold to 0.5, and then randomly extract a number x in the interval (0, 1). If x ≥ 0.5, the saturation is adjusted to x times the original value. If x < 0.5, a number y is randomly extracted in the interval (-x, x), and then the saturation is adjusted to 1+y times the original value.

[0051] S2: Feature extraction network of the end-to-end traffic light countdown recognition model to improve the model detection and recognition capabilities:

[0052] Specifically, in one embodiment, the following steps are included:

[0053] S2.1: See Figure 2 , the original CSPDarkNet53 of YOLOv4 has many parameters. In order to save computing resources, ResNet50vd is selected as the backbone network for feature extraction. ResNet50vd uses the ResNet-D network, that is, adding an average pooling layer and a 3×3 convolution with a step size of 2 in block1, so that the accuracy of the model is improved without changing the speed. At the same time, in order to improve the model's ability to extract features of long-distance traffic light numbers, CSP is used to transform stage1, stage2, stage3, and stage4 in the network.

[0054] S2.2: See Figure 3, build the Inception-CSP module and add it to stage2 and stage3 of the network to improve the model detection ability. The CSPNet structure can enhance the learning ability of the convolutional neural network, while the Inception network can make different layers have different sizes of receptive fields. Adding the Inception-CSP module to the backbone network can deepen the width and depth of the network, increase the receptive field of the network, and enhance the network's ability to detect objects.

[0055] S2.3: Replace the 3×3 standard convolution in stage 4 of the network with a 3×3 deformable convolution DCN to extract more effective features;

[0056] S2.4: Use matrix non-maximum suppression to remove overlapping boxes, which can effectively avoid conflicts between prediction boxes of similar objects.

[0057] For the detection of the same object, YOLOv4 may give multiple prediction boxes. In one embodiment, Matrix NMS is used to remove overlapping boxes. Matrix NMS calculates the IOU and the score of the prediction box through matrix calculation, and obtains the penalty coefficient based on the IOU and the score, thereby realizing parallel calculation, which not only speeds up the reasoning speed of the model but also improves the accuracy of detection. In one embodiment, the number of detection boxes of Matrix NMS is 1, the threshold of the score is 0.2, and the IOU threshold is 0.45.

[0058] S2.5: Use logistic regression as the traffic light countdown classifier and use the three feature maps of 13×13, 26×26, and 52×52 output by the end-to-end traffic light countdown recognition model for prediction.

[0059] S3: Construct an attention-based multi-scale fusion module to further improve the detection performance of the network:

[0060] For details, please refer to Figure 4, the input features of different scales are Feature1 and Feature2, where Feature1 is a resized small-scale feature, which is the same size as the large-scale feature Feature2. First, Feature1 and Feature2 are added, and the spatial resolution of the obtained feature becomes 1×1 after global average pooling. After 1×1 convolution and ReLU activation function, the number of channels of the feature becomes C / 2; then, the number of channels is adjusted to C through 1×1 convolution and BN (BatchNormalization) layer, and finally the output weight w1 is obtained through the fully connected layer (FC) and sigmoid function. Due to the different feature information of Feature1 and Feature2, this application does not adopt the method of sharing weight w1 between Feature1 and Feature2, but multiplies the obtained weight w1 with Feature1, and multiplies the weight w2 with Feature2 and then adds them to obtain the final output feature, where w2=1-w1. The attention-based multi-scale feature fusion module is introduced to obtain the final output feature by adopting different weights w1 and w2 for Feature1 and Feature2. For inputs of different scales, the feature multi-scale fusion module can calculate different weights w1 and w2, so that inputs of different scales contribute differently to the output features.

[0061] See also Figure 5 and Figure 6 In one embodiment, CSPNet is added to PANet to further enhance the feature fusion capability of the PANet module. Finally, the improved PANet fuses the features of two different scales through the multi-scale fusion module and then extracts features through CSPNet.

[0062] S4: Complete the network construction and preprocess the training dataset and labels, and then use them as input to train the end-to-end traffic light countdown recognition model.

[0063] Specifically, in one embodiment, the following steps are included:

[0064] S4.1: Calculate the loss function

[0065] In one embodiment, the loss function is obtained by weighting three loss functions, wherein the three loss functions are respectively the category loss Loss class , confidence loss Loss conf , coordinate deviation loss Loss coord , where Loss class Use binary cross entropy Loss, Loss conf Loss using binary cross entropy conf_obj and Loss conf_noobj , Losscoord Using CIOULoss, the weight ratio is 1:1:2, and the specific formula is:

[0066] Loss = 0.25 × Loss class +0.25×Loss conf +0.5×Loss coord

[0067] S4.2: Select the cosine learning rate and exponential moving average (EMA);

[0068] In one embodiment, the relationship between the number of training epochs of the model and the learning rate is as shown in the following formula:

[0069]

[0070] In the above formula, begin_rate is the initial learning rate, and epoch is the current round number. In one embodiment, begin_rate is 0.001, and epochs is 100000.

[0071] In one embodiment, the exponential moving average EMA calculates the moving average value during the parameter update process by exponential decay, and each parameter W has an exponential moving average W. t , the relationship between the two is shown in the formula:

[0072] W t =α×W t-1 +(1-α)×W(t≥1)

[0073] In the above formula, α is the attenuation coefficient. In one embodiment, α=0.998, W t The initial value is 0, using W t Update the parameters.

[0074] S4.3: Re-determine the prior box through the K-means algorithm, and the distance function is shown in the formula:

[0075] d(box,centroid)=1-IOU(box,centroid)

[0076] In the above formula, the rectangular box of the centroid cluster center, box represents the labeled rectangular box, and IOU represents the intersection-union ratio of box and centroid.

[0077] Through the above algorithm, we obtain the prior boxes: (6, 19), (13, 40), (7, 22), (4, 13), (5, 16), (8, 24), (8, 26), (8, 25), (9, 28), and complete the construction of the detection system.

[0078] The present application also provides a traffic light countdown recognition system, which is constructed using the above-mentioned construction method.

[0079] This application also provides an application method of a traffic light countdown recognition system. Figure 7 , deploy the above-mentioned traffic light countdown recognition system to the mobile terminal device to complete the recognition of the traffic light countdown in the actual scene.

[0080] Specifically, in one embodiment, the trained detection system is deployed on a mobile device Jetson TX2, and JetPack4.3 is used for flashing. The deep learning framework used in the present invention is PaddlePaddle1.8.4, and the deployment software is PaddleLite.

[0081] The present application provides a method for constructing a traffic light countdown recognition system, which improves YOLOv4. Compared with the original YOLOv4, the end-to-end traffic light countdown recognition model has higher accuracy, lower missed detection rate, and faster speed. It can have a better effect on traffic light recognition in complex environments, and the model has higher generalization and practicality.

[0082] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of the claims of the present invention.

Claims

1. A method for constructing a traffic light countdown recognition system, characterized in that: The following steps are involved: S1: Create a traffic light dataset: collect traffic light images, classify them and create a dataset in VOC 2007 format; S2: Feature extraction network of the end-to-end traffic light countdown recognition model: ResNet50vd is selected as the backbone network for feature extraction, and the Inception-CSP module is constructed. The 3×3 standard convolution of the network stage 4 is replaced with a 3×3 deformable convolution DCN. The matrix non-maximum suppression method is then used to remove overlapping boxes, and logistic regression is used as the traffic light countdown classifier. S3: Construct an attention-based multi-scale fusion module AMF to achieve the fusion of multi-scale features; S4: Complete the network construction and preprocess the training dataset and labels, and then use them as input to train the end-to-end traffic light countdown recognition model.

2. The method for constructing a traffic light countdown recognition system according to claim 1, characterized in that: The number of traffic light images collected in S1 is 8000, and during the classification process, the images are subjected to size normalization, random saturation adjustment, random contrast adjustment, random brightness adjustment and Mosaic data enhancement.

3. The method for constructing a traffic light countdown recognition system according to claim 1, characterized in that: In S3: the final output feature is obtained by adopting different weights w1 and w2 of Feature1 and Feature2, and CSPNet is added to PANet.

4. The method for constructing a traffic light countdown recognition system according to claim 1, characterized in that: The specific steps of S4 are: S4.1: Calculate the loss function, which is obtained by weighting three loss functions, and the three loss functions are respectively the category loss Loss class , confidence loss Loss conf , coordinate deviation loss Loss coord , Among them, Loss class Use binary cross entropy Loss, Loss conf Loss using binary cross entropy conf_obj and Loss conf_noobj , Loss coord Using CIOULoss, the weight ratio is 1:1:2, and the specific formula is: Loss=0.25×Loss class +0.25×Loss conf +0.5×Loss coord ; S4.2: Select the cosine learning rate and the exponential moving average EMA; S4.3: Re-determine the prior box through the K-means algorithm.

5. The method for constructing a traffic light countdown recognition system according to claim 4, characterized in that: The relationship between the cosine learning rate in S4.2 and the number of epochs of training rounds of the model is shown in the following formula: In the above formula, begin_rate is the initial learning rate, and epoch is the current round number; The calculation formula of the exponential moving average EMA is: W t =α×W t-1 +(1-α)×W(t≥1) In the above formula, α is the attenuation coefficient, W t It is an exponential moving average with an initial value of 0.

6. The method for constructing a traffic light countdown recognition system according to claim 4, characterized in that: The distance function calculated in S4.3 is: d(box,centroid)=1-IOU(box,centroid) In the above formula, the rectangular box of the centroid cluster center, box represents the labeled rectangular box, and IOU represents the intersection-union ratio of box and centroid.

7. A traffic light countdown recognition system, characterized in that: The traffic light countdown recognition system is constructed using the construction method of any one of claims 1 to 6.

8. An application method of a traffic light countdown recognition system, characterized in that: Using the traffic light countdown recognition system described in claim 7, the traffic light countdown recognition system is deployed in a mobile terminal device to complete the recognition of the traffic light countdown in an actual scenario.