A small target detection method and system based on YOLOv8

By improving the YOLOv8 network and introducing improved ShuffleNet, C2f_IECA, and RepViT modules, the feature extraction and fusion capabilities are enhanced, solving the problems of low efficiency and low accuracy in small target detection in vehicle images. This achieves fast and accurate target detection and improves the safety of autonomous driving.

CN122392015APending Publication Date: 2026-07-14JILIN INST OF ARCHITECTURE & TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JILIN INST OF ARCHITECTURE & TECH
Filing Date
2026-04-16
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing target detection algorithms are inefficient and inaccurate in detecting small targets in vehicle images, which cannot guarantee the safety of the vehicle during driving.

Method used

An improved YOLOv8 network is adopted, which enhances feature extraction and fusion capabilities by introducing an improved ShuffleNet module, a C2f_IECA module and an improved RepViT module. A pre-defined target detection model is constructed, including an improved backbone network, a neck network and a detection head network. Channel grouping processing and multi-scale feature modeling are performed to output small target detection results.

Benefits of technology

It enables rapid and accurate detection of small targets in vehicle images, improving safety and detection performance during vehicle operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122392015A_ABST
    Figure CN122392015A_ABST
Patent Text Reader

Abstract

The application discloses a small target detection method and system based on YOLOv8, and the method comprises the following steps: determining a target YOLOv8 network, and constructing a preset target detection model, wherein the preset target detection model comprises an improved backbone network, an improved neck network and a detection head network; acquiring a vehicle-mounted image and inputting the vehicle-mounted image into the improved backbone network; performing channel grouping processing and multi-scale feature modeling processing on the vehicle-mounted image through the improved backbone network to obtain weight distribution features; performing convolution processing, feature division processing and fusion processing on the weight distribution features to obtain fused multi-scale features; and inputting the fused multi-scale features into the improved neck network and the detection head network in sequence, and outputting a small target detection result. The YOLOv8 network is improved to construct the preset target detection model, so that the small target in the vehicle-mounted image can be quickly and accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a small target detection method, system, terminal, and computer-readable storage medium based on YOLOv8. Background Technology

[0002] With the advancement of deep learning technology, object detection, as a key technology in computer vision, has wide theoretical and practical applications in fields such as autonomous driving, intelligent transportation, and drone image analysis. Small object detection is particularly important in autonomous driving, primarily used to identify distant pedestrians, animals, and traffic signs. Although these targets are small in size, they are crucial for the safety decisions of autonomous driving systems. For example, early identification of distant obstacles or traffic signals can effectively improve vehicle safety and responsiveness. Currently, computer vision-based object detection algorithms can be broadly classified into two categories: two-stage object detection algorithms based on region extraction and single-stage object detection algorithms based on regression methods.

[0003] However, existing target detection algorithms are inefficient and inaccurate in detecting small targets in vehicle images, which cannot guarantee the safety of the car during driving.

[0004] Therefore, existing technologies still need to be improved and developed. Summary of the Invention

[0005] The main objective of this invention is to provide a small target detection method, system, terminal, and computer-readable storage medium based on YOLOv8, aiming to solve the problems of low detection efficiency and low accuracy of small targets in vehicle images in the prior art.

[0006] To achieve the above objectives, the present invention provides a small target detection method based on YOLOv8, which includes the following steps: A target YOLOv8 network is identified, and a preset target detection model is constructed based on the target YOLOv8 network. The preset target detection model includes an improved backbone network, an improved neck network, and a head detection network. The vehicle-mounted image is acquired and input into the improved backbone network. The improved backbone network performs channel grouping and multi-scale feature modeling on the vehicle-mounted image to obtain weight distribution features. The weight distribution features are subjected to convolution, feature segmentation, and fusion processing to obtain fused multi-scale features; The fused multi-scale features are sequentially input into the improved neck network and the detection head network to output small target detection results.

[0007] Optionally, the small target detection method based on YOLOv8, wherein determining the target YOLOv8 network and constructing a preset target detection model based on the target YOLOv8 network specifically includes: Identify the target YOLOv8 network, wherein the target YOLOv8 network includes a backbone network, a neck network, and a detection head network; The improved backbone network is obtained by replacing the ShuffleNetV2 module in the backbone network with the ShuffleNet module and the C2f module in the backbone network with the C2f_IECA module. The improved RepViT module is obtained by replacing the first SE attention mechanism module in the RepViT module with the CBAM attention mechanism module, and the improved neck network is obtained by replacing the convolution module in the neck network with the improved RepViT module. A preset target detection model is constructed based on the improved backbone network, the improved neck network, and the detection head network.

[0008] Optionally, the YOLOv8-based small target detection method, wherein acquiring the vehicle image, inputting the vehicle image into the improved backbone network, and performing channel grouping and multi-scale feature modeling on the vehicle image through the improved backbone network to obtain weight distribution features, specifically includes: The vehicle-mounted image is acquired and input into the improved backbone network, wherein the improved backbone network includes the ShuffleNet module, the Concat module, and the second SE attention mechanism module; The improved backbone network is used to uniformly divide the vehicle image to obtain multiple divided vehicle images. Multiple segmented vehicle images are input into multiple sub-feature branches in the ShuffleNet module. The first convolution process is performed on the corresponding segmented vehicle images through the multiple sub-feature branches to obtain multiple multi-scale features. Multiple multi-scale features are input into the Concat module, and the Concat module performs a first fusion process on the multiple multi-scale features to obtain a first fused feature; The first fused feature is input into the second SE attention mechanism module, which outputs the weight distribution feature.

