A YOLOV4 remote sensing target detection method fusing feature transfer and attention mechanism

The YOLOv4 remote sensing target detection method, which integrates feature transfer and attention mechanisms, solves the problems of insufficient detection accuracy and robustness in remote sensing images, achieves effective detection of complex backgrounds and scale changes, and improves the detection effect of small targets.

CN115497005BActive Publication Date: 2026-02-06CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211078264.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-05
Publication Date
2026-02-06
Estimated Expiration
2042-09-05

AI Technical Summary

Technical Problem

Existing remote sensing target detection algorithms suffer from insufficient detection accuracy and robustness when faced with complex backgrounds, scale diversity, unique perspectives, and small targets in remote sensing images. They also struggle to effectively suppress background interference and lack semantic information.

Method used

A YOLOv4 remote sensing target detection method that integrates feature transfer and attention mechanisms is adopted. By enhancing feature extraction and semantic information processing capabilities through Mosaic data augmentation, constructing a parallel attention module and a semantically enhanced PANet, the detection head is optimized by combining the feature transfer module, and training is performed using the CIOU loss function and the cross-entropy loss function.

Benefits of technology

It improves the accuracy and robustness of remote sensing target detection, enhances the ability to detect small targets, effectively suppresses background interference, and improves the model's adaptability to scale changes and its ability to fuse semantic information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115497005B_ABST
    Figure CN115497005B_ABST
Patent Text Reader

Abstract

The application relates to a YOLOV4 remote sensing target detection method fusing feature transfer and an attention mechanism, and comprises the following steps: preprocessing remote sensing image data through a Mosaic data enhancement method; constructing a YOLOV4 remote sensing target detection model fusing feature transfer and an attention mechanism; inputting the remote sensing data into the model for training; acquiring a remote sensing image to be detected, and preprocessing the remote sensing image to a uniform size; inputting the processed remote sensing image into the trained target detection model for detection, and outputting a detection result, that is, a bounding box position of a remote sensing target in the image to be detected and a target category. The application can significantly improve the detection precision under the premise of not obviously increasing the parameter quantity of the model by improving the YOLOV4 and fusing the feature transfer and the attention mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of remote sensing target detection, and specifically relates to a YOLOV4 remote sensing target detection method fusing feature transfer and attention mechanism. BACKGROUND

[0002] Remote sensing target detection plays a huge role in military and civilian fields. For example, in today's high-tech military confrontation, remote sensing target detection technology can obtain battlefield information in time and accurately and capture important strategic facility locations. In the civilian field, remote sensing target detection technology can provide important technical support for environmental monitoring, resource exploration and field rescue. However, compared with natural scene images, remote sensing images have the following specialities, which make remote sensing image target detection a great challenge:

[0003] 1. Scale diversity: aerial remote sensing images can be taken from a height of several hundred meters to nearly ten thousand meters, and ground targets, even the same kind of targets, vary in size, such as ships in a port, which can be as large as several hundred meters or as small as several tens of meters.

[0004] 2. Speciality of view angle: the view angle of aerial remote sensing images is basically overhead, but most of the conventional data sets are horizontal view angles. All the same target patterns are different, and the challenges faced by the detector are also different.

[0005] 3. Small target problem: aerial remote sensing images have high resolution, but most remote sensing targets only contain a few pixel points, which leads to insufficient available information of the target, and conventional detectors are prone to miss detection in the remote sensing target detection scene.

[0006] 4. High background complexity: aerial remote sensing images have a large field of view, which may contain various backgrounds, which will have strong interference on target detection.

