Aerial image target detection method, system and device and storage medium

Through the improved aerial image object detection method, the feature extraction network, Mamba dense aggregation network and gated adaptive feature fusion detection head are used to solve the problem of poor detection performance of small and small targets in aerial images, and achieve higher detection accuracy and effect.

CN118968346APending Publication Date: 2024-11-15WUHAN BUSINESS UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410949536.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The prior art has problems in small target detection performance, dense distribution, large scale changes and occlusion when detecting targets in aerial images, resulting in increased detection difficulty and inaccurate detection.

Method used

Improved aerial image object detection methods are adopted, including building feature extraction networks, Mamba dense aggregation networks and gated adaptive feature fusion detection heads, and optimizing the model through training data sets to improve the accuracy of small object detection.

Benefits of technology

The detection accuracy and effect of small targets in aerial images are improved, feature extraction ability and discriminantity are enhanced, and the improved model can more effectively handle dense and scale-changing targets, improving detection performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118968346A_ABST
    Figure CN118968346A_ABST
Patent Text Reader

Abstract

An aerial image target detection method comprises the steps that an improved Yolov5 target detection model is constructed, and the improved Yolov5 target detection model comprises a feature extraction network, a Mama dense aggregation network and a gating adaptive feature fusion detection head; the improved Yolov5 target detection model is trained, and a trained target detection model is obtained; and performing target detection on the aerial image by using the trained target detection model. The design has a better detection effect on the small target in the aerial image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to an aerial image target detection method, system, device and storage medium. Background Art

[0002] Unmanned aerial vehicles (UAVs) and remote sensing technologies have been continuously developing. They are able to perform a wider range of tasks by leveraging the combined power of their visual perception capabilities. Intelligent analysis and processing of aerial images can quickly and effectively capture target feature information, thereby enhancing the scene understanding capabilities of drones. At the same time, target detection technology can automatically identify targets and locate them in images, improve the perception capabilities of drones under weak human-computer interaction conditions, and provide basic technical support for autonomous detection and flight. Object detection in aerial images has gained widespread attention in civil and military fields such as drone reconnaissance, traffic supervision, precision agriculture, wildlife tracking, and personnel rescue.

[0003] Object detection technology aims to automatically identify and locate objects of interest, such as pedestrians, vehicles, buildings, etc., from images. In natural scene images, object detection technology has made significant progress, but in aerial images, due to the characteristics of small object size, dense distribution, large scale variation, occlusion and arbitrary direction, the object detection task is more challenging. Traditional object detection algorithms usually include steps such as image preprocessing, candidate region selection, feature extraction, dimensionality reduction and classification. These algorithms extract object features in images through manually designed feature descriptors (such as SIFT, VJ, HOG, DPM, etc.), and then use classifiers (such as support vector machines, Adaboost, etc.) to classify the extracted features. However, these algorithms have many shortcomings when dealing with aerial image object detection tasks. For example, the SIFT algorithm is not effective in extracting target features with smooth edges, and the computational complexity is high; although the VJ algorithm is easy to implement, it also faces the problem of high computational complexity; the HOG algorithm cannot effectively handle occlusion problems; the DPM algorithm requires artificially designed features, and the workload of designing features is large and the stability is poor.

[0004] In recent years, the rapid development of deep learning technology has brought new solutions to aerial image target detection. Deep learning models can automatically learn feature representations in images and optimize model parameters through a large amount of training data, thereby achieving accurate detection of targets. In the field of drone aerial image detection, many scholars use deep learning models (such as YOLO, SSD, Faster R-CNN, etc.) to conduct target detection research. Among them, the YOLO series of algorithms have attracted widespread attention for their high efficiency and accuracy.

[0005] However, there are still some problems when directly applying the existing YOLO algorithm to the task of aerial image target detection. First, the size of the targets in aerial images is usually small, and the YOLO algorithm has poor performance in detecting small targets; second, the targets in aerial images are densely distributed, and there are problems such as large scale changes and occlusion, which further increases the difficulty of target detection. In view of the above problems, the present invention proposes an improved aerial image target detection method with better detection effect on small targets in aerial images. Summary of the invention

[0006] The purpose of the present invention is to provide an aerial image target detection method with better detection effect for small targets in aerial images, in order to solve the problems in the prior art that aerial image target detection is difficult and inaccurate due to dense target distribution, large scale changes and target occlusion in aerial images.

[0007] To achieve the above objectives, the technical solution of the present invention is:

[0008] A method for detecting targets in aerial images, the method comprising:

[0009] S1. Build an improved target detection model;

[0010] The improved target detection model includes a feature extraction network, a Mamba dense aggregation network and a gated adaptive feature fusion detection head;

[0011] S2. Training the improved target detection model to obtain a trained target detection model;

[0012] S3. Use the trained target detection model to perform target detection on aerial images.

[0013] In step S2, training the improved target detection model using a training data set includes the following steps:

[0014] S201, training the improved target detection model using a training data set to obtain a first target detection model;

[0015] S202, evaluating the performance of the first object detection model using a test data set and a validation data set to obtain an evaluation index of the first object detection model;

[0016] The evaluation indicators include: accuracy, recall, F1 score, and average precision value;

[0017] S203, adjusting the hyperparameters of the first target detection model according to the evaluation index to obtain a trained target detection model;

[0018] The training data set, the test data set, and the validation data set all contain multiple aerial images, and the target category and target position are marked in each of the aerial images.

[0019] The feature extraction network includes a stem module, a first C2f module, a second C2f module, a third C2f module, a fourth C2f module, and an SPPF module;

[0020] The input end of the stem module is used to receive the original aerial image, the output end of the stem module is connected to the input end of the first C2f module, the output end of the first C2f module is connected to the input end of the second C2f module through a downsampling module, the output end of the second C2f module is connected to the input end of the third C2f module through a downsampling module, the output end of the third C2f module is connected to the input end of the fourth C2f module through a downsampling module, the output end of the fourth C2f module is connected to the input end of the SPPF module, and the output end of the SPPF module, the output end of the first C2f module, the output end of the second C2f module, the output end of the third C2f module, and the output end of the fourth C2f module are all connected to the input end of the Mamba dense aggregation network.

[0021] The Mamba dense aggregation network includes: a fifth C2f module, a sixth C2f module, a seventh C2f module, an eighth C2f module, a ninth C2f module, a tenth C2f module, an eleventh C2f module, a twelfth C2f module, a thirteenth C2f module, a first Mamba module, a second Mamba module, a third Mamba module, a fourth Mamba module, a first Concat module, a second Concat module, a third Concat module, a first adder, a second adder, a third adder, a fourth adder, a fifth adder, a sixth adder, and a seventh adder;

[0022] The two input ends of the first adder are respectively connected to the output end of the fourth C2f module and the output end of the SPPF module, the output end of the first adder is connected to the input end of the fifth C2f module, the output end of the fifth C2f module is connected to the input end of the first Mamba module, the output end of the first Mamba module is connected to the input end of the sixth C2f module, the output end of the sixth C2f module is connected to an input end of the third Concat module, the output end of the third Concat module is connected to the input end of the gated adaptive feature fusion detection head and the input end of the thirteenth C2f module, and the output end of the thirteenth C2f module is connected to an input end of the first Concat module;

[0023] The input end of the seventh C2f module is connected to the output end of the second adder, one input end of the second adder is connected to the output end of the third C2f module, another input end of the second adder is connected to the output end of the fifth C2f module through the upsampling module, another input end of the second adder is connected to the output end of the first Mamba module through the upsampling module, the output end of the seventh C2f module is connected to an input end of the second Mamba module, another input end of the second Mamba module is connected to the output end of the third adder, one input end of the third adder is connected to the output end of the first Mamba module through the upsampling module, another input end of the third adder is connected to the output end of the sixth C2f module through the upsampling module, the output end of the second Mamba module is connected to the input end of the eighth C2f module, the output end of the eighth C2f module is connected to an input end of the second Concat module, and the output end of the second Concat module is connected to the input end of the gated adaptive feature fusion detection head and the other input end of the third Concat module;