[0009] Optionally, the small target detection method based on YOLOv8, wherein the step of inputting the first fused feature into the second SE attention mechanism module and outputting the weight distribution feature specifically includes: The first fused feature is input into the second SE attention mechanism module, and the second SE attention mechanism module performs global context extraction and global average pooling on the first fused feature to obtain a one-dimensional vector. Dynamic weights are generated based on the one-dimensional vector to obtain the weight distribution characteristics.

[0010] Optionally, the YOLOv8-based small object detection method, wherein the convolutional processing, feature segmentation processing, and fusion processing of the weight distribution features to obtain fused multi-scale features specifically includes: The weight distribution features are input into the C2f_IECA module in the improved backbone network, and the weight distribution features are subjected to a second convolution process by the C2f_IECA module to obtain convolution features. The convolutional features are input into the Split module in the improved backbone network, and the Split module divides the convolutional features to obtain multiple branch features. Each of the branch features is sequentially input into multiple Bottleneck_IECA modules in the improved backbone network to obtain multiple branch output results; The output results of multiple branches are input into the Concat module in the improved backbone network. The Concat module performs a second fusion process on the output results of multiple branches to obtain a second fusion feature. The second fused feature is input into the output layer of the improved backbone network, and the second fused feature is subjected to a third convolution process through the output layer to obtain fused multi-scale features.

[0011] Optionally, the YOLOv8-based small target detection method, wherein the step of sequentially inputting each branch feature into multiple Bottleneck_IECA modules in the improved backbone network to obtain multiple branch output results specifically includes: Each of the aforementioned branch features is input into the global max pooling branch and the global average pooling branch in the Bottleneck_IECA module, respectively; The first feature is obtained by performing global average pooling on each of the branch features through the global average pooling branch. The first feature is processed by a fourth convolution and a sigmoid activation function to obtain the attention weight of the first channel. The second feature is obtained by performing global max pooling on each of the branch features through the global max pooling branch. The second feature is processed by a fifth convolution and a sigmoid activation function to obtain the attention weights for the second channel. A third fusion process is performed on the attention weights of the first channel and the attention weights of the second channel to obtain the fused weights; The features of each branch are weighted according to the fusion weights to obtain multiple branch output results.

[0012] Optionally, the YOLOv8-based small target detection method, wherein the step of sequentially inputting the fused multi-scale features into the improved neck network and the detection head network, and outputting the small target detection result, specifically includes: The fused multi-scale features are input into the improved neck network, and the improved RepViT module in the improved neck network is used to perform spatial downsampling processing on the fused multi-scale features to obtain downsampled multi-scale features. The downsampled multi-scale features are input into the detection head network, and the detection head network performs detection processing on the downsampled multi-scale features to obtain small target detection results.

[0013] Furthermore, to achieve the above objectives, the present invention also provides a small target detection system based on YOLOv8, wherein the small target detection system based on YOLOv8 includes: The model improvement module is used to determine the target YOLOv8 network and construct a preset target detection model based on the target YOLOv8 network. The preset target detection model includes an improved backbone network, an improved neck network, and a head detection network. The weight distribution feature generation module is used to acquire vehicle images, input the vehicle images into the improved backbone network, and perform channel grouping and multi-scale feature modeling on the vehicle images through the improved backbone network to obtain weight distribution features. The multi-scale feature fusion module is used to perform convolution processing, feature segmentation processing, and fusion processing on the weight distribution features to obtain fused multi-scale features. The detection result output module is used to sequentially input the fused multi-scale features into the improved neck network and the detection head network, and output the small target detection result.

[0014] Furthermore, to achieve the above objectives, the present invention also provides a terminal, wherein the terminal includes: a memory, a processor, and a YOLOv8-based small target detection program stored in the memory and executable on the processor, wherein the YOLOv8-based small target detection program, when executed by the processor, implements the steps of the YOLOv8-based small target detection method as described above.

[0015] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a small target detection program based on YOLOv8, and the small target detection program based on YOLOv8, when executed by a processor, implements the steps of the small target detection method based on YOLOv8 as described above.

[0016] In this invention, a target YOLOv8 network is determined, and a preset target detection model is constructed based on the target YOLOv8 network. The preset target detection model includes an improved backbone network, an improved neck network, and a detection head network. An in-vehicle image is acquired and input into the improved backbone network. The improved backbone network performs channel grouping and multi-scale feature modeling on the in-vehicle image to obtain weight distribution features. These weight distribution features are then subjected to convolution, feature segmentation, and fusion processing to obtain fused multi-scale features. These fused multi-scale features are sequentially input into the improved neck network and the detection head network to output small target detection results. This invention improves the YOLOv8 network to construct a preset target detection model, enabling fast and accurate detection of small targets in in-vehicle images and improving vehicle safety during driving. Attached Figure Description

