Twin structure change detection method for SAM2-assisted multi-scale feature coding
By using a SAM2-assisted multi-level Hiera encoder and a grouped channel self-attention mechanism, the problems of missed detection of small targets and blurred boundaries in remote sensing change detection are solved, and high-precision multi-scale change area detection is achieved.
Patent Information
- Application Number
- CN202511023213.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-24
- Publication Date
- 2025-11-07
AI Technical Summary
Existing dual-encoder-single-decoder change detection methods suffer from problems such as missed detection of small targets and inaccurate localization of complex boundaries in remote sensing change detection tasks.
A Siamese network architecture is constructed using a SAM2-assisted multi-level Hiera encoder. The feature response intensity is enhanced by multi-branch convolutional blocks and grouped channel self-attention mechanism. A target loss function for joint prediction of multi-scale feature difference maps is designed to achieve lightweight multi-scale features and cross-level feature collaborative optimization.
It significantly improves the model's detection accuracy for small-scale and irregularly shaped regions, reduces the false negative rate, and improves boundary localization accuracy, with an F1-score of up to 80.02%.
Smart Images

Figure CN120912916A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to an image change detection method, in particular to a SAM2 auxiliary multi-scale feature coding twin structure change detection method. BACKGROUND
[0002] Change detection of high spatial resolution optical remote sensing images is a key technology in remote sensing image processing. The core goal is to accurately identify surface change information, including urban expansion, new building / demolition, natural disaster damage area, vegetation cover change, and other applications, by intelligently analyzing high-resolution remote sensing images of the same geographical area acquired at different times. This technology has significant application value in land resource monitoring, urban planning, disaster assessment, and ecological environment protection.
[0003] In recent years, the combination of artificial intelligence technology and remote sensing big data, especially the application of deep learning technology, has significantly promoted the development of multi-temporal remote sensing image change detection, enabling it to shift from traditional methods to more automated, refined, and intelligent directions. The emergence of Vision Foundation Models (VFMs) has brought new opportunities to improve remote sensing image feature encoding capabilities. Representative models such as CLIP perform well in multi-modal image-text alignment and zero-shot transfer, but lack pixel-level fine segmentation capabilities. SAM, as the first general-purpose image segmentation VFM, has significant advantages in accurate boundary extraction and zero / few-shot transfer. However, its original ViT encoder has high computational cost, large parameters, and low inference efficiency. Although there have been targeted lightweight improvements, such as FastSAM replacing some ViT with CNN and MobileSAM using TinyViT for feature encoding. However, these VFMs still have obvious shortcomings in remote sensing change detection applications, with poor segmentation performance for small-scale and irregularly shaped objects, and problems of missed detection and fuzzy boundaries.
[0004] The SAM2 model makes important improvements to address the limitations of the above-mentioned VFMs. It uses a hierarchical image encoder Hiera based on MAE pre-training, which significantly improves multi-scale feature representation and network efficiency compared to the non-hierarchical ViT encoder of the original SAM. This natural multi-scale encoding characteristic is highly compatible with the dual-encoder-single-decoder framework, providing a new technical path to address the small target missed detection and complex boundary positioning problems faced by existing dual-encoder-single-decoder change detection methods in remote sensing change detection tasks. SUMMARY
[0005] Invention purposes: The purpose of the present application is to provide a SAM2 auxiliary multi-scale feature coding twin structure change detection method, which solves the problems of small target missed detection and complex boundary positioning inaccuracy in the existing double coding-single decoder change detection method in remote sensing change detection task.
[0006] Technical scheme: The SAM2 auxiliary multi-scale feature coding twin structure change detection method comprises the following steps:
[0007] A multi-level Hiera encoder is used to construct a twin network architecture, and the architecture is used to extract multi-scale feature maps of double temporal remote sensing images;
[0008] A multi-branch convolution block is used to reduce the channel dimension of the multi-scale feature map, and the absolute value of the difference between the corresponding scale feature maps of the two temporal remote sensing images is calculated to obtain the change area difference map of each scale;
[0009] The feature response intensity of the real change area in the change area difference map of each scale is enhanced to obtain a multi-scale feature difference map;
[0010] According to the hierarchical constraint relationship between different scale feature difference maps, the different scale feature difference maps are up-sampled to the original size and output in parallel to predict the map, and a multi-scale feature difference map joint prediction target loss function is used to calculate the multi-scale loss and weighted joint.
[0011] Preferably, the multi-level Hiera encoder based twin network architecture comprises:
[0012] Based on the Hiera encoder, the global relationship within the image window is independently calculated in each window to capture the local context dependency relationship, and the local feature modeling is enhanced by incorporating convolution operation while retaining channel mixing capability;
[0013] A hierarchical feature pyramid suitable for multi-scale change areas is automatically constructed by down-sampling and using step convolution operation between Hiera encoders, the parameters of the Hiera encoder are frozen, and an adapter parameter adjustment layer is inserted before each multi-scale module of the Hiera encoder;
[0014] The multi-scale feature map includes shallow features and deep features, the shallow features retain high-resolution details to capture small-scale change areas in the image, and the deep features encode high-level semantics to identify large-scale change areas in the image.
[0015] The present application constructs a Hiera coding module relying on the powerful coding ability of SAM2, and uses a twin network structure to extract features from double temporal remote sensing images. Through the design of multi-level encoders, a multi-scale feature pyramid is constructed to realize multi-level representation from fine-grained local features to high-level semantic features.
[0016] Preferably, the multi-branch convolution block is used to reduce the channel dimension of the multi-scale feature map, and the absolute difference value of the corresponding scale feature maps of the two time-phase remote sensing images is calculated.
[0017] The multi-scale feature map is processed by multiple multi-branch convolution blocks to reduce the channel dimension to 64 channels, realizing the lightweight and dimension unification of the multi-scale feature map. According to the lightweight dual-time multi-scale feature map, the absolute difference value of the corresponding scale feature maps of the two time-phase remote sensing images is calculated.
[0018] The application uses a multi-branch convolution block to reduce the channel dimension while enhancing the features to some extent, ensuring that the dual-time feature maps extracted from different Hiera encoding modules are unified to a lightweight dimension in the channel dimension. The absolute difference value of the corresponding hierarchical feature maps of the two time-phase remote sensing images is calculated to obtain the feature difference map of each level.
[0019] Further, the method for reducing the channel dimension to 64 channels is:
[0020] The multi-branch convolution block is applied to the encoding features at different stages of the Hiera encoder to reduce the channel dimension to 64:
[0021]
[0022] Where F1 i is the encoding feature at the i-th stage of the hierarchical encoder, is the encoding feature at the i-th stage of the hierarchical encoder, i∈[1,2,3,4];
[0023] The method for calculating the absolute difference value of the corresponding scale feature maps of the two time-phase remote sensing images is:
[0024] Suppose that at a certain stage of the Hiera encoder, the corresponding encoding image features F1 i and The change area difference map is obtained by the absolute difference of the dual-time feature maps The formula is as follows:
[0025]
[0026] Where H', W' and C' represent the height, width and channel number of D, respectively.
[0027] Preferably, the method for enhancing the feature response intensity of the real change area in the change area difference map of each scale includes:
[0028] The grouping channel self-attention enhancement module based on the design of the cavity convolution is adopted, the input feature map is grouped along the channel dimension, and the self-attention is calculated in each group, the long-distance dependence relationship is captured, the feature response strength of the real change region is enhanced, and the signal-to-noise ratio and feature saliency of the real change region in the change region difference graph are improved, so that the real change region and the background are distinguished.
[0029] The application takes into account the feature saliency deficiency of the multi-level feature generation change region difference graph of the dual-time phase remote sensing image, in order to more clearly distinguish the real change region and the background, the multi-scale channel grouping self-attention mechanism feature difference enhancement module is innovatively designed, the feature response strength of the real change region is enhanced, and the signal-to-noise ratio and feature saliency of the change region in the feature difference graph are improved.
[0030] Further, the step of enhancing the feature response strength of the real change region comprises the following steps:
[0031] After obtaining the change region difference graph D of the dual-time phase feature map, the projection feature QKV is calculated using 1×1 convolution and depth separable cavity convolution, the latter adopts 3×3 kernel and 2 inflation factor cavity convolution to expand the receptive field and extract more rich features, and the channel independence is maintained through the channel-by-channel convolution to retain the feature separation, and the formula is:
[0032] QKV=DepthConv 3×3,dilation=2 (Conv 1×1 (D))
[0033] Wherein, DepthConv represents the depth separable cavity convolution;
[0034] The projection feature QKV is split into query key and value Then, it is reshaped into a multi-head form, and g represents the number of attention heads, and the formula is:
[0035] Q,K,V=split(QKV,dim=1)
[0036] Dot product operation between the normalized Q and K is performed to calculate the attention of the change region in the feature difference graph, the feature is scaled using the learnable temperature parameter τ, and the softmax classifier is applied to obtain the attention map A, and the formula is:
[0037] A=softmax((Q·K T )·τ)
[0038] Finally, the attention map A is used for weighted summation of V to perform feature aggregation, and then 1×1 convolution is used to generate the enhanced output feature D GSEM , and the formula is:
[0039] D GSEM =Conv 1×1 (A·V)。
[0040] Preferably, the multi-scale feature difference map joint prediction target loss function is as follows:
[0041]
[0042] Wherein, m represents the index of the predicted feature map from bottom to top for loss calculation, M represents the total number of output feature layers, w represents the loss function weight of different level features, L BCE represents the joint loss function based on binary cross entropy, defined as follows:
[0043]
[0044] Wherein, n represents the pixel index, N represents the total number of pixels in the image, y n ∈{0,1} represents the true value of the first pixel change area, P n ∈{0,1} is the predicted probability of the change area, 0 represents the unchanged area, and 1 represents the change area.
[0045] In some embodiments, according to experience, the M is set to 3, w1 is 0.5, w2 is 0.5, and w3 is 1.0.
[0046] In order to make full use of the advantages of different scale features, the application designs a multi-scale feature difference map joint prediction target loss function, which not only calculates the loss in the final output layer, but also generates a prediction map from multiple intermediate layers during decoding, and uses the hierarchical constraint relationship between different scale features to weight and combine the multi-scale loss, further optimize the model training process, and improve the detection accuracy of the model to the multi-scale change area. The application shows obvious advantages in reducing the missed detection of small changes and improving the boundary positioning accuracy.
[0047] The second aspect of the application discloses a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor realizes the above method when executing the computer program.
[0048] The third aspect of the application discloses a computer storage medium, the computer storage medium stores instructions, and the instructions make the computer execute the above method when executed on the computer.
[0049] Advantages: compared with the prior art, the application has the following obvious advantages:
[0050] This invention addresses the shortcomings of traditional methods in optical remote sensing image change detection, particularly in detecting small-scale, multi-scale, and irregularly shaped regions. It proposes a Siamese structural change detection method assisted by the visual model SAM2 and multi-scale feature encoding. This method innovatively integrates SAM2's Hiera encoder to construct a multi-level feature pyramid architecture, effectively fusing shallow high-resolution details with deep global semantics, significantly improving the model's adaptability to scale differences. A multi-scale channel grouping self-attention mechanism feature difference enhancement module is proposed to enhance the feature difference map. Through a collaborative mechanism of channel grouping and dilated convolution, long-range dependency modeling is strengthened, significantly improving the response intensity of changed regions and optimizing the boundary localization accuracy of irregular regions, effectively suppressing false change interference. Simultaneously, a target loss function for joint prediction of multi-scale feature difference maps is designed to achieve cross-level feature collaborative optimization, synchronously constraining prediction results and significantly reducing the false negative rate at small scales. Experiments show that this method achieves an F1-score accuracy of 80.02% on the publicly available change detection dataset CLCD, effectively improving the robustness of the change detection model to multi-scale changed regions and the detection accuracy of irregularly shaped regions. Compared to existing change detection models, the SAM2 visual model-assisted multi-scale feature encoding twin structure change detection method significantly improves the model's ability to detect small-scale changes and complex shape changes, providing an effective solution for the accurate application of high-resolution remote sensing image change detection in scenarios such as land and resources monitoring, urban illegal construction identification, and disaster assessment. Attached Figure Description
[0051] Figure 1 This is an operation flowchart of the present invention;
[0052] Figure 2 This is an example of the CLCD dual-temporal remote sensing image dataset used in this invention;
[0053] Figure 3 This is a comparison of change detection results in the CLCD dataset with other methods; where TP pixels are green, FP pixels are yellow, and FN pixels are red. Green pixels represent correctly detected actual change areas (TP), yellow pixels represent false detection areas (FP), and red pixels represent missed detection areas (FN) where the model failed to identify changes. Detailed Implementation
[0054] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0055] like Figure 1 As shown, a method for detecting twin structure changes using SAM2-assisted multi-scale feature encoding based on the visual basic model is as follows:
[0056] (1) Leveraging the powerful encoding capabilities of the SAM2 large model, a Siamese change detection network architecture with Hiera encoding module-assisted dual-temporal feature encoding is constructed. Efficient local feature modeling is achieved through non-overlapping window self-attention and convolutional feedforward network. The stride convolution operation between Hiera encoders automatically constructs a multi-scale feature pyramid. Each Hiera encoder can promote low-cost global information fusion and support the progressive extraction of multi-scale features from fine-grained local details to high-level semantics in remote sensing images.
[0057] The registered dual-temporal remote sensing image (CLCD) dataset is input into a shared-weight Hiera hierarchical encoder to extract multi-scale features from the dual-temporal remote sensing images. Shallow features preserve high-resolution details to capture small-scale changing areas such as isolated buildings in the CLCD, while deep features encode high-level semantics to identify large-scale changing areas such as vegetation expansion in the CLCD. During this process, the SAM2 backbone parameters are frozen and a lightweight adapter is inserted to achieve efficient parameter fine-tuning. The specific steps are as follows:
[0058] (1.1) Based on the Hiera encoder, a non-overlapping window self-attention mechanism is adopted. This mechanism captures global relationships within each image window by independently calculating self-attention within each window, thereby modeling local contextual dependencies. The input is bi-temporal remote sensing images from the CLCD dataset. Each pair of remote sensing images... The image is divided into k×k non-overlapping windows, each with a size of M×M, where M = H / k or W / k. H, W, and C represent the height, width, and number of channels, respectively. X1 represents the image from the previous period T1, and X2 represents the image from the next period T2. Self-attention is computed independently for each window. Query Q is generated. sam2 Key K sam2 Sum V sam2 The linear projection of the matrix is shown below:
[0059] Q sam2 =XW Q ,K sam2 =XW K V sam2 =XW V
[0060] in, These are different linear projection weights. The attention weights within each window are calculated using a multi-head mechanism. Each head focuses on different subspace features, enhancing the modeling of contextual relationships at irregular boundaries. The formula is as follows:
[0061]
[0062] Where B is the learnable relative position bias, and d is the scaling factor derived from the attention head dimension.
[0063] (1.2) Convolutional feedforward network enhances local feature modeling by incorporating convolutional operations while preserving channel mixing capabilities. This design addresses the limitations of traditional Transformers in explicitly modeling local spatial relationships, which reduces sensitivity to detailed information such as edges and textures in remote sensing images in the CLCD dataset. Specifically, the convolutional feedforward network consists of three steps. First, use 1x1 convolution to expand the channel dimension to four times the original size. Then, use a 3x3 depth separable convolution to extract local spatial patterns, followed by a Gaussian Error Linear Unit (GELU) activation function for nonlinear transformation. Finally, use 1x1 convolution to restore the channel dimension to the original size, as follows:
[0064] X ConvFFN =Conv 1×1 (GELU(DepthConv(Conv 1×1 (X+Att(X)))))
[0065] where, is the output feature of the convolutional feedforward network from X1 and X2.
[0066] (1.3) By downsampling and using stride convolution, an automatic hierarchical feature pyramid is constructed to adapt to multi-scale changing regions. Due to the large number of parameters in the Hiera encoder, full fine-tuning requires a large amount of hardware resources. To solve this problem, the parameters of the Hiera encoder are frozen, and an adapter parameter layer is inserted before each multi-scale module of the Hiera encoder to achieve efficient parameter fine-tuning. CLCD uses the Hiera-Small model to avoid small sample overfitting.
[0067] (2) Use multi-branch convolutional modules to unify feature channels at each level, unify the feature channel dimension to 64, and reduce the channel dimension of multi-scale feature maps to effectively reduce the number of model parameters and achieve lightweight and dimension-unified multi-scale features. Calculate the absolute difference of the corresponding scale feature maps of the two time-phase remote sensing images to obtain the change region difference map at each scale, and generate a multi-scale hierarchical change region difference map through absolute difference operation, as follows:
[0068] (2.1) To lightweight image features, apply multi-branch convolutional blocks to the encoded features at different stages of the Hiera encoder to reduce the channel dimension to 64.
[0069]
[0070] where F1 i is the encoded feature at the i-th stage of the hierarchical encoder, is The encoding features of the i-th stage of the hierarchical encoder, i∈[1,2,3,4].
[0071] (2.2) Assuming that at a certain stage of the Hiera encoder, the encoding image features F1 corresponding to the dual-time-phase remote sensing images X1 and X2 are received i And The feature difference map is obtained by absolute difference of the dual-time-phase feature map The formula is as follows:
[0072]
[0073] Where H', W' and C' represent the height, width and channel number of D respectively.
[0074] (3) A grouped channel self-attention enhancement module is used to enhance the saliency of the real change area in the change area difference map, and to enhance the feature response strength of the real change area in the change area difference map at each scale, to obtain a multi-scale feature difference map. Experiments show that the channel self-attention enhancement module improves the change area response strength of the CLCD image and reduces the boundary positioning error. The specific steps are as follows:
[0075] (3.1) The grouped channel self-attention enhancement module is based on the dilated convolution, which groups the input feature map along the channel dimension and calculates the self-attention in each group. This module combines the advantages of dilated convolution and self-attention mechanism, effectively capturing long-range dependencies and reducing the phenomenon of boundary blur in complex boundary regions of remote sensing images. After obtaining the feature difference map D of the dual-time-phase feature map, a 1×1 convolution and a depth separable dilated convolution are used to calculate the projection feature QKV. The latter uses a 3×3 kernel and an inflation factor of 2 for dilated convolution to expand the receptive field and extract more rich features, while maintaining channel independence through channel-wise convolution to preserve feature separation. The formula is as follows:
[0076] QKV=DepthConv 3×3,dilation=2 (Conv 1×1 (D))
[0077] Where DepthConv represents the depth separable dilated convolution.
[0078] (3.2) The projection feature QKV is split into query key and value Then reshape to multi-head form, g represents the number of attention heads (set to 4 according to experience), the formula is as follows:
[0079] Q,K,V=split(QKV,dim=1)
[0080] (3.3) Dot product operation between the normalized Q and K is performed to calculate the attention of the changing area in the feature difference map, the features are scaled using a learnable temperature parameter τ, and a softmax classifier is applied to obtain the attention map A, as follows:
[0081] A = softmax((Q · K T ) · τ)
[0082] (3.4) Finally, the feature aggregation is performed using the attention map A to weight sum V, and then the enhanced output feature D is generated through 1x1 convolution GSEM , as follows:
[0083] D GSEM = Conv 1×1 (A · V)
[0084] (4) A target loss function for multi-scale feature difference map joint prediction is proposed. According to the hierarchical constraint relationship between different scale features, the feature difference map is upsampled to the original size and the prediction map is output in parallel. Then, the hierarchical constraint loss function is used to optimize the model, and the three-level prediction results are fused to generate a binary mask through threshold segmentation.
[0085] The target loss function for multi-scale feature difference map joint prediction optimizes the model training process using the hierarchical constraint relationship between different scale features, fully utilizes the multi-scale feature decoding to improve the model's detection ability for multi-scale changing areas, and makes the model have better adaptability to multi-scale changing areas. The specific steps are as follows:
[0086] (4.1) In order to generate prediction results from different scale feature difference maps in layers, a joint loss function based on binary cross entropy (BCE) is introduced. The joint loss function makes the model have better adaptability to multi-scale changing areas in the CLCD dataset. The BCE loss is defined as follows:
[0087]
[0088] Where n represents the pixel index, N represents the total number of pixels in the image. y n ∈{0,1} represents the true value of the nth pixel changing area, P n ∈{0,1} is the prediction probability of the changing area (0 represents the unchanged area and 1 represents the changing area).
[0089] (4.2) The joint prediction loss function of multi-level feature difference map is calculated as follows:
[0090]
[0091] where m represents the index of the predicted feature map from bottom to top for loss calculation, M represents the total number of output feature layers (set to 3 according to experience). According to experience, w1 is 0.5, w2 is 0.5, and w3 is 1.0.
[0092] (4.3) Quantitative results are shown in Table 1. The bold text in the table represents the highest precision value. The CLCD dataset contains complex and diverse change region types and significant irregular shapes. Despite this, the F1 value of the proposed method reached 80.02%, significantly better than the VFM-based comparison methods such as SFCD-Net, BAN and SAM-CD. The experimental results show that the method can effectively adapt to the shape and scale changes of these change regions. Overall, VFM-based methods exhibit more robust feature encoding capabilities, achieving better detection accuracy than most CNN and Transformer-based change detection methods. The method uses a hierarchical encoder for feature extraction, effectively capturing multi-scale global and local features in dual-phase remote sensing images. The target loss function jointly predicted by the multi-scale channel grouping self-attention mechanism and the multi-scale feature difference map enhances the change region features. This model can fully utilize the advantages of multi-scale feature encoding, minimize noise interference in the feature difference map, and improve the boundary accuracy of the change region. The comprehensive advantages shown by the experimental results verify the rationality and effectiveness of the design of these modules.
[0093] The accuracy of each model change detection result in step (4) is evaluated and displayed, Figure 3 The visualization of the change detection result sample in the CLCD dataset. The TP pixels are green, the FP pixels are yellow, and the FN pixels are red. The twin structure change detection method based on the visual-based model SAM2 assisted multi-scale feature encoding can accurately and completely obtain the boundary information of the ground objects, significantly better than other comparison methods. The change detection accuracy of the method of the patent compared with other representative methods on the dataset is shown in Table 1:
[0094] Table 1. Accuracy comparison of different change detection methods on the CLCD data
[0095]
[0096] The change detection method of the present application has higher accuracy than other models, and the F1 value detection accuracy can reach 80.02% on the CLCD dataset.
Claims
1. A SAM2-assisted multi-scale feature encoding twin structure change detection method, characterized in that, The method comprises the following steps: A multi-level Hiera encoder is used to build a twin network architecture, and the architecture is used to extract multi-scale feature maps of double-time remote sensing images; A multi-branch convolution block is used to reduce the channel dimension of the multi-scale feature maps, and the absolute difference value of the corresponding scale feature maps of the two time-phase remote sensing images is calculated to obtain the change area difference map of each scale; The feature response intensity of the real change area in the change area difference map of each scale is enhanced to obtain a multi-scale feature difference map; According to the hierarchical constraint relationship between different scale feature difference maps, the different scale feature difference maps are up-sampled to the original size and output in parallel to predict the map, and a multi-scale feature difference map is used to calculate the multi-scale loss and weighted joint.
2. The SAM2 aided multi-scale feature encoding twin structure variation detection method according to claim 1, characterized in that, The multi-level Hiera encoder is used to build a twin network architecture, which comprises: Based on the Hiera encoder, the global relationship within the image window is calculated independently in each window to capture the local context dependency relationship, and the local feature modeling is enhanced by fusing the convolution operation while retaining the channel mixing capability; A hierarchical feature pyramid suitable for multi-scale change areas is automatically constructed by down-sampling and using step convolution operation between Hiera encoders, the parameters of the Hiera encoder are frozen, and an adapter parameter adjustment layer is inserted before each multi-scale module of the Hiera encoder; The multi-scale feature map comprises shallow features and deep features, the shallow features retain high-resolution details to capture small-scale change areas in the image, and the deep features encode high-level semantics to identify large-scale change areas in the image.
3. The SAM2 aided multi-scale feature encoding twin structure variation detection method according to claim 1, characterized in that, The multi-branch convolution block is used to reduce the channel dimension of the multi-scale feature maps, and the absolute difference value of the corresponding scale feature maps of the two time-phase remote sensing images is calculated, which comprises: The multi-scale feature maps are processed by multiple multi-branch convolution blocks to reduce the channel dimension to 64 channels, realizing the lightweight and dimension unification of the multi-scale feature maps, and the absolute difference value of the corresponding scale feature maps of the two time-phase remote sensing images is calculated according to the lightweight double-time multi-scale feature maps.
4. The SAM2 aided multi-scale feature encoding twin structure variation detection method according to claim 3, characterized in that, The method for reducing the channel dimension to 64 channels comprises: A multi-branch convolution block is applied to the encoding features at different stages of the Hiera encoder to reduce the channel dimension to 64: wherein F1 i is the encoding feature at the i-th stage of the layered encoder, is the encoding feature at the i-th stage of the layered encoder, i ∈ [1, 2, 3, 4]; The method for calculating the absolute difference value of the corresponding scale feature maps of the two time-phase remote sensing images comprises: Suppose that at some stage of the Hiera encoder, encoded image features F1 corresponding to the dual temporal remote sensing images X1 and X2 are received i and The difference map of the change region is obtained by the absolute difference of the dual temporal feature maps The formula is as follows: Wherein H', W' and C' represent the height, width and channel number of D respectively.
5. The SAM2 aided multi-scale feature encoding twin structure variation detection method according to claim 1, characterized in that, The method for enhancing the feature response intensity of the real change area in the change area difference map of each scale comprises: A grouping channel self-attention enhancement module based on a design of a hollow convolution is used to group the input feature maps along the channel dimension, and the self-attention is calculated in each group to capture the long-distance dependency relationship, enhance the feature response intensity of the real change area, improve the signal-to-noise ratio and feature saliency of the real change area in the change area difference map, and distinguish the real change area from the background.
6. The SAM2 aided multi-scale feature encoded twin structure change detection method according to claim 5, wherein, The method for enhancing the feature response intensity of the real change area comprises the following steps: After obtaining the change region difference map D of the dual-time feature map, a projection feature QKV is calculated using a 1x1 convolution and a depth separable dilated convolution, the latter of which uses a 3x3 kernel and an inflation factor of 2 to expand the receptive field and extract more abundant features, while maintaining channel independence by using a channel-wise convolution to retain feature separation, and the formula is as follows: QKV = DepthConv 3×3,dilation=2 (Conv 1×1 (D)) wherein DepthConv represents the depth separable dilated convolution; Split the projection feature QKV into queries keys and Then reshape into multi-head form, g represents the number of attention heads, the formula is: Q, K, V = split(QKV, dim = 1) The attention of the change region in the feature difference map is calculated by performing a dot product operation between the normalized Q and K, a learnable temperature parameter τ is used to scale the features, and a softmax classifier is applied to obtain the attention map A, and the formula is as follows: A = softmax((Q · K T ) · τ) Finally, the features are aggregated by using the attention map A to weight sum V, and then the enhanced output features D are generated by 1x1 convolution GSEM The formula is: D GSEM = Conv 1×1 (A·V).
7. The SAM2 aided multi-scale feature encoding twin structure variation detection method according to claim 1, characterized in that, The target loss function of the multi-scale feature difference map joint prediction is as follows: wherein m represents the index from bottom to top of the predicted feature map for loss calculation, M represents the total number of output feature layers, w represents the loss function weight of different levels of features, L BCE represents a joint loss function based on binary cross-entropy, defined as follows: where n represents the pixel index, N represents the total number of pixels in the image, y n ∈{0,1} represents the true value of the nth pixel change region, P n ∈{0,1} is the predicted probability of the change region, 0 represents the unchanged region, and 1 represents the changed region.
8. The SAM2 aided multi-scale feature encoded twin structure change detection method according to claim 7, characterized in that, According to experience, the M is set to 3, w1 is 0.5, w2 is 0.5, and w3 is 1.
0. 9.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-8 when the computer program is executed by the processor. The processor executes the computer program to implement the method of any one of claims 1-8.
10. A computer storage medium, characterized in that The computer storage medium stores instructions, and the instructions are executed on the computer to make the computer execute the method of any one of claims 1-8.
Citation Information
Cited By
Abandoned farmland accurate extraction method and device based on time sequence remote sensing image, and medium
CN122067116A
