Traffic sign detection method based on improved yolov8n and related device

By improving the YOLOv8n network and replacing the Conv module of the backbone network with the GCConv module, and combining the LSCD detection head and the Focaler-CloU loss function, the problem of decreased traffic sign detection accuracy under severe weather conditions was solved, and efficient deployment and real-time detection were achieved on resource-constrained devices.

CN122157200APending Publication Date: 2026-06-05WUYI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WUYI UNIV
Filing Date
2026-02-25
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing traffic sign detection methods suffer from decreased accuracy under adverse weather conditions, and the efficiency and real-time performance of models deployed on vehicle-mounted devices and embedded terminals are difficult to guarantee.

Method used

An improved YOLOv8n network is adopted, which replaces the Conv module of the backbone network with the GCConv module. Combined with the LSCD lightweight detection head and the Focaler-CloU loss function, the accuracy of target bounding box regression is optimized, the feature capture capability under severe weather conditions is enhanced, and the computational cost is reduced.

Benefits of technology

To improve detection accuracy under adverse weather conditions, reduce the number of model parameters and computational load, adapt to the real-time detection needs of resource-constrained scenarios, and meet the requirements of intelligent transportation systems for high performance and low latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122157200A_ABST
    Figure CN122157200A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a traffic sign detection method based on improved YOLOv8n and related devices. The method comprises: obtaining a traffic sign image; inputting the traffic sign image into a trained target detection network to obtain a traffic sign detection result, wherein the target detection network takes YOLOv8n network as a basic framework, replaces the Conv convolution modules of the 0th layer, the 1st layer, the 3rd layer and the 5th layer in the original main network of the YOLOv8n network with GCConv modules to obtain a target main network; replaces the original Detect detection head of the YOLOv8n network with an LSCD lightweight detection head; and replaces the original CIoU loss function of the YOLOv8n network with a Focaler-CloU loss function. Based on this, the embodiments of the present application can balance the detection accuracy and lightweight of the model, and meet the requirements of intelligent transportation systems for high performance and low delay.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a traffic sign detection method and related apparatus based on an improved YOLOv8n. Background Technology

[0002] Traffic sign recognition, as a crucial foundational component of intelligent transportation systems and autonomous driving technologies, has always been an important research direction in the field of computer vision. With the rapid development of intelligent transportation systems and the widespread deployment of road perception devices, how to achieve accurate and stable recognition of traffic signs in complex real-world road environments has become one of the core issues in ensuring road traffic safety and improving the level of intelligent traffic management.

[0003] Under ideal weather conditions, deep learning-based object detection algorithms have achieved relatively good results in traffic sign recognition tasks. However, in real traffic scenarios, weather conditions are complex and changeable, with frequent occurrences of severe weather such as heavy rain, dense fog, and blizzards, which significantly affect image acquisition quality and easily lead to problems such as reduced contrast, blurred edges, and partial occlusion.

[0004] Most existing traffic sign detection methods are trained and optimized on general-purpose scene datasets, and their network structures and feature extraction capabilities are primarily designed for clear, unobstructed images. When these methods are directly applied to adverse weather scenarios, they suffer from insufficient feature representation and weak robustness, leading to a significant decrease in detection accuracy and failing to meet the comprehensive safety and reliability requirements of intelligent transportation systems. Furthermore, while existing models attempt to improve detection accuracy by introducing more complex network structures or feature fusion strategies, this often comes at the cost of increased computation and parameter size, making it difficult to guarantee deployment efficiency and real-time performance on resource-constrained platforms such as in-vehicle devices and embedded terminals. Summary of the Invention

[0005] This invention provides a traffic sign detection method and related apparatus based on an improved YOLOv8n, which can balance the detection accuracy and lightweight design of the model, meet the requirements of intelligent transportation systems for high performance and low latency, and ensure the efficient deployment of the model on vehicle systems and embedded platforms with high real-time requirements.

