A lightweight traffic sign recognition method, system, device and storage medium based on YOLOv5

By improving the YOLOv5 model structure and combining the CBAM attention module and sub-pixel convolution, the problem of slow traffic sign detection in the existing technology is solved, and lightweight and high-precision traffic sign recognition is achieved.

CN116246248BActive Publication Date: 2025-09-30NANJING UNIV OF INFORMATION SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310045370.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-30
Publication Date
2025-09-30
Estimated Expiration
2043-01-30

AI Technical Summary

Technical Problem

The traffic sign detection algorithm in the existing technology has a large amount of calculation and a slow detection speed, which makes it difficult to meet the real-time detection requirements.

Method used

A lightweight traffic sign recognition method based on YOLOv5 is adopted. By improving the backbone network, feature fusion network, lightweight triangular convolution layer and improved loss function, combined with the CBAM attention module and sub-pixel convolution, the model structure is optimized to reduce the computational complexity and improve the detection accuracy.

Benefits of technology

The accuracy and speed of traffic sign recognition are improved while reducing the amount of calculation, making the model more suitable for real-time detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116246248B_ABST
    Figure CN116246248B_ABST
Patent Text Reader

Abstract

The present invention discloses a lightweight traffic sign recognition method, system, device and storage medium based on YOLOv5, which belongs to the technical field of computer vision target detection. The method comprises the following steps: obtaining a picture to be recognized; inputting the picture to be recognized into a constructed lightweight traffic sign recognition model based on YOLOv5, and recognizing the traffic sign in the picture to be recognized; by improving the recognition model, the present invention enables the model to pay more attention to the recognition of small targets such as traffic signs during the learning process, effectively highlight the important features of the recognition objects, and reduce the amount of calculation while enriching the target feature information, so that the recognition accuracy and running speed of the model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a lightweight traffic sign recognition method, system, device and storage medium based on YOLOv5, belonging to the technical field of computer vision target detection. Background Art

[0002] With the rapid development of visual navigation and artificial intelligence technologies, road condition analysis and real-time detection of traffic signs have become key research areas in computer vision for autonomous driving. Because road conditions are complex during driving, and even subtle issues can have significant consequences, fast and accurate detection of traffic signs is essential.

[0003] Traditional traffic sign detection relies on two main approaches. The first is color-based detection. Traffic signs are primarily red, yellow, and blue, representing prohibitions, warnings, and instructions, respectively. However, color-based detection methods often struggle due to factors like inclement weather. The second is shape-based detection. Traffic signs typically come in three shapes: triangle, square, and circle. However, shape-based detection methods often suffer from detection errors due to sign damage or angle errors.

[0004] With the remarkable performance of deep learning in object detection, many researchers have begun to focus on using deep learning to detect and recognize traffic signs. Current deep learning object detection algorithms primarily include two-stage networks such as Faster-RCNN, Mask-RCNN, and Cascade-RCNN. These algorithms typically generate candidate regions first and then fine-tune bounding box regression. While traditional two-stage networks offer higher detection accuracy than single-stage networks, they are computationally intensive and slow, making them difficult to meet the requirements for real-time traffic sign detection. Summary of the Invention

[0005] The purpose of the present invention is to provide a lightweight traffic sign recognition method, system, device and storage medium based on YOLOv5 to solve the problem of slow detection speed in the prior art.

[0006] To achieve the above objectives, the present invention is implemented by adopting the following technical solutions:

[0007] In a first aspect, the present invention provides a lightweight traffic sign recognition method based on YOLOv5, comprising:

[0008] Get the image to be identified;

[0009] The image to be identified is input into the constructed lightweight traffic sign recognition model based on YOLOv5 to identify the traffic signs in the image to be identified.

[0010] In combination with the first aspect, the method further includes changing the size of the image to be identified to 1280×1280×3 to better identify traffic targets.

[0011] In combination with the first aspect, further, the YOLOv5-based lightweight traffic sign recognition model includes a backbone network, a feature fusion network, a lightweight triangular convolution layer, a detection layer, and a loss function;

[0012] The backbone network is used to extract features of the image to be identified;

