Remote sensing image high-quality automatic instance segmentation method based on SAM large model fine tuning

By introducing adapter modules and region proposal networks into all large segmentation models, we independently build remote sensing data sets, solving the problems of manual prompt dependence and insufficient feature extraction in remote sensing image segmentation, achieving high-quality automatic instance segmentation, and improving segmentation accuracy. and computational efficiency.

CN118691815APending Publication Date: 2024-09-24NANJING UNIV OF SCI & TECH
View PDF 0 Cites 26 Cited by

Patent Information

Application Number
CN202410811073.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

The existing Segmentation Everything Large Model (SAM) has problems in remote sensing image segmentation, such as relying on artificial prior hints, poor segmentation of small or complex targets, and lack of remote sensing data feature extraction capabilities, resulting in unstable segmentation results and high computational costs. .

Method used

By introducing the adapter module and the region proposal network, we independently construct a remote sensing instance segmentation annotation data set, use the importance scoring function to optimize adapter parameters, and combine global multi-scale features and mask features to generate high-quality masks to achieve automatic acquisition of target cues and improved segmentation. quality.

Benefits of technology

It significantly improves the automation level and segmentation accuracy of remote sensing image segmentation, reduces the dependence on manual prompts, and improves the model's generalization ability and computational efficiency on remote sensing data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691815A
    Figure CN118691815A
Patent Text Reader

Abstract

The invention discloses a remote sensing image high-quality automatic instance segmentation method based on SAM large model fine tuning, and the method comprises the steps: introducing an adapter fine tuning module capable of iteratively adjusting parameters into a backbone framework for segmenting all large models, and enabling the adapter fine tuning module to adapt to a remote sensing image downstream task; an iterative training scheme is designed, importance of different adapters is calculated through a scoring function, and dynamic and multi-scale adapter parameter distribution is achieved; performing feature extraction and aggregation on middle layers of a plurality of different adapter modules to obtain fine-tuned global multi-scale semantic information features; generating a candidate target frame by using an anchor point-based region suggestion network, and obtaining a position prompt of a target through a semantic branch and a positioning branch; global semantic information and mask decoder shape information are summarized through convolution processing, high-quality information features are obtained, and original mask features are replaced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of remote sensing image processing, in particular to a high-quality automatic instance segmentation method for remote sensing images based on SAM large model fine-tuning. Background Art

[0002] Remote sensing image instance segmentation refers to the process of accurately separating individual objects from remote sensing images and assigning a unique label to each object. It also allows for automated processing of large amounts of remote sensing data, reducing the workload of manual annotation and analysis, and thus enabling accurate measurement of attributes such as the area, boundary, and shape of objects. Its efficient automated processing mode is very valuable for applications such as land use and resource management that require high-precision measurements.

[0003] Early and traditional remote sensing image instance segmentation methods mainly rely on classical image processing and computer vision techniques. These methods have certain limitations in processing complex scenes and high-resolution images. The rise of deep learning methods has greatly promoted the development of remote sensing image segmentation. Through automatic learning and feature extraction, methods such as CNN, Transformer, GAN, etc. have significantly improved the accuracy and efficiency of segmentation. However, deep learning methods usually rely on a large amount of labeled data, which is often accompanied by huge manual costs in remote sensing image data. For this reason, methods such as semi-supervised, weakly supervised, and self-supervised learning have emerged to reduce the cost of annotation and improve the performance of the model in scenarios with a small amount of labeled data.

[0004] In the field of vision in recent years, the development of large models has significantly promoted the progress of self-supervised learning. By designing pre-training tasks, the model can learn useful features on unlabeled data and then fine-tune it on downstream tasks, demonstrating the powerful zero-sample generalization performance of large models. Among them, the visual model VisionTransformer (ViT) developed from the Transformer architecture performs well in multiple visual tasks such as image classification, segmentation, and detection, especially on large-scale datasets. Based on a basic model proposed by this architecture, Segment Anything Model (SAM) implements model training on a dataset containing more than 1 billion masks and covering 11 million images. It can generate instance segmentation masks for any object in any image or video without additional training, and has excellent generalization and migration capabilities. However, due to the particularity of remote sensing image data, there are still many problems in directly applying the Segmentation Everything Model (SAM) to the example segmentation of hyperspectral images, which leads to unstable segmentation results. That is, (1) SAM relies heavily on artificial prior prompts, such as manually input points, boxes, masks and text prompts, and the segmentation results are not labeled with categories; (2) SAM is prone to errors in the details of the target objects, especially in the segmentation of multiple targets and small targets in remote sensing images; (3) SAM's feature extraction and instance segmentation capabilities for remote sensing image data are not generalized enough and lack corresponding prior knowledge.

