Unmanned aerial vehicle aerial photography small target detection method based on improved YOLOv8
By improving the YOLOv8 algorithm, combined with the SR-Conv module, small object detection layer, BiFPN network and NWD loss function, the problem of low detection accuracy of small object detection by drone aerial photography is solved, and more efficient object detection effect is achieved.
Patent Information
- Application Number
- CN202411118064.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-08-15
AI Technical Summary
The detection accuracy of small and medium-sized drone aerial images is not high, and there are problems with high false detection and missed detection rates, especially in complex backgrounds.
Improve the YOLOv8 algorithm, optimize the network structure and loss function by designing the SR-Conv module, adding a small object detection layer, and introducing BiFPN network and NWD loss function to improve the accuracy of small object detection.
It significantly improves the accuracy of aerial photography of drone small target detection, reduces the rate of false detection and missed detection, and is suitable for real-time detection tasks in complex backgrounds.
Smart Images

Figure CN119152390A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision target detection, and in particular relates to a method for detecting targets in drone aerial photography based on an improved YOLOv8 algorithm. Background Art
[0002] A drone is an automatic or semi-automatic aircraft controlled by a remote control or ground control system. It has the advantages of low cost, high maneuverability, portability, multiple viewing angles and small size. It can perform tasks such as terrain survey, power inspection, urban patrol and emergency rescue. However, due to the flight altitude restrictions of drones and the fact that aerial photography is usually carried out in large-scale scenes, there are many small target instances, complex shooting backgrounds, and unclear features in drone aerial images, which affects the target detection effect. Therefore, drone target detection technology has become a research hotspot for experts and scholars at home and abroad.
[0003] Object detection is to extract features from areas where objects may exist in the input image through detection algorithms, and use pre-trained classifiers to output detection results. Traditional object detection algorithms use sliding window strategies to select candidate areas on a given image, extract features from these areas, and finally use trained classifiers for classification. This method has the disadvantages of weak targetedness of the region selection strategy, high time complexity, and poor robustness. With the continuous development of deep learning, object detection algorithms based on deep learning have become mainstream. At present, object detection algorithms based on deep learning can be divided into two categories: single-stage and dual-stage. Single-stage object detection algorithms directly detect objects on the input image and output the detection box and category of the object. Therefore, they have a faster detection speed and are suitable for real-time application scenarios. Common single-stage object detection algorithms include SSD, YOLO series, etc. The dual-stage object detection algorithm first generates a series of candidate boxes based on the input image, and then extracts and classifies the candidate boxes. It has higher detection accuracy, but requires higher computing resources. Common dual-stage object detection algorithms are R-CNN series.
[0004] With the continuous improvement of the YOLO series of algorithms, its detection accuracy has reached or even exceeded the two-stage algorithm. The YOLO series of cutting-edge algorithms have high real-time performance and fast detection speed, which is suitable for real-time detection of small targets in drone aerial photography. However, the application of the YOLO series cutting-edge version YOLOv8 to the detection of small targets in drone aerial photography still has the problem of low detection accuracy. Summary of the invention
[0005] In order to overcome the problems existing in the above-mentioned prior art, the purpose of the present invention is to provide a method, system, device and medium for detecting small targets in drone aerial photography based on improved YOLOv8, which is used to improve the detection accuracy of small targets in drone aerial photography and ensure that the drone can successfully complete various tasks.
[0006] In order to achieve the above object, the technical solution adopted by the present invention is:
[0007] In the first aspect, a method for detecting small targets in drone aerial photography based on improved YOLOv8 is provided, comprising the following steps:
[0008] Step 1: Obtain a drone aerial image dataset;
[0009] Step 2: Convert the acquired drone aerial image dataset into a training set, a validation set, and a test set.
[0010] Step 3: Build an improved YOLOv8 UAV aerial photography small target detection network, which improves the backbone network, neck network and loss function of the YOLOv8 network;
[0011] Step 4: Using the improved YOLOv8 drone aerial photography small target detection network as the detection model, the detection model is trained and verified using the training set and the validation set to obtain the final detection model;
[0012] Step 5: Use the final detection model and the drone aerial images as input to test the improved YOLOv8 drone aerial small target detection model.
[0013] Preferably, in step 1, the drone aerial photography dataset is the VisDrone dataset, and the publicly available VisDrone2019-DET aerial photography dataset is downloaded from the official website.
[0014] Preferably, in step 2, the drone aerial photography dataset file is converted into a txt file of a YOLO sequence, and the VisDrone2019-DET aerial photography dataset is divided into a training set, a validation set, and a test set.
[0015] Preferably, the step 3 includes:
[0016] The YOLOv8 model was selected as the basis for improvement. The improvements of the YOLOv8 model were in four aspects: designing the SR-Conv module to improve the backbone network, adding a small target detection layer, introducing the bidirectional feature pyramid network (BiFPN) to improve the neck network, and introducing the normalized weighted distance loss (NWD) loss function to optimize the loss function.
[0017] Designing SR-Conv module to improve backbone network: The backbone network of the original YOLOv8 will cause a certain degree of fine-grained information loss during the convolution and pooling operations. In order to reduce the false detection and missed detection rate of small targets in drone images, the space-to-depth (SPD) layer and the receptive field attention convolution (RFAConv) are combined to design the SR-Conv module to replace the standard convolution modules (Conv) in the first, third, fifth and seventh layers of the original backbone network. First, the SPD layer maps the spatial dimension of the input feature map to the channel dimension while retaining the information in the channel to avoid information loss in traditional methods. After the SPD layer, RFAConv is used for further feature extraction. RFAConv introduces the receptive field attention mechanism (RFA) to solve the problem of convolution kernel parameter sharing, and fully considers the importance of each feature in the receptive field in the global context. It can adaptively adjust the network's attention to targets of different scales, thereby improving the detection performance of small and dense targets. The SR-Conv module combines the ability of the SPD layer to retain all information in the channel dimension and the ability of RFAConv to adaptively adjust the network's attention to targets of different scales, replacing the Conv module in the original backbone network to extract more fine-grained information of small target features.
[0018] Add a small target detection layer: The feature fusion of the original YOLOv8 network usually starts from the third layer of features, introducing three feature maps of different scales into the neck network for fusion and forming three prediction heads. In order to improve the ability of small target detection, add a small target detection layer, fuse the second layer of features into the feature fusion network, retain more shallow semantic information, and form the fourth prediction head for small targets;
[0019] Introducing BiFPN to improve the neck network: The original YOLOv8 neck layer borrows from PANet and adopts the FPN+PAN dual feature pyramid structure to fuse features of different scales. The input features in the PAN network are processed by the FPN network, which will cause the loss of the original features and lead to low feature fusion efficiency. The present invention adopts the BiFPN network to improve the feature fusion method of the neck network, better utilize the original feature information, and enhance the ability to extract small-scale target features;
[0020] Introducing NWD loss function to optimize loss function: The YOLOv8 algorithm uses the CIoU bounding box regression loss function, which is based on the traditional intersection-over-union (IoU) metric and has certain limitations. It is very sensitive to the position deviation of small target labels and has great differences in sensitivity to targets of different scales. In order to improve the network's detection performance for small targets, the NWD loss function is introduced and combined with the CIoU loss function to optimize the loss function. NWD has scale invariance and smoothness for position deviation in detecting small objects, and has the ability to measure the similarity between non-overlapping or mutually contained bounding boxes, which can capture more details and spatial information and effectively improve the performance of aerial target detection algorithms.
[0021] Preferably, in step 4, the improved YOLOv8 UAV aerial photography small target detection network is used as the target detection model, the training set of VisDrone DET is input into the improved YOLOv8 UAV aerial photography image target detection network for training, and the validation set data is used to monitor whether the model is overfitting until the loss curve converges, the model training is completed, and the final improved YOLOv8 UAV aerial photography image target detection model is obtained.
[0022] Preferably, in step 5, the trained model weight file is input into the test set of the VisDrone data set, and the model will frame and mark the detected target on the output image to obtain the actual recognition result of the drone aerial image target.
[0023] In a second aspect, the present invention provides a UAV aerial photography small target detection system based on an improved YOLOv8 algorithm, comprising:
[0024] Dataset processing module: configured to obtain a drone aerial image dataset, pre-process the drone aerial image dataset, and obtain a training set, a validation set, and a test set;
[0025] Network building module: configured to build a small target detection model for drone aerial photography based on the improved YOLOv8 algorithm;
[0026] Network training module: used to train the constructed UAV aerial photography small target detection model based on the improved YOLOv8 algorithm using the training set according to the set network training parameters, and output the training weight file after the training is completed. The training weight file is verified through the validation set, and the training weight file with the highest accuracy is selected as the optimal weight file to obtain the trained UAV aerial photography small target detection model based on the improved YOLOv8 algorithm;
[0027] Target detection module: used to input the test set and the obtained optimal weight file into the trained UAV aerial photography small target detection model based on the improved YOLOv8 algorithm to perform target detection and obtain the target detection results.
[0028] The present invention also provides an electronic device, comprising a memory and one or more processors, wherein the memory is used to store one or more programs; when the one or more programs are executed by the one or more processors, a method for detecting small targets in drone aerial photography based on improved YOLOv8 is implemented.
[0029] The present invention also provides a computer storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of a method for detecting small targets in drone aerial photography based on improved YOLOv8 are implemented.
[0030] Compared with the prior art, the present invention has the following beneficial effects:
[0031] (1) In the UAV aerial photography small target detection method based on improved YOLOv8 constructed by the present invention, the SPD layer and RFAConv are combined to design the SR-Conv module to replace the Conv module in the original backbone network. By converting the information of the spatial dimension into the depth dimension and adaptively adjusting the network's attention to targets of different scales, more fine-grained information of small target features can be extracted.
[0032] (2) The present invention introduces a small target detection layer and a BiFPN network into the YOLOv8 network to improve the neck network and enhance the feature extraction and feature fusion capabilities of small targets.
[0033] (3) The present invention introduces the NWD loss function into the YOLOv8 network and combines it with the CIoU loss function as the positioning regression loss function to enhance the sensitivity of the model to small targets.
[0034] In summary, the present invention first combines the SPD layer with RFAConv, designs the SR-Conv module, replaces the Conv module in the original backbone network, and extracts more fine-grained information of small target features by converting the information of the spatial dimension into the depth dimension and adaptively adjusting the network's attention to targets of different scales; secondly, introduces the small target detection layer and the BiFPN network to improve the neck network, and strengthens the feature extraction and feature fusion capabilities of small targets; finally, introduces the NWD loss function, combines it with the CIoU loss function as a positioning regression loss function, and enhances the model's sensitivity to tiny targets. This method can better suit the task of detecting small targets in drone aerial photography, improve the accuracy of detecting small targets in drone aerial photography, and has wide applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is the overall flow chart of the present invention.
[0036] Figure 2 The overall structure diagram of the improved YOLOv8 network designed for the embodiment of the present invention;
[0037] Figure 3 It is the SPD layer structure diagram;
[0038] Figure 4 This is the structure diagram of RFAConv;
[0039] Figure 5 A comparison chart of PANet and BiFPN. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0041] First, this example provides a method for detecting small targets in drone aerial photography based on improved YOLOv8. The specific implementation steps are as follows: Figure 1 As shown, including:
[0042] Step 1: Obtain a drone aerial image dataset;
[0043] Step 2: Convert the acquired drone aerial image dataset into a training set, a validation set, and a test set.
[0044] Step 3: Build an improved YOLOv8 UAV aerial photography small target detection network, which improves the backbone network, neck network and loss function of the YOLOv8 network;
[0045] Step 4: Using the improved YOLOv8 drone aerial photography small target detection network as the detection model, the monitoring model is trained and verified using the training set and the validation set to obtain the final detection model;
[0046] Step 5: Use the final detection model and the drone aerial images as input to test the improved YOLOv8 drone aerial small target detection network.
[0047] In this embodiment, the step 1 is specifically as follows:
[0048] The present invention uses the VisDrone2019 DET aerial photography dataset downloaded from the official website. The data is a self-labeled file. The dataset has a total of 10 categories, including pedestrians, people, bicycles, cars, vans, trucks, tricycles, awning tricycles, buses, and cars. The training image size is unified to 640 × 640. At the same time, the images are detected and processed, including deleting images with blurred small targets and unclear feature points.
[0049] In this embodiment, the step 2 is specifically as follows:
[0050] First, the annotated VisDrone2019 DET dataset file is converted into a YOLO sequence txt file through a python script, and the VisDrone2019DET aerial photography dataset is randomly divided into training set, validation set and test set to prepare for subsequent training and testing.
[0051] In this embodiment, step 3 is specifically as follows:
[0052] The YOLOv8 model is selected as the basis for improvement. The improvements of the YOLOv8 model are in four aspects: designing the SR-Conv module to improve the backbone network, adding a small target detection layer, introducing the BiFPN network to improve the neck network, and introducing the NWD loss function to optimize the loss function. The improved YOLOv8 model structure diagram is shown in Figure 1. Figure 2 .
[0053] Furthermore, the SR-Conv module is designed to improve the backbone network:
[0054] The original YOLOv8 backbone network will cause a certain degree of fine-grained information loss during the convolution and pooling operations. In order to reduce the false detection and missed detection rate of small targets in drone images, the space-to-depth (SPD) layer and the receptive field attention convolution (RFAConv) are combined to design the SR-Conv module to replace the standard convolution modules (Conv) in the first, third, fifth, and seventh layers of the original backbone network. The SR-Conv module combines the ability of the SPD layer to retain all information in the channel dimension and the ability of RFAConv to adaptively adjust the network's attention to targets of different scales, replacing the Conv module in the original backbone network to extract more fine-grained information of small target features.
[0055] First, the SPD layer maps the spatial dimension of the input feature map to the channel dimension while retaining the information within the channel, avoiding information loss in traditional methods. Assume that there is a general input image X of size S×S×C1, and each step is to cut it into a series of sub-feature sequences as shown in formulas (1) to (3):
[0056]
[0057] In general, given any (original) feature map X, a submap consists of all items where items and items are separable by scale. Therefore, each submap downsamples X by a factor scale. Figure 3 (a)(b) shows an example when scale = 2. This example generates 4 sub-graphs, each with the shape Downsample X by a factor of 2. Then, concatenate these sub-feature maps along the channel dimension to obtain Figure 3 (c) The feature map shown. The SPD layer transforms the feature map X(S,S,C1) into Feature map.
[0058] After the SPD layer, RFAConv is used for further feature extraction. RFAConv introduces the receptive field attention mechanism (RFA) to solve the problem of convolution kernel parameter sharing, and fully considers the importance of each feature in the receptive field in the global context. It can adaptively adjust the network's attention to targets of different scales, thereby improving the detection performance of small and dense targets. The structure of RFAConv is shown in the figure. Figure 4 As shown. Assuming there is a general input image of size C×H×W, the interactive receptive field feature information method is used to improve network performance. At the same time, in order to minimize the amount of calculation and the number of parameters, the average pooling operation is used to aggregate the global information of the receptive field features of the first branch, and the information is transmitted through a 1x1 group convolution. Finally, the Softmax activation function is used to obtain an attention map of size 9C×H×W. The other branch is normalized using a 3×3 group convolution, and a non-linear condition is provided for it through the ReLU activation function. Finally, a receptive field spatial feature of size 9C×H×W is obtained. The feature maps of the two branches are multiplied to achieve the purpose of reshaping the weights, aggregate the associated information from different processing channels, and obtain a non-overlapping receptive field spatial feature map of size C×3H×3W after shape adjustment. Finally, the length and width of the feature map are shaped by convolution to keep it the same size as the input. The specific calculation process is shown in formula (4):
[0059]
[0060] Where s represents the convolution kernel size, g (1×1) represents a group convolution of size 1×1, Norm is normalization, AvgPool is the average pooling operation, ReLU and Softmax are activation functions, X represents the input feature map, and RFA is the receptive field spatial feature F after conversion. rfa and attention map Arfa Multiply them together to get .
[0061] Furthermore, add a small target detection layer:
[0062] The original YOLOv8 network introduces three feature maps of different scales into the neck network for fusion and forms three detection heads. When the input image resolution is 640×640, the original YOLOv8 algorithm downsamples the input image by 8 times, 16 times and 32 times respectively, and generates prediction feature maps of 80×80, 40×40, and 20×20 for detecting targets larger than 8×8, 16×16, and 32×32. The original YOLOv8 performs downsampling multiple times, and the target information in the feature map becomes very scarce. It is difficult for deeper feature maps to learn the feature information of small targets. While keeping the scale of other feature maps unchanged, the present invention introduces a new 160×160 small target detection layer on the basis of the original three detection layers of the network to form four detection heads for better obtaining the category and location information of small targets.
[0063] Furthermore, the BiFPN structure is introduced to improve the neck network
[0064] The original YOLOv8 neck layer borrows from PANet and adopts the FPN+PAN dual feature pyramid structure to fuse features of different scales. The input features in the PAN network are processed by the FPN network, which will cause the loss of the original features and lead to low feature fusion efficiency. The present invention adopts the BiFPN network to improve the feature fusion method of the neck network, better utilize the original feature information, and enhance the ability to extract small-scale target features.
[0065] Compared with PANet, BiFPN network adopts a combination of downsampling path and upsampling path, and retains more context information through feature information transmission in two directions, enhances the efficiency of network feature information transmission, and improves the feature expression ability of small-scale targets. BiFPN network deletes edge nodes with weak feature fusion ability, realizes cross-scale interaction of features at different levels, and improves the feature extraction ability of small-scale targets. The comparison between PANet and BiFPN is shown in the figure below. Figure 5 shown.
[0066] Since different features have different resolutions, their output contributions are also different. The BiFPN network uses weighted feature fusion to add an additional weight to each feature, so that the network continuously adjusts the weight and divides the weight by the sum of all weights to normalize it to [0, 1], which improves the calculation speed and can better control the contribution of features of different scales. The weighted feature fusion calculation method is shown in formula (5):
[0067]
[0068] Among them, ω i and ω j I represents the weights of the feature maps of the i-th layer and the j-th layer, respectively, and determines the contribution of the feature maps of the i-th layer and the j-th layer in the fusion process. i represents input features, ε=10 -4 , used to avoid digital instability.
[0069] Furthermore, the NWD loss function optimizes the loss function
[0070] The intersection over union (IoU) is a commonly used metric for evaluating the performance of target detection algorithms. It is used to measure the degree of overlap between the detection results and the true annotations. The CIoU bounding box regression loss function used by the YOLOv8 algorithm is based on the traditional intersection over union (IoU) metric, which has certain limitations. It is very sensitive to the position deviation of small target labels and has great differences in sensitivity to targets of different scales. In order to improve the network's detection performance for small targets, the NWD loss function is introduced and combined with the CIoU loss function to optimize the loss function.
[0071] NWD is a normalized Gaussian distance metric based on Wasserstein distance. It uses a two-dimensional Gaussian distribution to model the bounding box of the target and calculates the similarity between the predicted target and the true target by the similarity of their corresponding Gaussian distributions. For detected targets, whether they overlap or not, they can be measured by distribution similarity. The calculation method of NWD is shown in formula (6):
[0072]
[0073] Where C is a constant that is closely related to the data set. is a distance measure, calculated as shown in formula (7):
[0074]
[0075] N a and N b is the real box A=(cx a ,cy a ,w a ,h a ) and the prediction box B = (cx b ,cy b ,w b ,h b ) modeled Gaussian distribution, cx is the horizontal coordinate of the center point, cy is the vertical coordinate of the center point, w is the width, h is the height, and T is the transpose. a and cx bare the horizontal coordinates of the center points of the real box A and the real box B, respectively, a andcy b are the vertical coordinates of the center points of the real box A and the real box B, respectively, a and w b are the width of the real box A and the real box, h a and h b is the height of the real box A and the real box B.
[0076] Compared with CIoU, NWD can capture more details and spatial information and is more suitable for measuring the similarity between small targets. However, directly replacing CIoU with NWD can improve the detection accuracy of small and tiny targets, but it will significantly reduce the convergence speed of the network and bring great time cost. Therefore, the present invention retains CIOU and combines CIOU and NWD with a certain weight ratio. The complete position loss function Loss is shown in formula (8):
[0077] Loss = α1 × CIoU + α2 × NWD (8)
[0078] Where CIoU is the CIoU loss function, NWD is the NWD loss function, α1 and α2 are the weight parameters of CIoU and NWD, respectively, and the sum of the two is 1. By adjusting α1 and α2, different similarity calculation methods are obtained to adapt to different application scenarios and task requirements. In this embodiment, α1 and α2 are both set to 0.5, and NWD is introduced to fully compensate for the shortcomings of CIOU for small target detection and improve the detection accuracy of the model for small targets.
[0079] In this embodiment, step 4 is specifically as follows:
[0080] Input the VisDrone training set in step 2 into the configured network environment, and train on the training set of the VisDrone dataset until the loss curve converges. At the same time, the precision (Precision), recall (Recall) and mean average precision (mAP) of the validation set are used as indicators to evaluate the model performance.
[0081] Precision P represents the proportion of true positive samples among all samples predicted as positive by the model. Recall R represents the proportion of samples successfully predicted as positive by the model among all actual positive samples. P and R are calculated as shown in formulas (9) and (10):
[0082]
[0083] Among them, TP means correct classification; FP means predicting a negative sample as a positive example; FN means predicting a positive sample as a negative example; TN means predicting a negative sample as a negative example.
[0084] With P as the ordinate and R as the abscissa, the area enclosed by the PR curve and the coordinate axis is the value of the average precision AP. The average value of the AP of each target category in the same data set is called mAP. The calculation method of mAP is shown in formula (11):
[0085]
[0086] Where r is the rth type of target detected.
[0087] In this embodiment, the step 5 is specifically as follows:
[0088] Import the weight file trained in step 4 into the detection program, add the prepared test set data path to the program and run the program to obtain the actual detection effect diagram of the improved YOLOv8 model for drone aerial photography targets.
[0089] Secondly, this example also provides a UAV aerial photography small target detection system based on the improved YOLOv8 algorithm, including:
[0090] Dataset processing module: used to obtain the drone aerial image dataset in step 1-2; pre-process the drone aerial image dataset to obtain a training set, a validation set, and a test set;
[0091] Network construction module: used to implement the construction of a drone aerial photography small target detection model based on the improved YOLOv8 algorithm in step 3;
[0092] Network training module: used to implement the network training parameters set in step 3 in step 4, use the training set to train the constructed UAV aerial photography small target detection model based on the improved YOLOv8 algorithm, and output the training weight file after the training is completed; verify the training weight file through the verification set, select the training weight file with the highest accuracy as the optimal weight file, and obtain the trained UAV aerial photography small target detection model based on the improved YOLOv8 algorithm;
[0093] Target recognition module: used to implement step 5 by inputting the test set and the obtained optimal weight file into the trained UAV aerial photography small target detection model based on the improved YOLOv8 algorithm to perform target detection and obtain the target detection result.
[0094] In a third aspect, this example also provides an electronic device, including a memory and one or more processors, wherein the memory is used to store one or more programs; when the one or more programs are executed by the one or more processors, a method for detecting small targets in drone aerial photography based on improved YOLOv8 is implemented.
[0095] In a fourth aspect, this example also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of a method for detecting small targets in drone aerial photography based on improved YOLOv8 are implemented.
[0096] The above embodiments further illustrate the purpose, technical solutions and advantages of the present invention in detail. It should be understood that the above embodiments are only preferred implementation modes of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made to the present invention within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for detecting small targets in drone aerial photography based on improved YOLOv8, characterized in that: The following steps are involved: Step 1: Obtain a drone aerial image dataset; Step 2: Convert the acquired drone aerial image dataset into a training set, a validation set, and a test set. Step 3: Build an improved YOLOv8 UAV aerial photography small target detection network, which improves the backbone network, neck network and loss function of the YOLOv8 network; Step 4: Using the improved YOLOv8 drone aerial photography small target detection network as the detection model, the detection model is trained and verified using the training set and the validation set to obtain the final detection model; Step 5: Use the final detection model and the drone aerial images as input to test the improved YOLOv8 drone aerial small target detection network.
2. According to claim 1, a method for detecting small targets in drone aerial photography based on improved YOLOv8 is characterized in that: In step 1, the drone aerial photography dataset is the VisDrone dataset, specifically the public VisDrone2019-DET aerial photography dataset.
3. According to claim 2, a method for detecting small targets in drone aerial photography based on improved YOLOv8 is characterized in that: In step 2, the drone aerial image dataset file is converted into a txt file of the YOLO sequence, and the VisDrone2019-DET aerial image dataset is divided into a training set, a validation set, and a test set.
4. The method for detecting small targets in drone aerial photography based on improved YOLOv8 according to claim 1, characterized in that: The step 3 is specifically as follows: selecting the YOLOv8 network as the basis for improvement, and the improvement of the YOLOv8 network is in four aspects: designing the SR-Conv module to improve the backbone network, adding a small target detection layer, introducing the bidirectional feature pyramid network BiFPN to improve the neck network, and introducing the normalized weighted distance NWD loss function to optimize the loss function.
5. The method for detecting small targets in drone aerial photography based on improved YOLOv8 according to claim 4 is characterized in that: The SR-Conv module is designed to improve the backbone network. Specifically, the spatial-to-depth SPD layer and the receptive field attention convolution RFAConv are combined to design the SR-Conv module to replace the standard convolution modules Conv in the 1st, 3rd, 5th and 7th layers of the original backbone network. First, the SPD layer maps the spatial dimension of the input feature map to the channel dimension while retaining the information in the channel. After the SPD layer, RFAConv is used for further feature extraction. RFAConv introduces the receptive field attention mechanism RFA to solve the problem of convolution kernel parameter sharing, and fully considers the importance of each feature in the receptive field in the global context. It can adaptively adjust the network's attention to targets of different scales, thereby improving the detection performance of small targets and dense targets. The SR-Conv module combines the ability of the SPD layer to retain all information in the channel dimension, and the ability of RFAConv to adaptively adjust the network's attention to targets of different scales, replacing the Conv module in the original backbone network, thereby extracting more fine-grained information of small target features. Add a small target detection layer, specifically: add a small target detection layer, fuse the second layer features into the feature fusion network, retain more shallow semantic information, and form the fourth prediction head for small targets; BiFPN is introduced to improve the neck network. Specifically, the feature fusion method of the neck network is improved by using the BiFPN network to better utilize the original feature information and enhance the ability to extract small-scale target features. The NWD loss function is introduced to optimize the loss function. Specifically, the NWD loss function is introduced and combined with the CIoU loss function to optimize the loss function. NWD has scale invariance and smoothness of position deviation in detecting tiny objects, and has the ability to measure the similarity between non-overlapping or mutually contained bounding boxes, which can capture more details and spatial information, and effectively improve the performance of aerial target detection algorithm.
6. The method for detecting small targets in drone aerial photography based on improved YOLOv8 according to claim 1, characterized in that: In the step 4, the improved YOLOv8 UAV aerial photography small target detection network is used as the target detection model, the training set of VisDrone DET is input into the improved YOLOv8 UAV aerial photography image target detection network for training, and the validation set data is used to monitor whether the model is overfitting until the loss curve converges, the model training is completed, and the final improved YOLOv8 UAV aerial photography image target detection model is obtained.
7. The method for detecting small targets in drone aerial photography based on improved YOLOv8 according to claim 1, characterized in that: In step 5, the trained model weight file is input into the test set of the VisDrone dataset, and the model will frame and mark the detected targets on the output image to obtain the actual recognition results of the drone aerial image targets.
8. A UAV aerial photography small target detection system based on the improved YOLOv8 algorithm, characterized in that: include: Dataset processing module: configured to obtain a drone aerial image dataset, pre-process the drone aerial image dataset, and obtain a training set, a validation set, and a test set; Network building module: configured to build an improved YOLOv8 drone aerial photography small target detection model; Network training module: used to train the constructed improved YOLOv8 UAV aerial photography small target detection model using the training set according to the set network training parameters, and output the training weight file after the training is completed; verify the training weight file through the verification set, select the training weight file with the highest accuracy as the optimal weight file, and obtain the trained improved YOLOv8 UAV aerial photography small target detection model; Target detection module: used to input the test set and the obtained optimal weight file into the trained improved YOLOv8 drone aerial photography small target detection model for target detection and obtain the target detection results.
9. An electronic device, characterized in that: It comprises a memory and one or more processors, wherein the memory is used to store one or more programs; when the one or more programs are executed by the one or more processors, the method according to any one of claims 1 to 7 is implemented.
10. A computer storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Improved yolov8-based unmanned aerial vehicle aerial image target detection method
CN117372898A
Unmanned aerial vehicle aerial photography small target detection method based on improved YOLOv8s algorithm and electronic equipment
CN118230194A
Pedestrian detection method based on improved YOLO model
CN118351569A
YOLOv8n-based lightweight insect small target detection method and device
CN118470402A
Small target detection method and system for unmanned aerial vehicle image
CN118470576A
Cited By
Lightweight aerial image target detection method based on improved YOLOv11
CN119832219A
Unmanned aerial vehicle aerial photography target detection method based on improved YOLOv8
CN119832456A
Improved YOLOv10 network for detecting small target in remote sensing image
CN119888197A
Unmanned aerial vehicle-oriented small target detection system and method based on YOLOv8s improved model, medium and equipment
CN119888542A
Motion platform radar target detection and tracking integrated intelligent processing method
CN120013994A
