Improved YOLOv11 traffic sign recognition and detection method
By improving the IPC3k2, SomSPPF and MSCATR modules of the YOLOv11 model, the accuracy bottleneck problem of YOLOv11 in complex traffic scenarios is solved, the robustness and accuracy of traffic sign detection is improved, while maintaining the real-time and computing efficiency of the model.
Patent Information
- Application Number
- CN202510692192.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-08-19
AI Technical Summary
The existing YOLOv11 model faces accuracy bottlenecks in complex traffic scenarios, and it is difficult to effectively deal with the color distortion or edge blur caused by environmental interference such as strong light reflection, rainy and foggy weather, low illumination at night, the lack of features in the occlusion scenario, and the insufficient detection recall of multi-scale targets, and the high computational redundancy leads to inference delays, which makes it impossible to balance accuracy and efficiency.
The IPC3k2 module was introduced to replace standard convolution, embed the Coard coordinate attention mechanism, and combined with the dual-branch Ghoost feature fusion; the SomSPPF module was introduced to the backbone network to integrate the multi-scale deformable pyramid pooling and the two-dimensional attention mechanism; the MSCATR module was introduced to the neck network for dynamic channel fusion and three-axis cross-dimensional attention interaction, and the features were optimized by learning residual parameters.
It significantly improves the detection robustness and accuracy of complex lighting, occlusion and multi-scale scenarios, maintains the real-time and computing efficiency of the model, and enhances the ability to discriminate complex background interference.
Smart Images

