Image feature recognition method based on aerial photography of unmanned aerial vehicle

By improving the backbone network, neck network and loss function in the YOLOv8 model, the RGCS-YOLOv8n model is designed to solve the problem of low detection accuracy of small objects in aerial images, and achieve higher detection accuracy and lightweighting.

CN119904762APending Publication Date: 2025-04-29ZHONGBEI UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411799130.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-09
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

In the prior art, small and medium-sized aerial images have problems such as low resolution, complex background, insufficient features and inaccurate positioning, and it is difficult to accurately detect.

Method used

Using the RGCS-YOLOv8n model, by replacing the C2f module as the C2f_RFG module in the backbone network, the lightweight cross-scale feature fusion network structure LCCFN is added, and the SWS attention mechanism is added before the detection head, and the border loss function is improved to WiseIoU.

Benefits of technology

It improves the accuracy and lightweightness of small target detection of aerial images of drones, reduces the missed detection rate and false detection rate, and enhances the model's detection ability of small targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119904762A_ABST
    Figure CN119904762A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of unmanned aerial vehicle aerial target detection, and aims to solve the problems of low resolution, complex background, insufficient characteristics and inaccurate positioning of small targets in aerial images. The invention provides an image feature recognition method based on aerial photography of an unmanned aerial vehicle, and the method comprises the steps: constructing a YOLOv8 network model, replacing a C2f module in a backbone network with a C2fRFG module, adding a lightweight cross-scale feature fusion network structure LCCFN in a neck network to recombine a PANet structure, adding a small target detection head on the basis of an original detection head, and carrying out the recognition of the features of the small target. An SWS attention mechanism is added in front of each detection head, a frame loss function is replaced with WiseIoU from CIoU, and an RGCS-YOLOv8n model is obtained; and deploying the RGCS-YOLOv8n model on unmanned aerial vehicle equipment, and obtaining small target detection results in different scenes. According to the invention, the precision of unmanned aerial vehicle detection can be improved, and the omission ratio and false detection rate of unmanned aerial vehicle aerial image small target detection are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of unmanned aerial vehicle (UAV) aerial photography target detection, and in particular relates to an image feature recognition method based on unmanned aerial vehicle (UAV) aerial photography. Background Art

[0002] In recent years, drone aerial image detection technology has developed rapidly and has been widely used in precision agriculture, emergency rescue, geographic surveying and exploration, and other fields. Facing the complex urban and natural environment, drones can expand the field of vision and obtain rich information from a high-altitude perspective, which has great advantages that traditional visual equipment cannot achieve. However, small targets in aerial images have problems such as low resolution, complex background, insufficient features, and inaccurate positioning, making them difficult to detect accurately. Summary of the invention

[0003] In order to solve at least one of the above-mentioned technical problems existing in the prior art, the present invention provides an image feature recognition method based on drone aerial photography.

[0004] The present invention is implemented by the following technical scheme: an image feature recognition method based on unmanned aerial vehicle aerial photography, constructing a YOLOv8 network model, replacing the C2f module in the backbone network with the C2f_RFG module, adding a lightweight cross-scale feature fusion network structure LCCFN in the neck network to reorganize the PANet structure, and adding a small target detection head on the basis of the original detection head, adding a SWS attention mechanism in front of each detection head, replacing the border loss function from CIoU to WiseIoU, and obtaining an RGCS-YOLOv8n model; obtaining a data set of unmanned aerial vehicle aerial images and performing label format conversion to obtain a standard data set; training and verifying the RGCS-YOLOv8n model based on the standard data set; deploying the RGCS-YOLOv8n model on unmanned aerial vehicle equipment to obtain small target detection results in different scenarios.

[0005] Preferably, the steps of replacing the C2f module with the C2f_RFG module are:

[0006] Build the C2f_RFAGS module, which includes the lightweight convolution GSConv and the receptive field attention convolution RFAConv;

