Traffic sign detection method based on improved YOLOv8n

By using SPD-Conv convolution and ECA attention mechanism in the traffic sign detection algorithm, combined with the WIOUv3 loss function, the problem of low detection accuracy and missed detection of small targets is solved, the detection performance is improved, and the system is realized in an unmanned driving environment. Traffic sign detection with high accuracy and high recall rate.

CN118570767APending Publication Date: 2024-08-30CHANGZHOU UNIV
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202410704959.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Existing traffic sign detection algorithms have problems with low detection accuracy, missed detection, and misdetection of small targets in complex environments. Especially in the field of driverless driving, it is difficult to accurately identify traffic signs.

Method used

The SPD-Conv convolutional neural network structure is used to enhance the backbone network's ability to extract small target features, the ECA attention mechanism module is integrated into the feature weighted fusion, and the CIOU loss function is replaced by the WIOUv3 loss function to optimize bounding box regression.

Benefits of technology

The average accuracy and recall rate of traffic sign detection have been significantly improved. The improved model can quickly and accurately detect traffic signs in complex environments, reduce the missed detection rate, and improve the traffic sign detection performance in driverless driving. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570767A
    Figure CN118570767A
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a traffic sign detection method based on improved YOLOv8n, and the method comprises the steps: collecting a sign image data set; according to the improved YOLOv8n model, the first layer, the third layer, the sixth layer, the ninth layer and the twelfth layer in the backbone network are SPD-Conv convolution modules, the fourth layer, the seventh layer, the tenth layer and the thirteenth layer are C2f-ECA modules, the SPD-Conv convolution modules are used for enhancing the small target feature extraction capacity of the backbone network, and the ECA attention mechanism is used for improving the detection precision; and calculating a minimum circumscribed frame of the prediction frame and the real frame by using a loss function. According to the method, the problems of missing detection and low detection precision caused by serious loss of small target feature information during small target detection by an existing method are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a traffic sign detection method based on improved YOLOv8n. Background Art

[0002] In complex road conditions, accurate identification of traffic signs is crucial, especially in the field of unmanned driving, where information about the traffic signs ahead needs to be obtained in advance. However, due to the small proportion of traffic signs in the entire image during long-distance detection, the effective information that can be extracted is limited. In addition, the influence of external factors such as weather, light, and angle further increases the difficulty of accurate identification of traffic signs.

[0003] In recent years, deep convolutional neural networks (CNNs) have shown powerful feature extraction and generalization capabilities, providing key support for autonomous driving. Li Xuejun et al. proposed an improved Faster-RCNN algorithm, which introduced a multi-scale feature fusion network designed with attention and GSConv convolution, and updated the size of the Anchors anchor selection box to improve target positioning and recognition capabilities. The improved model can achieve a detection accuracy of 85% in low-intensity environments such as cloudy days, but has low accuracy in traffic sign detection, and there are problems of missed detection and false detection.

[0004] Cao Wuhan et al. proposed a traffic sign detection method based on an improved SSD target detection algorithm. By introducing the RFB-Tiny module for feature aggregation and using CIoU Loss as the loss function for bounding box regression, the target positioning accuracy was improved. The average accuracy of the improved SSD detection algorithm on the traffic sign test set reached 85.37, which was relatively low.

[0005] Hu Junping proposed an improved YOLOv5 algorithm for real-time detection of small target traffic signs. By introducing learnable adaptive weights, deep semantics and shallow detail features are better integrated in neck feature fusion to improve detection accuracy. The mAP of the improved algorithm on small target traffic signs is 77.3%.

[0006] Zheng Juanyi proposed an improved YOLOv5s algorithm by embedding ConvNeXt_Block in the Backbone and Head parts of YOLOv5s to enhance the capability of the feature extraction network and improve detection accuracy. On the TT100K dataset, the model has a detection accuracy of 79.9%.

[0007] Although the above-mentioned research on traffic sign detection in natural scenes has achieved good results, there are still some shortcomings, especially in small target detection. As the deep learning network continuously extracts image features, the feature information of small targets will be seriously lost, resulting in a large number of targets being missed and low detection accuracy. Summary of the invention