Figure CN120510593A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of target detection, and in particular to a traffic sign detection method based on an improved YOLOv11. Background Art
[0002] In intelligent transportation systems, accurate detection of traffic signs is a core requirement for autonomous driving and road safety. However, the existing detection algorithm based on YOLOv11 faces significant accuracy bottlenecks in complex road scenarios.
[0003] In complex traffic scenes, environmental interference such as strong light reflection, rainy and foggy weather, and low illumination at night can cause sign color distortion or blurred edges. The feature extraction network of traditional models is unable to discriminate low-contrast targets, resulting in an increased false detection rate. Partial occlusion scenes (such as trees or vehicles blocking signs) further exacerbate the problem of missing features, and existing algorithms find it difficult to reconstruct complete sign features from local fragments.
[0004] Although high-resolution traffic images (such as 4K / 8K surveillance footage) can provide rich details, the conventional convolutional layers of YOLOv11 are not sensitive enough to subtle textures (such as speed limit sign numbers and arrow symbols). The deep network loses semantic information of small-scale signs due to feature compression, especially the positioning accuracy of small signs in the distance is significantly reduced.
[0005] The coexistence of multi-scale objects is particularly problematic. Within the same scene, the feature distributions of large nearby signage and smaller, more distant warning signs differ significantly. YOLOv11's fixed pyramid structure suffers from information misalignment when fusing cross-scale features, resulting in insufficient recall for small object detection. While existing improvements have improved performance in some scenarios by adding attention modules or complex feature fusion strategies, they suffer from excessive computational redundancy, leading to inference delays and a struggle to strike a balance between accuracy and efficiency.
[0006] Furthermore, complex background interference (such as billboards, traffic lights, and similar signs) can lead to false model activations. Existing algorithms have limited ability to model spatial contextual relationships and are unable to effectively distinguish highly similar interfering objects. While traditional data augmentation and multi-scale training strategies can alleviate some of these issues, model generalization is still limited by the diversity of complex scenes.
[0007] The above defects restrict the reliability of traffic sign detection algorithms in real road scenarios. There is an urgent need for a high-precision optimization solution that can enhance the model's ability to distinguish complex lighting, multi-scale targets, subtle textures, and similar interferences without significantly sacrificing efficiency, thereby breaking through the accuracy bottleneck of existing algorithms. Summary of the Invention
[0008] Purpose of the invention: To address the problems of low multi-scale feature fusion efficiency, insufficient positioning accuracy in complex scenes, and poor interference robustness in YOLOv11 in traffic sign detection, the present invention proposes a traffic sign detection method based on improved YOLOv11. The IPC3k2 module is introduced into the backbone network to enhance the spatial positioning capability. The SomSPPF module is designed to fuse deformable multi-scale pooling and dual-dimensional attention mechanism to optimize feature discriminability. The MSCATR module is embedded in the neck network to realize dynamic coordination of multi-scale and cross-dimensional attention. Multi-level feature enhancement is achieved through the learnable residual parameter γ.
[0009] Technical solution: The present invention provides a traffic sign detection method based on YOLOv11, which includes the following steps:
[0010] Step 1: Obtain the traffic sign dataset and divide it into training set, validation set, and test set;
[0011] Step 2: Based on the backbone structure of YOLOv11, the IPC3k2 module is proposed to replace the traditional C3k2 module. The IPC3k2 module replaces the standard convolution with the Ghoost module and embeds the Coard coordinate attention mechanism in the Bottleneck to enhance the spatial positioning capability. The IPC3k2 module also introduces a dual-branch Ghoost feature fusion structure.
[0012] Step 3: In the YOLOv11 backbone network, the SomSPPF module is proposed to replace the SPPF module. The SomSPPF module integrates the channel and spatial dual-dimensional attention coordination mechanism and the SamReBlock reparameterizable convolution block based on the original SPPF module;
[0013] Step 4: The MSCATR module is introduced into the neck network of YOLOv11 and connected between the C3k2 module and the detection head. It uses dynamic fusion of MSCAD multi-scale features and three-axis attention cross-dimensional interaction to establish a spatial coordination mechanism through cross-space fusion, and combines the learnable parameter γ to achieve residual multi-level feature optimization;
[0014] Step 5: Use the improved target detection model from steps 2 to 4 to train the dataset, and evaluate the model based on the training results.
[0015] Furthermore, the IPC3k2 module is as follows:
[0016] The IPC3k2 module first replaces the standard convolution in the original C3k2 module with a lightweight 1×1 Ghoost module. The 1×1 Ghoost module uses a feature concatenation structure of 1×1 baseline convolution and 3×3 depth-separable convolution.
[0017] In the Bottltneck of the original C3k2 module, the traditional dual convolution module is replaced with a 3×3 Ghoost module. The 3×3 Ghoost module includes a feature concatenation structure using 3×3 base convolution and 3×3 depthwise separable convolution. The Coard coordinate attention mechanism is embedded after the 3×3 Ghoost module to achieve joint spatial-channel weight calibration.
[0018] In the C3k=True or C3k=False mode, a dual-branch Ghoost feature fusion structure is introduced. One branch enhances the key area representation through a multi-layer fusion of 3×3 Ghoost modules and a Bottleneck stack of coordinate attention mechanism, while the other branch directly retains the original feature stream through a 1×1 Ghoost module. Finally, the dual-path information is fused through channel splicing and lightweight convolution.
[0019] Furthermore, in C3k=True mode, all convolutions in the submodule C3k of the C3k2 module are replaced by 1×1 Ghoost modules.
[0020] Furthermore, the SomSPPF module in step 3 is specifically as follows:
[0021] The multi-scale pyramid pooling layer (SPPF) module uses a three-stage cascaded maximum pooling operation. After the input features are compressed through 1×1 convolution, contextual information of different receptive fields is captured through progressively larger pooling windows. The pooled multi-scale features are concatenated along the channel dimension and then restored to the original number of channels through 1×1 convolution, forming a pyramid structure covering small, medium, and large scale features.
[0022] Two-dimensional attention coordination mechanism: The output features of the SPPF module pass through the channel attention module and the spatial attention module in series. The channel attention module generates a channel statistical vector through global average pooling, and recalibrates the channel dimension through two layers of fully connected layers. The spatial attention module performs channel dimension mean and maximum dual pooling on the features output by the channel attention module, concatenates the results, and generates a spatial weight map through 7×7 convolution.
[0023] The reparameterizable convolution block SamReBlock adopts a dual-branch structure in the training phase: 3×3 depth-wise separable convolution is used to extract local features, and 1×1 standard convolution captures global associations; in the inference phase, the two convolution kernel weights are superimposed through parameter fusion technology to convert them into an equivalent 3×3 depth-wise separable convolution, and the residual connection structure is used to ensure the stability of feature transfer.
[0024] Furthermore, the MSCATR attention module consists of a multi-scale convolutional attention unit, a three-axis cross-dimensional attention unit, and an adaptive feature fusion unit. Its processing flow is as follows:
[0025] (1) The input features are processed by a multi-scale convolutional attention unit, and spatial features are extracted in parallel through 5×5 basic convolution and multiple sets of directional convolution kernels. The output features of each branch are superimposed and then subjected to 1×1 convolution to generate a spatial attention weight matrix, which is then multiplied element-by-element with the original features.
[0026] (2) Input the spatially enhanced features into the three-axis cross-dimensional attention unit and perform the following operations in sequence:
[0027] (a) Permuting the feature map along the channel-width dimension and computing the channel-space association weights through gated attention;
[0028] (b) Permuting the feature map along the height-channel dimension and calculating the height-channel association weights through gated attention;
[0029] (c) Directly apply gated attention to the original spatial dimension features to calculate spatial weights;
[0030] (d) weighting and summing the three-axis attention output features according to a preset ratio;
[0031] (3) Input the multi-scale features and the three-axis cross-dimensional features into the adaptive feature fusion unit for feature fusion;
[0032] (4) The output features of the adaptive feature fusion unit are residually connected with the input features of the MSCATR attention module through the learnable parameter γ to output the final enhanced features, whose dimension is consistent with the input features.
[0033] Furthermore, the adaptive feature fusion unit processes input features in parallel through dynamic channel fusion and cross-space fusion; dynamic channel fusion performs global average pooling on the input feature map to generate a channel statistical vector, and generates a channel-sensitive weight matrix through a fully connected network; cross-space fusion extracts spatial maximum features and mean features of the input feature map in parallel, and after splicing, generates a spatial complementary weight matrix through 7×7 convolution; the channel and spatial fusion features are added at the pixel level to generate mixed enhanced features, and then the spatial features are recombined through depth-wise separable convolution, and a high-order feature table is generated through GELU activation function and 1×1 convolution.
[0034] Beneficial effects:
[0035] 1. Based on the YOLOv11 backbone network, this paper proposes an innovative IPC3k2 module, adopts the Ghoost module to replace the standard convolution to achieve lightweight feature extraction, and combines the dual-branch Ghoost feature fusion strategy. The first branch extracts local detail features through continuously stacked 3×3 Ghoost modules and a Bottleneck structure embedded with coordinate attention. The second branch directly captures multi-scale contextual information through a 1×1 Ghoost module, generates spatially sensitive weights through global pooling in the height and width directions, and enhances the positioning accuracy of traffic signs.
[0036] 2. This paper proposes a new SomSPPF module, which integrates deformable multi-scale pyramid pooling to dynamically adjust the pooling area, combines the dual-dimensional calibration mechanism of channel attention and spatial attention, and collaboratively optimizes channel statistical features and spatial context information through the channel-space fusion module. It also integrates reparameterized convolution technology, retains the multi-branch structure to enhance feature diversity during the training phase, and fuses it into an equivalent single convolution structure during the inference phase to improve computational efficiency.
[0037] 3. The present invention introduces the MSCATR attention module into the neck network. It fuses the multi-scale convolutional features of MSCAD with the cross-dimensional interactive features of the three-axis attention through dynamic channels, establishes a spatial complementary mechanism using the cross-space fusion module, and balances the contributions of multi-level features with the adaptive feature fusion strategy. Finally, it implements residual feature weighting through the learnable parameter γ, significantly improving the detection robustness under complex lighting, occlusion, and multi-scale scenes. The MSCATR module is embedded in the P3 / 8, P4 / 16, and P5 / 32 levels of the detection head, acting on the feature maps of small targets, medium targets, and large targets respectively. It strengthens the spatial positioning capability through the multi-scale convolution kernel, dynamically suppresses background interference with the cross-dimensional attention, and uses the γ parameter to adaptively adjust the residual fusion weights of shallow details and deep semantics, ensuring the consistency of multi-scale features while improving accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 This is a diagram of the improved YOLOv11 network structure in an embodiment of the present invention;
[0039] Figure 2 This is a structural diagram of the IPC3k2 module in an embodiment of the present invention;
[0040] Figure 3 This is a structural diagram of SomSPPF in an embodiment of the present invention;
[0041] Figure 4 This is a structural diagram of MSCATR in an embodiment of the present invention;
[0042] Figure 5 This is a diagram of the multi-scale convolutional attention structure in the MSCATR module of the present invention;
[0043] Figure 6 This is a diagram of the three-axis attention structure in the MSCATR module of the present invention;
[0044] Figure 7 This is a structural diagram of the adaptive feature fusion unit in the MSCATR module of the present invention;
[0045] Figure 8 This is a diagram of the improved YOLOv11 training results in an embodiment of the present invention;
[0046] Figure 9 This is an unimproved YOLOv11 detection dataset image in an embodiment of the present invention;
[0047] Figure 10 This is an improved YOLOv11 detection dataset image in an embodiment of the present invention; DETAILED DESCRIPTION
[0048] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present invention.
[0049] The present invention discloses a traffic sign detection method based on an improved YOLOv11, comprising the following steps:
[0050] Step 1: Obtain the traffic sign dataset and divide it into training set, validation set, and test set.
[0051] Step 2: Based on the YOLOv11 backbone structure, an innovative IPC3k2 layer is proposed. This module replaces the standard convolution with Ghoost to construct a lightweight feature extraction structure, and embeds a coordinate attention mechanism in Bottleneck to enhance spatial positioning capabilities. Combined with a dual-branch Ghoost feature fusion structure, it significantly improves traffic sign detection accuracy and robustness in complex scenarios while maintaining real-time performance.
[0052] See also Figure 2 The IPC3k2 layer replaces the standard convolution in the original C3k2 module with a lightweight 1×1 Ghoost module. The 1×1 Ghoost module uses a feature concatenation structure of 1×1 baseline convolution and 3×3 depthwise separable convolution. In Botltneck, the traditional dual convolution module is optimized into a 3×3 Ghoost module, namely 3×3 baseline convolution and 3×3 depthwise separable convolution. Coordinate attention is embedded after the Ghoost module to achieve joint spatial-channel weight calibration.
[0053] In C3k=True mode, all convolutions in submodule C3k are replaced by 1×1 Ghoost modules.
[0054] In addition, a dual-branch Ghoost feature fusion structure is introduced. One branch is a multi-layer fusion of 3×3 Ghoost extraction and coordinate attention mechanism Bottleneck stacking to enhance the key area representation, and the other branch directly retains the original feature flow through a 1×1 Ghoost module, and finally fuses the dual-path information through channel splicing and lightweight convolution.
[0055] The Ghoost module uses a dual-branch feature generation architecture consisting of a 1×1 base convolution layer and a 3×3 depth-separable convolution layer. The mathematical implementation is as follows: the input feature tensor is first compressed by the 1×1 base convolution to generate intermediate features, where the number of intermediate channels is Determine (C out is the number of output channels, and ratio is the preset channel compression ratio parameter); at the same time, the intermediate features are further input into a 3×3 depth-separable convolution branch, and the number of convolution kernel groups is equal to the number of intermediate channels C mid , generate cheap features F cheap ; Finally, through the channel dimension splicing operation Y=Concat(F mid ,F cheap ) forms the complete output feature Y∈R Cout×H×W , where the total number of parameters is jointly determined by the parameters of the baseline convolution and the depth-wise separable convolution. By adjusting the value of ratio, the parameter ratio of the baseline convolution and the depth-wise convolution is dynamically controlled to achieve configurable optimization of the model's computational complexity.
[0056] The coordinate attention mechanism of the Bottleneck structure embedding in this invention sets the input feature of the Bottleneck structure to be X1∈R C×H×W Adaptive global average pooling is performed along the height and width directions respectively to generate direction-sensitive feature vectors of size [H, 1] and [1, W]. The pooling operations in the height and width directions are shown in Equations (1) and (2):
[0057] Height Directional Pooling: Width-wise pooling:
[0058] In the formula, the input feature Figure X 1∈R C×H×W Contains C channels, height H and width W. Height-wise pooling averages each height h and channel c along the width W, outputting Z h ∈R C×H×1 ; The width-wise pooling averages each width w and channel c along the height direction H, and outputs Z w ∈R C×1×W These two operations compress the width and height dimensions respectively, preserving the global context information along different directions.
[0059] By sharing the 1×1 convolutional layer W s ∈R C / r×2C×1 Perform channel compression (the compression rate is controlled by r, satisfying the constraint condition C / r ≥ 8, C is the number of channels, C / r is the number of channels after compression), and output feature F c As shown in formula (3):
[0060] F c =SiLU(BN(W s *Concat(Z h ,Z w )))∈R C / r×H×W (3)
[0061] Where Z h is a highly pooled feature, Z w is the width pooling feature, Concat is the splicing operation, W s is the weight matrix, BN is the quasi-normalization operation, and SiLU is the activation function.
[0062] After batch normalization and SiLU activation, independent height / width 1×1 convolutional layers W' are used h ∈R C ×C / r×1×1 and W' w ∈R C×C / r×1×1 Restore the original channel dimension, and the height weight and width weight outputs are shown in Equation (4) and Equation (5):
[0063] Height weight: W h =Sigmoid(W' h *F c )∈R C×H×1 (4)
[0064] Width weight: W w =Sigmoid(W' w *F c )∈R C×1×W (5)
[0065] Where W' h is the height convolution weight, W' w is the width convolution weight, * is the convolution operation, and Sigmoid is the activation function.
[0066] Finally, the spatial attention weight matrix is generated by the Sigmoid function, and the height weight and width weight are multiplied element by element and then dot-producted with the original input feature (X1(h,w,c) is the eigenvalue of the cth channel at position (h,w)). The output feature Y1(h,w,c) is shown in formula (6):
[0067] Y1(h,w,c)=X1(h,w,c)·W h (h,c)·W w (w,c)∈R C×H×W (6)
[0068] The above formula is used to realize the adaptive correlation calibration between channel response and spatial position.
[0069] Step 3: In the YOLOv11 backbone network, see Figure 3 , adding a new SomSPPF, integrating multi-scale deformable pyramid pooling, channel and space dual-dimensional attention mechanism and reparameterization technology, realizing channel-space collaborative attention optimization through channel-space fusion, and combining dynamic reparameterization strategy to enhance multi-scale adaptability, see Figure 3 .
[0070] Multi-scale pyramid pooling layer: Set the input features of the SomSPPF module (H×W is the spatial size of the feature map C in (number of input channels) through 1×1 convolution compression channel to C out (C out =C in / 4), the compression feature Y2 is shown in formula (7):
[0071]
[0072] Where C out is the number of output channels, Conv2D is the convolution operation, W1 is the 1×1 convolution kernel weight matrix in the multi-scale pyramid pooling layer, R represents a real number set, Indicates that all elements of W1 are real numbers and the shape is (C out ,C in ,1,1).
[0073] The compressed feature Y2 is subjected to three-level maximum pooling operations in parallel (all using 5×5 kernel size, different step lengths to capture multiple scales, and a padding parameter of 2). The receptive field is controlled by different step lengths (1 / 2 / 4) to capture local to global context. The pooling result P i As shown in formula (8):
[0074] P i =MaxPool(Y2,kernel_size=5,stride=s,padding=2)(i=1,2,3) (8)
[0075] Where kernel_size is the pooling window size, padding is the edge padding parameter, and s controls the scale step parameter, whose values are: level 1 (small scale): s = 1; level 2 (medium scale): s = 2; level 3 (large scale): s = 4.
[0076] The multi-scale features after pooling are aligned to the original resolution pooling feature result P' by bilinear interpolation i As shown in formula (9):
[0077] P′ i =Upsample(P i ,size=(H,W))(i=1,2,3) (9)
[0078] Where Upsample is the upsampling operation and size = (H, W) is the target size.
[0079] Then, the multi-scale fusion features are formed by splicing along the channel dimension. The multi-scale feature result after splicing is F concat As shown in formula (10):
[0080]
[0081] Then the original number of channels is restored through 1×1 convolution, and the final output feature Y final The result is shown in formula (11):
[0082]
[0083] A pyramid structure covering small, medium, and large scale features is formed, and the total parameter quantity P is shown in formula (12):
[0084] P=C in C out +3C out C in (12)
[0085] Two-dimensional attention coordination mechanism: The channel attention module obtains the final output feature Y obtained by the previous level convolution operation final As input feature X3∈R C×H×W The channel statistics vector Z is generated by global average pooling. c As shown in formula (13):
[0086]
[0087] Where C is the number of channels; H, W are the height and width of the feature map; X3(h,w,c) is the value of the cth channel at position (h,w); Z c is the compressed channel statistics vector.
[0088] After two layers of fully connected layers (the compression rate of the middle layer is 16, that is, W3∈R C / 16×C ,W4∈R C×C / 16 ) to achieve channel weight calibration (s c =σ(W3δ(W2Z c )), where δ is ReLU activation, σ is Sigmoid function, s c is the channel attention weight).
[0089] The spatial attention module performs mean and maximum dual-channel pooling on the input features along the channel dimension, and the average result F avg and the maximum two-way pooling result F max As shown in formula (14) and formula (15):
[0090]
[0091] F max =max c X4(:,:,c)∈R H×W (15)
[0092] Where X4∈R C×H×W is the channel weight calibration output feature map, and C is the number of channels.
[0093] F avg With F max Splicing along the channel dimension to generate spatial attention input features F concat1 , and then generate the spatial weight map s through 7×7 convolution s =σ(W s1 *F concat1 ), W s1 is the 7×7 convolution weight matrix.
[0094] Both adopt a serial structure, first perform channel dimension calibration X4=X3⊙s c , then perform spatial dimension enhancement Y'=X4⊙s s , where ⊙ represents element-wise multiplication.
[0095] Reparameterizable convolutional block: SamReBlock adopts a dual-branch structure in the training phase: the output feature map Y' with enhanced spatial dimension is used as input feature Through 3×3 depth separable convolution, the output result F dw As shown in formula (16):
[0096]
[0097] Where DepthwiseConv is a depth-wise separable convolution; W d is the depthwise convolution kernel weight.
[0098] Processed in parallel with the 1×1 standard convolution, the output is shown in formula (17):
[0099]
[0100] Where W5 is the 1×1 convolution kernel weight.
[0101] Output feature fusion is Y train =F dw +F 1x1 .
[0102] Reparameterizable convolution block: SamReBlock uses parameter fusion technology to convert the convolution kernel of the training branch into a single 3×3 convolution structure during the inference phase. The specific fusion process is as follows:
[0103] Weight fusion: Zero-fill the 1×1 convolution kernel to 3×3 size, and add it to the 3×3 depth-separable convolution kernel channel by channel to generate the equivalent convolution kernel weight W fuse As shown in formula (18):
[0104]
[0105] Where ZeroPad(·) means padding the 1×1 convolution kernel with zeros to a size of 3×3.
[0106] Bias fusion: Synchronously fuse the bias terms of two convolution operations to generate an equivalent bias b fuse =b d +b1,b d ∈R Cin is the 3×3 convolution bias, b1∈R Cout is the 1×1 convolution bias.
[0107] The fused weight W is reconstructed by equivalent convolution fuse With bias b fuse Combined into a normal 3×3 convolution, and then with a residual connection structure (when C in ≠C out When passing X shortcut =Conv2D(X2,W S1 )W S1 is the weight matrix) aligns the channel dimension to ensure the stability of feature transfer, and finally outputs Y f =Y infer +X shortcut (Y infer This design enables the module to have multi-path feature learning capabilities during training while maintaining single-path computation efficiency during inference.
[0108] Step 4: Introduce the MSCATR module into the neck network, use dynamic channel fusion of MSCAD multi-scale features and three-axis attention cross-dimensional interaction, establish a spatial coordination mechanism through cross-space fusion, and combine the learnable parameter γ to achieve residual multi-level feature optimization.
[0109] See also Figures 4 to 7 ,MSCATR attention module consists of multi-scale convolutional attention unit, three-axis cross-dimensional attention unit and adaptive feature fusion unit, and its processing flow is as follows:
[0110] (1) The input features are processed by a multi-scale convolutional attention unit, and spatial features are extracted in parallel through a 5×5 basic convolution and multiple sets of directional convolution kernels (7 / 11 / 21 in the horizontal direction and corresponding convolution kernels in the vertical direction), where:
[0111] The horizontal convolution kernel size is 1×k (k∈{7,11,21}), and the output is shown in the following formula:
[0112]
[0113] Where, is the horizontal convolution output feature map, X6 is the feature map of the input MSCATR module, that is, the output feature map of the C3k2 module of the neck network, X6∈R C×H×W , W 1×k is the horizontal convolution kernel weight.
[0114] The vertical convolution kernel size is k×1, and the hysteresis direction convolution output result is As shown below:
[0115]
[0116] Where W k×1 is the vertical convolution kernel weight.
[0117] The output features of each branch are superimposed and then 1×1 convolution is performed to generate the spatial attention weight matrix S, which is then multiplied element-by-element with the original features to output Y. all .
[0118] (2) The spatially enhanced output Y all As input feature X enh Enter the three-axis cross-dimensional attention unit and perform the following operations in sequence:
[0119] (a) Permuting the feature map along the channel-width dimension and calculating the channel-space association weight F through gated attention cw , the weight F cw Applied to the permuted feature map to generate weighted features The permutation output feature result is shown in formula (21):
[0120]
[0121] Where, X enh It is a multi-scale convolutional attention output feature map with a dimension of [Batch, C, H, W], where Batch is a batch and Permute is a dimension reordering operation.
[0122] (b) Permuting the feature map along the height-channel dimension and calculating the height-channel association weight F by gated attention hc , the weight F hc Applied to the permuted feature map to generate weighted features The permutation output feature result is shown in formula (22):
[0123]
[0124] (c) Apply gated attention directly to the original spatial dimension features to calculate the spatial weight F sp , the generated spatial attention weight F sp Applied to input features Figure X enh , get the spatial attention feature The output is as follows:
[0125] F sp =σ(Conv(Z-Pool(X enh ))) (twenty three)
[0126]
[0127] Among them, σ represents the sigmoid activation function, and Z-Pool is the global average pooling operation.
[0128] (d) The three-axis attention output features are weighted and summed according to the preset ratio to generate the comprehensive weight F 3axis , the comprehensive weight F 3axis Applied to the original input features Figure X enh , and get the final output feature X all =X enh ×F 3axis :
[0129] F 3axis =0.3F cw +0.3F hc +0.4F sp (25)
[0130] Where, F cw is the channel-width axis attention weight; F hcis the height-channel axis attention weight; F sp is the spatial dimension attention weight.
[0131] (3) The output feature X after multi-scale enhancement enh And the three-axis cross-dimensional output feature X all The adaptive feature fusion unit is input, channel-sensitive weights are generated through the dynamic channel fusion module, spatial complementary weights are generated through cross-space fusion, and then the two features are weightedly fused in the channel dimension.
[0132] Cross-space fusion extracts the spatial maximum and mean features of the input features in parallel. The maximum result is shown in formula (26), and the mean result is shown in formula (27):
[0133] F m =max(X enh ,X all ) (26)
[0134] F a =avg(X enh ,X all ) (27)
[0135] Where, X enh is the feature after multi-scale enhancement; max is the spatial maximum operation; avg is the spatial mean operation.
[0136] The spatial complementary weights are generated by 7×7 convolution to achieve adaptive feature optimization in spatial dimension. The channel and spatial fusion features are then added pixel by pixel to generate hybrid enhanced features. The spatial features are then reorganized by depthwise separable convolution, and high-order feature representation is generated by GELU activation function and 1×1 convolution to output the final feature F. fused .
[0137] (4) The optimized features are residually connected with the input features through the learnable parameter γ, with an initial value of 1. During the training process, γ will dynamically adjust its value according to the gradient of the loss function. The output result Ys is shown in formula (28):
[0138] Y s =γX6+F fused (28)
[0139] Where, F fused is the output feature of the adaptive feature fusion unit, Y s For the final enhanced features, their dimensions are consistent with the input features.
[0140] Step 5: Use the improved target detection model from steps 2 to 4 to train the dataset, and evaluate the model based on the training results.
[0141] The modified YOLOv11 model backbone network is as follows Figure 1 As shown in the figure, the IPC3k2 module is introduced in the 2nd / 4th / 6th / 8th layers, lightweight feature extraction is achieved through the Ghoost dual-branch structure, the internal Bottleneck embedding coordinate attention mechanism is used to enhance the spatial positioning ability through the horizontal-vertical attention weighting.
[0142] The 9th layer is replaced by the improved SomSPPF module, which uses multi-scale deformable pyramid pooling (5×5 / 7×7 dynamic convolution kernels) to capture cross-scale features, integrates channel calibration and spatial calibration, and achieves training-inference structure optimization through reparameterized convolution.
[0143] The MSCATR attention module is embedded in the 16th / 19th / 22nd layers, and a dynamic channel fusion mechanism is used to achieve multi-level feature optimization. A spatial coordination mechanism is established through cross-space fusion, and multi-scale convolutional attention is adaptively coordinated with three-axis cross-dimensional attention.
[0144] The original YOLOv11 network and the improved new YOLOv11 network are trained as follows:
[0145] Original YOLOv11 network: Use YOLOv11n.pt weights and the YOLOv11 network to iteratively train on the traffic sign dataset. Runtime: Python 3.9.19, torch 2.0.0 + cu118, CUDA: 0 (NVIDIA GeForce RTX4060 laptop GPU, 8188 MiB). Model size: 5.6 MB, number of parameters: 2613378, GFLOPs: 6.5.
[0146] During the model training process, after 200 iterations of training, the dataset detection pictures are as follows Figure 9 As shown in the figure, when training with 200 iterations and weight n files, the number of parameters is large, the model training is complex, and the training time is long.
[0147] The original YOLOv11 model suffers from structural limitations in traffic sign detection scenarios. Its fixed-architecture C3 layer and SPPF module struggle to effectively capture the detailed features of deformed objects and occluded signs, resulting in significant missed detections in complex road scenarios. The model's neck network, lacking a multi-dimensional attention interaction mechanism, is prone to misjudgment under variable environmental conditions such as strong lighting interference or rainy and foggy weather. Furthermore, the existing architecture's ability to represent small-scale traffic signs at long distances is weak, and the overall computational load is incompatible with the low-power requirements of embedded devices, hindering the real-time and stability of actual road deployments.
[0148] Experiments show that the accuracy of map50 reaches 99.3%. After 238 information processing layers, the number of parameters is 2613378 parameters, GFLOPs reaches 6.5, and the model size is 5.6MB.
[0149] Improved YOLOv11 Network: We iteratively trained the traffic sign dataset using the YOLOv11n.pt weights and the improved YOLOv11 network. We ran Python 3.9.19, torch 2.0.0 with cu118, and CUDA code 0 (NVIDIA GeForce RTX4060 laptop GPU, 8188 MiB). Model size: 6.7 MB, number of parameters: 3,134,553, and GFLOPs: 8.2. Figure 8 This is the improved YOLOv11 training result diagram of the present invention.
[0150] During the model training process, after 200 rounds of training, the improved dataset detection pictures are as follows Figure 10 After model training, the model size is 6.7MB, the number of parameters is 3,134,553, and the GFLOPs is 8.2.
[0151] Table 1
[0152] Parameter quantity Model size GFLOPs map50 average precision YOLOv11 2,613,378 5.6 6.5 0.932 Improving YOLOv11 3,134,553 6.7 8.2 0.947
[0153] According to the data in Table 1, the YOLOv11 network in this embodiment has a model accuracy improved from 0.932 to 0.947 compared to the original YOLOv11 network, with only a slight increase in model size, number of parameters, and GFLOPs.
[0154] Among them, the model accuracy map is improved by 0.947-0.932=1.5%.
[0155] Experimental results show that the improved YOLOv11 model's detection accuracy (mAP50) increases from 0.932 to 0.947. This improvement significantly enhances robustness in complex scenarios (such as object occlusion, sudden changes in illumination, and small, distant signs), validating the effectiveness of algorithm optimization in traffic sign detection tasks while keeping the model size (6.7MB) within an acceptable range for embedded devices.
[0156] The above embodiments are intended only to illustrate the technical concepts and features of the present invention. Their purpose is to enable those skilled in the art to understand the contents of the present invention and implement them accordingly. They are not intended to limit the scope of protection of the present invention. Any equivalent changes or modifications made in accordance with the spirit of the present invention are intended to be covered by the scope of protection of the present invention.
Claims
1. A traffic sign detection method based on YOLOv11, characterized in that: It includes the following steps: Step 1: Obtain the traffic sign dataset and divide it into training set, validation set, and test set; Step 2: Based on the backbone structure of YOLOv11, the IPC3k2 module is proposed to replace the traditional C3k2 module. The IPC3k2 module replaces the standard convolution with the Ghoost module and embeds the Coard coordinate attention mechanism in the Bottleneck to enhance the spatial positioning capability. The IPC3k2 module also introduces a dual-branch Ghoost feature fusion structure. Step 3: In the YOLOv11 backbone network, the SomSPPF module is proposed to replace the SPPF module. The SomSPPF module integrates the channel and spatial dual-dimensional attention coordination mechanism and the SamReBlock reparameterizable convolution block based on the original SPPF module; Step 4: The MSCATR module is introduced into the neck network of YOLOv11 and connected between the C3k2 module and the detection head. It uses dynamic fusion of MSCAD multi-scale features and three-axis attention cross-dimensional interaction to establish a spatial coordination mechanism through cross-space fusion, and combines the learnable parameter γ to achieve residual multi-level feature optimization; Step 5: Use the improved target detection model from steps 2 to 4 to train the dataset, and evaluate the model based on the training results.
2. The traffic sign detection method based on improved YOLOv11 according to claim 1, characterized in that: The IPC3k2 module is as follows: The IPC3k2 module first replaces the standard convolution in the original C3k2 module with a lightweight 1×1 Ghoost module. The 1×1 Ghoost module uses a feature concatenation structure of 1×1 baseline convolution and 3×3 depth-separable convolution. In the Bottltneck of the original C3k2 module, the traditional dual convolution module is replaced with a 3×3 Ghoost module. The 3×3 Ghoost module includes a feature concatenation structure using 3×3 base convolution and 3×3 depthwise separable convolution. The Coard coordinate attention mechanism is embedded after the 3×3 Ghoost module to achieve joint spatial-channel weight calibration. In the C3k=True or C3k=False mode, a dual-branch Ghoost feature fusion structure is introduced. One branch enhances the key area representation through a multi-layer fusion of 3×3 Ghoost modules and a Bottleneck stack of coordinate attention mechanism, while the other branch directly retains the original feature stream through a 1×1 Ghoost module. Finally, the dual-path information is fused through channel splicing and lightweight convolution.
3. The traffic sign detection method based on improved YOLOv11 according to claim 2, characterized in that: In C3k=True mode, all convolutions in the submodule C3k of the C3k2 module are replaced by 1×1 Ghoost modules.
4. The traffic sign detection method based on improved YOLOv11 according to claim 1, characterized in that: The SomSPPF module described in step 3 is as follows: The multi-scale pyramid pooling layer (SPPF) module uses a three-stage cascaded maximum pooling operation. After the input features are compressed through 1×1 convolution, contextual information of different receptive fields is captured through progressively larger pooling windows. The pooled multi-scale features are concatenated along the channel dimension and then restored to the original number of channels through 1×1 convolution, forming a pyramid structure covering small, medium, and large scale features. Two-dimensional attention coordination mechanism: The output features of the SPPF module pass through the channel attention module and the spatial attention module in series. The channel attention module generates a channel statistical vector through global average pooling, and recalibrates the channel dimension through two layers of fully connected layers. The spatial attention module performs channel dimension mean and maximum dual pooling on the features output by the channel attention module, concatenates the results, and generates a spatial weight map through 7×7 convolution. The reparameterizable convolution block SamReBlock adopts a dual-branch structure in the training phase: 3×3 depth-wise separable convolution is used to extract local features, and 1×1 standard convolution captures global associations; in the inference phase, the two convolution kernel weights are superimposed through parameter fusion technology to convert them into an equivalent 3×3 depth-wise separable convolution, and the residual connection structure is used to ensure the stability of feature transfer.
5. The traffic sign detection method based on improved YOLOv11 according to claim 1, characterized in that: The MSCATR attention module consists of a multi-scale convolutional attention unit, a three-axis cross-dimensional attention unit, and an adaptive feature fusion unit. Its processing flow is as follows: (1) The input features are processed by a multi-scale convolutional attention unit, and spatial features are extracted in parallel through 5×5 basic convolution and multiple sets of directional convolution kernels. The output features of each branch are superimposed and then subjected to 1×1 convolution to generate a spatial attention weight matrix, which is then multiplied element-by-element with the original features. (2) Input the spatially enhanced features into the three-axis cross-dimensional attention unit and perform the following operations in sequence: (a) Permuting the feature map along the channel-width dimension and computing the channel-space association weights through gated attention; (b) Permuting the feature map along the height-channel dimension and calculating the height-channel association weights through gated attention; (c) Directly apply gated attention to the original spatial dimension features to calculate spatial weights; (d) weighting and summing the three-axis attention output features according to a preset ratio; (3) Input the multi-scale features and the three-axis cross-dimensional features into the adaptive feature fusion unit for feature fusion; (4) The output features of the adaptive feature fusion unit are residually connected with the input features of the MSCATR attention module through the learnable parameter γ to output the final enhanced features, whose dimension is consistent with the input features.
6. The traffic sign detection method based on improved YOLOv11 according to claim 5, characterized in that: The adaptive feature fusion unit processes input features in parallel through dynamic channel fusion and cross-space fusion; dynamic channel fusion performs global average pooling on the input feature map to generate a channel statistical vector, and generates a channel-sensitive weight matrix through a fully connected network; cross-space fusion extracts spatial maximum features and mean features from the input feature map in parallel, and after splicing, generates a spatial complementary weight matrix through 7×7 convolution; the channel and spatial fusion features are added at the pixel level to generate mixed enhanced features, and then the spatial features are reorganized through depth-wise separable convolution, and a high-order feature table is generated through GELU activation function and 1×1 convolution.
Citation Information
Cited By
Safe wearing vision automatic detection method, device and system based on edge end equipment
CN120747873A
Edge device-based safety wear visual automatic detection method, device and system
CN120747873B
Automobile central control screen small target detection method based on YOLOv11 improvement
CN121415218A
Feature tracking-based four-quadrant identification dynamic visual tracking system
CN121600026A
Lightweight signal classification method and device based on electroencephalogram signals
CN121971108A