Road traffic sign detection method, device and equipment and storage medium

By replacing the backbone network with a lightweight network and adding a small object detection layer in the YOLOv5 algorithm framework, the traffic sign dataset was preprocessed and labeled, which solved the problem of insensitivity to small object recognition and improved the accuracy and robustness of traffic sign detection.

CN116403182BActive Publication Date: 2026-04-28WUHAN POLYTECHNIC UNIVERSITY
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN POLYTECHNIC UNIVERSITY
Filing Date
2023-03-13
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies are not sensitive to the recognition of small targets and are difficult to detect traffic signs, especially in complex backgrounds and under changing lighting conditions, making it difficult for autonomous vehicles to accurately identify road traffic signs.

Method used

A road traffic sign detection model was constructed using the YOLOv5 algorithm framework. The backbone network was replaced with a lightweight network and a small object detection layer was added. The traffic sign dataset was preprocessed and labeled. The model was trained and tested to improve detection accuracy through geometric transformation, color transformation and Laplacian sharpening.

Benefits of technology

It improves the detection accuracy of small road traffic signs, reduces memory usage, enhances the model's ability to recognize small targets, and improves the real-time performance and robustness of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116403182B_ABST
    Figure CN116403182B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of target detection, and discloses a road traffic sign detection method, device, equipment and storage medium, the method comprising: acquiring a road traffic sign picture, and obtaining a traffic sign data set; preprocessing the traffic sign data set; labeling the preprocessed traffic sign data set, and dividing the labeled traffic sign data set to obtain a training set and a test set; constructing an initial road traffic sign detection model based on a YOLOv5 algorithm framework, replacing the main network with a lightweight network and adding a small target detection layer; inputting the training set into the model for training to obtain a trained road traffic sign detection model; inputting the test set into the trained road traffic sign detection model for detection and identification to obtain a road traffic sign detection result, which can improve the structure of the initial prediction detection model, reduce the memory, and improve the detection accuracy of small road traffic signs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of target detection technology, and in particular to a method, apparatus, equipment and storage medium for detecting road traffic signs. Background Technology

[0002] In recent years, automotive technology has developed rapidly, and the emerging fields of intelligent driving and even autonomous driving are gaining attention and development. Object detection methods in the field of deep learning have also had opportunities for continuous innovation and improvement. Deep learning is a crucial component in the fields of artificial intelligence and autonomous driving, possessing unparalleled advantages in image recognition, speech recognition, and driving strategy control during the autonomous driving process. Therefore, deep learning will play a significant role in realizing true autonomous driving technology in the future. As the concept of autonomous driving continues to gain popularity and depth, the practical application of deep learning technology in road traffic sign detection and recognition algorithms under real driving environments is crucial to further improve the accuracy, real-time performance, and robustness of these algorithms. However, in real-world driving scenarios, numerous factors affect traffic sign recognition. Autonomous vehicles face many challenges in accurately identifying different traffic signs, such as varying lighting conditions, complex backgrounds, and aging or fading signs. Furthermore, traffic signs are often small targets, and onboard computers are not sensitive to small targets. These factors significantly complicate traffic sign detection tasks. Summary of the Invention

[0003] The main objective of this invention is to provide a method, apparatus, device, and storage medium for detecting road traffic signs, aiming to solve the technical problems of existing technologies being insensitive to the identification of small targets and having great difficulty in detecting traffic signs.

[0004] To achieve the above objectives, the present invention provides a method for detecting road traffic signs, the method comprising the following steps:

[0005] Obtain images of road traffic signs and generate a traffic sign dataset based on these images;

[0006] The traffic sign dataset is preprocessed to obtain a preprocessed traffic sign dataset;

[0007] The preprocessed traffic sign dataset is labeled, and the labeled traffic sign dataset is divided to obtain a training set and a test set;

[0008] An initial road traffic sign detection model is constructed based on the YOLOv5 algorithm framework. The backbone network in the initial road traffic sign detection model is replaced with a lightweight network, and a small target detection layer is added to the initial road traffic sign detection model to obtain the modified road traffic sign detection model.

[0009] The training set is input into the modified road traffic sign detection model for training to obtain the trained road traffic sign detection model.

[0010] The test set is input into the trained road traffic sign detection model for detection and recognition, and the road traffic sign detection results are obtained.