[0006] In a first aspect, embodiments of the present invention provide a traffic sign detection method based on an improved YOLOv8n, comprising: Acquire traffic sign images; The traffic sign image is input into a trained object detection network to obtain traffic sign detection results. The object detection network includes a target backbone network and a lightweight LSCD detection head. The target detection network is based on the YOLOv8n network framework. The Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network backbone network are replaced with GCConv modules to obtain the target backbone network. The GCConv module uses a multi-branch parallel convolutional structure to process the traffic sign image. The original Detect head of the YOLOv8n network is replaced with... The LSCD lightweight detection head includes a shared convolutional unit and an adaptive feature scaling unit. The shared convolutional unit is used to share the convolutional structure, and the adaptive feature scaling unit adopts an adaptive feature scaling mechanism. The Focaler-CloU loss function is used to replace the original CIoU loss function of the YOLOv8n network. The target bounding box regression accuracy of the target detection network is optimized based on the Focaler-CloU loss function, which is obtained by applying the Focaler-IoU loss to the CIoU loss function.

[0007] In some embodiments, the training method for the object detection network includes: Obtain a traffic sign image dataset and corresponding annotation information for the traffic sign image dataset, wherein the traffic sign image dataset is a collection of traffic sign image data under severe weather conditions; The target training image is obtained by performing size matching processing on the training images in the traffic sign image dataset; The annotation information is subjected to format conversion and category mapping to obtain the target annotation information; The target detection network is trained based on the target training image and the target annotation information to obtain the trained target detection network.

[0008] In some embodiments, the GCConv module includes a first branch, a second branch, and a third branch. The first branch and the second branch include Conv2d(3×3), BatchNorm2d, Conv2d(1×1), and BatchNorm2d connected in sequence. The third branch includes Conv2d(1×1), BatchNorm2d, Conv2d(1×1), and BatchNorm2d connected in sequence.

[0009] In some embodiments, when the GCConv module satisfies the condition that the number of output channels is equal to the number of input channels and the step size is 1, the GCConv module further includes a residual branch, which is used to apply BatchNorm2d to the input features to form residual terms.

[0010] In some embodiments, the first branch, second branch, third branch and / or residual branch of the GCConv module calculate the same traffic sign image features respectively to obtain the output results of each branch. The output results of each branch are added together according to the corresponding positions of the elements to obtain the fused features. Each fused feature is uniformly processed by the SiLU activation function to obtain the final output features of the GCConv module.

[0011] In some embodiments, the BatchNorm2d parameters in the first branch, second branch, third branch and / or residual branch of the GCConv module are uniformly transformed and merged into an equivalent 3×3 convolutional layer, and the computational structure of the GCConv module in the inference stage is represented as: Conv2d(3×3) → SiLU.

[0012] In some embodiments, the method for constructing the Focaler-CloU loss function includes: In the bounding box regression training objective, the Focaler-IoU loss is applied to the CIoU loss function, replacing the original CIoU loss function of the YOLOv8n network. The regression error is reweighted, and an improved regression loss function is constructed accordingly. The IoU mapping relationship is expressed as follows:

[0013] Where d and u represent the lower and upper thresholds of IoU, respectively, used to control the degree of attention given to different regression samples in loss calculation; the Focaler-CloU loss function is expressed as follows:

[0014] The target detection network is constructed based on the target backbone network, the LSCD lightweight detection head, and the Focaler-CloU loss function.

[0015] Secondly, embodiments of the present invention also provide a traffic sign detection device based on an improved YOLOv8n, the device comprising: The acquisition module is used to acquire traffic sign images; The detection module is used to input the traffic sign image into a trained target detection network to obtain the traffic sign detection result. The target detection network includes a target backbone network and a lightweight LSCD detection head. The target detection network is based on the YOLOv8n network framework, with the Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network backbone network replaced by GCConv modules to obtain the target backbone network. The GCConv module uses a multi-branch parallel convolutional structure to process the traffic sign image. The original YOLOv8n network detection... The head is replaced with a lightweight LSCD detection head, which includes a shared convolutional unit and an adaptive feature scaling unit. The shared convolutional unit is used to share the convolutional structure, and the adaptive feature scaling unit adopts an adaptive feature scaling mechanism. The original CIoU loss function of the YOLOv8n network is replaced with the Focaler-CloU loss function. The target bounding box regression accuracy of the target detection network is optimized based on the Focaler-CloU loss function, which is obtained by applying the Focaler-IoU loss to the CIoU loss function.