[0013] The feature fusion network is used to perform feature fusion on the feature map output by the backbone network;

[0014] The lightweight triangular convolution layer is used to improve the resolution of the feature map output by the feature fusion network;

[0015] The detection layer is used to identify traffic signs in the feature map output by the lightweight triangular convolution layer;

[0016] The loss function is used to improve the recognition accuracy of the model.

[0017] In combination with the first aspect, further, the backbone network includes CSPDarknet, which preliminarily extracts the features of the image to be identified through a multi-layer convolutional network and a cross-layer fusion network.

[0018] In combination with the first aspect, further, the feature fusion network includes an attention module, the attention module includes a spatial attention module and a channel attention module in series, the channel attention module is executed first, and then the spatial attention module is executed;

[0019] The channel attention module performs global average pooling and maximum pooling based on height and width on the input feature map to obtain two feature matrices containing global feature information. The feature matrices are respectively fed into a two-layer convolutional neural network, the output features are summed, and then activated by a Sigmoid function. Finally, the channel attention weight is generated and output;

[0020] The spatial attention module takes the channel attention weight as the input feature map, first passes through a network layer of global maximum pooling and global average pooling based on the number of channels, reduces the dimension of the input feature map to 1 channel, and obtains a 1-dimensional feature map. The input feature map and the 1-dimensional feature map are spliced ​​based on the channel, and then pass through a convolution layer and a Sigmoid function activation operation, and finally generates the spatial attention weight and outputs it.

[0021] In combination with the first aspect, further, the lightweight triangular convolution layer includes sub-pixel convolution, which generates three clear feature maps of different sizes with high resolution through sub-pixel convolution, thereby enriching the image feature information again before detection.

[0022] In combination with the first aspect, further, the loss function is an improved CIoU, which is expressed as:

[0023]

[0024] Among them, IoU is the intersection over union ratio, α is the weight coefficient, and ρ is the sum of b and b gt The Euclidean distance between them, b is the parameter of the predicted center coordinates, b gt is the parameter of the center of the true target bounding box, d is the diagonal length of the minimum circumscribed rectangle of the predicted box and the true target bounding box, and ν is used to measure the consistency of the aspect ratio.

[0025] In a second aspect, the present invention further provides a lightweight traffic sign recognition system based on YOLOv5, comprising:

[0026] Image acquisition module: used to obtain the image to be identified;

[0027] Traffic sign recognition module: This module is used to input the image to be recognized into the constructed lightweight traffic sign recognition model based on YOLOv5 to identify the traffic signs in the image to be recognized.

[0028] In a third aspect, the present invention further provides a lightweight traffic sign recognition device based on YOLOv5, comprising a processor and a storage medium;

[0029] The storage medium is used to store instructions;

[0030] The processor is configured to operate according to the instructions to execute the steps of the method according to any one of the first aspects.

[0031] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.

[0032] Compared with the prior art, the present invention has the following beneficial effects:

[0033] The present invention provides a lightweight traffic sign recognition method, system, device and storage medium based on YOLOv5. By improving the recognition model, the model can pay more attention to the recognition of small targets such as traffic signs during the learning process, and effectively highlight the important features of the recognition objects. It also reduces the amount of calculation while enriching the target feature information, thereby improving the recognition accuracy and running speed of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 This is one of the flow charts of a lightweight traffic sign recognition method based on YOLOv5 provided in an embodiment of the present invention;

[0035] Figure 2 This is the second flowchart of a lightweight traffic sign recognition method based on YOLOv5 provided in an embodiment of the present invention;

[0036] Figure 3 This is a structural diagram of the attention mechanism provided by an embodiment of the present invention;

[0037] Figure 4 is a diagram of the sub-pixel convolution process provided by an embodiment of the present invention;

[0038] Figure 5 This is a diagram of the lightweight triangular convolutional layer structure provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present invention.

[0040] Example 1

[0041] like Figure 1 As shown, an embodiment of the present invention provides a lightweight traffic sign recognition method based on YOLOv5, comprising the following steps:

[0042] S1. Obtain the image to be identified.

[0043] Get the image to be recognized and resize it to 1280×1280×3 to better detect small objects such as traffic signs.