[0011] Optionally, the preprocessing of the traffic sign dataset to obtain a preprocessed traffic sign dataset includes:

[0012] The traffic sign dataset is augmented by geometric transformation and color transformation operations to obtain an augmented traffic sign dataset. The geometric transformation operations include at least one of flipping, rotating, cropping, deforming, scaling, adding noise, and blurring. The color transformation operations include at least one of color transformation, erasing, and filling.

[0013] The augmented traffic sign dataset was smoothed.

[0014] The images in the smoothed traffic sign dataset are then subjected to Laplacian sharpening to obtain the preprocessed traffic sign dataset.

[0015] Optionally, the step of performing Laplacian sharpening on the images in the smoothed traffic sign dataset to obtain a preprocessed traffic sign dataset includes:

[0016] The images in the smoothed traffic sign dataset are normalized to obtain the original images;

[0017] The target Laplacian filter is obtained based on the original image;

[0018] The original image is subjected to Fourier transform, and the original image after Fourier transform is subjected to frequency domain Laplace filtering through the target Laplace filter to obtain a spatial domain Laplace image.

[0019] The spatial Laplacian plot is superimposed on the original image to obtain the sharpened traffic sign dataset.

[0020] The sharpened traffic sign dataset is used as the preprocessed traffic sign dataset.

[0021] Optionally, obtaining the target Laplacian filter based on the original image includes:

[0022] Obtain the spatial Laplacian operator of the original image;

[0023] The initial Laplace filter in the corresponding frequency domain is obtained based on the spatial Laplace operator.

[0024] The size of the initial Laplacian filter is determined based on the size data of the original image;

[0025] The target Laplace filter is obtained based on the size of the initial Laplace filter.

[0026] Optionally, the step of labeling the preprocessed traffic sign dataset and dividing the labeled traffic sign dataset into training and testing sets includes:

[0027] The images in the preprocessed traffic sign dataset are labeled one by one using a Python image annotation plugin to generate corresponding labels.

[0028] Save the labeled images in order to obtain the labeled traffic sign dataset;

[0029] The labeled traffic sign dataset is divided into a training set and a test set using random classification codes.

[0030] Optionally, the step of inputting the training set into the modified road traffic sign detection model for training to obtain the trained road traffic sign detection model includes:

[0031] The training set is input into the modified road traffic sign detection model for training to obtain a trained weight matrix;

[0032] The optimal weight matrix is ​​obtained from the trained weight matrix, and the optimal weight matrix is ​​input into the modified road traffic sign detection model to obtain the trained road traffic sign detection model.

[0033] Optionally, obtaining road traffic sign images and obtaining a traffic sign dataset based on the road traffic sign images includes:

[0034] By using cameras to capture video and images of a preset number of target locations, videos and images containing road traffic signs are obtained.

[0035] Keyframes are extracted from the video at preset intervals to obtain extracted images;

[0036] The extracted images are mixed with the images containing road traffic signs to obtain a traffic sign dataset.

[0037] Furthermore, to achieve the above objectives, the present invention also proposes a road traffic sign detection device, the road traffic sign detection device comprising:

[0038] The acquisition module is used to acquire road traffic sign images and obtain a traffic sign dataset based on the road traffic sign images;

[0039] The processing module is used to preprocess the traffic sign dataset to obtain a preprocessed traffic sign dataset.

[0040] The partitioning module is used to label the preprocessed traffic sign dataset and partition the labeled traffic sign dataset to obtain a training set and a test set.

[0041] The module is used to build an initial road traffic sign detection model based on the YOLOv5 algorithm framework. The backbone network in the initial road traffic sign detection model is replaced with a lightweight network and a small target detection layer is added to the initial road traffic sign detection model to obtain the modified road traffic sign detection model.

[0042] The training module is used to input the training set into the modified road traffic sign detection model for training, so as to obtain the trained road traffic sign detection model.

[0043] The detection module is used to input the test set into the trained road traffic sign detection model for detection and recognition, and to obtain the road traffic sign detection results.

[0044] In addition, to achieve the above objectives, the present invention also proposes a road traffic sign detection device, which includes: a memory, a processor, and a road traffic sign detection program stored in the memory and executable on the processor, wherein the road traffic sign detection program is configured to implement the steps of the road traffic sign detection method described above.

[0045] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a road traffic sign detection program, which, when executed by a processor, implements the steps of the road traffic sign detection method described above.