[0008] In view of the shortcomings of the existing methods, the present invention uses SPD-Conv to replace the original Conv convolutional neural network structure to enhance the backbone network's ability to extract small target features; secondly, the ECA attention mechanism module is integrated into the C2F model to weightedly fuse feature information of different channels to improve model performance; finally, the CIOU loss function is replaced by the WIOUv3 loss function to further optimize the bounding box loss.

[0009] The technical solution adopted by the present invention is: the traffic sign detection method based on improved YOLOv8n includes the following steps:

[0010] Step 1: Collect sign image dataset;

[0011] As a preferred implementation of the present invention, the data set adopts TT100K.

[0012] Step 2: Improve the YOLOv8n model: the 1st, 3rd, 6th, 9th, and 12th layers in the backbone network are all SPD-Conv convolution modules, and the 4th, 7th, 10th, and 13th layers are C2f-ECA modules. The SPD-Conv convolution module is used to enhance the backbone network's ability to extract small target features, and the ECA attention mechanism is used to improve detection accuracy.

[0013] As a preferred embodiment of the present invention, the improved YOLOv8n model also includes: the 17th, 20th, 23rd and 26th layers in the neck network are C2f-ECA modules.

[0014] As a preferred implementation of the present invention, the C2f-ECA module replaces the Bottleneck layer of the C2f module with an ECA-Bottleneck layer, and adds the ECA module after the second Conv layer of the Bottleneck layer.

[0015] Step 3: Use the loss function to calculate the minimum bounding box between the predicted box and the true box.

[0016] As a preferred implementation of the present invention, the loss function includes WIoUv3.

[0017] As a preferred implementation of the present invention, the loss function also includes WIOUv1 and WIOUv2.

[0018] As a preferred implementation of the present invention, the precision, recall, F1 and map value indicators are used to evaluate the improved YOLOv8n model.

[0019] Beneficial effects of the present invention:

[0020] 1. The present invention firstly adopts SPD-Conv convolution in the backbone network to enhance the network's ability to extract small target features; secondly, the ECA attention mechanism module is integrated into the C2f module to improve the detection accuracy of the target; finally, the CIOU loss function is replaced by the WIOUv3 loss function, and the bounding box loss is further optimized. Under the premise of not significantly increasing the network depth, the problem of network convergence difficulty is solved, which provides a basis for quickly and accurately completing the multi-task of detecting traffic signs;

[0021] 2. Through ablation experiments and comparison with existing models, the average accuracy of the present invention is 94.6% and the recall rate is 88.0%, which greatly improves the performance of the network model. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a logic diagram of the traffic sign detection model in a complex environment based on improved YOLOv8 of the present invention;

[0023] Figure 2 is a structural diagram of SPD-Conv of the present invention;

[0024] Figure 3 It is the structural diagram of the EAC attention mechanism of the present invention;

[0025] Figure 4 is the ablation experiment training accuracy curve of the present invention;

[0026] Figure 5 It is a comparison chart between YOLOv8n of the present invention and the model of the present invention. DETAILED DESCRIPTION

[0027] The present invention is further described below in conjunction with the accompanying drawings and embodiments. This figure is a simplified schematic diagram, which only illustrates the basic structure of the present invention in a schematic manner, and therefore it only shows the components related to the present invention.

[0028] like Figure 1 As shown, the traffic sign detection method based on improved YOLOv8n includes the following steps:

[0029] YOLOv8n is mainly composed of input, backbone network, neck network and output end; among them, the backbone network adopts Conv, C2f and SPPF structure, and the neck network adopts PAN structure; although YOLOv8n performs well in natural scenes, it has problems in unmanned driving traffic sign detection.

[0030] The present invention aims to improve the feature extraction capability and training accuracy by introducing ECA attention mechanism, SPD-Conv convolutional neural network, and utilizing WIoUV3 loss function, thereby improving the traffic sign detection effect.