[0044] S2. Input the image to be recognized into the constructed lightweight traffic sign recognition model based on YOLOv5 to identify the traffic signs in the image to be recognized.

[0045] The image to be recognized obtained in step S1 is input into the constructed lightweight traffic sign recognition model based on YOLOv5, such as Figure 2 As shown, in this model, the operation process is as follows:

[0046] 1) First, input the image (picture to be identified) into the backbone network for feature extraction.

[0047] In this embodiment, CSPDarknet is used as the backbone network, and the image features are preliminarily extracted through a multi-layer convolutional network and a cross-layer fusion network.

[0048] 2) Attention mechanism: The feature map generated by the backbone network is input into the feature fusion network to further extract the features of the image. This method replaces some redundant convolution blocks in the original network with attention modules, which greatly reduces the amount of calculation. Figure 3 The model (shown in Figure 2) mainly consists of two parts: the spatial attention module (SAM) and the channel attention module (CAM):

[0049] 2.1) Using Channel Attention Module (CAM):

[0050] The channel attention module (CAM) performs global average pooling and maximum pooling based on height and width on the input feature map F, ultimately generating two feature matrices (1×1×C) containing global feature information. These feature matrices are then fed into a two-layer convolutional neural network. The output features are summed and activated with a sigmoid function to generate channel attention weights.

[0051] 2.2) Using Spatial Attention Module (SAM):

[0052] The spatial attention module (SAM) takes the feature weights output by the CAM as the input feature map. It first passes through a network layer of global maximum pooling and global average pooling based on the number of channels to reduce the dimension of the feature map to 1 channel and obtain a feature map (H×W×1). The two feature maps are then concatenated based on the channel, and then pass through a convolutional layer and a Sigmoid function activation operation to finally generate the spatial attention weights.

[0053] 2.3) CBAM Attention Mechanism:

[0054] This method adopts a serial combination of channel attention module and spatial attention module, first executing the channel attention module and then executing the spatial attention module, which can better retain the feature information of the attention target before output.

[0055] The CBAM attention mechanism uses very few parameters and computations in deep learning, while some C3 modules in the feature fusion network (Neck) require very large amounts of computation and parameters. Therefore, replacing some C3 modules in the feature fusion network in YOLOv5 with the CBAM attention module can significantly reduce the number of parameters and computations, while highlighting more target feature information without losing much semantic information. Furthermore, adding the CBAM attention mechanism to the feature fusion network can further enhance the target channel and spatial feature information before detection.

[0056] 3) Light triangular convolution (LTC):

[0057] Considering that YOLOv5 selects three feature maps of different scales from the PAN pyramid in the feature fusion network (Neck) and enters them into the prediction layer for convolution and prediction operations. However, the PAN pyramid is structured from bottom to top, and as the number of layers increases, semantic information gradually decreases compared to positional information. Therefore, to improve detection accuracy, this method adds a lightweight triangular convolution (LTC) layer before the detection layer (Prediction) of the YOLOv5 network, that is, after the last PAN layer.

[0058] In this structure, sub-pixel convolution is introduced to replace the traditional convolution layer as the main convolution link. Sub-pixel (Sub-pixel) is actually the refinement between two adjacent pixels in the image. Similarly, sub-pixel convolution (Sub-pixelConvolution) is actually a simplified form of traditional convolution. A low-resolution image is converted into a high-resolution feature map through convolution and multi-channel reorganization. First, the input low-resolution image passes through a series of hidden layers (Hidden layers), that is, a series of 1×1 convolution and pooling operations. It is mainly to extract the features of the image and increase the number of channels of the image. Here, a parameter is introduced as the upsampling ratio r. The number of channels of the input image increases to r after the hidden layer operation. 2 Then the main function of the sub-pixel convolution layer is to transform this r 2 The feature maps of the channels are recombined in pixel order into a new W×r, H×r upsampled image result.

[0059] Sub-pixel interpolation involves thinning the distance between adjacent pixels in an image. The input value is typically divided into halves or quarters. This means each pixel is divided into smaller units, and an interpolation algorithm is applied to these smaller units. If a quarter is chosen, each pixel is interpolated three times horizontally and vertically, essentially magnifying one pixel into four. Sub-pixel interpolation typically increases the pixel value of the image while significantly improving resolution.