[0007] The existing target detection method mainly includes a traditional target detection algorithm based on manual design features and a target detection algorithm based on deep learning. The traditional target detection algorithm needs to be manually designed according to specific data. Therefore, the traditional detection algorithm has weak generalization ability and cannot effectively detect new sample images. On the other hand, the workload of manually designing image features is large and the time cost is higher. The target detection algorithm based on deep learning can be divided into one-stage target detection algorithm and two-stage target detection algorithm. The one-stage detection algorithm has two links in the whole detection process: first, the candidate frame is generated according to the feature extracted by the feature extraction network, and then the candidate frame is detected. The two-stage detection algorithm has high detection accuracy but slow speed. The one-stage detection algorithm directly obtains the detection frame and the category through regression, and has fast detection speed but relatively low accuracy. In the field of remote sensing target detection, the existing target detection algorithm has some limitations: first, the background of remote sensing image is complex, and general detection algorithm cannot effectively cope with background information interference, which is easy to detect the background image as a target; second, general detection algorithm is not sensitive to image feature scale, and the detection effect is worse in the scene with large scale difference; in addition, general detection algorithm has the problems of semantic loss or semantic ambiguity, which is easy to cause false detection when detecting specific targets.

[0008] In summary, designing a target detection algorithm that can effectively suppress complex background information, improve scale perception ability and more effectively semantic information has important practical significance for remote sensing target detection. SUMMARY

[0009] In order to solve the deficiency of the existing target detector in remote sensing image detection, the application provides a remote sensing image target detection algorithm fusing feature transfer and attention mechanism. The YOLOV4 target detection algorithm is improved to realize effective detection of remote sensing images.

[0010] In order to achieve the above purpose, the application adopts the following technical scheme: a YOLOV4 remote sensing target detection method fusing feature transfer and attention mechanism, which includes the following steps in sequence:

[0011] Step 1, the Mosaic data enhancement method is used to process the remote sensing data set, and the remote sensing target information is enriched.

[0012] Step 2, a YOLOV4 remote sensing target detection model fusing feature transfer and attention mechanism is constructed.

[0013] Step 3, the remote sensing image data set obtained in step 1 is input into the above model for training.

[0014] Step 4, preprocessing the remote sensing image to be detected, and unifying the size of the remote sensing image to the same size.

[0015] Step 5, input the processed remote sensing image into the trained target detection model for detection, and output the detection result, i.e. the position of the boundary box of the remote sensing target in the image to be detected and the target category.

[0016] Further step 1 specifically comprises the following steps:

[0017] Step 1a, read the training remote sensing image, convert the obtained image to an RGB image, and adjust the image to a uniform size. The image size needs to be unified to an integer multiple of 32, such as 416X416.

[0018] Step 1b, randomly flip the above-mentioned image, randomly transform the image color gamut, and adjust the training image true boundary box to the corresponding position according to the previous processing result.

[0019] Step 1c, process the training remote sensing image by the Mosaic method, i.e. randomly select four images for segmentation, and recombine the segmented images.

[0020] The above step 2 includes the construction of the target detection network, which involves the construction of the feature extraction network, the construction of the parallel attention module, and the construction of the semantic enhancement PANet and the feature transfer module. The specific steps are further described as follows:

[0021] Step 2a, the feature extraction network of the remote sensing target detection network of the present application selects CSPDarkNet53, which is realized by stacking residual networks with cross-stage connections, and has stronger feature extraction capability. The basic structure of CSPDarkNet53 is a cross-stage residual block CPSX and a CBM. The cross-stage residual block is divided into two parts, wherein the first part is directly stacked with a residual block, and the second part is a residual edge which is stacked with the first part after convolution operation.

[0022] Step 2b, the attention mechanism in the neural network can allocate computing resources to more important parts in the case of limited computing power. Similar to the human visual attention mechanism, by scanning the global image, the target area that needs to be focused on is obtained. The parallel attention mechanism consists of two parts. The first part is an improved efficient channel attention mechanism module, which is called EECA module in the present application. In the convolutional neural network, each feature map has a bias feature. Different channels can capture different features. For the convolutional neural network, the contribution rate of the feature map at different channel levels to the specific task is also different, and the channel attention mechanism can measure the importance of different channels. The EECA attention mechanism according to the present application outputs the final attention weighted feature map according to the following calculation steps:

[0023] 1. Two groups of channel-related feature values are obtained by global average pooling and global maximum pooling respectively, and the two groups of feature values are input into adaptive one-dimensional convolution to further obtain two groups of attention weights.

[0024] X1 = Conv1d(GAP(X))

