Lightweight unmanned aerial vehicle image detection method fusing context and multi-scale features

By improving the feature extraction and fusion method of the YOLOv8 model, the problem of degradation of detection accuracy caused by impaired aerial image quality of the drone is solved, and lightweight and efficient target detection is achieved to meet the real-time detection needs of the drone platform.

CN120431484APending Publication Date: 2025-08-05HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510269773.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-07
Publication Date
2025-08-05

AI Technical Summary

Technical Problem

The image quality of aerial images of drones is damaged in extreme environments, resulting in reduced target detection accuracy and reliability. The computing power of the drone platform is limited, making it difficult to deploy complex models to meet real-time detection needs.

Method used

The lightweight YOLOv8 model with fusion context and multi-scale features is adopted to improve the detection accuracy and speed of the model on the drone platform by improving the feature extraction network, adding a small object detection layer, optimizing feature fusion and bounding box regression loss function.

Benefits of technology

While reducing the computing load, it significantly improves the accuracy and speed of small target detection in drone aerial photography scenarios, meeting the needs of real-time detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120431484A_ABST
    Figure CN120431484A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight unmanned aerial vehicle image detection method fusing context and multi-scale features. The method comprises the following steps: designing a context guidance module and a multi-scale attention mechanism module in a Backbone network; the method comprises the following steps of: constructing an MFFPN (Multi-Feature Fusion Pyramid Network) feature fusion network structure, so that the detection capability of a model on a small target is improved; by constructing a P2 small target detection layer, the detection precision of the model on a small target is enhanced, and the parameter quantity is reduced; by designing a bounding box regression loss function Inner-CIoU, the convergence speed of the model is accelerated, and the accuracy of a prediction box is improved; and finally, training the model to obtain a detection result and evaluating the detection result. According to the method, by enhancing YOLOv8 feature extraction and multi-scale feature fusion capabilities, the problem of loss of deep details and context information of the feature map is relieved, the problems of missing detection, low precision and the like in unmanned aerial vehicle aerial image detection are effectively solved, the detection efficiency and precision are remarkably improved, and a more efficient and accurate solution is provided for the field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision target detection technology, and in particular to a lightweight drone image detection method that integrates context and multi-scale features. Background Art

[0002] Drone technology is rapidly developing and gaining widespread application across various fields. Drones offer high speeds, adaptability to complex terrain, and flexibility in responding to emergencies. Their high-altitude flight capabilities allow them to cover large areas and capture vast amounts of ground data. As an efficient data collection tool, they are widely used in areas such as traffic monitoring, power inspections, crop analysis, and disaster relief.

[0003] Currently, deep learning-based object detection algorithms are generally categorized as single-stage or two-stage algorithms. Single-stage algorithms directly extract the location and category of objects from images. Representative algorithms include the YOLO series and SSD. Two-stage algorithms divide object detection into two stages: generating candidate regions and then classifying and localizing them. Representative algorithms include Fast R-CNN and Faster R-CNN. While these two-stage algorithms offer high accuracy, they are slow, failing to meet real-time requirements and making them unsuitable for deployment on drone platforms. Since drone object detection requires fast and lightweight models, single-stage algorithms are well-suited for drone applications.

[0004] However, the variability of the drone aerial photography environment poses a challenge to image quality. Although the development of modern drone technology has made some progress and can adapt to these changes to a certain extent, when it faces extreme aerial photography conditions such as strong light, dark light or bad weather, the noise and blur of the image become particularly prominent. These factors directly lead to the loss of image clarity and the loss of detailed information of the target object, which greatly interferes with the drone's feature extraction and target recognition capabilities during the image processing process, thereby weakening the detection accuracy and reliability of aerial images.

[0005] Because the objects in drone aerial images are often small and low-resolution, they are prone to mutual occlusion in dense scenes, posing a significant challenge to accurate target identification. Extracting key feature information from complex backgrounds to achieve accurate classification and location of targets has become a pressing issue in drone target detection, particularly in densely populated areas like urban streets.

[0006] In addition, in order to capture more details in the image, the image resolution taken by drones is generally higher, so the target detection algorithm requires greater computational overhead. Because the computing power of the drone platform is low and it must meet real-time requirements, complex models are difficult to deploy on the drone platform, so the model needs to be lightweight. Summary of the Invention