[0017] Figure 1 This is a flowchart of a preferred embodiment of the small target detection method based on YOLOv8 of the present invention; Figure 2 This is a schematic diagram of the overall network model structure of a preferred embodiment of the small target detection method based on YOLOv8 of the present invention; Figure 3 This is a schematic diagram of the I-ShuffleNet module structure of a preferred embodiment of the small target detection method based on YOLOv8 of the present invention; Figure 4 This is a schematic diagram of the IECA module structure of a preferred embodiment of the small target detection method based on YOLOv8 of the present invention; Figure 5 This is a schematic diagram of the C2f_IECA module structure of a preferred embodiment of the small target detection method based on YOLOv8 of the present invention; Figure 6 This is a schematic diagram of the I-RepViT module structure of a preferred embodiment of the small target detection method based on YOLOv8 of the present invention; Figure 7 This is a schematic diagram of the experimental results of a preferred embodiment of the small target detection method based on YOLOv8 of the present invention on the KITTI dataset; Figure 8This is a schematic diagram of the experimental results of a preferred embodiment of the small target detection method based on YOLOv8 of the present invention on the BDD100K dataset; Figure 9 This is a structural diagram of a preferred embodiment of the small target detection system based on YOLOv8 of the present invention; Figure 10 This is a structural diagram of a preferred embodiment of the terminal of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, 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 of the invention and are not intended to limit the invention.

[0019] With the advancement of deep learning technology, object detection, as a key technology in computer vision, has wide theoretical and practical applications in fields such as autonomous driving, intelligent transportation, and drone image analysis. Small targets with low resolution and usable information are of great significance for object detection in complex backgrounds. Currently, computer vision-based object detection algorithms can be broadly divided into two categories: one is two-stage object detection algorithms based on region extraction, such as R-CNN, Fast R-CNN, and Faster R-CNN; the other is single-stage object detection algorithms based on regression methods, such as the YOLO series and SSD. Among these, the YOLO series has been widely used in object detection due to its lightweight and real-time design.

[0020] The introduction of the YOLO algorithm pioneered single-stage object detection algorithms, paving the way for subsequent development. YOLOv1 introduced an end-to-end real-time object detection framework. YOLOv2 developed a new routing mechanism and added an anchor mechanism suitable for small object detection. YOLOv3 improved upon YOLOv2, achieving multi-scale fusion through a pyramid network structure, further enhancing its performance in small object detection. YOLOv4 incorporated the YOLOv3 header into the network and made other improvements, inheriting YOLOv3's high accuracy in small object detection while improving performance for objects of varying sizes. YOLOv5 was more advanced than YOLOv4, introducing the GIoU loss function and adding optimization functions such as Adam, resulting in significantly higher accuracy and speed in detecting densely occluded targets compared to YOLOv4. Subsequently, YOLOv6 and YOLOv7 further improved and optimized the algorithm at the network structure and training strategies. YOLOv8 is an object detection model from the Ultralytics family. It features a new architecture, new convolutional layers, and a new detection head. Compared to previous versions, it offers significant improvements in speed and accuracy, making it suitable for real-time object detection. The main objective of this invention is to enhance and optimize the YOLOv8 network model to improve its ability to detect small objects.

[0021] Small target detection is of great significance in fields such as autonomous driving, primarily used to identify critical targets such as pedestrians, animals, and traffic signs at a distance. Although these targets are small in size, they are crucial for the safety decisions of autonomous driving systems. For example, early identification of distant obstacles or traffic signals can effectively improve vehicle safety and responsiveness. However, in the field of autonomous driving, small targets currently face numerous challenges due to their small size, limited feature information, low resolution, and susceptibility to background interference.

[0022] To address the aforementioned problems, this invention proposes a small target detection method for autonomous driving based on YOLOv8. First, an improved ShuffleNet (i.e., I-ShuffleNet) module is introduced. This module inherits the lightweight and efficient characteristics of ShuffleNetV2 while significantly enhancing the network's feature extraction capabilities through receptive field expansion, multi-scale feature modeling, and the introduction of the SE attention mechanism. Furthermore, an improved ECA attention mechanism (i.e., C2f_IECA) is introduced into the C2f module to achieve more effective capture of salient regions and global information, significantly enhancing the model's ability to detect complex scenes and small targets. Finally, this invention proposes an improved RepViT (i.e., I-RepViT) module. This module employs a separate design for channel and token mixers, a multi-head self-attention mechanism, and a structural reparameterization strategy. It also replaces the traditional SE attention mechanism with the CBAM attention mechanism to improve the global modeling and feature fusion capabilities of the neck network.

[0023] The preferred embodiment of the small target detection method based on YOLOv8 described in this invention, such as... Figure 1 As shown, the small target detection method based on YOLOv8 includes the following steps: Step S10: Determine the target YOLOv8 network and construct a preset target detection model based on the target YOLOv8 network. The preset target detection model includes an improved backbone network, an improved neck network, and a head detection network.

[0024] The overall network structure model of this invention is as follows: Figure 2 As shown, the overall network architecture is first constructed, including the Backbone, Neck, and Head. The Backbone and Neck are both improvements on the YOLOv8 network.

[0025] Specifically, a target YOLOv8 network is determined, which includes a backbone network, a neck network, and a detection head network; the ShuffleNetV2 module in the backbone network is replaced with a ShuffleNet module, and the C2f module in the backbone network is replaced with a C2f_IECA module to obtain an improved backbone network.

