Improved yolov8-based intelligent small target detection method and early warning system
By improving the YOLOv8 algorithm, utilizing multi-stage feature extraction and fusion, and combining the CAFC module and multi-head attention mechanism, the accuracy and stability issues of YOLOv8 in small target detection for UAVs are solved, achieving efficient and real-time small target detection.
Patent Information
- Application Number
- CN202511107917.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2026-02-24
AI Technical Summary
The existing YOLOv8 algorithm has problems in small target detection by UAVs, such as easy loss of small target features, insufficient modeling of long-distance dependencies, limited computing resources, and weak adaptability to complex scenarios, which makes it difficult to meet the requirements for detection accuracy and stability.
An improved YOLOv8 method is adopted, which enhances the accuracy and robustness of small object detection through multi-stage feature extraction and fusion, combined with CAFC module and multi-head attention mechanism. Lightweight convolution branches are used to reduce the amount of computation, and the computational resources of the detection head are dynamically adjusted to adapt to complex scenarios.
It improves the detection accuracy of small targets, reduces the false negative rate, enhances the model's adaptability to complex scenarios, and meets the real-time detection needs of UAVs.
Smart Images

Figure CN121564576A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of unmanned aerial vehicle (UAV) and small target detection technology, specifically involving an intelligent small target detection method and early warning system based on improved YOLOv8. Background Technology
[0002] Object detection, a core task in computer vision, holds significant value in drone applications such as power line inspection, security monitoring, and environmental monitoring. In recent years, deep learning-based object detection algorithms have made remarkable progress, particularly the YOLO series, which has been widely adopted in industry due to its high detection speed and accuracy. YOLOv8, the latest version in the YOLO series, demonstrates superior performance in general object detection tasks by incorporating various advanced technologies (such as the CSP structure, PANet feature pyramid, and dynamic label assignment strategies).
[0003] However, in real-time target detection scenarios using drones, YOLOv8 still faces the following challenges: Small target features are easily lost: Images captured by drones typically have a high shooting altitude and a large field of view, resulting in a small proportion of pixels occupied by the target in the image (for example, a typical low-altitude aircraft may occupy less than 10×10 pixels when photographed at an altitude of 100 meters). In YOLOv8's three-detection-head architecture (large / medium / small targets), the feature map corresponding to the smallest detector head is downsampled twice (to 1 / 16 of the original image size), causing the detailed features of small targets (such as edges and textures) to gradually become blurred or even lost during multi-layer convolution and downsampling, leading to a decrease in detection accuracy. Insufficient long-distance dependency modeling: Small targets are often sparsely distributed in images, and their contextual information (such as the surrounding environment and related objects) is crucial for accurate identification. Traditional convolutional operations have limited receptive fields, making it difficult to effectively capture the relationship between small targets and distant context. Although YOLOv8 achieves multi-scale feature fusion through the feature pyramid structure, its ability to model long-distance dependencies across regions still needs improvement. Limited computing resources: UAV platforms typically incorporate embedded computing devices (such as the NVIDIA Jetson series), which have limited computing power and power consumption budgets. Improving the accuracy of small target detection efficiently while maintaining a real-time detection frame rate (typically ≥30 FPS) becomes a key challenge. Traditional accuracy improvement methods (such as increasing network depth and expanding the receptive field) often significantly increase computational complexity, making it difficult to meet the real-time requirements of UAVs. Weak adaptability to complex scenarios: The operating environment of drones is complex and variable. Lighting conditions (such as strong light and backlight), weather factors (such as fog and rain), and target movement (such as high-speed movement and occlusion) can all affect the detectability of small targets. YOLOv8's general detection head design is difficult to adapt to changes in the feature distribution of small targets in different scenarios, resulting in insufficient detection stability.
[0004] In summary, the existing YOLOv8 algorithm has obvious limitations in the small target detection task of UAVs, and there is an urgent need for an improved solution that can both efficiently extract small target features and adapt to complex scenarios. Summary of the Invention
[0005] To address the aforementioned problems in existing technologies, namely the issues of easy loss of small target features, insufficient long-distance dependency modeling, limited computational resources, and weak adaptability to complex scenes in UAV small target detection, which lead to insufficient detection accuracy and stability, this invention proposes, in its first aspect, an intelligent small target detection method based on an improved YOLOv8 algorithm. This method includes the following steps: The process involves acquiring video data collected by a drone, extracting frames from the video data and dividing it into tasks, and using the task-divided images as input images; the task division includes category division. The input images are input into the backbone network, and features are extracted from each input image through multi-stage downsampling and feature recombination to output multi-scale feature maps. The multi-scale feature map is upsampled in multiple stages by the neck network to generate upsampled feature maps for the corresponding stages. The upsampled feature maps of each stage are then concatenated with the multi-scale feature map of the corresponding scale in stages. The concatenated feature maps are then fused after multi-branch processing to generate a multi-stage fused feature map. The first stage fusion feature map in the multi-stage fusion feature map is directly fed into the detection head, and the remaining stages are sequentially processed by downsampling, splicing and feature fusion before entering the detection head. The target detection result is obtained through the detection head. The multi-branch configuration includes three branches. Each branch is configured to perform linear and activation function processing on the concatenated feature map to obtain a preprocessed feature map. The first branch performs channel weighting on the preprocessed feature map, the second branch performs dot product processing on the preprocessed feature map, and the third branch performs multi-head attention weighting on the concatenated feature map. At least four detection heads are configured, and each detection head performs target detection at different scales through convolution processing.
[0006] The second invention proposes an intelligent small target detection and early warning system based on improved YOLOv8. Based on the aforementioned intelligent small target detection method based on improved YOLOv8, the system includes: The data acquisition and preprocessing module is configured to: acquire video data collected by the UAV, extract frames from the video data and divide it into tasks, and use the images after task division as input images; the task division includes category division. The backbone network module is configured to: input the input image into the backbone network, extract features from each input image through multi-stage downsampling and feature recombination, and output a multi-scale feature map; The neck network module is configured to: perform multi-stage upsampling on the multi-scale feature map through the neck network to generate upsampled feature maps for the corresponding stages; concatenate the upsampled feature maps of each stage with the multi-scale feature map of the corresponding scale in stages; and perform feature fusion on the concatenated feature map after multi-branch processing to generate a multi-stage fused feature map. The first stage fusion feature map in the multi-stage fusion feature map is directly fed into the detection head, and the remaining stages are sequentially processed by downsampling, splicing and feature fusion before entering the detection head. The target detection result is obtained through the detection head. The multi-branch configuration includes three branches. Each branch is configured to perform linear and activation function processing on the concatenated feature map to obtain a preprocessed feature map. The first branch performs channel weighting on the preprocessed feature map, the second branch performs dot product processing on the preprocessed feature map, and the third branch performs multi-head attention weighting on the concatenated feature map. The detection head module is configured such that at least four detection heads are provided, and each detection head performs target detection at different scales through convolution processing. The early warning module issues an early warning when a preset interest category is found in the target detection results, based on a set threshold.
[0007] The beneficial effects of this invention are: The newly added target detection head directly connects to the shallow features of the backbone network. Combined with the CAFC module added to the neck network, it efficiently extracts local and global feature information based on a large receptive field using an attention mechanism. Simultaneously, it employs depthwise separable convolutions to extract channel and spatial features with low computational cost, significantly improving the accuracy of small target detection. Specifically, channel attention enhances key features, effectively preventing the loss of small target details during deep downsampling. Combined with the global context captured by multi-head attention branches, this improves the accuracy of small target detection and reduces the false negative rate. The lightweight convolutional branch uses depthwise separable convolutions, reducing the number of parameters when extracting local spatial features. The four detection heads share feature extraction resources through dynamic weight allocation and combine a frequency domain fusion mechanism for efficient modeling of global features, achieving improved accuracy while controlling computational growth to meet real-time detection requirements. The frequency domain fusion mechanism and multi-head attention branch of the CAFC module enhance the robustness of the model to complex factors such as lighting changes, target occlusion, and background interference in drone scenarios. In low-light and dense small target scenarios, the detection accuracy is improved compared to the original YOLOv8, which broadens the practical application scenarios of the algorithm. The improved solution is based on the original YOLOv8 architecture and is a modular upgrade (adding a detection head and embedding a CAFC module) without changing the core inference process, which facilitates the migration and deployment of existing YOLOv8 models. At the same time, the branch design of the CAFC module supports flexible adjustment (such as adding or removing attention heads and adjusting the convolution kernel size), which can be adapted and optimized according to the different UAV mission requirements (such as power line inspection and environmental monitoring). In summary, CAFC-YOLOv8 improves the accuracy of small target detection while taking into account real-time performance and adaptability to complex scenarios, providing an efficient and reliable technical solution for UAV real-time detection tasks. Attached Figure Description
[0008] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram of the structure of the CAFC-YOLOv8 network used to implement the intelligent small target detection method and early warning system based on the improved YOLOv8 of this invention.
[0009] Figure 2 This is a schematic diagram of the CAFC module structure for implementing the intelligent small target detection method and early warning system based on the improved YOLOv8 of this invention.
[0010] Figure 3 This is a schematic diagram of the Fast Fourier Convolution module structure in the CAFC module of this invention.
[0011] Figure 4 This is a schematic diagram of the lightweight convolution module structure in the CAFC module of this invention.
[0012] Figure 5 This is a schematic diagram of the multi-head attention module structure in the CAFC module of this invention.
[0013] Figure 6 This is a schematic diagram of the self-attention structure in the multi-head attention module of the present invention.
[0014] Figure 7 This is a schematic diagram of the pointwise convolution unit in the lightweight convolution module of the present invention.
[0015] Figure 8 This is a schematic diagram of the depth convolution unit in the lightweight convolution module of the present invention.
[0016] Figure 9 This is a schematic diagram of the existing C2f module structure.
[0017] Figure 10 This is a schematic diagram of the existing Conv module structure.
[0018] Figure 11 This is a schematic diagram of the existing SPPF module structure. Detailed Implementation
[0019] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0021] To more clearly explain the implementation method of the distributed seat layout of the present invention, the following is combined with... Figures 1 to 11 The steps in the embodiments of the present invention will be described in detail below.
[0022] The first embodiment of the present invention is an intelligent small target detection method based on improved YOLOv8, see [link to relevant documentation]. Figure 1 The method includes the following steps: Video data collected by drones (typically collected at low altitudes of 80-100 meters, covering different weather conditions such as sunny, cloudy, and rainy, and lighting conditions such as scenes under strong daylight, dusk, and low nightlight) is acquired. The video data is then processed by frame extraction and task partitioning, with the partitioned images used as input images. Task partitioning includes category partitioning (e.g., multi-category labeling, including targets such as pedestrians, cars, trees, and land, and divided into training, validation, and test sets according to a predetermined ratio) to obtain an image dataset. The image dataset includes training, validation, and test sets. In this embodiment, preprocessing of the images in the training set is also included, such as adding Gaussian noise and applying random masks to augment the dataset and enhance the robustness of the algorithm model. The input images are input into the backbone network, that is, the images in the training set (RGB images with width × height × channels of 600 × 400 × 3) are input into the backbone network. Features are extracted from each input image through multi-stage downsampling and feature recombination, and multi-scale feature maps are output. In this embodiment, the multi-stage downsampling includes at least five progressive downsampling operations. After each downsampling, the feature map is shuffled and connected across stages by a feature reorganization module to enhance feature representation capabilities. Specifically, each stage includes: spatial downsampling performed by a convolutional kernel (Conv), feature reorganization and cross-stage connection performed by a C2f module, resulting in a halved output feature map size and a multiplied number of channels. A differentiated downsampling strategy is adopted: first stage: two consecutive C2f modules cascaded; second / third stage: a single C2f module; fourth stage: C2f module + SPPF pyramid pooling. The multi-scale feature map is upsampled in multiple stages by the neck network to generate upsampled feature maps for the corresponding stages. The upsampled feature maps of each stage are then concatenated with the multi-scale feature map of the corresponding scale in stages. The concatenated feature map is then processed by a multi-branch (i.e., CAFC module, channel attention Fourier convolution, used to extract local features in a smaller range) and then fused to generate a multi-stage fused feature map. The first stage fusion feature map in the multi-stage fusion feature map is directly fed into the detection head, and the remaining stages are sequentially processed by downsampling, splicing and feature fusion before entering the detection head. The target detection result is obtained through the detection head. The multi-branch configuration includes three branches. Each branch is configured to perform linear activation function processing on the concatenated feature map (F) to obtain a preprocessed feature map (F'). The first branch performs channel weighting on the preprocessed feature map, the second branch performs dot product processing on the preprocessed feature map, and the third branch performs multi-head attention weighting on the concatenated feature map. At least four detection heads are configured, and each detection head performs target detection at different scales through convolution processing. In this embodiment, the first-stage fused feature map directly enters the detection head. Compared to the traditional YOLOv8, which requires two convolutional module calculations, this essentially involves two downsampling operations, significantly reducing the receptive field. Since the feature map output by the first stage of the backbone network is output after the first downsampling, it is closer to the feature input end, resulting in a larger receptive field for the detection head and greater sensitivity to small targets, including the finest pixel-level details (i.e., the first detection head). The remaining stages sequentially undergo downsampling, concatenation, and feature fusion processing before entering the detection head (i.e., the other three detection heads). The multi-stage upsampling includes at least three progressive upsampling operations. Each upsampling process sequentially includes: upsampling, feature concatenation, and C2f module processing. By progressively restoring the feature map resolution and fusing the multi-scale features of the backbone network, cross-stage information complementarity is achieved. The feature interactions between the backbone network and the neck network, as well as the connection relationships of the CAFC modules, are as follows: The fourth-stage feature map (containing medium-scale spatial details) in the backbone network is directly fed into the fourth CAFC module. Through the frequency domain and spatial domain feature fusion mechanism, the global context representation of large-scale targets is enhanced, providing a foundation for subsequent large-scale target detection. After upsampling, the fourth-stage feature map in the backbone network is concatenated with the third-stage feature map (containing medium-scale spatial details) in the backbone network. After concatenation, the feature representation is enhanced by the C2f module and then enters the third CAFC module. The third CAFC module can simultaneously process medium-scale local details and global semantic information, optimizing the feature representation of medium-sized targets. The aforementioned feature maps continue to participate in the next stage of upsampling. After being upsampled again, they are concatenated with the second-stage feature maps (containing finer spatial details) in the backbone network. After concatenation, they are processed by the C2f module and then enter the second CAFC module. Through frequency domain analysis, the texture and structural features of the target are further mined. Combined with low-level spatial details, the detection capability of small and medium-scale targets is improved. After the feature map is upsampled for the third time, it is concatenated with the feature map output from the first stage of the backbone network. After concatenation, it enters the first CAFC module through the C2f module for processing. The multi-branch attention mechanism is used to enhance the edge and texture features of small targets, providing key support for small-scale target detection. See Figure 2 The concatenated feature maps are then processed through multiple branches and fused to generate a multi-stage fused feature map. The method is as follows: The preprocessed feature map is input into the channel attention module branch to calculate the channel weights. The preprocessed feature map is then weighted using the channel weights to obtain a channel-weighted feature map. To achieve adaptive enhancement of key channel features (such as small target edges and textures), the channel attention module includes a linear layer and a SoftMax activation function connected in sequence. Specifically, after the linear layer, a trainable parameter W is used to dynamically control the calculation result, and then the result is calculated using the SoftMax activation function to obtain the attention weight parameters for the feature channel. The preprocessed feature map is multiplied by the trainable parameter K to obtain a dynamic control feature map. The dynamic control feature map and the channel-weighted feature map are then input into a lightweight convolutional module branch to extract local spatial features, resulting in a local spatial feature map. (See also...) Figure 4The lightweight convolution module comprises a linear layer, a GLU activation function, a depthwise separable convolution, and another linear layer connected in sequence. While maintaining feature representation capabilities, it extracts local spatial features with low computational cost, meeting the real-time detection requirements of UAVs. Compared to traditional convolution, it exhibits significant advantages in computational efficiency, parameter optimization, and feature representation capabilities by decoupling spatial filtering and channel transformation. The depthwise separable convolution includes depthwise convolution (using a convolution kernel of a specified size to independently perform spatial convolution operations on each channel of the input feature map; that is, each input channel is convolved with only one two-dimensional convolution kernel, and the number of output channels remains the same as the number of input channels, only changing the W and H of the features) and pointwise convolution (using a 1×1 convolution kernel to control the number of output channels, flexibly enhancing or suppressing specific channel features and improving the nonlinear representation capability of the model). Schematic diagrams of the depthwise convolution unit and the pointwise convolution unit are shown below. Figure 8 , Figure 7 ; The number of parameters for the depthwise convolution is: Number of parameters = (Number of input channels × Kernel height × Kernel width) / Number of groups + Number of target output channels; The pointwise convolution is a 1×1 convolution kernel; The number of parameters for the pointwise convolution is: number of parameters = 1 × number of input channels × number of target output channels. Compared with ordinary convolution, it reduces the number of parameters and helps the model converge quickly during training. See Figure 5 The concatenated feature map is input into the multi-head attention module branch, grouped in the W / H dimension, and each group is calculated by the self-attention module. Multiple attentions are concatenated in the channel dimension to obtain the concatenated feature map. The concatenated feature map is then linearly transformed by a linear layer to obtain the context-enhanced feature map. Here, W represents the width of the concatenated feature map, and H represents the height of the concatenated feature map. It can efficiently capture long-range dependencies between global data, overcoming the limitations of convolutional neural networks in global modeling; see also Figure 6The self-attention module takes the preprocessed feature map as input and generates a query vector Q, a key vector K, and a value vector V through three linear layers. Then, Q and K are multiplied, and the result is scaled. The SoftMax function is applied to the scaled result to obtain normalized attention weights. These weights are multiplied by the value vector V, and the result is output as the attention for each head through a linear layer. The core of the self-attention mechanism lies in its autonomous discovery of the inherent relationships within the data. It does not rely on external parameters but drives the discovery of key features through the data itself. This mechanism exhibits strong memory capabilities, efficiently capturing long-range dependencies between global data. This characteristic precisely compensates for the limitations of convolutional neural networks in global modeling. The grouping strategy of the multi-head attention mechanism is applied to W and H, without involving channel-specific attention. Especially in the heads near the input segment, due to their larger receptive fields, grouping is done based on width and height. This grouping divides the image, allowing for the retrieval of small targets within a smaller range, enabling the attention to focus more on the features of small targets. For example, when processing images containing small targets, since the features of small targets are in Q and K... During the interaction, local high similarity regions will be formed. The weight matrix will automatically strengthen the influence of this region on V, thereby highlighting small target information in the output features and forming a synergy with the subsequent detection head for small-scale targets, improving the detection robustness in complex scenes. The scaling dot product attention is: ; In the formula, This is a similarity matrix. Scaling factor It is the dimension of the key vector; The bulls' focus is on: ; ; In the formula, It is a linear transformation matrix. The outputs of all heads are concatenated along the feature dimension. For linear transformation projection, Number of heads; The local spatial feature map and the context-enhanced feature map are concatenated (Add) to obtain local and global feature maps; the local and global feature maps are then processed by fast Fourier transform and inverse transform to obtain a multi-stage fused feature map. The system transforms spatial features into the frequency domain for global context modeling, and then restores them to the spatial domain using IFFT. This enhances the global perception of small targets and improves robustness to complex scenes such as lighting changes and occlusion. The detection accuracy is improved compared to the original model under low illumination conditions. The local and global feature maps are processed by Fast Fourier Transform and Inverse Fourier Transform, as follows: Step 1: Divide the local and global feature maps equally along the channel dimension to form the first feature sub-map and the second feature sub-map; Step 2: Perform parallel feature processing based on the first feature sub-map and the second feature sub-map: Perform spatial convolution on the first feature sub-map to output local-to-local features; After performing spatial convolution on the first feature sub-image, a fast Fourier transform is applied to output local to global features. After performing a Fast Fourier Transform on the second feature sub-map, spatial convolution is performed to output global-to-local features; Perform Fast Fourier Transform, Frequency Domain Convolution, and Inverse Transform on the second feature sub-map to output global-to-global features; Step 3: Perform cross-branch feature fusion on the features output in Step 2: First group: add the local-to-local features and the global-to-local features element-wise; Second group: add the local-to-global features and the global-to-global features element-wise. Step 4: The features output from the two groups in Step 3 are concatenated along the channel dimension to restore the local and global features. Figure 1 The number of channels is determined to obtain a multi-stage fusion feature map; See Figure 3 The method involves performing a Fast Fourier Transform, frequency domain convolution, and inverse transform on the global feature sub-map to output global-to-global features. The global feature sub-map is subjected to Fast Fourier Transform to generate real and imaginary features. The generation of real and imaginary features is achieved by performing Fast Fourier Transform on the global feature sub-map to the frequency domain, and then dividing the frequency domain space by the feature width to generate real and imaginary features. The real part feature and the imaginary part feature are concatenated along the channel dimension to generate a recombined feature; The recombined features are sequentially subjected to convolution transformation, batch normalization, and ReLU activation function to generate activated features; The activation feature is divided into two parts along the channel dimension to obtain the recovered real part feature and the recovered imaginary part feature with the same dimension as the real part feature and the imaginary part feature; The recovered real part features and the recovered imaginary part features are transformed back to the spatial domain by inverse fast Fourier transform to generate global-to-global features; In summary, the neck network structure is improved by adding a multi-branch, channel attention dynamic convolution (CAFC) module. Specifically, the channel attention branch calculates channel weights and adaptively enhances key channel features (such as small object edges and textures); the lightweight convolution branch uses depthwise separable convolution combined with the GLU activation function to extract local spatial features with low computational cost while maintaining feature expressive power. Multi-head attention branch: The feature map is grouped according to the average size of the target, and the long-range dependencies between different regions are captured through the multi-head self-attention mechanism; Fast Fourier Transform (FFT) is introduced to transform the spatial domain features to the frequency domain for global context modeling, and then IFFT is used to restore them to the spatial domain, which enhances the global perception capability of small targets; The four detection heads share a partial feature extraction layer, and the computing resources of each detection head are adaptively adjusted through a dynamic weight allocation mechanism to improve accuracy while maintaining real-time performance. By using lightweight convolution and dynamic computational allocation, the real-time detection needs of drones are met; The frequency domain fusion mechanism of the CAFC module enhances robustness to complex scenes such as changes in illumination and occlusion, and improves detection accuracy under low illumination conditions compared to the original model. The detection head is set with at least 4 heads, and each detection head performs target detection at different scales through convolution processing to obtain target detection results; The connection relationship between the CAFC module output and the detection head is as follows: The detection head is configured with four heads. The first CAFC module outputs a one-stage fused feature map which is fed into the first detection head to focus on detecting small targets. Meanwhile, the output of the first CAFC module is concatenated with the two-stage fusion feature map output by the second CAFC module after being downsampled by Conv, and then processed by the C2f module before entering the second detection head, which is responsible for the detection of medium-sized targets. The second detection head can simultaneously utilize small-scale enhancement features and medium-scale features to optimize the detection accuracy of medium-scale targets. The spliced features are further downsampled and then concatted with the three-stage fusion feature map output by the third CAFC module. The concat features are then fed into the third detection head via the C2f module. By integrating multi-scale enhancement features, the detection capability for medium to large-scale targets is improved. Finally, this feature is concatenated with the four-stage fusion feature map output by the fourth CAFC module, and then fed into the fourth detection head via the C2f module, focusing on large target and global semantic detection. In this way, each detection head can acquire features optimized by different levels of CAFC modules, achieving full-scale coverage detection from extremely small targets to extremely large targets; It also includes training the target detection results using cross-entropy loss in the training set and evaluating the results using evaluation metrics. In this embodiment, the training parameters are set as follows: the number of training iterations epoch = 250, the batch size = 24, the initial learning rate of the network is set to 0.01, the stochastic gradient descent optimizer SGD is used, and the input image size is uniformly scaled to 640×640 (the parameter settings are consistent with those in the original YOLOv8 paper, and the batch size and epoch are set by the user). Evaluation metrics include: Precision: the percentage of samples that predicted positive is correct, Precision = TP / (TP + FP). Recall: The percentage of true positive samples that are correctly predicted as positive. Recall = TP / (TP + FN); Mean Average Precision (mAP): The average precision for multi-class problems. Here, mAP(50) represents the mAP value at a 50% IOU threshold. mAP(50-95) calculates the mAP within the 50-95% IOU threshold range. Number of parameters: The total number of parameters used in the algorithm model; The cross-entropy loss function: ; in, Representative sample The label is 1 for the target to be detected, and 0 for the other. Indicates sample The probability of predicting it as positive; experiment: 1. The experimental dataset used is the Visdrone2019 dataset, which is an open-source dataset. The training set contains 6471 images, the validation set contains 548 images, and the test set contains 1610 images. The dataset provides 12 classes. To facilitate experiments and algorithm model training, the dataset has been processed and converted to YOLO format. 2. Evaluation indicators: average accuracy, number of parameters; 3. Comparative experiment: To verify the intelligent small target detection method and early warning system of the improved YOLOv8 proposed in this invention, experiments were conducted on the same test set to compare it with multiple traditional models such as Fast-R-CNN, YOLOv9, and YOLOv8. The results are shown in Table 1. As can be seen from the analysis of Table 1, this invention has good performance in small target detection, reduces the number of model parameters, and improves the accuracy of the model. Table 1
[0023] 4. Ablation experiments: To further explore the module performance and structural changes to the YOLOv8 model, this method added a series of ablation experiments to investigate the impact of each sub-module and sub-unit on the overall model performance. In this ablation experiment, several experiments were conducted, including using three detector heads with the CAFC module, four detector heads without the CAFC module, the CAFC module using only multi-head attention, and the CAFC module without multi-head attention. The results are shown in Table 2. Analysis of Table 2 shows that this invention has good performance in small target detection, reduces the number of model parameters, and improves the accuracy of the model. Table 2
[0024] Although the steps in the embodiments are described in the above-described order, those skilled in the art will understand that, in order to achieve the effect of this embodiment, different steps do not necessarily need to be executed in this order. They can be executed simultaneously (in parallel) or in reverse order. These simple variations are all within the protection scope of this invention.
[0025] A second embodiment of the present invention proposes an intelligent small target detection and early warning system based on improved YOLOv8. The intelligent small target detection method based on improved YOLOv8 is characterized in that the system includes: The data acquisition and preprocessing module is configured to: acquire video data collected by the UAV, extract frames from the video data and divide it into tasks, and use the images after task division as input images; the task division includes category division. The backbone network module is configured to: input the input image into the backbone network, extract features from each input image through multi-stage downsampling and feature recombination, and output a multi-scale feature map; The neck network module is configured to: perform multi-stage upsampling on the multi-scale feature map through the neck network to generate upsampled feature maps for the corresponding stages; concatenate the upsampled feature maps of each stage with the multi-scale feature map of the corresponding scale in stages; and perform feature fusion on the concatenated feature map after multi-branch processing to generate a multi-stage fused feature map. The first stage fusion feature map in the multi-stage fusion feature map is directly fed into the detection head, and the remaining stages are sequentially processed by downsampling, splicing and feature fusion before entering the detection head. The target detection result is obtained through the detection head. The multi-branch configuration includes three branches. Each branch is configured to perform linear and activation function processing on the concatenated feature map to obtain a preprocessed feature map. The first branch performs channel weighting on the preprocessed feature map, the second branch performs dot product processing on the preprocessed feature map, and the third branch performs multi-head attention weighting on the concatenated feature map. The detection head module is configured such that at least four detection heads are provided, and each detection head performs target detection at different scales through convolution processing. The early warning module issues an early warning when a preset interest category is found in the target detection results, based on a set threshold.
[0026] It should be noted that the intelligent small target detection and early warning system based on the improved YOLOv8 provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be further decomposed or combined. For example, the modules in the above embodiments can be merged into one module, or further divided into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the various modules or steps and are not considered as an improper limitation of the present invention.
[0027] Those skilled in the art will recognize that the modules and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. The programs corresponding to the software modules and method steps can be placed in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art. To clearly illustrate the interchangeability of electronic hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the invention.
[0028] The terms “first”, “second”, etc., are used to distinguish similar objects, not to describe or indicate a specific order or sequence.
[0029] The term "comprising" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus / device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent in such process, method, article, or apparatus / device.
[0030] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after such changes or substitutions will all fall within the scope of protection of the present invention.
Claims
1. An intelligent small target detection method based on improved YOLOv8, characterized in that, The method includes the following steps: The process involves acquiring video data collected by a drone, extracting frames from the video data and dividing it into tasks, and using the task-divided images as input images; the task division includes category division. The input images are input into the backbone network, and features are extracted from each input image through multi-stage downsampling and feature recombination to output multi-scale feature maps. The multi-scale feature map is upsampled in multiple stages by the neck network to generate upsampled feature maps for the corresponding stages. The upsampled feature maps of each stage are then concatenated with the multi-scale feature map of the corresponding scale in stages. The concatenated feature maps are then fused after multi-branch processing to generate a multi-stage fused feature map. The first stage fusion feature map in the multi-stage fusion feature map is directly fed into the detection head, and the remaining stages are sequentially processed by downsampling, splicing and feature fusion before entering the detection head. The target detection result is obtained through the detection head. The multi-branch configuration includes three branches. Each branch is configured to perform linear and activation function processing on the concatenated feature map to obtain a preprocessed feature map. The first branch performs channel weighting on the preprocessed feature map, the second branch performs dot product processing on the preprocessed feature map, and the third branch performs multi-head attention weighting on the concatenated feature map. At least four detection heads are configured, and each detection head performs target detection at different scales through convolution processing.
2. The intelligent small target detection method based on improved YOLOv8 according to claim 1, characterized in that, The concatenated feature maps are then processed through multiple branches and fused to generate a multi-stage fused feature map. The method is as follows: The preprocessed feature map is input into the channel attention module branch to calculate the channel weights. The preprocessed feature map is then weighted using the channel weights to obtain a channel-weighted feature map. The preprocessed feature map is multiplied by the trainable parameters to obtain a dynamic control feature map. The dynamic control feature map and the channel-weighted feature map are input into the lightweight convolution module branch to extract local spatial features, thus obtaining a local spatial feature map. The concatenated feature map is input into the multi-head attention module branch, grouped in the W / H dimension, and each group is calculated by the self-attention module. Multiple attentions are concatenated in the channel dimension to obtain concatenated features. The concatenated features are linearly transformed by a linear layer to obtain a context-enhanced feature map; where W represents the width of the concatenated feature map and H represents the height of the concatenated feature map. The local spatial feature map and the context-enhanced feature map are concatenated to obtain local and global feature maps; the local and global feature maps are then processed by fast Fourier transform and inverse transform to obtain a multi-stage fused feature map.
3. The intelligent small target detection method based on improved YOLOv8 according to claim 2, characterized in that, The local and global feature maps are processed by Fast Fourier Transform and Inverse Fourier Transform, as follows: Step 1: Divide the local and global feature maps equally along the channel dimension to form the first feature sub-map and the second feature sub-map; Step 2, [GUOHF1] performs parallel feature processing based on the first feature sub-map and the second feature sub-map: Perform spatial convolution on the first feature sub-map to output local-to-local features; After performing spatial convolution on the first feature sub-image, a fast Fourier transform is applied to output local to global features. After performing a Fast Fourier Transform on the second feature sub-map, spatial convolution is performed to output global-to-local features; Perform Fast Fourier Transform, Frequency Domain Convolution, and Inverse Transform on the second feature sub-map to output global-to-global features; Step 3: Perform cross-branch feature fusion on the features output in Step 2: First group: add the local-to-local features and the global-to-local features element-wise; Second group: add the local-to-global features and the global-to-global features element-wise. Step 4: The features output from the two groups in Step 3 are concatenated along the channel dimension to restore the number of channels to be consistent with the local and global feature maps, thus obtaining a multi-stage fused feature map.
4. The intelligent small target detection method based on improved YOLOv8 according to claim 3, characterized in that, Performing Fast Fourier Transform, Frequency Domain Convolution, and Inverse Transform on the global feature sub-map to output global-to-global features is as follows: Perform a Fast Fourier Transform on the global feature sub-map to generate real and imaginary features; The real part feature and the imaginary part feature are concatenated along the channel dimension to generate a recombined feature; The recombined features are sequentially subjected to convolution transformation, batch normalization, and ReLU activation function to generate activated features; The activation feature is divided into two parts along the channel dimension to obtain the recovered real part feature and the recovered imaginary part feature with the same dimension as the real part feature and the imaginary part feature; The recovered real part features and the recovered imaginary part features are transformed back to the spatial domain by inverse fast Fourier transform to generate global-to-global features.
5. The intelligent small target detection method based on improved YOLOv8 according to claim 4, characterized in that, The method for generating the real and imaginary features is as follows: the second feature sub-image is transformed to the frequency domain by a fast Fourier transform, and the frequency domain space is divided equally according to the feature width to generate the real and imaginary features.
6. The intelligent small target detection method based on improved YOLOv8 according to claim 2, characterized in that, The lightweight convolution module includes a linear layer, a GLU activation function, a depthwise separable convolution, and a linear layer connected in sequence, wherein the depthwise separable convolution includes depthwise convolution and pointwise convolution.
7. The intelligent small target detection method based on improved YOLOv8 according to claim 6, characterized in that, The parameters of the depthwise convolution are: Parameters = (Number of input channels × Kernel height × Kernel width) / Number of groups + Number of target output channels.
8. The intelligent small target detection method based on improved YOLOv8 according to claim 6, characterized in that, The pointwise convolution is a 1×1 convolution kernel; The number of parameters for the pointwise convolution is: number of parameters = 1 × number of input channels × number of target output channels.
9. The intelligent small target detection method based on improved YOLOv8 according to claim 1, characterized in that, It also includes preprocessing the input image, which includes adding Gaussian noise and applying a random mask.
10. An intelligent small target detection and early warning system based on improved YOLOv8, based on the intelligent small target detection method based on improved YOLOv8 as described in any one of claims 1-9, characterized in that, The system includes: The data acquisition and preprocessing module is configured to: acquire video data collected by the UAV, extract frames from the video data and divide it into tasks, and use the images after task division as input images; the task division includes category division. The backbone network module is configured to: input the input image into the backbone network, extract features from each input image through multi-stage downsampling and feature recombination, and output a multi-scale feature map; The neck network module is configured to: perform multi-stage upsampling on the multi-scale feature map through the neck network to generate upsampled feature maps for the corresponding stages; concatenate the upsampled feature maps of each stage with the multi-scale feature map of the corresponding scale in stages; and perform feature fusion on the concatenated feature map after multi-branch processing to generate a multi-stage fused feature map. The first stage fusion feature map in the multi-stage fusion feature map is directly fed into the detection head, and the remaining stages are sequentially processed by downsampling, splicing and feature fusion before entering the detection head. The target detection result is obtained through the detection head. The multi-branch configuration includes three branches. Each branch is configured to perform linear and activation function processing on the concatenated feature map to obtain a preprocessed feature map. The first branch performs channel weighting on the preprocessed feature map, the second branch performs dot product processing on the preprocessed feature map, and the third branch performs multi-head attention weighting on the concatenated feature map. The detection head module is configured such that at least four detection heads are provided, and each detection head performs target detection at different scales through convolution processing. The early warning module issues an early warning [GUOHF2] when the target detection results contain a preset interest category, based on a set threshold.