[0031] The backbone network consists of 14 layers, the 1st, 3rd, 6th, 9th, and 12th layers are the first to fifth SPD-Conv modules respectively; the 2nd, 5th, 8th, and 11th layers are the first to fourth Conv modules; the 4th, 7th, 10th, and 13th layers are the first to fourth C2f-ECA modules respectively.

[0032] The Neck network consists of 12 layers, the 17th, 20th, 23rd, and 26th layers are the fifth to eighth C2f-ECA modules respectively; the 15th and 18th layers are the first and second upsampling modules respectively; the 16th, 19th, 22nd, and 25th layers are the first to fourth fully connected layers respectively.

[0033] SPD-Conv consists of a spatial depth (SPD) layer and a convolution-free stride (Conv stride = 1); Figure 2 In (a), the SPD layer first downsamples the feature map X[S×S×C1], but retains all the information in the channel; Figure 2 (b) gives an example when scale = 2, so 4 sub-feature maps X1 [S / 2×S / 2×C1] are obtained, so there is no information loss in this process; secondly, the 4 feature maps are spliced ​​in the channel direction to obtain a feature map X2 of size [S / 2×S / 2×4C1]; finally, after the SPD structure is completed, Figure 2 (c) A Convolution layer with a C2 filter is added, where the Convolution step size stride = 1 and C2<4C1, and finally a feature map X3[S / 2×S / 2×C2] is obtained; in this process, the purpose of setting the Convolution step size to 1 is to prevent the loss of small target information and thereby improve the detection performance of small targets.

[0034] In the process of unmanned driving, in order to better separate the traffic sign information from the background and improve the detection performance of the model, the attention mechanism is introduced; in the field of computer vision, the attention mechanism is used to focus on important areas in the image and suppress irrelevant parts; in many machine vision tasks, the attention mechanism plays an important role; in order to ensure that after adding the attention mechanism, the network can improve the feature representation capability without increasing too much computational cost; therefore, the ECANet (Efficient Channel Attention Network) attention mechanism is adopted, and the ECA attention mechanism structure diagram is shown in Figure 3.

[0035] from Figure 3It can be seen that, first, the input feature map [h×w×c] is sent to the ECA attention module. In this module, the feature map is converted into a [1×1×c] vector by introducing the global average pooling (GAP) operation so that each channel can obtain the global information of the entire feature map; next, the convolution kernel K of the adaptive size is calculated according to the number of channels of the feature map; where the calculation formula of K is as shown in formula (1);

[0036]

[0037] Wherein, C is the number of channels, b=1, and γ=2.

[0038] This process aims to calculate the importance of each channel and weight it in order to highlight the important feature information. These weighted features will help the network better learn the important features of each channel. Finally, the weighted features obtained after the feature mapping calculation are fused into the feature map of the original input, thus generating an output feature map with stronger representation ability. This output feature map can be passed to the next layer of the network or used for subsequent tasks and processing. In general, the ECA attention mechanism can effectively extract and weight important feature information by introducing global information acquisition and feature mapping calculation, thereby enhancing the representation ability and performance of the network.

[0039] In the process of unmanned driving, the detection task of traffic sign target information faces many challenges. Among them, the high proportion of small objects increases the difficulty of detection, and there are many types of traffic signs. Therefore, choosing a suitable loss function is crucial to the performance and training effect of the model. Traditional loss functions, such as CIOU and GIOU, may limit the convergence speed of the model because they need to calculate the minimum bounding box between the predicted box and the true box. In order to solve this problem, WIoUv3 is used as the loss function in the improved network. The WIoUv3 loss function is improved on the basis of WIOUv1 and WIOUv2. It not only considers the aspect ratio, center point distance and overlapping area, but also designs a reasonable gradient gain allocation strategy to reduce the large gradients or harmful gradients that may appear in extreme samples. This loss method pays more attention to samples of ordinary quality, thereby improving the generalization ability and overall performance of the network model.

[0040] According to the distance metric, the distance attention is constructed, and WIoU v1 with a two-layer attention mechanism is obtained. The calculation is shown in formulas (2)-(4):