[0005] Specifically, for problem (1), the interactive framework of the Segment Everything Large Model SAM requires prior manual prompts, such as points, boxes, coarse masks, or text prompts, which results in the performance of segmenting remote sensing image objects largely depending on the type, location, and number of prompts. The complex background interference and lack of well-defined object edges in remote sensing image scenes interfere with the segmentation effect of the model, and manual precise prompts are often accompanied by a huge workload. These limitations are not suitable for fully automatic understanding of remote sensing images. For problem (2), although the Segment Everything Large Model SAM can generate multiple accurate and reasonable masks for any image based on prompts, when segmenting fine-grained objects with small or complex shapes, SAM usually ignores the object structure and may produce blurred or fragmented segmentation masks. This limitation is more obvious in remote sensing images. For problem (3), the basic image data of the segmentation model SAM comes from natural images from different countries and regions, and the mask annotation is semi-automatically generated by the data engine. Although this mask has the characteristics of high quality and diversity, remote sensing images often contain multispectral or hyperspectral information, and the spatial resolution varies from sub-meter to tens of meters. At the same time, it contains a large amount of geographic information. These features usually have spatial continuity and regional consistency, which makes the basic large model lack special domain knowledge on remote sensing image data, resulting in serious performance degradation. The existing full fine-tuning method, especially for remote sensing data, will bring expensive computational costs to the basic model, and it is difficult to have the portability and migration of the original model. Summary of the invention

[0006] The object of the present invention is to provide a high-quality automatic instance segmentation method for remote sensing images based on SAM large model fine-tuning.

[0007] The technical solution to achieve the purpose of the present invention is: a high-quality automatic instance segmentation method for remote sensing images based on fine-tuning of the SAM large model, comprising the following steps:

[0008] The first step is to construct a remote sensing mask-annotated image dataset;

[0009] In the second step, the adapter module is integrated into the existing layers, while keeping the original model weights unchanged, and training the linear classification head and adapter parameters;

[0010] The third step is to design an importance scoring function to automatically estimate the optimal hidden dimension of the adapter to achieve effective parameter allocation;

[0011] The fourth step is to extract and fuse the features of different stages of the fine-tuning model to form a new global multi-scale feature;

[0012] The fifth step is to use the region proposal network to obtain target region proposals, map the candidate regions to a fixed-size feature map through RoI pooling, and perform target classification and bounding box regression through the classification head and localization head;

[0013] Step 6: Use the position hint and fine-tuned image features to input the mask encoder to obtain the fine-tuned mask features and output tokens;

[0014] Step 7: Perform spatial point-by-point multiplication of the global features and the fine-tuned mask features to generate high-quality mask features, and obtain the output mask through a multi-layer perceptron.

[0015] In the eighth step, the weighted loss function is used to train and update the network for the adapter module and the region proposal network.

[0016] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0017] Compared with the prior art, the present invention has the following significant features: (1) the present invention innovatively adopts a small-scale variable-scale adapter module to improve the fine-tuning performance of the adapter according to the importance scoring function; (2) the basic model is equipped with prior knowledge of the relevant field by using an independently constructed remote sensing instance segmentation annotation dataset; (3) the classification head and the localization head are subjected to target classification and bounding box regression through the region proposal network and RoI pooling, so that the model can automatically obtain target hints; (4) the segmentation mask quality is further improved by aggregating global features and mask features.

[0018] The present invention is further described in detail below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a flow chart of the method of the present invention.

[0020] Figure 2 This is an example diagram of remote sensing instance segmentation and annotation data constructed independently.

[0021] Figure 3 This is the remote sensing instance segmentation result map obtained by using different algorithms on the test set. DETAILED DESCRIPTION