[0024] The input end of the ninth C2f module is connected to the output end of the fourth adder, one input end of the fourth adder is connected to the output end of the second C2f module, another input end of the fourth adder is connected to the output end of the seventh C2f module through the upsampling module, another input end of the fourth adder is connected to the output end of the second Mamba module through the upsampling module, the output end of the ninth C2f module is connected to an input end of the third Mamba module, another input end of the third Mamba module is connected to the output end of the fifth adder, one input end of the fifth adder is connected to the output end of the second Mamba module through the upsampling module, another input end of the fifth adder is connected to the output end of the eighth C2f module through the upsampling module, the output end of the third Mamba module is connected to the input end of the tenth C2f module, the output end of the tenth C2f module is connected to another input end of the first Concat module, and the output end of the first Concat module is connected to the input end of the gated adaptive feature fusion detection head and another input end of the second Concat module;

[0025] The input end of the eleventh C2f module is connected to the output end of the sixth adder, one input end of the sixth adder is connected to the output end of the first C2f module, another input end of the sixth adder is connected to the output end of the ninth C2f module through the upsampling module, another input end of the sixth adder is connected to the output end of the third Mamba module through the upsampling module, the output end of the eleventh C2f module is connected to an input end of the fourth Mamba module, another input end of the fourth Mamba module is connected to the output end of the seventh adder, one input end of the seventh adder is connected to the output end of the third Mamba module through the upsampling module, another input end of the seventh adder is connected to the output end of the tenth C2f module through the upsampling module, the output end of the fourth Mamba module is connected to the input end of the twelfth C2f module, and the output end of the twelfth C2f module is connected to another input end of the first Concat module.

[0026] The first C2f module includes a slipt structure, a plurality of Bottleneck residual structures and a Concat structure connected in sequence, wherein the slipt structure is used to divide the input image into two parts, namely, a first split feature map and a second split feature map in the channel dimension, the plurality of Bottleneck residual structures are used to perform a residual connection operation on the first split feature map, and the Concat structure is used to perform splicing processing on the second split feature map and the feature maps output by the plurality of Bottleneck residual structures;

[0027] The structures of the second to thirteenth C2f modules are the same as that of the first C2f module.

[0028] The gated adaptive feature fusion detection head comprises a first gated adaptive feature fusion module, a second gated adaptive feature fusion module, a third gated adaptive feature fusion module, and a detection head module;

[0029] The first gated adaptive feature fusion module includes a first linear layer, a second linear layer, a third linear layer, a convolutional layer, a sigmoid activation function layer, a fourth linear layer, a fifth linear layer, a first multiplier, a second multiplier, an eighth adder, and a ninth adder. The output end of the first linear layer is connected to an input end of the first multiplier and an input end of the second multiplier through the convolutional layer and the sigmoid activation function layer in sequence. The other input end of the first multiplier is connected to the output end of the second linear layer, and the other input end of the second multiplier is connected to the output end of the third linear layer. The output end of the first multiplier and the output end of the second multiplier are respectively connected to two input ends of the eighth adder. The output end of the first adder is connected to an input end of the ninth adder through the fourth linear layer. The other input end of the second adder shares an input with the first linear layer, and the output end of the ninth adder is connected to the input end of the fifth linear layer.

[0030] The structures of the second gated adaptive feature fusion module and the third gated adaptive feature fusion module are the same as the first gated adaptive feature fusion module;

[0031] The input end of the first Linear layer in the first gated adaptive feature fusion module is connected to the output end of the first Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the first gated adaptive feature fusion module are connected to the output ends of the second Concat module and the third Concat module respectively;

[0032] The input end of the first Linear layer in the second gated adaptive feature fusion module is connected to the output end of the second Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the second gated adaptive feature fusion module are connected to the output ends of the first Concat module and the third Concat module respectively;

[0033] The input end of the first Linear layer in the third gated adaptive feature fusion module is connected to the output end of the third Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the third gated adaptive feature fusion module are connected to the output ends of the first Concat module and the second Concat module respectively;

[0034] The output ends of the three fifth Linear layers in the first gated adaptive feature fusion module, the second gated adaptive feature fusion module, and the third gated adaptive feature fusion module are all connected to the input end of the detection head module.

[0035] The first Mamba module includes a Mamba layer, a Layernorm layer, a 1*1 convolution layer, a GELU activation function layer, and a 1*1 convolution layer connected in sequence;

[0036] The structures of the second to fourth Mamba modules are the same as that of the first Mamba module.

[0037] In a second aspect, the present invention provides an aerial image target detection system, comprising:

[0038] The model building department is used to build an improved object detection model;

[0039] The improved target detection model includes a feature extraction network, a Mamba dense aggregation network and a gated adaptive feature fusion detection head;

[0040] A model training unit, used for training the improved target detection model to obtain a trained target detection model;

[0041] The image detection unit is used to perform target detection on aerial images using the trained target detection model.

[0042] In a third aspect, the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store computer program code and transmit the computer program code to the processor;

[0043] The processor is used to execute the above-mentioned aerial image target detection method according to the instructions in the computer program code.

[0044] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and the computer program, when executed by a processor, implements the above-mentioned aerial image target detection method.

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

[0046] 1. In an aerial image target detection method of the present invention, the feature extraction network of the target detection model based on the yolov5 architecture is improved, and the Bottleneck CSP module in the original feature extraction network is replaced by the C2f module. At the same time, in order to prevent the loss of high-level semantic information in the feature fusion process, the improved feature extraction network retains the residual structure of the Bottleneck in the original feature extraction network. This structure calculates the average value of local high-level features and combines it with the connection features to form a local joint feature. In addition, after replacing the Bottleneck CSP module in the original feature extraction network with the C2f module, more skip-layer connections and additional Split operations are added to improve the feature extraction ability of the network. The improved feature extraction network not only retains the semantic information of high-level features, but also enhances the discriminability of features. Therefore, this design improves the feature extraction network of the target detection model. The improved feature extraction network not only retains the semantic information of high-level features, but also enhances the discriminability of features, thereby improving the accuracy of target detection.

[0047] 2. In an aerial image target detection method of the present invention, a simple and homogeneous architecture including a selective state space is used to design a Mamba module, and a Mamba dense aggregation network (MDAN) is designed based on a path aggregation network and a Mamba module as the Neck part of the target detection model. For the Neck part of the target detection model, a Mamba module based on a state space model (SSM) is introduced at different resolution levels. The Mamba dense aggregation network realizes effective information fusion and information screening on feature maps of different scales, thereby improving the performance of small target feature recognition and target detection tasks. At the same time, the Mamba module has the ability of selective replication, which improves the quality of feature representation. Therefore, the Neck part of the target detection model is improved in the present invention, and information irrelevant to the task is screened out by a Mamba module based on a state space model (SSM), while maintaining long-term memory of information related to the task, thereby improving the recognition and detection performance of the target detection model for small targets.

[0048] 3. In an aerial image target detection method of the present invention, a gated adaptive feature fusion detection head (GAFHead) is used. The gated adaptive feature fusion detection head adjusts the features of other scales to the same resolution as the target scale, and then finds the optimal fusion method by training the gated unit. At each spatial position, features of different scales will be adaptively fused according to the learned weight map, and some features carrying contradictory information will be filtered out, while features carrying more discriminative clues will be retained. The gated adaptive feature fusion detection head can filter out more effective feature information and adaptively aggregate features of all levels. Under the action of adaptive feature fusion, the detection head has better performance. Therefore, the detection head is improved in this design. The improved detection head can filter out more effective feature information and adaptively aggregate features of all levels, achieving better detection effect under the action of adaptive feature fusion.