[0007] Purpose of the invention: To address the above problems, the present invention provides a lightweight drone image detection method that integrates context and multi-scale features. By improving the YOLOv8 structure, the model performance is improved, the small target detection accuracy and detection speed in drone aerial photography scenarios are improved, the complexity and computational load of the model are reduced, and the needs of drones for real-time small target detection tasks are met.

[0008] Technical solution: This invention proposes a lightweight UAV image detection method that integrates context and multi-scale features, including the following steps:

[0009] S1: Data acquisition and preprocessing of datasets;

[0010] S2: Build a lightweight YOLOv8 model based on context guidance and multi-scale feature fusion;

[0011] S3: Use Inner-CIoU in post-processing;

[0012] S4: Set training parameters, train the model, obtain test results, and evaluate and compare them.

[0013] Furthermore, the S1 is mainly divided into the following steps:

[0014] S1.1: The public dataset VisDrone2019 was divided into a training set and a validation set. Mosaic data augmentation was used to splice the input images by random scaling, cropping, and arranging them to increase data diversity.

[0015] S1.2: Re-clustering is performed to calculate the adaptive detection box and generate 12 scale detection boxes suitable for the dataset used in this experiment;

[0016] S1.3: Scale the input image to the standard size of 640*640 pixels and then feed it into the detection network.

[0017] Furthermore, the S2 is mainly divided into the following steps:

[0018] S2.1: In the feature extraction stage, the C2f module in the YOLOv8 Backbone feature extraction network is replaced with a CE module, where the CE module consists of a context-guided (CG) module and a multi-scale attention mechanism (EMA) module. The improved YOLOv8 backbone network includes the first convolutional module, the second convolutional module, the first CE module, the third convolutional module, the second CE module, the fourth convolutional module, the third CE module, and the SPPF spatial pyramid pooling structure.

[0019] S2.2: Add a small object detection head P2 to the prediction end of the YOLOv8 algorithm and delete the P5 layer in the model backbone to improve the detection FPS;

[0020] S2.3: During the feature fusion stage, the P1 layer in the neck network is downsampled once and fused with the P2 layer, allowing the small object detection layer P2 to capture more underlying details. Then, based on the characteristics of the BiFPN model, the backbone feature maps P2 and P3 are directly fused with their corresponding final output maps. This preserves the details of the backbone feature maps while avoiding the loss of detail caused by multiple upsampling and downsampling. Two new feature fusion routes are also designed, starting with direct downsampling from the backbone P2 and P3 layers, and then participating in the fusion of the final output feature maps of P3 and P4, respectively. This preserves more details and features of the underlying feature maps.

[0021] Furthermore, the backbone network described in S2.1 is mainly responsible for feature extraction, which includes the context guidance module, the multi-scale attention mechanism module and the SPPF module.

[0022] The context-guided module is a module consisting of 1 1D convolution layer + 1 3D convolution layer + 1 Concat layer + 1 batch normalization Bn layer + 1 PReLU activation function + 2 fully connected layers. Its function is to obtain image features. A context-guided module is regarded as a standard convolution module in the YOLOv8 model.

[0023] The multi-scale attention mechanism module re-adjusts the weights of each parallel branch by encoding global information, highlighting the characteristics of small objects. The multi-scale attention mechanism module adopts a parallel substructure consisting of two 1×1 branches and one 3×3 branch.

[0024] The SPPF module is an improved spatial pyramid pooling module. Compared with the conventional pooling module, this module can realize adaptive size pooling with less computational effort. By obtaining features at different levels (number of pooling times) and then fusing local features with overall features, it helps to ensure that the model has higher detection efficiency and detection accuracy.

[0025] Furthermore, P2 described in S2.2 is a detection head for detecting extremely small targets added on the basis of the original three detection heads of YOLOv8, which corresponds to the output of a 160*160*255 feature map. The other two detection heads are P3 for small target detection corresponding to the output of an 80*80*255 feature map, and P4 for medium target detection corresponding to the output of a 40*40*255 feature map.

[0026] Furthermore, the neck network described in S2.3 is mainly used for feature fusion, which includes the C2f module, the MP downsampling module and the Concat module;

[0027] The C2f module improves the model's feature extraction capabilities and information transfer efficiency without significantly increasing computational effort, thereby enhancing the performance of tasks like object detection and segmentation. The input feature map is first channel-adjusted using a one-dimensional convolution, and then split into two streams: one portion is forwarded directly, while the other is branched through a residual block with skip connections. These two streams are then concatenated and fused using a one-dimensional convolution to adjust the output. This allows for efficient information transmission, reduced computational effort, enhanced feature representation, and improved detection and segmentation performance.