[0026] This invention introduces an improved ShuffleNet (i.e., I-ShuffleNet) module into the backbone network. While inheriting the lightweight and efficient characteristics of ShuffleNetV2, this module significantly enhances the network's feature extraction capabilities by expanding the receptive field, multi-scale feature modeling, and introducing the SE attention mechanism.

[0027] This invention introduces an improved ECA attention mechanism (also known as C2f_IECA) into the C2f module of the backbone network, which enables more effective capture of salient regions and global information, and significantly enhances the model's ability to detect complex scenes and small targets.

[0028] The improved RepViT module is obtained by replacing the first SE attention mechanism module in the RepViT module with the CBAM attention mechanism module, and the improved neck network is obtained by replacing the convolution module in the neck network with the improved RepViT module.

[0029] This invention proposes an improved RepViT (also known as I-RepViT) module, which adopts a separate design of channel and token mixers, a multi-head self-attention mechanism, and a structural reparameterization strategy. It also replaces the SE attention mechanism of the neck network in the YOLOv8 network with the CBAM attention mechanism to improve the global modeling and feature fusion capabilities of the neck network.

[0030] A preset target detection model is constructed based on the improved backbone network, the improved neck network, and the detection head network.

[0031] Step S20: Acquire vehicle-mounted images, input the vehicle-mounted images into the improved backbone network, and perform channel grouping and multi-scale feature modeling on the vehicle-mounted images through the improved backbone network to obtain weight distribution features.

[0032] Once the preset target detection model is built, the acquired vehicle images are first input into the improved backbone network of the preset target detection model, and feature extraction is performed in the backbone network (i.e., the improved backbone network). The improved backbone network introduces an improved ShuffleNet module (i.e., I-ShuffleNet). This module, while inheriting the lightweight and efficient characteristics of ShuffleNetV2, expands the receptive field, models multi-scale features, and introduces the SE attention mechanism, which significantly enhances the network's feature extraction capabilities.

[0033] Specifically, an in-vehicle image is acquired and input into the improved backbone network, wherein the improved backbone network includes the ShuffleNet module, the Concat module, and the second SE attention mechanism module; the in-vehicle image is uniformly divided by the improved backbone network to obtain multiple segmented in-vehicle images; the multiple segmented in-vehicle images are input into multiple sub-feature branches in the ShuffleNet module, and the corresponding segmented in-vehicle images are subjected to a first convolution process by the multiple sub-feature branches to obtain multiple multi-scale features; the multiple multi-scale features are input into the Concat module, and the multiple multi-scale features are subjected to a first fusion process by the Concat module to obtain a first fused feature; the first fused feature is input into the second SE attention mechanism module, and the first fused feature is subjected to global context extraction processing and global average pooling processing by the second SE attention mechanism module to obtain a one-dimensional vector; dynamic weights are generated based on the one-dimensional vector to obtain weight distribution features.

[0034] The I-ShuffleNet module structure set in this invention is as follows: Figure 3 As shown, this module makes key improvements to the lightweight structure of the ShuffleNetV2 downsampling unit, significantly enhancing its adaptability to complex scenes. This module innovatively extends the two-branch structure to a four-branch design, with each branch employing different convolutional kernel sizes (3×3, 5×5, 7×7, and 3×3 depthwise separable convolutions), thereby significantly improving the diversity and coverage of the receptive field. This improvement enables the network to model in a larger-scale feature space, providing stronger feature capture capabilities for multi-object detection in complex scenes. Simultaneously, the I-ShuffleNet module replaces the ReLU activation function with PReLU, allowing the model to adaptively adjust the nonlinear response of features, further enhancing the richness of feature representation.

[0035] The core of ShuffleNetV2 in this invention lies in its channel grouping and feature interaction strategy. Specifically, it reduces computational cost through grouped convolutions and enhances inter-branch information interaction through channel shuffling after feature fusion. I-ShuffleNet further extends and optimizes this branch structure. The process is as follows: the input features (i.e., the vehicle-mounted image in this invention) are first converted into a three-dimensional tensor through a Split operation. (i.e., the multiple segmented vehicle images in this invention) are uniformly divided into four branches according to the channel dimension C, resulting in four sub-feature branches with a channel number of C / 4. Each branch independently processes feature information at a specific scale (i.e., the multiple segmented vehicle images in this invention). The four branches are respectively processed by convolution kernels of different sizes (i.e., the first convolution processing in this invention, using 3×3, 5×5, 7×7, and 3×3 depth separable convolutions), thereby achieving efficient capture of multi-scale features. The features extracted from each branch (i.e., the multiple multi-scale features in this invention) are fused along the channel dimension using a Concat operation to obtain a fused feature with C channels containing multi-scale information from each branch (i.e., the first fused feature in this invention). This fused feature is further embedded with an SE attention mechanism (i.e., the second SE attention mechanism module in this invention). The SE module combines global average pooling and dynamic channel weighting strategies. Based on global context information, it first extracts the global context through a "Squeeze" operation, then performs global average pooling on the concat fused feature, compressing each channel into a scalar value to obtain a one-dimensional vector. Then, it generates dynamic weights through an "Excitation" operation. The vector dimension is first reduced by a fully connected layer, then activated by ReLU, and finally restored by a fully connected layer. Finally, it is activated by Sigmoid to generate a weight vector and a weight distribution (i.e., the weight distribution feature in this invention), thereby significantly improving the ability to capture salient regions and global features. Channel shuffling is performed on the fused feature, and by rearranging the channel order, the feature flow between branches is optimized, improving the overall feature interaction efficiency and information transmission capability. Experimental results show that I-ShuffleNet exhibits excellent detection performance in complex scenes, and its improved design provides a high-efficiency solution that balances efficiency and accuracy for real-time object detection tasks.