[0049] 4. An aerial image target detection system of the present invention includes: a model building unit, which is used to build an improved Yolov5 target detection model; the improved Yolov5 target detection model includes a feature extraction network, a Mamba dense aggregation network and a gated adaptive feature fusion detection head; a model training unit, which is used to train the improved Yolov5 target detection model to obtain a trained target detection model; an image detection unit, which is used to use the trained target detection model to perform target detection on aerial images. The aerial image target detection system in this design is used to implement the steps of the aerial image target detection method provided in the above technical solution. Therefore, the system also includes all the beneficial effects of the aerial image target detection method provided in the above technical solution, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 The present invention provides a flowchart of an aerial image target detection method.

[0051] Figure 2 It is a flowchart of training a target detection model provided by an embodiment of the present invention.

[0052] Figure 3 It is a structural schematic diagram of a feature extraction network provided by an embodiment of the present invention.

[0053] Figure 4 It is a structural diagram of a Mamba dense aggregation network provided by an embodiment of the present invention.

[0054] Figure 5 It is a structural schematic diagram of a C2f module provided in an embodiment of the present invention.

[0055] Figure 6It is a structural schematic diagram of a Bottleneck residual structure provided by an embodiment of the present invention.

[0056] Figure 7 It is a structural diagram of a gated adaptive feature fusion module provided in an embodiment of the present invention.

[0057] Figure 8 It is a structural schematic diagram of the Mamba module provided by an embodiment of the present invention.

[0058] Fig. 9 The diagram is a schematic diagram of the structure of an aerial image target detection system provided by an embodiment of the present invention.

[0059] Fig.10 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention.

[0060] Fig.11 It is a visualization effect diagram of the Mamba module at each stage provided by the embodiment of the present invention.

[0061] Fig.12 It is a detection effect diagram of aerial image target detection provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0062] 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 creative work are within the scope of protection of the present invention.

[0063] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0064] In the prior art, when performing target detection tasks on aerial images taken by drones, the existing algorithms have poor detection performance when performing aerial image target detection tasks because the detection targets in drone images are small in size, densely distributed, have large scale variations, and are blocked. In order to solve the technical problems existing in the prior art, the embodiments of the present invention provide an aerial image target detection method, see Figure 1 , Figure 1 1 is a flow chart of an aerial image target detection method provided by an embodiment of the present invention, the method comprising steps S1 to S3:

[0065] S1. Build an improved target detection model;

[0066] An improvement is made based on the Yolov target detection model, wherein the improved target detection model includes a feature extraction network, a Mamba dense aggregation network and a gated adaptive feature fusion detection head.

[0067] By improving the feature fusion part (Neck) and the detection head (Head) of the target detection model, an improved target detection model is obtained. The improved target detection model introduces new modules and strategies to improve the detection accuracy and effect of small targets in UAV aerial images.

[0068] In this embodiment, Figure 3 is a structural diagram of a feature extraction network provided by an embodiment of the present invention, such as Figure 3 As shown, the feature extraction network includes a stem module, a first C2f module, a second C2f module, a third C2f module, a fourth C2f module, and an SPPF module; the input end of the stem module is used to receive the aerial image, the output end of the stem module is connected to the input end of the first C2f module, the output end of the first C2f module is connected to the input end of the second C2f module through a downsampling module, the output end of the second C2f module is connected to the input end of the third C2f module through a downsampling module, the output end of the third C2f module is connected to the input end of the fourth C2f module through a downsampling module, the output end of the fourth C2f module is connected to the input end of the SPPF module, and the output end of the SPPF module, the output end of the first C2f module, the output end of the second C2f module, the output end of the third C2f module, and the output end of the fourth C2f module are all connected to the input end of the Mamba dense aggregation network.

[0069] Specifically, after receiving the aerial image, the stem module uses two convolution layers with convolution kernels of 3×3 to downsample the input image to obtain a downsampled image, and outputs the downsampled image.

[0070] The first C2f module is used to extract features from the downsampled image, obtain a first feature image with a resolution of 1 / 4 of the original aerial image, and output the first feature image.

[0071] The second C2f module is connected to the first C2f module through a downsampling module. The scale of the first feature image output by the first C2f module is changed after downsampling. The second C2f module extracts features from the downsampled first feature image to obtain a second feature image with a resolution of 1 / 8 of the original aerial image, and outputs the second feature image.

[0072] The third C2f module is connected to the second C2f module through a downsampling module. The scale of the second feature image output by the second C2f module is changed after downsampling. The third C2f module extracts features from the downsampled second feature image to obtain a third feature image with a resolution of 1 / 16 of the original aerial image, and outputs the third feature image.

[0073] The fourth C2f module is connected to the third C2f module through a downsampling module. The scale of the third feature image output by the third C2f module is changed after downsampling. The fourth C2f module performs feature extraction on the downsampled third feature image to obtain a fourth feature image with a resolution of 1 / 32 of the original aerial image, and outputs the fourth feature image.

[0074] The SPPF module is used to fuse the local features and global features of the fourth feature image to obtain the fifth feature image, and output the fifth feature image. SPPF stands for Spatial Pyramid Pooling-Fast. The SPPF module can fuse the features of the same feature map at different scales. Through the concat splicing operation, the feature maps of multiple dimensions after 3 pooling operations and before pooling are fused to enrich the semantic features of the feature map. By fusing features of different scales, the SPPF module can provide richer contextual information, which helps to improve the accuracy of target detection. Aggregating features at multiple scales can enable the model to better cope with targets of different sizes and effectively improve the detection accuracy of the model for small targets.

[0075] In this embodiment, the feature extraction network performs four consecutive feature mapping stages, which extract feature images of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 resolution sizes respectively. After inputting the original image, the feature extraction network will continuously use two convolution layers with a convolution kernel of 3×3 for the first downsampling to reduce the subsequent calculation cost, and then sequentially perform feature processing through four processing levels. The structure of each processing level includes a C2f module and a convolution downsampling layer with a convolution kernel of 3×3. Finally, the feature extraction network will output the calculation results of the four levels for subsequent processing.

[0076] In this embodiment, Figure 4 is a schematic diagram of a structure of a Mamba dense aggregation network provided by an embodiment of the present invention, such as Figure 4As shown, the Mamba dense aggregation network includes: a fifth C2f module, a sixth C2f module, a seventh C2f module, an eighth C2f module, a ninth C2f module, a tenth C2f module, an eleventh C2f module, a twelfth C2f module, a thirteenth C2f module, a first Mamba module, a second Mamba module, a third Mamba module, a fourth Mamba module, a first Concat module, a second Concat module, a third Concat module, a first adder, a second adder, a third adder, a fourth adder, a fifth adder, a sixth adder, and a seventh adder. The two input ends of the first adder are respectively connected to the output end of the fourth C2f module and the output end of the SPPF module, the output end of the first adder is connected to the input end of the fifth C2f module, the output end of the fifth C2f module is connected to the input end of the first Mamba module, the output end of the first Mamba module is connected to the input end of the sixth C2f module, the output end of the sixth C2f module is connected to an input end of the third Concat module, the output end of the third Concat module is connected to the input end of the gated adaptive feature fusion detection head and the input end of the thirteenth C2f module, and the output end of the thirteenth C2f module is connected to an input end of the first Concat module;

[0077] The input end of the seventh C2f module is connected to the output end of the second adder, one input end of the second adder is connected to the output end of the third C2f module, another input end of the second adder is connected to the output end of the fifth C2f module through the upsampling module, another input end of the second adder is connected to the output end of the first Mamba module through the upsampling module, the output end of the seventh C2f module is connected to an input end of the second Mamba module, another input end of the second Mamba module is connected to the output end of the third adder, one input end of the third adder is connected to the output end of the first Mamba module through the upsampling module, another input end of the third adder is connected to the output end of the sixth C2f module through the upsampling module, the output end of the second Mamba module is connected to the input end of the eighth C2f module, the output end of the eighth C2f module is connected to an input end of the second Concat module, and the output end of the second Concat module is connected to the input end of the gated adaptive feature fusion detection head and the other input end of the third Concat module;