[0060] Similarly, sub-pixel convolution is actually a simplified form of traditional convolution, which converts a low-resolution image into a high-resolution feature map through convolution and multi-channel recombination. Figure 4The figure shows the sub-pixel convolution process. First, the input low-resolution image passes through a series of hidden layers, that is, a series of 1×1 convolution and pooling operations. The main purpose is to extract the image features and increase the number of channels of the image. Here, a parameter called upsampling factor r is introduced. The number of channels of the input image increases to r after the hidden layer operation. 2 Then the main function of the sub-pixel convolution layer is to transform this r 2 The feature maps of the channels are recombined in pixel order into a new W×r, H×r upsampled image result.

[0061] Figure 5 The figure shows the structure of a lightweight triangular convolutional layer. In the figure, P1 is the output feature map of the last layer of the feature fusion network. As the input map of the convolutional layer, sub-pixel convolution and upsampling are performed in two directions respectively to generate a feature map of size P2. The feature map of size P2 is then fused with the feature map of the same size in the shallow network to generate a feature map for detecting medium-sized targets. The feature map obtained by sub-pixel convolution of the upsampled feature map of P1 is then fused with the feature map obtained by sub-pixel convolution of P2. Finally, three feature maps of different sizes (P1, P2, P3) are generated, and the sizes increase in geometric proportion (1:2:4), which are used to detect large, medium, and small targets respectively.

[0062] The lightweight triangular convolution layer proposed in this method mainly replaces the traditional convolution layer with sub-pixel convolution to produce three different sizes of clear feature maps with high resolution, thereby enriching the image feature information again before detection.

[0063] 4) Loss optimization and evaluation:

[0064] The loss function measures the error between the model's predictions and the true values, greatly reflecting the model's stability. In YOLOv5, the loss function consists of three parts: the classification loss (cls_loss), which calculates the consistency between the anchor box and the corresponding calibrated category; the localization loss (box_loss), which calculates the position error between the predicted box and the true box; and the confidence loss (obj_loss), which calculates the network's confidence in the target prediction. This method improves the CIoU Loss loss function, achieving more accurate calculation of target position information in traffic sign detection.

[0065] The intersection over union function calculates the ratio of the intersection and union of two bounding boxes to measure the accuracy of the predicted box, as shown in the following formula:

[0066]

[0067] Among them B and B gt They represent the predicted bounding box and the ground-truth bounding box, respectively. Generally, the higher the IoU value, the more accurate the network's predicted bounding box. However, using the traditional IoU loss function, if two objects do not overlap, the IoU value and gradient are almost zero, failing to reflect the distance between them, making the function inefficient for optimization. To address this, YOLOv5 proposes three methods for improving the loss function: GIoU, DIoU, and CIoU.

[0068] CIoU is an improvement on GIoU and DIoU. It has better convergence speed and fitting effect than the former. It increases the loss of detection box size as well as the loss of length and width, which can make the predicted box more consistent with the true box. It has better convergence speed and fitting effect than the former. The formula is as follows:

[0069]

[0070] αν is added to the function, where α is the weight coefficient and ν is used to measure the consistency of the aspect ratio, and is defined as follows:

[0071]

[0072] This method improves upon CIoU by performing a square root operation on the Euclidean distance in the fraction. During traffic sign recognition, traffic signs of varying sizes appear in the image. As the target becomes larger, the center distance between the detection frame and the ground truth frame also increases. Consequently, when calculating the loss, the loss will be significantly higher than that of small targets, which is detrimental to the loss calculation of small targets. Therefore, by taking the square root, we can reduce the loss weight of large targets, more efficiently calculate the loss, and make the loss function converge faster. The improved loss function is shown below:

[0073]

[0074] To verify the practical effect of the present invention, it was applied to the open source dataset TT100K (China Traffic Sign Dataset) to verify its effectiveness. The experimental results are shown in Tables 1 and 2.