[0036] Step S30: Perform convolution processing, feature segmentation processing, and fusion processing on the weight distribution features to obtain fused multi-scale features.

[0037] This invention introduces an improved ECA attention mechanism (i.e., C2f_IECA) into the C2f module. By adding a global max pooling branch to process input features in parallel with the global average pooling branch, and calculating channel attention weights through 1D convolution, the weighted input features are finally fused. This can more effectively capture salient regions and global information, and enhance the network's ability to detect complex scenes and small targets.

[0038] Specifically, the weight distribution features are input into the C2f_IECA module in the improved backbone network, and the weight distribution features are subjected to a second convolution process by the C2f_IECA module to obtain convolution features; the convolution features are input into the Split module in the improved backbone network, and the convolution features are divided by the Split module to obtain multiple branch features.

[0039] Each branch feature is input into the global max pooling branch and the global average pooling branch in the Bottleneck_IECA module, respectively. The global average pooling branch performs global average pooling on each branch feature to obtain a first feature. The first feature undergoes a fourth convolution and a sigmoid activation function to obtain a first channel attention weight. The global max pooling branch performs global max pooling on each branch feature to obtain a second feature. The second feature undergoes a fifth convolution and a sigmoid activation function to obtain a second channel attention weight. The first channel attention weight and the second channel attention weight undergo a third fusion process to obtain a fused weight.

[0040] The IECA module structure set in this invention is as follows: Figure 4 As shown, this module, based on the original ECA attention mechanism, adds a global max pooling branch (such as...). Figure 4 The Maxpool branch processes input features in parallel with the Global Average Pooling branch, calculating channel attention weights for each branch using 1D convolutions. For the Global Average Pooling (GAP) branch, the input features (i.e., the branch features in this invention) are first subjected to global average pooling to obtain features of dimension 1×1×C (i.e., the first features in this invention). Then, a 1D convolution with a kernel size of K=5 is used for inter-channel information interaction, followed by a Sigmoid activation function to generate the corresponding branch's channel attention weights (i.e., the first channel attention weights in this invention). For the Global Maxpooling (Maxpool) branch, the input features are first subjected to global max pooling to obtain features of dimension 1×1×C (i.e., the second features in this invention). Then, a 1D convolution with a kernel size of K=3 is used for inter-channel information interaction, followed by a Sigmoid activation function to generate the corresponding branch's channel attention weights (i.e., the second channel attention weights in this invention). By fusing the weight distributions of multiple branches to weight the input features, more effective capture of salient regions and global information is achieved (resulting in multiple branch outputs). This design retains the advantages of the ECA module being lightweight and efficient, while significantly enhancing the model's adaptability to complex scenes and dense target areas.

[0041] Each branch feature is weighted according to the fusion weight to obtain multiple branch output results; the multiple branch output results are input into the Concat module in the improved backbone network, and the Concat module performs a second fusion process on the multiple branch output results to obtain a second fusion feature; the second fusion feature is input into the output layer in the improved backbone network, and the output layer performs a third convolution process on the second fusion feature to obtain a fusion multi-scale feature.

[0042] The structure of the C2f_IECA module set in this invention is as follows: Figure 5 As shown in 'a', in the C2f_IECA module, IECA is embedded in the bottleneck structure of the C2f module. This enhances the modeling ability of key features through a dynamic channel attention mechanism, further improving the deep interaction between local features and global information. Specifically, C2f_IECA first performs convolution processing on the input features (i.e., the second convolution processing in this invention), then divides them into multiple branches (i.e., multiple branch features in this invention) through the Split module. Each branch sequentially passes through multiple Bottleneck_IECA structures. For example... Figure 5 As shown in b, the internal structure of Bottleneck_IECA includes one convolutional layer, one IECA module, and another convolutional layer. Residual connections are used to add and fuse the input features with the enhanced features passed through the IECA module, ensuring both the integrity of feature propagation and enhancing feature expressiveness. After processing all branches, the outputs of each branch are fused through a Concat operation (to obtain the second fused feature), and a 1×1 convolutional operation in the output layer is used to compress and fuse multi-scale features. This effectively alleviates the channel redundancy problem caused by multi-layer stacking, significantly improving the network's expressive power and global modeling performance.

[0043] Compared to the original YOLOv8n architecture, the C2f_IECA module exhibits significant advantages in several aspects, including: 1. By employing a global max-pooling branch and weight fusion mechanism, it significantly enhances the capture capability of global semantic information, providing strong adaptability for small and dense target scenarios; 2. The IECA module maintains a lightweight design principle, introducing additional modeling capabilities while keeping computational costs within a reasonable range, ensuring the network's real-time performance; 3. By optimizing multi-scale feature interaction capabilities, it significantly improves the accuracy and robustness of target detection. Experimental results show that the C2f_IECA module performs excellently in both small target detection and dense target scenarios, achieving a significant improvement in detection accuracy while maintaining efficient inference performance, providing an efficient and reliable solution for small target detection tasks.