[0016] Thirdly, embodiments of the present invention also provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the traffic sign detection method based on the improved YOLOv8n as described in the first aspect.

[0017] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer-executable instructions for performing the traffic sign detection method based on the improved YOLOv8n as described in the first aspect.

[0018] According to embodiments of the present invention, a traffic sign detection method and related apparatus based on an improved YOLOv8n are provided. The improved YOLOv8n-based traffic sign detection method includes: acquiring a traffic sign image; inputting the traffic sign image into a trained target detection network to obtain a traffic sign detection result. The target detection network includes a target backbone network and a lightweight LSCD detection head. The target detection network is based on the YOLOv8n network framework, with the Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network backbone network replaced by GCConv modules to obtain the target backbone network. The GCConv modules employ a multi-branch parallel convolutional structure. The traffic sign images are processed; the original YOLOv8n network's Detect head is replaced with a lightweight LSCD head. The LSCD head includes shared convolutional units and adaptive feature scaling units. The shared convolutional units share the convolutional structure, and the adaptive feature scaling units employ an adaptive feature scaling mechanism. The original CIoU loss function of the YOLOv8n network is replaced with the Focaler-CloU loss function. The Focaler-CloU loss function optimizes the target bounding box regression accuracy of the target detection network; it is obtained by applying the Focaler-IoU loss to the CIoU loss function. Furthermore, this invention replaces the first four standard Conv modules of the backbone with the GCConv module. This reduces computational redundancy in the backbone, improves the efficiency of lightweight feature extraction, and enhances the feature capture capability for blurred and low-contrast traffic signs under adverse weather conditions by leveraging its multi-path feature learning characteristics. On the other hand, the LSCD lightweight detection head reduces redundant computation across multi-scale branches by using a shared convolutional structure. Combined with the Focaler-CIoU loss function for optimized adaptation to occluded and deformed targets, it significantly improves detection accuracy while further reducing the number of parameters and computational load. This makes it more suitable for real-time detection needs in resource-constrained scenarios such as edge computing and in-vehicle devices. Therefore, this embodiment of the invention balances detection accuracy and lightweight design, meeting the high-performance and low-latency requirements of intelligent transportation systems, and ensuring efficient deployment of the model on in-vehicle systems and embedded platforms with high real-time requirements. Attached Figure Description

[0019] Figure 1 This is the main flowchart of a traffic sign detection method based on an improved YOLOv8n provided in an embodiment of the present invention; Figure 2A This is a schematic diagram of the overall structure of the YOLOv8n network; Figure 2B This is a schematic diagram of the overall structure of a target detection network provided in one embodiment of the present invention; Figure 3This is a schematic diagram of the structure of the GCConv module provided in one embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a lightweight LSCD detection head provided in one embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a traffic sign detection device based on an improved YOLOv8n according to an embodiment of the present invention; Figure 6 This is a schematic diagram of an electronic device provided in one embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0021] It should be noted that although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first," "second," etc., in the specification, claims, and the following drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0022] In this embodiment of the invention, the terms "furthermore," "exemplarily," or "optionally" are used as examples, illustrations, or descriptions and should not be construed as being more preferred or advantageous than other embodiments or designs. The use of the terms "furthermore," "exemplarily," or "optionally" is intended to present the relevant concepts in a specific manner.

[0023] To facilitate a more convenient description of the working principle of the embodiments of the present invention, the following introduction of relevant technical scenarios is given first.

[0024] Traffic sign recognition, as a crucial foundational component of intelligent transportation systems and autonomous driving technologies, has always been an important research direction in the field of computer vision. With the rapid development of intelligent transportation systems and the widespread deployment of road perception devices, how to achieve accurate and stable recognition of traffic signs in complex real-world road environments has become one of the core issues in ensuring road traffic safety and improving the level of intelligent traffic management.

[0025] Under ideal weather conditions, deep learning-based object detection algorithms have achieved relatively good results in traffic sign recognition tasks. However, in real traffic scenarios, weather conditions are complex and changeable, with frequent occurrences of severe weather such as heavy rain, dense fog, and blizzards, which significantly affect image acquisition quality and easily lead to problems such as reduced contrast, blurred edges, and partial occlusion.