[0041] L WIoUv1 =R WIoU ×L IoU (2)

[0042]

[0043] L IoU =1-IoU (4)

[0044] Among them, IoU represents the intersection over union of the predicted box and the real box; h and w represent the height and width of the predicted box; cx and cy represent the center coordinates of the real box; b gt and w gt Represents the height and width of the real box; ch and cw represent the height and width of the minimum enclosing box formed by the predicted box and the real box.

[0045] A non-monotonic focusing coefficient is constructed using β and applied to WIoU v1 to obtain WIoU v3 with dynamic non-monotonic FM. WIoU v3 achieves superior performance by using a judicious gradient gain allocation strategy with dynamic non-monotonic FM. The calculation is shown in formulas (5)-(7):

[0046] L WIoU =r×L WIoUv1 (5)

[0047]

[0048] Among them, δ and α are hyperparameters.

[0049] Based on the public dataset TT100K Chinese traffic sign images, this study takes the sign identification information as the object and conducts a study on the traffic sign detection method based on improved YOLOv8n for unmanned driving; TT100K (TrafficSign 100K) is a large traffic sign detection and recognition dataset, which contains 100,000 high-definition images with a resolution of 2048×2048, including 30,000 traffic sign instances, presenting the real traffic scenes of almost all different urban roads in China. In order to improve the practicality of the data, common traffic sign categories were screened in TT100K, and there were 45 categories with more than 100 instances, totaling 9170 images. In order to conduct effective training and evaluation, the training set (5503 images), validation set (1833 images) and test set (1834 images) were randomly divided according to the ratio of 8:1:1.

[0050] This study uses the PyTorch 1.8.0 deep learning framework, Pycharm compiler, and Python 3.7 programming language to train the data set model on an NVIDIA Tesla V100 32G, Ubuntu 16.04 operating system, Intel Xeon Gold 5117 processor, and 32GB memory platform. The SGD optimizer is used during the experiment, with a random seed of 2, a learning rate of 0.01, a SGD optimizer momentum of 0.937, a weight decay of 0.0005, 300 iterations, and a batch size of 16.

[0051] In order to analyze the performance of the model, the experiment uses precision P (Precision), recall R (Recall), F1 and map value indicators to evaluate the detection effect of the model. Their definitions are shown in equations (8)-(11). The higher the P, R, F1 and map values, the higher the network detection accuracy.

[0052]

[0053]

[0054] Among them, TP represents the number of signs recognized by the algorithm, FN represents the number of signs not recognized, FP represents the number of backgrounds mistakenly recognized as signs, and c is the total number of detected targets.

[0055] In order to verify the effectiveness of the model of the present invention, mainstream target detection algorithms Faster-rcnn, SSD, YOLOv5 and YOLOv7 are used to train the model under the same data set and the same configuration; the training results are shown in Table 1.

[0056] Table 1 Performance comparison of different algorithm models

[0057]

[0058] It can be seen from the test results in Table 1 that YOLOv8n has the best network performance among the five types of models; compared with Faster-rcnn, SSD, YOLOV5s, and YOLOv7 detection networks, the mAP of YOLOv8n is increased by 8.7, 12.8, 1.6 and 7.1 percentage points respectively, and the recall rate R is increased by 8.1, 11.8, 1.0 and 2.8 percentage points respectively; the precision rate P is increased by 8.9, 12.4, 1.6 and 7.1 percentage points respectively; and the training weight model size of YOLOv8n is the smallest; from multiple angles of comparison and analysis, the YOLOV8n model shows better results in traffic sign detection. Therefore, the model of the present invention is improved on YOLOv8n to make the model better applied to traffic sign detection.

[0059] In order to verify the superiority of the SPD model, while ensuring the consistency of the target detection network structure, this experiment integrates SPD-Conv convolution in the backbone network. In order to enhance the backbone network's ability to extract small target traffic signs, it is compared with the original YOLOv8n model. The performance is shown in Table 2.