[0044] Step S40: Input the fused multi-scale features sequentially into the improved neck network and the detection head network, and output the small target detection result.

[0045] This invention sets up feature fusion in the neck network of a pre-defined target detection model. It replaces traditional convolutions with an improved RepViT module (I-RepViT), optimized based on the MobileNetV3 architecture, and incorporates a channel and token mixer separation design, a multi-head self-attention mechanism, and a structural reparameterization strategy. Furthermore, it replaces the traditional SE attention mechanism with a CBAM attention mechanism, jointly modeling channel and spatial attention to adaptively focus on information-dense regions and suppress irrelevant information, further enhancing the global modeling and feature fusion capabilities of the neck network. Finally, detection is performed using a multi-scale detection head, and the C2f module optimizes feature representation, outputting the target's category, location, and detection accuracy. This significantly improves the network's performance in detecting small targets and its adaptability to complex scenarios, meeting the real-time and high-precision requirements of autonomous driving applications.

[0046] Specifically, the fused multi-scale features are input into the improved neck network, and the improved RepViT module in the improved neck network performs spatial downsampling processing on the fused multi-scale features to obtain downsampled multi-scale features; the downsampled multi-scale features are input into the detection head network, and the detection head network performs detection processing on the downsampled multi-scale features to obtain small target detection results.

[0047] The I-RepViT module structure set in this invention is as follows: Figure 6As shown, this module is further optimized based on the MobileNetV3 architecture, employing a separate design for channel and token mixers, a multi-head self-attention mechanism, and a structural reparameterization strategy. The multi-head self-attention mechanism enables the model to efficiently capture global semantic information; the channel mixer significantly reduces parameter redundancy by setting the expansion ratio to 2; and the token mixer further enhances the ability to model global dependencies across spatial boundaries. During training, I_RepViT constructs a multi-branch topology through structural reparameterization, significantly improving the model's expressive freedom; during inference, these branches are merged to improve computational efficiency. Furthermore, during spatial downsampling, this module uses independent deep convolutional layers to adjust channel sizes and constructs a feedforward network (FFN) through residual connections, effectively mitigating information loss caused by reduced resolution while also improving network depth and feature representation capabilities. Furthermore, the I-RepViT module uses a Convolutional Block Attention Module (CBAM) instead of the traditional SE attention mechanism. By jointly modeling channels and spatial attention, it adaptively focuses on information-dense regions and suppresses irrelevant information. This design significantly improves feature extraction and fusion capabilities, enabling I-RepViT to exhibit higher robustness and efficiency in complex scenes and small object detection tasks.

[0048] To verify the accuracy of small object detection in autonomous driving scenarios, this invention conducted extensive experiments on the KITTI and BDD100K datasets to evaluate the model's performance. To ensure fairness, a uniform data processing method was adopted, specifically as follows: preprocessed images were 640×640 pixels in resolution, for 200 epochs, with a batch size of 8. The model optimizer used was stochastic gradient descent (SGD), with an initial learning rate of 0.01 and a final learning rate of 0.1; the remaining configurations retained the default settings of the original YOLOv8 model. To evaluate the model's object detection performance in autonomous driving, this invention used the following four metrics as evaluation standards: precision, recall, mAP@0.5, and mAP@0.5:0.95. Furthermore, FLOPs are a metric for measuring computer hardware performance and algorithm complexity, calculated using the following formula: ; ; ; ; in, P This represents the proportion of correctly detected positive samples out of all samples detected as positive. R This represents the proportion of correctly detected positive samples out of all actual positive samples. AP It is the calculation of the area under the precision-recall curve, used to measure the performance of object detection for a single class, m. AP It is multiple categories AP The average value is used to comprehensively measure the performance of object detection across multiple categories. Pi ( R ) indicates the first i Precision of each category varies with recall. R The changing function (i.e.) P - R The curve corresponds to the recall rate R The precision value at that time (the integral symbol indicates that the function is integrated over the entire range of recall from 0 to 1), and the final area value is the average precision of that class. APi ,in, APi Indicates the first i The average precision of each category is used to measure the performance of target detection in that category. TP This indicates the number of correctly detected positive samples. FP This represents the number of positive samples detected as errors. FN This represents the number of negative samples detected incorrectly.

[0049] The model used in this invention is built based on the PyTorch deep learning framework. The hardware and software environment for the experiment is as follows: Windows 10 operating system, Intel(R) Core(TM) i9-10920X CPU @ 3.50GHz, NVIDIA GeForce RTX 3090 24575MiB, Python version 3.10.14, PyTorch version 1.11.0 and CUDA version 11.3.1.

[0050] Experimental results are as follows Figure 7 and Figure 8 As shown in the experimental results, the proposed YOLOv8-based small target detection method for autonomous driving significantly outperforms existing mainstream detection models in autonomous driving scenarios. It demonstrates a clear advantage in small target detection tasks, particularly in detecting key autonomous driving targets such as cars, pedestrians, and traffic signs, exhibiting high accuracy, low false negative rate, and strong generalization ability. This fully verifies the practicality and superiority of this invention in autonomous driving scenarios, providing a reliable solution for real-time small target detection in autonomous driving systems.