[0046] This invention acquires road traffic sign images and obtains a traffic sign dataset; preprocesses the traffic sign dataset; labels the preprocessed traffic sign dataset and divides it into training and testing sets; constructs an initial road traffic sign detection model based on the YOLOv5 algorithm framework, replacing the backbone network of the initial road traffic sign detection model with a lightweight network and adding a small target detection layer to the initial road traffic sign detection model; inputs the training set into the modified road traffic sign detection model for training, obtaining a trained road traffic sign detection model; inputs the test set into the trained road traffic sign detection model for detection and recognition, obtaining road traffic sign detection results. By improving the structure of the initial prediction detection model, this invention solves the technical problems of insensitivity to small target recognition and high difficulty in traffic sign detection in existing technologies, reduces memory usage, and improves the detection accuracy of small road traffic signs. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the structure of a road traffic sign detection device in the hardware operating environment of the embodiment of the present invention;

[0048] Figure 2 This is a flowchart illustrating the first embodiment of the road traffic sign detection method of the present invention;

[0049] Figure 3 This is a schematic diagram of the overall process in one embodiment of the road traffic sign detection method of the present invention;

[0050] Figure 4 This is a flowchart illustrating the second embodiment of the road traffic sign detection method of the present invention;

[0051] Figure 5a This is the original image in the second embodiment of the road traffic sign detection method of the present invention;

[0052] Figure 5b This is the result of the Laplace sharpening operation in the second embodiment of the road traffic sign detection method of the present invention.

[0053] Figure 6 This is a flowchart illustrating the third embodiment of the road traffic sign detection method of the present invention;

[0054] Figure 7 This is a structural block diagram of the first embodiment of the road traffic sign detection device of the present invention.

[0055] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0056] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0057] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of a road traffic sign detection device in the hardware operating environment of an embodiment of the present invention.

[0058] like Figure 1 As shown, the road traffic sign detection device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk storage device. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0059] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on road traffic sign detection equipment, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0060] like Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a road traffic sign detection program.

[0061] exist Figure 1 In the road traffic sign detection device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the road traffic sign detection device of the present invention can be set in the road traffic sign detection device. The road traffic sign detection device calls the road traffic sign detection program stored in the memory 1005 through the processor 1001 and executes the road traffic sign detection method provided in the embodiment of the present invention.

[0062] This invention provides a method for detecting road traffic signs, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the road traffic sign detection method of the present invention.

[0063] In this embodiment, the road traffic sign detection method includes the following steps:

[0064] Step S10: Obtain road traffic sign images and obtain a traffic sign dataset based on the road traffic sign images.

[0065] It should be noted that road traffic signs are facilities that use graphic symbols, colors, and text to convey specific information to traffic participants and are used to manage traffic and ensure safety. The road traffic sign images are obtained by taking videos containing road traffic signs at a selected preset number of locations and extracting keyframes from the videos.

[0066] It is understood that a dataset is a collection of data samples, and the traffic sign dataset is composed of images of road traffic signs.

[0067] Furthermore, in order to obtain the dataset, step S10 includes: capturing videos and images of a preset number of target locations using a camera to obtain videos and images containing road traffic signs; extracting keyframes from the videos at preset intervals to obtain extracted images; and mixing the extracted images with the images containing road traffic signs to obtain a traffic sign dataset.

[0068] It should be noted that the preset quantity can be 3, 4, 5, etc., and this embodiment does not impose a specific limitation on it. The target location is a location with traffic signs.

[0069] It is understood that videos and images of traffic signs at the target location are captured separately, and keyframes are extracted from the videos at preset intervals. Images containing traffic signs are then extracted and mixed with separately captured images containing road traffic signs to create a traffic sign dataset. The preset intervals can be 1 second, 2 seconds, etc., and this embodiment does not impose specific limitations on them.

[0070] Step S20: Preprocess the traffic sign dataset to obtain a preprocessed traffic sign dataset.

[0071] It should be noted that the preprocessing includes dataset augmentation, smoothing, and sharpening to enhance the edges of the image, making the image clearer and improving the accuracy of model detection.

[0072] Understandably, since machine learning requires learning from a large number of image samples, the traffic sign dataset is augmented to obtain more dataset images.

[0073] In a specific implementation, augmenting the traffic sign dataset involves cropping, rotating, deforming, adjusting brightness, mirroring, and adding Gaussian noise to the original images, and then incorporating the processed images into the traffic sign dataset.