[0026] Most existing traffic sign detection methods are trained and optimized on general-purpose scene datasets, and their network structures and feature extraction capabilities are primarily designed for clear, unobstructed images. When these methods are directly applied to adverse weather scenarios, they suffer from insufficient feature representation and weak robustness, leading to a significant decrease in detection accuracy and failing to meet the comprehensive safety and reliability requirements of intelligent transportation systems. Furthermore, while existing models attempt to improve detection accuracy by introducing more complex network structures or feature fusion strategies, this often comes at the cost of increased computation and parameter size, making it difficult to guarantee deployment efficiency and real-time performance on resource-constrained platforms such as in-vehicle devices and embedded terminals.

[0027] Based on this, the present invention provides a traffic sign detection method and related apparatus based on an improved YOLOv8n. The traffic sign detection method based on the improved YOLOv8n includes: acquiring a traffic sign image; inputting the traffic sign image into a trained target detection network to obtain a traffic sign detection result, wherein the target detection network includes a target backbone network and a lightweight LSCD detection head. The target detection network is based on the YOLOv8n network framework, replacing the Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network backbone network with GCConv modules to obtain the target backbone network. The GCConv modules use a multi-branch parallel convolutional structure to process the traffic sign image; and inputting the YOLOv8n image into a trained target detection network to obtain a traffic sign detection result. The original YOLOv8n network's Detect head is replaced with a lightweight LSCD head. The LSCD head includes shared convolutional units and adaptive feature scaling units. The shared convolutional units share the convolutional structure, and the adaptive feature scaling units employ an adaptive feature scaling mechanism. The original CIoU loss function of the YOLOv8n network is replaced with the Focaler-CloU loss function. The Focaler-CloU loss function optimizes the target bounding box regression accuracy of the target detection network; it is derived by applying the Focaler-IoU loss to the CIoU loss function. Furthermore, this invention replaces the first four standard Conv modules of the backbone with the GCConv module. This reduces computational redundancy in the backbone, improves the efficiency of lightweight feature extraction, and enhances the ability to capture features of blurred and low-contrast traffic signs under adverse weather conditions by leveraging the GCConv module's multi-path feature learning capabilities. On the other hand, the LSCD lightweight detection head reduces redundant computation across multi-scale branches by using a shared convolutional structure. Combined with the Focaler-CIoU loss function for optimized adaptation to occluded and deformed targets, it significantly improves detection accuracy while further reducing the number of parameters and computational load. This makes it more suitable for real-time detection needs in resource-constrained scenarios such as edge computing and in-vehicle devices. Therefore, this embodiment of the invention balances detection accuracy and lightweight design, meeting the high-performance and low-latency requirements of intelligent transportation systems, and ensuring efficient deployment of the model on in-vehicle systems and embedded platforms with high real-time requirements.

[0028] The embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0029] like Figure 1 As shown, Figure 1 This is a flowchart of a traffic sign detection method based on an improved YOLOv8n according to an embodiment of the present invention. The traffic sign detection method based on the improved YOLOv8n may include, but is not limited to, steps S101 to S102.

[0030] Step S101: Obtain the traffic sign image; Step S102: Input the traffic sign image into the trained object detection network to obtain the traffic sign detection result. The object detection network includes an object backbone network and a lightweight LSCD detection head. The object detection network is based on the YOLOv8n network framework. The Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network backbone are replaced with GCConv modules to obtain the object backbone network. The GCConv module uses a multi-branch parallel convolutional structure to process the traffic sign image. The original YOLOv8n network detection head... The detection head is replaced with a lightweight LSCD head, which includes shared convolutional units and adaptive feature scaling units. The shared convolutional units are used to share the convolutional structure, and the adaptive feature scaling units adopt an adaptive feature scaling mechanism. The original CIoU loss function of the YOLOv8n network is replaced with the Focaler-CloU loss function. The target bounding box regression accuracy of the target detection network is optimized based on the Focaler-CloU loss function, which is obtained by applying the Focaler-IoU loss to the CIoU loss function.