[0022] The present invention proposes a method for fine-tuning a basic model in remote sensing image data. By introducing an adapter fine-tuning module with iteratively adjustable parameters into the backbone framework of the segmentation model, the fine-tuning model can adapt to the downstream tasks of remote sensing images. The importance of different neural layers is calculated in the adapter module through a scoring function to achieve dynamic and multi-scale adapter parameter allocation. Then, on the one hand, feature extraction and aggregation are performed from the middle layers of multiple adapter modules to obtain fine-tuned global multi-scale semantic information features; on the other hand, the initial mask features are extracted from the mask decoder of the original basic model, and finally the two are summarized through convolution processing to obtain high-quality mask features. In addition, we use an anchor-based region proposal network to generate candidate target boxes, obtain the location prompts of the target through the semantic branch and the positioning branch, and input them into the mask decoder to achieve fully automatic prior prompts to solve the problem of manual prompts.

[0023] Combination Figure 1 , the implementation process of the present invention is described in detail below, the steps are as follows:

[0024] The first step is to construct a remote sensing mask annotated image dataset, that is, further labeling the NWPU VHR-10 dataset, SSDD dataset and INRIA aerial image dataset according to the coco dataset standard to obtain manual annotations of bounding boxes and instance masks.

[0025] The second step is to design and train the adapter module, that is, to integrate the adapter module into the existing layer, train the linear classification head and adapter parameters, that is, to apply layer normalization before each sublayer of the multi-head self-attention layer and the fully connected layer of the ViT architecture, use residual connections to skip the multi-head self-attention, and introduce two adapters after each sublayer, assuming the size is m i Input Through the first fully connected layer, it is projected down to a dimension of N i Vector And after a nonlinear activation function, the layer is composed of a linear projection matrix Parameterized, where W i down is the linear projection matrix, dimension is M i ×N i , and then through the second fully connected layer to z i Upsample and get the output where r i is the upsampled output vector, and this layer consists of The linear projection matrix is ​​parameterized, and finally the residual connection is performed in the adapter module. The adapter result will be directly applied to the output of the corresponding sub-layer:

[0026] h′ i =Wi up ·φ(W i down ·h i )+h i #(1)

[0027] Among them, W i up and W i down Both are linear projection matrices, used for upsampling and downsampling, respectively, h i is the input vector, h i ′ is the output vector, and the total number of adapter parameters is equal to 2·N i ·M i , the compression ratio of the adapter is

[0028] The third step is to design the importance scoring function, that is, according to W i down The L of the corresponding row in 1 Norm and W i up The L of the corresponding row in 1 The sum of the norms gives the following importance scoring function:

[0029]

[0030] in The importance score of the jth neuron of the ith adapter is normalized by the total number of parameters associated with that particular dimension of the adapter.

[0031] The fourth step is to extract and fuse the features of different stages of the fine-tuning model. The early local features of the image encoder represent rich edge details, while the deep features contain rich contextual semantic information. The feature aggregation iterative process is defined as follows:

[0032]

[0033] in and They represent the features of the SAM backbone module after fine-tuning and DownConv The features of the downsampling convolution, h represents the first dimension of the tensor, i.e., height, w represents the first dimension of the tensor, i.e., width, and c represents the third dimension of the tensor, i.e., number of channels. This process involves using a 1×1 convolution-ReLU activation function to reduce the number of channels to 32, and then using a 3×3 convolution-ReLU activation function to capture more spatial information. i represents the intermediate feature map of the i-th layer, which is obtained by summing the intermediate feature map of the previous layer after 3×3 convolution and the downsampled feature map of the current layer; Φ Conv2Drepresents the 3×3 convolution-ReLU activation function, and Φ Fusionconv It represents the final fusion convolution layer, which consists of two 3×3 convolution layers and one 1×1 convolution layer, used to restore the channel dimension, and finally obtain F agg Construct new global multi-scale features.

[0034] In the fifth step, the region proposal network RPN is used to obtain target region proposals, the candidate regions are mapped to fixed-size feature maps through RoI pooling, and target classification and bounding box regression are performed through the classification head and the localization head. First, the image features obtained by fine-tuning the encoder are Perform convolution downsampling to obtain a multi-scale feature map:

[0035]

[0036] Through upsampling and lateral connection, the high-level feature map is gradually fused with the low-level feature map to generate a pyramid feature map F ms , generate candidate object proposals through the region proposal network RPN:

[0037] {o i}=Φ rpn (F ms )#(5)

[0038] Then after the ROI pooling operation Φ roi-p , the candidate region is placed in the feature map F ms Pooling is performed on it, and position encoding PE is added to obtain the pooled feature v i :

[0039] v i =Φ roi-p (F ms +PE,o i )#(6)

[0040] Use a classification and regression network to perform classification and bounding box regression on the pooled features:

[0041]

[0042] Among them, Φ cls represents the classification head, using the softmax layer as the classification layer, c i Represents the classification result of candidate region i, which is specifically defined as follows:

[0043]

[0044] Among them, W is the weight matrix, b is the bias vector, C is the number of categories; and the regression head Φ reg The fully connected layer is used to obtain the bounding box regression result of the candidate region i, which is specifically defined as follows:

[0045] t i =W reg ·v i +b reg #(9)

[0046] Among them, W reg is the regression layer weight matrix, b reg is the bias vector, t i is the output vector of the regression layer, which contains four parameters: [t x ,t y ,t w ,t h ], here t x ,t y Indicates the offset of the center coordinates of the bounding box, t w ,t h represents the scaling amount of the bounding box width and height. Assuming that the initial bounding box of the candidate region is (x a ,y a ,w a ,h a ), the resulting position coordinate prompt is:

[0047]

[0048] Where x, y are the coordinates of the center of the bounding box, and w, h are the width and height of the bounding box.

[0049] In the sixth step, the position cue and fine-tuned image features are used to input the mask encoder to obtain the fine-tuned mask features and output tokens. That is, the learnable output tokens are first initialized and inserted into the position cue embedding; the output token consists of two parts:

[0050] t out =t iou +t mask #(11)

[0051] where t iou represents the IoU token, which is subsequently separated out to predict the reliability of IoU, t mask Represents the mask token, which is used to participate in predicting the final mask result; the final hint embedding consists of the output token and the position hint token, and the image embedding is mapped into the mask decoder;

[0052] Next, the image embedding, image position embedding, and hint token go into a two-layer encoder, each of which first self-attentions the tokens, then cross-attentions from the tokens to the image embeddings, then point-by-point feature transformations through a multi-layer perceptron to update each token, then cross-attentions from the image embedding to the hint tokens, and finally updates the image embedding using the hint information:

[0053] At the same time, in order to keep the position information updated in time, in each attention operation, the image embedding is superimposed with its own position encoding, and the prompt token is superimposed with the initial token:

[0054]

[0055] Among them, F i represents image embedding, P F represents the positional encoding of the image embedding, T i represents token embedding, T init represents the initial token embedding; finally, we get the output token and mask features after fine-tuning and updating.

[0056] The seventh step is to merge and obtain high-quality mask features, that is, to perform spatial point-by-point product of the global fusion features and the fine-tuning mask features to generate high-quality mask features, that is, to first upsample the global fusion features through transposed convolution:

[0057] F agg ′=Φ ConvTran (F agg ,k,s,p)#(13)

[0058] Among them, F agg is the global fusion feature, k is the convolution kernel size, s is the stride, p is the padding, Φ ConvTran represents spatial convolution;

[0059] Then the global fusion features and mask features are simply convolved to obtain high-quality mask features:

[0060] F HQ =Conv(F agg , F mask )#(14)

[0061] Among them, F mask is the mask feature, F HQ is a high-quality mask feature;

[0062] Next, the output token is passed through three MLP layers to adjust the number of channels:

[0063]

[0064] Where W is the weight matrix, b is the bias term, and σ is the activation function;

[0065] Finally, the high-quality mask features and the adjusted output tokens are matrix-multiplied to obtain the final mask prediction:

[0066] M=F′ out ·F HQ#(16)

[0067] In the eighth step, the weighted loss function is used to train and update the network for the adapter module and the region proposal network, that is, to calculate the object loss and positioning loss in the RPN, the classification loss of the semantic head, the regression loss associated with the positioning head, and the segmentation loss of the SAM decoder:

[0068]

[0069] in, represents the region proposal loss, represents the cross entropy loss calculated between the predicted category and the target, is the loss calculated based on the predicted coordinate offset and the object offset between the ground mask and the previous box, represents the binary CE loss between the SAM decoded mask and the instance mask, where the IoU of the boxes determines the supervised matching criterion, represents the loss of the fine-tuning adapter module, is the indicator function used to verify positive matches, η represents the weight factor of the auxiliary loss, M represents the number of samples for calculating the region proposal loss, and N represents the number of samples for calculating the classification loss.

[0070] The effect of the present invention can be further illustrated by the following simulation experiment:

[0071] Simulation conditions