[0075] This method, based on the basic framework of YOLOv5, compresses and stretches the depth and width based on a certain ratio. Depth represents the number of models in a given layer of the network, while width represents the change in the number of channels in a given layer. The baseline network, YOLOv5n, has a depth-to-width ratio of 0.33:0.50. The authors modified the depth-to-width ratio in two ways: stretching the depth and compressing the width to 0.67:0.25; and maintaining the depth unchanged while compressing the width to 0.33:0.25. As the network depth is compressed, the computational effort required to calculate the number of model parameters is reduced, making the model more lightweight.

[0076] At the same time, the CBAM attention mechanism and lightweight triangular convolution layer (LTC) are added to the models of these two scales respectively. Since the author added the CBAM attention mechanism and replaced part of the C3 layer of the feature fusion network, the amount of calculation and parameters were greatly reduced.

[0077] As shown in Table 1 below, we first improved the loss function based on YOLOv5n, finding a 6.1% increase in mAP. This improvement not only improved model convergence but also significantly improved accuracy. Selecting a depth-to-width ratio of 0.33 + 0.25 improved recall (R) compared to the baseline network, but there was no significant change in accuracy. A depth-to-width ratio of 0.67 + 0.25 significantly improved model accuracy. Furthermore, by adding the CBAM and LTC modules, the maximum mean average precision (mAP) reached 90.6%, a 14.5% improvement over the baseline YOLOv5n network.

[0078] Table 1-Performance and ablation results of this method on the TT100K dataset

[0079]

[0080] Table 2 below compares this algorithm with the latest algorithms from other frameworks, including experimental results from Faster-RCNN and FA-SSD. These algorithms are significantly larger in size and parameter count than YOLOv5n, making them difficult to lightweight and inconvenient for embedded systems. However, this algorithm demonstrates superior performance in both accuracy and speed.

[0081] Table 2 - Comparison of the results of this method with other frame detection algorithms

[0082] algorithm MAP (%) Detection speed / FPS Parameter quantity (M) YOLOv5s 79.9 53.9 7.07 YOLOv5n 76.1 90.7 1.85 FASTER-RCNN 62.5 11.7 4.5 FA-SSD 80.2 13.6 1.83 This article 90.6 70.5

[0083] Example 2

[0084] An embodiment of the present invention provides a lightweight traffic sign recognition system based on YOLOv5, including:

[0085] Image acquisition module: used to obtain the image to be identified;

[0086] Traffic sign recognition module: This module is used to input the image to be recognized into the constructed lightweight traffic sign recognition model based on YOLOv5 to identify the traffic signs in the image to be recognized.

[0087] Example 3

[0088] An embodiment of the present invention provides a lightweight traffic sign recognition device based on YOLOv5, including a processor and a storage medium;

[0089] The storage medium is used to store instructions;

[0090] The processor is configured to operate according to the instructions to execute the steps of the following method:

[0091] Get the image to be identified;

[0092] The image to be identified is input into the constructed lightweight traffic sign recognition model based on YOLOv5 to identify the traffic signs in the image to be identified.

[0093] Example 4

[0094] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the following method are implemented:

[0095] Get the image to be identified;

[0096] The image to be identified is input into the constructed lightweight traffic sign recognition model based on YOLOv5 to identify the traffic signs in the image to be identified.

[0097] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0098] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0099] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0100] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0101] The above is only a preferred embodiment of 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. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A lightweight traffic sign recognition method based on YOLOv5, characterized in that: include: Get the image to be identified; Input the image to be recognized into the constructed lightweight traffic sign recognition model based on YOLOv5 to identify the traffic signs in the image to be recognized; The YOLOv5-based lightweight traffic sign recognition model includes a backbone network, a feature fusion network, a lightweight triangular convolution layer, a detection layer, and a loss function; The backbone network is used to extract features of the image to be identified; The feature fusion network is used to perform feature fusion on the feature map output by the backbone network; The lightweight triangular convolution layer is used to improve the resolution of the feature map output by the feature fusion network; The detection layer is used to identify traffic signs in the feature map output by the lightweight triangular convolution layer; The loss function is used to improve the recognition accuracy of the model; After the feature map P1 output by the feature fusion network is input to the lightweight triangular convolution layer, the operations performed by the lightweight triangular convolution layer include: Perform sub-pixel convolution on the feature map P1 to generate a feature map P2 of a different size from the feature map P1. Fuse the feature map P2 with the feature map of the same size in the shallow network to generate the feature map P2 for detecting medium-sized targets. Perform sub-pixel convolution on the feature map P2. After upsampling and sub-pixel convolution of feature map P1, feature fusion is performed with feature map P2 to obtain feature map P3; Through the above steps, feature maps P1, P2, and P3 of different sizes are obtained.