[0025] X2 = Conv1d(GMP(X))

[0026] X is the input feature map, GAP and GMP represent global average pooling and global maximum pooling respectively, and Conv1d represents adaptive one-dimensional convolution, the number of convolution kernels k is determined by the following formula:

[0027]

[0028] C indicates the number of input feature channels, and |t| odd represents the nearest odd number, and b and γ are 2 and 1 respectively.

[0029] 2. The feature maps obtained above are added pixel by pixel to obtain feature weights X s .

[0030]

[0031] 3. The obtained feature values are activated by using a sigmoid activation function, and each feature is normalized to between 0 and 1.

[0032]

[0033] 4. After obtaining the channel attention weight, the input feature channel is reweighted by the corresponding weight size to obtain the final attention weighted feature map X o .

[0034]

[0035] The second part of the parallel attention mechanism described in the application is the spatial attention part. For the input feature map, the contribution of each feature point to the feature expression is also different in the two-dimensional space level, and the spatial attention mechanism can capture the importance of different pixel points in the two-dimensional space. The spatial attention calculation steps of the application include the following parts:

[0036] 1. Two channel number 1 feature maps can be obtained by respectively finding the maximum value and the average value in the corresponding channel direction of the two-dimensional space of the input feature map X.

[0037] X1 = mean C (X)

[0038] X2 = maxC (X)

[0039] wherein mean C and max C respectively represent the channel direction average value and maximum value of the input feature map.

[0040] 2. Stack the two groups of feature maps obtained to obtain the feature map X c .

[0041] X c =cat(X1,X2)

[0042] wherein cat represents a feature map stacking operation in the channel direction.

[0043] 3. The feature map obtained in the above step is input into a 3X3 size convolution kernel for convolution operation to obtain the feature map X c ′.

[0044] X c ′=Conv2d 3X3 (X c )

[0045] 4. The spatial feature weight obtained in the above step is probabilized to generate a spatial attention feature weight through a softmax function, and each feature point X i ′ j is calculated in the following manner:

[0046]

[0047] wherein X ij represents each feature point on the input feature X c ′ space.

[0048] 5. After obtaining the spatial attention feature weight, the input feature map is spatially weighted by the corresponding spatial attention feature weight, and each feature point is combined to obtain the weighted feature X os .

[0049]

[0050] The parallel attention feature map described in the application is obtained by pixel-by-pixel addition of the attention feature maps of the two parts.

[0051]

[0052] Step 2c, the construction steps of the semantic information enhanced PANet are as follows:

[0053] 1, the processed remote sensing image is input to a backbone network, and feature maps are respectively down-sampled to 1 / 8, 1 / 16 and 1 / 32 of input features on the last three effective feature layers of the backbone network, and the feature maps are denoted as O1, O2 and O3.

[0054] 2, the O3 is up-sampled and fused with the O2 in the channel direction after 5 convolution processes to obtain O2', and the O2' is also up-sampled and fused with the O1 in the channel direction after 5 convolution processes to obtain O1'.

[0055] 3, the O3 obtained in 1 is up-sampled to obtain a feature value through a CBLGS module, the CGLBS module includes 1X1 convolution, batch normalization, LeakyRelu activation function, global average pooling and Sigmoid activation function, the obtained feature value is multiplied by the O2' and then added pixel by pixel to obtain O2'', and O1'' can be obtained in the same way.

[0056]

[0057]

[0058] 4, the O1'' is down-sampled and fused with the O2'' in the channel direction after 5 convolution processes to obtain O2''', and the O2''' is down-sampled and fused with the O3 in the channel direction to obtain O3'.

[0059] 5, the three feature layers C3, C4 and C5 output by the semantic information enhanced PANet are obtained in the following manner.

[0060]

[0061]

[0062]

[0063] Step 2d, the feature transfer module is used to obtain the output of the semantic information enhanced PANet, and the features required by the final model detection head are reconstructed, including the following steps.

[0064] 1, the C4 described above is input into a CUGS module, and then multiplied by the C3 pixel by pixel and subtracted to obtain the output detection feature P3, wherein the CUGS module includes 1X1 convolution, up-sampling, global maximum pooling and Sigmoid activation function.