[0060] Table 2 SPD-Conv convolution model performance comparison

[0061]

[0062]

[0063] According to the results in Table 2, the average accuracy map of YOLOv8n after integrating SPD-Conv convolution is improved by 1.3 percentage points, and the recall rate and precision rate are increased by 0.1 and 1.7 percentage points respectively, compared with the original YOLOv8n. This shows that the addition of SPD-Conv convolution can be beneficial to the improvement of small target detection performance.

[0064] In order to verify the impact of different attention mechanism models on traffic sign detection, this experiment integrated CBAM, CA, SE and ECA attention mechanisms into the C2f module in the backbone network structure and the Neck structure respectively; while ensuring the consistency of the target detection network structure, these four attention mechanisms were experimentally compared, and their performance is shown in Table 3.

[0065] Table 3 Experimental comparison of different attention mechanisms under the yolov8 framework

[0066]

[0067] According to the experimental results in Table 3, the integration of ECA attention mechanism into the YOLOv8n traffic sign detection model makes the model performance more superior. Compared with the three attention mechanisms of CBAM, CA, and SE, the precision P is increased by 2.3, 1.8, and 1.1 percentage points respectively; the recall rate R is increased by 0.3, 0.9, and 0.5 percentage points respectively; and the average accuracy is increased by 0.4, 0.3, and 0.5 percentage points respectively.

[0068] In order to verify the optimization effect of different loss functions on the YOLOv8n network model, while ensuring the consistency of the target detection network structure, this experiment simultaneously constructed seven loss functions, namely replacement, DIOU, SIOU, GIOU, EIOU, WIOU V1, WIOU V2 and WIOU V3, for comparative analysis, as shown in Table 4 below.

[0069] Table 4 Comparison of different loss functions

[0070]

[0071]

[0072] According to the results in Table 4, the WIOU V3 loss function is used in the YOLOv8n traffic sign detection model; compared with the other 7 loss function models, the WIOU V3 loss function can significantly improve the average accuracy, and the mAP0.5 value is increased by 5.9, 16.1, 0.5, 2.4, 2.9, 5, and 3.6 percentage points respectively. In terms of precision P, the WIOUv3 loss function improves by 3.9, 13.3, 1.5, 2.1, 4.3, 4.9, and 3.2 percentage points. In terms of recall rate R, compared with CIOU, DIOU, SIOU, GIOU, EIOU, WIOU V1 and WIOU V2, the WIOU V3 loss function improves by 4.8, 16.7, 0.1, 3.2, 2.4, 4.5, and 1.5 percentage points. The experimental results clearly show that the WIOUv3 loss function can effectively improve the detection performance of the network model and has a good effect on the target detection task.

[0073] In order to further explore the advantages of the model of the present invention, a fusion experiment was conducted to integrate the YOLOv8n model, SPD-Conv structure, C2f-ECA attention mechanism and WIoUv3 loss function; the experimental results are shown in Table 5, and the traffic sign training accuracy curve is shown in Figure 4 shown.

[0074] Table 5 Ablation test results

[0075]

[0076] Note: YOLOv8n represents the original network; YOLOv8n-SEW means modifying the backbone network, C2f-ECA module and loss function in the YOLOv8n network at the same time; “×” means not using this module; “√” means using this module.

[0077] According to the ablation test results of the YOLOv8n improved model in Table 5, it can be seen that the SEW improved method is used to improve the YOLOv8n traffic sign target detection model. Compared with the YOLOv8n network model, the precision P, average precision mAP and recall rate R of the improved model are increased by 9.4, 6.1 and 4.9 percentage points respectively; therefore, the improved method can reduce the missed detection rate of traffic signs while achieving high accuracy.

[0078] according to Figure 4The accuracy results of five models obtained from different experimental training on the validation set are shown. From the curves of the training results of the five models, it can be seen that YOLOv8n-SEW has the best effect.

[0079] In order to verify the improved traffic sign detection performance of YOLOv8n in complex environments, the detection results of the network on 1834 test sets were analyzed. These 1834 test sets cover most scenarios. The specific test results are shown in Table 6