[0074] It is understandable that the images in the dataset may contain large blank or useless areas, so it is necessary to crop the images in the dataset to a set size.

[0075] Step S30: Label the preprocessed traffic sign dataset and divide the labeled traffic sign dataset to obtain a training set and a test set.

[0076] It should be noted that the preprocessed traffic sign dataset was annotated using a Python image annotation plugin, resulting in the annotated traffic sign dataset.

[0077] It is understandable that the labeled traffic sign dataset is divided into training and testing sets according to a preset ratio, such as 7:3, 8:2, etc. This embodiment does not impose specific restrictions on this.

[0078] Step S40: Construct an initial road traffic sign detection model based on the YOLOv5 algorithm framework, replace the backbone network in the initial road traffic sign detection model with a lightweight network, and add a small target detection layer to the initial road traffic sign detection model to obtain the modified road traffic sign detection model.

[0079] It should be noted that the initial road traffic sign detection model includes an input layer, a backbone network, a neck network, and a prediction layer.

[0080] Understandably, replacing the backbone network in the initial road traffic sign detection model with a lightweight network reduces memory usage and achieves an optimal balance between speed and accuracy. One reason why the initial road traffic sign detection model performs poorly in small target detection is because the small target samples are small. However, the initial road traffic sign detection model based on the YOLOv5 algorithm has a relatively large downsampling factor, making it difficult for deeper feature maps to learn the feature information of small targets. Therefore, it is proposed to add a small target detection layer to concatenate the shallow and deep feature maps before detection. Adding a small target detection layer allows the network to focus more on the detection of small targets, thus improving the detection performance.

[0081] In the specific implementation, the dataset is placed in the project folder, and the train.py file in the project folder is clicked to run a trial. Then, the shuffle module is added to the project folder, the configuration file is modified, and it is added to the backbone network to replace the backbone network with a lightweight network (shuffle-net). The small target detection layer is added by modifying the content of the yaml file under the initial road traffic sign detection model and changing the anchor and head code.

[0082] Step S50: Input the training set into the modified road traffic sign detection model for training to obtain the trained road traffic sign detection model.

[0083] It is understandable that the training set is input into the modified road traffic sign detection model for training to obtain the optimal weight matrix. The parameters of the modified road traffic sign detection model are then updated using the optimal weight matrix to obtain the trained road traffic sign detection model.

[0084] Furthermore, in order to train the model, step S50 includes: inputting the training set into the modified road traffic sign detection model for training to obtain a trained weight matrix; obtaining the optimal weight matrix from the trained weight matrix and inputting the optimal weight matrix into the modified road traffic sign detection model to obtain a trained road traffic sign detection model.

[0085] Understandably, the initial road traffic sign detection model is trained using a training set to obtain a trained weight matrix. The trained weight matrix is ​​then filtered to obtain the optimal weight matrix. The parameters of the modified road traffic sign detection model are then updated using the optimal weight matrix to obtain the trained road traffic sign detection model.

[0086] Step S60: Input the test set into the trained road traffic sign detection model for detection and recognition, and obtain the road traffic sign detection results.

[0087] It is understandable that the trained road traffic sign detection model is used to detect and identify the test set of road traffic signs.

[0088] like Figure 3 As shown, Figure 3This is a schematic diagram of the overall process of the road traffic sign detection method in this embodiment. First, images are captured and compiled into a set. Geometric transformation, color transformation, and Laplacian sharpening are then performed to obtain an image set. The image set is labeled and divided to obtain a dataset. A network model is built. The backbone network is replaced with a lightweight network (shuffle-net) and a small object detection layer is added to obtain an improved network. The road traffic sign model is trained and then tested.

[0089] This embodiment acquires road traffic sign images and obtains a traffic sign dataset; preprocesses the traffic sign dataset; labels the preprocessed traffic sign dataset and divides it into training and testing sets; constructs an initial road traffic sign detection model based on the YOLOv5 algorithm framework, replaces the backbone network in the initial road traffic sign detection model with a lightweight network, and adds a small target detection layer to the initial road traffic sign detection model; inputs the training set into the modified road traffic sign detection model for training, obtaining a trained road traffic sign detection model; inputs the test set into the trained road traffic sign detection model for detection and recognition, obtaining road traffic sign detection results. By improving the structure of the initial road traffic sign detection model, the technical problems of insensitivity to small target recognition and high difficulty in traffic sign detection in existing technologies can be solved, memory usage can be reduced, and the detection accuracy of small road traffic signs can be improved.