[0031] It is understandable that the object detection network used in this invention replaces the Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network backbone with GCConv modules, which can enhance feature extraction capabilities under adverse weather conditions. The original YOLOv8 Detect head is replaced with a lightweight LSCD head design. The LSCD includes shared convolutional units and adaptive feature scaling units. The shared convolutional units are used to share the convolutional structure, and the adaptive feature scaling units employ an adaptive feature scaling mechanism. Focaler-IoU loss is applied to the CIoU loss function to form the Focaler-CoU loss function, which optimizes the target bounding box regression accuracy of the object detection network. Based on the synergy of GCConv replacement, LSCD head replacement, and Focaler-CIoU, the overall network achieves lower parameter count, lower computational cost, and higher inference speed at the edge. It should be noted that the Conv convolutional module in layer 7 of the original YOLOv8n network backbone can also be replaced with a GCConv module.

[0032] It is understandable that, such as Figure 2A As shown, Figure 2A This is a structural diagram of the YOLOv8n network model. The object detection network of this invention is an improvement on the YOLOv8n network model, as shown below. Figure 2BAs shown, the target detection network is based on the YOLOv8n network framework. The Conv convolutional modules in layers 0, 1, 3 and 5 of the original YOLOv8n network backbone are replaced with GCConv modules to obtain the target backbone network. The original YOLOv8n network Detect head is replaced with the LSCD lightweight detection head.

[0033] Understandably, during the model training phase, the traffic sign image dataset and its corresponding annotation information are obtained. The traffic sign image dataset is a collection of traffic sign images in adverse weather conditions. The training images in the traffic sign image dataset are subjected to size matching processing to obtain target training images. The annotation information is subjected to format conversion and category mapping processing to obtain target annotation information. The target detection network is trained based on the target training images and target annotation information to obtain a trained target detection network.

[0034] It should be noted that the traffic sign image dataset and its corresponding annotation information can be sourced from publicly available datasets or actual collected data, preferably covering traffic sign imaging scenarios under adverse weather conditions such as rain, fog, and snow. The traffic sign image dataset can be divided into training, validation, and test sets, with the division ratio set according to actual needs to ensure the independence of model training, parameter selection, and performance evaluation.

[0035] Understandably, the backbone of the object detection network is obtained by replacing the original Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network with GCConv modules. During training, the GCConv module employs a "vertical multi-convolution, horizontal multi-path" structure to enhance feature representation capabilities. During inference, it uses a reparameterization mechanism to effectively fuse the multi-branch structure into a single 3×3 convolution, thereby improving feature extraction performance without significantly increasing inference computation, making it particularly suitable for resource-constrained real-time applications.

[0036] It is understandable that, such as Figure 3 As shown, the GCConv module adopts different implementation methods in the training and inference phases to balance the model training effect and the actual deployment efficiency, as detailed below.

[0037] During the training phase of the GCConv module, the GCConv module uses a multi-branch parallel convolutional structure to process the input features. Specifically, the input features simultaneously enter multiple convolutional branches, and the structure of each branch is as follows: First branch (3×3→1×1 path): Conv2d(3×3) → BatchNorm2d → Conv2d(1×1) → BatchNorm2d.

[0038] The second branch (3×3→1×1 path): its structure is the same as the first branch, namely Conv2d(3×3) →BatchNorm2d → Conv2d(1×1) → BatchNorm2d.

[0039] The third branch (1×1→1×1 path): Conv2d(1×1) → BatchNorm2d → Conv2d(1×1) → BatchNorm2d.

[0040] For optional residual branches, when the number of output channels equals the number of input channels and the step size is 1, an identity residual branch is introduced, specifically by applying BatchNorm2d to the input features to form residual terms; when the conditions are not met, the residual branch is not enabled or the residual terms are set to 0.

[0041] Finally, the first, second, and third branches of the GCConv module, as well as the optional residual branch, each compute the same input feature. The outputs of each branch are then summed element-wise to obtain the fused feature. After the multi-branch feature summation is complete, the feature is uniformly passed through the SiLU activation function to form the final output feature of the GCConv module. This "multi-branch parallel—summation and fusion—unified activation" processing flow helps to fully utilize different convolutional paths to learn complementary feature information during the training phase.

[0042] In this way, the GCConv module can learn richer feature information by utilizing multiple convolutional paths during the training phase, which helps to improve the feature representation ability of the backbone network in complex scenarios.