[0065]

[0066] 2, C4 is multiplied by C5 pixel by pixel after passing through the CMGS module, and then added to obtain the final output P5. The CMGS module includes 1X1 convolution, 2X2 maximum pooling, global maximum pooling and Sigmoid activation function. The final feature transfer module output obtains P3, P4 and P5.

[0067] P4 = C4

[0068]

[0069] Step 3 specifically includes:

[0070] In the Adam optimization algorithm, the initial learning rate is set to 0.001, and the minimum learning rate is set to 0.01 times the initial learning rate. The Mosaic data enhancement probability in each batch of training samples is 0.5. The loss function is the sum of the regression box loss, the confidence loss and the classification loss.

[0071] The regression box loss function uses the CIOU loss function, and the mathematical expression is as follows:

[0072]

[0073] Where, ρ represents the Euclidean distance between the center points of the predicted box and the real box, and c represents the diagonal distance of the smallest rectangular box containing the predicted box and the detection box. The specific parameters of α and v are as follows:

[0074]

[0075]

[0076] The confidence loss function uses the cross-entropy loss function, and the mathematical expression is as follows:

[0077]

[0078] Where, λ noobj represents the boundary box of the negative sample, which is set to 0.5. SxS represents dividing the feature map into a grid of this size, and the number of anchor boxes on each grid is M. C i is the predicted value, is the confidence parameter, which is 1 when the boundary box contains an object, and 0 otherwise.

[0079] The classification loss function uses the cross-entropy loss function, and the mathematical expression is:

[0080]

[0081] Where, when the jth anchor box is 1, the boundary box generated by this anchor box will be calculated for classification loss. Pi (c) is a probability value for predicting the category c, 1 indicates that the bounding box is used for detecting objects, otherwise 0.

[0082] The detection process described in the present application is that after the remote sensing image is input into the trained remote sensing target detection model, the network will first adjust the input image to a uniform size, then three different scale prediction results will be obtained, which are (13X13), (26X26), (52X52), and the fusion of the three detection results will obtain [(13*13)+(26*26)+(52*52)]*3 prediction candidate boxes, that is, 10647. Assuming that there are 10 categories of remote sensing targets to be detected, the trained remote sensing target detection model will express the output result as a two-dimensional vector (10647, 15). The 15 includes the target category number 10, the position parameters (x, y, w, h) of the detection box and the 1 confidence parameter. Then the detection box with a prediction value lower than the set threshold is filtered through the non-maximum suppression algorithm, and the remaining detection box is the final detection result.

[0083] Advantages:

[0084] 1. Compared with YOLOV4, the YOLOV4 remote sensing target detection model with the fusion attention mechanism and feature transfer has better robustness and higher detection accuracy.

[0085] 2. The parallel attention mechanism module proposed can enhance the feature expression ability of the feature map in the model from the aspects of space and channel, so that the model described in the present application can more effectively learn and focus on the target area.

[0086] 3. The semantic information enhanced PANet can better avoid the semantic dilution problem in the traditional feature pyramid feature fusion process, and more effectively fuse multi-level semantic features.

[0087] 4. The introduction of the feature transfer module before the detection head of the model can make the detection model more sensitive to the scale of the feature map. Through feature transfer, the detection effect of shallow small targets can be improved, and the detection effect of deep large targets can also be improved. BRIEF DESCRIPTION OF DRAWINGS

[0088] In order to more clearly illustrate the purpose, technical scheme and advantages of the present application, the present application will be described in detail below with reference to the accompanying drawings.

[0089] Figure 1 is a flow chart of the method of the present application;

[0090] Figure 2 is a schematic diagram of Mosaic remote sensing image data enhancement;

[0091] Figure 3 The overall structure of the YOLOV4 remote sensing target detection model fusing attention mechanism and feature transfer;

[0092] Figure 4 The parallel attention mechanism PAM module;

[0093] Figure 5 The feature transfer module schematic diagram; DETAILED DESCRIPTION

