Traffic sign detection method and device
By using the nearest neighbor fusion feature pyramid structure of the first-order fully convolutional target detection model in traffic sign detection, the problem of both detection speed and accuracy in the existing technology is solved, and more efficient traffic sign recognition is achieved.
Patent Information
- Application Number
- CN202210261336.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-03-14
AI Technical Summary
It is difficult for the existing technology to balance the speed and accuracy of traffic sign detection. The second-stage network recognition speed is slow and the accuracy of the first-stage network is insufficient.
A first-order fully convolutional target detection model is adopted, and the feature fusion module adopts a nearest neighbor fusion feature pyramid structure to improve detection speed and accuracy through feature extraction, fusion and output modules.
It improves the speed and accuracy of traffic sign detection, provides more reliable feature fusion images, and reduces the frequency of operational errors and traffic accidents.
Smart Images

Figure CN114639087B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent driving technology, and in particular to a traffic sign detection method and device. Background Art
[0002] The development of Advanced Driver Assistant System (ADAS) has improved the safety of vehicle systems and driving efficiency. Traffic Sign Detection and Recognition (TSR) system plays a key role in ADAS. This system can locate and recognize traffic sign images in real environments. TSR system usually processes in two steps: detection and recognition. During the detection process, the purpose is to locate the area containing traffic signs in the scene image. The purpose of recognition is to classify the detected symbols according to the information contained in them.
[0003] Since traffic signs are designed with predetermined colors and shapes, the methods for identifying traffic signs in the prior art can be divided into color-based, shape-based, and machine learning-based methods. The colors of traffic signs usually have strong and obvious contrasting colors. The color-based method refers to the detection through these colors. The main disadvantage of the color-based method is that the color is not always reliable due to changes in weather conditions, changes in light direction, differences between day and night, etc., because these conditions often change in outdoor scenes. Traffic signs are always designed in specific shapes (circles, triangles, rectangles, etc.), so shape information is also very important for traffic sign detection. Most color-based methods consider geometric information while considering color information. Due to the rapid development of deep learning, researchers have also tried to add deep learning to intelligent driving. The deep learning-based method has gradually replaced the shape-based and color-based methods due to its advantages in speed and accuracy. There are two main methods for traffic sign detection based on deep learning. One is a method based on a two-stage network, such as Faster-RCNN and Cascade-RCNN. The processing method of this method is: first extract features from the input image, then perform the first position correction of the obtained feature map by RPN, and then perform the second position correction through the detector head. However, the recognition speed based on the two-stage network is slow. In order to solve this technical problem, a method based on the one-stage network is proposed, such as the Yolo series, RetinaNet, etc., but the accuracy is slightly inferior to that of the one-stage network.
[0004] Therefore, there is an urgent need to propose a traffic sign detection method and device to solve the technical problem that the existing technology cannot balance the detection speed and detection accuracy. Summary of the invention
[0005] In view of this, it is necessary to provide a traffic sign detection method and device to solve the technical problem existing in the prior art that both detection speed and detection accuracy cannot be taken into account.
[0006] In one aspect, the present invention provides a traffic sign detection method, comprising:
[0007] Acquire the traffic image to be detected;
[0008] Inputting the traffic image to be detected into a well-trained first-order fully convolutional target detection model to obtain a traffic sign detection result;
[0009] Among them, the first-order full convolution target detection model includes a feature extraction module, a feature fusion module and an output module, and the structure of the feature fusion module is a nearest neighbor fusion feature pyramid structure.
[0010] In some possible implementations, the feature extraction module includes a first feature extraction layer, a second feature extraction layer, and a third feature extraction layer; the feature fusion module includes a first feature fusion layer, a second feature fusion layer, a third feature fusion layer, a fourth feature fusion layer, and a fifth feature fusion layer;
[0011] The traffic image to be detected is sequentially convolved through the first feature extraction layer, the second feature extraction layer and the third feature extraction layer, to obtain a first extracted image, a second extracted image and a third extracted image respectively;
[0012] The first feature fusion layer is used to receive the first extracted image and the second extracted image to generate a first feature map; the second feature fusion layer is used to receive the second extracted image and the third extracted image to generate a second feature map; the third feature fusion layer is used to receive the third extracted image to generate a third feature map; the fourth feature fusion layer is used to receive the third extracted image to generate a fourth feature map; the fifth feature fusion layer is used to receive the fourth feature map to generate a fifth feature map;
[0013] The first feature fusion layer is further used to upsample the second feature map to obtain a first upsampled image, and fuse the first upsampled image with the first feature map to obtain a first feature fused image;
[0014] The second feature fusion layer is further used to upsample the third feature map to obtain a second upsampled image, downsample the first feature map to obtain a first downsampled image, and fuse the first downsampled image, the second upsampled image and the second feature map to obtain a second feature fused image;
[0015] The third feature fusion layer is further used to upsample the fourth feature map to obtain a third upsampled image, downsample the second feature map to obtain a second downsampled image, and fuse the second downsampled image, the third upsampled image and the third feature map to obtain a third feature fused image;
[0016] The fourth feature fusion layer is further used to upsample the fifth feature map to obtain a fourth upsampled image, downsample the third feature map to obtain a third downsampled image, and fuse the third downsampled image, the fourth upsampled image and the fourth feature map to obtain a fourth feature fusion image;
[0017] The fifth feature fusion layer is also used to downsample the fourth feature map to obtain a fourth downsampled image, and to fuse the fourth downsampled image with the fifth feature map to obtain a fifth feature fused image.
[0018] In some possible implementations, the output module includes a first output layer, a second output layer, a third output layer, a fourth output layer, and a fifth output layer;
[0019] The first output layer is used to detect the first feature fusion image and output a first detection result; the second output layer is used to detect the second feature fusion image and output a second detection result; the third output layer is used to detect the third feature fusion image and output a third detection result; the fourth output layer is used to detect the fourth feature fusion image and output a fourth detection result; the fifth output layer is used to detect the fifth feature fusion image and output a fifth detection result.
[0020] In some possible implementations, before inputting the traffic image to be detected into a well-trained first-order fully convolutional target detection model to obtain a traffic sign detection result, the method further includes:
[0021] Build an initial target detection model;
[0022] Acquire a plurality of traffic images, and preprocess the plurality of traffic images to obtain a traffic image training set;
[0023] The initial target detection model is trained according to the traffic image training set to obtain the first-order fully convolutional target detection model.
[0024] In some possible implementations, the loss function of the initial target detection model includes a regression loss function and a classification loss function, the regression loss function is a generalized intersection-over-union loss function, and the classification loss function is a generalized focal loss function.
[0025] In some possible implementations, preprocessing the plurality of traffic images to obtain a traffic image training set includes:
[0026] Performing data enhancement processing on the multiple traffic images to obtain multiple enhanced images;
[0027] The traffic image and the enhanced image are annotated to obtain the traffic image dataset, wherein the traffic image dataset includes a plurality of annotated traffic images, and the annotated traffic images include a plurality of real annotation boxes and real categories.
[0028] In some possible implementations, the training the initial target detection model according to the traffic image training set to obtain the first-order fully convolutional target detection model includes:
[0029] Input the labeled traffic image into the initial target detection model, and obtain a plurality of feature fusion images through the feature extraction module and the feature fusion module, wherein the fusion feature image includes a plurality of prediction anchor boxes and a plurality of pixel regions;
[0030] Dividing the plurality of pixel regions into a plurality of positive samples and a plurality of negative samples based on an adaptive sample screening model and the predicted anchor frame;
[0031] Inputting the plurality of positive samples and the plurality of negative samples into the output module to obtain a plurality of predicted annotation boxes and predicted categories;
[0032] Based on the true annotation box, the true category, the predicted annotation box, the predicted category, the loss function and preset training parameters, the optimal model parameters of the initial target detection model are determined, and the first-order full convolution target detection model is determined according to the optimal model parameters.
[0033] In some possible implementations, the preset training parameters include an initial learning rate, a decay strategy, and an optimizer, the initial learning rate is 0.025, the decay strategy is a cosine annealing decay strategy, and the optimizer is a stochastic gradient descent optimizer.
[0034] In some possible implementations, the traffic sign detection result includes a target sign frame and a structural size of the target sign frame; and the step of inputting the traffic image to be detected into a well-trained first-order fully convolutional target detection model to obtain the traffic sign detection result includes:
[0035] Inputting the traffic image to be detected into a well-trained first-order fully convolutional target detection model to obtain multiple boxes to be selected;
[0036] The multiple candidate boxes are screened based on a preset threshold to determine the target mark box and the structural size of the target mark box.
[0037] On the other hand, the present invention also provides a traffic sign detection device, comprising:
[0038] An image acquisition unit to be detected, used to acquire a traffic image to be detected;
[0039] A traffic sign detection unit, used for inputting the traffic image to be detected into a well-trained first-order full convolution target detection model to obtain a traffic sign detection result;
[0040] Among them, the first-order full convolution target detection model includes a feature extraction module, a feature fusion module and an output module, and the structure of the feature fusion module is a nearest neighbor fusion feature pyramid structure.
[0041] The beneficial effect of adopting the above embodiment is: the traffic sign detection method provided by the present invention improves the feature fusion module in the first-order full convolution target detection model, so that the structure of the feature fusion module is a neighbor fusion feature pyramid structure, which can explore the intrinsic correlation between different pyramid layers and discard the fusion of non-adjacent pyramid layers, thereby improving the reliability of the fused feature image obtained by the feature fusion module, and improving the accuracy of detecting the traffic image to be detected by the first-order full convolution target detection model while improving the traffic sign recognition speed, thereby providing decision support for the driver or intelligent vehicle to perform correct actions, reducing operational errors, and reducing the frequency of traffic accidents. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 A schematic diagram of a flow chart of an embodiment of a traffic sign detection method provided by the present invention;
[0044] Figure 2 A schematic diagram of the structure of an embodiment of a first-order fully convolutional target detection model provided by the present invention;
[0045] Figure 3 A schematic diagram of an embodiment of the process of training an initial target detection model provided by the present invention;
[0046] Figure 4 For the present invention Figure 3 A schematic flow chart of an embodiment of S302;
[0047] Figure 5 For the present invention Figure 3 A schematic flow chart of an embodiment of S303;
[0048] Figure 6 For the present invention Figure 1 A schematic flow chart of an embodiment of S102;
[0049] Figure 7 A schematic diagram of the structure of an embodiment of a traffic sign detection device provided by the present invention;
[0050] Figure 8 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0052] It should be understood that the schematic drawings are not drawn to scale. The flow chart used in the present invention shows the operations implemented according to some embodiments of the present invention. It should be understood that the operations of the flow chart can be implemented out of order, and the steps without logical context can be reversed or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flow chart under the guidance of the content of the present invention, and can also remove one or more operations from the flow chart.
[0053] In the description of the embodiments of the present invention, "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone.
[0054] Some of the block diagrams shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor systems and / or microcontroller systems.
[0055] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0056] The embodiments of the present invention provide a traffic sign detection method and device, which are described below respectively.
[0057] Figure 1 A flow chart of an embodiment of the traffic sign detection method provided by the present invention is shown in FIG. Figure 2 A schematic diagram of the structure of an embodiment of the first-order full convolution target detection model provided by the present invention is shown in FIG. Figure 1 and Figure 2 As shown, the traffic sign detection method includes:
[0058] S101, obtaining a traffic image to be detected;
[0059] S102, inputting the traffic image to be detected into a fully trained one-stage fully convolutional object detection model (Fully Convolutional One-Stage Object Detection, FCOS) to obtain a traffic sign detection result;
[0060] Among them, the first-order fully convolutional target detection model includes a feature extraction module, a feature fusion module and an output module. The structure of the feature fusion module is a neighbor fusion feature pyramid structure (Neighbor Fusion Feature Pyramid Network, NF-FPN).
[0061] Compared with the prior art, the traffic sign detection method provided by the embodiment of the present invention improves the feature fusion module in the first-order full convolution target detection model so that the structure of the feature fusion module is a nearest neighbor fusion feature pyramid structure, which can explore the intrinsic correlation between different pyramid layers and discard the fusion of non-adjacent pyramid layers, thereby improving the reliability of the fused feature image obtained by the feature fusion module, and further improving the accuracy of detecting the traffic image to be detected by the first-order full convolution target detection model while improving the traffic sign detection speed, thereby providing decision support for the driver or intelligent vehicle to perform correct actions, reducing operating errors, and reducing the frequency of traffic accidents.
[0062] It should be noted that the structure of the feature extraction module can be a Resnet50 structure.
[0063] In some embodiments of the present invention, Figure 2 As shown, the feature extraction module includes a first feature extraction layer C3, a second feature extraction layer C4 and a third feature extraction layer C5; the feature fusion module includes a first feature fusion layer P3, a second feature fusion layer P4, a third feature fusion layer P5, a fourth feature fusion layer P6 and a fifth feature fusion layer P7;
[0064] The traffic image to be detected is sequentially convolved through the first feature extraction layer C3, the second feature extraction layer C4 and the third feature extraction layer C5, and a first extracted image, a second extracted image and a third extracted image are obtained accordingly;
[0065] The first feature fusion layer P3 is used to receive the first extracted image and the second extracted image to generate a first feature map; the second feature fusion layer P4 is used to receive the second extracted image and the third extracted image to generate a second feature map; the third feature fusion layer P5 is used to receive the third extracted image to generate a third feature map; the fourth feature fusion layer P6 is used to receive the third extracted image to generate a fourth feature map; the fifth feature fusion layer P7 is used to receive the fourth feature map to generate a fifth feature map;
[0066] The first feature fusion layer P3 is also used to upsample the second feature map to obtain a first upsampled image, and fuse the first upsampled image with the first feature map to obtain a first feature fused image;
[0067] The second feature fusion layer P4 is further used to upsample the third feature map to obtain a second upsampled image, downsample the first feature map to obtain a first downsampled image, and fuse the first downsampled image, the second upsampled image and the second feature map to obtain a second feature fused image;
[0068] The third feature fusion layer P5 is further used to upsample the fourth feature map to obtain a third upsampled image, downsample the second feature map to obtain a second downsampled image, and fuse the second downsampled image, the third upsampled image and the third feature map to obtain a third feature fused image;
[0069] The fourth feature fusion layer P6 is further used to upsample the fifth feature map to obtain a fourth upsampled image, downsample the third feature map to obtain a third downsampled image, and fuse the third downsampled image, the fourth upsampled image and the fourth feature map to obtain a fourth feature fused image;
[0070] The fifth feature fusion layer P7 is also used to downsample the fourth feature map to obtain a fourth downsampled image, and to fuse the fourth downsampled image with the fifth feature map to obtain a fifth feature fused image.
[0071] That is to say, Figure 2 As shown in the figure, the black dotted line represents a 3x3 convolution with a stride of 1 plus upsampling, the brown solid line represents a 3x3 convolution with a stride of 1, and the black dotted line represents a 3x3 convolution with a stride of 2 plus downsampling. Finally, the feature maps obtained by the three operations are added together, which represents the nearest neighbor fusion pyramid structure proposed in this paper.
[0072] Each feature fusion layer in the embodiment of the present invention fuses the feature map of its own layer with the feature maps of one or two adjacent feature fusion layers, so that the obtained feature fusion image fuses more features, thereby improving the accuracy of the obtained feature fusion image, and further improving the accuracy of the traffic sign detection method.
[0073] That is:
[0074] y i =Upsample(k0*x i+1 )+k1*x i +Downsample(k -1 *x i-1 )
[0075] In the formula, y i is the feature fusion image corresponding to the current feature fusion layer; Upsample is upsampling; x i+1 is the feature map output by the previous feature fusion layer adjacent to the current feature fusion layer; k0 is the convolution operation performed on the feature map output by the previous feature fusion layer; x i is the feature map output by the current feature fusion layer; k1 is the convolution operation on the feature map output by the current feature fusion layer; Downsample is downsampling; x i-1 The feature map output by the next feature fusion layer adjacent to the current feature fusion layer; k -1 Perform a convolution operation on the feature map output by the next feature fusion layer.
[0076] Furthermore, if Figure 2 As shown, the output module includes a first output layer Head1, a second output layer Head2, a third output layer Head3, a fourth output layer Head4 and a fifth output layer Head5;
[0077] The first output layer Head1 is used to detect the first feature fusion image and output the first detection result; the second output layer Head2 is used to detect the second feature fusion image and output the second detection result; the third output layer Head3 is used to detect the third feature fusion image and output the third detection result; the fourth output layer Head4 is used to detect the fourth feature fusion image and output the fourth detection result; the fifth output layer Head5 is used to detect the fifth feature fusion image and output the fifth detection result.
[0078] Depend on Figure 2It can be seen that each output layer includes a classification branch (Classification), a clustering branch (Center-ness) and a regression branch (Regression). The classification branch is used to identify the local features of the fused feature map, the regression branch is used to identify the position and edge information of the object in the fused feature map, and the clustering branch is used to improve the recognition performance of the regression branch. Because the classification branch requires the features to have characteristics such as translation invariance, scale invariance, and rotation invariance, it is sensitive to the local features of the object, while the regression branch is more sensitive to the position and edge information of the object. The clustering branch is introduced to learn the relative centrality of each position, so it should share features with the regression branch.
[0079] In some embodiments of the present invention, Figure 3 As shown, before step S102, it also includes:
[0080] S301, constructing an initial target detection model;
[0081] S302, acquiring a plurality of traffic images, and preprocessing the plurality of traffic images to obtain a traffic image training set;
[0082] S303: Train an initial target detection model according to the traffic image training set to obtain a first-order fully convolutional target detection model.
[0083] It should be noted that before performing step S303, the traffic image training set needs to be divided into a training set, a verification set and a test set. The initial target detection model is trained with the training set, and the obtained first-order full convolution target detection model is verified and tested with the verification set and the test set respectively, so as to improve the detection accuracy of the first-order full convolution target detection model.
[0084] In a specific embodiment of the present invention, the ratio of the training set, the validation set and the test set is 8:1:1.
[0085] In order to further improve the detection accuracy of the first-order fully convolutional target detection model, thereby improving the detection reliability of the traffic sign detection method, in some embodiments of the present invention, the loss function of the initial target detection model includes a regression loss function and a classification loss function, the regression loss function is a generalized intersection over union (GIOU) loss function, and the classification loss function is a generalized focal loss (GFL) loss function.
[0086] Specifically, the GFL loss function consists of two parts, namely the quality focal loss function (Quality Focal Loss, QFL) and the distribution focal loss function (Distribution Focal Loss, DFL).
[0087] The embodiment of the present invention sets the classification loss function to GFL, thereby improving the accuracy and speed of traffic sign recognition while adding additional computational effort.
[0088] Since the number of traffic images is limited, in order to improve the model performance of the first-order full convolutional target detection model, a large number of traffic images are required for training. In order to solve the technical problem of insufficient number of traffic image samples, in some embodiments of the present invention, Figure 4 As shown, step S302 includes:
[0089] S401, performing data enhancement processing on a plurality of traffic images to obtain a plurality of enhanced images;
[0090] S402: Annotate the traffic image and the enhanced image to obtain a traffic image dataset, where the traffic image dataset includes a plurality of annotated traffic images, and the annotated traffic images include a plurality of real annotation boxes and real categories.
[0091] The embodiment of the present invention performs data enhancement processing on traffic images, so as to expand the number of traffic image samples when the number of traffic image samples is insufficient, thereby improving the model performance of the obtained first-order full convolution target detection model.
[0092] In some embodiments of the present invention, the traffic image dataset includes 1,500 labeled traffic images.
[0093] Specifically: the data enhancement processing in step S401 includes but is not limited to multi-scale training, mixup, mosaic, random image rotation, HSV hue change, image transposition and other enhancement processing.
[0094] It should be noted that step S402 may specifically include: using an open source data annotation tool, such as the Labelme tool, to annotate the traffic image in a visual interface, and convert the traffic image into Common Objects in COntext (COCO) format.
[0095] It should also be noted that in order to improve the reliability of the detection results, the traffic images need to be cropped to make the size of the traffic images uniform. Specifically, the height and width of the traffic images are 640 mm and 960 mm respectively.
[0096] In some embodiments of the present invention, Figure 5As shown, step S303 includes:
[0097] S501, inputting the annotated traffic image into the initial target detection model, and obtaining multiple feature fusion images through a feature extraction module and a feature fusion module, wherein the fusion feature image includes multiple prediction anchor boxes and multiple pixel regions;
[0098] S502, dividing multiple pixel regions into multiple positive samples and multiple negative samples based on the adaptive sample screening model and the predicted anchor frame;
[0099] S503, inputting multiple positive samples and multiple negative samples into an output module to obtain multiple predicted annotation boxes and predicted categories;
[0100] S504, determining the optimal model parameters of the initial target detection model based on the true annotation box, the true category, the predicted annotation box, the predicted category, the loss function and the preset training parameters, and determining the first-order full convolution target detection model according to the optimal model parameters.
[0101] The embodiment of the present invention divides multiple pixel areas into multiple positive samples and multiple negative samples based on an adaptive sample screening model and a predicted anchor frame, thereby improving the rationality of the positive and negative sample division, thereby improving the accuracy of the first-order full convolution target detection model.
[0102] Specifically, step S502 is as follows:
[0103] For each true annotation box in the annotated traffic image, select k prediction anchor boxes with the closest distance L2 to its center point in each layer of feature fusion image in the feature fusion module. Assuming that the feature fusion module has L layers of feature fusion layers, each true annotation box has k×L candidate prediction anchor boxes;
[0104] Calculate the intersection-and-union ratio Dg of each predicted anchor box and the true annotation box, and calculate the mean mg and variance vg of these k×L Dg, and set the intersection-and-union ratio threshold of the positive sample of the true annotation box tg=mg+vg;
[0105] The predicted anchor boxes whose IoU ratio is greater than the IoU threshold and whose center points are in the true annotation box are selected as positive samples, and the remaining predicted anchor boxes are selected as negative samples.
[0106] In some embodiments of the present invention, the training parameters preset in step S504 are an initial learning rate, a decay strategy, and an optimizer, specifically: the initial learning rate is 0.025, the decay strategy is a cosine annealing decay strategy, the optimizer is a stochastic gradient descent optimizer (Stochastic Gradient Descent, SGD), and the training method is a multi-scale training method.
[0107] It should be noted that the training parameters preset in step S504 may also include a maximum number of training times. When the loss function converges or when the number of training times reaches the maximum number of training times, the training is stopped to obtain a first-order full convolution target detection model.
[0108] In some embodiments of the present invention, the traffic sign detection result includes a target sign frame and a structure size of the target sign frame. Since the traffic image to be detected is subjected to a first-order full convolution target detection model, multiple candidate frames are obtained. In order to determine the target sign frame from the multiple candidate frames, in some embodiments of the present invention, for example Figure 6 As shown, step S102 includes:
[0109] S601, inputting the traffic image to be detected into a well-trained first-order full convolution target detection model to obtain multiple boxes to be selected;
[0110] S602: Screen multiple candidate boxes based on a preset threshold to determine a target mark box and a structural size of the target mark box.
[0111] In a specific embodiment of the present invention, the preset threshold is 0.2. It should be understood that the preset threshold can be adjusted according to actual conditions, which will not be described in detail here.
[0112] In order to better implement the traffic sign detection method in the embodiment of the present invention, based on the traffic sign detection method, the embodiment of the present invention also provides a traffic sign detection device, such as Figure 7 As shown, the traffic sign detection device 700 includes:
[0113] The image acquisition unit 701 is used to acquire the traffic image to be detected;
[0114] The traffic sign detection unit 702 is used to input the traffic image to be detected into a well-trained first-order full convolution target detection model to obtain a traffic sign detection result;
[0115] Among them, the first-order full convolution target detection model includes a feature extraction module, a feature fusion module and an output module. The structure of the feature fusion module is a nearest neighbor fusion feature pyramid structure.
[0116] The traffic sign detection device 700 provided in the above embodiment can implement the technical solution described in the above traffic sign detection method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above traffic sign detection method embodiment, which will not be repeated here.
[0117] like Figure 8 As shown, the present invention also provides an electronic device 800. The electronic device 800 includes a processor 801, a memory 802 and a display 803. Figure 8Only some components of the electronic device 800 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0118] In some embodiments, the processor 801 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 802, such as the traffic sign detection method of the present invention.
[0119] In some embodiments, the processor 801 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 801 may be local or remote. In some embodiments, the processor 801 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.
[0120] In some embodiments, the memory 802 may be an internal storage unit of the electronic device 800, such as a hard disk or memory of the electronic device 800. In other embodiments, the memory 802 may also be an external storage device of the electronic device 800, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 800.
[0121] Furthermore, the memory 802 may include both an internal storage unit of the electronic device 800 and an external storage device. The memory 802 is used to store application software installed in the electronic device 800 and various data.
[0122] In some embodiments, the display 803 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 803 is used to display information on the electronic device 800 and to display a visual user interface. The components 801-803 of the electronic device 800 communicate with each other via a system bus.
[0123] In one embodiment, when the processor 801 executes the traffic sign detection program in the memory 802, the following steps may be implemented:
[0124] Acquire the traffic image to be detected;
[0125] The traffic image to be detected is input into a well-trained first-order fully convolutional object detection model to obtain the traffic sign detection result;
[0126] Among them, the first-order full convolution target detection model includes a feature extraction module, a feature fusion module and an output module. The structure of the feature fusion module is a nearest neighbor fusion feature pyramid structure.
[0127] It should be understood that: when the processor 801 executes the traffic sign detection program in the memory 802, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.
[0128] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 800 mentioned, and the electronic device 800 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 800 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0129] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps or functions in the traffic sign detection method provided in the above-mentioned method embodiments can be implemented.
[0130] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0131] The traffic sign detection method and device provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A traffic sign detection method, characterized in that: include: Acquire the traffic image to be detected; Inputting the traffic image to be detected into a well-trained first-order fully convolutional target detection model to obtain a traffic sign detection result; The first-order full convolution target detection model includes a feature extraction module, a feature fusion module and an output module, and the structure of the feature fusion module is a nearest neighbor fusion feature pyramid structure; The feature extraction module includes a first feature extraction layer, a second feature extraction layer and a third feature extraction layer; the feature fusion module includes a first feature fusion layer, a second feature fusion layer, a third feature fusion layer, a fourth feature fusion layer and a fifth feature fusion layer; The traffic image to be detected is sequentially convolved through the first feature extraction layer, the second feature extraction layer and the third feature extraction layer, to obtain a first extracted image, a second extracted image and a third extracted image respectively; The first feature fusion layer is used to receive the first extracted image and the second extracted image to generate a first feature map; the second feature fusion layer is used to receive the second extracted image and the third extracted image to generate a second feature map; the third feature fusion layer is used to receive the third extracted image to generate a third feature map; the fourth feature fusion layer is used to receive the third extracted image to generate a fourth feature map; the fifth feature fusion layer is used to receive the fourth feature map to generate a fifth feature map; The first feature fusion layer is further used to upsample the second feature map to obtain a first upsampled image, and fuse the first upsampled image with the first feature map to obtain a first feature fused image; The second feature fusion layer is further used to upsample the third feature map to obtain a second upsampled image, downsample the first feature map to obtain a first downsampled image, and fuse the first downsampled image, the second upsampled image and the second feature map to obtain a second feature fused image; The third feature fusion layer is further used to upsample the fourth feature map to obtain a third upsampled image, downsample the second feature map to obtain a second downsampled image, and fuse the second downsampled image, the third upsampled image and the third feature map to obtain a third feature fused image; The fourth feature fusion layer is further used to upsample the fifth feature map to obtain a fourth upsampled image, downsample the third feature map to obtain a third downsampled image, and fuse the third downsampled image, the fourth upsampled image and the fourth feature map to obtain a fourth feature fusion image; The fifth feature fusion layer is also used to downsample the fourth feature map to obtain a fourth downsampled image, and to fuse the fourth downsampled image with the fifth feature map to obtain a fifth feature fused image.
2. The traffic sign detection method according to claim 1, characterized in that: The output module includes a first output layer, a second output layer, a third output layer, a fourth output layer and a fifth output layer; The first output layer is used to detect the first feature fusion image and output a first detection result; the second output layer is used to detect the second feature fusion image and output a second detection result; the third output layer is used to detect the third feature fusion image and output a third detection result; the fourth output layer is used to detect the fourth feature fusion image and output a fourth detection result; the fifth output layer is used to detect the fifth feature fusion image and output a fifth detection result.
3. The traffic sign detection method according to claim 1, characterized in that: Before inputting the traffic image to be detected into a well-trained first-order full convolution target detection model to obtain a traffic sign detection result, the method further includes: Build an initial target detection model; Acquire a plurality of traffic images, and preprocess the plurality of traffic images to obtain a traffic image training set; The initial target detection model is trained according to the traffic image training set to obtain the first-order fully convolutional target detection model.
4. The traffic sign detection method according to claim 3, characterized in that: The loss function of the initial target detection model includes a regression loss function and a classification loss function, the regression loss function is a generalized intersection-over-union loss function, and the classification loss function is a generalized focal loss function.
5. The traffic sign detection method according to claim 4, characterized in that: The preprocessing of the plurality of traffic images to obtain a traffic image training set includes: Performing data enhancement processing on the multiple traffic images to obtain multiple enhanced images; The traffic image and the enhanced image are annotated to obtain the traffic image dataset, wherein the traffic image dataset includes a plurality of annotated traffic images, and the annotated traffic images include a plurality of real annotation boxes and real categories.
6. The traffic sign detection method according to claim 5, characterized in that: The step of training the initial target detection model according to the traffic image training set to obtain the first-order fully convolutional target detection model includes: Input the labeled traffic image into the initial target detection model, and obtain a plurality of feature fusion images through the feature extraction module and the feature fusion module, wherein the fusion feature image includes a plurality of prediction anchor boxes and a plurality of pixel regions; Dividing the plurality of pixel regions into a plurality of positive samples and a plurality of negative samples based on an adaptive sample screening model and the predicted anchor frame; Inputting the plurality of positive samples and the plurality of negative samples into the output module to obtain a plurality of predicted annotation boxes and predicted categories; Based on the true annotation box, the true category, the predicted annotation box, the predicted category, the loss function and preset training parameters, the optimal model parameters of the initial target detection model are determined, and the first-order full convolution target detection model is determined according to the optimal model parameters.
7. The traffic sign detection method according to claim 6, characterized in that: The preset training parameters include an initial learning rate, a decay strategy and an optimizer, the initial learning rate is 0.025, the decay strategy is a cosine annealing decay strategy, and the optimizer is a stochastic gradient descent optimizer.
8. The traffic sign detection method according to claim 1, characterized in that: The traffic sign detection result includes a target sign frame and a structural size of the target sign frame; The step of inputting the traffic image to be detected into a well-trained first-order fully convolutional target detection model to obtain a traffic sign detection result includes: Inputting the traffic image to be detected into a well-trained first-order fully convolutional target detection model to obtain multiple boxes to be selected; The multiple candidate boxes are screened based on a preset threshold to determine the target mark box and the structural size of the target mark box.
9. A traffic sign detection device, characterized in that: The traffic sign detection method according to any one of claims 1 to 8, wherein the device comprises: An image acquisition unit to be detected, used to acquire a traffic image to be detected; A traffic sign detection unit, used for inputting the traffic image to be detected into a well-trained first-order full convolution target detection model to obtain a traffic sign detection result; Among them, the first-order full convolution target detection model includes a feature extraction module, a feature fusion module and an output module, and the structure of the feature fusion module is a nearest neighbor fusion feature pyramid structure.
Citation Information
Patent Citations
Method for improving traffic sign recognition precision in extreme weather and environment
CN113076842A
Defect detection method for LED and storage medium
CN113160128A