[0028] The MP downsampling module is used to reduce the size of the feature map while keeping the number of feature map channels unchanged, so that feature maps of different scales but the same number of channels can be fused;

[0029] The function of the Concat module is to increase the number of channels of the feature map while ensuring that the size of the feature map remains unchanged, so as to fuse the semantic information of the deep feature map with the position and detail information of the shallow feature map;

[0030] Furthermore, the S3 is specifically as follows: using Inner-CioU in post-processing, controlling the size of the auxiliary bounding box by introducing a scale factor ratio, and using auxiliary boxes of different sizes for calculating the loss according to the IOU and scale of the detection target, thereby accelerating the convergence speed, generating regression results more efficiently, and improving the accuracy of the prediction box.

[0031] Furthermore, the training parameters in S4 are specifically as follows: input image size imgsz = 640, initial learning rate lr = 0.01, learning rate momentum momentum = 0.937, weight decay coefficient weight_decay = 0.0005, training iteration number epoch = 300, batch training dataset sample number batchsize = 16, SGD is selected as the training optimizer, and official pre-trained weights are used for transfer learning and fine-tuning.

[0032] Furthermore, the evaluation indicators in S4 are mainly: mean average precision (mAP), precision P (Precision), and recall R (Recall), where mAP represents the comprehensive weighted average of the average precision (AP) of all categories of detection, P represents the ratio of the number of correctly predicted positive samples to the actual number of positive samples, and R represents the ratio of the number of correctly predicted positive samples to the total number of predicted samples. The specific formula is as follows:

[0033]

[0034] Among them, AP i represents the average precision of the i-th category, K represents K categories, TP represents true positive examples, that is, positive samples predicted by the model as positive, FP represents false positive examples, that is, negative samples predicted by the model as positive, and FN represents false negative examples, that is, positive samples predicted by the model as false.

[0035] Compared with the prior art, the present invention can bring at least one of the following beneficial effects:

[0036] (1) This paper replaces the C2f module in the Backbone feature extraction network of YOLOv8 with a CE module, where the CE module consists of a context guidance module and a multi-scale attention mechanism module. By introducing the CE module, the parameter calculation amount of the model can be reduced and deep feature extraction can be enhanced.

[0037] (2) The present invention proposes a new feature fusion module MFFPN feature fusion network structure, which adds multiple fusions with the backbone feature map at the neck of the model, thereby enhancing the feature map's ability to retain details, retaining more information about small targets, improving the model's detection accuracy and reducing the missed detection rate.

[0038] (3) This paper proposes a new YOLOv8 backbone structure, adds a P2 small target detection layer, and deletes the P5 layer of the backbone. At the same time, it optimizes the number of channels of the model, enhances the model's detail retention of small targets, and enhances the model's feature extraction capability, thereby improving the model's detection accuracy.

[0039] (4) The present invention uses Inner-CIoU to replace CIOU, controls the size of the auxiliary bounding box by the scaling factor, better balances the losses of different target scales, accelerates the low IOU target bounding box regression process without adding new loss terms, and improves the convergence speed and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Figure 1 This is a flow chart of the drone aerial photography target detection method of the present invention;

[0041] Figure 2This is the improved YOLOv8 network structure diagram in the present invention;

[0042] Figure 3 This is a network structure diagram of the context guidance module of the present invention;

[0043] Figure 4 This is the network structure diagram of the multi-scale attention mechanism module of the present invention;

[0044] Figure 5 This is the improved MFFPN feature pyramid network structure diagram in the present invention;

[0045] Figure 6 This is the network structure diagram of the MP module of the present invention; DETAILED DESCRIPTION

[0046] For a better understanding of the present invention, the present invention is further described below with reference to the accompanying drawings in the examples of the present invention, but is not intended to limit the present invention. Various modifications and improvements made to the technical solution of the present invention by ordinary persons in the art without departing from the design concept of the present invention should fall within the scope of protection of the present invention.

[0047] like Figure 1-6 As shown, a lightweight UAV image detection method integrating context and multi-scale features is provided, wherein the method comprises the following steps:

[0048] Step 1: Data acquisition and preprocessing of the data set. The specific operations are as follows:

[0049] In this example, the dataset selected is VisDrone-DET2019, which contains 6471 training set images and 549 validation set images, covering 10 categories such as pedestrians, bicycles, cars, and buses. The VisDrone-DET2019 dataset is divided into training and validation sets. Mosaic data augmentation is used to splice the input images by randomly scaling, cropping, and arranging them to increase data diversity.

[0050] YOLOv8 uses adaptive scaling to ensure that the maximum width and height of the image are 640. At the same time, it uses padding to fill pixel values to ensure that the width and height are divisible by 32, maximizing the use of the receptive field. After scaling, the image is sent to the detection network.

[0051] Step 2: Build a lightweight YOLOv8 model based on context guidance and multi-scale feature fusion, such as Figure 2 As shown in the figure, the YOLOv8 network model is mainly divided into the input end, the backbone network Backbone, the neck network Neck, and the output end Detect.

[0052] Step 2.1: Improve feature extraction by replacing the C2f module in the YOLOv8 backbone feature extraction network with a CE module, which consists of a context-guided (CG) module and a multi-scale attention mechanism (EMA) module. The improved YOLOv8 backbone network consists of P1 (first convolutional module, second convolutional module), the first CE module, the third convolutional module, the second CE module, the fourth convolutional module, the third CE module, and the SPPF spatial pyramid pooling structure.

[0053] Context-guided modules such as Figure 3 As shown in Figure 1, in the first step, the local information of the target location and the surrounding context are learned to generate their joint features. In the second step, the weight vector is obtained by using the global context information to perform channel-level weighting on the joint features extracted in the first step. In the first step of the CG module, a 1×1 convolution is first used to process the input, and then two parallel convolutions are used to obtain multi-scale information, where f loc The () extractor is responsible for extracting local features and is implemented using a 3×3 standard convolution to learn local features from 8 adjacent feature vectors; and f sur The () extractor is used to extract the surrounding context features and uses a 3×3 dilated convolution for processing. joi () is the joint feature extractor, which is responsible for integrating the two features to extract the joint feature. Its definition is shown in formula (1):

[0054]

[0055] Among them, PReLU represents parameterized linear rectifier unit and BN represents batch normalization. and Represent local features and surrounding context features respectively, It represents the combined features after integration.

[0056] Secondly, in the second step of the context-guided module, f glo The extractor is used to extract global context features. It extracts features through a global pooling layer and two fully connected layers to obtain a weight vector. The weight vector is used to guide the fusion of joint features. The obtained weights are multiplied element-wise with the input to fine-tune the joint features channel by channel, emphasizing useful elements and compressing useless elements. Its definition is shown in Equations (2) to (3).

[0057]

[0058] in, represents the global context feature, Represents the output features. FC represents a fully connected layer. ⊙ represents element-wise multiplication.

[0059] Multi-scale attention mechanism module such as Figure 4 As shown in the figure, a parallel substructure consisting of two 1×1 branches and one 3×3 branch is employed. A cross-spatial information processing learning module is also introduced. In the 1×1 branch, one-dimensional global average pooling is performed on the input feature map in the x and y directions to encode channel information. The encoded features are then concatenated in the height direction and integrated through a shared 1×1 convolution. Sigmoid activation and adaptive reweighting are then performed to obtain the final output. The 3×3 branch uses a 3×3 convolution kernel to capture multi-scale feature outputs. The cross-spatial learning module performs two-dimensional global average pooling and softmax processing on the outputs of the 1×1 and 3×3 branches. The dot product generates two spatial attention maps, which are then sigmoid activated and adaptively reweighted to provide global context to the model, enabling EMA to achieve better pixel-level attention on deep feature maps.

[0060] The SPPF module is an improved spatial pyramid pooling module. Compared with the conventional pooling module, this module can achieve adaptive size pooling with less computational complexity. By obtaining features at different levels (number of pooling times) and then fusing local features with overall features, it helps ensure that the model has high detection efficiency and accuracy.

[0061] Step 2.2: Add a small object detection head P2 to the prediction end of the YOLOv8 algorithm and delete the P5 layer in the main model to improve the detection FPS. P2 is a detection head for small objects added based on the original three detection heads of YOLOv8. It outputs a 160*160*255 feature map. The other two detection heads are P3 for small object detection, which outputs an 80*80*255 feature map, and P4 for medium object detection, which outputs a 40*40*255 feature map.