[0072] The simulation experiment constructs and integrates three sets of remote sensing image data: the NWPU VHR-10 dataset, the SSDD dataset, and the INRIAaerial image dataset. The NWPU VHR-10 dataset is a remote sensing image object detection dataset, including ten categories of target objects, 715 optical remote sensing images from Google Earth with a spatial resolution of 0.5-2 meters, and 85 pan-sharpened color 8 infrared images from the Vahingen dataset with a spatial accuracy of 0.08 meters. The SSDD dataset is ship detection data, including 1160 synthetic aperture radar images with resolutions ranging from 1 meter to 15 meters, and 2540 ship instances. Each image contains detailed annotation information, including the ship's bounding box and category label. The INRIAAerial Image Dataset dataset is a high-resolution aerial image, which contains high-resolution aerial images of multiple cities. The image resolution is 0.3 meters, the image size is 5000×5000 pixels, and each image contains detailed building outline annotations. We uniformly annotate the above datasets into the coco data format, and the specific form is as follows Figure 2 As shown, we use 80% of the data for training and the remaining 20% ​​for testing.

[0073] The simulation experiments were completed in Python-3.9+Pytorch-1.12.2 environment. The experiment was conducted using NVIDIA A10Tensor Core GPU. We set the AdamW optimizer with an initial learning rate of 0.0001 for training, established a small batch of 16, and fixed the number of iterations to 300. In addition, this experiment also uses a linear warm-up strategy to implement a cosine annealing scheduler to decay the learning rate, and all additional modules are trained from scratch. This experiment uses the widely recognized COCO average precision (mAP) metric. That is, when the predicted box or mask of an instance presents an intersection over union (IoU) with its corresponding ground truth exceeding a threshold T, and when its predicted category is aligned, the prediction is considered true. In this experiment, we use APmask, AP50 mask, and AP75 mask for evaluation. AP refers to the average metric of all 10 IoU thresholds (0.50:0.05:0.95) and all categories. The larger the AP value, the more accurate the predicted instance mask, and therefore the better the instance segmentation performance. AP50 represents the calculation under an IoU threshold of 0.50, while AP75 embodies a stricter metric corresponding to the calculation under an IoU threshold of 0.75.

[0074] Simulation content

[0075] The present invention uses a real remote sensing image dataset to test the instance segmentation performance of the algorithm. To verify the effectiveness of the algorithm of the present invention, we compare the proposed method with the original basic segmentation model SAM and some existing variant models based on SAM, including the high-quality segmentation model HQ-SAM, the high-quality image segmentation prompt adapter PA-SAM, and the remote sensing instance segmentation prompt learning RSPrompter, and also compare it with some traditional multi-stage instance segmentation methods, including: Mask R-CNN, HTC and SCNet.

[0076] Analysis of simulation experiment results

[0077] Table 1 shows the comparison results of instance segmentation accuracy and different evaluation indicators of the simulation experiment of the method of the present invention on the above dataset. Since the original segmentation model SAM requires a priori target prompts, the target box prompts in the comparative experiment are all from the input box prompts generated by the same training detector.

[0078] Table 1 Classification results of different methods on Pavia University dataset (%)

[0079]

[0080]

[0081] From the experimental results, this method has obvious advantages over the original basic model. Compared with the method based on SAM to improve accuracy, the method of fine-tuning the SAM model, the SAM model method of training prompt learning and the traditional two-stage instance segmentation method, the segmentation accuracy of the method of the present invention has been significantly improved in different evaluation indicators. The example segmentation effect of the method of the present invention on the test data set is shown in the figure Figure 3 As shown, it can be seen that the method has a significant effect on instance segmentation in the field of remote sensing images. The above simulation experiment results show the effectiveness of the method of the present invention.

Claims

1. A high-quality automatic instance segmentation method for remote sensing images based on fine-tuning of the SAM large model. It is characterized in that The following steps are involved: The first step is to build a remote sensing mask annotated image dataset; In the second step, the adapter module is integrated into the existing layers, while keeping the original model weights unchanged, and training the linear classification head and adapter parameters; The third step is to design an importance scoring function to automatically estimate the optimal hidden dimension of the adapter to achieve effective parameter allocation; The fourth step is to extract and fuse the features of different stages of the fine-tuning model to form a new global multi-scale feature; The fifth step is to use the region proposal network to obtain target region proposals, map the candidate regions to a fixed-size feature map through RoI pooling, and perform target classification and bounding box regression through the classification head and localization head; Step 6: Use the position hint and fine-tuned image features to input the mask encoder to obtain the fine-tuned mask features and output tokens; In the seventh step, the global features and the fine-tuned mask features are spatially multiplied point by point to generate high-quality mask features, and the output mask is obtained through a multi-layer perceptron. In the eighth step, the weighted loss function is used to train and update the network for the adapter module and the region proposal network.