[0080] Table 6 Traffic sign inspection and verification

[0081]

[0082] Through verification, the improved model has an improvement of 9.7 percentage points in precision P and 11.1 percentage points in recall on the test set, which means that its missed detection rate has increased by 11.1 percentage points.

[0083] pass Figure 5 It can be seen that the improved model greatly reduces the probability of missed detection and improves the accuracy during traffic sign detection; compared with the original model, the improved model is effective.

[0084] In order to solve the traffic hazard problems caused by model missed detection and false detection due to the small size of traffic signs in unmanned driving, the improved YOLOv8n model enhances the detection ability of small targets by using the SPD_Conv convolutional neural network; by integrating the ECA attention mechanism into C2f, the network can improve the feature representation ability and the detection accuracy of the model's traffic signs without increasing too much computational cost; by introducing the WIOUv3 loss function, the detection performance of the network model is effectively improved.

[0085] Through experimental comparison, the improved model has better performance, with an average accuracy of 94.6% and a recall rate of 88.0%, which greatly improves the performance of the network model and also provides protection for the safety of unmanned driving.

[0086] Based on the above ideal embodiments of the present invention, the relevant staff can make various changes and modifications without departing from the technical concept of the present invention through the above description. The technical scope of the present invention is not limited to the contents of the specification, and its technical scope must be determined according to the scope of the claims.

Claims

1. The traffic sign detection method based on improved YOLOv8n is characterized by: The following steps are involved: Step 1: Collect sign image dataset; Step 2: Improve the YOLOv8n model: the 1st, 3rd, 6th, 9th, and 12th layers in the backbone network are all SPD-Conv convolution modules, and the 4th, 7th, 10th, and 13th layers are C2f-ECA modules. The SPD-Conv convolution module is used to enhance the backbone network's ability to extract small target features, and the ECA attention mechanism is used to improve detection accuracy. Step 3: Use the loss function to calculate the minimum bounding box between the predicted box and the true box.

2. The traffic sign detection method based on improved YOLOv8n according to claim 1 is characterized in that: The improved YOLOv8n model also includes: the 17th, 20th, 23rd and 26th layers in the neck network are C2f-ECA modules.

3. The traffic sign detection method based on improved YOLOv8n according to claim 2 is characterized in that: The C2f-ECA module replaces the Bottleneck layer of the C2f module with the ECA-Bottleneck layer and adds the ECA module after the second Conv layer of the Bottleneck layer.

4. The traffic sign detection method based on improved YOLOv8n according to claim 1 is characterized in that: The dataset used is TT100K.

5. The traffic sign detection method based on improved YOLOv8n according to claim 1 is characterized in that: The loss functions include WIoUv3.

6. The traffic sign detection method based on improved YOLOv8n according to claim 1, characterized in that: The loss functions also include WIOUv1 and WIOUv2.

7. The traffic sign detection method based on improved YOLOv8n according to claim 1 is characterized in that: The precision, recall, F1 and map value indicators are used to evaluate the improved YOLOv8n model.

8. The traffic sign detection system based on improved YOLOv8n is characterized by: include: a memory for storing instructions executable by a processor; A processor, configured to execute instructions to implement the traffic sign detection method based on the improved YOLOv8n as described in any one of claims 1 to 7.

9. A computer readable medium storing a computer program code, characterized in that: When the computer program code is executed by a processor, the computer program code implements the traffic sign detection method based on improved YOLOv8n as described in any one of claims 1 to 7.

Citation Information

Cited By

  • River channel target identification method and device based on improved YOLOv8n model

    CN119007018A

  • Traffic facility detection method based on improved YOLOV8n

    CN119314125A

  • A Traffic Facility Detection Method Based on Improved YOLOV8n

    CN119314125B

  • Improved lightweight traffic sign detection method

    CN119445533A

  • Radar active composite interference signal identification and parameter measurement method of Yolov8 network based on convolution attention mechanism and rejection loss

    CN119511213A