[0051] In summary, this invention addresses the challenges of small targets in the current autonomous driving field, including their small size, limited feature information, low resolution, and susceptibility to background interference. It proposes a YOLOv8-based method for small target detection in autonomous driving. First, an improved ShuffleNet (I-ShuffleNet) module is introduced. This module inherits the lightweight and efficient characteristics of ShuffleNetV2 while significantly enhancing the network's feature extraction capabilities through receptive field expansion, multi-scale feature modeling, and the introduction of the SE attention mechanism. Furthermore, an improved ECA attention mechanism (C2f_IECA) is introduced into the C2f module to more effectively capture salient regions and global information, significantly enhancing the model's ability to detect complex scenes and small targets. Finally, this invention proposes an improved RepViT (I-RepViT) module. This module employs a separate channel and token mixer design, a multi-head self-attention mechanism, and a structural reparameterization strategy. It replaces the traditional SE attention mechanism with the CBAM attention mechanism to improve the global modeling and feature fusion capabilities of the neck network, enabling autonomous vehicles to cope with complex traffic environments more safely and reliably, laying a solid foundation for achieving true driverless driving.

[0052] Furthermore, such as Figure 9 As shown, based on the above-described YOLOv8-based small target detection method, this invention also provides a YOLOv8-based small target detection system, wherein the YOLOv8-based small target detection system includes: The model improvement module 51 is used to determine the target YOLOv8 network and construct a preset target detection model based on the target YOLOv8 network. The preset target detection model includes an improved backbone network, an improved neck network, and a head detection network. The weight distribution feature generation module 52 is used to acquire vehicle images, input the vehicle images into the improved backbone network, and perform channel grouping and multi-scale feature modeling on the vehicle images through the improved backbone network to obtain weight distribution features. The multi-scale feature fusion module 53 is used to perform convolution processing, feature segmentation processing and fusion processing on the weight distribution features to obtain fused multi-scale features. The detection result output module 54 is used to input the fused multi-scale features sequentially into the improved neck network and the detection head network, and output the small target detection result.

[0053] Furthermore, such as Figure 10 As shown, based on the above-mentioned small target detection method and system based on YOLOv8, the present invention also provides a terminal, which includes a processor 10, a memory 20 and a display 30. Figure 10Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0054] In some embodiments, the memory 20 may be an internal storage unit of the terminal, such as a hard disk or memory. In other embodiments, the memory 20 may be an external storage device of the terminal, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc. Further, the memory 20 may include both internal and external storage devices. The memory 20 is used to store application software and various types of data installed on the terminal, such as program code installed on the terminal. The memory 20 can also be used to temporarily store data that has been output or will be output. In one embodiment, the memory 20 stores a YOLOv8-based small target detection program 40, which can be executed by the processor 10 to implement the YOLOv8-based small target detection method of this application.

[0055] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chip, used to run program code stored in the memory 20 or process data, such as executing the YOLOv8-based small target detection method.

[0056] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 30 is used to display information on the terminal and to display a visual user interface.

[0057] In one embodiment, when the processor 10 executes the YOLOv8-based small target detection program 40 in the memory 20, it implements the steps of the YOLOv8-based small target detection method as described above.

[0058] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a small target detection program based on YOLOv8, and the small target detection program based on YOLOv8, when executed by a processor, implements the steps of the small target detection method based on YOLOv8 as described above.

[0059] In summary, this invention provides a small target detection method and system based on YOLOv8. The method includes: determining a target YOLOv8 network and constructing a preset target detection model based on the target YOLOv8 network, wherein the preset target detection model includes an improved backbone network, an improved neck network, and a detection head network; acquiring a vehicle-mounted image and inputting the vehicle-mounted image into the improved backbone network, performing channel grouping and multi-scale feature modeling on the vehicle-mounted image through the improved backbone network to obtain weight distribution features; performing convolution, feature segmentation, and fusion processing on the weight distribution features to obtain fused multi-scale features; and sequentially inputting the fused multi-scale features into the improved neck network and the detection head network to output the small target detection result. This invention improves the YOLOv8 network to construct a preset target detection model, enabling fast and accurate detection of small targets in vehicle-mounted images and improving safety during vehicle operation.

[0060] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal that includes that element.

[0061] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The computer-readable storage medium can be a memory, magnetic disk, optical disk, etc.

[0062] It should be understood that the application of the present invention is not limited to the examples above. Those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.

Claims

1. A small target detection method based on YOLOv8, characterized in that, The YOLOv8-based small target detection method includes: A target YOLOv8 network is identified, and a preset target detection model is constructed based on the target YOLOv8 network. The preset target detection model includes an improved backbone network, an improved neck network, and a head detection network. The vehicle-mounted image is acquired and input into the improved backbone network. The improved backbone network performs channel grouping and multi-scale feature modeling on the vehicle-mounted image to obtain weight distribution features. The weight distribution features are subjected to convolution, feature segmentation, and fusion processing to obtain fused multi-scale features; The fused multi-scale features are sequentially input into the improved neck network and the detection head network to output small target detection results.