[0078] The input end of the ninth C2f module is connected to the output end of the fourth adder, one input end of the fourth adder is connected to the output end of the second C2f module, another input end of the fourth adder is connected to the output end of the seventh C2f module through the upsampling module, another input end of the fourth adder is connected to the output end of the second Mamba module through the upsampling module, the output end of the ninth C2f module is connected to an input end of the third Mamba module, another input end of the third Mamba module is connected to the output end of the fifth adder, one input end of the fifth adder is connected to the output end of the second Mamba module through the upsampling module, another input end of the fifth adder is connected to the output end of the eighth C2f module through the upsampling module, the output end of the third Mamba module is connected to the input end of the tenth C2f module, the output end of the tenth C2f module is connected to another input end of the first Concat module, and the output end of the first Concat module is connected to the input end of the gated adaptive feature fusion detection head and another input end of the second Concat module;

[0079] The input end of the eleventh C2f module is connected to the output end of the sixth adder, one input end of the sixth adder is connected to the output end of the first C2f module, another input end of the sixth adder is connected to the output end of the ninth C2f module through the upsampling module, another input end of the sixth adder is connected to the output end of the third Mamba module through the upsampling module, the output end of the eleventh C2f module is connected to an input end of the fourth Mamba module, another input end of the fourth Mamba module is connected to the output end of the seventh adder, one input end of the seventh adder is connected to the output end of the third Mamba module through the upsampling module, another input end of the seventh adder is connected to the output end of the tenth C2f module through the upsampling module, the output end of the fourth Mamba module is connected to the input end of the twelfth C2f module, and the output end of the twelfth C2f module is connected to another input end of the first Concat module.

[0080] The adders are used to perform principal element addition processing on the input feature images. The C2f modules are used to receive feature images, fuse the received feature images once, and extract features based on convolution. The Mamba modules are used to fuse the received feature images once, and extract features based on the state space model (SSM).

[0081] Specifically, the first adder receives the fourth feature image and the fifth feature image and performs element addition processing on them, and outputs the processing result to the fifth C2f module, the fifth C2f module performs a feature extraction on the received feature map, obtains and outputs the first intermediate feature map; the first Mamba module receives the first intermediate feature map, extracts features from the first intermediate feature map based on the state space model, and obtains the second intermediate feature map; the sixth C2f module receives the second intermediate feature map and extracts features from the second intermediate feature map based on the space state model, and obtains the third intermediate feature map. The fifth C2f module, the first Mamba module, and the sixth C2f module connected in sequence form a branch structure for fusing feature maps with a resolution of 1 / 32 of the input image.

[0082] The second adder receives the first intermediate feature map after upsampling processing and the second intermediate feature map after upsampling processing, performs element-wise summing and outputs the first intermediate feature map after upsampling processing, the second intermediate feature map after upsampling processing and the three feature images, the seventh C2f module receives the output of the second adder, performs feature extraction on it, and obtains the fourth intermediate feature map; the third adder is used to receive the second intermediate feature map after upsampling processing and the third intermediate feature map after upsampling processing, performs element-wise summing and outputs the second intermediate feature map after upsampling processing and the third intermediate feature map after upsampling processing, the second Mamba module fuses the fourth intermediate feature map and the feature map output by the third adder, and performs feature extraction based on the state space model to obtain the fifth intermediate feature map; the eighth C2f module receives the fifth intermediate feature map, performs feature extraction on the fifth intermediate feature map based on convolution, and obtains the sixth intermediate feature map. The seventh C2f module, the second Mamba module, and the eighth C2f module connected in sequence form a branch structure for fusing feature maps with a resolution of 1 / 16 of the input image.

[0083] The fourth adder is used to receive the second feature image, the fourth intermediate feature map after upsampling, and the fifth intermediate feature map after upsampling, and perform element-wise addition and output on the second feature image, the fourth intermediate feature map after upsampling, and the fifth intermediate feature map after upsampling. The ninth C2f module receives the feature map output by the fourth adder, and performs feature extraction on it to obtain the seventh intermediate feature map; the fifth adder receives the fifth intermediate feature map after upsampling, and the sixth intermediate feature map after upsampling, and performs element-wise addition and output on the fifth intermediate feature map after upsampling, and the sixth intermediate feature map after upsampling. The third Mamba module fuses the seventh intermediate feature map and the feature map output by the fifth adder, and performs feature extraction based on the state space model to obtain the eighth intermediate feature map; the tenth C2f module receives the eighth intermediate feature map, and performs feature extraction on the eighth intermediate feature map based on convolution to obtain the ninth intermediate feature map. The ninth C2f module, the third Mamba module, and the tenth C2f module connected in sequence form a branch structure for fusing feature maps with a resolution size of 1 / 8 of the input image.

[0084] The sixth adder receives the second feature image, the seventh intermediate feature map after upsampling, and the eighth intermediate feature map after upsampling, and performs element-wise summing and outputting on the second feature image, the eleventh C2f module, the seventh intermediate feature map after upsampling, and the eighth intermediate feature map after upsampling; the eleventh C2f module receives the feature map output by the sixth adder and performs feature extraction on it to obtain the tenth intermediate feature map; the seventh adder receives the eighth intermediate feature map after upsampling and the ninth intermediate feature map after upsampling, performs element-wise summing and outputting on the eighth intermediate feature map after upsampling and the ninth intermediate feature map after upsampling; the fourth Mamba module fuses the tenth intermediate feature map and the feature map output by the seventh adder and performs feature extraction based on the state space model to obtain the eleventh intermediate feature map; the twelfth C2f module is used to receive the eleventh intermediate feature map, perform feature extraction on the eleventh intermediate feature map, and obtain the twelfth intermediate feature map. The eleventh C2f module, the fourth Mamba module, and the twelfth C2f module connected in sequence form a branch structure for fusing feature maps with a resolution size of 1 / 4 of the input image.

[0085] The first Concat module is used to receive the ninth intermediate feature map, the twelfth intermediate feature map, and the thirteenth intermediate feature map, and splice the ninth intermediate feature map, the twelfth intermediate feature map, and the thirteenth intermediate feature map to obtain a first fused feature map with a resolution of 1 / 8 of the input image, wherein the thirteenth intermediate feature map is the output of the thirteenth C2f module; the second Concat module is used to receive the sixth intermediate feature map and the first fused feature map, and splice the sixth intermediate feature map and the first fused feature map to obtain a second fused feature map with a resolution of 1 / 16 of the input image; the third Concat module is used to receive the third intermediate feature map and the second fused feature map, and splice the third intermediate feature map and the second fused feature map to obtain a third fused feature map with a resolution of 1 / 32 of the input image; the thirteenth C2f module receives the third fused feature map, performs feature extraction on the third fused feature map, and obtains and outputs the thirteenth intermediate feature map.

[0086] In this embodiment, the Mamba Dense Aggregation Network (MDAN) is a deep neural network architecture for image feature extraction and fusion. The design concept of the Mamba Dense Aggregation Network is to achieve effective information fusion and information screening on feature maps of different scales, thereby improving the performance of small target feature recognition and target detection tasks. Fig.11 is a visualization effect diagram of the Mamba module at each stage provided by the embodiment of the present invention, such as Fig.11 As shown in Figure 1, in the Mamba dense aggregation network, the feature processing process involves multiple levels of feature maps, each level corresponding to feature maps of different resolutions.

[0087] The Mamba dense aggregation network adopts a dense feature fusion strategy similar to BiFPN, and further optimizes it to achieve more dense and multi-scale feature fusion. This strategy fully considers the feature information of different scales, thereby improving the richness and accuracy of feature representation. In addition, more C2f feature processing basic modules are added to the Mamba dense aggregation network to enhance the depth and accuracy of feature extraction.

[0088] In the feature fusion stage, the Mamba dense aggregation network achieves the fusion of feature maps of different scales through upsampling and lateral connections. This strategy effectively combines high-level semantic information and low-level detail information while maintaining spatial resolution. Specifically, the upsampling process uses depthwise separable convolution, which is a computationally efficient form of convolution that helps reduce computational complexity.