[0094] The preferred examples of the present application will be described in detail below with reference to the accompanying drawings. The examples are only part of the embodiments of the present application, but not all. Based on the examples in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0095] As shown in Figure 1 A remote sensing target detection method fusing feature transfer and attention mechanism, the method comprising the following sequential steps:

[0096] Step 1, processing the remote sensing data set by the Mosaic data enhancement method to enrich the remote sensing target information.

[0097] Step 2, constructing a YOLOV4 remote sensing target detection model fusing feature transfer and attention mechanism.

[0098] Step 3, inputting the remote sensing image data set obtained by processing in step 1 into the above model for training.

[0099] Step 4, preprocessing the remote sensing image to be detected, and unifying the size of the remote sensing image to the same size.

[0100] Step 5, inputting the processed remote sensing image into the trained target detection model for detection, and outputting the detection result, i.e. the boundary box position of the remote sensing target in the image to be detected and the target category.

[0101] Figure 2 The Mosaic data enhancement method used in the data preprocessing of the present application can enrich the background information of the remote sensing image data and enhance the robustness of the model by randomly selecting 4 images for segmentation and recombination.

[0102] Figure 3 The YOLOV4 remote sensing target detection model fusing feature transfer and attention mechanism described in the present application comprises a feature extraction network CSPDarkNet53, a spatial pyramid pooling module SPP, a parallel attention mechanism module PAM, a PANet with enhanced semantic information, and a detection head.

[0103] The basic structure of the feature extraction network CSPDarkNet53 includes a CBM module and a CSPX residual module. The CBM specifically refers to a module containing convolution, batch normalization and a Mish activation function, and the number after CSPX indicates that there are several residual modules in series. CSPX is divided into two parts, wherein the first part is a plurality of residual blocks in series, and the second part is a residual edge which is stacked with the first part after being processed by convolution operation. The SPP module refers to a spatial pyramid pooling module, which is spliced by four maximum pooling operations with different kernel sizes, and the sizes of the pooling operations are 1X1, 5X5, 9X9 and 13X13. The concat represents that the obtained feature maps are spliced in the channel direction. The CBL module extracts features of the feature map, and the CBL includes convolution, batch normalization and LeakyRelu activation function.

[0104] To better fuse the semantic information and spatial detail information extracted by CSPDarkNet53, the application proposes a semantic information enhanced PANet structure, as shown in the Enhanced PANet part in Figure 3 According to CSPDarkNet53, three groups of feature maps for feature fusion can be obtained, and the spatial sizes of the three groups of feature maps are 1 / 8, 1 / 16 and 1 / 32 of the original input image, which are denoted as O1, O2 and O3. The feature fusion specifically includes:

[0105] 1, O3 needs to be adjusted in size by up-convolution and up-sampling to be consistent with O2, the up-sampling rate is 2, the size of the convolution kernel is 1X1, the number of output channels is consistent with the number of channels of O2, and O3 and O2 are spliced in the channel direction to obtain O2';

[0106] 2, O2' is also subjected to convolution and up-sampling, and is spliced with O1 in the channel direction to obtain feature O1', the size of the convolution kernel is 1X1, and the number of output channels is consistent with the number of channels of O1;

[0107] 3, O3 is up-sampled, the up-sampling rate is 2, and the up-sampled O3 is processed by a CBLGS module, the CBLGS module includes 1X1 convolution, batch normalization, LeakyRelu activation function, global average pooling and Sigmoid activation function, the obtained feature is multiplied by O2', and then pixel-by-pixel addition is performed to obtain feature O2";

[0108] 4, O3 is up-sampled, the up-sampling rate is 4, and the up-sampled feature is also subjected to a CBLGS module, and the obtained feature is multiplied by O1' and then added to obtain feature O1";

[0109] 5. Down-sampling is performed on O1" using convolution, the convolution kernel size is 3X3, the step is 2, the obtained feature is spliced with O2" in the channel direction to obtain feature O2'", and O2'" is stacked with O3 in the channel direction after down-sampling to obtain feature O3'; finally, the output of the semantic information enhanced PANet is denoted as C1, C2 and C3, and the mathematical expression is described as:

[0110]

[0111]

[0112]

[0113] Figure 4 The parallel attention mechanism is illustrated, according to the illustration, the parallel attention mechanism includes upper and lower two parts; the upper part is an improved efficient channel attention mechanism, which is used for generating channel dimension attention weight information, and the implementation process includes the following steps:

[0114] 1. Two groups of channel features with the size of 1X1XC are respectively generated by global maximum pooling GMP and global average pooling GAP, wherein C is the dimension of the channel;

[0115] 2. The two groups of channel features are respectively extracted by adaptive one-dimensional convolution to obtain two groups of feature values, and the adaptive one-dimensional convolution refers to that the number of convolution kernels is determined by the number of input feature channels, and the number of convolution kernels is determined by the following formula:

[0116]

[0117] Wherein C refers to the number of input feature channel, |t| odd The nearest odd number is represented by t, and b and γ are 2 and 1 respectively;

[0118] 3. The two groups of channel weights obtained above are fused by pixel-by-pixel addition, and then the channel dimension attention weight can be obtained by using Sigmoid activation function;

[0119] Figure 4 The lower part of the parallel attention mechanism is a spatial attention part, according to the illustration, the implementation of the spatial attention includes the following steps:

[0120] 1. The maximum value and the average value of each channel feature in the spatial dimension are obtained, and two groups of feature maps with the size of HXWX1 are obtained;

[0121] 2. The two groups of feature maps are stacked in the channel direction, and then feature extraction is performed by using a 3X3 size convolution kernel, the output channel number is set to 1, and finally the feature map is activated by using Softmax activation function to obtain the spatial attention feature map.

[0122] The parallel attention module (PAM module) generates features which are fused by pixel-by-pixel addition of channel-dimension attention features and spatial-dimension attention features.

[0123] Figure 5 The feature transfer module is used to receive three groups of effective features C3, C4 and C5 fused by the PANet. The features C3, C4 and C5 are reconstructed. The CUGS module is used to suppress large-scale target information of the C3 layer, so as to highlight small target information of the C3 layer and improve the ability of the C3 layer to detect small targets. The CUGS includes 1X1 convolution, upsampling, global maximum pooling and Sigmoid activation function. The CMGS module is used to transfer large-scale target information of the C4 layer to the C5 layer, so as to improve the ability of the C5 layer to detect large target features. The CMGS includes 1X1 convolution, maximum pooling with a step of 2 and a pooling size of 2X2, global maximum pooling and Sigmoid activation function.

[0124] The above is only a specific embodiment of the present application, and it should be noted that those skilled in the art can understand that various changes, modifications, replacements and variations can be made to these embodiments without departing from the principles and spirits of the present application, and the scope of the present application is defined by the appended claims and their equivalents.

Claims

