Remote sensing image target detection method based on improved Mask R-CNN
Through the improved Mask R-CNN method, the HSResSENet-BiFPN network and attention mechanism are used to solve the robustness problem of complex background and dense target detection in remote sensing images, improve the detection accuracy and efficiency, and adapt to the high-resolution remote sensing images. Building target detection requirements.
Patent Information
- Application Number
- CN202410460753.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-17
- Publication Date
- 2024-08-20
AI Technical Summary
Existing target detection methods in remote sensing images are not robust for dense target detection in complex backgrounds and require a large amount of calculation, resulting in detection accuracy and inference speed that cannot meet the needs of practical applications.
The improved Mask R-CNN method is used, the HSResSENet-BiFPN network is introduced, the attention mechanism and the bidirectional feature pyramid network are combined to optimize the backbone network structure, generate multi-scale feature maps, improve target detection accuracy and reduce computational complexity.
It significantly improves the target detection accuracy of remote sensing images, reasonably controls the computational complexity, adapts to the needs of building target detection in high-resolution remote sensing images, and reduces manual vectorization work.
Smart Images

Figure CN118521908A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision, and in particular relates to a remote sensing image target detection method based on an improved Mask R-CNN. Background Art
[0002] In recent years, with the rapid development of remote sensing imaging technology and the successive launch of remote sensing satellites, the quality and scale of remote sensing image data have been greatly improved. Massive high-resolution remote sensing images have brought new opportunities and challenges to the detection of independent target individuals. In the field of computer vision, target detection algorithms, as one of the most challenging tasks, have important research significance and application prospects in various aspects such as military defense deployment, geological traffic monitoring, and smart city planning.
[0003] With the continuous expansion of the application scope of remote sensing images, the current deep learning-based target detectors have been able to achieve automatic feature extraction and have achieved better detection performance than traditional methods. However, remote sensing image target detection often relies on detection technology under natural images, without considering the visual differences and data information between the two. Compared with natural images, high-resolution remote sensing images are interspersed with various densely arranged multi-scale target objects, which brings huge challenges to the target detection task based on deep learning.
[0004] In response to the problems of complex background and different target scales in remote sensing images, researchers began to adjust the network structure based on the existing feature extraction network and the current mainstream target detection model according to the characteristics of remote sensing images, so as to improve the robustness of the algorithm in the task of remote sensing image target detection. By adding attention mechanism, multi-scale feature fusion and introducing dilated convolution, the network structure of the model is innovated, so that the model has a better effect on most remote sensing image target detection.
[0005] Although the current remote sensing image target detection method based on deep learning designed according to the characteristics of remote sensing images can realize automated target detection tasks, the detection effect of existing methods still has room for further improvement. Existing methods are not robust for the detection of dense targets in complex backgrounds, and rarely study the computational complexity of the model, resulting in the existing methods failing to meet the actual application requirements in terms of detection accuracy and inference rate. Therefore, how to reasonably adjust the network structure of the target detection model based on deep learning to better adapt to the needs of building target detection in remote sensing images and greatly reduce the work of manual vectorization is of great research significance, and at the same time provides basic data for urban expansion research, digital city construction and other fields. Summary of the invention
[0006] In view of the shortcomings of the above-mentioned prior art, the present invention proposes a remote sensing image target detection method based on an improved Mask R-CNN. By designing a detection model that can accurately and efficiently identify building targets in high-resolution remote sensing images, the problem of inability to accurately detect targets with large scale variations and densely arranged targets in complex backgrounds of remote sensing images is solved.
[0007] The present invention proposes a remote sensing image target detection method based on an improved Mask R-CNN, the method comprising the following steps:
[0008] Step 1: Obtain the original remote sensing image containing the target to be detected;
[0009] Step 2: Convert the format of the original remote sensing image, and use the converted remote sensing image to construct a remote sensing image dataset, and divide the remote sensing image dataset into a training dataset, a verification dataset, and a test dataset according to a preset ratio;
[0010] Step 3: Build a remote sensing image target detection model based on the improved Mask R-CNN;
[0011] The remote sensing image target detection model based on the improved Mask R-CNN is as follows: based on the deep learning model of the mask region-based convolutional neural network Mask R-CNN, the backbone network adopts the HSResSENet-BiFPN network to extract and fuse features of the received remote sensing image and generate a multi-scale feature map;
[0012] The HSResSENet-BiFPN network is constructed by introducing the attention mechanism SENet and the hierarchical segmentation network HS-ResNet into the residual network ResNet101 in the deep learning model of the mask region-based convolutional neural network MaskR-CNN to construct the HSResSENet network, and then combining the weighted bidirectional feature pyramid network BiFPN with the HSResSENet network to construct the HSResSENet-BiFPN network;
[0013] Step 4: Use the training data set to train the remote sensing image target detection model based on the improved Mask R-CNN, and then use the verification data set to verify the trained remote sensing image target detection model based on the improved Mask R-CNN to obtain the final remote sensing image target detection model;
[0014] Step 5: Input the test data set into the trained target detection model for target detection, predict the category and position of the target to be detected in the remote sensing image, obtain the target to be detected in the remote sensing image, and generate a target segmentation mask;
[0015] The method for converting the format of the original remote sensing image in step 2 is: annotating the original remote sensing image using an annotation tool, and converting the annotated data format into a standard COCO dataset format;
[0016] The remote sensing image target detection model based on the improved Mask R-CNN described in step 3 includes: an input end, a backbone network, a region proposal network RPN, a region alignment layer ROI Align and an output end;
[0017] The input end is used to input the original remote sensing image containing the target to be detected, and transmit the remote sensing image to the backbone network;
[0018] The backbone network adopts the HSResSENet-BiFPN network to extract and fuse features of the received remote sensing images, generate multi-scale feature maps and transmit them to the region proposal network RPN;
[0019] The region proposal network RPN is used to extract a detection frame from the received multi-scale feature map to obtain a set of proposed regions;
[0020] The region alignment layer ROI Align is used to generate a region of interest ROI feature of the same size for each proposed region according to the multi-scale feature map;
[0021] The output end is used to predict the category and position of the target to be detected in the remote sensing image according to the ROI feature, obtain the target to be detected in the remote sensing image, and generate a target segmentation mask;
[0022] The HSResSENet-BiFPN network is as follows: a remote sensing image is input into the HSResSENet-BiFPN network, and a convolution operation and a maximum pooling operation are sequentially performed on the input remote sensing image by means of zero padding Zeropad to obtain a feature map C1; the feature map C1 is input into the first down-sampled residual block and two identical residual blocks of the first SENet and HS-ResNet network connected in series to obtain a feature map C2; the feature map C2 is input into the second down-sampled residual block and three identical residual blocks of the second SENet and HS-ResNet network connected in series to obtain a feature map C3; the feature map C3 is input into the third down-sampled residual block and 22 identical residual blocks of the third SENet and HS-ResNet network connected in series to obtain a feature map C4; The feature map C4 is obtained from the identical residual block of the HS-ResNet network; the feature map C4 is input into the fourth down-sampling residual block and the two fourth identical residual blocks of the attention mechanism SENet and HS-ResNet network in series to obtain the feature map C5; the feature maps C2, C3, C4 and C5 are then input into the BiFPN network for feature fusion to obtain the feature maps P2', P3', P4' and P5', and the feature map C5 is subjected to maximum pooling to obtain the feature map C6. The feature map C6 is directly used as the feature map P6 without feature fusion, and the feature maps P2', P3', P4', P5' and P6 are input into the region proposal network RPN as multi-scale feature maps;
[0023] The first identical residual block based on the attention mechanism SENet and HS-ResNet network, the second identical residual block based on the attention mechanism SENet and HS-ResNet network, the third identical residual block based on the attention mechanism SENet and HS-ResNet network, and the fourth identical residual block based on the attention mechanism SENet and HS-ResNet network have the same structure, which are all connected in sequence: a convolutional layer of size 1×1, a convolutional layer of size 3×3 embedded in the HS-ResNet network, a convolutional layer of size 1×1, an attention mechanism SENet module, and a splicing layer;
[0024] The output end includes: a parallel mask branch, a classification branch and a regression branch; the mask branch is a fully convolutional network FCN, which is used to generate a target segmentation mask of the target to be detected in the remote sensing image; the classification branch and the regression branch are two fully connected layers of the same size and the same number of channels; the classification branch is used to predict the category of the target to be detected in the remote sensing image according to the input region of interest ROI features; the regression branch is used to perform regression calculation on the input region of interest ROI features to obtain the bounding box of the detection target, calculate the regression vector of the bounding box relative to the detection box, and predict the position of the target to be detected in the remote sensing image;
[0025] The step 4 further comprises:
[0026] Step 4.1: Extract features from the remote sensing image input into the remote sensing image target detection model based on the improved Mask R-CNN to obtain a feature map C1;
[0027] Step 4.2: Input the feature map C1 into the first identical residual block of the attention mechanism SENet and HS-ResNet network connected in series for feature extraction to obtain the feature map C2;
[0028] Step 4.3: Input the feature map C2 into three serially connected second attention mechanism SENet and HS-ResNet network identity residual blocks to obtain the feature map C3;
[0029] Step 4.4: Input the feature map C3 into 22 serially connected third attention mechanism SENet and HS-ResNet network’s identical residual blocks for feature extraction to obtain the feature map C4;
[0030] Step 4.5: Input the feature map C4 into the two identical residual blocks of the fourth attention mechanism SENet and HS-ResNet network connected in series for feature extraction to obtain the feature map C5;
[0031] Step 4.6: Input feature maps C2, C3, C4 and C5 into the BiFPN network for feature fusion to obtain feature maps P2', P3', P4' and P5'; at the same time, perform maximum pooling on feature map C5 to obtain feature map P6;
[0032] Step 4.7: Input feature map P2', feature map P3', feature map P4', feature map P5' and feature map P6 into the region proposal network RPN to obtain a set of proposed regions;
[0033] Step 4.8: Input the proposed region and feature maps P2', P3', P4' and P5' into the ROI Align layer, and generate ROI features of the same size for each proposed region according to feature maps P2', P3', P4' and P5';
[0034] Step 4.9: Input the ROI features into two fully connected layers to predict the category and position of the target to be detected in the remote sensing image; input the ROI features into the fully convolutional network to generate the target segmentation mask of the target to be detected in the remote sensing image;
[0035] Step 4.10: Use the stochastic gradient descent algorithm SGD to perform a preset round of iterative training on the remote sensing image target detection model based on the improved Mask R-CNN to obtain a trained remote sensing image target detection model based on the improved Mask R-CNN;
[0036] Step 4.11: Use the validation data set to validate the trained remote sensing image target detection model based on the improved Mask R-CNN to obtain the final remote sensing image target detection model;
[0037] The step 4.2 further comprises:
[0038] Step 4.2.1: Input the feature map C1 into the first identical residual block of the first attention mechanism SENet and HS-ResNet network in series for splitting to obtain s groups of feature maps, each group has w channels, that is, w feature maps; the s groups of feature maps are recorded as {X1, ..., X s}, where X1 represents the first group of feature maps; X s represents the sth group of feature maps;
[0039] Step 4.2.2: Use filter convolution to extract features from the s groups of feature maps to obtain a new feature map X;
[0040] Step 4.2.3: Perform a standard convolution operation on the feature map X to obtain the transformed feature map U, and then perform global average pooling and feature compression on the transformed feature map U to obtain a feature vector [1,1,C], where C represents the number of channels of the transformed feature map U;
[0041] Step 4.2.4: Reduce the number of channels of the feature vector [1,1,C] to 1 / r of the original, recorded as [1,1,C*1 / r], where r represents the scaling factor, and use the Relu function for activation. Then restore the number of channels of the activated feature vector to C, and use the Sigmoid activation function to obtain a normalized weight vector between 0 and 1;
[0042] Step 4.2.5: Multiply the normalized weight vector and the transformed feature map U channel by channel to obtain the weighted feature map
[0043] Step 4.2.6: The weighted feature map As the input of the second first identical residual block based on the attention mechanism SENet and HS-ResNet network in series, repeat steps 4.2.1-4.2.5 and convert the weighted feature map It is concatenated with the weighted feature map output by the identical residual block of the second first attention mechanism SENet and HS-ResNet network in series to obtain feature map C2;
[0044] The method for extracting features from s groups of feature maps using filter convolution in step 4.2.2 is as follows: extracting features from the i-th group of feature maps X using filter convolution i Perform feature extraction, where i = 2, ..., s-1, and extract the feature map Y i Divide into two subgroups Y equally along the channel dimension i1 and Y i2 , Y i2 and the i+1th group of feature graphs X i+1 After concatenation, feature extraction is performed through filter convolution to obtain the feature map Y i+1 ; Repeat the above process until the feature map Y is obtained s ; Then the first group of feature graphs X1 and subgroup Y of feature graph Y2 21 ,…, feature map Y i Subgroup Y i1 and feature map Y s Connect them in series to get a new feature map Y; then use the filter convolution to extract features from the feature map Y to get a new feature map X.
[0045] The beneficial effects of adopting the above technical solution are:
[0046] Compared with the prior art, the method of the present invention introduces the attention mechanism module SENet into the backbone network ResNet101-FPN network, so as to obtain more detection target information and suppress useless background information when extracting image features. At the same time, the bidirectional feature pyramid BiFPN is introduced to fuse high-level information with low-level information, thereby effectively alleviating the problem of low detection accuracy caused by large changes in target scale. In addition, the HS-ResNet network is introduced into the backbone network to reduce the complexity of the model while further enhancing the target detection effect of the model. According to the experimental results, the method of the present invention significantly improves the target detection accuracy of remote sensing images on the basis of reasonably controlling the computational complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A flowchart of a remote sensing image target detection method based on an improved Mask-CNN according to an embodiment of the present invention;
[0048] Figure 2 A structural diagram of a remote sensing image target detection model based on an improved Mask R-CNN according to an embodiment of the present invention;
[0049] Figure 3 It is a schematic diagram of the structure of the backbone network HSResSENet-BiFPN according to an embodiment of the present invention;
[0050] Figure 4It is a schematic diagram of the structure of the HS-ResNet network according to an embodiment of the present invention;
[0051] Figure 5 A schematic diagram of the structure of a SENet network according to an embodiment of the present invention;
[0052] Figure 6 Schematic diagram of the structure of the BiFPN network according to the embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to facilitate the understanding of the present application, the specific embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thoroughly understood.
[0054] In this embodiment, a remote sensing image target detection method based on improved Mask R-CNN is provided. Figure 1 As shown, the method comprises the following steps:
[0055] Step 1: Obtain the original remote sensing image containing the target to be detected.
[0056] In this implementation, the data source of the original remote sensing image is a dataset of typical Chinese urban buildings labeled by Fang Fang's team from China University of Geosciences (Wuhan). The dataset contains 7,260 image area samples and 63,886 buildings in total, distributed in four cities: Beijing, Shanghai, Shenzhen, and Wuhan. The remote sensing images in the dataset are composed of the original image file and the corresponding building mask binary image.
[0057] Step 2: Convert the format of the original remote sensing image, and use the converted remote sensing image to construct a remote sensing image dataset, which is divided into a training dataset, a verification dataset, and a test dataset according to a preset ratio.
[0058] The method for converting the format of the original remote sensing image is: using a labeling tool to label the original remote sensing image, and converting the labeled data format into a standard COCO dataset format.
[0059] In this embodiment, in order to ensure that the remote sensing image target detection model established subsequently can smoothly read the remote sensing image data set information, the original remote sensing image needs to be converted into a format recognized by the remote sensing image target detection model, that is, the original remote sensing image is annotated by the labelme software to obtain a data file in the labelme format, and it is converted into a standard COCO data set format, wherein the COCO data set format includes 4 files, namely: pic file, json file, labelme_json file and cv2_mask file. The pic file contains the original image file, i.e., 7260 image area samples. The json file is annotated by the original image file through the labelme annotation software to obtain the json file corresponding to the original image. The labelme_json file is converted by the json file through the json_to_dataset file that comes with labelme to obtain the labelme_json file corresponding to the json file. The converted labelme_json file contains 5 files, namely, img file, info file, label_names file, label_viz file and label file. The cv2_mask file consists of the label file in the labelme_json file. 80% of the images in the remote sensing image dataset are used as training dataset and verification dataset, where the data ratio of the training dataset and the verification dataset is 7:3, and the remaining 20% of the images are used as test dataset for testing.
[0060] Step 3: Build a remote sensing image target detection model based on the improved Mask R-CNN.
[0061] The remote sensing image target detection model based on the improved Mask R-CNN is as follows: on the basis of the deep learning model of the mask region-based convolutional neural network Mask R-CNN, the backbone network adopts the HSResSENet-BiFPN network to perform feature extraction and feature fusion on the received remote sensing image to generate a multi-scale feature map.
[0062] The remote sensing image target detection model based on the improved Mask R-CNN includes: an input end, a backbone network, a region proposal network (RPN), a region alignment layer (ROI Align) and an output end.
[0063] In this embodiment, if Figure 2As shown in the figure, the remote sensing image target detection model based on the improved Mask R-CNN consists of an input end, a backbone network, a region proposal network RPN, a region alignment layer ROI Align and an output end.
[0064] The input end is used to input the original remote sensing image containing the target to be detected, and transmit the remote sensing image to the backbone network.
[0065] The backbone network adopts the HSResSENet-BiFPN network to extract and fuse features of the received remote sensing images, generate multi-scale feature maps and transmit them to the region proposal network RPN.
[0066] The HSResSENet-BiFPN network is constructed by introducing an attention mechanism (Squeeze-and-Excitation Networks, SENet) and a hierarchical segmentation network (Hierarchical-Split Block on Convolutional Neural Network, HS-ResNet) into the residual network ResNet101 in the deep learning model of the Mask Region-based Convolutional Neural Network (Mask R-CNN) to construct the HSResSENet network, and then combining the weighted bidirectional feature pyramid network (Bi-directional Feature Pyramid Network, BiFPN) with the HSResSENet network to construct the HSResSENet-BiFPN network.
[0067] In this embodiment, if Figure 3 As shown in Figure 2, the HSResSENet-BiFPN network is based on the residual network ResNet101 and the feature pyramid network (FPN) and is improved. Figure 4 and Figure 5 As shown in Figure 2, the network constructed by introducing the ResNet101 network into the attention mechanism SENet and HS-ResNet network is called the HSResSENet network. Figure 6 As shown in FIG. 1 , a bidirectional feature pyramid BiFPN is introduced into the FPN network, and the network constructed by combining the HSResSENet network with BiFPN is called the HSResSENet-BiFPN network.
[0068] The HSResSENet-BiFPN network is as follows: a remote sensing image to be detected is input into the HSResSENet-BiFPN network, and a convolution operation and a maximum pooling operation are sequentially performed on the input remote sensing image by means of zero padding Zeropad to obtain a feature map C1; the feature map C1 is input into the first down-sampling residual block and two identical residual blocks of the first SENet and HS-ResNet network connected in series to obtain a feature map C2; the feature map C2 is input into the second down-sampling residual block and three identical residual blocks of the second SENet and HS-ResNet network connected in series to obtain a feature map C3; the feature map C3 is input into the third down-sampling residual block and 22 identical residual blocks of the third SENet based on the attention mechanism connected in series to obtain a feature map C4; the feature map C5 is input into the third down-sampling residual block and 22 identical residual blocks of the third SENet based on the attention mechanism connected in series to obtain a feature map C6. The feature map C4 is obtained from the identical residual block of the SENet and HS-ResNet networks; the feature map C4 is input into the fourth down-sampling residual block and the two fourth identical residual blocks of the SENet and HS-ResNet networks based on the attention mechanism in series to obtain the feature map C5; the feature maps C2, C3, C4 and C5 are input into the BiFPN network for feature fusion to obtain the feature maps P2', P3', P4' and P5', and the feature map C5 is pooled at the same time to obtain the feature map C6, and the feature map C6 is directly used as the feature map P6 without feature fusion, and the feature maps P2', P3', P4', P5' and P6 are input into the region proposal network RPN as multi-scale feature maps.
[0069] In this embodiment, if Figure 3 As shown in the figure, the remote sensing image to be detected is input into the HSResSENet-BiFPN network, and a convolution operation with a convolution kernel of 7×7 and a step size of 2 and a maximum pooling operation with a window size of 3×3 and a step size of 2 are performed in sequence using the zero padding Zeropad method to obtain the feature map C1.
[0070] In this embodiment, a maximum pooling operation with a step size of 2 is performed on the feature map C5 to obtain the feature map C6, that is, the feature map P6.
[0071] The first identical residual block based on the attention mechanism SENet and HS-ResNet network, the second identical residual block based on the attention mechanism SENet and HS-ResNet network, the third identical residual block based on the attention mechanism SENet and HS-ResNet network, and the fourth identical residual block based on the attention mechanism SENet and HS-ResNet network have the same structure, which are all connected in sequence: a convolutional layer of size 1×1, a convolutional layer of size 3×3 embedded in the HS-ResNet network, a convolutional layer of size 1×1, an attention mechanism SENet module, and a splicing layer.
[0072] In this embodiment, for an input image of size H×W, where H represents the height of the input image and W represents the width of the input image, the sizes obtained by different HSResSENet networks are as follows: The feature map C1, The feature map C2, The feature map C3, The feature map C4, Feature map C5.
[0073] In this embodiment, if Figure 6 As shown in the figure, the feature map C5 input into the BiFPN network is subjected to a 1×1 convolution and a 3×3 convolution to obtain the preliminary feature P5_up; the feature map C4 input into the BiFPN network is subjected to a layer of 1×1 convolution and then connected with the preliminary feature P5_up after the nearest neighbor interpolation upsampling, and then subjected to a layer of 3×3 convolution to obtain the preliminary feature P4_up; the feature map C3 input into the BiFPN network is subjected to a layer of 1×1 convolution and then connected with the preliminary feature P4_up after the nearest neighbor interpolation upsampling, and then subjected to a layer of 3×3 convolution to obtain the preliminary feature P3_up; the feature map C2 is subjected to a layer of 1×1 convolution and then connected with the preliminary feature P3_up after the nearest neighbor interpolation upsampling to obtain the preliminary feature P2_up; the preliminary feature P2_up is subjected to a layer of 3×3 convolution to obtain the feature map P2; The feature map P2 is downsampled, that is, the maximum value pooling operation is performed, and then connected to the preliminary feature P3_up and the feature map C3, and then a layer of 3×3 convolution is performed to obtain the feature map P3. The feature map P3 is downsampled, that is, the maximum value pooling operation is performed, and then connected to the preliminary feature P4_up and the feature map C4, and then a layer of 3×3 convolution is performed to obtain the feature map P4. The feature map P4 is downsampled, that is, the maximum value pooling operation is performed, and then connected to the preliminary feature P5_up, and then a layer of 3×3 convolution is performed to obtain the feature map P5. The obtained feature maps P2, P3, P4 and P5 are regarded as feature maps C2, C3, C4 and C5. Repeat the above steps once, that is, the number of repeated modules is 2, and the final feature maps P2', P3', P4' and P5' are obtained. Finally, the obtained feature maps P2', P3', P4', P5' and P6 are transmitted to the region proposal network RPN.
[0074] The region proposal network RPN is used to extract a detection frame from the received multi-scale feature map to obtain a set of proposed regions;
[0075] In this embodiment, the region proposal network RPN is a network completely based on convolutional neural networks (CNN), which extracts detection frames from received multi-scale feature maps by generating a series of anchor frames, i.e., preset detection frames, i.e., generates recommended regions by certain rules. For the input original feature map, a sliding window of size 3×3 is used for convolution processing to obtain a feature map of the same size as the original feature map. The RPN network initializes k anchor frames with different sizes and aspect ratios at each spatial position of the feature map, and then predicts the category of each anchor frame through a 1×1 convolution layer, i.e., a classification layer, i.e., determines which anchor frames belong to the foreground and which anchor frames belong to the background, and a 1×1 convolution layer, i.e., a regression layer, predicts the regression vector of each anchor frame, and the regression vector of the anchor frame corresponds to the horizontal and vertical coordinates and the width and height of the anchor frame. Based on the above output, a set of recommended regions, i.e., the extracted detection frames, are obtained.
[0076] The region alignment layer ROI Align is used to generate a region of interest (ROI) feature of the same size for each proposed region according to the multi-scale feature map.
[0077] In this embodiment, the obtained proposed region, ie, the detection box and the multi-scale feature map are input into the ROI Align layer, and the ROI Align layer extracts a feature vector of a fixed length as the ROI feature on the input feature map according to the position of each proposed region.
[0078] The output end is used to predict the category and position of the target to be detected in the remote sensing image according to the ROI feature, and obtain the generated target segmentation mask of the target to be detected in the remote sensing image.
[0079] The output end includes: a parallel mask branch, a classification branch and a regression branch; the mask branch is a fully convolutional network (FCN), which is used to generate a target segmentation mask of a target to be detected in a remote sensing image; the classification branch and the regression branch are two fully connected layers of the same size and the same number of channels; the classification branch is used to predict the category of the target to be detected in the remote sensing image according to the input region of interest ROI features; the regression branch is used to perform regression calculation on the input region of interest ROI features to obtain a bounding box of the detected target, calculate the regression vector of the bounding box relative to the detection box, and predict the position of the target to be detected in the remote sensing image.
[0080] In this embodiment, the feature vectors extracted from ROI Align are respectively input into two fully connected layers of the same size and 1024 channels to predict the classification score of the proposed region and the regression vector relative to the detection frame, thereby obtaining the category and position of the target to be detected in the remote sensing image. At the same time, the feature vector extracted from ROI Align is input into the mask branch to determine whether each pixel in the bounding box of the detection target belongs to the instance corresponding to the detection target, thereby outputting the target segmentation mask.
[0081] Step 4: Use the training data set to train the remote sensing image target detection model based on the improved Mask R-CNN, and then use the verification data set to verify the trained remote sensing image target detection model based on the improved Mask R-CNN to obtain the final remote sensing image target detection model;
[0082] In this embodiment, the remote sensing image target detection model based on the improved Mask R-CNN learns the characteristics of the data through a training data set, and then adjusts the parameters and hyperparameters of the trained remote sensing image target detection model through a verification data set to improve the model performance and obtain the final remote sensing image target detection model.
[0083] Step 4.1: Extract features from the remote sensing image input into the remote sensing image target detection model based on the improved Mask R-CNN to obtain a feature map C1;
[0084] Step 4.2: Input the feature map C1 into the first identical residual block of the attention mechanism SENet and HS-ResNet network connected in series for feature extraction to obtain the feature map C2;
[0085] Step 4.2.1: Input the feature map C1 into the first identical residual block of the first attention mechanism SENet and HS-ResNet network in series for splitting to obtain s groups of feature maps, each group has w feature maps; the s groups of feature maps are recorded as {X1, ..., X s}, where X1 represents the first group of feature maps; X s represents the sth group of feature maps;
[0086] In this embodiment, a remote sensing image of size N×H×W is input into the ResNet101 network in the remote sensing image target detection model based on the improved Mask R-CNN for feature extraction to obtain a feature map C1, where N represents the number of channels, and the extracted feature map is input into the HS-ResNet network for splitting after the first downsampling residual block and 1×1 convolution, and the feature map is split into 4 groups, each group has w channels, that is, w feature maps.
[0087] Step 4.2.2: Use filter convolution to extract features from the s groups of feature maps to obtain a new feature map X;
[0088] The method for extracting features from s groups of feature maps by using filter convolution is as follows: using filter convolution to extract features from the i-th group of feature maps X i Perform feature extraction, where i = 2, ..., s-1, and extract the feature map Y i Divide into two subgroups Y equally along the channel dimension i1 and Y i2 , Y i2 and the i+1th group of feature graphs X i+1 After concatenation, feature extraction is performed through filter convolution to obtain the feature map Y i+1 ; Repeat the above process until the feature map Y is obtained s ; Then the first group of feature graphs X1 and subgroup Y of feature graph Y2 21 ,…, feature map Y i Subgroup Y i1 and feature map Y s Connect in series to obtain a new feature map Y; then use the filter convolution to extract features from the feature map Y to obtain a new feature map X;
[0089] In this embodiment, only the first group of feature maps X1 can be directly connected as output to the output of other groups of feature maps, and the second group of feature maps X2 is sent to a 3×3 filter convolution for feature extraction, and the output feature maps are evenly divided into two subgroups in the channel dimension. The feature map of one subgroup is directly used as the final output, and the other subgroup is concatenated with the third group of feature maps X3 in the channel dimension through a series operation and then sent to a 3×3 filter convolution for feature extraction; this process is repeated several times until all feature maps are processed to obtain feature map Y; and feature map Y is sent to the next layer of 1×1 filter convolution to obtain a new feature map X.
[0090] Step 4.2.3: Perform a standard convolution operation on the feature map X to obtain the transformed feature map U, and then perform global average pooling and feature compression on the transformed feature map U to obtain the feature vector [1,1,C], where C represents the number of channels of the transformed feature map U.
[0091] In this embodiment, the feature map X is subjected to one or a group of several standard convolution operations to obtain a transformed feature map U, and then the transformed feature map U is subjected to global average pooling and feature compression to obtain a feature vector [1, 1, C], which is a "squeeze" operation.
[0092] Step 4.2.4: Reduce the number of channels of the feature vector [1,1,C] to 1 / r of the original, denoted as [1,1,C*1 / r], where r represents the scaling factor, and activate it using the Relu function. Then restore the number of channels of the activated feature vector to C, and use the Sigmoid activation function to obtain a normalized weight vector between 0 and 1.
[0093] In this implementation, the number of channels of the feature vector [1,1,C] obtained by the "squeeze" operation is reduced from C to 1 / 16 of the original, that is, [1,1,C*1 / 16], and the amount of calculation is reduced by reducing the number of channels; the Relu function is used for activation, and then the dimension of the feature vector is increased back to the original [1,1,C] through the second fully connected layer; and then a normalized weight vector between 0 and 1 is obtained through the Sigmoid activation function, that is, "excitation". The weight coefficients of each channel are learned through the "excitation" operation to enhance the model's ability to recognize the features of each channel.
[0094] Step 4.2.5: Multiply the normalized weight vector and the transformed feature map U channel by channel to obtain the weighted feature map
[0095] In this embodiment, the weighted feature map U is generated by multiplying the normalized weight vector and the transformed feature map U channel by channel. To achieve the recalibration of the original feature map, that is, the "weighting" operation.
[0096] Step 4.2.6: The weighted feature map As the input of the second first identical residual block based on the attention mechanism SENet and HS-ResNet network in series, repeat steps 4.2.1-4.2.5 and convert the weighted feature map The weighted feature map output by the identical residual block of the second first attention mechanism SENet and HS-ResNet network in series is concatenated to obtain the feature map C2.
[0097] In this embodiment, the weighted feature map The input of the second identical residual block of the first attention mechanism SENet and HS-ResNet network connected in series is concatenated with the input of the identical residual block, and the feature map of the next stage of the HSResSENet network can be obtained after all the identical residual blocks. For example, if the number of identical residual blocks connected in series of the first attention mechanism SENet and HS-ResNet network is 2, the feature map obtained by the first identical residual block needs to be concatenated with the feature map obtained by the next identical residual block to generate feature map C2.
[0098] Step 4.3: Input the feature map C2 into three serially connected second attention mechanism SENet and HS-ResNet network identity residual blocks to obtain the feature map C3.
[0099] In this embodiment, feature map C2 is input into three serially connected second identical residual blocks based on the attention mechanism SENet and HS-ResNet network for processing, steps 4.2.1-4.2.5 are repeated three times, and the three weighted feature maps obtained are spliced to obtain feature map C3; similarly, feature map C3 is used to obtain feature map C4, and feature map C5 is obtained using feature map C4.
[0100] Step 4.4: Input the feature map C3 into 22 serially connected third attention mechanism SENet and HS-ResNet network’s identity residual blocks for feature extraction to obtain the feature map C4.
[0101] Step 4.5: Input the feature map C4 into the identical residual block of the two fourth attention mechanism-based SENet and HS-ResNet networks connected in series for feature extraction to obtain the feature map C5.
[0102] Step 4.6: Input feature maps C2, C3, C4 and C5 into the BiFPN network for feature fusion to obtain feature maps P2', P3', P4' and P5'; at the same time, perform maximum pooling on feature map C5 to obtain feature map P6.
[0103] In this embodiment, a maximum pooling operation with a step size of 2 is performed on the feature map C5 to obtain the feature map C6. The feature map C6 does not need to be feature fused and is directly used as the feature map P6.
[0104] Step 4.7: Input feature map P2', feature map P3', feature map P4', feature map P5' and feature map P6 into the region proposal network RPN to obtain a set of proposed regions.
[0105] Step 4.8: Input the proposed region and feature maps P2', P3', P4' and P5' into the ROI Align layer, and generate ROI features of the same size for each proposed region based on feature maps P2', P3', P4' and P5'.
[0106] Step 4.9: Input the ROI features into two fully connected layers respectively to predict the category and position of the target to be detected in the remote sensing image; input the ROI features into the fully convolutional network to generate the target segmentation mask of the target to be detected in the remote sensing image.
[0107] Step 4.10: Use the stochastic gradient descent algorithm (SGD) to perform a preset round of iterative training on the remote sensing image target detection model based on the improved Mask R-CNN to obtain a trained remote sensing image target detection model based on the improved Mask R-CNN.
[0108] In this embodiment, the input image size in the remote sensing image target detection model based on the improved Mask R-CNN is 500×500, the RPN size is set to (48, 96, 192, 384, 768), the initial learning rate during model training is set to 0.002, the momentum parameter is 0.9, the decay rate is set to 0.0002, and the stochastic gradient descent algorithm (SGD) is used to train the remote sensing image target detection model for 100 rounds.
[0109] Step 4.11: Use the verification data set to verify the trained remote sensing image target detection model based on the improved Mask R-CNN to obtain the final remote sensing image target detection model.
[0110] Step 5: Input the test data set into the trained target detection model for target detection, predict the category and position of the target to be detected in the remote sensing image, obtain the target to be detected in the remote sensing image, and generate a target segmentation mask.
[0111] In this embodiment, the obtained remote sensing image target detection results are used to calculate the detection accuracy AP of each improved Mask R-CNN model and its inference rate is statistically analyzed to evaluate the effectiveness of the improved model.
[0112] The average precision AP (Average Precision) is the main indicator for object evaluation, and is specifically expressed as shown in formula (1):
[0113]
[0114] Where P stands for precision; R stands for recall; AP is the area under the precision-recall curve. The precision is the vertical axis and the recall is the horizontal axis. The formulas for precision and recall are as follows:
[0115]
[0116]
[0117] In building detection, TP represents the number of buildings that are correctly detected, FP represents the number of backgrounds that are incorrectly detected as buildings, and FN represents the number of detected buildings that are misclassified as backgrounds.
[0118] In this embodiment, the parameters and experimental data of the remote sensing image target detection model based on the improved Mask R-CNN are shown in Table 1.
[0119] Table 1 Parameters and experimental data of the remote sensing image target detection model based on the improved Mask R-CNN
[0120]
[0121] As shown in the table above, under the same conditions, the method proposed in the present invention shows good performance in the multi-scale remote sensing image target detection task. On a dataset of typical examples of urban buildings in China, the average accuracy of target detection of the improved Mask R-CNN method based on the HSResSENet-BiFPN module is 6.8% higher than that of the original Mask R-CNN model while slightly increasing the inference rate, proving the effectiveness of the algorithm in multi-scale target detection in optical remote sensing images.
[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope defined by the claims of the present invention.
Claims
1. A remote sensing image target detection method based on improved Mask R-CNN, characterized in that: The method comprises the following steps: Step 1: Obtain the original remote sensing image containing the target to be detected; Step 2: Convert the format of the original remote sensing image, and use the converted remote sensing image to construct a remote sensing image dataset, and divide the remote sensing image dataset into a training dataset, a verification dataset, and a test dataset according to a preset ratio; Step 3: Build a remote sensing image target detection model based on the improved Mask R-CNN; The remote sensing image target detection model based on the improved Mask R-CNN is as follows: based on the deep learning model of the mask region-based convolutional neural network Mask R-CNN, the backbone network adopts the HSResSENet-BiFPN network to extract and fuse features of the received remote sensing image and generate a multi-scale feature map; The HSResSENet-BiFPN network is constructed by introducing the attention mechanism SENet and the hierarchical segmentation network HS-ResNet into the residual network ResNet101 in the deep learning model of the mask region-based convolutional neural network Mask R-CNN to construct the HSResSENet network, and then combining the weighted bidirectional feature pyramid network BiFPN with the HSResSENet network to construct the HSResSENet-BiFPN network; Step 4: Use the training data set to train the remote sensing image target detection model based on the improved Mask R-CNN, and then use the verification data set to verify the trained remote sensing image target detection model based on the improved Mask R-CNN to obtain the final remote sensing image target detection model; Step 5: Input the test data set into the trained target detection model for target detection, predict the category and position of the target to be detected in the remote sensing image, obtain the target to be detected in the remote sensing image, and generate a target segmentation mask.
2. According to the remote sensing image target detection method based on improved Mask R-CNN as described in claim 1, it is characterized in that: The method for converting the format of the original remote sensing image described in step 2 is: using an annotation tool to annotate the original remote sensing image, and converting the annotated data format into a standard COCO dataset format.
3. According to the remote sensing image target detection method based on improved Mask R-CNN as described in claim 1, it is characterized in that: The remote sensing image target detection model based on the improved Mask R-CNN described in step 3 includes: an input end, a backbone network, a region proposal network RPN, a region alignment layer ROIAlign and an output end; The input end is used to input the original remote sensing image containing the target to be detected, and transmit the remote sensing image to the backbone network; The backbone network adopts the HSResSENet-BiFPN network to extract and fuse features of the received remote sensing images, generate multi-scale feature maps and transmit them to the region proposal network RPN; The region proposal network RPN is used to extract a detection frame from the received multi-scale feature map to obtain a set of proposed regions; The region alignment layer ROIAlign is used to generate a region of interest ROI feature of the same size for each proposed region according to the multi-scale feature map; The output end is used to predict the category and position of the target to be detected in the remote sensing image according to the ROI feature, obtain the target to be detected in the remote sensing image, and generate a target segmentation mask.
4. According to the remote sensing image target detection method based on improved Mask R-CNN as described in claim 3, it is characterized in that: The HSResSENet-BiFPN network is as follows: a remote sensing image to be detected is input into the HSResSENet-BiFPN network, and a convolution operation and a maximum pooling operation are sequentially performed on the input remote sensing image by means of zero padding Zeropad to obtain a feature map C1; the feature map C1 is input into the first down-sampling residual block and two identical residual blocks of the first SENet and HS-ResNet network connected in series to obtain a feature map C2; the feature map C2 is input into the second down-sampling residual block and three identical residual blocks of the second SENet and HS-ResNet network connected in series to obtain a feature map C3; the feature map C3 is input into the third down-sampling residual block and 22 identical residual blocks of the third SENet based on the attention mechanism connected in series to obtain a feature map C4; the feature map C5 is input into the third down-sampling residual block and 22 identical residual blocks of the third SENet based on the attention mechanism connected in series to obtain a feature map C6. The feature map C4 is obtained from the identical residual block of the SENet and HS-ResNet networks; the feature map C4 is input into the fourth down-sampling residual block and the two fourth identical residual blocks of the SENet and HS-ResNet networks based on the attention mechanism in series to obtain the feature map C5; the feature maps C2, C3, C4 and C5 are input into the BiFPN network for feature fusion to obtain the feature maps P2', P3', P4' and P5', and the feature map C5 is pooled at the same time to obtain the feature map C6, and the feature map C6 is directly used as the feature map P6 without feature fusion, and the feature maps P2', P3', P4', P5' and P6 are input into the region proposal network RPN as multi-scale feature maps.
5. A remote sensing image target detection method based on improved Mask R-CNN according to claim 4, characterized in that: The first identical residual block based on the attention mechanism SENet and HS-ResNet network, the second identical residual block based on the attention mechanism SENet and HS-ResNet network, the third identical residual block based on the attention mechanism SENet and HS-ResNet network, and the fourth identical residual block based on the attention mechanism SENet and HS-ResNet network have the same structure, which are all connected in sequence: a convolutional layer of size 1×1, a convolutional layer of size 3×3 embedded in the HS-ResNet network, a convolutional layer of size 1×1, an attention mechanism SENet module, and a splicing layer.
6. A remote sensing image target detection method based on improved Mask R-CNN according to claim 5, characterized in that: The output end includes: a parallel mask branch, a classification branch and a regression branch; the mask branch is a fully convolutional network FCN, which is used to generate a target segmentation mask of the target to be detected in the remote sensing image; the classification branch and the regression branch are two fully connected layers of the same size and the same number of channels; the classification branch is used to predict the category of the target to be detected in the remote sensing image according to the input region of interest ROI features; the regression branch is used to perform regression calculation on the input region of interest ROI features to obtain the bounding box of the detected target, calculate the regression vector of the bounding box relative to the detection box, and predict the position of the target to be detected in the remote sensing image.
7. A remote sensing image target detection method based on improved Mask R-CNN according to claim 6, characterized in that: The step 4 further comprises: Step 4.1: Extract features from the remote sensing image input into the remote sensing image target detection model based on the improved Mask R-CNN to obtain a feature map C1; Step 4.2: Input the feature map C1 into the first identical residual block of the attention mechanism SENet and HS-ResNet network connected in series for feature extraction to obtain the feature map C2; Step 4.3: Input the feature map C2 into three serially connected second attention mechanism SENet and HS-ResNet network identity residual blocks to obtain the feature map C3; Step 4.4: Input the feature map C3 into 22 serially connected third attention mechanism SENet and HS-ResNet network’s identical residual blocks for feature extraction to obtain the feature map C4; Step 4.5: Input the feature map C4 into the two identical residual blocks of the fourth attention mechanism SENet and HS-ResNet network connected in series for feature extraction to obtain the feature map C5; Step 4.6: Input feature maps C2, C3, C4 and C5 into the BiFPN network for feature fusion to obtain feature maps P2', P3', P4' and P5'; at the same time, perform maximum pooling on feature map C5 to obtain feature map P6; Step 4.7: Input feature map P2', feature map P3', feature map P4', feature map P5' and feature map P6 into the region proposal network RPN to obtain a set of proposed regions; Step 4.8: Input the proposed region and feature maps P2', P3', P4' and P5' into the ROIAlign layer, and generate ROI features of the same size for each proposed region according to feature maps P2', P3', P4' and P5'; Step 4.9: Input the ROI features into two fully connected layers to predict the category and position of the target to be detected in the remote sensing image; input the ROI features into the fully convolutional network to generate the target segmentation mask of the target to be detected in the remote sensing image; Step 4.10: Use the stochastic gradient descent algorithm SGD to perform a preset round of iterative training on the remote sensing image target detection model based on the improved Mask R-CNN to obtain a trained remote sensing image target detection model based on the improved Mask R-CNN; Step 4.11: Use the verification data set to verify the trained remote sensing image target detection model based on the improved Mask R-CNN to obtain the final remote sensing image target detection model.
8. A remote sensing image target detection method based on improved Mask R-CNN according to claim 7, characterized in that: The step 4.2 further comprises: Step 4.2.1: Input the feature map C1 into the first identical residual block of the first attention mechanism SENet and HS-ResNet network in series for splitting to obtain s groups of feature maps, each group has w feature maps; the s groups of feature maps are recorded as {X1, ..., X s }, where X1 represents the first group of feature maps; X s represents the sth group of feature maps; Step 4.2.2: Use filter convolution to extract features from the s groups of feature maps to obtain a new feature map X; Step 4.2.3: Perform a standard convolution operation on the feature map X to obtain the transformed feature map U, and then perform global average pooling and feature compression on the transformed feature map U to obtain a feature vector [1,1,C], where C represents the number of channels of the transformed feature map U; Step 4.2.4: Reduce the number of channels of the feature vector [1,1,C] to 1 / r of the original, recorded as [1,1,C*1 / r], where r represents the scaling factor, and use the Relu function for activation. Then restore the number of channels of the activated feature vector to C, and use the Sigmoid activation function to obtain a normalized weight vector between 0 and 1; Step 4.2.5: Multiply the normalized weight vector and the transformed feature map U channel by channel to obtain the weighted feature map Step 4.2.6: The weighted feature map As the input of the second first identical residual block based on the attention mechanism SENet and HS-ResNet network in series, repeat steps 4.2.1-4.2.5 and convert the weighted feature map The weighted feature map output by the identical residual block of the second first attention mechanism SENet and HS-ResNet network in series is concatenated to obtain the feature map C2.
9. A remote sensing image target detection method based on improved Mask R-CNN according to claim 8, characterized in that: The method for extracting features from s groups of feature maps using filter convolution in step 4.2.2 is as follows: extracting features from the i-th group of feature maps X using filter convolution i Perform feature extraction, where i = 2, ..., s-1, and extract the feature map Y i Divide into two subgroups Y equally along the channel dimension i1 and Y i2 , Y i2 and the i+1th group of feature graphs X i+1 After concatenation, feature extraction is performed through filter convolution to obtain the feature map Y i+1 ; Repeat the above process until the feature map Y is obtained s ; Then the first group of feature graphs X1 and subgroup Y of feature graph Y2 21 ,…, feature map Y i Subgroup Y i1 and feature map Y s Connect them in series to get a new feature map Y; then use the filter convolution to extract features from the feature map Y to get a new feature map X.
Citation Information
Cited By
Image internal texture classification method and training method of texture classification model
CN119579968A
Building extraction and roof identification method and device based on RGB satellite picture
CN119832446A