[0007] Replace all the convolutions in Bottlenneck in C2f with the C2f_RFAGS module consisting of a lightweight convolution GSConv and a receptive field attention convolution RFAConv.

[0008] Preferably, the steps of the LCCFN network using low-channel convolution operations and integrating features of different scales through fusion operations are as follows:

[0009] A 1×1 convolution operation is performed on the feature maps of four different scales (160×160, 80×80, 40×40, and 20×20) extracted by the RGCS-YOLOv8n backbone network. The number of channels of the feature maps of 160×160 and 80×80 scales remains unchanged after the convolution operation, and the number of channels of the feature maps of 40×40 and 20×20 scales is reduced to 64.

[0010] The number of channels of the C2f module is uniformly compressed to 64 during the top-down feature fusion and bottom-up convolution operations. In the top-down feature fusion process, a 1×1 convolution operation is added before the second and third upsampling. The shallow and middle feature maps of 80×80 and 40×40 after the convolution operation are sent to the deep layer for multi-scale feature fusion through skip connections. The feature information of each scale is then fused through the bottom-up convolution operation to generate the final feature map and output it to the detection head.

[0011] Preferably, the original three detection heads are used to generate detection feature maps of sizes 80×80, 40×40 and 20×20, respectively, and are located in the P3, P4 and P5 layers; the newly added small target detection head has a pixel size of 160×160 and is located in the P2 layer.

[0012] Preferably, the steps of improving the border loss function are:

[0013] The dynamic non-monotonic focusing mechanism of Wise-IoU is adopted, and the outlier degree is used instead of IoU to evaluate the quality of the anchor box, and the gradient gain allocation strategy is adopted;

[0014] The formula of the improved border loss function is as follows:

[0015] L WIoUv3 =γ·L WIoUv1 ·L IoU

[0016]

[0017] Where, L WIoUv1 =R WIoU ·L IoU , where R WIoU represents the loss of high-quality anchor boxes, R WIoU The formula is as follows:

[0018] where w c and h c is the width and height of the minimum bounding box, x gt Indicates the width of the real box; y gt Indicates the height of the real box; x 0 Indicates the width of the annotation box; y 0 Indicates the height of the annotation box; LIoU represents the intersection-over-union loss function, IoU is the intersection-over-union ratio;

[0019] γ represents the gradient gain; α and β represent the constant and outlier degree respectively; δ represents a custom hyperparameter.

[0020] Preferably, based on the confusion matrix composed of the prediction results and the actual results of the model, the accuracy, recall rate, average precision mean, and parameter quantity in the target detection task are selected as evaluation indicators to evaluate the model.

[0021] Preferably, the label format of the drone aerial image dataset is converted from VOC format to YOLO format to obtain a standard dataset; at the same time, a pytorch virtual environment is built as the training environment of the RGCS-YOLOv8n model;

[0022] The optimal weight parameters obtained by training the model with the training set in the standard data set are saved; the test set in the standard data set is input into the trained RGCS-YOLOv8n model to evaluate and verify the model detection performance.

[0023] Preferably, the output of the RGCS-YOLOv8n model generates a heat map by the Grad-CAM method, and four groups of photos of dim, occluded, small target dense and multi-scale environments are selected in the test set for visual comparison.

[0024] Compared with the prior art, the present invention has the following beneficial effects:

[0025] This method improves the backbone network, neck network, and loss function based on the RGCS-YOLOv8n model, and designs the SWS parameter-free attention mechanism. The RGCS-YOLOv8n algorithm for small target detection in drone aerial images is proposed. In the backbone network, the GSConv lightweight convolution is used to replace the traditional convolution and the LCCFN neck network is designed, which greatly reduces the number of model parameters and achieves a lightweight effect, which has better deployment advantages for resource-constrained edge devices such as drones.