[0043] During the inference phase of the GCConv module, the GCConv module no longer adopts the multi-branch parallel structure of the training phase. Instead, it uses reparameterization to equivalently fuse the convolutional layers and their corresponding BatchNorm2d parameters in each branch of the training phase, thereby simplifying the multi-branch structure into a single convolutional structure.

[0044] Specifically, during the training phase, the convolution parameters of the first, second, and third branches, as well as the BatchNorm2d parameters in the optional residual branch, are uniformly transformed and merged into an equivalent 3×3 convolutional layer. The kernel weights and biases of this equivalent convolutional layer already include the effects of the original batch normalization operation, therefore, the BatchNorm2d layer is no longer explicitly set during the inference phase. After completing the above reparameterization, the computational structure of the GCConv module during the inference phase can be represented as: Conv2d(3×3) → SiLU.

[0045] By converting the multi-branch convolutional structure in the training phase into a single-branch 3×3 convolutional structure, the GCConv module maintains the same computational form as the ordinary convolutional module in the inference phase. This preserves the feature representation capabilities learned in the training phase without increasing additional inference computation overhead, thus facilitating the efficient operation of the model in real-world deployment environments.

[0046] It is understandable that, such as Figure 4 As shown, the object detection network of this invention replaces the original Detect head of the YOLOv8n network with a lightweight LSCD head. The lightweight LSCD head includes shared convolutional units and adaptive feature scaling units. The shared convolutional units are used to share convolutional structures, and the adaptive feature scaling units employ an adaptive feature scaling mechanism. By sharing convolutional structures and combining them with the adaptive feature scaling mechanism, the lightweight LSCD head achieves efficient representation of classification and regression branches, thereby reducing the number of parameters and computational overhead while maintaining detection performance.

[0047] It should be noted that, for detection head replacement, the LSCD lightweight detection head can also be replaced with publicly available lightweight detection heads such as Efficient-Head and Slim-Detect Head.

[0048] Understandably, in the bounding box regression training objective, this invention applies the Focaler-IoU loss to the CIoU loss function and replaces the original CIoU loss function of the YOLOv8n network with it. An improved regression loss function is constructed by reweighting the regression error. Its IoU mapping relationship can be expressed as:

[0049] Here, d and u represent the lower and upper thresholds of IoU, respectively, used to control the degree of attention given to different regression samples in the loss calculation. By adjusting these threshold parameters, the loss function can focus more on regression samples with larger localization errors during training, while avoiding applying excessive gradient interference to high-quality regression samples.

[0050] The Focaler-CloU loss function is defined as follows: .

[0051] Based on the improved network structure and loss function described above, the model is trained. Training can be completed within a deep learning training framework, and hyperparameters such as learning rate, batch size, and number of training epochs can be set and adjusted according to the data scale and computing resources.

[0052] It should be noted that, for loss function replacement, Focaler-IoU can also be combined with DIoU, EIoU, GIoU, and SIoU to generate a corresponding fusion loss function to replace the original CIoU loss function of the YOLOv8n network.

[0053] To improve the model's ability to generalize to complex scenes, data augmentation strategies can be introduced during training. For example, Mosaic data augmentation can be used to stitch together multiple sample images to increase the target scale and background variation, thereby improving the model's detection adaptability under adverse weather conditions.

[0054] During model training, the improved YOLOv8n network is trained using training and validation sets to obtain a trained improved YOLOv8n network model. The improved YOLOv8n network model is then used for inference using a test set. Precision (P), recall (R), mean accuracy (mAP@50), and frames per second (FPS) are used as evaluation metrics to assess the network model's detection performance. When compared and validated under the same training configuration, this embodiment of the invention achieves improved detection performance while reducing model size, ensuring improved accuracy.

[0055] Compared with the benchmark YOLOv8n, the core advantage of this invention lies in the synergistic optimization of lightweight design and detection accuracy, and it is specifically adapted to traffic sign detection scenarios in severe weather.

[0056] On the one hand, by replacing the first four standard Conv modules of the Backbone with the GGCConv module, the computational redundancy of the backbone is reduced and the efficiency of lightweight feature extraction is improved. On the other hand, its multi-path feature learning characteristics are used to enhance the feature capture capability of blurred and low-contrast traffic signs under severe weather conditions. On the other hand, the LSCD detection head reduces redundant calculations in multi-scale branches by sharing convolutional structures, and, combined with the Focaler-CIoU loss function, optimizes the adaptation of occluded and deformed targets, thereby significantly improving detection accuracy while further reducing the number of parameters and computational load.