[0062] Step 2.3: Improve feature fusion, such as Figure 5 As shown, in the neck network, the P1 layer is downsampled once and fused with the P2 layer, allowing the small object detection layer P2 to capture more underlying details. Then, based on the characteristics of the BiFPN model, the backbone feature maps P2 and P3 are directly fused with their corresponding final output maps. This preserves the details of the backbone feature maps while avoiding the detail loss caused by multiple upsampling and downsampling. Two new feature fusion routes are also designed, starting with direct downsampling from the backbone P2 and P3 layers, which then participate in the fusion of the final output feature maps of P3 and P4, respectively. This preserves more details and features in the underlying feature maps.

[0063] The improved YOLOv8 neck network is mainly used for feature fusion, which includes the C2f module, the MP downsampling module, and the Concat module;

[0064] The C2f module improves the model's feature extraction capabilities and information transfer efficiency without significantly increasing computational effort, thereby enhancing the performance of tasks like object detection and segmentation. The input feature map is first channel-adjusted using a one-dimensional convolution, and then split into two streams: one portion is forwarded directly, while the other is branched through a residual block with skip connections. These two streams are then concatenated and fused using a one-dimensional convolution to adjust the output. This allows for efficient information transmission, reduced computational effort, enhanced feature representation, and improved detection and segmentation performance.

[0065] The MP downsampling module is used to reduce the size of the feature map while keeping the number of channels unchanged, so that feature maps of different scales but with the same number of channels can be fused. The structure of the MP module is as follows: Figure 6 As shown in the figure, the first branch first passes through a maximum pooling layer, downsamples by taking the maximum value in each pooling window, and then changes the number of channels through a 1×1 convolution. The second branch first performs a 1×1 convolution to change the number of channels of the feature map, and then uses a 3×3 convolution to achieve further downsampling to capture more spatial context. Finally, the results of the two branches are merged to obtain a feature map with a spatial resolution twice as small. Among them, in order to fuse features of different resolutions, MFFPN introduces additional weight parameters and uses fast normalization fusion to keep the weights between 0 and 1, thereby improving the running speed of the model on the GPU. The fast normalization fusion formula is as follows:

[0066]

[0067] where w i represents the learning weight, I i is the size of the input feature, ∈ is a very small number to prevent numerical instability.

[0068] The function of the Concat module is to increase the number of channels of the feature map while ensuring that the size of the feature map remains unchanged, so as to fuse the semantic information of the deep feature map with the position and detail information of the shallow feature map;

[0069] Step 3: Replace the bounding box regression loss function of YOLOv8 from CIoU to Inner-IOU.

[0070] Inner-CIOU loss function, based on the original CIOU loss function, introduces the scale factor ratio to control the size of the auxiliary bounding box. According to the IOU and scale of the detection target, different sizes of auxiliary boxes are used to calculate the loss, thereby accelerating the convergence speed, generating regression results more efficiently, and improving the accuracy of the predicted box. Applying Inner-IoU to the existing CIoU-based bounding box regression loss function, L Inner-CIoU The definition is as follows:

[0071] L Inner-CIoU=L CIoU +IoU-IoU Inner #(5)

[0072]

[0073] union=(w gt *h gt )*(ratio) 2 +(w*h)*(ratio) 2 -inter#(7)

[0074]

[0075] Here, "union" and "inter" represent the intersection and union of the auxiliary predicted and ground-truth bounding boxes, respectively. For scenes with numerous small objects from a drone's perspective, larger auxiliary bounding boxes expand the effective range of regression, focusing more on the core area of the bounding box and providing a more refined assessment of the overlapping areas within the bounding box, thus providing greater benefits at lower IoU (intersection over union) settings.

[0076] Step 4: Set training parameters, train the model, obtain detection results, and perform evaluation, comparison, and testing. Set the input image size imgsz = 640, initial learning rate lr = 0.01, learning rate momentum momentum = 0.937, weight decay coefficient weight_decay = 0.0005, training iterations epoch = 300, batch size of training dataset samples batchsize = 16, and select Adam as the training optimizer.

[0077] This paper uses the official pre-trained weights YOLOv8s.pt for transfer learning and fine-tuning during model training, because the use of pre-trained weights can shorten the training cycle, speed up the network convergence, and improve the training effect.