2. A lightweight traffic sign recognition method based on YOLOv5 according to claim 1, characterized in that: The process also includes changing the size of the image to be identified to 1280×1280×3 to better identify traffic targets.

3. A lightweight traffic sign recognition method based on YOLOv5 according to claim 2, characterized in that: The backbone network includes CSPDarknet, which performs preliminary extraction of features of the image to be identified through a multi-layer convolutional network and a cross-layer fusion network.

4. A lightweight traffic sign recognition method based on YOLOv5 according to claim 2, characterized in that: The feature fusion network includes an attention module, which includes a serial spatial attention module and a channel attention module, wherein the channel attention module is executed first and then the spatial attention module; The channel attention module performs global average pooling and maximum pooling based on height and width on the input feature map to obtain two feature matrices containing global feature information. The feature matrices are respectively fed into a two-layer convolutional neural network, the output features are summed, and then activated by a Sigmoid function. Finally, the channel attention weight is generated and output; The spatial attention module takes the channel attention weight as the input feature map, first passes through a network layer of global maximum pooling and global average pooling based on the number of channels, reduces the dimension of the input feature map to 1 channel, and obtains a 1-dimensional feature map. The input feature map and the 1-dimensional feature map are spliced ​​based on the channel, and then pass through a convolution layer and a Sigmoid function activation operation, and finally generates the spatial attention weight and outputs it.

5. A lightweight traffic sign recognition method based on YOLOv5 according to claim 1, characterized in that: The loss function is the improved CIoU, which is expressed as: ; in, IoU is the intersection and union ratio, is the weight coefficient, ρ yes b and b gt The Euclidean distance between b is the parameter of the prediction center coordinate, b gt is the parameter of the center of the ground-truth target bounding box, d is the minimum diagonal length of the bounding rectangle of the predicted box and the true target bounding box, It is used to measure the consistency of aspect ratio.

6. A lightweight traffic sign recognition system based on YOLOv5, characterized in that: include: Image acquisition module: used to obtain the image to be identified; Traffic sign recognition module: This module is used to input the image to be recognized into the constructed lightweight traffic sign recognition model based on YOLOv5 to identify the traffic signs in the image to be recognized. The YOLOv5-based lightweight traffic sign recognition model includes a backbone network, a feature fusion network, a lightweight triangular convolution layer, a detection layer, and a loss function. The backbone network is used to extract features of the image to be identified; The feature fusion network is used to perform feature fusion on the feature map output by the backbone network; The lightweight triangular convolution layer is used to improve the resolution of the feature map output by the feature fusion network; The detection layer is used to identify traffic signs in the feature map output by the lightweight triangular convolution layer; The loss function is used to improve the recognition accuracy of the model; After the feature map P1 output by the feature fusion network is input to the lightweight triangular convolution layer, the operations performed by the lightweight triangular convolution layer include: Perform sub-pixel convolution on the feature map P1 to generate a feature map P2 of a different size from the feature map P1. Fuse the feature map P2 with the feature map of the same size in the shallow network to generate the feature map P2 for detecting medium-sized targets. Perform sub-pixel convolution on the feature map P2. After upsampling and sub-pixel convolution of feature map P1, feature fusion is performed with feature map P2 to obtain feature map P3; Through the above steps, feature maps P1, P2, and P3 of different sizes are obtained.

7. A lightweight traffic sign recognition device based on YOLOv5, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Infrared target detection method based on improved YOLOv3

    CN112949633A

  • Method and device for detecting primitive in architectural plan, equipment and medium

    CN113537026A