[0057] On the THOR dataset, the final result is a relative improvement of approximately 2.62% in mAP50 and a relative reduction of approximately 15.61% in the number of parameters, while the inference speed remains basically the same. It is more suitable for real-time detection needs in resource-constrained scenarios such as edge devices and in-vehicle devices, and its overall performance far exceeds that of the benchmark YOLOv8n, which is not optimized for severe weather.

[0058] In addition, such as Figure 5 As shown, one embodiment of the present invention also discloses a traffic sign detection device based on an improved YOLOv8n, the device comprising: Module 110 is used to acquire traffic sign images; The detection module 120 is used to input traffic sign images into a trained object detection network to obtain traffic sign detection results. The object detection network includes an object backbone network and a lightweight LSCD detection head. The object detection network is based on the YOLOv8n network framework, replacing the Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network backbone with GCConv modules to obtain the object backbone network. The GCConv module uses a multi-branch parallel convolutional structure to process the traffic sign images. The original YOLOv8n network detection... The head is replaced with the LSCD lightweight detection head, which includes shared convolutional units and adaptive feature scaling units. The shared convolutional units are used to share the convolutional structure, and the adaptive feature scaling units adopt an adaptive feature scaling mechanism. The original CIoU loss function of the YOLOv8n network is replaced with the Focaler-CloU loss function. The target bounding box regression accuracy of the target detection network is optimized based on the Focaler-CloU loss function, which is obtained by applying the Focaler-IoU loss to the CIoU loss function.

[0059] The traffic sign detection device based on the improved YOLOv8n in this embodiment of the invention is used to execute the traffic sign detection method based on the improved YOLOv8n in the above embodiment. Its specific processing procedure is the same as that of the traffic sign detection method based on the improved YOLOv8n in the above embodiment, and will not be described in detail here.

[0060] In addition, such as Figure 6 As shown, one embodiment of the present invention also discloses an electronic device, including: at least one processor 210; at least one memory 220 for storing at least one program; when the at least one program is executed by the at least one processor 210, it implements the traffic sign detection method based on the improved YOLOv8n as in any of the preceding embodiments.

[0061] In addition, one embodiment of the present invention discloses a computer-readable storage medium storing computer-executable instructions for performing the traffic sign detection method based on the improved YOLOv8n as described in any of the preceding embodiments.

[0062] The system architecture and application scenarios described in the embodiments of this invention are for the purpose of more clearly illustrating the technical solutions of the embodiments of this invention, and do not constitute a limitation on the technical solutions provided by the embodiments of this invention. As those skilled in the art will know, with the evolution of system architecture and the emergence of new application scenarios, the technical solutions provided by the embodiments of this invention are also applicable to similar technical problems.

[0063] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0064] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0065] The terms “component,” “module,” “system,” etc., used in this specification are used to refer to computer-related entities, hardware, firmware, combinations of hardware and software, software, or software in execution. For example, a component can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, or a computer. As illustrated, applications running on computing devices and computing devices can both be components. One or more components may reside in a process or execution thread, and components may be located on a single computer or distributed among two or more computers. Furthermore, these components can be executed from various computer-readable media on which various data structures are stored. Components can communicate, for example, via local or remote processes based on signals having one or more data packets (e.g., data from two components interacting with another component between a local system, a distributed system, or a network, such as the Internet interacting with other systems via signals).

Claims

1. A traffic sign detection method based on an improved YOLOv8n, comprising: Acquire traffic sign images; The traffic sign image is input into a trained object detection network to obtain traffic sign detection results. The object detection network includes a target backbone network and a lightweight LSCD detection head. The target detection network is based on the YOLOv8n network framework. The Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network backbone are replaced with GCConv modules to obtain the target backbone network. The GCConv module uses a multi-branch parallel convolutional structure to process the traffic sign image. The original YOLOv8n network Detect head is replaced with a lightweight LSCD detection head. The lightweight LSCD detection head includes shared convolutional units and adaptive feature scaling units. The shared convolutional units are used to share the convolutional structure, and the adaptive feature scaling unit uses an adaptive feature scaling mechanism. The original CIoU loss function of the YOLOv8n network is replaced with the Focaler-CloU loss function. The target bounding box regression accuracy of the target detection network is optimized based on the Focaler-CloU loss function, which is obtained by applying the Focaler-IoU loss to the CIoU loss function.

