Unmanned aerial vehicle target detection method and device based on lightweight YOLOv5s
By improving the Neck structure and detection layer of the YOLOv5s model, combining BiFPN and Slim-Neck, the drone object detection algorithm is optimized, and the problems of low detection accuracy and high computational complexity on the drone platform are solved, achieving lightweight and efficient inference target detection effect.
Patent Information
- Application Number
- CN202510568139.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-08-12
AI Technical Summary
The existing object detection algorithms have problems such as low detection accuracy, high computational complexity, low Neck structural feature fusion efficiency and unreasonable detection layer design on the drone platform, which is difficult to meet the real-time requirements of the platform with limited computing resources of the drone.
Using the lightweight YOLOv5s model, BiFPN and Slim-Neck are introduced by improving the Neck structure, small object detection layer P2 is added and large object detection layer P5 is removed. Combined with adaptive anchor box adjustment and non-maximum suppression, feature fusion and detection layer are optimized, calculation complexity is reduced and detection accuracy is improved.
While maintaining high detection accuracy, it significantly reduces the computational complexity and model parameters, improves the inference speed and detection performance of the drone platform, and is especially suitable for resource-constrained environments.
Smart Images

Figure CN120472346A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision and deep learning technology, and specifically relates to a drone target detection method and device based on lightweight YOLOv5s. Background Art
[0002] The widespread application of drone technology in scenarios such as environmental monitoring, disaster assessment, security surveillance, agricultural inspections, and traffic management has led to higher demands for intelligent aerial object detection capabilities. However, existing object detection algorithms face numerous challenges when applied to UAV platforms. First, due to the high proportion of small objects in UAV footage, existing algorithms suffer from information loss during feature extraction and multi-scale fusion, leading to missed or false detection of small objects and low detection accuracy. Second, traditional detection models often suffer from large parameter counts and high computational complexity, making them difficult to meet the real-time requirements of resource-constrained platforms such as UAVs. Furthermore, the feature fusion efficiency of existing models' Neck (neck feature fusion network) architecture is low, resulting in insufficient multi-scale object detection capabilities and poor performance in complex backgrounds or scenes with significant scale differences. Furthermore, the detection layer design is not optimized for the characteristics of small objects, and the feature allocation mechanism is irrational, further limiting improvements in detection accuracy. These challenges collectively hinder the application of existing object detection technologies on UAV platforms, necessitating the urgent need for new solutions that balance structural optimization and lightweight design.
[0003] The YOLO (One-shot Object Detection) family of object detection algorithms has been widely used in real-time object detection tasks due to its end-to-end detection capabilities and high operational efficiency. However, the application of traditional object detection algorithms on drone platforms is limited because drone images typically contain a large number of small objects and drone computing resources are limited. Currently, YOLOv5s (a smaller version of the One-shot Object Detection Network) still faces challenges in detecting small objects and in environments with limited computing resources. These challenges include limited feature extraction capabilities, high computational redundancy, and insufficient detection accuracy. Therefore, optimizing the YOLOv5s model to improve detection accuracy while reducing computational complexity and the number of model parameters remains a pressing issue in the field of drone object detection. Summary of the Invention
[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0005] A drone target detection method based on lightweight YOLOv5s, including:
[0006] Step 1: Dataset construction: obtain an image dataset, annotate the image dataset, and generate an annotation file containing category labels and bounding box locations.
[0007] Step 2: Data preprocessing and feature extraction. Data preprocessing includes normalizing the image size and performing image processing using data augmentation and noise suppression. Feature extraction uses the backbone network in the improved YOLOv5s network as the base model to perform multi-scale feature extraction on the input image.
[0008] Step 3: Feature fusion and detection layer optimization; including: Step 3.1: Improve the Neck structure in terms of feature fusion; Step 3.2: Add a small target detection layer P2 and remove the large target detection layer P5 in terms of detection layer optimization;
[0009] Step 4: Target detection and optimization: Use the improved YOLOv5s network for target detection and output multi-scale detection frames; adaptively adjust the size of the anchor frame and use non-maximum suppression to remove redundant frames;
[0010] Step 5: Model performance evaluation: The overall performance of the model is evaluated through model performance evaluation.
[0011] A drone target detection device based on lightweight YOLOv5s, including the following modules:
[0012] Dataset construction module: obtain image dataset, annotate the image dataset, and generate annotation files containing category labels and bounding box locations;
[0013] Data preprocessing and feature extraction module; data preprocessing includes image size normalization, image processing using data enhancement techniques and noise suppression; feature extraction uses the backbone network in the improved YOLOv5s network as the basic model to perform multi-scale feature extraction on the input image;
[0014] Feature fusion and detection layer optimization module; including: Step 3.1, in terms of feature fusion, improve the Neck structure; Step 3.2, in terms of detection layer optimization, add small object detection layer P2 and remove large object detection layer P5;
[0015] Target detection and optimization module: uses an improved YOLOv5s network for target detection and outputs multi-scale detection frames; adaptively adjusts the size of anchor frames and uses non-maximum suppression to remove redundant frames;
[0016] Model performance evaluation module: evaluates the overall performance of the model through model performance evaluation.
[0017] An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the UAV target detection method based on lightweight YOLOv5s are implemented.
[0018] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the UAV target detection method based on lightweight YOLOv5s.
[0019] The present invention has the following beneficial effects: Based on the YOLOv5s model, the present invention proposes an efficient target detection method suitable for computing resource-constrained platforms (such as drones), and comprehensively introduces a number of structural optimizations and module innovations to improve detection accuracy and reasoning efficiency. First, the BiFPN (bidirectional feature pyramid network) is used to replace the original PANet (path aggregation network) structure, which enhances the information interaction between multi-scale features and improves the detection robustness of the model in complex scenarios, especially for small targets. Secondly, the lightweight Slim-Neck (lightweight feature fusion network) is introduced in the Neck (feature fusion network) stage, which significantly reduces the computational complexity and the number of model parameters while maintaining strong feature expression capabilities, thereby improving the inference speed of the model on edge devices. Slim-Neck is a lightweight feature fusion network structure that aims to improve the operating efficiency of target detection models in resource-constrained environments such as edge devices. By introducing GSConv (lightweight convolution), VoV-GSCSP (efficient cross-stage fusion module), and carefully selecting activation functions and bounding box regression loss functions, combined with lightweight training techniques that do not increase computational effort, this architecture significantly reduces computational complexity and parameter count while maintaining detection accuracy, thereby improving overall inference speed and deployment performance. Furthermore, the present invention designs an innovative multi-scale feature fusion module, MS-VoV-GSCSP (multi-scale efficient cross-stage fusion module), to further enhance detection performance for objects of varying scales, particularly improving small object recognition accuracy. In terms of detection layer design, the P2 layer is added to enhance small object perception and the P5 layer, which has limited contribution to large objects, is removed. This optimizes the feature allocation strategy, improves detection accuracy, and reduces redundant computational overhead. In summary, through multiple key improvements, this invention achieves lightweight and efficient inference while maintaining high detection accuracy. It is particularly suitable for real-time object detection tasks on resource-constrained platforms such as drones, and has significant application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 This is a flowchart of the UAV target detection method based on lightweight YOLOv5s of the present invention;
[0021] Figure 2 The network structure of the improved YOLOv5s algorithm of the present invention;
[0022] Figure 3This is a schematic diagram of the structure of GSConv lightweight convolution;
[0023] Figure 4 It is the structural diagram of GS-Bottleneck;
[0024] Figure 5 It is a structural diagram of the VoV-GSCSP module;
[0025] Figure 6 Figure 2 is a structural diagram of the MS-VoV-GSCSP module. DETAILED DESCRIPTION
[0026] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only intended to illustrate the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
[0027] like Figure 1 As shown in FIG, the UAV target detection method based on lightweight YOLOv5s proposed in the present invention includes the following steps:
[0028] Step 1: Dataset construction.
[0029] Acquire an image dataset from drone aerial photography, covering a variety of scenes and object categories. Annotate the captured image data, generating annotation files containing category labels and bounding box locations, such as those in XML (Extensible Markup Language, which organizes data using a tag structure) or JSON (JavaScript Object Notation, which organizes data as key-value pairs). Partition the annotated dataset into training, validation, and test sets proportionally for model training and performance evaluation.
[0030] The drone aerial imagery dataset uses publicly available datasets: Visdrone-2019 and UAVDT. The Visdrone-2019 dataset (drone image object detection dataset) includes 6,471 training images, 548 validation images, and 1,610 test images, and provides over 2.6 million manually annotated object bounding boxes covering categories such as pedestrians, vehicles, and bicycles. The UAVDT dataset (UAV Traffic Detection and Tracking dataset) contains 100 video sequences (approximately 80,000 frames) and focuses on object detection and tracking tasks in urban environments.
[0031] Step 2: Data preprocessing and feature extraction.
[0032] Data preprocessing includes normalizing the image size and adjusting it to a fixed size (640×640); using data enhancement techniques (random flipping, rotation, and brightness adjustment) to improve data diversity; and performing noise suppression to improve image quality.
[0033] For feature extraction, this paper uses the backbone network from an improved YOLOv5s network as the foundational model to perform multi-scale feature extraction on the input image. This backbone network incorporates a cross-stage partial connection structure (CSP), which effectively enhances feature representation and reduces redundant computation. This facilitates the extraction of richer and more efficient image semantic information, providing foundational support for subsequent feature fusion and object detection.
[0034] For example, the input image is scaled to a fixed size (640×640) and padded, while the pixel values are normalized to the range of 0 to 1. Subsequently, the image is converted to a floating-point tensor in CHW (Channel-Height-Width) format and normalized to meet the model input requirements.
[0035] The network structure of the improved YOLOv5s algorithm of the present invention is as follows Figure 2 shown.
[0036] The backbone network in step 2 is based on the CSDarknet53 (Cross-Stage Partially Connected Darknet53) network, comprising Convolutional (Convolutional) modules, Cross-Stage Partially Connected (CSP) structures, and Fast Spatial Pyramid Pooling (SPPF) modules. The Conv module downsamples the input image, while the CSP structure segments and processes the feature maps before fusing them. Darknet53 is a deep convolutional neural network architecture used for object detection tasks and serves as the backbone network used in this paper. This network consists of 53 convolutional layers to enhance the training stability and feature representation capabilities of the deep network. The SPPF module fuses features through multi-scale pooling.
[0037] Step 3: Feature fusion and detection layer optimization.
[0038] In step 3.1, in terms of feature fusion, multiple improvements are made to the Neck structure to improve model performance.
[0039] In step 3.1.1, a bidirectional feature pyramid network (BiFPN) is introduced to enhance the fusion capability of multi-scale features through bidirectional cross-scale connections, thereby better capturing target information at different scales and improving the accuracy and robustness of target detection.
[0040] In step 3.1.2, a Slim-Neck architecture is used, replacing standard convolutions with GSConv lightweight convolutions and replacing the C3 module with the VoV-GSCSP module. This invention utilizes the Slim-Neck architecture to significantly reduce computational complexity through lightweight design while maintaining high feature representation capabilities. The Slim-Neck architecture includes GSConv lightweight convolutions and VoV-GSCSP modules. Specifically, the GSConv lightweight convolution replaces the standard convolution, reducing model parameters and computational complexity while maintaining effective feature extraction. The VoV-GSCSP module replaces the C3 module (the convolution-residual-fusion architecture commonly used in YOLOv5). The VoV-GSCSP module is an improved cross-stage partially connected architecture that integrates channel reuse and lightweight convolutions, facilitating the efficient extraction and fusion of deep and shallow features.
[0041] Step 3.1.3, in the branch outputting to the small object detection layer, the MS-VoV-GSCSP module is used to replace the original C3 module. Although the C3 module has certain feature extraction capabilities, it has limitations in multi-scale modeling and lightweighting. The MS-VoV-GSCSP module is an improved module based on VoV-GSCSP that introduces a multi-scale receptive field design. Its structure is as follows Figure 6 This module connects convolution branches of different scales in parallel, effectively improving the modeling capability of target features of different sizes while maintaining lightweight computing characteristics.
[0042] In step 3.2, regarding detection layer optimization, a small object detection layer P2 is added, while the large object detection layer P5 is removed. This invention adds the small object detection layer P2, specifically for detecting small objects in images, to enhance small object detection performance. This significantly improves small object detection capabilities and adapts to the diverse object sizes found in drone scenarios. P2 refers to the output branch constructed based on high-resolution shallow feature maps (feature maps obtained by downsampling the input image by a factor of 4). This branch has higher spatial resolution and is suitable for capturing small objects with sharp edges. The P5 detection layer is the large object detection branch, based on the output of deep, low-resolution feature maps (typically downsampled by a factor of 32). Due to the relatively small number of large objects in drone scenarios, the P5 layer has limited impact on overall detection performance. Furthermore, its feature maps have low resolution and high semantic abstraction, resulting in information loss. Removing this layer not only optimizes feature resource allocation and reduces the model's computational burden, but also improves inference efficiency. These improvements collectively improve the model's performance in multi-scale object detection, particularly in the complex scenes found in drone aerial imagery.
[0043] The following is a detailed description of the specific structures of the GSConv lightweight convolution, VoV-GSCSP module and MS-VoV-GSCSP module with reference to the accompanying drawings. Figure 3 As shown in the figure, the number of channels of the input feature map of the GSConv lightweight convolution is C1. The input feature map is divided into two groups through grouped convolution Conv (the number of channels in each group is C2 / 2). After the convolution operation, the result is subjected to depthwise separable convolution (DWC) to reduce the amount of calculation. Then, the two groups of convolution results are spliced (contact) along the channel dimension, and the information interaction between features is enhanced through channel shuffling (Shuffle), and finally the output is a feature map with the number of channels C2.
[0044] like Figure 4 As shown in the figure, GS Bottleneck (lightweight bottleneck architecture) is an improved module built on GSConv, designed to enhance feature representation while maintaining model lightweightness. GS Bottleneck utilizes serialized lightweight convolutions, which, compared to traditional bottleneck architectures, reduces computational overhead and requires fewer parameters, making it suitable for feature extraction tasks on resource-constrained platforms. This architecture is incorporated into the VoV-GSCSP module and further integrated into Slim-Neck. The introduction of GSBottleneck helps improve semantic extraction capabilities during feature fusion and enhances information flow between multi-scale features, ultimately improving detection accuracy. The input feature map of GS Bottleneck has C1 channels. The input feature map undergoes convolution operations with GSConv and Conv, respectively. The GSConv output has C2 / 2 channels. GSConv is then used again to adjust the channel count to C2, outputting a feature map with C2 channels. This feature map is then added to the feature map output by Conv, resulting in a final feature map with C2 channels.
[0045] like Figure 5 As shown, the number of channels of the input feature map of the VoV-GSCSP module is C1, first through 1 1 convolution Conv adjusts the number of channels, and then uses GS Bottleneck to further extract features and 1 The result of 1 convolution Conv is concatenated with the output of GSBottleneck along the channel dimension, and finally passed through 1 1 Convolution Conv adjusts the number of channels of the concatenated feature map to C2, and outputs a feature map with C2 channels.
[0046] like Figure 6 As shown, the number of input feature map channels of the MS-VoV-GSCSP module is C1, which is divided into three branches. Compared with VoV-GSCSP, the leftmost branch is increased by 3. 3 convolution Conv,3 The convolution Conv of 3 is connected to the GS Bottleneck to further extract features. From left to right, the proportion of the number of channels occupied by the three branches is 3 / 8, 4 / 8, and 1 / 8 respectively. 3. Convolutional branch, used to enhance the local receptive field, thereby improving the model's ability to extract detailed features of small targets.
[0047] The three branches of the MS-VoV-GSCSP module transform the input feature maps in different ways, improving feature utilization and expressiveness while maintaining the total number of channels. The fused feature maps undergo concatenation (Concat) and subsequent convolution (Conv) processing before being passed as output features to subsequent detection layers. This module's design balances feature extraction efficiency with a lightweight structure, making it particularly suitable for multi-scale object detection tasks.
[0048] Step 4: Target detection and optimization.
[0049] An improved YOLOv5s network is used for object detection, outputting multi-scale detection boxes. The anchor box sizes are adaptively adjusted, and non-maximum suppression (NMS) is used to remove redundant boxes.
[0050] In step 4, the sizes of the annotation boxes in the statistical dataset are used to adaptively adjust the size of the anchor boxes to better match the size and shape of the actual target, thereby improving the match between the detection boxes and the real target. The NMS method refers to the fact that during object detection, multiple overlapping detection boxes may be generated. The NMS method improves the accuracy of detection results by retaining the boxes with the highest confidence and removing redundant boxes.
[0051] Step 5: Model performance evaluation.
[0052] The detection box positioning accuracy is optimized by generalized intersection over union (GIoU), and the detection performance is evaluated using mean average precision (mAP) and PR curves. The real-time performance and operational efficiency of the model are measured by combining inference speed (FPS) and computational complexity (GFLOPs).
[0053] We use the Generalized Intersection-over-Union (GIoU) as the bounding box regression loss function to optimize the accuracy of bounding box positioning. GIoU is an improved Intersection-over-Union metric that effectively improves the matching accuracy between the target bounding box and the detection bounding box by considering the distance between the bounding boxes.
[0054] Detection performance is evaluated by calculating mean average precision (mAP) and plotting the precision-recall curve (PR). mAP combines precision and recall at different thresholds, while the PR curve shows the relationship between the model's precision and recall at different decision thresholds.
[0055] Statistical inference speed FPS (Frames Per Second) and computational complexity GFLOPs (GigaFloating-Point Operations per Second) were used to evaluate the real-time performance of the improved YOLOv5s model (the model's real-time detection capabilities on a drone platform).
[0056] The average precision (AP) is the proportion of correctly predicted targets among all detected targets. The calculation process is as follows:
[0057] ;
[0058] in, is the precision-recall curve. (Precision) and recall The calculation formula of (Recall) is as follows:
[0059] ;
[0060] ;
[0061] in, are true positives, are false positives, are false negatives.
[0062] Mean Average Precision (mAP) is a commonly used evaluation metric in object detection tasks, used to measure the detection performance of an object detection model across all detected categories. mAP is calculated by taking the mean average precision (AP) of each category and evaluating the overall model performance. The calculation process is shown below.
[0063] .
[0064] in, For the The average precision of the categories, is the category number, is the total number of all categories.
[0065] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk drives, CD-ROMs, optical storage devices, etc.) containing computer-usable program code. The solutions in the embodiments of the present invention may be implemented using various computer languages, for example, the object-oriented programming language Python.
[0066] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0067] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0068] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.
[0069] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0070] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.
Claims
1. A UAV target detection method based on lightweight YOLOv5s, characterized in that: include: Step 1, dataset construction; Obtain an image dataset, annotate the image dataset, and generate an annotation file containing category labels and bounding box locations; Step 2: data preprocessing and feature extraction; Data preprocessing includes image size normalization, image processing using data enhancement techniques and noise suppression; Feature extraction uses the backbone network in the improved YOLOv5s network as the basic model to perform multi-scale feature extraction on the input image; Step 3: Feature fusion and detection layer optimization; including: Step 3.1: Improve the Neck structure in terms of feature fusion; Step 3.2: Add a small target detection layer P2 and remove the large target detection layer P5 in terms of detection layer optimization; Step 4: Target detection and optimization: Use the improved YOLOv5s network for target detection and output multi-scale detection boxes; Adaptively adjust the size of the anchor box and use non-maximum suppression to remove redundant boxes; Step 5: Model performance evaluation: The overall performance of the model is evaluated through model performance evaluation.
2. The UAV target detection method based on lightweight YOLOv5s according to claim 1 is characterized in that, The image dataset is obtained through drone aerial photography. The image dataset uses public datasets: Visdrone-2019 and UAVDT dataset.
3. The UAV target detection method based on lightweight YOLOv5s according to claim 1 is characterized in that, Step 3.1 includes: In step 3.1.1, a bidirectional feature pyramid network is introduced to enhance the fusion capability of multi-scale features through bidirectional cross-scale connections; In step 3.1.2, the Slim-Neck structure is used, the standard convolution is replaced by the GSConv lightweight convolution, and the C3 module is replaced by the VoV-GSCSP module; In step 3.1.3, in the branch outputting to the small object detection layer, the MS-VoV-GSCSP module is used to replace the original C3 module.
4. The UAV target detection method based on lightweight YOLOv5s according to claim 3 is characterized in that: In step 3.2, the number of channels of the input feature map of the GSConv lightweight convolution is C1. The input feature map is divided into two groups through group convolution Conv, and the number of channels in each group is C2 / 2. Then the result is subjected to depthwise separable convolution to reduce the amount of computation. The two groups of convolution results are then concatenated along the channel dimension, and the information interaction between features is enhanced by channel shuffling. Finally, the feature map with the number of channels of C2 is output.
5. The UAV target detection method based on lightweight YOLOv5s according to claim 3 is characterized in that, In step 3.2, the number of channels of the input feature map of the VoV-GSCSP module is C1, first through Convolution Conv adjusts the number of channels, and then uses GS Bottleneck to further extract features and The result of convolution Conv is concatenated with the output of GS Bottleneck along the channel dimension, and finally passed Convolution Conv adjusts the number of channels of the spliced feature map to C2, and outputs a feature map with C2 channels; The number of channels of the input feature map of the GS Bottleneck is C1, and the input feature map is convolved through GSConv and Conv respectively; the number of channels of GSConv output is C2 / 2, and then GSConv is used again to adjust the number of channels to C2, and the feature map with the number of channels of C2 is output. This feature map is then added to the feature map output by Conv to obtain a feature map with the final output channel number of C2.
6. The UAV target detection method based on lightweight YOLOv5s according to claim 3 is characterized in that: The number of channels of the input feature map of the VoV-GSCSP module is C1. First, 1 convolution Conv adjusts the number of channels, and then uses GS Bottleneck to further extract features and 1 The result of 1 convolution Conv is concatenated with the output of GS Bottleneck along the channel dimension, and finally passed through 1 1 Convolution Conv adjusts the number of channels of the concatenated feature map to C2, and outputs a feature map with C2 channels.
7. The UAV target detection method based on lightweight YOLOv5s according to claim 6 is characterized in that: The number of input feature map channels of the MS-VoV-GSCSP module is C1, which is divided into three branches. On the basis of the VoV-GSCSP module, the leftmost branch is added with 3 3 convolution Conv,3 The convolution Conv of 3 is connected to the GS Bottleneck to further extract features; The three branches of the MS-VoV-GSCSP module from left to right occupy 3 / 8, 4 / 8, and 1 / 8 of the channels respectively.
8. The UAV target detection method based on lightweight YOLOv5s according to claim 1 is characterized in that, In step 5, the detection box positioning accuracy is optimized by generalizing the intersection-over-union ratio (IoU). The detection performance is evaluated using the mean average precision (AOP) and the PR curve. The real-time performance and operational efficiency of the model are measured by combining inference speed and computational complexity. The calculation process of the mean average precision is as follows: Average precision The ratio of correctly predicted targets among all detected targets is calculated as follows: ; in, is the precision-recall curve, precision and recall The calculation formula is as follows: ; ; in, For a real example, For a false positive example, is a false negative example; The mean average precision (AP) is calculated for each category and the average is taken to evaluate the overall performance of the model. The calculation process is as follows: ; in, For the The average precision of the categories, is the category number, The total number of all categories.
9. A drone target detection device based on lightweight YOLOv5s, characterized in that: Includes the following modules: Dataset construction module: obtain image dataset, annotate the image dataset, and generate annotation files containing category labels and bounding box locations; Data preprocessing and feature extraction module; Data preprocessing includes image size normalization, image processing using data enhancement techniques and noise suppression; Feature extraction uses the backbone network in the improved YOLOv5s network as the basic model to perform multi-scale feature extraction on the input image; Feature fusion and detection layer optimization module; including: Step 3.1, in terms of feature fusion, improve the Neck structure; Step 3.2, in terms of detection layer optimization, add small object detection layer P2 and remove large object detection layer P5; Target detection and optimization module: uses an improved YOLOv5s network for target detection and outputs multi-scale detection frames; adaptively adjusts the size of anchor frames and uses non-maximum suppression to remove redundant frames; Model performance evaluation module: evaluates the overall performance of the model through model performance evaluation.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the drone target detection method based on lightweight YOLOv5s are implemented as described in any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the drone target detection method based on lightweight YOLOv5s are implemented as described in any one of claims 1 to 8.