[0090] refer to Figure 4 , Figure 4 This is a flowchart illustrating the second embodiment of the road traffic sign detection method of the present invention.

[0091] Based on the first embodiment described above, step S20 in the road traffic sign detection method of this embodiment includes:

[0092] Step S201: Expand the traffic sign dataset by geometric transformation and color transformation operations to obtain the expanded traffic sign dataset. The geometric transformation operation includes at least one of flipping, rotating, cropping, deforming, scaling, adding noise, and blurring. The color transformation operation includes at least one of color transformation, erasing, and filling.

[0093] It should be noted that, since machine learning requires learning from a large number of image samples, the traffic sign dataset was augmented to obtain more dataset images.

[0094] It is understood that the data augmentation includes geometric transformation and color transformation operations. The geometric transformation operations include flipping, rotating, cropping, deforming, scaling, adding noise, and blurring. The color transformation operations include color transformation, erasing, and filling. Flipping includes horizontal flipping and vertical flipping. Adding noise is adding Gaussian noise, which can improve the robustness and generalization ability of the model.

[0095] Understandably, since the original image has a very high pixel size, it can be cropped into 2×2 images, which increases the amount of data while improving the model's ability to detect small targets.

[0096] Step S202: Smooth the augmented traffic sign dataset.

[0097] It should be noted that the smoothing process eliminates noise, reduces interference, and removes random noise in the image to achieve a smoothing effect, making the image brightness change gradually, reducing abrupt gradients, and improving image quality.

[0098] Step S203: Perform Laplacian sharpening on the images in the smoothed traffic sign dataset to obtain the preprocessed traffic sign dataset.

[0099] It should be noted that the main purpose of sharpening is to highlight the transitions in grayscale. Image differentiation can enhance edges and other abrupt changes (such as noise) while weakening areas where grayscale changes are slow.

[0100] It is understood that the Laplacian sharpening is to superimpose the high-frequency (detail) components of the Laplacian filter onto the original image, making the image edge contours clearer.

[0101] Furthermore, to make the image edge contours clearer, step S203 includes: normalizing the images in the smoothed traffic sign dataset to obtain the original image; obtaining a target Laplacian filter based on the original image; performing a Fourier transform on the original image, and then performing a frequency domain Laplacian filter on the Fourier-transformed original image using the target Laplacian filter to obtain a spatial domain Laplacian image; superimposing the spatial domain Laplacian image with the original image to obtain a sharpened traffic sign dataset; and using the sharpened traffic sign dataset as the preprocessed traffic sign dataset.

[0102] It should be noted that image normalization refers to the process of performing a series of standard processing transformations on an image to transform it into a fixed standard form. After undergoing some processing or attacks, the original image can be obtained into multiple copies of the image. These copies can be obtained into a standard image of the same form after undergoing image normalization processing with the same parameters.

[0103] In its specific implementation, the target Laplace filter is as follows: Equation 1:

[0104] H(u, v) = -4π 2 [(uP / 2) 2 +(vQ / 2) 2 ]=-4π 2 D(u, v) (Equation 1)

[0105] Where H is the Laplacian filter, u and v are frequency variables, u = 0, 1, 2, ..., M-1, v = 0, 1, 2, ..., N-1, M and N are the dimensions of the original image f, P and Q are the dimensions of the initial Laplacian filter, generally P = 2M and Q = 2N.

[0106] The original image f is subjected to Fourier transform, and the original image after Fourier transform is subjected to frequency domain Laplace filtering through the target Laplace filter H. An inverse transform is then performed to obtain the spatial domain Laplace plot, as shown in Equation 2 below:

[0107]

[0108] Where H(u,v) is the target Laplacian filter, and F(u,v) is the Fourier transform of the original image f(x,y).

[0109] The spatial Laplacian plot is overlaid with the original image to obtain the sharpened traffic sign dataset, as shown in Equation 3 below:

[0110]

[0111] Where g is the output, f is the original image, and c is the coefficient, representing the detail weight.

[0112] Understandably, because Since negative values ​​exist, we take c = -1 to sharpen the original image f. Because the Laplacian filter result has two types of contour details, black and white, this is mainly to strengthen weak edges and weaken strong edges, making the sharpened image look more natural and more suitable for human eye observation.