[0089] In this embodiment, the Mamba dense aggregation network introduces a Mamba module based on a state space model (SSM), and the Mamba module has the ability to selectively replicate. These modules improve the quality of feature representation by screening and strengthening features. Specifically, the Mamba dense aggregation network includes four branch structures for processing feature maps of different resolution sizes, each branch structure includes two C2f modules and a Mamba module, and the visual Mamba module is embedded between consecutive C2f modules, which helps to promote the efficient flow of effective information and enhance the network's ability to process complex image structures.

[0090] In this embodiment, Figure 8 is a schematic diagram of the structure of the Mamba module provided by an embodiment of the present invention, such as Figure 8 Any Mamba module shown includes a Mamba layer, a Layernorm layer, a 1*1 convolution layer, a GELU activation function layer, and a 1*1 convolution layer connected in sequence. The image input to the Mamba module is subjected to feature extraction based on a state space model (SSM) by the Mamba layer, and then normalized by the Layernorm layer to prevent the model from overfitting. Then, it passes through the first 1*1 convolution layer, the GELU activation function layer, and the second 1*1 convolution layer in sequence to perform further nonlinear transformation and processing on the previously extracted features.

[0091] In this embodiment, the Mamba layer adopts a simplified selectivity mechanism that focuses on or excludes certain specific inputs by "parameterizing the input of the SSM". This mechanism enables the model to filter out information that is not relevant to the task while maintaining long-term memory for information that is relevant to the task.

[0092] In the prior art, Albert Gu, Tri Dao, etc. combined the SSM architecture with the MLP block of the transformer into one block in Mamba: Linear-Time Sequence Modeling with Selective State Spaces, simplifying the previous deep sequence model architecture and forming a simple and homogeneous architecture design Mamba containing a selective state space, namely the Mamba layer in the present invention. The Mamba layer is a combination of the SSM architecture and the MLP block in the transformer. Specifically, the state space model (SSM) is a continuous system model inspired by the classic Kalman filter model. The model uses the hidden state h(t)∈R N Mapping a one-dimensional function or sequence x(t)∈R to y(t)∈R, the system uses the evolution parameter A∈R M×N and projection parameter B∈RN×1 ,C∈R 1×N , the dynamics of the above continuous system is described by the following set of equations:

[0093] h'(t)=Ah(t)+Bx(t)

[0094] y(t)=Ch(t)

[0095] Among them, h'(t) represents the derivative of the hidden state h(t).

[0096] Mamba is a discrete version of the above continuous system. It introduces a time scale parameter Δ to convert continuous parameters A and B into discrete parameters. The conversion usually adopts the Zero-Order Hold (ZOH) method, which is defined as follows:

[0097] A=e ΔA

[0098] B=(e ΔA -1)ΔBA -1

[0099] The discretized system can be described in the form of step size:

[0100] h t =Ah t-1 +Bx t

[0101] y t =Ch t

[0102] Finally, Mamba calculates the output through global convolution:

[0103] K=(CB,CAB,...CA M-1 B)

[0104] y=x*K

[0105] Where M is the length of the input sequence x, K∈R M is a structured convolution kernel.

[0106] The Mamba layer is a visual module based on the advanced state-space model (SSM). For visual tasks, we first transform the two-dimensional image t∈R H×W×C Convert to flattened 2D image blocks Where (H, W) is the size of the input image, C is the number of channels, and P is the size of the image patch. Then, x p Linearly project to a vector of size D and add the position embedding E pos ∈R (J+1)×D , the mathematical representation of this process is as follows:

[0107] T0=[t cls ;t 1pW ;t 2pW ;...t jpW ]+E pos

[0108] Among them, t jpW is the jth image patch of t, is a learnable projection matrix, using class labels t cls To represent the entire image block sequence, then, the token sequence T l-1 Send it to the lth layer of Mamba and get the output T l Finally, the output class is labeled T 0L Normalize it and feed it into the Multi-Layer Perceptron (MLP) head to get the final prediction The mathematical representation of the above process is as follows:

[0109] T l =Mamba(T l-1 )+T l-1

[0110] f=Norm(T 0L )

[0111]

[0112] In the above formula, Mamba represents the Mamba layer, L is the number of layers, and Norm is the normalization layer.

[0113] Finally, the Mamba dense aggregation network outputs a series of image pyramids that fuse multi-scale features. These feature maps are very suitable for various downstream tasks such as object detection, instance segmentation, etc. Through this improved feature processing method, the Mamba dense aggregation network not only improves the efficiency of feature fusion, but also reduces the computational cost, making it an efficient architecture in image recognition and detection tasks.

[0114] In this embodiment, Figure 5 is a schematic diagram of a structure of a C2f module provided in an embodiment of the present invention, such as Figure 5As shown, the first C2f module includes a Conv1*1 convolution layer, a slipt structure, a plurality of Bottleneck residual structures, a Concat structure, and a Conv1*1 convolution layer connected in sequence, wherein the slipt structure is used to divide the input image into two parts, a first split feature map and a second split feature map, in the channel dimension, and the plurality of the Bottleneck residual structures are used to perform a residual connection operation on the first split feature map, and the Concat structure is used to perform a splicing operation on the second split feature map and the feature maps output by the plurality of the Bottleneck residual structures. The Concat structure performs a splicing operation on the input feature image in the channel dimension.

[0115] Figure 6 is a schematic diagram of a structure of a Bottleneck residual structure provided in an embodiment of the present invention, such as Figure 6 As shown, the Bottleneck residual structure includes a Conv1*1 convolutional layer, a Conv3*3 convolutional layer and an adder connected in sequence, wherein one input end of the adder shares the input with the Conv1*1 convolutional layer, and the other input end of the adder is connected to the output end of the Conv3*3 convolutional layer.

[0116] The structures of the second to thirteenth C2f modules are the same as that of the first C2f module.

[0117] In order to prevent the loss of high-level semantic information during the feature fusion process, the residual structure in Bottleneck is retained in the C2f module. This structure forms a local joint feature by calculating the average of local high-level features and combining them with the connection features. This method not only retains the semantic information of high-level features, but also enhances the discriminability of features and improves the detection performance of the target detection model.

[0118] In this embodiment, the gated adaptive feature fusion detection head includes three gated adaptive feature fusion modules and a detection head module. The gated adaptive feature fusion module receives a first fusion feature map, a second fusion feature map, a third fusion feature map, and a detection head module. Figure 3 The detection head module outputs the detection result according to the feature information aggregated by the gated adaptive feature fusion module.

[0119] Specifically, the gated adaptive feature fusion detection head includes a first gated adaptive feature fusion module, a second gated adaptive feature fusion module, a third gated adaptive feature fusion module, and a detection head module.

[0120] Figure 7 is a schematic diagram of a structure of a gated adaptive feature fusion module provided in an embodiment of the present invention, such as Figure 7 As shown, the first gated adaptive feature fusion module includes a first linear layer, a second linear layer, a third linear layer, a 1*1 convolution layer, a sigmoid activation function layer, a fourth linear layer, a fifth linear layer, a first multiplier, a second multiplier, an eighth adder, and a ninth adder. The output of the first linear layer is connected to one input of the first multiplier and one input of the second multiplier through the 1*1 convolution layer and the sigmoid activation function layer, respectively. The other input of the first multiplier is connected to the output of the second linear layer, and the other input of the second multiplier is connected to the output of the third linear layer. The output of the first multiplier and the output of the second multiplier are respectively connected to two inputs of the eighth adder. The output of the first adder is connected to one input of the ninth adder through the fourth linear layer, and the other input of the second adder shares the input with the first linear layer. The output of the ninth adder is connected to the input of the fifth linear layer. The first multiplier and the second multiplier are used to perform element-by-element multiplication of the input feature image.

[0121] The structures of the second gated adaptive feature fusion module and the third gated adaptive feature fusion module are the same as the first gated adaptive feature fusion module.

[0122] The input end of the first Linear layer in the first gated adaptive feature fusion module is connected to the output end of the first Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the first gated adaptive feature fusion module are connected to the output ends of the second Concat module and the third Concat module respectively;