[0078] The evaluation indicators are mainly: mean average precision (mAP), precision P (Precision), and recall R (Recall). Among them, mAP represents the comprehensive weighted average of the average precision (AP) of all categories of detection, P represents the ratio of the number of correctly predicted positive samples to the actual number of positive samples, and R represents the ratio of the number of correctly predicted positive samples to the total number of predicted samples. The specific formulas are as follows:

[0079]

[0080] Among them, AP irepresents the average precision of the i-th category, K represents K categories, TP represents true positive examples, that is, positive samples predicted by the model as positive, FP represents false positive examples, that is, negative samples predicted by the model as positive, and FN represents false negative examples, that is, positive samples predicted by the model as false.

[0081] In order to verify the effectiveness of the improved modules of the present invention on the model improvement, under the same parameter conditions, the present invention conducted the following eight sets of ablation experiments on the three innovative points. The ablation experiment results are shown in Table 1:

[0082]

[0083] Table 1 Ablation experiment

[0084] By replacing the C2f module with the CE module in the backbone network, the model's parameter count and computational overhead decreased by 17.4% and 20.0%, respectively, and the FPS increased by 6%, while mAP50 decreased slightly, by 2.8%. This indicates that replacing the C2f module with the CG module alone provides only modest improvements. Adding the EMA attention mechanism after each CG module improves the capture of key information in the feature map and reduces the interference of background noise on the feature extraction process, resulting in a 0.5% increase in mAP50, essentially on par with the baseline model. This demonstrates that replacing the C2f module with the CG module + EMA attention mechanism effectively controls model parameters and computational overhead while enhancing the model's ability to focus on key image regions. Subsequently, the introduction of the MFFPN feature pyramid network architecture effectively reduces the missed detection rate of small objects and improves mAP50 by 2.8%. Furthermore, by applying a convolutional layer to adjust the number of channels before feature fusion, the model's parameter count and computational overhead are significantly reduced, alleviating the computational and memory burden of feature fusion. This improved module significantly improves performance. Then, applying the Inner-CIoU loss function increased mAP50 by 0.7% without increasing the model's computational load, achieving a lossless improvement. This highlights the effectiveness of the Inner-CIoU loss function when using auxiliary boxes of varying sizes for different datasets. The improved model achieved a 2% improvement in average detection accuracy. The model's parameter count and computational overhead were significantly smaller than the baseline model, decreasing by 51.4% and 28.0%, respectively. The FPS improved slightly while maintaining a high frame rate, meeting the requirements of real-time drone object detection. This method maintains improved accuracy while being lightweight, achieving higher values for precision, recall, and mAP50, striking a balance between reducing computational resources and ensuring accuracy.

[0085] The above embodiments are intended only to illustrate the technical concepts and features of the present invention. Their purpose is to enable those skilled in the art to understand the contents of the present invention and implement them accordingly. They are not intended to limit the scope of protection of the present invention. Any equivalent changes or modifications made in accordance with the spirit of the present invention shall be covered by the present invention.

Claims

1. A lightweight drone image detection method that integrates context and multi-scale features, characterized by: The following steps are involved: S1: Data acquisition and preprocessing of datasets; S2: A lightweight YOLOv8 model based on contextual guidance and multi-scale feature fusion is constructed. A small object detection head P2 is added to the prediction end, and the P5 layer of the model backbone is deleted. In the feature fusion stage, the P1 layer is downsampled once in the neck network and fused with the P2 layer. The backbone feature maps P2 and P3 are then directly fused with their corresponding final output maps. At the same time, two new feature fusion routes are designed, starting from the backbone P2 and P3 layers, which are directly downsampled and then participate in the fusion of the final output feature maps of P3 and P4 respectively. S3: Use Inner-CIoU in post-processing; S4: Set training parameters, train the model, obtain test results, and evaluate and compare them.

2. The lightweight UAV image detection method integrating context and multi-scale features according to claim 1 is characterized in that: The specific process of S1 is: S1.1: The public dataset VisDrone2019 was divided into a training set and a validation set. Mosaic data augmentation was used to splice the input images by random scaling, cropping, and arranging them to increase data diversity. S1.2: Re-clustering is performed to calculate the adaptive detection box and generate 12 scale detection boxes suitable for the dataset used in this experiment; S1.3: Scale the input image to the standard size of 640*640 pixels and then feed it into the detection network.