2. A high-quality automatic instance segmentation method for remote sensing images based on SAM large model fine-tuning according to claim 1, It is characterized in that The first step is to construct a remote sensing mask annotated image dataset. According to the dataset coco standard, the NWPUVHR-10 dataset, SSDD dataset and INRIA aerial image dataset are marked to obtain manual annotations of bounding boxes and instance masks.

3. The method for high-quality automatic instance segmentation of remote sensing images based on fine-tuning of the SAM large model according to claim 1, It is characterized in that In the second step, the adapter module is integrated into the existing layer and the linear classification head and adapter parameters are trained. That is, layer normalization is applied before each sublayer of the multi-head self-attention layer and the fully connected layer of the ViT architecture, multi-head self-attention is skipped using residual connections, and two adapters are introduced after each sublayer. Let the size be m i Input Through the first fully connected layer, it is projected down to a dimension of N i Vector And after a nonlinear activation function, the layer is composed of a linear projection matrix Parameterized, where is the linear projection matrix, dimension is M i ×N i , and then through the second fully connected layer to z i Upsample and get the output where r i is the upsampled output vector, and this layer consists of The linear projection matrix is ​​parameterized, and finally the residual connection is performed in the adapter module. The adapter result will be directly applied to the output of the corresponding sub-layer: Among them, W i up and W i down Both are linear projection matrices, used for upsampling and downsampling, respectively, h i is the input vector, h′ i is the output vector, the total number of adapter parameters is equal to 2·N i ·M i , the compression ratio of the adapter is 4. The method for high-quality automatic instance segmentation of remote sensing images based on fine-tuning of the SAM large model according to claim 3, It is characterized in that The third step is to design an importance scoring function based on W i down The L of the corresponding row in 1 Norm and W i up The L of the corresponding row in 1 The sum of the norms gives the following importance scoring function: in The importance score of the jth neuron of the ith adapter is normalized by the total number of parameters associated with that particular dimension of the adapter.

5. The method for high-quality automatic instance segmentation of remote sensing images based on fine-tuning of the SAM large model according to claim 4, It is characterized in that The fourth step is to extract and fuse the features of different stages of the fine-tuning model. The feature aggregation iterative process is defined as follows: in and They represent the features of the SAM backbone module after fine-tuning and DownConv The features of the downsampling convolution, h represents the first dimension of the tensor, i.e., height, w represents the first dimension of the tensor, i.e., width, and c represents the third dimension of the tensor, i.e., number of channels. This process involves using a 1×1 convolution-ReLU activation function to reduce the number of channels to 32, and then using a 3×3 convolution-ReLU activation function to capture more spatial information. i represents the intermediate feature map of the i-th layer, which is obtained by summing the intermediate feature map of the previous layer after 3×3 convolution and the downsampled feature map of the current layer; Φ Conv2 represents the 3×3 convolution-ReLU activation function, and Φ FusionConv represents the final fusion convolution layer, which consists of two 3×3 convolution layers and one 1×1 convolution layer, used to restore the channel dimension, and finally obtain F agg Construct new global multi-scale features.

6. A high-quality automatic instance segmentation method for remote sensing images based on SAM large model fine-tuning according to claim 5, It is characterized in that In the fifth step, the region proposal network RPN is used to obtain target region proposals, the candidate regions are mapped to fixed-size feature maps through RoI pooling, and target classification and bounding box regression are performed through the classification head and the localization head. First, the image features obtained by fine-tuning the encoder are Perform convolution downsampling to obtain a multi-scale feature map: Through upsampling and lateral connection, the high-level feature map is gradually fused with the low-level feature map to generate a pyramid feature map F ms , generate candidate object proposals through the region proposal network RPN: {o} i }=Φ rpn (F ms )#(5) Then after the ROI pooling operation Φ roi-p , the candidate region is placed in the feature map F ms Pooling is performed on it, and position encoding PE is added to obtain the pooled feature v i : v i =Φ roi-p (F m s+OR,o i )#(6) Use a classification and regression network to perform classification and bounding box regression on the pooled features: Among them, Φ cls represents the classification head, using the softmax layer as the classification layer, c i Represents the classification result of candidate region i, which is specifically defined as follows: Among them, W is the weight matrix, b is the bias vector, C is the number of categories; and the regression head Φ reg The fully connected layer is used to obtain the bounding box regression result of the candidate region I, which is specifically defined as follows: t i =W reg ·v i +b reg #(9) Among them, W reg is the regression layer weight matrix, b reg is the bias vector, t i is the output vector of the regression layer, which contains four parameters: [t x , t y , t w , t h ], t x , t y Indicates the offset of the center coordinates of the bounding box, t w , t h represents the scaling amount of the bounding box width and height. Assuming that the initial bounding box of the candidate region is (x a ,y a , w a ,h a ), the resulting position coordinate prompt is: Where x, y are the coordinates of the center of the bounding box, and w, h are the width and height of the bounding box.