[0123] The input end of the first Linear layer in the second gated adaptive feature fusion module is connected to the output end of the second Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the second gated adaptive feature fusion module are connected to the output ends of the first Concat module and the third Concat module respectively;

[0124] The input end of the first Linear layer in the third gated adaptive feature fusion module is connected to the output end of the third Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the third gated adaptive feature fusion module are connected to the output ends of the first Concat module and the second Concat module respectively;

[0125] The output ends of the three fifth Linear layers in the first gated adaptive feature fusion module, the second gated adaptive feature fusion module, and the third gated adaptive feature fusion module are all connected to the input end of the detection head module.

[0126] Linear layer is an important component in the PyTorch framework. It is mainly used to implement linear transformations in neural networks. It is also called a fully connected layer or a dense layer. It receives an input tensor and outputs a tensor through a linear transformation (i.e., an affine transformation). This linear transformation includes the role of weight matrices and bias vectors. These parameters are randomly generated during initialization and are continuously updated during training. In the first gated adaptive feature fusion module, the first Linear layer, the second Linear layer, and the third Linear layer are used to convert the number of channels so that the number of channels of the input feature map remains uniform; at the same time, these Linear layers also have the functions of linear transformation and feature mapping, making the model more robust. The fourth and fifth Linear layers are used for feature fusion operations after feature addition to achieve interaction and information fusion between different channels.

[0127] The core idea of ​​the Gated Adaptive Feature Fusion Detection Head (GAFHead) is to adaptively learn to fuse features of other scales at each scale. Specifically, GAFHead first adjusts the features of other scales to the same resolution as the target scale, and then finds the optimal fusion method by training the gated unit. At each spatial position, features of different scales are adaptively fused according to the learned weight map. Some features carrying contradictory information will be filtered out, while features carrying more discriminative clues will be retained. The Gated Adaptive Feature Fusion Detection Head conveniently learns the optimal fusion operation through back-propagation. It is simple to implement and the added computational cost is very small. The implementation of the gated adaptive feature fusion detection head includes feature resampling and adaptive fusion. In feature resampling, a 1×1 convolutional layer and interpolation method are used to adjust the number of channels and resolution of features of different scales. In adaptive fusion, a 1×1 convolutional layer is used to calculate the spatial weight scalar map, and the input of the current scale is calculated and reprojected using sigmoid, and then multiplied point by point with other scales to obtain similar features. The final results are added and superimposed with the residual value of the original input.

[0128] The gated adaptive feature fusion detection head is a detection head for a single-stage detector. It is used to solve the problem of feature fusion and feature screening at different scales in the feature pyramid. The gated adaptive feature fusion detection head learns how to filter conflicting information spatially to screen consistent features between different feature scales, thereby improving the scale invariance of the features.

[0129] S2. Training the improved Yolov5 target detection model to obtain a trained target detection model.

[0130] Specifically, Figure 2 is a flow chart of training a target detection model provided by an embodiment of the present invention, such as Figure 2 As shown, training the improved Yolov5 target detection model includes steps S201 to S203:

[0131] S201. Train the improved Yolov5 target detection model using a training data set to obtain a first target detection model.

[0132] S202, evaluating the performance of the first object detection model using a test data set and a validation data set to obtain an evaluation index of the first object detection model;

[0133] The evaluation indicators include: accuracy, recall rate, F1 score, and average precision value.

[0134] Among them, accuracy (Precision): Accuracy refers to the proportion of samples that are actually positive among all samples predicted by the system as positive. It measures the accuracy of the model when predicting the positive class. Mathematically, accuracy can be calculated by the following formula: Precision = TP / (TP+FP), where TP represents true positive and FP represents false positive.

[0135] Recall: Recall refers to the proportion of samples that are correctly predicted as positive among all samples that are actually positive. It measures the model's ability to find all positive examples. Mathematically, recall can be calculated by the following formula: Recall = TP (TP + FN). FN stands for false negative.

[0136] F1 Score: The F1 score is the harmonic mean of the precision and recall, which is used to comprehensively reflect the accuracy and robustness of the model. A higher F1 score means that both the precision and recall are high. Mathematically, the F1 score can be calculated by the following formula: F1 Score = 2×(Precision×Recall) / (Precision+Recall).

[0137] Average precision (AP): To calculate the average precision AP, you need to first calculate the corresponding precision and recall based on different thresholds. Then, draw the precision-recall curve. Finally, calculate the area under the precision-recall curve to get the average precision.

[0138] S203, adjusting the hyperparameters of the first target detection model according to the evaluation index to obtain a trained target detection model;

[0139] The training data set, the test data set, and the validation data set all contain multiple aerial images, and the target category and target position are marked in each of the aerial images.

[0140] According to the values ​​of accuracy, recall, F1 score, and average precision, the performance of the trained model can be evaluated. According to the values ​​of accuracy, recall, F1 score, and average precision, the hyperparameters of the model can be gradually adjusted until the performance of the model reaches the best.

[0141] S3, use the trained target detection model to perform real-time detection on aerial images, such as Fig.12 As shown, Fig.12 1 is a detection effect diagram of an aerial image target detection provided by an embodiment of the present invention, wherein the aerial image is a ground image taken by an aircraft such as a drone.

[0142] In order to verify the performance of the improved Yolov5 target detection model, as shown in Table 1, Table 1 is a performance data comparison table of the improved Yolov5 target detection model in this embodiment of other mainstream real-time target detectors.

[0143]

[0144]

[0145] Table 1

[0146] In order to verify the performance of the feature extraction network, Mamba dense aggregation network, and gated adaptive feature fusion detection head in the detection model, we conducted a gradually improved ablation experiment based on the original Yolov5 target detection model. The experimental results are shown in Table 2 below:

[0147]

[0148] Table 2

[0149] It can be seen from the experimental data that compared with other existing mainstream real-time target detectors, the improved target detection model proposed in the present invention has better comprehensive performance.

[0150] In summary, an embodiment of the present invention provides an aerial image target detection method, the method comprising: constructing an improved target detection model; the improved target detection model comprises a feature extraction network, a Mamba dense aggregation network and a gated adaptive feature fusion detection head; training the improved target detection model to obtain a trained target detection model; using the trained target detection model to perform target detection on aerial images. The present invention is improved based on Yolov5, and uses the Mamba dense aggregation network as the Neck part of the model, so that the target detection model has richer feature connections and fusions, and improves the detection performance of small and dense targets in aerial images. Compared with the original Yolov5 model, the overall performance of the aerial image target detection method provided by the embodiment of the present invention in the small target detection data set is significantly better than the original Yolov5 detection model.

[0151] By adopting the embodiments of the present invention, the accuracy of target detection in aerial images taken by unmanned aerial vehicles can be effectively improved.

[0152] According to the method described in the above embodiment, this embodiment will be further described from the perspective of an aerial image target detection system. Specifically, Fig. 9 As shown, Fig. 9 : is a structural schematic diagram of an aerial image target detection system provided by an embodiment of the present invention, the system comprising:

[0153] A model building unit, used to build an improved target detection model; the improved target detection model includes a feature extraction network, a Mamba dense aggregation network and a gated adaptive feature fusion detection head;

[0154] The feature extraction network includes a stem module, a first C2f module, a second C2f module, a third C2f module, a fourth C2f module, and an SPPF module; the input end of the stem module is used to receive the aerial image, the output end of the stem module is connected to the input end of the first C2f module, the output end of the first C2f module is connected to the input end of the second C2f module through a downsampling module, the output end of the second C2f module is connected to the input end of the third C2f module through a downsampling module, the output end of the third C2f module is connected to the input end of the fourth C2f module through a downsampling module, the output end of the fourth C2f module is connected to the input end of the SPPF module, and the output end of the SPPF module, the output end of the first C2f module, the output end of the second C2f module, the output end of the third C2f module, and the output end of the fourth C2f module are all connected to the input end of the Mamba dense aggregation network.