1. A YOLOv4 remote sensing target detection method integrating feature transfer and attention mechanisms, characterized in that... At: The method includes the following steps: S1) The remote sensing dataset is processed using the Mosaic data augmentation method to enrich the remote sensing target information. The Mosaic data augmentation method specifically includes: S11) Reading the training remote sensing images, converting the obtained images into RGB images, and adjusting the images to a uniform size, which needs to be uniform to a multiple of 32; S12) Randomly flipping the above images, randomly changing the image color gamut, and adjusting the true bounding boxes of the training images to the corresponding positions according to the previous processing results; S13) Processing the training remote sensing images using the Mosaic method, that is, randomly selecting four images for segmentation and recombining the segmented images. S2), construct a YOLOv4 remote sensing target detection model that integrates feature transfer and attention mechanisms; The model includes a feature extraction network, a parallel attention module, a semantically enhanced PANet, and a feature transfer module. The specific construction steps are as follows: S21) The remote sensing target detection network uses CSPDarkNet53 for feature extraction. This network is implemented through stacked cross-level connected residual networks, resulting in more powerful feature extraction capabilities. The basic structure of CSPDarkNet53 consists of cross-level residual blocks CPSX and CBM. The cross-level residual blocks are divided into two parts. The first part is obtained by directly stacking residual blocks, and the second part, as a residual edge, is stacked with the first part after convolutional processing. S22) The parallel attention mechanism consists of two parts. The first part is an improved, efficient channel attention mechanism module. In convolutional neural networks, each feature map has a bias characteristic; different channels can capture different features. For convolutional neural networks, the contribution rate of feature maps at different channel levels to specific tasks is also different. The channel attention mechanism can measure the importance of different channels. The attention mechanism outputs the final attention-weighted feature map according to the following calculation steps: (1) Two sets of feature values ​​related to the channel are obtained by global average pooling and global max pooling, respectively. The two sets of feature values ​​are then input into an adaptive one-dimensional convolution to obtain two sets of attention weights. X 1 = Conv1d(GAP(X)) X 2 = Conv1d(GMP(X)) X is the input feature map, GAP and GMP represent global flat pooling and global max pooling, respectively, and Conv1d represents adaptive one-dimensional convolution, the number of convolution kernels k of which is determined by the following formula: C refers to the number of channels in the input feature map, |t|odd represents the nearest odd number to t, and b and γ take values ​​of 2 and 1 respectively; (2) The feature maps obtained above are added pixel by pixel to obtain the feature weights Xs; (3) Activate the obtained feature values ​​with the sigmoid activation function and normalize each feature to between 0 and 1; (4) After obtaining the channel attention weights, the input feature map channels are reweighted according to the corresponding weights to obtain the final attention-weighted feature map Xo; The second part of the parallel attention mechanism is the spatial attention part. For the input feature map, in the two-dimensional space, the contribution of each feature point to the feature expression is different. The spatial attention mechanism can capture the importance of different pixels in the two-dimensional space. The spatial attention calculation steps include the following parts: (1) By calculating the maximum value and average value of the channel direction corresponding to the two-dimensional space of the input feature map X, two feature maps with 1 channel can be obtained respectively, X1 = mean C(X), X2 = max C(X), where mean C and max C represent calculating the average value and maximum value of the channel direction of the input feature map respectively; (2) Stack the two sets of feature maps to obtain the feature map Xc, Xc = cat(X1, X2), where cat represents stacking the feature maps according to the channel direction; (3) Input the feature map obtained in the previous step into a 3X3 convolution kernel to perform convolution operation to obtain the feature map X c′, Xc′=Conv2d 3X3(X c); (4) The spatial feature weights obtained in the above steps are probabilistically converted, and spatial attention feature weights are generated through the softmax function, with each feature point X′... i,j The calculation method is as follows: X i,j (5) After obtaining the spatial attention feature weights, the corresponding spatial attention feature weights are used to perform spatial feature weighting on the input feature map, and the feature points are combined to obtain the weighted feature Xos; the parallel attention feature map Xout is obtained by adding the attention feature maps of the above two parts pixel by pixel. The construction steps of the semantic information enhanced PANet in S23) are as follows: (1) Input the processed remote sensing image into the backbone network. On the three final effective feature layers of the backbone network, the feature maps are downsampled to 1 / 8, 1 / 16, and 1 / 32 of the input features, respectively. The feature maps are denoted as O1, O2, and O3. (2) Upsample O3 and convolve it 5 times to obtain O2′. Then, upsample and convolve O2′ and merge it with O1 in the channel direction to obtain O1′. (3) Upsample O3 obtained in step 1 and obtain feature values ​​through the CBLGS module. The CBLGS module includes 1X1 convolution, batch normalization, LeakyReLU activation function, global average pooling, and Sigmoid activation function. Multiply the obtained feature values ​​with O2′ and then add them pixel by pixel to obtain O2″. O1″ can be obtained in the same way. (4) Downsample O1″ and convolve it 5 times to obtain O2′. "O2" is obtained by fusing according to the channel direction; O2" is downsampled and fused with O3 according to the channel direction to obtain O3"; (5) The three feature layers C3, C4, and C5 of the semantic information enhanced PANet output are obtained by the following steps: S24) Feature transfer is used to receive PANet output features and perform feature reconstruction, specifically including: (1) After C4 passes through the CUGS module, it is multiplied and subtracted from C3 pixel by pixel to obtain the output detection feature P3, wherein the CUGS module includes 1X1 convolution, upsampling, global max pooling, and Sigmoid activation function; (2) After C4 passes through the CMGS module, it is multiplied and added to C5 pixel by pixel to obtain the final output P5; the CMGS module includes 1X1 convolution, 2X2 max pooling, global max pooling, and Sigmoid activation function, and the final feature transfer module outputs P3, P4, and P5; P4 = C4; S3) Input the remote sensing image dataset obtained from S1 into the above model for training; the training uses the Adam optimization algorithm with an initial learning rate of 0.001 and a minimum learning rate of 0.00001; The probability of Mosaic data augmentation in each batch is 0.5; the loss function is the sum of CIOU regression box loss, cross-entropy confidence loss, and cross-entropy classification loss. S4), preprocess the remote sensing image to be detected, and unify the size of the remote sensing image to be consistent with the size of the training image; S5) The processed remote sensing image is input into the trained target detection model for detection: the model outputs prediction results at three scales of 13×13, 26×26, and 52×52 and fuses them to obtain 10647 candidate boxes; if N types of targets are detected, the output two-dimensional vector has a dimension of (10647, N+5), where N is the number of categories, "N+5" contains N categories, 4 bounding box parameters, and 1 confidence score; the candidate boxes with confidence scores below the threshold are filtered by the non-maximum suppression algorithm, and the final detection result is output, which is the bounding box position and target category of the remote sensing target in the image to be detected.