7. The method for high-quality automatic instance segmentation of remote sensing images based on fine-tuning of the SAM large model according to claim 6, It is characterized in that Step 6: Use the position hint and fine-tuned image features to input the mask encoder to obtain the fine-tuned mask features and output tokens, that is, first initialize the learnable output tokens and insert them into the position hint embedding; This output token consists of two parts: t out =t iou +t mask #(11) where t iou represents the IoU token, which is subsequently separated out to predict the reliability of IoU, t mask Represents the mask token, which is used to participate in predicting the final mask result; the final hint embedding consists of the output token and the position hint token, and the image embedding is mapped into the mask decoder; Next, the image embedding, image position embedding, and hint token go into a two-layer encoder, each of which first self-attentions the tokens, then cross-attentions from the tokens to the image embeddings, then point-by-point feature transformations through a multi-layer perceptron to update each token, then cross-attentions from the image embedding to the hint tokens, and finally updates the image embedding using the hint information: In each attention operation, the image embedding is superimposed on its own position encoding, and the hint token is superimposed on the initial token: Among them, F i represents image embedding, PF represents the position encoding of image embedding, Ti represents token embedding, Tin i t represents the initial token embedding; the final output token and mask features are obtained after fine-tuning and updating.

8. The method for high-quality automatic instance segmentation of remote sensing images based on fine-tuning of the SAM large model according to claim 7, It is characterized in that In the seventh step, the global fusion features and the fine-tuned mask features are spatially multiplied point by point to generate high-quality mask features, that is, the global fusion features are first upsampled through transposed convolution: F agg ′=Φ ConvTran (F agg ,k,s,p)#(13) Among them, F agg is the global fusion feature, k is the convolution kernel size, s is the stride, p is the padding, Φ ConvTran represents spatial convolution; Then the global fusion features and mask features are convolved to obtain high-quality mask features: F HQ =Conv(F agg ,F mask )#(14) Among them, F mask is the mask feature, F HQ is a high-quality mask feature; Next, the output token is passed through three MLP layers to adjust the number of channels: Where W is the weight matrix, b is the bias term, and σ is the activation function; Finally, the high-quality mask features and the adjusted output tokens are matrix-multiplied to obtain the final mask prediction: M=F′ out ·F HQ #(16)。 9. The method for high-quality automatic instance segmentation of remote sensing images based on fine-tuning of the SAM large model according to claim 8, It is characterized in that In the eighth step, the weighted loss function is used to train and update the network for the adapter module and the region proposal network, that is, to calculate the object loss and positioning loss in the RPN, the classification loss of the semantic head, the regression loss associated with the positioning head, and the segmentation loss of the SAM decoder: in, represents the region proposal loss, represents the cross entropy loss calculated between the predicted category and the target, is the loss calculated based on the predicted coordinate offset and the object offset between the ground mask and the previous box, represents the binary CE loss between the SAM decoded mask and the instance mask, represents the loss of the fine-tuning adapter module, is the indicator function used to verify positive matches, η represents the weight factor of the auxiliary loss, M represents the number of samples for calculating the region proposal loss, and N represents the number of samples for calculating the classification loss.

10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Cited By

  • Remote sensing image segmentation method and device

    CN119152213A

  • Image classification method and device based on incremental learning, medium and product

    CN119206364A

  • Industrial drawing key symbol semantic recognition method and system

    CN119229469A

  • SAM-based end-to-end remote sensing target detection method, electronic equipment and storage medium

    CN119251700A

  • End-to-end remote sensing target detection method, electronic device and storage medium based on SAM

    CN119251700B