2. The method according to claim 1, characterized in that, The training method for the object detection network includes: Obtain a traffic sign image dataset and corresponding annotation information for the traffic sign image dataset, wherein the traffic sign image dataset is a collection of traffic sign image data under severe weather conditions; The target training image is obtained by performing size matching processing on the training images in the traffic sign image dataset; The annotation information is subjected to format conversion and category mapping to obtain the target annotation information; The target detection network is trained based on the target training image and the target annotation information to obtain the trained target detection network.

3. The method according to claim 1, characterized in that, During the training phase, the GCConv module includes a first branch, a second branch, and a third branch. The first branch and the second branch include Conv2d (3×3), BatchNorm2d, Conv2d (1×1), and BatchNorm2d connected in sequence. The third branch includes Conv2d (1×1), BatchNorm2d, Conv2d (1×1), and BatchNorm2d connected in sequence.

4. The method according to claim 3, characterized in that, When the GCConv module satisfies the condition that the number of output channels equals the number of input channels and the step size is 1, the GCConv module further includes a residual branch, which is used to apply BatchNorm2d to the input features to form residual terms.

5. The method according to claim 4, characterized in that, The first branch, second branch, third branch, and / or residual branch of the GCConv module calculate the same traffic sign image features respectively, and obtain the output results of each branch. The output results of each branch are added together according to the corresponding positions of the elements to obtain the fused features. Each fused feature is processed by the SiLU activation function to obtain the final output features of the GCConv module.

6. The method according to claim 4, characterized in that, During the inference phase, the BatchNorm2d parameters in the first branch, second branch, third branch and / or residual branch of the GCConv module are uniformly transformed and merged into an equivalent 3×3 convolutional layer. The computational structure of the GCConv module during the inference phase is represented as: Conv2d(3×3) → SiLU.

7. The method according to claim 1, characterized in that, The method for constructing the Focaler-CloU loss function includes: In the bounding box regression training objective, the Focaler-IoU loss is applied to the CIoU loss function, replacing the original CIoU loss function of the YOLOv8n network. The regression error is reweighted, and an improved regression loss function is constructed accordingly. The IoU mapping relationship is expressed as follows: Where d and u represent the lower and upper thresholds of IoU, respectively, used to control the degree of attention given to different regression samples in loss calculation; the Focaler-CloU loss function is expressed as follows: The target detection network is constructed based on the target backbone network, the LSCD lightweight detection head, and the Focaler-CloU loss function.

8. A traffic sign detection device based on an improved YOLOv8n, characterized in that, The device includes: The acquisition module is used to acquire traffic sign images; The detection module is used to input the traffic sign image into a trained target detection network to obtain the traffic sign detection result. The target detection network includes a target backbone network and a lightweight LSCD detection head. The target detection network is based on the YOLOv8n network framework, with the Conv convolutional modules in layers 0, 1, 3, and 5 of the original YOLOv8n network backbone network replaced by GCConv modules to obtain the target backbone network. The GCConv module uses a multi-branch parallel convolutional structure to process the traffic sign image. The original YOLOv8n network detection... The head is replaced with a lightweight LSCD detection head, which includes a shared convolutional unit and an adaptive feature scaling unit. The shared convolutional unit is used to share the convolutional structure, and the adaptive feature scaling unit adopts an adaptive feature scaling mechanism. The original CIoU loss function of the YOLOv8n network is replaced with the Focaler-CloU loss function. The target bounding box regression accuracy of the target detection network is optimized based on the Focaler-CloU loss function, which is obtained by applying the Focaler-IoU loss to the CIoU loss function.

9. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, when the processor executes the computer program, it implements the traffic sign detection method based on the improved YOLOv8n as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing computer-executable instructions for performing the traffic sign detection method based on the improved YOLOv8n as described in any one of claims 1 to 7.