[0113] Further, obtaining the target Laplacian filter based on the original image includes: obtaining the spatial domain Laplacian operator of the original image; obtaining the initial Laplacian filter in the corresponding frequency domain based on the spatial domain Laplacian operator; determining the size of the initial Laplacian filter based on the size data of the original image; and obtaining the target Laplacian filter based on the size of the initial Laplacian filter.

[0114] It should be noted that by taking the second derivative of the original image f(x,y), the spatial Laplacian operator is obtained, as shown in Equation 4 below:

[0115]

[0116] It is understood that obtaining the corresponding initial Laplace filter in the frequency domain based on the spatial Laplace operator is equivalent to deriving the corresponding initial Laplace filter in the frequency domain using the differential property of the Fourier transform. The initial Laplace filter is shown in Equation 5 below:

[0117] H(u, v) = -4π 2 (u 2 +v 2 (Equation 5)

[0118] Where H is the Laplacian filter, u and v are frequency variables, u = 0, 1, 2, ..., M-1, v = 0, 1, 2, ..., N-1, and M and N are the dimensions of the original image f.

[0119] As shown in Figure 5, Figure 5 is a before-and-after comparison diagram of the Laplacian sharpening operation in the road traffic sign detection method of this embodiment. Figure 5a This is the original image. Figure 5b This is the image after Laplacian sharpening. The image after Laplacian sharpening is clearer than the original image.

[0120] This embodiment augments the traffic sign dataset using geometric and color transformation operations to obtain an augmented traffic sign dataset. The augmented dataset is then smoothed. Finally, the images in the smoothed traffic sign dataset undergo Laplacian sharpening to obtain a preprocessed traffic sign dataset. These methods augment the dataset and make the image edges clearer, thereby improving the accuracy of the detection model.

[0121] refer to Figure 6 , Figure 6 This is a flowchart illustrating the third embodiment of the road traffic sign detection method of the present invention.

[0122] Based on the first embodiment described above, step S30 in the road traffic sign detection method of this embodiment includes:

[0123] Step S301: Label each image in the preprocessed traffic sign dataset using a Python image annotation plugin to generate corresponding labels.

[0124] It should be noted that Python is a cross-platform computer programming language, an alternative to ABC languages, and an object-oriented, dynamically typed language. It was originally designed for writing automation scripts, but with continuous updates and the addition of new features, it is increasingly used for the development of independent, large-scale projects.

[0125] It is understandable that the image annotation plugin, namely labelme, is a Python-based software that can be used to annotate data, and it is convenient, simple and fast to use.

[0126] Step S302: Save the labeled labels and images in order to obtain the labeled traffic sign dataset.

[0127] Understandably, the labeled images and their corresponding pictures are saved in order to ensure a one-to-one correspondence between the labels and images, thus obtaining the labeled traffic sign dataset.

[0128] Step S303: Divide the labeled traffic sign dataset into a training set and a test set using random classification codes.

[0129] It should be noted that the random classification code can be a Naive Bayes classifier, decision tree, K-nearest neighbor classification algorithm, support vector machine, neural network and rule-based classification algorithm, etc., and this embodiment does not impose specific restrictions on it.

[0130] It is understood that the labeled traffic sign dataset is divided into training set and test set according to a preset ratio by random classification code. The preset ratio can be 7:3, 8:2, etc., and this embodiment does not impose specific restrictions on this.

[0131] This embodiment annotates each image in the preprocessed traffic sign dataset using a Python image annotation plugin, generating corresponding labels. The annotated labels and images are then saved sequentially to obtain the annotated traffic sign dataset. A random classification code is used to divide the annotated traffic sign dataset into a training set and a test set. This method, by labeling the dataset and dividing it into training and test sets, facilitates training and testing, improving the model's detection accuracy.

[0132] Reference Figure 7 , Figure 7 This is a structural block diagram of the first embodiment of the road traffic sign detection device of the present invention.

[0133] like Figure 7 As shown, the road traffic sign detection device proposed in this embodiment of the invention includes:

[0134] The acquisition module 10 is used to acquire road traffic sign images and obtain a traffic sign dataset based on the road traffic sign images;

[0135] Processing module 20 is used to preprocess the traffic sign dataset to obtain a preprocessed traffic sign dataset;

[0136] The partitioning module 30 is used to label the preprocessed traffic sign dataset and partition the labeled traffic sign dataset to obtain a training set and a test set.

[0137] Module 40 is used to build an initial road traffic sign detection model based on the YOLOv5 algorithm framework, replace the backbone network in the initial road traffic sign detection model with a lightweight network, and add a small target detection layer to the initial road traffic sign detection model to obtain a modified road traffic sign detection model.

[0138] Training module 50 is used to input the training set into the modified road traffic sign detection model for training, so as to obtain the trained road traffic sign detection model;

[0139] The detection module 60 is used to input the test set into the trained road traffic sign detection model for detection and recognition, and to obtain the road traffic sign detection results.

[0140] This embodiment acquires road traffic sign images and obtains a traffic sign dataset; preprocesses the traffic sign dataset; labels the preprocessed traffic sign dataset and divides it into training and testing sets; constructs an initial road traffic sign detection model based on the YOLOv5 algorithm framework, replaces the backbone network in the initial road traffic sign detection model with a lightweight network, and adds a small target detection layer to the initial road traffic sign detection model; inputs the training set into the modified road traffic sign detection model for training, obtaining a trained road traffic sign detection model; inputs the test set into the trained road traffic sign detection model for detection and recognition, obtaining road traffic sign detection results. By improving the structure of the initial road traffic sign detection model, the technical problems of insensitivity to small target recognition and high difficulty in traffic sign detection in existing technologies can be solved, memory usage can be reduced, and the detection accuracy of small road traffic signs can be improved.

[0141] In addition, to achieve the above objectives, the present invention also proposes a road traffic sign detection device, which includes: a memory, a processor, and a road traffic sign detection program stored in the memory and executable on the processor, wherein the road traffic sign detection program is configured to implement the steps of the road traffic sign detection method described above.

[0142] Since this road traffic sign detection equipment adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.

[0143] Furthermore, this embodiment of the invention also proposes a storage medium storing a road traffic sign detection program, which, when executed by a processor, implements the steps of the road traffic sign detection method described above.

[0144] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.

[0145] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.

[0146] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.

[0147] In addition, for technical details not described in detail in this embodiment, please refer to the road traffic sign detection method provided in any embodiment of the present invention, which will not be repeated here.

[0148] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0149] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0150] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0151] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A method for detecting road traffic signs, characterized in that, The method includes: Obtain images of road traffic signs and generate a traffic sign dataset based on these images; The traffic sign dataset is preprocessed to obtain a preprocessed traffic sign dataset; The preprocessed traffic sign dataset is labeled, and the labeled traffic sign dataset is divided to obtain a training set and a test set; An initial road traffic sign detection model is constructed based on the YOLOv5 algorithm framework. The backbone network in the initial road traffic sign detection model is replaced with a lightweight network, and a small target detection layer is added to the initial road traffic sign detection model to obtain the modified road traffic sign detection model. The training set is input into the modified road traffic sign detection model for training to obtain the trained road traffic sign detection model. The test set is input into the trained road traffic sign detection model for detection and recognition, and the road traffic sign detection results are obtained. The preprocessing of the traffic sign dataset to obtain a preprocessed traffic sign dataset includes: The traffic sign dataset is augmented by geometric transformation and color transformation operations to obtain an augmented traffic sign dataset. The geometric transformation operations include at least one of flipping, rotating, cropping, deforming, scaling, adding noise, and blurring. The color transformation operations include at least one of color transformation, erasing, and filling. The augmented traffic sign dataset was smoothed. The images in the smoothed traffic sign dataset are subjected to Laplacian sharpening to obtain the preprocessed traffic sign dataset. The step involves performing Laplacian sharpening on the images in the smoothed traffic sign dataset to obtain a preprocessed traffic sign dataset, including: The images in the smoothed traffic sign dataset are normalized to obtain the original images; The target Laplacian filter is obtained based on the original image; The original image is subjected to Fourier transform, and the original image after Fourier transform is subjected to frequency domain Laplace filtering through the target Laplace filter to obtain a spatial domain Laplace image. The spatial Laplacian plot is superimposed on the original image to obtain the sharpened traffic sign dataset. The sharpened traffic sign dataset is used as the preprocessed traffic sign dataset. The step of obtaining the target Laplacian filter based on the original image includes: Obtain the spatial Laplacian operator of the original image; The initial Laplace filter in the corresponding frequency domain is obtained based on the spatial Laplace operator. The size of the initial Laplacian filter is determined based on the size data of the original image; The target Laplace filter is obtained based on the size of the initial Laplace filter.