[0155] The Mamba dense aggregation network includes: a fifth C2f module, a sixth C2f module, a seventh C2f module, an eighth C2f module, a ninth C2f module, a tenth C2f module, an eleventh C2f module, a twelfth C2f module, a thirteenth C2f module, a first Mamba module, a second Mamba module, a third Mamba module, a fourth Mamba module, a first Concat module, a second Concat module, a third Concat module, a first adder, a second adder, a third adder, a fourth adder, a fifth adder, a sixth adder, a third Seven adders; two input ends of the first adder are respectively connected to the output end of the fourth C2f module and the output end of the SPPF module, the output end of the first adder is connected to the input end of the fifth C2f module, the output end of the fifth C2f module is connected to the input end of the first Mamba module, the output end of the first Mamba module is connected to the input end of the sixth C2f module, the output end of the sixth C2f module is connected to an input end of the third Concat module, the output end of the third Concat module is connected to the input end of the gated adaptive feature fusion detection head, the input end of the thirteenth C2f module The output end of the thirteenth C2f module is connected to an input end of the first Concat module; the input end of the seventh C2f module is connected to the output end of the second adder, one input end of the second adder is connected to the output end of the third C2f module, another input end of the second adder is connected to the output end of the fifth C2f module through the upsampling module, another input end of the second adder is connected to the output end of the first Mamba module through the upsampling module, the output end of the seventh C2f module is connected to an input end of the second Mamba module, another input end of the second Mamba module is connected to the output end of the third adder, one input end of the third adder is connected to the output end of the first Mamba module through the upsampling module, another input end of the third adder is connected to the output end of the sixth C2f module through the upsampling module, the output end of the second Mamba module is connected to the input end of the eighth C2f module, the output end of the eighth C2f module is connected to an input end of the second Concat module, and the output end of the second Concat module is connected to the input end of the gated adaptive feature fusion detection head and the other input end of the third Concat module;The input end of the ninth C2f module is connected to the output end of the fourth adder, one input end of the fourth adder is connected to the output end of the second C2f module, another input end of the fourth adder is connected to the output end of the seventh C2f module through the upsampling module, another input end of the fourth adder is connected to the output end of the second Mamba module through the upsampling module, the output end of the ninth C2f module is connected to an input end of the third Mamba module, another input end of the third Mamba module is connected to the output end of the fifth adder, one input end of the fifth adder is connected to the output end of the second Mamba module through the upsampling module, another input end of the fifth adder is connected to the output end of the eighth C2f module through the upsampling module, the output end of the third Mamba module is connected to the input end of the tenth C2f module, the output end of the tenth C2f module is connected to another input end of the first Concat module, and the output end of the first Concat module is connected to the gated adaptive feature fusion detection head. The input end of the eleventh C2f module is connected to the output end of the sixth adder, one input end of the sixth adder is connected to the output end of the first C2f module, another input end of the sixth adder is connected to the output end of the ninth C2f module through the upsampling module, another input end of the sixth adder is connected to the output end of the third Mamba module through the upsampling module, the output end of the eleventh C2f module is connected to one input end of the fourth Mamba module, another input end of the fourth Mamba module is connected to the output end of the seventh adder, one input end of the seventh adder is connected to the output end of the third Mamba module through the upsampling module, another input end of the seventh adder is connected to the output end of the tenth C2f module through the upsampling module, the output end of the fourth Mamba module is connected to the input end of the twelfth C2f module, and the output end of the twelfth C2f module is connected to another input end of the first Concat module. ;

[0156] Among them, the first C2f module includes a slipt structure, multiple Bottleneck residual structures and a Concat structure connected in sequence, the slipt structure is used to divide the input image into two parts, a first split feature map and a second split feature map in the channel dimension, the multiple Bottleneck residual structures are used to perform a residual connection operation on the first split feature map, and the Concat structure is used to splice the second split feature map and the feature maps output by the multiple Bottleneck residual structures; the structures of the second to thirteenth C2f modules are the same as the first C2f module.

[0157] The gated adaptive feature fusion detection head includes a first gated adaptive feature fusion module, a second gated adaptive feature fusion module, a third gated adaptive feature fusion module, and a detection head module.

[0158] The first gated adaptive feature fusion module includes a first linear layer, a second linear layer, a third linear layer, a 1*1 convolution layer, a sigmoid activation function layer, a fourth linear layer, a fifth linear layer, a first multiplier, a second multiplier, an eighth adder, and a ninth adder. The output end of the first linear layer is connected to an input end of the first multiplier and an input end of the second multiplier through the 1*1 convolution layer and the sigmoid activation function layer in sequence. The other input end of the first multiplier is connected to the output end of the second linear layer, and the other input end of the second multiplier is connected to the output end of the third linear layer. The output end of the first multiplier and the output end of the second multiplier are respectively connected to two input ends of the eighth adder. The output end of the first adder is connected to an input end of the ninth adder through the fourth linear layer. The other input end of the second adder shares an input with the first linear layer, and the output end of the ninth adder is connected to the input end of the fifth linear layer.

[0159] The structures of the second gated adaptive feature fusion module and the third gated adaptive feature fusion module are the same as those of the first gated adaptive feature fusion module; the input end of the first Linear layer in the first gated adaptive feature fusion module is connected to the output end of the first Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the first gated adaptive feature fusion module are respectively connected to the output ends of the second Concat module and the third Concat module; the input end of the first Linear layer in the second gated adaptive feature fusion module is connected to the output end of the second Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the second gated adaptive feature fusion module are respectively connected to the output ends of the first Concat module and the third Concat module; the input end of the first Linear layer in the third gated adaptive feature fusion module is connected to the output end of the third Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the third gated adaptive feature fusion module are respectively connected to the output ends of the first Concat module and the second Concat module; the output ends of the three fifth Linear layers in the first gated adaptive feature fusion module, the second gated adaptive feature fusion module, and the third gated adaptive feature fusion module are all connected to the input end of the detection head module.

[0160] The model training unit is used to train the improved target detection model to obtain a trained target detection model.

[0161] Training the improved target detection model includes the following steps:

[0162] S201, training the improved target detection model using a training data set to obtain a first target detection model;

[0163] S202, evaluating the performance of the first object detection model using a test data set and a validation data set to obtain an evaluation index of the first object detection model;

[0164] The evaluation indicators include: accuracy, recall, F1 score, and average precision value;

[0165] S203, adjusting the hyperparameters of the first target detection model according to the evaluation index to obtain a trained target detection model;

[0166] The training data set, the test data set, and the validation data set all contain multiple aerial images, and the target category and target position are marked in each of the aerial images.

[0167] The image detection unit is used to perform target detection on aerial images using the trained target detection model.

[0168] in addition, Fig.10 Schematic diagram of a structure of an electronic device provided by an embodiment of the present invention. Fig.10 As shown, an embodiment of the present invention further provides an electronic device for aerial image target detection, the electronic device comprising a memory and a processor, the memory being used to store computer program code and transmit the computer program code to the processor, the processor being configured to run a computer program to execute the steps in any one of the above method embodiments.

[0169] In some embodiments, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0170] An embodiment of the present invention further provides a computer-readable storage medium, in which a plurality of instructions are stored, and when the instructions are executed by a processor, any step in the above-mentioned aerial image target detection method can be implemented.

[0171] In this embodiment, the above-mentioned computer-readable storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

Claims

1. A method for detecting targets in aerial images, characterized in that: The target detection method comprises: S1. Build an improved target detection model; The improved target detection model includes a feature extraction network, a Mamba dense aggregation network and a gated adaptive feature fusion detection head; S2. Training the improved target detection model to obtain a trained target detection model; S3. Use the trained target detection model to perform target detection on aerial images.

2. The method for detecting an aerial image target according to claim 1, characterized in that: In step S2, training the improved target detection model using a training data set includes the following steps: S201, training the improved target detection model using a training data set to obtain a first target detection model; S202, evaluating the performance of the first object detection model using a test data set and a validation data set to obtain an evaluation index of the first object detection model; The evaluation indicators include: accuracy, recall, F1 score, and average precision value; S203, adjusting the hyperparameters of the first target detection model according to the evaluation index to obtain a trained target detection model; The training data set, the test data set, and the validation data set all contain multiple aerial images, and the target category and target position are marked in each of the aerial images.