[0026] By designing the SWS parameter-free attention mechanism and adding a slice operation on the basis of SimAM attention, the small target features are strengthened and the small target detection accuracy is improved. At the same time, the small target detection head is added and embedded in the LCCFN neck network to further improve the small target detection performance. The CIoU loss function is improved to the WIoU loss function, which balances the sample quality during the training process, improves the detection accuracy of the model, and reduces the missed detection rate and false detection rate of small target detection in drone aerial images. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0028] Figure 1 It is a schematic diagram of the small target detection model structure provided by this method;

[0029] Figure 2 It is the structural diagram of the improved backbone network C2f_RFG module;

[0030] Figure 3 It is a diagram of the SWS structure with slicing operation;

[0031] Figure 4 This is the structure diagram of the improved neck network structure LCCFN;

[0032] Figure 5 is the thermal map detection result of the present invention;

[0033] Figure 6 It is a diagram of detection results in different scenarios of the present invention. DETAILED DESCRIPTION

[0034] In conjunction with the drawings in the embodiments of the present invention, the technical solutions in the embodiments of the present invention are clearly and completely described. 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 implementation methods obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0035] It should be noted that the structures, proportions, sizes, etc. illustrated in the drawings of this specification are only used to match the contents disclosed in the specification so that people familiar with this technology can understand and read them. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantive technical significance. Any structural modification, change in proportional relationship or adjustment of size should fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention. It should be noted that in this specification, relational terms such as first and second are only used to distinguish one entity from several other entities, and do not necessarily require or imply any actual relationship or order between these entities.

[0036] The present invention provides an embodiment:

[0037] An image feature recognition method based on drone aerial photography is proposed. A YOLOv8 network model is constructed, the C2f module in the backbone network is replaced by the C2f_RFG module, a lightweight cross-scale feature fusion network structure LCCFN is added to the neck network to reorganize the PANet structure, and a small target detection head is added based on the original detection head. A SWS attention mechanism is added before each detection head, and the border loss function is replaced from CIoU to WiseIoU to obtain the RGCS-YOLOv8n model; a drone aerial image dataset is obtained and the label format is converted to obtain a standard dataset; the RGCS-YOLOv8n model is trained and verified based on the standard dataset; the RGCS-YOLOv8n model is deployed on drone equipment to obtain small target detection results in different scenarios.

[0038] The technical solution adopted by the present invention to solve its technical problems is: mainly improving the YOLOv8 target detection model, improving the accuracy and lightness of small target detection in drone aerial images, and reducing the missed detection rate and false detection rate by improving the backbone network, neck network and loss function. The model is trained and verified on the public data set VisDrone, and can be exported and deployed on resource-constrained drone devices for real-time detection.

[0039] The specific steps include:

[0040] S1: Convert the label format of the public drone aerial image dataset VisDrone2019 from VOC format to YOLO format to obtain a standard dataset;

[0041] S2: Build a pytorch virtual environment and configure the model training environment; the specific training environment configured: python version is 3.8.10, pytorch 2.0.1CUDA 12.3;

[0042] S3: Improve the YOLOv8 backbone network, design the C2f_RFG module in the backbone network to replace the C2f module of the original network, lightweight the model while increasing the receptive field, and use the backbone network for feature extraction.

[0043] After the format conversion is completed, the image is passed to the model and the feature extraction is performed in the backbone network as shown in the attached figure. Figure 1(1-11) The Bottleneck module in the C2f module in the original YOLOv8 algorithm is composed of two traditional convolutions. However, there are many small targets in drone aerial images, which are dense and have complex backgrounds. Traditional standard convolution uses the same convolution kernel to extract features from the original feature map, which has the problem of shared parameters. This limits the learning ability of the model in complex environments and is not conducive to small target detection. The C2f_RFAGS module is designed, as shown in the attached figure. Figure 2 As shown in the figure, the convolution in Bottlenneck in C2f is replaced with RFAConv, a convolution based on the receptive field attention mechanism, and GSConv, a lightweight convolution that reduces the weight of the model but maintains accuracy, which effectively enhances the feature extraction capability and improves the detection accuracy of the model. Compared with traditional convolution, the advantages of RFAConv and GSConv are as follows:

[0044] The core idea of ​​RFAConv is to combine spatial attention with standard convolution and emphasize the importance of different features within the receptive field slider, allowing the network to process local areas in the image more efficiently and improve the accuracy of feature extraction. And based on the spatial features of the receptive field, the parameters of the convolution kernel can be adjusted more flexibly, which completely solves the problem of convolution kernel parameter sharing. The calculation formula of RFA can be expressed as:

[0045] F = Softmax(g i×i (AvgPool(X)))×ReLU(g k×k (X)

[0046] Among them, g i×i represents the i×i grouped convolution, k represents the size of the convolution kernel, and F represents the output feature map through the attention map A rf And the converted receptive field feature F rf obtained by multiplication; Softmax represents the normalized exponential function; AvgPool represents the average pooling function; ReLU represents the linear rectification function.

[0047] GSConv is a convolutional layer that combines the advantages of standard convolution and depthwise separable convolution. Traditional depthwise separable convolution has the disadvantage that the channel information of the input image is isolated, resulting in much lower feature extraction and fusion capabilities than standard convolution. The input tensor is grouped and convolved through the standard convolution layer to generate a tensor with half the channel dimension. The output tensor of the standard convolution layer is depthwise convolved in the depthwise separable convolution layer. The output tensors of the standard convolution and depthwise separable convolution are feature fused in the Concat layer. According to the principle that the corresponding channels of the two output tensors are adjacent, the final output result is obtained through the channel re-shuffle layer.

[0048] S4: Improve the YOLOv8 neck network, design the LCCFN (Lightweight Cross-Scale Feature Fusion Network) network structure in the neck network to reorganize the PANet structure. Add a 160×160 pixel small target detection head based on the original three detection heads. Since the P2 layer is at a shallower layer of the network, it can better capture the details of small targets, thereby improving the small target detection capability.

[0049] S4.1: LCCFN network structure example diagram is as attached Figure 4 As shown in the figure. Through the convolution operation with low number of channels and integrating the features of different scales through fusion operation, the adaptability of the model to scale changes and the detection ability of small targets are enhanced while reducing the number of network parameters. First, a 1×1 convolution operation is performed on the four feature maps of different scales of 160×160, 80×80, 40×40 and 20×20 extracted by the YOLOv8n backbone network. The number of channels of the feature maps of 160×160 and 80×80 scales remains unchanged after the convolution operation, and the number of channels of the feature maps of 40×40 and 20×20 is reduced to 64. While integrating the detailed features of each scale, it can effectively reduce the parameters and calculation amount of the neck network. Secondly, in the process of top-down feature fusion and bottom-up convolution operation, the number of channels of the C2f module is uniformly compressed to 64, further reducing the number of parameters and calculation amount of the neck network. Then, in the top-down feature fusion process, a 1×1 convolution operation is added before the second and third upsampling. This is the middle of feature fusion. An additional 1×1 convolution operation here can effectively increase nonlinear features and strengthen the connection and feature expression of contextual information. Figure 5 As shown by the red dotted line in the figure, the shallow and middle feature maps of 80×80 and 40×40 after convolution operation are sent to the deep layer for multi-scale feature fusion through jump connection. Finally, the feature information of each scale is fused through bottom-up convolution operation and the final feature map is generated and output to the detection head. CCFN can significantly reduce the number of model parameters while strengthening the feature expression ability through active channel dimensionality reduction and the insertion of appropriate 1×1 convolution operation, thereby improving the overall performance of the model.

[0050] S4.2: The YOLOv8n detection model has three detection heads by default, namely P3, P4, and P5, which generate detection feature maps of 80×80, 40×40, and 20×20 sizes respectively. There are a large number of small targets in drone aerial images. Since the sample pixels of small targets are too small and the downsampling multiple of YOLOV8n is large, it is difficult to integrate the shallow small target information into the deep feature map. The original three detection heads can no longer meet the detection requirements of extremely small targets, and there are omissions and false detections. Therefore, a new 160×160 pixel small target detection head is added on the basis of the original three detection heads. Since the P2 layer is at a shallower layer of the network, it can better capture the details of small targets, thereby improving the small target detection capability.

[0051] S5: Add SWS attention mechanism before each detection head of the network, as shown in the attached Figure 1 As shown in the 25th, 29th, 33rd and 37th layers. There are many small targets in drone aerial images. The attention mechanism can help the network quickly filter the feature information of small targets and enhance the relevance of local context information, so as to accurately locate the spatial position of small targets.

[0052] S5.1: SWS attention mechanism as attached Figure 3 As shown. Traditional attention mechanisms usually operate by generating one-dimensional weights along the channel dimension or two-dimensional weights along the spatial dimension. These methods either treat all neurons in a channel equally or all neurons at a spatial position equally, so they cannot effectively calculate the true 3D weights. Inspired by neuroscience theory, the SimAm attention module directly estimates the 3D weight of each neuron based on spatial inhibition observed in the mammalian brain. Figure 6 In each subgraph of , the same color represents a single scalar used for each channel, space, or feature. The simplest way to distinguish the importance of neurons is to measure the linear separability between neurons. The energy function is defined in the SWS module as shown below:

[0053]

[0054] Where ω t x i +b t and ω t t+b t is t and x i A linear transformation where t and x i is the input feature X∈R C×H×W The target neuron and other neurons in a single channel of . i is the index in the spatial dimension, M = H × W is the number of neurons in the channel, ω t and b t are the weights and biases of the transformation; et is the energy function; y is the ordinate; λ is the regularization coefficient.

[0055] The linear separability between the target neuron t and all other neurons in the same channel can be found by minimizing this equation.

[0056] S5.2: When the feature map is cut into different blocks, the large target will affect the average value of the block due to its obvious texture features, resulting in a reduction in the additional weight it receives. After merging the feature maps, the large target can still maintain high recognizability or even be further enhanced; while the difference between the features of the small target and the average value after cutting is larger, so the small target can get more weight and the features of the small target are enhanced. That is, the SWS module ensures that both large and small targets receive fair attention and enhancement, further improving the accuracy and robustness of small target detection in aerial images.

[0057] S6: Loss function improvement: the bounding box loss function is replaced by WiseIoU from CIoU to provide a gain allocation strategy to improve the generalization ability of the network.

[0058] S6.1: YOLOv8 originally used CIoU as the bounding box loss function. The loss function formula of CIoU is shown in the following equations (1)-(4):

[0059]

[0060]

[0061] Where w and h represent the width and height of the annotation box respectively. gt and h gt are the width and height of the real frame, b and b gt is the center point of the boundary between the annotation box and the ground-truth box, and ρ represents b and b gt The Euclidean distance between c and h c is the width and height of the minimum bounding box, IoU is the intersection over union ratio; α is a balance term used to balance the position of the center point of the bounding box and the size of the bounding box, v is the cosine value of the aspect ratio of the bounding box; c is the diagonal length of the minimum bounding box; L CIoU is the CIoU loss function; R CIoU is the penalty term of CIoU.

[0062] S6.2: CIoU only focuses on the distance between the center points and the height ratio of the anchor frame, and does not pay attention to the balance between difficult and easy samples. If the boundary loss function of the low-quality anchor frame is blindly strengthened, it will mislead the model's judgment of the background and reduce the model's positioning ability. Therefore, the dynamic non-monotonic focusing mechanism of Wise-IoU is adopted, and "outlier degree" is used instead of IoU to evaluate the quality of the anchor frame. At the same time, the gradient gain allocation strategy is adopted to reduce the competitiveness of high-quality anchor frames, reduce the harmful gradients generated by low-quality anchor frames, and improve the overall performance of the model. The formula of WIoUv1 is as follows:

[0063] L WIoUv1 =R WIoU ·L IoU(5)

[0064] Where L WIoUv1 represents the WIoUv1 loss function; L IoU represents the intersection-over-union loss function; R WIoU represents the loss of high-quality anchor boxes, R WIoU The formula is as follows:

[0065]

[0066] x gt Indicates the width of the real box; y gt Indicates the height of the real box; x 0 Indicates the width of the annotation box; y 0 Indicates the height of the annotation box;

[0067] In order to avoid large harmful gradients caused by low-quality samples, the parameter β and WIoUv1 are introduced to construct WIoUv3. The loss function formula of WIoUv3 is as follows:

[0068]

[0069] Where γ represents the gradient gain; δ represents the custom hyperparameter; α and β are constants and outliers, respectively, which balance the gradient contributions of anchor boxes of different qualities during training and can improve the learning effect of the model on small target detection in aerial images. Therefore, WIoUv3 is used as the bounding box loss function.

[0070] S7: Construct a small target detection model for drone aerial images. Combine S3, S4, S5 and S6 to improve the YOLOv8 network model and propose the RGCS-YOLOv8n algorithm to reduce the number of model parameters and improve detection accuracy.

[0071] S8: Parameter setting and model evaluation: Save the optimal weight parameters obtained by training the model with the VisDrone-2019 training set; after the training is completed, combine the trained model and input the test set VisDrone-2019-test into the saved RGCS-YOLOv8n model to evaluate and verify the model detection performance.

[0072] S8.1: Parameter setting: Use the SGD parameter optimizer, set the optimizer momentum to 0.937, the batch size to 8, the network initial learning rate (lr0) to 0.01, the cosine annealing parameter (lrf) to 0.01, the image size (imgsz) to 640×640, turn on data enhancement during training, turn off data enhancement in the last 10 rounds of training, set the number of training epochs to 300, and do not use pre-trained weights for all training.

[0073] S8.2: Performance evaluation: The confusion matrix composed of statistical prediction results and true results is selected as the evaluation basis for common evaluation indicators in target detection tasks, such as precision (Precision, P), recall (Recall, R), mean average precision (Mean Average Precision, mAP), and parameter quantity (Params). The indicators are introduced as follows:

[0074] (1) Precision represents the accuracy of the detected target, reflecting the effectiveness of the algorithm detection. The calculation formula is:

[0075]

[0076] TP is the number of positive samples that predict the correct category, and FP is the number of negative samples that predict the correct category.

[0077] (2) Recall represents the recall rate of the detection target, which refers to the probability of predicting a positive sample. FN is the number of positive samples predicted to be undetected categories. The calculation formula is:

[0078]

[0079] FN is the number of positive samples predicted for undetected categories.

[0080] mAP represents the mean of the detection accuracy of all categories, mAP@0.5 represents the average of the average accuracy AP@0.5 of all categories; mAP@0.5: 0.95 is the average mAP with a step size of 0.05 and an IoU threshold between 0.5 and 0.95, and the calculation formula is:

[0081]

[0082] C is the total number of categories of detected targets, j is the number of detections, AP is the area under the PR curve of a single category, and the AP calculation formula is:

[0083]

[0084] Params represents the number of network parameters, reflecting the complexity of the network and the lightweightness of the model.

[0085] S9: Visualization of detection results. In order to explore the improvement effect of RGCS-YOLOv8n, the Grad-CAM method generates a heat map, which can intuitively reflect which areas of the feature map the model focuses on. At the same time, four groups of photos of dim, occluded, small target dense and multi-scale environments are selected from the VisDrone test set for visual comparison.

[0086] In order to explore the improvement effect of RGCS-YOLOv8n, the visual analysis of the detection results is divided into two parts:

[0087] (1) The heat map generated by the Grad-CAM method can intuitively reflect which areas of the feature map the model focuses on. Two pictures taken at high altitude are selected for detection. The detection results are shown in Figure 2. Figure 5 As shown in the figure, the left side is the original image, the middle is the heat map generated by the YOLOv8n model, and the right side is the heat map generated by the improved RGCS-YOLOv8n. Figure 5 As can be seen, we can conclude that YOLOv8n pays less attention to small objects and is insensitive to distant objects. The model proposed in this method pays more attention to small objects, has better suppression of background noise, and pays more attention to small targets. The model's attention is more focused on the center point of the object, which makes the predicted bounding box more accurate, thereby improving the overall detection performance of the model.

[0088] (2) Four groups of photos of dim, occluded, small target dense and multi-scale environments were selected from the VisDrone test set for visual comparison. The left side is the original image, the middle is the detection effect of the YOLOv8n algorithm, and the right side is the detection effect of the RGCS-YOLOv8n algorithm in this paper. The box shows the detected target information. Figure 6 As shown in (a), in a dim environment, RGCS-YOLOv8n can accurately identify and detect the dense pedestrians in the upper left corner of the image and the car in the distance in front of the image, while the YOLOv8n algorithm has a serious omission of these pedestrians and cars. Figure 6As shown in (b), in a scene with dense small targets, the crowd and cars in the picture are dense and block each other, and the small targets overlap significantly. The YOLOv8n algorithm misses most pedestrians and the car in the upper right corner of the picture, but the algorithm in this paper can still accurately detect these small targets. Figure 6 As shown in (c), in the occlusion scene, the trees on the roadside block part of the motorcycle and car. YOLOv8n loses important features in the feature extraction process, resulting in serious missed detection. However, the proposed algorithm is more capable of extracting features for small target detection and can accurately detect targets that are occluded by trees. Figure 6 As shown in (d), when the drone is at high altitude, the resolution of small targets in the image is smaller and less feature information can be extracted. The target features are not clear enough and the background is complex. YOLOv8n has serious missed detection of the car in the image, but the algorithm in this paper can still accurately detect and identify small targets, and the confidence is generally significantly higher than the original model.

[0089] The present invention designs the C2f_RFAGS module, which replaces the convolution in Bottlenneck in C2f with the convolution RFAConv based on the receptive field attention mechanism and the lightweight convolution GSConv that reduces the weight of the model but maintains accuracy, effectively enhancing the feature extraction capability and improving the detection accuracy of the model.

[0090] Use LCCFN and introduce a small target detection layer to reconstruct the Neck network. Enhance the ability to extract small target features, and use 1×1 convolution to enhance feature extraction while compressing the number of output channels of the backbone network and C2f layer, reducing the number of model parameters. Add jump connections to fuse shallow information and improve detection performance.

[0091] Introduce the SWS attention mechanism before each detection head. SWS is based on SimAM's parameter-free attention. By adding slicing operations, small target features are more weighted, and the model pays more attention to small target categories in the dataset, improving small target detection performance.

[0092] The baseline network border fitting loss function CIoU is replaced by the bounding box loss function WiseIoU-V3 based on the dynamic non-monotonic focusing mechanism to enhance the overall generalization ability of the network.

[0093] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for image feature recognition based on drone aerial photography, characterized in that: Build a YOLOv8 network model, replace the C2f module in the backbone network with the C2f_RFG module, add a lightweight cross-scale feature fusion network structure LCCFN to the neck network to reorganize the PANet structure, and add a small target detection head based on the original detection head. Add a SWS attention mechanism in front of each detection head, replace the bounding box loss function from CIoU to WiseIoU, and get the RGCS-YOLOv8n model; Obtain a drone aerial image dataset and convert the label format to obtain a standard dataset; train and verify the RGCS-YOLOv8n model based on the standard dataset; The RGCS-YOLOv8n model is deployed on the UAV device to obtain small target detection results in different scenarios.

2. The image feature recognition method based on drone aerial photography according to claim 1 is characterized in that: The steps to replace the C2f module with the C2f_RFG module are: Build the C2f_RFAGS module, which includes the lightweight convolution GSConv and the receptive field attention convolution RFAConv; Replace all the convolutions in Bottlenneck in C2f with the C2f_RFAGS module consisting of a lightweight convolution GSConv and a receptive field attention convolution RFAConv.

3. The image feature recognition method based on drone aerial photography according to claim 2 is characterized in that: The steps of LCCFN network using low-channel convolution operation and integrating features of different scales through fusion operation are as follows: A 1×1 convolution operation is performed on the feature maps of four different scales (160×160, 80×80, 40×40, and 20×20) extracted by the RGCS-YOLOv8n backbone network. The number of channels of the feature maps of 160×160 and 80×80 scales remains unchanged after the convolution operation, and the number of channels of the feature maps of 40×40 and 20×20 scales is reduced to 64. The number of channels of the C2f module is uniformly compressed to 64 during the top-down feature fusion and bottom-up convolution operations. In the top-down feature fusion process, a 1×1 convolution operation is added before the second and third upsampling. The shallow and middle feature maps of 80×80 and 40×40 after the convolution operation are sent to the deep layer for multi-scale feature fusion through skip connections. The feature information of each scale is then fused through the bottom-up convolution operation to generate the final feature map and output it to the detection head.

4. The image feature recognition method based on drone aerial photography according to claim 3 is characterized by: The original three detection heads are used to generate detection feature maps of sizes 80×80, 40×40 and 20×20, respectively, and are located in the P3, P4 and P5 layers; the newly added small target detection head has a pixel size of 160×160 and is located in the P2 layer.

5. The image feature recognition method based on drone aerial photography according to claim 2 is characterized in that: The steps to improve the border loss function are: The dynamic non-monotonic focusing mechanism of Wise-IoU is adopted, and the outlier degree is used instead of IoU to evaluate the quality of the anchor box, and the gradient gain allocation strategy is adopted; The formula of the improved border loss function is as follows: L WIoUv3 =γ·L WIoUv1 ·L IoU Where, L WIoUv1 =R WIoU ·L IoU , where R WIoU represents the loss of high-quality anchor boxes, R WIoU The formula is as follows: where w c and h c is the width and height of the minimum bounding box, x gt Indicates the width of the real box; y gt represents the height of the real box; x0 represents the width of the annotation box; y0 represents the height of the annotation box; L IoU represents the intersection-over-union loss function, IoU is the intersection-over-union ratio; γ represents the gradient gain; α and β represent the constant and outlier degree respectively; δ represents a custom hyperparameter.

6. The image feature recognition method based on drone aerial photography according to claim 1 is characterized in that: Based on the confusion matrix composed of the model's prediction results and actual results, the accuracy, recall rate, average precision mean, and parameter quantity in the target detection task are selected as evaluation indicators to evaluate the model.

7. The image feature recognition method based on drone aerial photography according to claim 1 is characterized by: Convert the label format of the drone aerial image dataset from VOC format to YOLO format to obtain a standard dataset; at the same time, build a pytorch virtual environment as the training environment for the RGCS-YOLOv8n model; The optimal weight parameters obtained by training the model with the training set in the standard data set are saved; the test set in the standard data set is input into the trained RGCS-YOLOv8n model to evaluate and verify the model detection performance.

8. The image feature recognition method based on drone aerial photography according to claim 7 is characterized by: The output of the RGCS-YOLOv8n model is used to generate a heat map using the Grad-CAM method. At the same time, four groups of photos of dim, occluded, small target dense, and multi-scale environments are selected from the test set for visual comparison.

Citation Information

Cited By

  • Instrument reading method and system, computer readable storage medium and electronic equipment

    CN120544175A

  • Low-altitude unmanned aerial vehicle small target detection method and system based on improved YOLOv8

    CN122090330A