YOLOv8 traffic sign real-time detection method and system based on edge calculation optimization
By pruning, quantizing, and adapting the YOLOv8 model to the environment, and combining it with the model differential update mechanism of federated learning, the contradiction between computing power and model complexity on edge computing devices and the problem of detection robustness are resolved, achieving efficient traffic sign detection.
Patent Information
- Application Number
- CN202510711280.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-26
AI Technical Summary
The existing YOLOv8 model on edge computing devices has problems such as the contradiction between computing power and model complexity, insufficient detection robustness, and low edge-cloud collaboration efficiency, making it difficult to meet the real-time and bandwidth requirements of intelligent transportation systems.
Through strategies such as model pruning, quantization processing, introduction of SE modules, generative adversarial networks, environment perception preprocessing and dynamic resolution adjustment, combined with the model differential update mechanism of federated learning, the YOLOv8 model is optimized to adapt to the computing power of edge devices, and the detection results are transmitted through a low-latency communication protocol.
It improves the accuracy and robustness of traffic sign detection, reduces computational complexity, meets the real-time detection needs of edge devices, and optimizes edge-cloud collaboration efficiency.
Smart Images

Figure CN120708168A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision and deep learning technology, and more particularly to a YOLOv8 real-time traffic sign detection method and system based on edge computing optimization. Background Art
[0002] As one of the core technologies of intelligent transportation systems, traffic sign detection has evolved from traditional image processing to deep learning-driven technologies, playing an important role in areas such as traffic safety monitoring and autonomous driving. However, existing technologies still face many key challenges.
[0003] YOLOv8, a classic version of the YOLO series, further improves detection performance while maintaining lightweight through an improved C2f feature pyramid network, TaskAlignedAssigner label assignment strategy, and mixed-precision training. Despite significant algorithmic progress, YOLOv8 still faces some key challenges in practical edge computing deployment.
[0004] First, there's a clear contradiction between edge device computing power and model complexity. Typical edge devices in intelligent transportation scenarios (such as roadside cameras and in-vehicle terminals) typically use ARM-based processors (e.g., Nvidia Jetson Nano, Raspberry Pi) or dedicated AI chips (e.g., Horizon Journey 3), with a computing power ceiling of approximately 0.5-4 TOPS and a memory bandwidth of less than 50GB / s. The native YOLOv8n model, with 3.2MB of parameters and 8.9B floating-point operations (FLOPs), outperforms mainstream two-stage algorithms. However, after INT8 quantization, it still requires approximately 2.5 TOPS of computing power to support real-time inference (above 30 FPS), according to Ultralytics' official performance report. This makes it difficult for low-end edge devices to meet real-time requirements. While existing model compression techniques (such as pruning and knowledge distillation) can reduce computational complexity, over-compression can significantly reduce the accuracy of small object detection (e.g., traffic signs typically account for less than 5% of an image), creating an optimization bottleneck between accuracy and efficiency.
[0005] Secondly, insufficient detection robustness in dynamic environments is a prominent issue. In real-world traffic scenarios, detection systems must cope with multi-dimensional environmental disturbances, such as illumination variations, occlusions, deformations, and multi-scale object distributions. Traditional data augmentation methods struggle to fully capture complex environmental conditions, and existing algorithms still need to improve their robustness to local feature loss.
[0006] Inefficient edge-cloud collaboration is also a key challenge. Existing deployment solutions often employ a "raw data upload - cloud processing - result return" model, resulting in high latency and high bandwidth consumption, making it difficult to meet the stringent real-time and bandwidth requirements of scenarios like autonomous driving.
[0007] The challenges of dynamic model updates and device management cannot be ignored. Edge devices are often deployed outdoors or in mobile scenarios, resulting in high manual maintenance costs. Existing update solutions also have security and compatibility issues, making efficient and secure model management difficult. Summary of the Invention
[0008] The main purpose of the present invention is to overcome the above-mentioned defects in the prior art and propose a YOLOv8 real-time traffic sign detection method based on edge computing optimization. Through a lightweight optimization strategy of model pruning and quantization processing, combined with an environment-adaptive image preprocessing method, the detection accuracy and robustness are improved, and high-precision and low-latency traffic sign detection is achieved to meet the actual deployment requirements of intelligent transportation systems.
[0009] The present invention adopts the following technical solutions:
[0010] The YOLOv8 real-time traffic sign detection method based on edge computing optimization includes the following steps:
[0011] Collect traffic scene image data in real time, and pre-process the collected image data to obtain pre-processed image data;
[0012] The preprocessed image data is input into the optimized YOLOv8 network model for feature extraction. Feature maps of different scales are processed by the SE module and the bidirectional feature fusion strategy before entering the detection head for target detection to obtain detection results. The optimized YOLOv8 network model introduces the SE module, the generative adversarial network, the structured pruning module, the environment perception preprocessing module, the dynamic resolution adjustment module, and the model differential update mechanism.
[0013] The obtained detection results are transmitted to the central server or autonomous driving system in a structured data format via a low-latency communication protocol;
[0014] In the central server or autonomous driving system, the detection results are counted in real time and trend analysis is performed.
[0015] Specifically, the acquisition frame rate is between 15-60 FPS.
[0016] Specifically, enter the detection head to perform target detection, specifically:
[0017] The detection head uses the IoU between the predicted box and the ground-truth box:
[0018]
[0019] Among them, IoU is the intersection over union ratio, A and B are the areas of the predicted box and the real box respectively, and the model outputs the location coordinates and category information of the candidate traffic sign through the non-maximum suppression algorithm:
[0020]
[0021] where s i is the score of the predicted box i, b i 、b j is the prediction box, N t is the non-maximum suppression threshold, N t Between 0.3 and 0.5, redundant prediction boxes are removed and the final detection results are retained. i and j are serial numbers.
[0022] Specifically, the SE module in the optimized YOLOv8 network model includes:
[0023]
[0024] s c =F exc (z c ,W)=σ(g(z c ,W))=σ(W2δ(W1z c ))
[0025] where u c is the cth channel of the input feature map, H and W are the height and width of the feature map, z c is the feature after channel compression, W1 and W2 are the weights of the fully connected layer, δ is the ReLU activation function, and σ is the Sigmoid activation function. {F}_{sq} is the channel compression operation function, which processes the cth channel {u}_{c} of the input feature map through global average pooling, compressing the spatial dimension (height H, width W) to 1, and obtaining the channel-level global feature z c , in the formula Indicates that the pixel values of all spatial positions (i, j) of each channel of the feature map are summed and averaged, where i and j are the row and column coordinate indices of the feature map, respectively, used to locate each spatial pixel point. exc Is the channel excitation operation function, through two layers of fully connected layers (weights W1 and W2 respectively) and activation function to achieve adaptive adjustment of channel weights. Among them, W1 is the weight of the dimensionality reduction fully connected layer (usually compressing the number of channels to 1 / 16 of the original number of channels), W2 is the weight of the dimensionality increase fully connected layer (restoring to the original number of channels), and the two constitute the multi-layer perceptron (MLP) structure g(·), which is used to calculate the compressed feature z c First, a nonlinear transformation is performed through W1 and ReLU activation function δ, then mapped back to the original channel dimension through W2, and finally the channel weight s is output through Sigmoid activation function σc , completing the "stimulation" of key feature channels.
[0026] Specifically, the optimized YOLOv8 network model generates an adversarial network, including:
[0027] Introducing the generative adversarial network, including the generator network G and the discriminator network D, the optimization goal of the generator is
[0028]
[0029] where p data (x) is the real data distribution, p z (z) is the noise distribution, Represents the real data distribution p data The sample x in (x) takes the expectation, that is, samples from the real traffic sign image data and calculates the statistical expectation. Denotes the noise distribution p z The noise sample z in (z) takes the expectation, that is, sampling from random noise (such as Gaussian or uniformly distributed noise) and calculating the statistical expectation. D(x) is the discriminant network's output for the real image x, used to determine whether the input image is real data. The output value is usually a probability value (e.g., close to 1 indicates that the discriminator believes it is real). G(z) is the forged image generated by the generator network based on the noise z. The goal is to generate an image that is close to the real traffic sign by learning the noise distribution, thereby deceiving the discriminator.
[0030] Specifically, it includes: the structured pruning module in the optimized YOLOv8 network model, including:
[0031] A second-order importance evaluation pruning strategy based on Taylor expansion is used to calculate the Hessian matrix approximation for the convolutional layer parameters W. Sort by importance score, channels below the threshold \tau will be pruned;
[0032] The FLOPs calculation formula of the pruned model is: Where M is the total number of channels and I(·) is the indicator function.
[0033] The threshold τ is a manually set pruning threshold used to judge the importance of the convolutional layer channel. ) is lower than τ, the channel will be considered "redundant" and pruned to reduce the amount of model calculation. FLOPs: is the abbreviation of "Floating Point Operations Per Second", which is used to measure the computational complexity of the model (that is, the amount of calculation required for model inference). The larger the FLOPs value, the greater the model calculation, and the higher the requirement for hardware computing power. FLOPs ( pruned : represents the floating point operations of the pruned model, that is, the computational complexity of the model after structured pruning. FLOPs( origin : Indicates the floating-point operations of the original model, that is, the initial computational complexity of the YOLOv8 model when no pruning operation is performed. ( Hessian matrix approximation: This is an approximation of the second-order derivative of the Taylor expansion, used to assess the importance of the convolutional layer parameters W. A larger value indicates that the corresponding channel is more critical to model performance and less likely to be pruned; conversely, a smaller value indicates that the channel is more likely to be deleted.
[0034] Specifically, the environment perception preprocessing module in the optimized YOLOv8 network model includes:
[0035] Based on the Retinex theory, the illumination component L(x,y) and the reflection component R(x,y) are estimated using the formula: L(x,y)=I(x,y)*G(x,y), where I(x,y) is the input image and G(x,y) is the Gaussian kernel.
[0036] Specifically, it includes: the dynamic resolution adjustment module in the optimized YOLOv8 network model, specifically including:
[0037] The input resolution R(t) is dynamically adjusted according to the real-time computing load C(t) of the edge device, that is,
[0038] C max : Indicates the maximum computing load threshold of the edge device, which is the pre-set upper limit of the device computing power
[0039] When computing power is insufficient, switch to low-resolution mode to ensure that the inference frame rate is stable above 30FPS, and use a bilinear interpolation algorithm to upsample the low-resolution feature map to compensate for the resolution drop.
[0040] Specifically, it includes: the model differential update mechanism in the optimized YOLOv8 network model, specifically including:
[0041] Adopting the federated learning edge fine-tuning strategy, only uploading the model parameter update amount W=W local -W global, transmitted through an encrypted channel. local : represents the model parameters after local fine-tuning on the edge device. W global : Indicates the global shared model parameters sent from the cloud
[0042] Another embodiment of the present invention provides a YOLOv8 traffic sign real-time detection system based on edge computing optimization, including:
[0043] Acquisition module: collects traffic scene image data in real time, and preprocesses the collected image data to obtain preprocessed image data;
[0044] Object detection module: The preprocessed image data is input into the optimized YOLOv8 network model for feature extraction. Feature maps of different scales are processed by the SE module and the bidirectional feature fusion strategy before entering the detection head for object detection to obtain detection results. The optimized YOLOv8 network model introduces the SE module, the generative adversarial network, the structured pruning module, the environment perception preprocessing module, the dynamic resolution adjustment module, and the model differential update mechanism.
[0045] Transmission module: The obtained detection results are transmitted to the central server or autonomous driving system in a structured data format through a low-latency communication protocol;
[0046] Analysis module: In the central server or autonomous driving system, real-time statistics of detection results and trend analysis are performed.
[0047] On the other hand, the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and runnable on the processor, wherein when the processor executes the computer program, the steps of the YOLOv8 traffic sign real-time detection method based on edge computing optimization are implemented.
[0048] Yet another aspect of the present invention provides a computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the YOLOv8 traffic sign real-time detection method based on edge computing optimization are implemented.
[0049] From the above description of the present invention, it can be seen that compared with the prior art, the present invention has the following beneficial effects:
[0050] This paper proposes a real-time traffic sign detection method based on YOLOv8, optimized for edge computing. By deeply optimizing the YOLOv8 model and improving its deployment strategy, it overcomes many limitations of existing technologies in edge computing scenarios. Specifically, it proposes a lightweight optimization strategy that combines model pruning, quantization, and an efficient inference engine, combined with an environment-adaptive image preprocessing method to improve detection accuracy and robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 Flowchart of the YOLOv8 real-time traffic sign detection method based on edge computing optimization provided by an embodiment of the present invention;
[0052] Figure 2 A block diagram of a YOLOv8 traffic sign real-time detection system based on edge computing optimization provided by an embodiment of the present invention;
[0053] Figure 3 A schematic diagram of an electronic device according to an embodiment of the present invention;
[0054] Figure 4 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] The present invention is further described below through specific embodiments.
[0056] This paper proposes a real-time traffic sign detection method based on YOLOv8, optimized for edge computing. By deeply optimizing the YOLOv8 model and improving its deployment strategy, this method overcomes many limitations of existing technologies in edge computing scenarios. Specifically, a lightweight optimization strategy combining model pruning, quantization, and an efficient inference engine is proposed, along with an environment-adaptive image preprocessing method to improve detection accuracy and robustness.
[0057] like Figure 1 The present invention is based on the YOLOv8 real-time traffic sign detection method optimized by edge computing; specifically, it includes the following steps:
[0058] The YOLOv8 real-time traffic sign detection method based on edge computing optimization includes the following steps:
[0059] S101: collecting traffic scene image data in real time, and preprocessing the collected image data to obtain preprocessed image data;
[0060] High-resolution cameras are used to collect traffic scene video streams in real time. The frame rate is set according to the actual application requirements, generally between 15-60FPS. The collected video data will be pre-processed, including but not limited to image denoising, using the Gaussian filter formula Where (x, y) is the image pixel coordinate, (x0, y0) is the center coordinate, and σ is the standard deviation. The denoising effect is optimized by adjusting the σ value. At the same time, the resolution is adjusted to scale the image to a size suitable for subsequent processing, such as the common 640×640 resolution, to balance the computational effort and detection accuracy.
[0061] S102: The preprocessed image data is input into the optimized YOLOv8 network model for feature extraction. Feature maps of different scales are processed by the SE module and the bidirectional feature fusion strategy, and then enter the detection head for target detection to obtain detection results. The optimized YOLOv8 network model introduces the SE module, the generative adversarial network, the structured pruning module, the environment perception preprocessing module, the dynamic resolution adjustment module, and the model differential update mechanism;
[0062] The model runs on edge devices, performing real-time object detection directly on pre-processed video streams, accurately identifying and classifying various traffic signs. To adapt to the limited computing resources of edge devices, various optimization strategies are adopted.
[0063] (1) Model structure improvement: Based on the basic YOLOv8 network structure, the feature extraction network is optimized. Introducing attention mechanism modules, such as the Squeeze-and-Excitation (SE) module:
[0064]
[0065] s c =F exc (z c ,W)=σ(g(z c ,W))=σ(W2δ(W1z c ))
[0066] where u c is the cth channel of the input feature map, H and W are the height and width of the feature map, z c is the feature after channel compression, W1 and W2 are the weights of the fully connected layer, δ is the ReLU activation function, and σ is the Sigmoid activation function. {F}_{sq} is the channel compression operation function, which processes the cth channel {u}_{c} of the input feature map through global average pooling, compressing the spatial dimension (height H, width W) to 1, and obtaining the channel-level global feature z c , in the formula Indicates that the pixel values of all spatial positions (i, j) of each channel of the feature map are summed and averaged, where i and j are the row and column coordinate indices of the feature map, respectively, used to locate each spatial pixel point. exc Is the channel excitation operation function, through two layers of fully connected layers (weights W1 and W2 respectively) and activation function to achieve adaptive adjustment of channel weights. Among them, W1 is the weight of the dimensionality reduction fully connected layer (usually compressing the number of channels to 1 / 16 of the original number of channels), W2 is the weight of the dimensionality increase fully connected layer (restoring to the original number of channels), and the two constitute the multi-layer perceptron (MLP) structure g(·), which is used to calculate the compressed feature z cFirst, a nonlinear transformation is performed through W1 and ReLU activation function δ, then mapped back to the original channel dimension through W2, and finally the channel weight s is output through Sigmoid activation function σ c , completing the "stimulation" of key feature channels. Through the SE module, the model can adaptively adjust the weights of different channel features, strengthening the ability to extract key features of traffic signs, especially for small-target traffic signs, and improving the significance of their feature expression.
[0067] (2) Training and data preprocessing: Construct a large-scale and diverse traffic sign dataset, covering traffic sign images under different weather conditions (sunny, rainy, snowy), lighting (strong light, weak light, backlight), and viewing angles (front view, oblique view, and top view). In the model training phase, the cross entropy loss function is used.
[0068]
[0069] Where N is the number of samples, C is the number of categories, and y ij is the true label (0 or 1) of sample i belonging to category j, p ij The model predicts the probability that sample i belongs to category j and optimizes the model parameters by minimizing the loss function.
[0070] To further improve the robustness of the model, a variety of data enhancement techniques are implemented. In addition to conventional rotation, scaling, and color transformation, a data enhancement method based on the Generative Adversarial Network (GAN) is also introduced. The generator network G and the discriminator network D are trained adversarially to generate realistic synthetic traffic sign images and expand the diversity of the training dataset. The goal of the generator is to generate fake samples that are difficult for the discriminator to distinguish. Its optimization goal is
[0071]
[0072] where p data (x) is the real data distribution, p z (z) is the noise distribution, Represents the real data distribution p data The sample x in (x) takes the expectation, that is, samples from the real traffic sign image data and calculates the statistical expectation. Denotes the noise distribution p zThe noise sample z in (z) takes the expectation, that is, sampling from random noise (such as Gaussian or uniformly distributed noise) and calculating the statistical expectation. D(x) is the discriminant network's discriminant output for the real image x, used to determine whether the input image is real data. The output value is usually a probability value (e.g., close to 1 indicates that the discriminator believes it is a real image). G(z) is a forged image generated by the generator network based on the noise z. The goal is to generate images that are close to real traffic signs by learning the noise distribution to deceive the discriminator. Through this adversarial training method, the model can learn more generalizable feature representations.
[0073] (3) Edge optimization:
[0074] To enable the YOLOv8 model to run efficiently on edge devices, the present invention focuses on three aspects: hardware-aware model lightweighting, edge-side adaptive inference framework, and edge-cloud hierarchical collaborative architecture, to comprehensively improve model performance and system efficiency.
[0075] 1. Hardware-aware model lightweight technology
[0076] Structured pruning algorithm: A second-order importance evaluation pruning strategy based on Taylor expansion, which calculates the Hessian matrix approximation for the convolutional layer parameter W. Sort by importance score, and channels below the threshold \tau will be pruned. The FLOPs calculation formula of the model after pruning is Where M is the total number of channels, I(·) is the indicator function. The threshold τ is a manually set pruning threshold used to judge the importance of the convolutional layer channel. When the importance score of the channel (i.e. the approximate Hessian matrix) ) is lower than τ, the channel will be considered "redundant" and pruned to reduce the amount of model calculation. FLOPs: is the abbreviation of "Floating Point Operations PerSecond", which is used to measure the computational complexity of the model (that is, the amount of calculation required for model inference). The larger the FLOPs value, the greater the model calculation, and the higher the requirement for hardware computing power. FLOPs ( pruned : represents the floating point operations of the pruned model, that is, the computational complexity of the model after structured pruning. FLOPs( origin : Indicates the floating-point operations of the original model, that is, the initial computational complexity of the YOLOv8 model when no pruning operation is performed. ( Hessian matrix approximation: This is an approximation of the second-order derivative of the Taylor expansion, used to assess the importance of the convolutional layer parameters W. A larger value indicates that the corresponding channel is more critical to model performance and less likely to be pruned; conversely, a smaller value indicates that the channel is more likely to be deleted.
[0077] This strategy retains key feature channels, reduces redundant calculations, and reduces computing power usage on Jetson Nano by more than 60%.
[0078] Hybrid precision quantization method: an asymmetric quantization scheme based on dynamic threshold is proposed, and an adaptive quantization interval [a, b] is used for the activation value. The quantization formula is: s∈[a,b]. By minimizing the quantization error E=E[(s-dequantize(q)) 2 Dynamically optimize the threshold, and under INT8 quantization, the mAP drops by less than 1.5%. Compared with traditional symmetric quantization, this method better preserves the feature details of small objects.
[0079] Computational graph optimization technology: Using TensorRT for layer fusion optimization, the continuous n convolution-batch normalization-activation layers (CBN) are fused into a single operator. The calculation efficiency is improved by the formula: Where T mem is the memory access latency, T comp The calculation latency for a single operator is shown in the table. After fusion, inference speed is increased by over 30% and memory bandwidth usage is reduced by 40%, alleviating the memory bandwidth shortage problem on edge devices.
[0080] 2. Edge Adaptive Inference Framework
[0081] Environmental perception preprocessing module: Design an adaptive illumination adjustment algorithm and estimate the illumination component L(x,y) and reflection component R(x,y) based on the Retinex theory. The formula is: L(x,y) = I(x,y) * G(x,y), where I(x,y) is the input image and G(x,y) is the Gaussian kernel. This algorithm achieves dynamic contrast enhancement by adjusting the illumination components, improving detection accuracy by 12% in low-light scenes (<10 lux). For occluded scenes, a local feature completion algorithm is introduced, which interpolates and compensates for occluded areas using feature information from adjacent regions, improving the model's detection capabilities for partially obscured traffic signs.
[0082] Dynamic resolution inference strategy: Dynamically adjust the input resolution R(t) according to the real-time computing load C(t) of the edge device, that is, C max : This represents the maximum computing load threshold of the edge device. It is a pre-set upper limit for the device's computing power. When computing power is insufficient, the device switches to low-resolution mode to ensure a stable inference frame rate above 30 FPS. At the same time, a bilinear interpolation algorithm is used to upsample low-resolution feature maps to compensate for information loss caused by resolution reduction, maintain the spatial resolution and semantic information of the features, and avoid a decrease in detection accuracy.
[0083] 3. Edge-Cloud Hierarchical Collaborative Architecture
[0084] Lightweight data interaction protocol: Design a detection result compression format based on ProtoBuffer, compressing the original bounding box data (4 floating point coordinates + 1 category, about 20 bytes / box) to 8 bytes / box. The transmission delay calculation formula is: Compared to the original image transmission (when the number of detection targets N is less than 20), bandwidth usage is reduced by more than 95%. The protocol supports dynamic data compression ratio adjustment, optimizing the transmission data volume in real time based on network bandwidth, ensuring low-latency data transmission.
[0085] Model differential update mechanism: Adopting the federated learning edge fine-tuning strategy, only uploading the model parameter update amount W=W local -W global , where W local : represents the model parameters after local fine-tuning on the edge device. W global : Represents globally shared model parameters sent from the cloud. Transmitted via encrypted channels (such as TLS 1.3), the update package size is 90% smaller than the full model (approximately 3MB), enabling model updates to be completed within 3 seconds on a 4G network. Edge devices fine-tune the model locally using real-time collected data and regularly synchronize updates to the cloud. The cloud aggregates updates from multiple edge devices, generates a globally optimized model, and sends it down, forming a closed-loop model update mechanism.
[0086] S103: The obtained detection results are transmitted to the central server or the autonomous driving system in a structured data format via a low-latency communication protocol;
[0087] The detection results generated by the edge terminal detection module are quickly transmitted to the central control system or cloud service platform through low-latency communication protocols (such as MQTT and WebSocket).
[0088] S104: In the central server or the autonomous driving system, the detection results are counted in real time and trend analysis is performed.
[0089] These results can be used to inform traffic monitoring decisions, such as adjusting traffic light timing. They can also provide early warning information to autonomous driving systems, assisting vehicles in making informed driving decisions. Furthermore, offline storage and analysis of detection data are supported, enabling further data mining and providing a basis for optimizing system performance. On the central server side, real-time statistics are collected on detection data, such as the number of detections and location distribution of different types of traffic signs within a specific time period. Trend analysis can promptly identify anomalies such as changes in traffic flow and damaged or obscured traffic signs. This provides data support for traffic management departments in making decisions, such as adjusting traffic diversion strategies or arranging personnel to repair damaged signs.
[0090] In addition, it supports two strategies: online learning and offline updating. During online learning, the edge device uploads some sample data that is difficult to accurately classify (filtered by setting uncertainty thresholds) to the cloud during the detection process. The cloud uses this data to perform incremental learning on the model, optimize the model parameters, and then push the updated model parameters to the edge device. Offline updating is to regularly upload the detection data accumulated by the edge device to the cloud, and the cloud performs full model training based on large-scale data to obtain a model version with better performance. The model update process uses encrypted transmission protocols (such as SSL / TLS) to ensure the security of the model data. At the same time, before the model is pushed, the compatibility of different models of edge devices is tested first, and the adapted model version is pushed based on the device hardware computing power, operating system and other information to ensure that the model can run stably and efficiently on the edge device, and always maintain the optimal detection performance of the system.
[0091] like Figure 2 On the other hand, an embodiment of the present invention provides a YOLOv8 traffic sign real-time detection system based on edge computing optimization, including:
[0092] Acquisition module 201: collects traffic scene image data in real time, and pre-processes the collected image data to obtain pre-processed image data;
[0093] Object detection module 202: The pre-processed image data is input into the optimized YOLOv8 network model for feature extraction. Feature maps of different scales are processed by the SE module and the bidirectional feature fusion strategy before entering the detection head for object detection to obtain detection results. The optimized YOLOv8 network model introduces the SE module, the generative adversarial network, the structured pruning module, the environment perception preprocessing module, the dynamic resolution adjustment module, and the model differential update mechanism.
[0094] Transmission module 203: The obtained detection results are transmitted to the central server or the autonomous driving system in a structured data format via a low-latency communication protocol;
[0095] Analysis module 204: In the central server or autonomous driving system, real-time statistics and trend analysis of the detection results are performed.
[0096] like Figure 3 As shown, an embodiment of the present invention provides an electronic device 300, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor 320. When the processor 320 executes the computer program 311, the YOLOv8 traffic sign real-time detection method based on edge computing optimization provided in an embodiment of the present invention is implemented.
[0097] In the specific implementation process, when the processor 320 executes the computer program 311, it can achieve Figure 1 Any implementation manner in the corresponding embodiments.
[0098] Since the electronic device introduced in this embodiment is a device used to implement a data processing device in the embodiment of the present invention, based on the method introduced in the embodiment of the present invention, technical personnel in this field can understand the specific implementation of the electronic device of this embodiment and its various variations. Therefore, how the electronic device implements the method in the embodiment of the present invention will not be introduced in detail here. As long as the equipment used by technical personnel in this field to implement the method in the embodiment of the present invention falls within the scope of protection of the present invention.
[0099] See also Figure 4 , Figure 4 A schematic diagram of an embodiment of a computer-readable storage medium provided in an embodiment of the present invention.
[0100] like Figure 4 As shown, this embodiment provides a computer-readable storage medium 400, on which a computer program 411 is stored. When the computer program 411 is executed by a processor, the YOLOv8 traffic sign real-time detection method based on edge computing optimization provided by an embodiment of the present invention is implemented;
[0101] In a specific implementation process, the computer program 411 can be implemented when executed by a processor. Figure 1 Any implementation manner in the corresponding embodiments.
[0102] It should be noted that, in the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.
[0103] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] This paper proposes a real-time traffic sign detection method based on YOLOv8, optimized for edge computing. By deeply optimizing the YOLOv8 model and improving its deployment strategy, it overcomes many limitations of existing technologies in edge computing scenarios. Specifically, it proposes a lightweight optimization strategy that combines model pruning, quantization, and an efficient inference engine, combined with an environment-adaptive image preprocessing method to improve detection accuracy and robustness.
[0105] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited to this. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.
Claims
1. YOLOv8 traffic sign real-time detection method based on edge computing optimization, characterized by: The steps include: Collect traffic scene image data in real time, and pre-process the collected image data to obtain pre-processed image data; The preprocessed image data is input into the optimized YOLOv8 network model for feature extraction. Feature maps of different scales are processed by the SE module and the bidirectional feature fusion strategy before entering the detection head for target detection to obtain detection results. The optimized YOLOv8 network model introduces the SE module, the generative adversarial network, the structured pruning module, the environment perception preprocessing module, the dynamic resolution adjustment module, and the model differential update mechanism. The obtained detection results are transmitted to the central server or autonomous driving system in a structured data format via a low-latency communication protocol; In the central server or autonomous driving system, the detection results are counted in real time and trend analysis is performed.
2. The YOLOv8 traffic sign real-time detection method based on edge computing optimization according to claim 1 is characterized in that: The acquisition frame rate is between 15-60FPS.
3. The YOLOv8 traffic sign real-time detection method based on edge computing optimization according to claim 1 is characterized in that: Enter the detection head to perform target detection, specifically: The detection head uses the IoU between the predicted box and the ground-truth box: Among them, IoU is the intersection over union ratio, A and B are the areas of the predicted box and the real box respectively, and the model outputs the location coordinates and category information of the candidate traffic sign through the non-maximum suppression algorithm: where s i is the score of the predicted box i, b i 、b j is the prediction box, N t is the non-maximum suppression threshold, N t Between 0.3 and 0.5, redundant prediction boxes are removed and the final detection results are retained. i and j are serial numbers.
4. The YOLOv8 traffic sign real-time detection method based on edge computing optimization according to claim 1 is characterized in that: The SE module in the optimized YOLOv8 network model specifically includes: s c =F exc (z c ,W)=σ(g(z c ,W))=σ(W2δ(W1z c )) where u c is the cth channel of the input feature map, H and W are the height and width of the feature map, z c is the feature after channel compression, W1 and W2 are the weights of the fully connected layer, δ is the ReLU activation function, and σ is the Sigmoid activation function. {F}_{sq} is the channel compression operation function, which processes the cth channel {u}_{c} of the input feature map through global average pooling, compresses the spatial dimension to 1, and obtains the channel-level global feature z c , in the formula Indicates that the pixel values of all spatial positions (i, j) of each channel of the feature map are summed and averaged, where i and j are the row and column coordinate indexes of the feature map, respectively, used to locate each spatial pixel point; F exc is the channel excitation operation function, which realizes the adaptive adjustment of channel weights through two layers of fully connected layers and activation functions, where W1 is the weight of the fully connected layer with reduced dimension, and W2 is the weight of the fully connected layer with increased dimension. The two constitute the multi-layer perceptron structure g(·), which is used to adjust the compressed feature z c First, a nonlinear transformation is performed through W1 and ReLU activation function δ, then mapped back to the original channel dimension through W2, and finally the channel weight s is output through Sigmoid activation function σ c , completing the "stimulation" of key feature channels.
5. The YOLOv8 traffic sign real-time detection method based on edge computing optimization according to claim 1 is characterized in that: The optimized YOLOv8 network model generates an adversarial network, specifically including: Introducing the generative adversarial network, including the generator network G and the discriminator network D, the optimization goal of the generator is where p data (x) is the real data distribution, p z (z) is the noise distribution, Represents the real data distribution p data The sample x in (x) takes the expectation, that is, samples from the real traffic sign image data and calculates the statistical expectation. Denotes the noise distribution p z The noise sample z in (z) takes the expectation, that is, sampling from random noise (such as Gaussian distribution, uniform distribution noise) and calculating the statistical expectation. D(x) is the discriminant output of the discriminant network for the real image x, which is used to determine whether the input image is real data. The output value is usually a probability value. G(z) is a forged image generated by the generator network based on the noise z. The goal is to generate images close to real traffic signs by learning the noise distribution to deceive the discriminator.
6. The YOLOv8 traffic sign real-time detection method based on edge computing optimization according to claim 1 is characterized in that: include: The structured pruning module in the optimized YOLOv8 network model includes: A second-order importance evaluation pruning strategy based on Taylor expansion is used to calculate the Hessian matrix approximation for the convolutional layer parameters W. Sort by importance score, channels below the threshold τ will be pruned; The FLOPs calculation formula of the pruned model is: Where M is the total number of channels and I(·) is the indicator function. τ is the set pruning threshold, which is used to judge the importance of the convolution layer channel. When the importance score of the channel (i.e. the approximate value of the Hessian matrix ) is lower than τ, the channel will be considered "redundant" and pruned to reduce the amount of model calculation; FLOPs: is the abbreviation of "floating point operations per second", which is used to measure the computational complexity of the model. The larger the FLOPs value, the greater the amount of model calculation and the higher the requirement for hardware computing power; FLOPs( pruned : represents the floating point operation of the pruned model, that is, the computational complexity of the model after structured pruning; FLOPs( origin : represents the floating-point operations of the original model, that is, the initial computational complexity of the YOLOv8 model without pruning; It is an approximation of the second-order derivative based on Taylor expansion, which is used to evaluate the importance of the convolutional layer parameter W. The larger the value, the more critical the impact of the corresponding channel on the model performance and the less likely it is to be pruned; otherwise, it is more likely to be deleted.
7. The YOLOv8 traffic sign real-time detection method based on edge computing optimization according to claim 1 is characterized in that: The optimized environment perception preprocessing module in the YOLOv8 network model includes: Based on the Retinex theory, the illumination component L(x,y) and the reflection component R(x,y) are estimated using the formula: L(x,y)=I(x,y)*G(x,y), where I(x,y) is the input image and G(x,y) is the Gaussian kernel.
8. The YOLOv8 traffic sign real-time detection method based on edge computing optimization according to claim 1 is characterized in that: include: The dynamic resolution adjustment module in the optimized YOLOv8 network model includes: The input resolution R(t) is dynamically adjusted according to the real-time computing load C(t) of the edge device, that is, Among them, C max : Indicates the maximum computing load threshold of the edge device, which is the pre-set upper limit of the device computing power; When computing power is insufficient, switch to low-resolution mode to ensure that the inference frame rate is stable above 30FPS, and use a bilinear interpolation algorithm to upsample the low-resolution feature map to compensate for the resolution drop.
9. The YOLOv8 traffic sign real-time detection method based on edge computing optimization according to claim 1 is characterized in that: include: The model differential update mechanism in the optimized YOLOv8 network model includes: Adopting the federated learning edge fine-tuning strategy, only uploading the model parameter update amount W=W local -W global , transmitted through encrypted channels; Where W local : represents the model parameters after local fine-tuning on the edge device. W global : Indicates the global shared model parameters sent from the cloud.
10. YOLOv8 traffic sign real-time detection system based on edge computing optimization, characterized by: include, Acquisition module: collects traffic scene image data in real time, and preprocesses the collected image data to obtain preprocessed image data; Object detection module: The preprocessed image data is input into the optimized YOLOv8 network model for feature extraction. Feature maps of different scales are processed by the SE module and the bidirectional feature fusion strategy before entering the detection head for object detection to obtain detection results. The optimized YOLOv8 network model introduces the SE module, the generative adversarial network, the structured pruning module, the environment perception preprocessing module, the dynamic resolution adjustment module, and the model differential update mechanism. Transmission module: The obtained detection results are transmitted to the central server or autonomous driving system in a structured data format through a low-latency communication protocol; Analysis module: In the central server or autonomous driving system, real-time statistics of detection results and trend analysis are performed.
Citation Information
Cited By
Parking state intelligent sensing method and device based on target detection tracking
CN121545115A
Intelligent parking state sensing method and device based on target detection tracking
CN121545115B
Traffic cone real-time target detection method, system and equipment based on YOLOv8 identification model
CN121861595A