3. The method for detecting an aerial image target according to claim 1, characterized in that: The feature extraction network includes a stem module, a first C2f module, a second C2f module, a third C2f module, a fourth C2f module, and an SPPF module; The input end of the stem module is used to receive the aerial image, the output end of the stem module is connected to the input end of the first C2f module, the output end of the first C2f module is connected to the input end of the second C2f module through a downsampling module, the output end of the second C2f module is connected to the input end of the third C2f module through a downsampling module, the output end of the third C2f module is connected to the input end of the fourth C2f module through a downsampling module, the output end of the fourth C2f module is connected to the input end of the SPPF module, and the output end of the SPPF module, the output end of the first C2f module, the output end of the second C2f module, the output end of the third C2f module, and the output end of the fourth C2f module are all connected to the input end of the Mamba dense aggregation network.

4. The method for detecting an aerial image target according to claim 3, characterized in that: The Mamba dense aggregation network includes: a fifth C2f module, a sixth C2f module, a seventh C2f module, an eighth C2f module, a ninth C2f module, a tenth C2f module, an eleventh C2f module, a twelfth C2f module, a thirteenth C2f module, a first Mamba module, a second Mamba module, a third Mamba module, a fourth Mamba module, a first Concat module, a second Concat module, a third Concat module, a first adder, a second adder, a third adder, a fourth adder, a fifth adder, a sixth adder, and a seventh adder; The two input ends of the first adder are respectively connected to the output end of the fourth C2f module and the output end of the SPPF module, the output end of the first adder is connected to the input end of the fifth C2f module, the output end of the fifth C2f module is connected to the input end of the first Mamba module, the output end of the first Mamba module is connected to the input end of the sixth C2f module, the output end of the sixth C2f module is connected to an input end of the third Concat module, the output end of the third Concat module is connected to the input end of the gated adaptive feature fusion detection head and the input end of the thirteenth C2f module, and the output end of the thirteenth C2f module is connected to an input end of the first Concat module; The input end of the seventh C2f module is connected to the output end of the second adder, one input end of the second adder is connected to the output end of the third C2f module, another input end of the second adder is connected to the output end of the fifth C2f module through the upsampling module, another input end of the second adder is connected to the output end of the first Mamba module through the upsampling module, the output end of the seventh C2f module is connected to an input end of the second Mamba module, another input end of the second Mamba module is connected to the output end of the third adder, one input end of the third adder is connected to the output end of the first Mamba module through the upsampling module, another input end of the third adder is connected to the output end of the sixth C2f module through the upsampling module, the output end of the second Mamba module is connected to the input end of the eighth C2f module, the output end of the eighth C2f module is connected to an input end of the second Concat module, and the output end of the second Concat module is connected to the input end of the gated adaptive feature fusion detection head and the other input end of the third Concat module; The input end of the ninth C2f module is connected to the output end of the fourth adder, one input end of the fourth adder is connected to the output end of the second C2f module, another input end of the fourth adder is connected to the output end of the seventh C2f module through the upsampling module, another input end of the fourth adder is connected to the output end of the second Mamba module through the upsampling module, the output end of the ninth C2f module is connected to an input end of the third Mamba module, another input end of the third Mamba module is connected to the output end of the fifth adder, one input end of the fifth adder is connected to the output end of the second Mamba module through the upsampling module, another input end of the fifth adder is connected to the output end of the eighth C2f module through the upsampling module, the output end of the third Mamba module is connected to the input end of the tenth C2f module, the output end of the tenth C2f module is connected to another input end of the first Concat module, and the output end of the first Concat module is connected to the input end of the gated adaptive feature fusion detection head and another input end of the second Concat module; The input end of the eleventh C2f module is connected to the output end of the sixth adder, one input end of the sixth adder is connected to the output end of the first C2f module, another input end of the sixth adder is connected to the output end of the ninth C2f module through the upsampling module, another input end of the sixth adder is connected to the output end of the third Mamba module through the upsampling module, the output end of the eleventh C2f module is connected to an input end of the fourth Mamba module, another input end of the fourth Mamba module is connected to the output end of the seventh adder, one input end of the seventh adder is connected to the output end of the third Mamba module through the upsampling module, another input end of the seventh adder is connected to the output end of the tenth C2f module through the upsampling module, the output end of the fourth Mamba module is connected to the input end of the twelfth C2f module, and the output end of the twelfth C2f module is connected to another input end of the first Concat module.

5. The method for detecting an aerial image target according to claim 4, characterized in that: The first C2f module includes a slipt structure, a plurality of Bottleneck residual structures and a Concat structure connected in sequence, wherein the slipt structure is used to divide the input image into two parts, namely, a first split feature map and a second split feature map in the channel dimension, the plurality of Bottleneck residual structures are used to perform a residual connection operation on the first split feature map, and the Concat structure is used to perform splicing processing on the second split feature map and the feature maps output by the plurality of Bottleneck residual structures; The structures of the second to thirteenth C2f modules are the same as that of the first C2f module.

6. The method for detecting an aerial image target according to claim 4, characterized in that: The gated adaptive feature fusion detection head includes a first gated adaptive feature fusion module, a second gated adaptive feature fusion module, a third gated adaptive feature fusion module, and a detection head module. The first gated adaptive feature fusion module includes a first linear layer, a second linear layer, a third linear layer, a convolutional layer, a sigmoid activation function layer, a fourth linear layer, a fifth linear layer, a first multiplier, a second multiplier, an eighth adder, and a ninth adder. The output end of the first linear layer is connected to an input end of the first multiplier and an input end of the second multiplier through the convolutional layer and the sigmoid activation function layer in sequence. The other input end of the first multiplier is connected to the output end of the second linear layer, and the other input end of the second multiplier is connected to the output end of the third linear layer. The output end of the first multiplier and the output end of the second multiplier are respectively connected to two input ends of the eighth adder. The output end of the first adder is connected to an input end of the ninth adder through the fourth linear layer. The other input end of the second adder shares an input with the first linear layer, and the output end of the ninth adder is connected to the input end of the fifth linear layer. The structures of the second gated adaptive feature fusion module and the third gated adaptive feature fusion module are the same as the first gated adaptive feature fusion module; The input end of the first Linear layer in the first gated adaptive feature fusion module is connected to the output end of the first Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the first gated adaptive feature fusion module are connected to the output ends of the second Concat module and the third Concat module respectively; The input end of the first Linear layer in the second gated adaptive feature fusion module is connected to the output end of the second Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the second gated adaptive feature fusion module are connected to the output ends of the first Concat module and the third Concat module respectively; The input end of the first Linear layer in the third gated adaptive feature fusion module is connected to the output end of the third Concat module, and the input end of the second Linear layer and the input end of the third Linear layer in the third gated adaptive feature fusion module are connected to the output ends of the first Concat module and the second Concat module respectively; The output ends of the three fifth Linear layers in the first gated adaptive feature fusion module, the second gated adaptive feature fusion module, and the third gated adaptive feature fusion module are all connected to the input end of the detection head module.

7. The method for detecting an aerial image target according to claim 4, characterized in that: The first Mamba module includes a Mamba layer, a Layernorm layer, a 1*1 convolution layer, a GELU activation function layer, and a 1*1 convolution layer connected in sequence; The structures of the second to fourth Mamba modules are the same as that of the first Mamba module.

8. An aerial image target detection system, characterized in that: The system comprises: The model building department is used to build an improved object detection model; The improved target detection model includes a feature extraction network, a Mamba dense aggregation network and a gated adaptive feature fusion detection head; A model training unit, used for training the improved target detection model to obtain a trained target detection model; The image detection unit is used to perform target detection on aerial images using the trained target detection model.

9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory is used to store computer program code and transmit the computer program code to the processor; The processor is used to execute the aerial image target detection method according to any one of claims 1 to 7 according to the instructions in the computer program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for detecting targets in aerial images described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Improved infrared small target detection method and system based on visual state space model

    CN119810681A