2. The method as described in claim 1, characterized in that, The process involves labeling the preprocessed traffic sign dataset and then dividing the labeled dataset into training and testing sets, including: The images in the preprocessed traffic sign dataset are labeled one by one using a Python image annotation plugin to generate corresponding labels. Save the labeled images in order to obtain the labeled traffic sign dataset; The labeled traffic sign dataset is divided into a training set and a test set using random classification codes.

3. The method as described in claim 1, characterized in that, The step of inputting the training set into the modified road traffic sign detection model for training, to obtain the trained road traffic sign detection model, includes: The training set is input into the modified road traffic sign detection model for training to obtain a trained weight matrix; The optimal weight matrix is ​​obtained from the trained weight matrix, and the optimal weight matrix is ​​input into the modified road traffic sign detection model to obtain the trained road traffic sign detection model.

4. The method as described in claim 1, characterized in that, The step of obtaining road traffic sign images and obtaining a traffic sign dataset based on the road traffic sign images includes: By using cameras to capture video and images of a preset number of target locations, videos and images containing road traffic signs are obtained. Keyframes are extracted from the video at preset intervals to obtain extracted images; The extracted images are mixed with the images containing road traffic signs to obtain a traffic sign dataset.

5. A road traffic sign detection device, characterized in that, The road traffic sign detection device includes: The acquisition module is used to acquire road traffic sign images and obtain a traffic sign dataset based on the road traffic sign images; The processing module is used to preprocess the traffic sign dataset to obtain a preprocessed traffic sign dataset. The partitioning module is used to label the preprocessed traffic sign dataset and partition the labeled traffic sign dataset to obtain a training set and a test set. The module is used to build an initial road traffic sign detection model based on the YOLOv5 algorithm framework. The backbone network in the initial road traffic sign detection model is replaced with a lightweight network and a small target detection layer is added to the initial road traffic sign detection model to obtain the modified road traffic sign detection model. The training module is used to input the training set into the modified road traffic sign detection model for training, so as to obtain the trained road traffic sign detection model. The detection module is used to input the test set into the trained road traffic sign detection model for detection and recognition, and to obtain the road traffic sign detection results; The processing module is further configured to augment the traffic sign dataset through geometric transformation and color transformation operations to obtain an augmented traffic sign dataset. The geometric transformation operations include at least one of flipping, rotating, cropping, deforming, scaling, adding noise, and blurring, and the color transformation operations include at least one of color transformation, erasing, and filling. The augmented traffic sign dataset is then smoothed. The images in the smoothed traffic sign dataset are then subjected to Laplacian sharpening to obtain a preprocessed traffic sign dataset. The processing module is further configured to normalize the images in the smoothed traffic sign dataset to obtain the original image; obtain a target Laplace filter based on the original image; perform a Fourier transform on the original image, and perform frequency domain Laplace filtering on the Fourier transformed original image through the target Laplace filter to obtain a spatial domain Laplace plot. The processing module is further configured to use the sharpened traffic sign dataset as a preprocessed traffic sign dataset; obtaining the target Laplacian filter based on the original image includes: obtaining the spatial domain Laplacian operator of the original image; obtaining the initial Laplacian filter in the corresponding frequency domain based on the spatial domain Laplacian operator; determining the size of the initial Laplacian filter based on the size data of the original image; and obtaining the target Laplacian filter based on the size of the initial Laplacian filter.

6. A road traffic sign detection device, characterized in that, The road traffic sign detection device includes: a memory, a processor, and a road traffic sign detection program stored in the memory and executable on the processor, the road traffic sign detection program being configured to implement the road traffic sign detection method as described in any one of claims 1 to 4.

7. A storage medium, characterized in that, The storage medium stores a road traffic sign detection program, which, when executed by a processor, implements the road traffic sign detection method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Cigarette automatic detection method based on deep learning in monitoring scene

    CN110390673A

  • Small target detection method and system for improving yolov5 network

    CN114373121A

  • Traffic sign detection method based on improved YOLOv5

    CN115116032A

  • Parking space number identification method and device based on yov5-shufflenetv2 and medium

    CN115424243A