3. The lightweight UAV image detection method integrating context and multi-scale features according to claim 2 is characterized in that: The specific steps of S2 are: S2.1: In the feature extraction stage, the C2f module in the Backbone feature extraction network of YOLOv8 is replaced with the CE module, where the CE module is composed of a context-guided module and a multi-scale attention mechanism module; the improved YOLOv8 backbone network includes the first convolution module, the second convolution module, the first CE module, the third convolution module, the second CE module, the fourth convolution module, the third CE module, and the SPPF spatial pyramid pooling structure connected in sequence.

4. The lightweight UAV image detection method integrating context and multi-scale features according to claim 3 is characterized in that: The backbone network described in step S2.1 is mainly responsible for feature extraction, which includes the context guidance module, the multi-scale attention mechanism module and the SPPF module. The context-guided module is a module consisting of 1 1D convolution layer + 1 3D convolution layer + 1 Concat layer + 1 batch normalization Bn layer + 1 PReLU activation function + 2 fully connected layers. A context-guided module is regarded as a standard convolution module in the YOLOv8 model. The multi-scale attention mechanism module readjusts the weight of each parallel branch by encoding global information to highlight the characteristics of small targets. The multi-scale attention mechanism module adopts a parallel substructure, including two 1×1 branches and one 3×3 branch.

5. The lightweight UAV image detection method integrating context and multi-scale features according to claim 3 is characterized in that: The P2 described in step S2 is a detection head for detecting extremely small targets added on the basis of the original YOLOv8 three detection heads, which corresponds to the output 160*160*255 feature map. The other two detection heads are respectively small target detection P3 corresponding to the output 80*80*255 feature map and medium target detection P4 corresponding to the output 40*40*255 feature map.

6. The lightweight UAV image detection method integrating context and multi-scale features according to claim 1 is characterized in that: The neck network described in step S2.3 is mainly used for feature fusion, which includes the C2f module, the MP downsampling module and the Concat module; The C2f module first adjusts the channel of the input feature map through 1D convolution and then splits it into two parts: one part is directly transmitted and the other part is branched through a residual block with a jump connection; the two parts of features are spliced and then fused and adjusted by 1D convolution. The MP downsampling module reduces the size of the feature map while keeping the number of channels of the feature map unchanged, so that feature maps of different scales but the same number of channels can be fused; The Concat module increases the number of channels of the feature map while ensuring that the size of the feature map remains unchanged, so as to fuse the semantic information of the deep feature map with the position and detail information of the shallow feature map.

7. The lightweight UAV image detection method integrating context and multi-scale features according to claim 1 is characterized in that: Specifically, S3 uses Inner-CIoU in post-processing, controls the size of the auxiliary bounding box by introducing a scale factor ratio, and uses auxiliary boxes of different sizes for calculating the loss according to the IOU and scale of the detection target.

8. The lightweight UAV image detection method integrating context and multi-scale features according to claim 1 is characterized in that: The training parameters in S4 are as follows: input image size imgsz = 640, initial learning rate lr = 0.01, learning rate momentum = 0.937, weight decay coefficient weight_decay = 0.0005, number of training iterations epoch = 300, number of batch training dataset samples batchsize = 16, SGD is selected as the training optimizer, and official pre-trained weights are used for transfer learning and fine-tuning.

9. The lightweight UAV image detection method integrating context and multi-scale features according to claim 1 is characterized in that: The evaluation indicators in S4 are mainly: mean average precision (mAP), precision P (Precision), and recall R (Recall), where mAP represents the comprehensive weighted average of the average precision (AP) of all categories of detection, P represents the ratio of the number of correctly predicted positive samples to the actual number of positive samples, and R represents the ratio of the number of correctly predicted positive samples to the total number of predicted samples. The specific formula is as follows: Among them, AP i represents the average precision of the i-th category, K represents K categories, TP represents true positive examples, that is, positive samples predicted by the model as positive, FP represents false positive examples, that is, negative samples predicted by the model as positive, and FN represents false negative examples, that is, positive samples predicted by the model as false.

Citation Information

Cited By

  • ICW-YOLO-based lightweight high-efficiency warehouse logistics environment target detection method

    CN121095548A

  • Lightweight YOLO network and method for solar panel damage detection

    CN121353189A

  • Lightweight heterogeneous cooperative target detection method for driving condition in foggy weather

    CN121884305A

  • A lightweight heterogeneous collaborative target detection method for fog driving conditions

    CN121884305B