Remote sensing image target detection method combining multi-scale features and self-adaptive strategy
By using a method of combining multi-scale features and adaptive strategies in remote sensing image target detection, the problem of low detection accuracy caused by information transmission loss is solved, more efficient feature extraction and small target detection are achieved, and detection accuracy is improved.
Patent Information
- Application Number
- CN202410418837.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-09
- Publication Date
- 2024-08-30
AI Technical Summary
Existing remote sensing image target detection technology ignores the loss during the information transmission process, resulting in low detection accuracy, especially when complex feature boundaries and labeling are difficult.
Using the method of combining multi-scale features and adaptive strategies, we determine the anchor box through k-means++ clustering, build an improved neural network architecture, use deformable convolution modules and aggregation-distribution mechanisms, and combine with normalized Wasserstein loss for hybrid loss training, reducing information loss and improving feature extraction capabilities.
It significantly improves the accuracy of target detection in remote sensing images, reduces the loss during information transmission, enhances the network's ability to detect small targets, and reduces the sensitivity to initial data center selection.
Smart Images

Figure CN118570512A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of remote sensing image target detection, and in particular to a remote sensing image target detection method combining multi-scale features and an adaptive strategy. Background Art
[0002] The innovative development of artificial intelligence has become a key area of national layout, and the application of artificial intelligence technology in military and civilian fields is of great significance. Among them, optical remote sensing image target detection, as a key technology for intelligent interpretation of remote sensing images, aims to search the spatial position of the target of interest in the remote sensing image through intelligent algorithms and analyze its category. In recent years, remote sensing image processing technology has been widely used in various fields such as digital city construction, maritime ship monitoring, military reconnaissance, etc., and has become an indispensable and important means for national security, economic construction and public information services.
[0003] In the early days of remote sensing image target detection, due to the lack of effective image representation, target detection algorithms relied heavily on manually designed features. However, with the booming development of deep learning, it has also greatly promoted the development of remote sensing image target detection and has become an indispensable and important part of the modern remote sensing image target detection field. Convolutional neural networks are widely used in remote sensing image target detection due to their powerful feature extraction capabilities. However, due to the long-distance imaging of the earth's surface, remote sensing images have complex target features, difficult to distinguish feature boundaries, and difficulty in labeling. With the development of technology, researchers have introduced improvements related to deep learning algorithms into the field of remote sensing image target detection, including lightweight feature extraction units, reconstructed feature pyramid networks, and enhanced feature extraction networks. However, current research ignores the loss in the information transmission process and does not consider the impact of irrelevant background on detection performance, resulting in room for improvement in detection accuracy. Summary of the invention
[0004] The present application provides a remote sensing image target detection method combining multi-scale features and adaptive strategies, which can be used to solve the technical problem that the existing technology ignores the loss in the information transmission process, resulting in low detection accuracy.
[0005] The present application provides a remote sensing image target detection method combining multi-scale features and adaptive strategies, the method comprising:
[0006] Step A, perform k-means++ clustering on the width and height of the detection box in the original remote sensing image, use the intersection-over-union distance and the elbow rule to determine different K values, and obtain an anchor box that is closely consistent with the actual distribution size of the data set;
[0007] Step B, construct the overall neural network architecture; the neural network is divided into the backbone network backbone, feature aggregation network Neck and detection head Head from the input end to the output end;
[0008] Step C, using an improved backbone network, i.e., a feature extraction network backbone, to extract multi-scale feature layers in the image;
[0009] Step D: Combine the aggregation-distribution mechanism with the multi-branch stacking module unique to the YOLOv7 network to build a new feature aggregation network;
[0010] In step E, the normalized Wasserstein loss is introduced and the appropriate modulation coefficient IoU-ratio is adopted to perform mixed loss training.
[0011] Furthermore, step A performs k-means++ clustering on the width and height of the detection box in the original remote sensing image, uses the intersection-over-union distance and the elbow rule to determine different K values, and obtains an anchor box that is closely consistent with the actual distribution size of the data set; including:
[0012] The clustering loss function is as follows:
[0013]
[0014] Use the intersection-over-union distance to replace the Euclidean distance to obtain the adaptive setting value. The intersection-over-union distance is recorded as:
[0015] D(box,centroid)=1-IoU(box,centroid)
[0016] Perform mini-batch k-means++ for different K values;
[0017] For a pre-set K value, the cluster centroids are randomly initialized, the average intersection-union distance is calculated each time, and then the cluster centroid corresponding to the minimum average intersection-union distance is selected;
[0018] For different preset K and the minimum value of the corresponding average intersection-over-union ratio distance, or use the elbow rule to determine the K value;
[0019] The cluster centroid represents the width and height of the anchor point of the prior box, and the scale of the anchor box is obtained by calculating the side length of a square with the same area as the generated prior box.
[0020] Furthermore, in step B, the overall neural network architecture is constructed; the neural network is divided into a backbone network backbone, a feature aggregation network Neck and a detection head Head from the input end to the output end; including:
[0021] In the backbone network, the input remote sensing image to be detected passes through several convolution modules CBS, and then alternately passes through the multi-branch stacking module ELAN and the transition module MP; the backbone network ends with a multi-scale spatial pyramid pooling module SPPCSPC;
[0022] The deformable convolution block is embedded into the multi-branch stacking module and the transition module, and the original convolution block with a step size of 3 is replaced by the deformable convolution block; the improved modules are the deformable multi-branch stacking module D-ELAN and the deformable transition module D-MP;
[0023] The feature aggregation network includes shallow branches and deep branches.
[0024] Furthermore, the shallow branch includes the following three modules: shallow feature alignment module L-FAM, shallow information fusion module L-IFM, shallow adjacent layer fusion module L-ALF;
[0025] The deep branch contains the following three modules: deep feature alignment module H-FAM, deep information fusion module H-IFM, and deep adjacent layer fusion module H-ALF;
[0026] Both shallow and deep branches contain information injection modules IIM;
[0027] The feature aggregation network is used to fuse the four feature layers extracted by the backbone network, which are the first-level feature layer B2, the second-level feature layer B3, the third-level feature layer B4, and the fourth-level feature layer B5 from shallow to deep. The four feature layers are fused in turn through the shallow feature alignment module and the shallow information fusion module to obtain the shallow global information L-global.
[0028] The shallow adjacent layer fusion module fuses the first-level feature layer B2, the second-level feature layer B3 and the third-level feature layer B4 to obtain the first-level local information L-local1; then the second-level feature layer B3, the third-level feature layer B4 and the fourth-level feature layer Conv (B5) after convolution are fused to obtain the second-level local information L-local2;
[0029] The global information is injected into the primary local information and the secondary local information respectively through the information injection module; after the two multi-branch stacking modules are connected to the two information injection modules respectively, the primary deep feature P3 and the secondary deep feature P4 are obtained;
[0030] In the deep branch, the third-level deep feature layer P5 is the fourth-level feature layer B5; the first-level deep feature P3, the second-level deep feature P4 and the third-level deep feature P5 are used as the input of the deep branch, that is, the three-layer feature is fused using the deep feature alignment module to obtain the deep global information H-global;
[0031] The deep adjacent layer fusion module is used to fuse the second-level deep feature P4 and the third-level feature layer ConvB4 after convolution to obtain the first-level deep local information H-local1, and the deep global information is injected into the first-level deep local information through the information injection module. The result is sent to the multi-branch stacking module; the result of the multi-branch stacking module is input into another deep adjacent layer fusion module together with the third-level deep feature ConvP5 after convolution to obtain the second-level deep local information H-local2;
[0032] Finally, the deep global information is injected into the secondary deep local information through an information injection module, and the obtained result is input into a multi-branch stacking module.
[0033] Furthermore, step C uses an improved backbone network, i.e., a feature extraction network backbone, to extract multi-scale feature layers in the image; including:
[0034] The deformable convolution block is embedded into the last multi-branch stacking module and transition module of the backbone network, and the weight for each sampling point is added. The formula of the deformable convolution adopted is as follows:
[0035]
[0036] Where x is the input feature, p is the center position, and p k is the offset of the center point, Δp k is the learnable sampling point offset, Δm k is the weight coefficient, with a value between [0,1], w k is the weight of the corresponding sampling point, in the calculation of p0+p k +Δp k When calculating x(p0+p k +Δp k ) will apply bilinear interpolation; where Δp k and Δm k are obtained by a single convolution on the feature map of input x.
[0037] Furthermore, step D combines the aggregation-distribution mechanism and the multi-branch stacking module unique to the YOLOv7 network to build a new feature aggregation network; including:
[0038] The aggregation-distribution mechanism corresponds to the two branches of the feature aggregation network: the shallow aggregation-distribution branch is the shallow branch, and the deep aggregation-distribution branch is the deep branch, which extracts and fuses feature information based on convolution blocks and self-attention blocks respectively;
[0039] The shallow branches and deep branches correspond to the following three modules: feature alignment module FAM, information fusion module IFM, and information injection module IIM;
[0040] During the aggregation process, the feature alignment module is first used to collect and align features from different levels, and then the information fusion module is used to fuse information to generate global information. After obtaining the fused global information, the information injection module distributes information to different levels and injects information through attention operations.
[0041] The shallow aggregation-distribution branch and the deep aggregation-distribution branch are used to extract and fuse feature maps of large and small scales, respectively. The shallow aggregation-distribution branch is for small and medium-sized objects, while the deep aggregation-distribution branch is for detecting large objects. The adjacent layer fusion module supports these two branches;
[0042] Furthermore, the shallow aggregation-distribution branch is used to receive the four feature layers of the backbone, collect and align features, and thus obtain a high-resolution feature map containing small target information, including a shallow feature alignment module and a shallow information fusion module;
[0043] The shallow feature alignment module uses global average pooling for downsampling, bilinear interpolation for upsampling, and identity mapping;
[0044] The shallow information fusion module contains three re-parameterized convolution blocks. The re-parameterized convolution block RepBlock takes the first-level alignment feature as input and then obtains the first-level fusion feature F fuse1 , the number of channels in each heavy parameter convolution block in the middle can be adjusted to adjust the size of the model. The calculation process is as follows:
[0045] F align1 =Low_FAM([B2,B3,B4,B5])
[0046] F fuse1 =RepBlock(F align1 )
[0047] Among them, F align1 It is a primary alignment feature.
[0048] Furthermore, the deep aggregation-distribution branch is used to fuse the feature information obtained by the shallow aggregation-distribution, which includes a deep feature alignment module and a deep information fusion module;
[0049] Among them, the deep feature alignment module uses average pooling and bilinear interpolation to perform feature processing to deal with problems of different scales and obtain the secondary alignment feature F align2 ;
[0050] The deep information injection module includes stacked self-attention stacking blocks Transformer; each self-attention stacking block contains a multi-head self-attention block, a feedforward network block and a residual connection; among them, the self-attention stacking block is stacked L times when applied to obtain the second-level fusion feature F fuse2 ;
[0051] In the process of stacking self-attention blocks, the ReLU6 activation function is used; batch normalization is used after each convolution in the multi-head self-attention block. During inference, a batch normalization layer can be merged with the previous convolution; for the feedforward network, a depth-wise convolution layer is introduced between two convolutional layers with a convolution kernel size of 1x1 to enhance local connections, and the expansion factor of the feedforward network is set to 2;
[0052] The calculation process is as follows:
[0053] F align2 =High_FAM([P3,P4,P5])
[0054] F fuse2 = Transformer(F align2 )
[0055] Furthermore, the information injection module is used to inject the obtained global information into the local features of different levels, and the self-attention form is used to distribute and inject information; the local feature F of the current layer local and the global feature F generated by the information fusion module global They are input into the information injection module respectively; for local features, after inputting the convolution with a convolution kernel size of 1x1 and the batch normalization layer, the local feature F to be injected is obtained local_embed ;
[0056] The global features are given semantic weights F according to whether the path is activated or not. global_act and the global injection feature F global_embed ; The corresponding three outputs have the same size, and the global information is injected into the local information through the Hadamard product, and the injected features are added to the global information; At the end of the module, a re-parameterized convolution block is added to further fuse the information;
[0057] The calculation process is as follows:
[0058] F global_act = resize(Sigmoid(Conv act (F global )))
[0059] F global_embed = resize(Conv global_embed (F global )
[0060] F local_embed =Conv local_embed (F local )
[0061]
[0062] Before the information injection module, a neighboring layer feature fusion module is used to aggregate features of different scales.
[0063] Furthermore, step E introduces the normalized Wasserstein loss and adopts the appropriate modulation coefficient IoU-ratio to perform mixed loss training; including:
[0064] The normalized Wasserstein distance is introduced to measure the similarity between the bounding boxes of tiny objects. After being converted into a similarity metric, it is trained with the original intersection over union loss (IoU loss) for mixed loss.
[0065] By the bounding box A = (cx a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b ) is modeled, and the Gaussian distribution of the bounding box A is obtained and the Gaussian distribution of the bounding box B Simplified to:
[0066]
[0067] Where c is a constant, x a and x b Indicates the horizontal coordinate of the bounding box anchor point, y a and b Indicates the vertical coordinate of the bounding box anchor point, w a and w b Indicates the width of the bounding box, h a and h b Indicates the height of the bounding box;
[0068] Is a distance metric, using the exponential normalization form exp to get the normalized Wasserstein distance as follows:
[0069]
[0070] Among them, C is a constant that is strongly related to the data set. Set C to the average absolute size of the data set. The bounding box loss formula is as follows:
[0071]
[0072] L obj =(1-IoU_ratio)×L NWD +IoU ratio ×L IoU #(twenty one)
[0073] In the formula, IoU_ratio is used as a modulation coefficient, L NWD K is the normalized Wasserstein loss added. IoU is the original intersection-combination loss of the network.
[0074] Compared with the prior art, the present invention has the following significant advantages: 1. It abandons the traditional feature pyramid structure and builds a new feature aggregation network based on the Gather-Distrtibute mechanism, which makes more effective use of the feature information obtained from the backbone and reduces the loss of information during transmission. 2. It enhances the feature extraction network based on the deformable convolution module, improves the network's ability to model geometric transformations and can extract more effective feature representations of the network. 3. It uses the normalized Wasserstein distance for mixed loss training to measure the similarity between the bounding boxes of tiny objects, reducing the sensitivity of the loss function to small targets. (4) It proposes a small batch k-means++ algorithm, which reduces the sensitivity of the original algorithm to the selection of the initial data center while reducing the calculation time, and obtains an anchor box that is closely consistent with the actual distribution size of the data set. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] Figure 1 Flowchart of target detection in remote sensing images for the practical work provided in this application.
[0076] Figure 2 An overview of the overall network structure of GDRS-YOLO designed for the method provided in this application.
[0077] Figure 3 Structural diagram of the deformable convolutional feature extraction module designed for the method provided in this application.
[0078] Figure 4 This is a module structure diagram of the shallow GD branch of the method provided in this application.
[0079] Figure 5 Module structure diagram of the deep GD branch of the method provided in this application.
[0080] Figure 6 This is a structural diagram of the information injection module of the method provided in this application. DETAILED DESCRIPTION
[0081] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0082] The following first introduces the embodiments of the present application in conjunction with the accompanying drawings.
[0083] Combination Figure 1 The present invention designs a remote sensing image target detection method combining multi-scale features and adaptive strategies, which mainly includes firstly clustering the length and width of the target in the remote sensing image to be detected using a small batch k-means++ algorithm, and then obtaining a suitable initial anchor frame (anchor) scale, and training based on an improved loss function, an improved backbone network and a reconstructed feature aggregation network, thereby realizing accurate recognition and positioning of the target in the remote sensing image.
[0084] The network structure diagram of the remote sensing image target detection method combining multi-scale features and adaptive strategies is as follows Figure 2 As shown, the method comprises the following steps:
[0085] Step A: Perform k-means++ clustering on the width and height of the detection box in the original remote sensing image, use the intersection-over-union distance to replace the Euclidean distance, and use the elbow rule to determine different K values to obtain an anchor box that is closely consistent with the actual distribution size of the data set;
[0086] Directly using the k-means algorithm to cluster the length and width of the training data to obtain a suitable prior box scale will consume a lot of time, and the k-means algorithm is sensitive to the selection of the initial data center. The clustering loss function is as follows:
[0087]
[0088] In order to solve the above problems, a small batch k-means++ algorithm is proposed. First, the intersection over union distance is used to replace the Euclidean distance to obtain an adaptive setting value. If the standard k-means algorithm with Euclidean distance is used directly, a larger box will produce a larger error than a smaller box, and the IoU distance is independent of the size of the anchor box. The intersection over union distance is recorded as:
[0089] D(box,centroid)=1-IoU(box,centroid)
[0090] Secondly, small batch k-means++ is performed for different K values; for the pre-set K value, the cluster centroids are randomly initialized, the average intersection-over-union distance is calculated each time, and then the cluster centroid corresponding to the minimum average intersection-over-union distance is selected.
[0091] The appropriate K value is determined for different preset K values and the corresponding minimum average intersection-over-union distance, or the elbow rule is used.
[0092] The cluster centroid represents the width and height of the anchor point of the prior box, and the scale of the anchor box is obtained by calculating the side length of a square with the same area as the generated prior box.
[0093] The mini-batch k-means++ algorithm is easy to implement. Since it generates anchor boxes that are closely consistent with the actual distribution size of the dataset, it can improve the detection performance of anchor-based detectors and further explore the adaptive research of other parameters of the neural network model.
[0094] Step B: Construct the overall neural network architecture; the neural network is divided into the backbone network (backbone), feature aggregation network (Neck) and detection head (Head) from the input end to the output end;
[0095] In the backbone network, the input remote sensing image to be detected passes through several convolution modules CBS, and then alternately passes through the multi-branch stacking module ELAN and the transition module MP; the backbone network ends with a multi-scale spatial pyramid pooling module SPPCSPC;
[0096] This application disassembles the last multi-branch stacking module and transition module, such as Figure 3 , designed a deformable convolution block (DBS Block), and embedded the deformable convolution block into the multi-branch stacking module and the transition module, replaced the original convolution block with a step size of 3 with the deformable convolution block, and named the improved modules as the deformable multi-branch stacking module D-ELAN and the deformable transition module D-MP; the specific network structures of D-ELAN and D-MP are as follows Figure 3 shown.
[0097] As the network deepens, the feature aggregation network includes shallow branches and deep branches;
[0098] The shallow branch includes the following three modules: shallow feature alignment module L-FAM, shallow information fusion module L-IFM, shallow adjacent layer fusion module L-ALF;
[0099] The deep branch contains the following three modules: deep feature alignment module H-FAM, deep information fusion module H-IFM, and deep adjacent layer fusion module H-ALF;
[0100] Both the shallow branch and the deep branch contain an information injection module IIM; in terms of network construction, unlike the original network that only uses the three effective feature layers extracted by the backbone network, this application constructs a new feature aggregation network based on the aggregation-distribution mechanism, fully integrating the four feature layers extracted by the backbone network, which are the first-level feature layer B2, the second-level feature layer B3, the third-level feature layer B4, and the fourth-level feature layer B5 from shallow to deep; the four feature layers are fused in turn through the shallow feature alignment module and the shallow information fusion module to obtain the shallow global information L-global;
[0101] Next, the shallow adjacent layer fusion module fuses the first-level feature layer B2, the second-level feature layer B3 and the third-level feature layer B4 to obtain the first-level local information L-local1; then the second-level feature layer B3, the third-level feature layer B4 and the fourth-level feature layer Conv (B5) after convolution are fused to obtain the second-level local information L-local2;
[0102] The global information is injected into the first-level local information and the second-level local information respectively through the information injection module; in order to expand the efficient learning and convergence capabilities of the multi-branch stacking module in the original YOLOv7 network, the two multi-branch stacking modules are connected to the two information injection modules respectively to obtain the first-level deep feature P3 and the second-level deep feature P4. The above is the work of the shallow branch.
[0103] In the work of the deep branch, the third-level deep feature layer P5 is the fourth-level feature layer B5; the first-level deep feature P3, the second-level deep feature P4 and the third-level deep feature P5 are used as the input of the deep branch, that is, the three-layer feature is fused using the deep feature alignment module to obtain the deep global information H-global;
[0104] Then, the deep adjacent layer fusion module is used to fuse the second-level deep feature P4 and the third-level feature layer Conv (B4) after convolution to obtain the first-level deep local information H-local1, and the deep global information is injected into the first-level deep local information through the information injection module. The result is sent to the multi-branch stacking module; the result of the multi-branch stacking module is input into another deep adjacent layer fusion module together with the third-level deep feature Conv (P5) after convolution to obtain the second-level deep local information H-local2;
[0105] Finally, the deep global information is injected into the secondary deep local information through the information injection module, and the result is input into a multi-branch stacking module. The above is the work of the deep branch, that is, the construction process of the feature aggregation network.
[0106] In general, the number of detection heads is still three, but the four feature layers extracted from the backbone network are fully utilized, and an additional first-level feature layer containing detailed information of small targets is introduced, so the network construction is more compact, alleviating the problem of information loss during transmission, thereby greatly improving the performance of the network.
[0107] Step C: Using an improved feature extraction network (backbone) to extract multi-scale feature layers in the image;
[0108] This application designs a deformable convolution block based on deformable convolution v2, and embeds the deformable convolution block into the last multi-branch stacking module and transition module of the backbone network, replaces the convolution block with a step size of 3 with the deformable convolution block, and names the improved modules as deformable multi-branch stacking module and deformable transition module respectively. The specific network structures of the deformable multi-branch stacking module and the deformable transition module are as follows: Figure 3 shown.
[0109] In Deformable Convolution v2, considering that different sampling points contribute differently to network feature extraction, a weight for each sampling point is added to the original convolution. For example, the module can decide not to perceive the signal from a specific position by setting its feature amplitude to 0. The formula of the deformable convolution used is as follows:
[0110]
[0111] Where x is the input feature, p is the center position, and p k is the offset of the center point, Δp k is the learnable sampling point offset, Δm k is the weight coefficient, with a value between [0,1], w k is the weight of the corresponding sampling point, in the calculation of p0+p k +Δp k When calculating x(p0+p k +Δp k ) will apply bilinear interpolation; where Δp k and Δm k are all obtained by a single convolution on the feature map of input x;
[0112] Deformable convolution v2 improves the ability to model geometric transformations and can extract more effective feature representations of the network. In addition, compared with self-attention, the offset Δp of deformable convolution is k is flexible and can interact with short-range and long-range properties, and Δp k and Δm kIt is learnable and depends on the input, so it has characteristics similar to the long-range dependency and adaptive spatial aggregation ability of the self-attention mechanism, which enables the convolution-based model to learn a deeper and more robust feature information representation.
[0113] In addition, the experiment compared the effects of introducing the deformable convolution module at different positions in the backbone network. Finally, when designing the model, we chose to introduce the deformable convolution block in the last multi-branch stacking module and transition module of the backbone feature extraction network to enhance the feature extraction capability of the backbone network, thereby extracting a more effective feature layer.
[0114] Step D: Combine the Gather-Distribute mechanism and the multi-branch stacking module unique to the YOLOv7 network to build a new feature aggregation network;
[0115] The aggregation-distribution mechanism generally corresponds to two branches of the feature aggregation network: the shallow aggregation-distribution branch, i.e. the shallow branch, and the deep aggregation-distribution branch, i.e. the deep branch, which respectively extract and fuse feature information based on convolution blocks and self-attention blocks. Among them, the adjacent layer fusion module fuses the features of the adjacent layers at a local scale, further promoting the flow of information.
[0116] In the process of network construction, considering the more effective use of feature information obtained from the backbone, the shallow branches and deep branches correspond to the following three modules: feature alignment module FAM, information fusion module IFM, and information injection module IIM. The specific structure of the module is as follows: Figure 5 and Figure 6 shown.
[0117] In general, during the aggregation process, the feature alignment module is first used to collect and align features from different levels, and then the information fusion module is used to fuse information to generate global information; after obtaining the fused global information, the information injection module allocates information to different levels and injects information through simple attention operations to enhance the detection performance of branches.
[0118] The developed shallow aggregation-distribution branch and deep aggregation-distribution branch are used to extract and fuse feature maps of large and small scales, respectively. The shallow aggregation-distribution branch is mainly for small and medium-sized objects, while the deep aggregation-distribution branch mainly detects large objects. The adjacent layer fusion module supports these two branches.
[0119] In order to enhance the detection performance of multi-scale targets, different from the original feature fusion network that only uses the three effective feature layers from the backbone, this application will make full use of the information of the four levels of the backbone. The core idea is: for information of different scales, it is first processed by a unified module to obtain global information, and then the refined features are distributed through the information injection module and injected into the local information fused by the adjacent layer fusion module, thereby realizing the fusion of shallow and deep features and improving the scale perception ability of the model.
[0120] The shallow aggregation-distribution branch is used to receive the four feature layers of the backbone, collect and align features, and obtain high-resolution feature maps containing small target information. It includes a shallow feature alignment module and a shallow information fusion module. The shallow feature alignment module uses global average pooling for downsampling and bilinear interpolation for upsampling. It also includes identity mapping, in order to make feature information of different scales have the same size, so that they can be spliced together as the input of the shallow information fusion module to obtain the first-level alignment feature F. align1 , while reducing the computational complexity, ensuring effective information aggregation, which is convenient for subsequent further processing; the shallow information fusion module contains three re-parameterized convolution blocks. In particular, the re-parameterized convolution block RepBlock takes the first-level alignment feature as input and then obtains the first-level fusion feature F fuse1 , the number of channels in each heavy parameter convolution block in the middle can be adjusted (such as 96), which is used to adjust the size of the model. The calculation process is as follows:
[0121] F align1 =Low_FAM([B2,B3,B4,B5])
[0122] F fuse1 =RepBlock(F align1 )
[0123] Among them, F align1 is the first-level alignment feature;
[0124] The deep aggregation-distribution branch is used to further fuse the feature information obtained by the shallow aggregation-distribution, which includes a deep feature alignment module and a deep information fusion module;
[0125] Among them, the deep feature alignment module uses average pooling and bilinear interpolation to perform feature processing to deal with problems of different scales, ensure correct feature alignment, and obtain the secondary alignment feature F align2The deep information injection module includes stacked self-attention stacking blocks Transformer; each self-attention stacking block contains a multi-head self-attention block, a feedforward network block and a residual connection;. When the self-attention stacking block is applied, it is stacked L times (a feasible value in this application is L = 2) to obtain the second-level fusion feature F fuse2 ;
[0126] In the process of stacking self-attention blocks, the ReLU6 activation function is used; batch normalization is used after each convolution in the multi-head self-attention block. During inference, one batch normalization layer can be merged with the previous convolution; for the feedforward network, a depth-wise convolution layer is introduced between two convolutional layers with a convolution kernel size of 1x1 to enhance local connections, and the expansion factor of the feedforward network is set to 2 to balance speed and accuracy.
[0127] The calculation process is as follows:
[0128] F align2 =High_FAM([P3,P4,P5])
[0129] F fuse2 = Transformer(F align2 )
[0130] The information injection module is used to inject the obtained global information into the local features of different levels, and uses the form of self-attention to distribute and inject information; the local feature F of the current layer local and the global feature F generated by the information fusion module global They are input into the information injection module respectively; for local features, after inputting the convolution with a convolution kernel size of 1x1 and the batch normalization layer, the local feature F to be injected is obtained local_embed ;
[0131] The global features are given semantic weights F according to whether the path is activated or not. global_act and the global injection feature F global_embed ; The corresponding three outputs have the same size, and the global information is injected into the local information through the Hadamard product, and the injected features are added to the global information; at the end of the module, a re-parameterized convolution block is added to further fuse the information.
[0132] The calculation process is as follows:
[0133] F global_act = resize(Sigmoid(Conv act (F glova l)))
[0134] F global_embed = resize(Conv global_embed(F global ))
[0135] F lobal_embed =Conv local_embed (F local )
[0136]
[0137] In order to improve the detection performance of the network, a neighboring layer feature fusion module is used to aggregate features of different scales before the information injection module. This module can increase the path for information flow, thereby improving network performance without significantly increasing latency.
[0138] Step E, by introducing the normalized Wasserstein loss and using the appropriate modulation coefficient IoU-ratio, hybrid loss training is performed;
[0139] The conventional intersection-over-union (IoU) metric and its extensions are very sensitive to positional deviations of tiny objects, and when used in anchor-based object detectors, the detection performance will be greatly reduced. In order to solve the above problems and enhance the network's ability to detect small objects, the normalized Wasserstein distance is introduced to measure the similarity between tiny object bounding boxes. After being converted into a similarity metric, it is trained with the original intersection-over-union (IoU) loss using a mixed loss. Compared to the class intersection-over-union (IoU) metric, this metric is smoother to positional deviations, better describes the weights of different pixels in the bounding box, and is insensitive to objects of different scales. Therefore, it is more suitable for measuring the similarity between tiny objects.
[0140] By the bounding box A = (cx a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b ) is modeled, and the Gaussian distribution of the bounding box A is obtained and the Gaussian distribution of the bounding box B Simplified to:
[0141]
[0142] Where c is a constant, x a and x b Indicates the horizontal coordinate of the bounding box anchor point, y a and b Indicates the vertical coordinate of the bounding box anchor point, w a and w b Indicates the width of the bounding box, h aand h b Indicates the height of the bounding box;
[0143] It is a distance metric and cannot be used directly for similarity measurement (e.g., values between [0,1] like the intersection-over-union ratio). Therefore, the exponential normalization form exp is used to obtain the normalized Wasserstein distance as follows:
[0144]
[0145] Among them, C is a constant that is strongly related to the dataset. C is set to the average absolute size of the dataset to achieve the best performance. The bounding box loss formula is as follows:
[0146]
[0147] L obj =(1-IoU_ratio)×L NWD +IoU ratio ×L IoU #(twenty one)
[0148] In the formula, IoU_ratio is used as a modulation coefficient, L NWD is the normalized Wasserstein loss added, L IoU is the original intersection-combination loss of the network.
[0149] In summary, the present invention first performs k-means++ clustering on the width and height of the detection frame in the original remote sensing image to obtain an anchor frame that is closely consistent with the actual distribution size of the data set; then uses an improved backbone feature extraction network to extract multi-scale effective feature layers in the image; uses a reconstructed feature aggregation network to fuse shallow texture information and deep semantic information; finally, by introducing normalized Wasserstein loss and using a suitable modulation coefficient, mixed loss training is performed; the optimized anchor frame size can be effectively improved through the improved network to improve the detection accuracy of targets in remote sensing images, and can be applied to digital city construction, marine ship monitoring, reconnaissance and other fields, and has good practical value.
[0150] The above-described embodiments of the present application do not constitute a limitation on the protection scope of the present application.
Claims
1. A remote sensing image target detection method combining multi-scale features and adaptive strategies, characterized in that: The method comprises: Step A, perform k-means++ clustering on the width and height of the detection box in the original remote sensing image, use the intersection-over-union distance and the elbow rule to determine different K values, and obtain an anchor box that is closely consistent with the actual distribution size of the data set; Step B, construct the overall neural network architecture; the neural network is divided into the backbone network backbone, feature aggregation network Neck and detection head Head from the input end to the output end; Step C, using an improved backbone network, i.e., a feature extraction network backbone, to extract multi-scale feature layers in the image; Step D: Combine the aggregation-distribution mechanism with the multi-branch stacking module unique to the YOLOv7 network to build a new feature aggregation network; In step E, the normalized Wasserstein loss is introduced and the appropriate modulation coefficient IoU-ratio is adopted to perform mixed loss training.
2. The method according to claim 1, characterized in that Step A, k-means++ clustering is performed on the width and height of the detection box in the original remote sensing image, and the elbow rule is used to determine different K values using the intersection-over-union distance to obtain an anchor box that is closely consistent with the actual distribution size of the data set; including: The clustering loss function is as follows: Use the intersection-over-union distance to replace the Euclidean distance to obtain the adaptive setting value. The intersection-over-union distance is recorded as: D(box,centroid)=1-loU(box,centroid) Perform mini-batch k-means++ for different K values; For a pre-set K value, the cluster centroids are randomly initialized, the average intersection-union distance is calculated each time, and then the cluster centroid corresponding to the minimum average intersection-union distance is selected; For different preset K and the minimum value of the corresponding average intersection-over-union ratio distance, or use the elbow rule to determine the K value; The cluster centroid represents the width and height of the anchor point of the prior box, and the scale of the anchor box is obtained by calculating the side length of a square with the same area as the generated prior box.
3. The method according to claim 1, characterized in that Step B, constructing the overall neural network architecture; the neural network is divided into the backbone network backbone, feature aggregation network Neck and detection head Head from the input end to the output end; including: In the backbone network, the input remote sensing image to be detected passes through several convolution modules CBS, and then alternately passes through the multi-branch stacking module ELAN and the transition module MP; the backbone network ends with a multi-scale spatial pyramid pooling module SPPCSPC; The deformable convolution block is embedded into the multi-branch stacking module and the transition module, and the original convolution block with a step size of 3 is replaced by the deformable convolution block; the improved modules are the deformable multi-branch stacking module D-ELAN and the deformable transition module D-MP; The feature aggregation network includes shallow branches and deep branches.
4. The method according to claim 3, characterized in that The shallow branch includes the following three modules: shallow feature alignment module L-FAM, shallow information fusion module L-IFM, shallow adjacent layer fusion module L-ALF; The deep branch contains the following three modules: deep feature alignment module H-FAM, deep information fusion module H-IFM, and deep adjacent layer fusion module H-ALF; Both shallow and deep branches contain information injection modules IIM; The feature aggregation network is used to fuse the four feature layers extracted by the backbone network, which are the first-level feature layer B2, the second-level feature layer B3, the third-level feature layer B4, and the fourth-level feature layer B5 from shallow to deep; The four feature layers are fused in turn through the shallow feature alignment module and the shallow information fusion module to obtain the shallow global information L-global; The shallow adjacent layer fusion module fuses the first-level feature layer B2, the second-level feature layer B3 and the third-level feature layer B4 to obtain the first-level local information L-local1; then the second-level feature layer B3, the third-level feature layer B4 and the fourth-level feature layer Conv (B5) after convolution are fused to obtain the second-level local information L-local2; The global information is injected into the primary local information and the secondary local information respectively through the information injection module; after the two multi-branch stacking modules are connected to the two information injection modules respectively, the primary deep feature P3 and the secondary deep feature P4 are obtained; In the deep branch, the third-level deep feature layer P5 is the fourth-level feature layer B5; the first-level deep feature P3, the second-level deep feature P4 and the third-level deep feature P5 are used as the input of the deep branch, that is, the three-layer feature is fused using the deep feature alignment module to obtain the deep global information H-global; The deep adjacent layer fusion module is used to fuse the second-level deep feature P4 and the third-level feature layer ConvB4 after convolution to obtain the first-level deep local information H-local1, and the deep global information is injected into the first-level deep local information through the information injection module. The result is sent to the multi-branch stacking module; the result of the multi-branch stacking module is input into another deep adjacent layer fusion module together with the third-level deep feature ConvP5 after convolution to obtain the second-level deep local information H-local2; Finally, the deep global information is injected into the secondary deep local information through an information injection module, and the obtained result is input into a multi-branch stacking module.
5. The method according to claim 1, characterized in that Step C, using an improved backbone network, i.e., a feature extraction network backbone, to extract multi-scale feature layers in the image; including: The deformable convolution block is embedded into the last multi-branch stacking module and transition module of the backbone network, and the weight for each sampling point is added. The formula of the deformable convolution adopted is as follows: Where x is the input feature, p is the center position, and p k is the offset of the center point, Δp k is the learnable sampling point offset, Δm k is the weight coefficient, with a value between [0,1], w k is the weight of the corresponding sampling point, in the calculation of p0+p k +Δp k When calculating x(p0+p k +Δp k ) will apply bilinear interpolation; where Δp k and Δm k are obtained by a single convolution on the feature map of input x.
6. The method according to claim 1, characterized in that Step D, combining the aggregation-distribution mechanism and the multi-branch stacking module unique to the YOLOv7 network, builds a new feature aggregation network; including: The aggregation-distribution mechanism corresponds to the two branches of the feature aggregation network: the shallow aggregation-distribution branch is the shallow branch, and the deep aggregation-distribution branch is the deep branch, which extracts and fuses feature information based on convolution blocks and self-attention blocks respectively; The shallow branches and deep branches correspond to the following three modules: feature alignment module FAM, information fusion module IFM, and information injection module IIM; During the aggregation process, the feature alignment module is first used to collect and align features from different levels, and then the information fusion module is used to fuse information to generate global information. After obtaining the fused global information, the information injection module distributes information to different levels and injects information through attention operations. The shallow aggregation-distribution branch and the deep aggregation-distribution branch are used to extract and fuse feature maps of large and small scales, respectively. The shallow aggregation-distribution branch targets small and medium-sized objects, while the deep aggregation-distribution branch targets detecting large objects. The adjacent layer fusion module supports these two branches.
7. The method according to claim 6, characterized in that The shallow aggregation-distribution branch is used to accept the four feature layers of the backbone, collect and align features, and thus obtain a high-resolution feature map containing small target information. It includes a shallow feature alignment module and a shallow information fusion module. The shallow feature alignment module uses global average pooling for downsampling, bilinear interpolation for upsampling, and identity mapping; The shallow information fusion module contains three re-parameterized convolution blocks. The re-parameterized convolution block RepBlock takes the first-level alignment feature as input and then obtains the first-level fusion feature F fuse1 , the number of channels in each heavy parameter convolution block in the middle can be adjusted to adjust the size of the model. The calculation process is as follows: F align1 =Low_FAM([B2,B3,B4,B5]) F fuse1 =RepBlock(F align1 ) Among them, F align1 It is a primary alignment feature.
8. The method according to claim 6, characterized in that The deep aggregation-distribution branch is used to fuse the feature information obtained by the shallow aggregation-distribution, which includes a deep feature alignment module and a deep information fusion module; Among them, the deep feature alignment module uses average pooling and bilinear interpolation to perform feature processing to deal with problems of different scales and obtain the secondary alignment feature F align2 ; The deep information injection module includes stacked self-attention stacking blocks Transformer; each self-attention stacking block contains a multi-head self-attention block, a feedforward network block and a residual connection; among them, the self-attention stacking block is stacked L times when applied to obtain the second-level fusion feature F fuse2 ; In the process of stacking self-attention blocks, the ReLU6 activation function is used; batch normalization is used after each convolution in the multi-head self-attention block. During inference, a batch normalization layer can be merged with the previous convolution; for the feedforward network, a depth-wise convolution layer is introduced between two convolutional layers with a convolution kernel size of 1x1 to enhance local connections, and the expansion factor of the feedforward network is set to 2; The calculation process is as follows: F align2 =HighFAM([P3,P4,P5]) F fuse2 =Transformer(F aign2 )。 9. The method according to claim 6, characterized in that The information injection module is used to inject the obtained global information into the local features of different levels, and uses the form of self-attention to distribute and inject information; the local feature F of the current layer local and the global feature F generated by the information fusion module global They are input into the information injection module respectively; for local features, after inputting the convolution with a convolution kernel size of 1x1 and the batch normalization layer, the local feature F to be injected is obtained local_embed ; The global features are given semantic weights F according to whether the path is activated or not. global_act and the global injection feature F global_embed ; The corresponding three outputs have the same size, and the global information is injected into the local information through the Hadamard product, and the injected features are added to the global information; At the end of the module, a re-parameterized convolution block is added to further fuse the information; The calculation process is as follows: g lobal_act =resizee(Sigmoid(Conv act (F global ))) F global_embed =resize(Conv global_embed (F global )) F local_embed =Conv local_embed ((F local ) Before the information injection module, a neighboring layer feature fusion module is used to aggregate features of different scales.
10. The method according to claim 1, characterized in that Step E, by introducing the normalized Wasserstein loss and using the appropriate modulation coefficient IoU-ratio, hybrid loss training is performed; include: The normalized Wasserstein distance is introduced to measure the similarity between the bounding boxes of tiny objects. After being converted into a similarity metric, it is trained with the original intersection over union loss (IoU loss) for mixed loss. By the bounding box A = (cx a ,cy a ,w a ,h a ) and bounding box B = (cx b ,cy b ,w b ,h b ) is modeled, and the Gaussian distribution of the bounding box A is obtained and the Gaussian distribution of the bounding box B Simplified to: Where c is a constant, x a and x b Indicates the horizontal coordinate of the bounding box anchor point, y a and b Indicates the vertical coordinate of the bounding box anchor point, w a and w b Indicates the width of the bounding box, h a and h b Indicates the height of the bounding box; Is a distance metric, using the exponential normalization form exp to get the normalized Wasserstein distance as follows: Among them, C is a constant that is strongly related to the data set. Set C to the average absolute size of the data set. The bounding box loss formula is as follows: L obj =(1-IoU_ratio)×L NWD +IoU ratio ×L IoU #(21) In the formula, IoU_ratio is used as a modulation coefficient, L NWD is the normalized Wasserstein loss added, L IoU is the original intersection-combination loss of the network.
Citation Information
Cited By
Remote sensing image target detection method, system and equipment based on deep learning
CN119672437A
Remote sensing image target detection method, system and equipment based on deep learning
CN119672437B
