A Traffic Sign Detection Method Based on Improved YOLOv5
By introducing regional context modules and feature enhancement modules in YOLOv5, combined with CIoU-NMS algorithm, the traffic sign detection model is improved, the small target detection accuracy and missed detection problems are solved, and the performance of traffic sign detection is significantly improved.
Patent Information
- Application Number
- CN202210681167.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-15
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2042-06-15
AI Technical Summary
The existing traffic sign detection algorithm has low accuracy and is prone to missed detection in small target detection, making it difficult to meet the requirements of practical applications.
Based on YOLOv5 neural network, the regional context module (RCM) and feature enhancement module (FEM) are introduced, and the CIoU-NMS module is added to the output end to build an improved traffic sign detection model, and enhance the network's detection ability and feature extraction ability of small targets .
The detection accuracy and recall rate of small targets have been improved. The average accuracy of small targets in the test set has been improved by 3.3%, the average recall rate of small targets has been improved by 4.6%, and the average accuracy has been improved by 1.5%, which has significantly improved traffic sign detection performance.
Smart Images

Figure CN115116032B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of target detection and computer vision, and in particular relates to a traffic sign detection method based on improved YOLOv5. Background Art
[0002] The task of traffic sign detection is to display the type and location of traffic signs in images or videos. Traffic sign detection is an important part of autonomous driving and assisted driving. Traffic signs contain information such as speed limits and road conditions, which is an important step in safe driving. Therefore, studying traffic signs has important theoretical and practical significance.
[0003] Traffic sign detection research can be divided into traditional methods and methods based on deep learning. Among them, the traditional method uses appearance and color features to detect traffic signs, but feature extraction relies on manual work, which has many limitations and does not meet the requirements of real-time and accuracy of traffic sign detection. In 2014, R-CNN (GIRSHICK R, DONAHUE J, DARRELL T, et al. Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation [C] / / Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Washington DC, USA: IEEE Press, 2014: 580-587) first used convolutional networks for target detection. Since then, deep learning-based methods have been widely used in traffic sign detection. Object detection algorithms based on deep learning are mainly divided into two directions: one-stage detection and two-stage detection algorithms. One-stage detection algorithms mainly include: YOLO (you only look once) series, SSD (single shot multibox detector) series, etc. The main two-stage detection algorithms include the R-CNN series and so on.
[0004] Since traffic signs are small and have low resolution, Li et al. (Li J, Liang X, Wei Y, et al. Perceptual Generative Adversarial Networks for Small Object Detection[C] / / 2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, USA: IEEE Press, 2017: 1951-1959.) introduced a new perceptual adversarial network to increase the resolution of small traffic signs, thereby improving detection accuracy. Traffic sign detection contains a large number of small targets. To address this problem, Fan et al. (Fan BB, Yang H. Multi-scale traffic sign detection model with attention [J]. Proceedings of the Institution of Mechanical Engineers, Part D: Journal of Automobile Engineering, 2021, 235 (2-3): 708-720.) introduced a multi-scale traffic sign detection method based on an attention mechanism, which can suppress background information and better focus on the target area in the traffic recognition image; Tang et al. (Tang Q, Cao G, Jo K H. Integrated Feature Pyramid Network With Feature Aggregation for Traffic Sign Detection [J]. IEEE Access, 2021, 9: 117784-117794.) introduced a new feature pyramid network that integrates feature aggregation, thereby enhancing the network's robustness to differences in traffic sign sizes. Although the existing detection algorithms have achieved good results in traffic sign detection, there are many difficulties in actual detection due to the large proportion of small targets in traffic signs and the low resolution of small targets, such as low detection accuracy and missed detection. Based on the above analysis, traffic sign detection needs further research. Summary of the invention
[0005] The purpose of the present invention is that the existing algorithms still have insufficient detection accuracy in small traffic sign targets, which can easily lead to missed detection and false detection. In order to improve the detection accuracy and recall rate of small traffic sign targets, the present invention mainly uses the YOLOv5 detection algorithm, utilizes the new regional context module and feature enhancement module, and proposes a traffic sign detection method based on improved YOLOv5.
[0006] To achieve the above object, the present invention provides the following technical solutions: a traffic sign detection method based on improved YOLOv5, based on a YOLOv5 neural network and a traffic sign dataset containing traffic images corresponding to preset labels, by executing the following steps A to D to obtain a traffic sign detection model, and then based on a target traffic sign sample image, applying the traffic sign detection model to obtain a label corresponding to the target traffic sign image;
[0007] Step A: Based on the YOLOv5 neural network, a feature enhancement FEM module and a regional context RCM module are added to the backbone of the YOLOv5 neural network, and a Focus module, a Conv module, a C3 module, a Conv module, a C3 module, a Conv module, a feature enhancement FEM module, a Conv module, a regional context RCM module, and a feature enhancement FEM module are sequentially connected to construct an improved backbone of the YOLOv5 neural network;
[0008] Step B: Based on the YOLOv5 neural network, a CIoU-NMS module is added after the output end of the YOLOv5 neural network to construct an improved YOLOv5 neural network output part with the CIoU-NMS module as the output end;
[0009] Step C: sequentially connecting the improved YOLOv5 neural network trunk, the YOLOv5 neural network neck, and the improved YOLOv5 neural network output part, and the output end of the improved YOLOv5 neural network trunk is connected to the input end of the YOLOv5 neural network neck, and the output end of the YOLOv5 neural network neck is connected to the input end of the improved YOLOv5 neural network output part; forming an improved YOLOv5 traffic sign detection model with the traffic sign sample image as input and the true value label corresponding to the traffic sign sample image as output;
[0010] Step D: Based on a preset number of traffic sign sample images in the traffic sign dataset, the improved YOLOv5 traffic sign detection model is trained with each traffic sign sample image as input and each target traffic sample image as output to obtain the improved YOLOv5 traffic sign detection model.
[0011] Furthermore, in the aforementioned step A, the feature enhancement FEM module includes convolution 1, convolution 2, convolution 3, convolution 4, convolution 5, ADD module, attention module SA, and Concat module M;
[0012] The input end of convolution 1 serves as the input end of the feature enhancement FEM module, and the input end of convolution 1 is connected to the input end of convolution 5; the output end of convolution 1 is connected to the input end of convolution 2 and the input end of the ADD module respectively; the output end of convolution 2 is connected to the input end of convolution 3, the output end of convolution 3 is connected to the input end of the attention module SA, and the output end of the attention module SA is connected to the input end of the ADD module; the output end of the ADD module is connected to the output end of convolution 5 and the input end of the Concat module; the output end of the Concat module M is connected to the input end of convolution 4, and the output end of convolution 4 serves as the output end of the feature enhancement FEM module.
[0013] Furthermore, in the aforementioned step A, the regional context RCM module includes convolution a, dilated convolution b, dilated convolution c, convolution d, convolution e, convolution f, convolution g, dilated convolution h, dilated convolution i, convolution j, and Concat module N; convolution a is used as the input end, and the output end of convolution a is connected to the input end of dilated convolution b, the input end of dilated convolution c, the input end of convolution d, and the input end of convolution e respectively; the output end of the dilated convolution b is connected to the input end of convolution f, and the output end of the dilated convolution c is connected to the input end of convolution f. The output end is connected to the input end of convolution g, the output end of convolution d is connected to the input end of dilated convolution h, and the output end of convolution e is connected to the input end of dilated convolution i; the output end of convolution f, the output end of convolution g, the output end of dilated convolution h, the output end of dilated convolution h and the input end of convolution a are connected, and are connected to the input end of Concat module N, and the output end of Concat module N is connected to the input end of convolution j; the output end of convolution j serves as the output end of the regional context RCM module.
[0014] Furthermore, the CIoU-NMS module in the aforementioned step B includes steps B1 to B2;
[0015] Step B1: According to the following formula:
[0016]
[0017] Calculate the overlap between the real frame and the predicted frame of the traffic sign image; where:
[0018]
[0019]
[0020] IoU represents the ratio of the intersection of the area of the real box and the predicted box of the traffic sign image to the union of the area, ρ 2 (b,b gt) represents the Euclidean distance between the center points of the real frame and the predicted frame of the traffic sign image, c represents the diagonal distance of the minimum closed area that can contain the predicted frame and the real frame of the traffic sign image, wgt and hgt represent the width and height of the real frame of the traffic sign image, w and h represent the width and height of the predicted frame of the traffic sign image, respectively;
[0021] Step B2: According to the following formula: Filter the traffic sign image detection frame, where M i Indicates the prediction box with the highest prediction score, B i Indicates whether the prediction box needs to be removed, S i represents the classification score, and ε represents the preset NMS threshold.
[0022] Furthermore, the aforementioned traffic sign detection method based on improved YOLOv5 also includes performing a performance test on the improved YOLOv5 traffic sign detection model to obtain the average precision mAP of overall sample detection, the average precision AP of small target detection, and the average recall rate AR of small targets,
[0023] Specifically: Calculate according to the following formula:
[0024]
[0025]
[0026]
[0027]
[0028]
[0029] Among them, P refers to precision, R refers to recall, A refers to average precision, AR is average recall, TP is the number of samples predicted as positive but actually positive, TN is the number of samples predicted as negative but actually negative, FP is the number of samples predicted as positive but actually negative, and FN is the number of samples predicted as negative but actually positive; m is the number of preset categories.
[0030] Furthermore, the aforementioned traffic sign dataset is divided into a test set and a training set in a ratio of 1:9.
[0031] Furthermore, all traffic sign images in the aforementioned training set and test set are unified into a preset size.
[0032] Furthermore, Mosic data enhancement is performed on the aforementioned training set images.
[0033] The improved network was tested for performance. As shown in Table 1, the average accuracy AP of the small target in the test set reached 87.0%, the average recall AR of the small target reached 92.9%, and the AP reached 90.7%. Comparing the algorithm in this paper with YOLOv5, the average accuracy of the small target in AP was improved by 3.3%, the average recall AR of the small target was improved by 4.6%, and the AP was improved by 1.5%. The data test comparison is shown in Table 1, which confirms the feasibility of the algorithm of the present invention. The innovation of the present invention is that the performance of traffic sign detection is improved compared with the original algorithm. The algorithm of the present invention is improved in three aspects based on the YOLOv5 framework. In the first aspect, the Regional Context Module (RCM) is introduced to make full use of the effective information of the surrounding environment, which plays an important supplementary role in the learning of traffic signs; in the second aspect, the attention module (ShuffleAttention, SA) is added, combined with the original C3 structure to form a feature enhancement module (Feature Enhancement Module, FEM), redistribute the weight of the extracted features, enhance the feature expression ability of the small target of the traffic sign, and improve the feature extraction ability of the network. Thirdly, when the prediction box is screened as the final detection box, the optimized NMS algorithm CIoU-NMS algorithm is used for screening. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 This is a flow chart of a traffic sign detection method based on improved YOLOv5 of the present invention;
[0035] Figure 2 A specific network structure diagram of a traffic sign detection method based on improved YOLOv5 of the present invention;
[0036] Figure 3 A regional context RCM module diagram of a traffic sign detection method based on improved YOLOv5 of the present invention;
[0037] Figure 4 This is a feature enhancement module diagram FEM of a traffic sign detection method based on improved YOLOv5 of the present invention. DETAILED DESCRIPTION
[0038] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.
[0039] Various aspects of the invention are described herein with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the invention are not limited to those described in the accompanying drawings. It should be understood that the invention is implemented by any of the various concepts and embodiments described above, as well as the concepts and embodiments described in detail below, because the concepts and embodiments disclosed in the invention are not limited to any implementation. In addition, some aspects disclosed in the invention may be used alone or in any appropriate combination with other aspects disclosed in the invention.
[0040] like Figure 1 As shown, the present invention provides a traffic sign detection method based on improved YOLOv5, and its basic implementation process is as follows: based on a traffic sign dataset containing traffic images corresponding to preset labels, the traffic sign dataset TT100K is first divided into a test set and a training set at a ratio of 1:9. The dataset TT100K is jointly produced by Tsinghua University and Tencent, and provides a total of 100,000 images, including 30,000 traffic sign instances. The images cover changes in lighting and weather conditions. Compared with other traffic sign datasets, there are more types, smaller targets, and greater detection difficulty. This paper selects 45 categories, a total of 9170 pictures, which are divided into 7335 training sets and 1835 test sets. Among them, a total of 9170 pictures are divided into 7335 training sets and 1835 test sets, making the detection results more illustrative and comparative.
[0041] After that, all images in the training set and the test set are unified into 960×960 size. Based on YOLOv5, the Regional Context Module (RCM) and the Feature Enhancement Module (FEM) are introduced. Based on the preset number of traffic sign sample images in the traffic sign dataset, the traffic sign detection model of the improved YOLOv5 is trained with each traffic sign sample image as input and each target traffic sample image as output, and the traffic sign detection model of the improved YOLOv5 is obtained.
[0042] The specific network structure of the improved YOLOv5 traffic sign detection method is as follows Figure 2As shown. Introduce the regional context RCM module. The original YOLOv5 is updated very quickly and now has version 6.0. Since version 6.0 omits the Focus slice, which affects the accuracy of traffic sign detection, this article uses version 5.0. The SPPF structure is proposed in 6.0, and its overall sample accuracy is higher than the SPP structure in version 5.0, so the SPPF module replaces the SPP module in the original 5.0. The SPPF module uses 5×5 maximum pooling. Although maximum pooling will expand the receptive field, it will reduce the resolution of the feature map, which is not conducive to network learning. The dilated convolution has the advantages of being able to learn contextual information, expand the receptive field and not reduce the feature resolution, so this article replaces the maximum pooling with the dilated convolution. Construct an improved YOLOv5 traffic sign detection model through steps A to C;
[0043] Step A: Based on the YOLOv5 neural network, a feature enhancement FEM module and a regional context RCM module are added to the backbone of the YOLOv5 neural network, and a Focus module, a Conv module, a C3 module, a Conv module, a C3 module, a Conv module, a feature enhancement FEM module, a Conv module, a regional context RCM module, and a feature enhancement FEM module are sequentially connected to construct an improved backbone of the YOLOv5 neural network;
[0044] Step B: Based on the YOLOv5 neural network, a CIoU-NMS module is added after the output end of the YOLOv5 neural network to construct an improved YOLOv5 neural network output part with the CIoU-NMS module as the output end;
[0045] Step C: sequentially connect the improved YOLOv5 neural network trunk, the YOLOv5 neural network neck, and the improved YOLOv5 neural network output part, and the output end of the improved YOLOv5 neural network trunk is connected to the input end of the YOLOv5 neural network neck, and the output end of the YOLOv5 neural network neck is connected to the input end of the improved YOLOv5 neural network output part; construct an improved YOLOv5 traffic sign detection model with the traffic sign sample image as input and the true value label corresponding to the traffic sign sample image as output.
[0046] Regional context RCM modules such as Figure 3As shown in the figure, a total of five branches can be divided into three categories, which are used to extract distant context information, adjacent context information and original information respectively. The regional context RCM module includes convolution a, dilated convolution b, dilated convolution c, convolution d, convolution e, convolution f, convolution g, dilated convolution h, dilated convolution i, convolution j, and Concat module N; convolution a is used as the input end, and the output end of convolution a is connected to the input end of dilated convolution b, the input end of dilated convolution c, the input end of convolution d, and the input end of convolution e respectively; the output end of the dilated convolution b is connected to the input end of convolution f, and the output end of the dilated convolution c is connected to the input end of convolution h. The input end of the convolution g is connected, the output end of the convolution d is connected to the input end of the dilated convolution h, and the output end of the convolution e is connected to the input end of the dilated convolution i; the output end of the convolution f, the output end of the convolution g, the output end of the dilated convolution h, the output end of the dilated convolution h and the input end of the convolution a are connected, and are connected to the input end of the Concat module N, and the output end of the Concat module N is connected to the input end of the convolution j; the output end of the convolution j serves as the output end of the regional context RCM module.
[0047] Among them, the more distant context information is first obtained by expanding the receptive field through the dilated convolution b and dilated convolution c, and then the information is processed in detail through 1×1 convolution f and convolution g; the adjacent area information is first obtained through 1×1 convolution d and convolution e, and then the information is locally expanded through dilated convolution h and dilated convolution i. The dilation rate (d) of the dilated convolution in these two types of context information is the same, and both use dilation rates d=3 and d=4, so that multiple receptive field information can be obtained. Finally, the more distant area information, the adjacent area information and the original information are fused through the sequentially linked Concat module and N convolution j to form the regional context RCM module. This module can learn the associated information of the area around the traffic sign target, thus playing an important supplementary role.
[0048] Introducing feature-enhanced FEM modules, such as Figure 4 As shown in the figure. The SA (Shuffle Attention, SA) attention module includes channel attention and spatial attention. SA divides the original feature information into two groups, which are respectively channel-attended and spatial-attended. Then, the shuffle unit is used to combine the attention channel with the spatial channel at the same time, so that the cross-group information flows along the channel dimension. SA has fewer hyperparameters, so it is a lightweight attention module.
[0049] The C3 module is composed of two nested residual modules. This paper embeds the SA module into the second residual block of the C3 module to form a feature enhancement module. The feature enhancement FEM module includes convolution 1, convolution 2, convolution 3, convolution 4, convolution 5, ADD module, attention module SA, and Concat module M; the input end of convolution 1 is used as the input end of the feature enhancement FEM module, and the input end of convolution 1 is connected to the input end of convolution 5; the output end of convolution 1 is connected to the input end of convolution 2 and the input end of the ADD module respectively; the output end of convolution 2 is connected to the input end of convolution 3, the output end of convolution 3 is connected to the input end of the attention module SA, and the output end of the attention module SA is connected to the input end of the ADD module; the output end of the ADD module is connected to the output end of convolution 5 and the input end of the Concat module; the output end of the Concat module M is connected to the input end of convolution 4, and the output end of convolution 4 is used as the output end of the feature enhancement FEM module.
[0050] Since the key to extracting features lies in the backbone, it is more appropriate to place the feature enhancement module in the backbone. The feature enhancement module can enhance the network's ability to extract effective information and better learn the semantic information of small targets. The CIoU-NMS module includes steps B1 to B2;
[0051] Step B1: According to the following formula:
[0052]
[0053] Calculate the overlap between the real frame and the predicted frame of the traffic sign image; where:
[0054]
[0055]
[0056] IoU represents the ratio of the intersection of the area of the real box and the predicted box of the traffic sign image to the union of the area, ρ 2 (b,b gt ) represents the Euclidean distance between the center points of the real frame and the predicted frame of the traffic sign image, c represents the diagonal distance of the minimum closed area that can contain the predicted frame and the real frame of the traffic sign image, wgt and hgt represent the width and height of the real frame of the traffic sign image, w and h represent the width and height of the predicted frame of the traffic sign image, respectively;
[0057] Step B2: According to the following formula: Filter the traffic sign image detection frame, where M i Indicates the prediction box with the highest prediction score, B i Indicates whether the prediction box needs to be removed, S irepresents the classification score, and ε represents the preset NMS threshold.
[0058] The NMS algorithm process is as follows: In the final detection phase, many prediction boxes are obtained to form an initial prediction box set. These prediction boxes are first sorted according to confidence, and the prediction box with the highest prediction score is named M. i , and put it into the final detection box set. The remaining prediction boxes are named Bi. Then Bi and Mi are calculated for IoU. When IoU is greater than the threshold, Bi is deleted, indicating that Bi and Mi are responsible for detecting the same target; when IoU is less than the threshold, it means that Bi is responsible for predicting another category.
[0059] The algorithm process of CIoU reduces the overlapping scores of two prediction boxes on the basis of the original IoU. The specific process is: sort the prediction boxes by confidence, and the Mi with the highest score will be put into the final detection box set, and then the overlapping scores of Mi and the remaining prediction boxes are calculated. The overlapping score calculation is to subtract the distance value and the aspect ratio value of the center point from the IoU score. In this way, the overlapping score is reduced, so that the originally deleted Bi can be retained, thereby reducing the missed detection rate.
[0060] The training set is sent to the improved YOLOv5 traffic sign detection model for training. The experimental environment of the present invention is the windows10 operating system, the computer memory is 64GB, the processor type is i9-11900K, the graphics card is RTX 3080Ti, the video memory is 12GB, the deep learning framework adopted is pytorch1.8, and the programming language is python3.8. Before training, the training set pictures will first be subjected to Mosic data enhancement. By randomly arranging four pictures into an image by randomly cropping, rotating, scaling, etc., this data enhancement method can effectively improve the accuracy of small target detection. Set the network training parameters: the training batch size is set to 16, the attenuation coefficient is 0.0005, the total number of iterations is 120 times, the initial learning rate is 0.01, the momentum is 0.937, and the threshold is 0.5.
[0061] The test set is input into the trained improved YOLOv5 traffic sign detection model to perform performance testing and analyze the experimental results. The evaluation indicators include the overall sample average precision AP, small target average precision AP, and small target average recall AR. The specific formula is as follows:
[0062]
[0063]
[0064]
[0065]
[0066]
[0067] Among them, P refers to precision, R refers to recall, AP (average precision) refers to average precision, AR (average recall) refers to average recall, TP, TN, FP, and FN are respectively the samples predicted as positive are actually positive samples, the samples predicted as negative are actually negative samples, the samples predicted as positive are actually negative samples, and the samples predicted as negative are actually positive samples. m is the number of sample categories, and m is 45 in this paper.
[0068] Under the premise that the pixels of traffic signs are very small, experiments have shown that a good detection effect can be achieved. The data test comparison of traffic sign detection performance shown in Table 1 confirms the feasibility of the algorithm of the present invention. The innovation of the present invention is reflected in the proposal of a new regional context RCM module and a feature enhancement FEM module, and the use of them in the YOLOv5 detection algorithm, which improves the traffic sign detection performance compared with the original algorithm.
[0069] Table 1
[0070]
[0071] The above is only a preferred embodiment of the present invention, but it is not intended to limit the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.
Claims
1. A traffic sign detection method based on improved YOLOv5, characterized in that: Based on the YOLOv5 neural network and a traffic sign dataset including traffic images corresponding to preset labels, a traffic sign detection model is obtained by performing the following steps A to D, and then the traffic sign detection model is applied to the target traffic sign sample image to obtain the label corresponding to the target traffic sign image; Step A: Based on the YOLOv5 neural network, a feature enhancement FEM module and a regional context RCM module are added to the backbone of the YOLOv5 neural network, and a Focus module, a Conv module, a C3 module, a Conv module, a C3 module, a Conv module, a feature enhancement FEM module, a Conv module, a regional context RCM module, and a feature enhancement FEM module are sequentially connected to construct an improved backbone of the YOLOv5 neural network; Step B: Based on the YOLOv5 neural network, a CIoU-NMS module is added after the output end of the YOLOv5 neural network to construct an improved YOLOv5 neural network output part with the CIoU-NMS module as the output end; Step C: sequentially connecting the improved YOLOv5 neural network trunk, the YOLOv5 neural network neck, and the improved YOLOv5 neural network output part, and the output end of the improved YOLOv5 neural network trunk is connected to the input end of the YOLOv5 neural network neck, and the output end of the YOLOv5 neural network neck is connected to the input end of the improved YOLOv5 neural network output part; forming an improved YOLOv5 traffic sign detection model with the traffic sign sample image as input and the true value label corresponding to the traffic sign sample image as output; Step D: Based on a preset number of traffic sign sample images in the traffic sign dataset, the improved YOLOv5 traffic sign detection model is trained with each traffic sign sample image as input and each target traffic sample image as output to obtain the improved YOLOv5 traffic sign detection model.
2. A traffic sign detection method based on improved YOLOv5 according to claim 1, characterized in that: In the step A, the feature enhancement FEM module includes convolution 1, convolution 2, convolution 3, convolution 4, convolution 5, ADD module, attention module SA, and Concat module M; The input end of convolution 1 serves as the input end of the feature enhancement FEM module, and the input end of convolution 1 is connected to the input end of convolution 5; the output end of convolution 1 is connected to the input end of convolution 2 and the input end of the ADD module respectively; the output end of convolution 2 is connected to the input end of convolution 3, the output end of convolution 3 is connected to the input end of the attention module SA, and the output end of the attention module SA is connected to the input end of the ADD module; the output end of the ADD module is connected to the output end of convolution 5 and the input end of the Concat module; the output end of the Concat module M is connected to the input end of convolution 4, and the output end of convolution 4 serves as the output end of the feature enhancement FEM module.
3. The traffic sign detection method based on improved YOLOv5 according to claim 1, characterized in that: In step A, the regional context RCM module includes convolution a, dilated convolution b, dilated convolution c, convolution d, convolution e, convolution f, convolution g, dilated convolution h, dilated convolution i, convolution j, Concat module N Convolution a is used as the input, and the output of convolution a is connected to the input of dilated convolution b, the input of dilated convolution c, the input of convolution d, and the input of convolution e respectively; The output end of the dilated convolution b is connected to the input end of the convolution f, the output end of the dilated convolution c is connected to the input end of the convolution g, the output end of the convolution d is connected to the input end of the dilated convolution h, and the output end of the convolution e is connected to the input end of the dilated convolution i; The output end of the convolution f, the output end of the convolution g, the output end of the hollow convolution h, the output end of the hollow convolution h and the input end of the convolution a are connected, and are connected to the input end of the Concat module N. The output end of the Concat module N is connected to the input end of the convolution j; the output end of the convolution j serves as the output end of the regional context RCM module.
4. The traffic sign detection method based on improved YOLOv5 according to claim 1, characterized in that: The CIoU-NMS module in step B includes steps B1 to B2; Step B1: According to the following formula: Calculate the overlap between the real frame and the predicted frame of the traffic sign image; where: IoU represents the ratio of the intersection of the area of the real box and the predicted box of the traffic sign image to the union of the area, ρ 2 (b,b gt ) represents the Euclidean distance between the center points of the real frame and the predicted frame of the traffic sign image, c represents the diagonal distance of the minimum closed area that can contain the predicted frame and the real frame of the traffic sign image, and w gt 、h gt Respectively represent the width and height of the real frame of the traffic sign image, w and h represent the width and height of the predicted frame of the traffic sign image; Step B2: According to the following formula: Filter the traffic sign image detection frame, where M i Indicates the prediction box with the highest prediction score, B i Indicates whether the prediction box needs to be removed, S i represents the classification score, and ε represents the preset NMS threshold.
5. The traffic sign detection method based on improved YOLOv5 according to claim 1, characterized in that: It also includes performance testing of the improved YOLOv5 traffic sign detection model to obtain the average precision mAP of overall sample detection, the average precision AP of small target detection, and the average recall rate AR of small targets. Specifically: Calculate according to the following formula: Among them, P refers to precision, R refers to recall, A refers to average precision, AR is average recall, TP is the number of samples predicted as positive but actually positive, TN is the number of samples predicted as negative but actually negative, FP is the number of samples predicted as positive but actually negative, and FN is the number of samples predicted as negative but actually positive; m is the number of preset categories.
6. The traffic sign detection method based on improved YOLOv5 according to claim 1, characterized in that: For the traffic sign dataset, it is divided into a test set and a training set in a ratio of 1:
9.
7. The traffic sign detection method based on improved YOLOv5 according to claim 6, characterized in that: All traffic sign images in the training set and test set are unified into a preset size.
8. The traffic sign detection method based on improved YOLOv5 according to claim 6, characterized in that: Perform Mosic data enhancement on the training set images.
Citation Information
Patent Citations
Long-distance traffic sign detection and recognition method suitable for vehicle-mounted system
CN110188705A
Traffic sign detection method based on improved cascaded neural network
CN111401410A