YOLOv8s traffic sign detection method based on edge and shape feature fusion
By adding edge feature extraction branches and adaptive feature fusion modules to YOLOv8s, combined with the shape prior convolution module, the problem of missed detections and false detections in traffic sign detection in complex traffic scenes is solved, and detection accuracy and rapid response capabilities are improved.
Patent Information
- Application Number
- CN202410832268.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-06
AI Technical Summary
In complex traffic scenes, existing traffic sign detection methods have problems with missed detections and false detections, and convolutional neural networks are difficult to fully capture position information and shape features, resulting in low detection accuracy.
The edge feature extraction branch and adaptive feature fusion module are added to the backbone network of YOLOv8s, combined with the shape prior convolution module, to enhance the sensitivity and representation capabilities of edge and shape features, and reduce background noise interference.
It improves the accuracy of traffic sign detection and the model's ability to perceive targets of specific shapes, alleviates the problem of missed detections and false detections, and improves the rapid response capability of detection.
Smart Images

Figure CN118609092A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of traffic sign recognition, and in particular to a YOLOv8s traffic sign detection method based on edge and shape feature fusion. Background Art
[0002] In the traffic scene of autonomous driving, the detection of traffic signs still faces some challenges. In complex and ever-changing traffic scenes, due to complex background interference and multi-scale transformation of targets, the detection may cause missed detection and false detection, resulting in low overall detection accuracy.
[0003] Among the existing technologies, most use convolutional neural networks for traffic sign detection and recognition. Due to the local receptive field and weight sharing characteristics of the convolution operation, the network may not be able to fully capture the information of different spatial locations, which leads to differences in positional information in the feature map, thereby ignoring some important feature information. There are still certain challenges in processing small-sized targets, optimizing edge recognition accuracy, and enhancing the model's adaptability to shape variations. At the same time, edge and shape information have been used as important features in fields such as semantic segmentation, proving their effectiveness. However, in terms of traffic sign detection methods, there are still few methods on how to efficiently use these features.
[0004] The Chinese patent application with application publication number CN116778456A discloses a traffic sign detection method based on improved YOLOv5s. In the process of detecting traffic signs, a multi-layer GhostBottleneck network is introduced, and the effective features are focused and enhanced by introducing an attention mechanism module (CBAM). It can effectively extract small target feature information, suppress background noise, and improve the detection ability of traffic signs under complex backgrounds. The disadvantages of this method are: ① CBAM is an attention mechanism based on channels and spaces, which requires large computing resources and computational complexity, resulting in a decrease in detection rate. ② GhostBottleneck uses a lightweight convolution method, which is insufficient for feature extraction of small targets.
[0005] The Chinese patent application with application publication number CN117392640A discloses a traffic sign detection method based on improved YOLOv8s, including obtaining training set images and images to be detected, and also including the following steps: designing an improved model based on YOLOv8s; using the training set images to train the improved model of YOLOv8s and saving weights; inputting the images to be detected into the trained improved model of YOLOv8s for prediction; and outputting the prediction results. The disadvantage of this method is that it requires additional computing resources and computing complexity during detection, resulting in a decrease in detection rate. At the same time, it lacks a detailed design for the inherent characteristics of traffic signs and has insufficient characterization capabilities for traffic signs. Summary of the invention
[0006] In order to solve the above technical problems, the present invention proposes a YOLOv8s traffic sign detection method based on edge and shape feature fusion, adds an edge feature extraction branch to the backbone network of YOLOv8s, designs an adaptive feature fusion module to fuse the same-level features of the backbone network, and enhances the sensitivity and characterization ability of edge information; designs a convolution module based on shape prior to enhance the model's perception ability of targets with specific shapes, reduces the interference of background noise on the model, and improves the model's detection accuracy of traffic signs.
[0007] The purpose of the present invention is to provide a YOLOv8s traffic sign detection method based on edge and shape feature fusion, including obtaining a training set image and a to-be-detected image, and also including the following steps:
[0008] Step 1: Design an improved model based on YOLOv8s;
[0009] Step 2: Use the training set images to train the improved model of YOLOv8s and save the weights;
[0010] Step 3: Input the image to be detected into the trained YOLOv8s improved model for prediction;
[0011] Step 4: Output the prediction results.
[0012] Preferably, the improved model of YOLOv8s includes at least one of an edge feature extraction branch, an adaptive feature fusion module and a shape prior convolution module.
[0013] In any of the above solutions, preferably, the edge feature extraction branch includes an edge map extraction module, an edge feature extraction module and an adaptive feature fusion module.
[0014] Preferably, in any of the above solutions, the edge map extraction module is used to perform Sobel operator sampling on the input image to obtain preliminary global feature information.
[0015] In any of the above schemes, preferably, the edge feature extraction branch consists of re-parameterized convolution, normalization, activation function and parameter-free attention mechanism.
[0016] In any of the above schemes, it is preferred that the parameter-free attention mechanism does not need to add parameters to the network, determines the importance of each neuron by optimizing the energy function, generates a three-dimensional attention weight of the feature map, and adaptively strengthens the edge features that have a positive effect on detection, and the process is as follows:
[0017] Step 101: For the input feature map Calculate its channel statistics μ;
[0018] Step 102: Calculate the square difference of each element with respect to the current channel average value;
[0019] Step 103: normalizing the squared difference and performing a Sigmoid activation function to calculate an attention map;
[0020] Step 104: Multiply the input feature map by the attention map to obtain a final weighted feature map.
[0021] In any of the above solutions, preferably, the calculation formula of the channel statistic μ is:
[0022]
[0023] Among them, μ C is the statistic of each channel of the feature map, C is the different channels, H and W are the height and width of the feature map, i is the number of feature map rows, j is the number of feature map columns, and X C (i, j) is the pixel in the i-th row and j-th column of a channel in the feature map X.
[0024] In any of the above solutions, preferably, the square difference D C The calculation formula for (i,j) is
[0025] D C (i,j)=(X C (i,j)-μ C ) 2 .
[0026] In any of the above schemes, preferably, the attention map A C The calculation formula for (i,j) is
[0027]
[0028] Among them, σ is the Sigmoid function, D C is the variance of a pixel in each channel relative to the channel mean, N is the total number of elements in the feature map, and λ is a very small constant.
[0029] In any of the above solutions, preferably, the final weighted feature map Y C The calculation formula for (i,j) is
[0030] Y C (i,j)=A C (i,j)·X C (i,j).
[0031] In any of the above solutions, preferably, the working process of the adaptive feature fusion module is as follows:
[0032] Step 111: For the input edge branch feature f at the same level e and backbone features f s , first concatenate along the channel dimension to get f u ,Then the different feature information of the two branches is integrated through a 1×1 convolution block for preliminary interaction;
[0033] Step 112: Input the integrated feature information into the global average pooling layer, compress the feature map of each channel to obtain the global representation feature Z;
[0034] Step 113: Input the global representation feature Z into the fully connected layer, perform normalization and activation, and obtain weights w1 and w2 of two branch features;
[0035] Step 114: Output the fused feature f = f e ×w1+f s ×w2.
[0036] In any of the above schemes, preferably, the shape prior convolution module consists of three parallel branches, including a circular convolution block branch, a triangular convolution block branch and a common convolution block extraction branch.
[0037] In any of the above schemes, it is preferred that the working process of the shape prior convolution module is: the input feature map is input into three branches respectively, and the circular convolution kernel, the triangular convolution kernel and the ordinary convolution kernel are used for downsampling and activation kernel to perform feature fusion to obtain the output feature map.
[0038] In any of the above solutions, preferably, the convolution kernel initialization process of the circular convolution block branch is as follows:
[0039] Step 121: Define a function named initialize circular convolution kernel, which accepts two parameters: convolution kernel size and output channel number;
[0040] Step 122: Calculate the radius of the convolution kernel, where the radius is equal to the convolution kernel size divided by 2;
[0041] Step 123: Determine the coordinates of the center point of the convolution kernel, where the horizontal and vertical coordinates of the center point are both values of the radius;
[0042] Step 124: Initialize an all-zero matrix as the weight matrix of the convolution kernel, and the dimension of the matrix is [number of output channels, number of output channels, convolution kernel size, convolution kernel size];
[0043] Step 125: Use two nested loops to traverse each element of the convolution kernel matrix: the outer loop variable is from 0 to the convolution kernel size minus 1, and the inner loop variable is from 0 to the convolution kernel size minus 1;
[0044] Step 126: For each element, calculate the sum of the squares of its distance from the center point and compare it with the square of the radius: if the sum of the squares of the distances is less than or equal to the square of the radius, the element is inside the circle, and the corresponding convolution kernel weight is set to 1; otherwise, the element is outside the circle, and the corresponding convolution kernel weight is set to 0;
[0045] Step 127: Return the initialized convolution kernel weight matrix.
[0046] In any of the above solutions, preferably, the weight W of the circular convolution kernel is y for
[0047]
[0048] In any of the above solutions, preferably, the weight W of the triangular convolution kernel is s for
[0049]
[0050] The present invention proposes a YOLOv8s traffic sign detection method based on the fusion of edge and shape features. An edge feature extraction branch is added to the original backbone branch of YOLOv8 to extract more detailed and comprehensive edge features, and adaptive feature fusion with the backbone branch is realized through an adaptive fusion module, so that the high-level semantic information and edge information of the model are effectively complementary. By designing a shape prior convolution block, the model's perception ability of the specific shape of traffic signs is further enhanced, the comprehensive detection ability of the model is enhanced, and the problem of missed detection and false detection is effectively alleviated. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 The present invention is a flowchart of a preferred embodiment of a YOLOv8s traffic sign detection method based on edge and shape feature fusion according to the present invention.
[0052] Figure 2 The present invention is a flowchart of another preferred embodiment of a YOLOv8s traffic sign detection method based on edge and shape feature fusion according to the present invention.
[0053] Figure 3 The figure is a schematic diagram of the network structure of a preferred embodiment of a YOLOv8s traffic sign detection method based on edge and shape feature fusion according to the present invention.
[0054] Figure 4The present invention is a schematic structural diagram of an edge feature extraction module of a YOLOv8s traffic sign detection method based on edge and shape feature fusion according to an embodiment of the present invention.
[0055] Figure 5 The present invention is a schematic structural diagram of an embodiment of an adaptive feature fusion module of a YOLOv8s traffic sign detection method based on edge and shape feature fusion according to the present invention.
[0056] Figure 6 The present invention is a schematic structural diagram of an example of a shape prior convolution module of a YOLOv8s traffic sign detection method based on edge and shape feature fusion according to the present invention.
[0057] Figure 7 The figure is a schematic diagram for comparing traffic sign detection results on CCTSDB according to an embodiment of a YOLOv8s traffic sign detection method based on edge and shape feature fusion according to the present invention.
[0058] Figure 8 This is a schematic diagram comparing traffic sign detection results according to an embodiment of a YOLOv8s traffic sign detection method based on edge and shape feature fusion on TT100K according to the present invention. DETAILED DESCRIPTION
[0059] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0060] Embodiment 1
[0061] like Figure 1 As shown, a YOLOv8s traffic sign detection method based on edge and shape feature fusion executes step 1000 to obtain a training set image and a to-be-detected image.
[0062] Execute step 1100 to design an improved model based on YOLOv8s, wherein the improved model of YOLOv8s includes at least an edge feature extraction branch, an adaptive feature fusion module, and a shape prior convolution module.
[0063] The edge feature extraction branch includes an edge map extraction module, an edge feature extraction module and an adaptive feature fusion module.
[0064] The edge map extraction module performs Sobel operator sampling on the input image to obtain preliminary global feature information.
[0065] The edge feature extraction branch consists of reparameterized convolution, normalization, activation function and parameter-free attention mechanism.
[0066] 1) The reparameterization technology maintains the excellent feature extraction capability of the multi-branch structure and can extract rich edge features from the edge map, which is very effective for the network to capture detailed information such as edges and contours. At the same time, it also decouples the planar structure of the reasoning stage and the multi-branch structure of the training stage, effectively improving the computational efficiency and reducing the reasoning time, which is very important for traffic sign detection that requires fast response.
[0067] 2) The parameter-free attention mechanism does not need to add parameters to the network, but determines the importance of each neuron by optimizing the energy function, thereby generating the three-dimensional attention weight of the feature map and adaptively strengthening the edge features that have a positive effect on detection. The process is as follows:
[0068] Execute step 1101, for the input feature map Calculate its channel statistics μ, the formula is as follows:
[0069]
[0070] Among them, μ C is the statistic of each channel of the feature map, C is the different channels, H and W are the height and width of the feature map, i is the number of feature map rows, j is the number of feature map columns, and X C (i, j) is the pixel in the i-th row and j-th column of a channel in the feature map X.
[0071] Execute step 1102 to calculate the square difference of each element with respect to the average value of the current channel, using the following formula:
[0072] D C (i,j)=(X C (i,j)-μ C ) 2 .
[0073] Execute step 1103 to normalize the squared difference and apply the Sigmoid activation function to calculate the attention map. The formula is as follows:
[0074]
[0075] Among them, σ is the Sigmoid function, D C is the variance of a pixel in each channel relative to the channel mean, N is the total number of elements in the feature map, and λ is a very small constant.
[0076] Execute step 1104 to multiply the input feature map by the attention map to obtain the final weighted feature map, as shown in the formula:
[0077] Y C (i,j)=A C (i,j)·X C(i,j).
[0078] The process of adaptive feature fusion module is as follows:
[0079] Execute step 1111, for the input edge branch feature f e and backbone features f s , first concatenate along the channel dimension to get f u ,Then the different feature information of the two branches is integrated through a 1×1 convolution block, and preliminary interaction is performed to enhance the richness of feature representation.
[0080] Execute step 1112, input the integrated feature information into the global average pooling layer, and compress the feature map of each channel to obtain the global representation feature Z.
[0081] Execute step 1113, input the global representation feature Z into the fully connected layer, perform normalization and activation, and obtain weights w1 and w2 of the two branch features.
[0082] Execute step 1114 to output the fused feature f=f e ×w1+f s ×w2.
[0083] The shape prior convolution block consists of three parallel branches, including a circular convolution block branch, a triangular convolution block branch, and a common convolution block extraction branch. The process is to input the input feature map into the three branches respectively, and perform feature fusion through the circular convolution kernel, the triangular convolution kernel, the common convolution kernel, the downsampling kernel, the activation kernel, and the output feature map.
[0084] The circular convolution block branch, the convolution kernel initialization process is as follows:
[0085] Execute step 1121 to define a function named initialize circular convolution kernel, which accepts two parameters: convolution kernel size and output channel number;
[0086] Execute step 1122 to calculate the radius of the convolution kernel, where the radius is equal to the convolution kernel size divided by 2;
[0087] Execute step 1123 to determine the coordinates of the center point of the convolution kernel, where the horizontal and vertical coordinates of the center point are both values of the radius;
[0088] Execute step 1124 to initialize an all-zero matrix as the weight matrix of the convolution kernel, and the dimension of the matrix is [number of output channels, number of output channels, convolution kernel size, convolution kernel size];
[0089] Execute step 1125, use two nested loops to traverse each element of the convolution kernel matrix: the outer loop variable is from 0 to the convolution kernel size minus 1, and the inner loop variable is from 0 to the convolution kernel size minus 1;
[0090] Execute step 1126, for each element, calculate the sum of the squares of the distances from the center point, and compare it with the square of the radius: if the sum of the squares of the distances is less than or equal to the square of the radius, the element is inside the circle, and the corresponding convolution kernel weight is set to 1; otherwise, the element is outside the circle, and the corresponding convolution kernel weight is set to 0;
[0091] Execute step 1127 to return the initialized convolution kernel weight matrix.
[0092] The initialization process of the triangular convolution kernel is similar.
[0093] Initialize the convolution kernel parameters as follows:
[0094] Circular convolution kernel weights:
[0095]
[0096] Triangular convolution kernel weights:
[0097]
[0098] Execute step 1200 to train the improved model of YOLOv8s using the training set images and save the weights.
[0099] Execute step 1300 to input the image to be detected into the trained improved model of YOLOv8s for prediction.
[0100] Execute step 1400 to output the prediction result.
[0101] Embodiment 2
[0102] In the traffic scene of autonomous driving, the detection of traffic signs still faces some challenges. In complex and ever-changing traffic scenes, due to complex background interference, multi-scale transformation of targets, etc., the detection may cause missed detection and false detection, resulting in low overall detection accuracy. Figure 2 shown.
[0103] In order to solve the above problems, this paper makes improvements based on YOLOv8s. Specifically, an edge feature extraction branch is added to the backbone network of YOLOv8s, and an adaptive feature fusion module is designed to fuse the same-level features of the backbone network to enhance the sensitivity and representation ability of edge information; a convolution module based on shape prior is designed to enhance the model's perception of targets of specific shapes and reduce the interference of background noise on the model, thereby improving the model's detection accuracy for traffic signs. Improved network structure Figure 3 shown.
[0104] Edge feature extraction branch
[0105] Adding an edge feature extraction branch to the backbone network aims to enhance the network's ability to perceive and extract information such as edges and contours. In complex and ever-changing traffic scenes, the model misses detections due to the influence of various elements in the background, including trees, street lights, and buildings, as well as edge blurring caused by different weather conditions. By adding an edge extraction branch, the model's ability to characterize edges and contours can be enhanced, allowing the model to better focus on traffic sign areas with distinct edges. The edge extraction branch consists of an edge map extraction module, a convolution block, an edge feature extraction module, and an adaptive feature fusion module. The original image is first input into the edge map extraction module, where the Sobel operator is used for edge extraction, and then the edge feature extraction module is used for convolution downsampling, focusing on refining and enhancing edge features, thereby providing the model with a richer extraction range of edge information, allowing the model to further integrate the geometric details of the edge information, so that the model can focus more on the traffic sign area, improve the model's anti-interference ability, and alleviate missed detection and false detection problems. The structure of the edge feature extraction module is as follows Figure 4 As shown in the figure, the structure of the adaptive feature fusion module is as follows: Figure 5 shown.
[0106] The re-parameterization technology maintains the excellent feature extraction capability of the multi-branch structure and can extract rich edge features from the edge map, which is very effective for the network to capture detailed information such as edges and contours. At the same time, it also decouples the planar structure of the reasoning stage and the multi-branch structure of the training stage, effectively improving computational efficiency and reducing reasoning time, which is very important for traffic sign detection that requires fast response.
[0107] The parameter-free attention mechanism does not need to add parameters to the network, but determines the importance of each neuron by optimizing the energy function, thereby generating a three-dimensional attention weight for the feature map and adaptively strengthening edge features that have a positive effect on detection. The process is as follows:
[0108] 1): For the input feature map Calculate its channel statistics μ, the formula is as follows:
[0109]
[0110] C represents different channels, H and W are the height and width of the feature map.
[0111] 2): Calculate the square difference of each element with respect to the average value of the current channel. The formula is as follows:
[0112] D C (i,j)=(X C (i,j)-μ C ) 2
[0113] 3): Normalize the squared difference and use the Sigmoid activation function to calculate the attention map. The formula is as follows:
[0114]
[0115] Among them, σ represents the Sigmoid function, N represents the total number of elements in the feature map, and λ is a very small constant.
[0116] 4): Multiply the input feature map by the attention map to obtain the final weighted feature map, as shown in the formula:
[0117] Y C (i,j)=A C (i,j)·X C (i,j).
[0118] The process of adaptive feature fusion module is as follows:
[0119] 1) For the input edge branch feature f at the same level e and backbone features f s , first concatenate along the channel dimension to get f u ,Then the different feature information of the two branches is integrated through a 1×1 convolution block, and preliminary interaction is performed to enhance the richness of feature representation.
[0120] 2) The integrated feature information is then input into the global average pooling layer, and the feature map of each channel is compressed to obtain the global representation feature Z.
[0121] 3) Z is input into the fully connected layer, and after normalization and activation, the weights w1 and w2 of the two branch features are obtained.
[0122] 4) Output the fused feature f = f e ×w1+f s ×w2.
[0123] Shape Prior Convolution Module
[0124] Traffic signs have fixed shapes, including circles, triangles and rectangles. Their shape features are very prominent and important judgment information. A circular convolution kernel convolution block and a triangular convolution kernel convolution block are designed, and a shape prior convolution block is designed based on them. The structure of the shape prior convolution block is as follows: Figure 6 As shown;
[0125] The shape prior convolution block consists of three parallel branches, including a circular convolution block branch, a triangular convolution block branch, and a common convolution block extraction branch. The process is to input the input feature map into the three branches respectively, and then perform feature fusion through the circular convolution kernel, the triangular convolution kernel, and the common convolution kernel for downsampling and activation, and then obtain the output feature map.
[0126] The circular convolution block branch, its convolution kernel initialization process is shown in Table 1:
[0127] Table 1 Circular convolution kernel assignment
[0128]
[0129] The initialization process of the triangular convolution kernel is similar.
[0130] Circular convolution kernel weights:
[0131]
[0132] Triangular convolution kernel weights:
[0133]
[0134] Embodiment 3
[0135] The method proposed in this invention is conducted and tested on the datasets CCTSDB and TT100K. The Chinese Traffic Signs Dataset released by the Chinese Academy of Sciences contains 1,100 images. Changsha University of Science and Technology added 5,200 images collected from highways on the basis of ctsd to propose the Chinese Traffic Signs Detection Benchmark ctsdb dataset, with a total of more than 17,000 images. Three types of traffic signs are involved, including night and day. The TT100k dataset is also a public dataset collected in China, containing 16,000 images, consisting of 27,000 traffic sign instances.
[0136] In order to verify the performance of the detection algorithm proposed in this paper, since the improved method in this paper is based on yolov8s, which is a model with a smaller depth in the yolov8 series. For each model, the input is 640*640, and experiments are carried out on CCTSDB and TT100K datasets respectively. The experimental results are shown in Tables 2 and 3. The detection results are compared. Figure 7 and Figure 8 shown.
[0137]
[0138] Table 2 Comparative experiments on CCTSDB dataset
[0139]
[0140] Table 3 Comparison with mainstream single-stage algorithms on the tt100k dataset
[0141] In order to better understand the present invention, the above is described in detail in conjunction with the specific embodiments of the present invention, but it is not intended to limit the present invention. Any simple modifications made to the above embodiments based on the technical essence of the present invention still fall within the scope of the technical solution of the present invention. Each embodiment in this specification focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referenced to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A YOLOv8s traffic sign detection method based on edge and shape feature fusion, comprising obtaining a training set image and a to-be-detected image, and further comprising the following steps: Step 1: Design an improved model based on YOLOv8s, wherein the improved model of YOLOv8s includes at least an edge feature extraction branch, an adaptive feature fusion module, and a shape prior convolution module; Step 2: Use the training set images to train the improved model of YOLOv8s and save the weights; Step 3: Input the image to be detected into the trained YOLOv8s improved model for prediction; Step 4: Output the prediction results.
2. The YOLOv8s traffic sign detection method based on edge and shape feature fusion as claimed in claim 1, characterized in that: The edge feature extraction branch includes an edge map extraction module, an edge feature extraction module and an adaptive feature fusion module.
3. The YOLOv8s traffic sign detection method based on edge and shape feature fusion as claimed in claim 2, characterized in that: The edge map extraction module is used to perform Sobel operator sampling on the input image to obtain preliminary global feature information.
4. The YOLOv8s traffic sign detection method based on edge and shape feature fusion as claimed in claim 3, characterized in that: The edge feature extraction branch consists of re-parameterized convolution, normalization, activation function and parameter-free attention mechanism.
5. The YOLOv8s traffic sign detection method based on edge and shape feature fusion as claimed in claim 4, characterized in that: The parameter-free attention mechanism does not need to add parameters to the network. It determines the importance of each neuron by optimizing the energy function, generates the three-dimensional attention weight of the feature map, and adaptively strengthens the edge features that have a positive effect on detection. The process is as follows: Step 101: For the input feature map Calculate its channel statistics μ, the calculation formula is Among them, μ C is the statistic of each channel of the feature map, C is the different channels, H and W are the height and width of the feature map, i is the number of feature map rows, j is the number of feature map columns, and X C (i,j) is the pixel in the i-th row and j-th column of a channel of the feature map X; Step 102: Calculate the square difference of each element with respect to the current channel average value. The calculation formula is: D C (i,j)=(X C (i,j)-μ C ) 2 ; Step 103: Normalize the squared difference and apply the Sigmoid activation function to calculate the attention map. The calculation formula is: Among them, σ is the Sigmoid function, D C is the variance of a pixel in each channel relative to the channel mean, N is the total number of elements in the feature map, and λ is a very small constant; Step 104: Multiply the input feature map by the attention map to obtain the final weighted feature map. The calculation formula is: Y C (i,j)=A C (i,j)·X C (i,j)。 6. The YOLOv8s traffic sign detection method based on edge and shape feature fusion as claimed in claim 5, characterized in that: The working process of the adaptive feature fusion module is as follows: Step 111: For the input edge branch feature f at the same level e and backbone features f s , first concatenate along the channel dimension to get f u ,Then the different feature information of the two branches is integrated through a 1×1 convolution block for preliminary interaction; Step 112: Input the integrated feature information into the global average pooling layer, compress the feature map of each channel to obtain the global representation feature Z; Step 113: Input the global representation feature Z into the fully connected layer, perform normalization and activation, and obtain weights w1 and w2 of two branch features; Step 114: Output the fused feature f = f e ×w1+f s ×w2.
7. The YOLOv8s traffic sign detection method based on edge and shape feature fusion as claimed in claim 6, characterized in that: The shape prior convolution module consists of three parallel branches, including a circular convolution block branch, a triangular convolution block branch and a common convolution block extraction branch.
8. The YOLOv8s traffic sign detection method based on edge and shape feature fusion as claimed in claim 7, characterized in that: The working process of the shape prior convolution module is as follows: the input feature map is input into three branches respectively, and the circular convolution kernel, the triangular convolution kernel and the ordinary convolution kernel are used for downsampling and activation kernel to perform feature fusion to obtain the output feature map.
9. The YOLOv8s traffic sign detection method based on edge and shape feature fusion as claimed in claim 8, characterized in that: The convolution kernel initialization process of the circular convolution block branch is as follows: Step 121: Define a function named initialize circular convolution kernel, which accepts two parameters: convolution kernel size and output channel number; Step 122: Calculate the radius of the convolution kernel, where the radius is equal to the convolution kernel size divided by 2; Step 123: Determine the coordinates of the center point of the convolution kernel, where the horizontal and vertical coordinates of the center point are both values of the radius; Step 124: Initialize an all-zero matrix as the weight matrix of the convolution kernel, and the dimension of the matrix is [number of output channels, number of output channels, convolution kernel size, convolution kernel size]; Step 125: Use two nested loops to traverse each element of the convolution kernel matrix: the outer loop variable is from 0 to the convolution kernel size minus 1, and the inner loop variable is from 0 to the convolution kernel size minus 1; Step 126: For each element, calculate the sum of the squares of its distance from the center point and compare it with the square of the radius 2: if the sum of the squares of the distances is less than or equal to the square of the radius, the element is inside the circle and the corresponding convolution kernel weight is set to 1; otherwise, the element is outside the circle and the corresponding convolution kernel weight is set to 0; Step 127: Return the initialized convolution kernel weight matrix.
10. The YOLOv8s traffic sign detection method based on edge and shape feature fusion as claimed in claim 8, characterized in that: The weight W of the circular convolution kernel y for The weight W of the triangular convolution kernel s for
Citation Information
Patent Citations
Traffic sign detection method based on improved YOLOv5s
CN116778456A
Traffic sign board detection method based on improved YOLOv8s
CN117392640A
Cited By
Rubber accelerator particle diameter monitoring method and system based on optic nerves
CN119067973A
Underground small target hyperbolic echo detection method and system, electronic equipment and medium
CN119131330A
Method, system, electronic equipment and medium for detecting small underground targets by hyperbolic echo
CN119131330B
Flame and smoke detection method based on RoseConv2d
CN120071247A
Flame and smoke detection method based on roseconv2d
CN120071247B