2. The small target detection method based on YOLOv8 according to claim 1, characterized in that, The process of determining the target YOLOv8 network and constructing a preset target detection model based on the target YOLOv8 network specifically includes: Identify the target YOLOv8 network, wherein the target YOLOv8 network includes a backbone network, a neck network, and a detection head network; The improved backbone network is obtained by replacing the ShuffleNetV2 module in the backbone network with the ShuffleNet module and the C2f module in the backbone network with the C2f_IECA module. The improved RepViT module is obtained by replacing the first SE attention mechanism module in the RepViT module with the CBAM attention mechanism module, and the improved neck network is obtained by replacing the convolution module in the neck network with the improved RepViT module. A preset target detection model is constructed based on the improved backbone network, the improved neck network, and the detection head network.

3. The small target detection method based on YOLOv8 according to claim 2, characterized in that, The process of acquiring vehicle-mounted images involves inputting the images into the improved backbone network, and then performing channel grouping and multi-scale feature modeling on the images through the improved backbone network to obtain weight distribution features. Specifically, this includes: The vehicle-mounted image is acquired and input into the improved backbone network, wherein the improved backbone network includes the ShuffleNet module, the Concat module, and the second SE attention mechanism module; The improved backbone network is used to uniformly divide the vehicle image to obtain multiple divided vehicle images. Multiple segmented vehicle images are input into multiple sub-feature branches in the ShuffleNet module. The first convolution process is performed on the corresponding segmented vehicle images through the multiple sub-feature branches to obtain multiple multi-scale features. Multiple multi-scale features are input into the Concat module, and the Concat module performs a first fusion process on the multiple multi-scale features to obtain a first fused feature; The first fused feature is input into the second SE attention mechanism module, which outputs the weight distribution feature.

4. The small target detection method based on YOLOv8 according to claim 3, characterized in that, The step of inputting the first fused feature into the second SE attention mechanism module and outputting the weight distribution feature specifically includes: The first fused feature is input into the second SE attention mechanism module, and the second SE attention mechanism module performs global context extraction and global average pooling on the first fused feature to obtain a one-dimensional vector. Dynamic weights are generated based on the one-dimensional vector to obtain the weight distribution characteristics.

5. The small target detection method based on YOLOv8 according to claim 3, characterized in that, The process of performing convolution, feature segmentation, and fusion on the weight distribution features to obtain fused multi-scale features specifically includes: The weight distribution features are input into the C2f_IECA module in the improved backbone network, and the weight distribution features are subjected to a second convolution process by the C2f_IECA module to obtain convolution features. The convolutional features are input into the Split module in the improved backbone network, and the Split module divides the convolutional features to obtain multiple branch features. Each of the branch features is sequentially input into multiple Bottleneck_IECA modules in the improved backbone network to obtain multiple branch output results; The output results of multiple branches are input into the Concat module in the improved backbone network. The Concat module performs a second fusion process on the output results of multiple branches to obtain a second fusion feature. The second fused feature is input into the output layer of the improved backbone network, and the second fused feature is subjected to a third convolution process through the output layer to obtain fused multi-scale features.

6. The small target detection method based on YOLOv8 according to claim 5, characterized in that, The step of sequentially inputting each branch feature into multiple Bottleneck_IECA modules in the improved backbone network to obtain multiple branch output results specifically includes: Each of the aforementioned branch features is input into the global max pooling branch and the global average pooling branch in the Bottleneck_IECA module, respectively; The first feature is obtained by performing global average pooling on each of the branch features through the global average pooling branch. The first feature is processed by a fourth convolution and a sigmoid activation function to obtain the attention weight of the first channel. The second feature is obtained by performing global max pooling on each of the branch features through the global max pooling branch. The second feature is processed by a fifth convolution and a sigmoid activation function to obtain the attention weights for the second channel. A third fusion process is performed on the attention weights of the first channel and the attention weights of the second channel to obtain the fused weights; The features of each branch are weighted according to the fusion weights to obtain multiple branch output results.

7. The small target detection method based on YOLOv8 according to claim 2, characterized in that, The step of sequentially inputting the fused multi-scale features into the improved neck network and the detection head network, and outputting small target detection results, specifically includes: The fused multi-scale features are input into the improved neck network, and the improved RepViT module in the improved neck network is used to perform spatial downsampling processing on the fused multi-scale features to obtain downsampled multi-scale features. The downsampled multi-scale features are input into the detection head network, and the detection head network performs detection processing on the downsampled multi-scale features to obtain small target detection results.

8. A small target detection system based on YOLOv8, characterized in that, The YOLOv8-based small target detection system includes: The model improvement module is used to determine the target YOLOv8 network and construct a preset target detection model based on the target YOLOv8 network. The preset target detection model includes an improved backbone network, an improved neck network, and a head detection network. The weight distribution feature generation module is used to acquire vehicle images, input the vehicle images into the improved backbone network, and perform channel grouping and multi-scale feature modeling on the vehicle images through the improved backbone network to obtain weight distribution features. The multi-scale feature fusion module is used to perform convolution processing, feature segmentation processing, and fusion processing on the weight distribution features to obtain fused multi-scale features. The detection result output module is used to sequentially input the fused multi-scale features into the improved neck network and the detection head network, and output the small target detection result.

9. A terminal, characterized in that, The terminal includes: a memory, a processor, and a YOLOv8-based small target detection program stored in the memory and executable on the processor. When the YOLOv8-based small target detection program is executed by the processor, it implements the steps of the YOLOv8-based small target detection method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a small target detection program based on YOLOv8, which, when executed by a processor, implements the steps of the small target detection method based on YOLOv8 as described in any one of claims 1-7.