2. The YOLOv4 remote sensing target detection method based on the fusion of feature transfer and attention mechanisms according to claim 1, characterized in that: Step S3 specifically refers to: In the Adam optimization algorithm, the initial learning rate is set to 0.001, the minimum learning rate is set to 0.01 times the initial learning rate, the probability of Mosaic data augmentation in each batch of training samples is 0.5, and the loss function is the sum of three terms: regression box loss, confidence loss, and classification loss. The regression box loss function uses the CIOU loss function, and its mathematical expression is as follows: Where IoU is the intersection-union ratio of the predicted box and the ground truth box, ρ refers to the Euclidean distance between the center points of the predicted box and the ground truth box, and c refers to the diagonal distance of the smallest rectangle that can simultaneously contain the predicted box and the detection box. The confidence loss function uses the cross-entropy loss function, and its mathematical expression is as follows: Where λnoobj represents the bounding box of the negative sample, and this value is set to 0.

5. S×S means that the feature map is divided into a grid of this size, and the number of anchor boxes in each grid is M. C is the predicted value. i The confidence parameter is 1 when the bounding box contains an object and 0 otherwise. The classification loss function uses the cross-entropy loss function, which is mathematically expressed as: Specifically, when the j-th anchor box is 1, the bounding box generated by that anchor box will be used to calculate the classification loss. To predict the probability value of category c, P i (c) represents the true category, where 1 indicates that the bounding box is used to detect objects, and 0 otherwise.

3. The YOLOv4 remote sensing target detection method based on the fusion of feature transfer and attention mechanisms according to claim 1, characterized in that: The processed remote sensing image is input into a trained target detection model for detection. First, the detection model adjusts the input image to a uniform size using S4, and then obtains three prediction results at different scales: (13x13), (26x26), and (52x52). Fusing the three detection results yields [(13*13)+(26*26)+(52*52)]*3 prediction candidate boxes, which is 10647. Assuming there are 10 categories of remote sensing targets to be detected, the trained remote sensing target detection model will output the result as a two-dimensional vector (10647, 15), where 15 includes the number of target categories (10), the position parameters (x, y, w, h) of the detection box, and one confidence parameter. Then, a non-maximum suppression algorithm is used to filter out detection boxes with prediction values ​​lower than a set threshold, and the remaining detection boxes are the final detection results.

Citation Information

Patent Citations

  • High-resolution remote sensing image target detection method of M-F-Y type lightweight convolutional neural network

    CN111666836A

  • Image rain removal method based on multi-stage and multi-scale attention fusion network

    CN114187275A