A road change detection model training method based on regional supervision and a SAM model

By using a road change detection method based on regional supervision and SAM model, and generating adaptive pseudo-labels by utilizing multi-scale difference features and attention mechanism, the problem of detection accuracy and efficiency in complex scenarios is solved, and high-precision, low-dependency road change detection is achieved.

CN122289852BActive Publication Date: 2026-08-25ZENMORN (HEFEI) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610757851.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-05-29
Publication Date
2026-08-25
Estimated Expiration
2046-05-29

AI Technical Summary

Technical Problem

Existing road change detection methods suffer from low accuracy and poor adaptability in complex scenarios, and are highly dependent on labeled data, resulting in low detection efficiency.

Method used

A road change detection model training method based on regional supervision and SAM model is adopted. Local and global attention features are extracted through multi-scale difference features to generate attention pseudo-labels and SAM segmentation maps. The change detection model is optimized by combining adaptive pseudo-labels.

Benefits of technology

It improves the accuracy and robustness of road change detection, reduces reliance on labeled data, and enhances detection efficiency and generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122289852B_ABST
    Figure CN122289852B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of computer vision and remote sensing image processing, and relates to a road change detection model training method based on regional supervision and a SAM model, comprising: performing feature difference on double-phase remote sensing images to obtain multi-scale difference features; extracting local attention features and global attention features according to the multi-scale difference features, and fusing to generate attention pseudo labels; inputting the difference map and the regional label corresponding to the double-phase remote sensing images into the SAM model to generate a SAM segmentation map; performing double-path threshold judgment according to the attention pseudo label and the SAM segmentation map to obtain an adaptive pseudo label; inputting the double-phase remote sensing images into the change detection model to generate a road change prediction result, and optimizing the change detection model according to a loss value generated by the adaptive pseudo label and the road change prediction result. The application effectively improves the detection precision of the traffic road change detection model and makes it have strong generalization ability, while reducing the dependence on labeled data and improving the detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and remote sensing image processing technology, specifically relating to a method for training a road change detection model based on regional supervision and SAM model. Background Technology

[0002] With the acceleration of urbanization and the continuous development of transportation networks, traffic road change detection is of great significance in urban planning, traffic management, disaster assessment and other fields.

[0003] Traditional road change detection methods mainly rely on manually designed features and simple image difference techniques. These methods often fail to effectively distinguish similar areas between the road and the background in complex scenes, and are sensitive to factors such as lighting and viewing angle, resulting in low detection accuracy and poor adaptability.

[0004] In recent years, deep learning methods have made significant progress in the field of change detection, especially in automatic feature extraction and high-dimensional feature modeling. However, existing deep learning methods still have some problems: for example, insufficient feature extraction in complex scenes, inaccurate localization of change regions, and challenges in the accurate segmentation and detection of change regions.

[0005] Meanwhile, the above methods often require a large amount of labeled data for training. The labeling process is not only time-consuming and labor-intensive, but also increases in cost and workload as the dataset size increases, resulting in high cost and time consumption for obtaining labeled data.

[0006] In summary, how to effectively improve the detection accuracy of traffic road change detection models and give them strong generalization ability, while reducing dependence on labeled data and improving detection efficiency, has become an important technical problem that urgently needs to be solved in the field of road change detection. Summary of the Invention

[0007] In view of the shortcomings of the prior art described above, the purpose of this invention is to provide a road change detection model training method based on regional supervision and SAM model, which can improve the detection accuracy of traffic road change detection model and make it have strong generalization ability, while reducing the dependence on labeled data and improving detection efficiency.

[0008] This invention provides a method for training a road change detection model based on regional supervision and SAM model, including: Acquire dual-temporal remote sensing images and corresponding region labels, and perform feature difference on the dual-temporal remote sensing images to obtain multi-scale difference features; Local attention features and global attention features are extracted based on the multi-scale difference features, and the local attention features and global attention features are fused together. Attention pseudo-labels are generated based on the fused result. The difference map corresponding to the dual-temporal remote sensing images and the region labels are input into a pre-trained SAM model to generate a SAM segmentation map; Dual-path thresholding is performed based on the attention pseudo-labels and the SAM segmentation map to obtain adaptive pseudo-labels; The dual-temporal remote sensing images are input into a pre-constructed change detection model to generate road change prediction results. The change detection model is then optimized based on the adaptive pseudo-labels and the loss values ​​generated from the road change prediction results to obtain a trained change detection model.

[0009] In one embodiment of the present invention, performing feature difference on the dual-temporal remote sensing images to obtain multi-scale difference features includes: A feature extraction network is used to extract features from the dual-temporal remote sensing images to obtain dual-temporal image feature representations at multiple scales; The dual-time image feature representation is subjected to scale-wise feature difference and normalization processing to obtain multi-scale difference features.

[0010] In one embodiment of the present invention, extracting local attention features based on the multi-scale difference features includes: The multi-scale difference features are divided into multiple non-overlapping local windows; The features within each non-overlapping local window are reshaped to obtain a two-dimensional matrix vector. A linear mapping is performed on the two-dimensional matrix vector corresponding to each non-overlapping local window to obtain the local query vector, local key vector, and local value vector; For each non-overlapping local window, perform in-window self-attention calculation on the local query vector, local key vector, and local value vector to obtain the corresponding self-attention features; The local attention features are obtained by reverse reshaping based on the self-attention features corresponding to all non-overlapping local windows.

[0011] In one embodiment of the present invention, global attention features are extracted based on the multi-scale difference features, including: The multi-scale difference features are divided into multiple non-overlapping local windows; Average pooling is performed on the features within each non-overlapping local window to obtain the corresponding average feature vector, and an average pooled feature map is generated based on the average feature vectors corresponding to all non-overlapping local windows. A linear transformation is performed on the average pooling feature map to obtain a global key vector and a global value vector. A linear transformation is also performed on the multi-scale difference features to obtain a global query vector. Global self-attention is calculated on the global key vector, the global value vector, and the global query vector to obtain global attention features.

[0012] In one embodiment of the present invention, the fusion of the local attention features and the global attention features includes: The local attention features and the global attention features are concatenated to obtain the concatenated features; The spliced ​​features are normalized to obtain the fused attention feature map.

[0013] In one embodiment of the present invention, generating attention pseudo-labels based on the fused result includes: Calculate the inter-class variance based on the gray-level histogram corresponding to the fused attention feature map; The optimal segmentation threshold is determined by maximizing the inter-class variance. The fused attention feature map is adaptively divided into regions based on the optimal segmentation threshold to obtain attention pseudo-labels.

[0014] In one embodiment of the present invention, the step of performing dual-path threshold judgment based on the attention pseudo-label and the SAM segmentation map to obtain adaptive pseudo-labels includes: The attention pseudo-labels are subjected to erosion and dilation to obtain the first pseudo-label image; Perform connected component analysis on the first pseudo-label graph to obtain the second pseudo-label graph; Gaussian smoothing is applied to the second pseudo-label image to obtain optimized attention pseudo-labels; Dual-path thresholding is performed based on the optimized attention pseudo-labels and the SAM segmentation map to obtain adaptive pseudo-labels.

[0015] In one embodiment of the present invention, the step of inputting the difference map corresponding to the dual-temporal remote sensing images and the region labels into a pre-trained SAM model to generate a SAM segmentation map includes: The dual-temporal remote sensing images are subtracted pixel by pixel to generate a difference map; The region labels are used as prompts for the SAM model. The difference map is input into the pre-trained SAM model for segmentation processing to obtain multiple candidate segmentation masks. The SAM segmentation map is selected from the candidate segmentation mask.

[0016] In one embodiment of the present invention, the step of performing dual-path threshold judgment based on the attention pseudo-label and the SAM segmentation map to obtain adaptive pseudo-labels includes: The intersection-union ratio (IU) is calculated as the matching degree based on the attention pseudo-labels and the SAM segmentation map; If the matching degree between the attention pseudo-label and the SAM segmentation map is greater than or equal to the adaptive threshold, then the SAM segmentation map is used as the adaptive pseudo-label. If the matching degree between the attention pseudo-label and the SAM segmentation map is less than the adaptive threshold, then the attention pseudo-label is used as the adaptive pseudo-label.

[0017] In one embodiment of the present invention, the change detection model includes a feature extraction network and a segmentation network. The step of inputting the dual-temporal remote sensing image into the pre-constructed change detection model to generate road change prediction results includes: The feature extraction network is used to extract features from the dual-temporal remote sensing images to obtain multi-scale difference features; The road change prediction result is obtained by using the segmentation network to predict changes based on the multi-scale difference features.

[0018] The beneficial effects of this invention are as follows: This invention extracts different resolution features from dual-temporal images at different stages of ResNet, obtains multi-scale difference features through scale-wise differencing, captures change information at different granularities, enhances change sensitivity, provides rich input for the attention mechanism, and ultimately improves the accuracy and robustness of change detection. Local attention features acquire feature responses of local regions through a small window self-attention mechanism, focusing on fine-grained local changes, while global attention features extract overall environmental information through pooling operations, which helps to capture overall environmental information. The combination of the two can enhance the detection results' ability to perceive road changes. The SAM model uses the original region labels as weak supervision signals to generate a segmentation mask, providing prior information for subsequent pseudo-label generation. The SAM segmentation map has strong generalization ability but may be coarse, while the attention pseudo-labels are fine but may be noisy. Adaptive selection combines the advantages of both, which can improve the robustness of detection and the accuracy of model detection. Using adaptive pseudo-labels as supervisory signals to optimize change detection models can reduce dependence on labeled data and improve detection efficiency. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0020] Figure 1 This is a flowchart illustrating a gated dual-branch network training method provided in one embodiment of the present invention; Figure 2 This is a flowchart illustrating the structure of generating attention pseudo-labels based on an attention mechanism, as provided in one embodiment of the present invention. Figure 3 This is a flowchart illustrating the structure of generating adaptive pseudo-labels based on the SAM model in one embodiment of the present invention. Detailed Implementation

[0021] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings, which illustrate embodiments of the present application. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that the disclosure of this application will be thorough and complete.

[0022] This invention provides a road change detection model training method based on regional supervision and SAM model, which is used to improve the limitations of existing technologies in traffic road change detection, such as complex scenarios, noise interference, and time-consuming and laborious data annotation. It also solves the shortcomings of traditional methods in high-precision change detection.

[0023] This invention combines SAM (Separate Aspect-Oriented Analysis) with an attention mechanism, enabling more precise separation of changing regions and background, thus improving the localization accuracy of changing regions. By introducing region supervision and an attention mechanism, it achieves efficient and accurate traffic road change detection without relying on a large amount of manually labeled data. This invention not only reduces the workload and cost of manual labeling but also adapts to change detection tasks in complex scenarios, demonstrating strong generalization ability.

[0024] The road change detection model of the present invention provides preliminary segmentation information for the input image through SAM, generates high-quality change detection results, and can effectively cope with a variety of complex situations and provide more reliable change detection information.

[0025] Please see Figure 1 As shown, a method for training a road change detection model based on regional supervision and SAM model includes the following steps: S1. Obtain dual-temporal remote sensing images and corresponding region labels, and perform feature difference on the dual-temporal remote sensing images to obtain multi-scale difference features.

[0026] In this embodiment of the invention, a dual-temporal remote sensing image refers to two remote sensing images of the same geographical area acquired at two different time points; acquiring dual-temporal remote sensing images of the same area at different time points. and ,in, Remote sensing images representing an initial time (e.g., January 2023), Remote sensing images representing a later time (e.g., December 2023).

[0027] In addition, the acquired dual-temporal remote sensing images may have problems such as noise or uneven brightness. Data preprocessing operations can be performed on the acquired dual-temporal remote sensing images, such as image denoising, normalization and contrast enhancement, histogram equalization, edge enhancement, etc., to optimize image quality, ensure the quality of input data, and improve the accuracy of subsequent analysis.

[0028] Specifically, dual-temporal remote sensing images can come from high-resolution optical remote sensing satellites, synthetic aperture radar (SAR), or multispectral remote sensing platforms to ensure that information on changes in traffic roads and their surrounding environment is captured.

[0029] Furthermore, for the acquired dual-temporal remote sensing images, manual annotation or auxiliary algorithm annotation methods can be used to generate region-level supervision signals, i.e., region labels. Specifically, region labels are used to indicate which regions in the image are regions of interest (e.g., road areas, areas that may change), and in this invention, they are used to guide subsequent SAM change detection tasks and provide preliminary prior information.

[0030] Manual annotation can be performed by professionals or remote sensing analysts based on high-resolution images and actual road distribution, ensuring the accuracy and reliability of the annotation results. Alternatively, automated annotation can be performed using existing road vector data or high-precision map data, such as ALPS (Automatic Labeling for Pre-training in Segmentation) automatic annotation or SAM (Segment Anything Model) assisted annotation, to reduce manual intervention and improve annotation efficiency.

[0031] In this embodiment of the invention, performing feature difference analysis on the dual-temporal remote sensing images to obtain multi-scale difference features includes: A feature extraction network is used to extract features from the dual-temporal remote sensing images to obtain dual-temporal image feature representations at multiple scales; The dual-time image feature representation is subjected to scale-wise feature difference and normalization processing to obtain multi-scale difference features.

[0032] To effectively capture the change information between two-temporal remote sensing images, this invention can use a dual-branch parallel ResNet (Residual Network) as the feature extraction network to extract deep semantic features of the two-temporal remote sensing images from different scales, thereby enhancing the sensitivity to changes in the region.

[0033] Specifically, a parallel ResNet encoder with two shared parameters is used to extract the previous temporal image from the dual-temporal remote sensing image in parallel. and post-phase images Corresponding multi-scale image feature representation and It emphasizes temporal variation information. The ResNet encoder contains multiple convolutional layers, pooling layers, and skip connections to preserve information at different scales. Each convolutional block outputs a feature map at one scale, extracting dual-temporal image feature representations. , It contains spatial semantic information at different levels.

[0034] For example, a dual-temporal remote sensing image has dimensions of 3*256*256, and the ResNet encoder contains a five-layer structure: The first layer consists of a 7*7 convolutional layer, a normalization layer, and a ReLU (corrected linear unit). The input dimension is 3*256*256, and the output dimension is 64*128*128. The second layer contains two residual blocks, each containing two 3*3 convolutional layers with an input dimension of 64*128*128 and an output dimension of 64*128*128. The third layer contains two residual blocks, each containing two 3*3 convolutional layers with an input dimension of 64*128*128 and an output dimension of 128*64*64. The fourth layer contains two residual blocks, each containing two 3*3 convolutional layers with an input dimension of 128*64*64 and an output dimension of 256*32*32. The fourth layer contains two residual blocks, each containing two 3x3 convolutional layers with an input dimension of 256*32*32 and an output dimension of 512*16*16.

[0035] The dual-time image feature representation obtained in this invention refers to the feature representation extracted from the same image at different spatial scales (resolutions). Among them, large-scale (low-resolution) features have a large receptive field and contain more semantic information (e.g., this is a road, this is a building area), but the spatial location is not fine; small-scale (high-resolution) features have a small receptive field and contain more spatial detail information (e.g., road edges, small area changes), but the semantic information is weaker.

[0036] Obtaining dual-time image feature representation and Subsequently, for each scale, the element-wise difference method is used to calculate the multi-scale difference features, and the absolute value is taken to obtain the multi-scale difference features. Here, D represents the multi-scale difference feature, and its value indicates the degree of difference between the two-phase remote sensing images corresponding to different time points. A larger value means that the region has undergone more significant changes, while a smaller value means that the region has remained basically unchanged between the two time points.

[0037] This invention uses a feature extraction network to obtain multi-scale differential features that can simultaneously capture both large and small changes. Large-scale (deep) features can detect regional, semantic-level changes (e.g., a newly built road); small-scale (shallow) features can detect local, subtle changes (e.g., road edge repairs, small-scale construction). This avoids focusing only on large changes while ignoring details, or focusing only on details while ignoring the overall structure, effectively enhancing the information expression of the changed areas. Features at different scales respond differently to changes in the region. By using multi-scale difference, the change signal can be enhanced at different resolutions, the interference from unchanged regions can be suppressed, and the recall rate of change detection can be improved. Multi-scale difference features enable the change detection model to have good detection capabilities for road changes at different scales, thus enhancing its generalization ability. Subsequent local and global attention needs to be computed at different scales or different receptive fields. Multi-scale differential features support fine computation of local attention on high-resolution features (small scale) and global attention on low-resolution features (large scale) for overall modeling, making the fusion of local and global attention more effective and improving the localization accuracy of changing regions.

[0038] S2. Extract local attention features and global attention features based on the multi-scale difference features, fuse the local attention features and global attention features, and generate attention pseudo-labels based on the fused results.

[0039] See Figure 2 As shown, the multi-scale difference features are feature maps, which can be represented as follows: , where H, W and C represent the height, width and number of channels of the feature map, respectively.

[0040] Further, local attention features are extracted based on the multi-scale difference features, including: The multi-scale difference features are divided into multiple non-overlapping local windows; The features within each non-overlapping local window are reshaped to obtain a two-dimensional matrix vector. A linear mapping is performed on the two-dimensional matrix vector corresponding to each non-overlapping local window to obtain the local query vector, local key vector, and local value vector; For each non-overlapping local window, perform in-window self-attention calculation on the local query vector, local key vector, and local value vector to obtain the corresponding self-attention features; The local attention features are obtained by reverse reshaping based on the self-attention features corresponding to all non-overlapping local windows.

[0041] In a practical application scenario of this invention, in order to extract local attention information, the multi-scale difference features can be divided into non-overlapping windows of size 3×3. Each window contains feature vectors of 9 spatial locations, and the features in each non-overlapping local window can be represented as 3×3×C.

[0042] To compute local attention, the features within each non-overlapping local window are reshaped and flattened into a matrix form, and the two-dimensional matrix vector corresponding to each non-overlapping local window is represented as 9×C.

[0043] A 1×1 convolution is used to linearly map the reshaped 2D matrix vector, generating a local query vector Q, a local key vector K, and a local value vector V corresponding to each non-overlapping local window:

[0044] in, Let be the locally trainable query projection matrix, key projection matrix, and value projection matrix, respectively, and let be the two-dimensional matrix vector corresponding to the i-th non-overlapping local window.

[0045] Furthermore, the attention weights within the local window are obtained by performing a dot product calculation based on the local query vector and the local key vector, and then Softmax normalization is applied. d is the dimension (i.e., the number of channels) of the Q and K vectors; by using attention weights to perform a weighted summation of the local value vectors, the self-attention features corresponding to each non-overlapping local window are obtained. .

[0046] Rearrange the self-attention features of all local windows back to the original feature map dimensions (i.e., the feature map dimensions corresponding to the multi-scale difference features) to form local attention features. .

[0047] Specifically, global attention features are extracted based on the multi-scale difference features, including: The multi-scale difference features are divided into multiple non-overlapping local windows; Average pooling is performed on the features within each non-overlapping local window to obtain the corresponding average feature vector, and an average pooled feature map is generated based on the average feature vectors corresponding to all non-overlapping local windows. A linear transformation is performed on the average pooling feature map to obtain a global key vector and a global value vector. A linear transformation is also performed on the multi-scale difference features to obtain a global query vector. Global self-attention is calculated on the global key vector, the global value vector, and the global query vector to obtain global attention features.

[0048] In a practical application scenario of this invention, in order to extract global attention information, the multi-scale difference features can be divided into non-overlapping local windows of size 3×3. Each window contains feature vectors of 9 spatial locations, and the features in each non-overlapping local window can be represented as 3×3×C.

[0049] For each 3×3 local window, average pooling is applied to calculate the average eigenvector within the window, resulting in a 1×1×C average eigenvector. After all local windows have been calculated, a low-resolution average pooled feature map P can be obtained based on the average eigenvectors corresponding to all non-overlapping local windows.

[0050] A linear transformation is performed on the average pooling feature map P to generate the corresponding global key vector. and global value vector A linear transformation is performed on the multi-scale difference features D to obtain the global query vector. :

[0051] in, These are the globally trainable query projection matrix, key projection matrix, and value projection matrix, respectively.

[0052] Furthermore, global attention weights are calculated based on the global key vector and the global query vector. , yes and The dimension of the vector (i.e., the number of channels). This represents the similarity between each pixel corresponding to the multi-scale difference feature and the average pooling feature, and is calculated based on the global attention weights and the global value vector. Generate global attention features .

[0053] Further, the fusion of the local attention features and the global attention features includes: The local attention features and the global attention features are concatenated to obtain the concatenated features; The spliced ​​features are normalized to obtain the fused attention feature map.

[0054] In this embodiment of the invention, the calculated local attention is concatenated with the local attention, and then a 1×1 convolution is used for feature fusion to obtain the concatenated features. To improve the stability of the model, the splicing features are normalized to standardize their value range to [0, 1].

[0055] In this invention, the changing region often has local detailed features and global contextual information, so local attention and global attention are calculated separately. The local attention feature obtains the feature response of the local region through the small window self-attention mechanism, focusing on fine-grained local changes, while the global attention feature extracts the overall environmental information through pooling operation, which helps to capture the overall environmental information. The combination of the two can enhance the detection results' ability to perceive road changes.

[0056] Furthermore, the step of generating attention pseudo-labels based on the fused result includes: Calculate the inter-class variance based on the gray-level histogram corresponding to the fused attention feature map; The optimal segmentation threshold is determined by maximizing the inter-class variance. The fused attention feature map is adaptively divided into regions based on the optimal segmentation threshold to obtain attention pseudo-labels.

[0057] To extract potential change regions from the fused attention feature map, this invention employs the Otsu adaptive threshold segmentation method. The Otsu adaptive threshold segmentation method calculates the intra-class and inter-class variances corresponding to the grayscale histogram of the fused attention feature map to distinguish between change regions and unchanged regions. An optimal segmentation threshold is selected to maximize the inter-class variance, and this optimal threshold is used to binarize the fused attention feature map, resulting in preliminary generated attention pseudo-labels.

[0058] S3. Input the difference map corresponding to the dual-temporal remote sensing image and the region label into the pre-trained SAM model to generate the SAM segmentation map.

[0059] In this embodiment of the invention, the step of inputting the difference map corresponding to the dual-temporal remote sensing images and the region labels into a pre-trained SAM model to generate a SAM segmentation map includes: The dual-temporal remote sensing images are subtracted pixel by pixel to generate a difference map; The region labels are used as prompts for the SAM model. The difference map is input into the pre-trained SAM model for segmentation processing to obtain multiple candidate segmentation masks. The SAM segmentation map is selected from the candidate segmentation mask.

[0060] See Figure 3 As shown, element-wise subtraction between the two temporal remote sensing images is performed to obtain a difference feature map that can characterize the changed areas. It can be used to represent the intensity of pixel-level changes between phase remote sensing images; inputting the difference map into the pre-trained SAM model can highlight the change information more effectively than the original bi-temporal remote sensing images, making it more suitable for guiding SAM segmentation.

[0061] In this embodiment of the invention, SAM (Segment Anything Model) is used to accept points, boxes, region labels, etc. as prompts and output corresponding segmentation masks. The generated segmentation masks have clear boundaries and complete regions. The advantage of the SAM model lies in its strong generalization ability, which can adapt to different scenarios and data distributions and improve the reliability of segmentation.

[0062] In this invention, original region labels are provided. As a cue (a weakly supervised signal, annotating the region of interest, such as a road region), the difference map of the two temporal images is input into the pre-trained SAM model. The SAM model generates candidate segmentation masks based on the images and the cue. The candidate segmentation mask output by the SAM model includes potential variation regions, providing prior information for subsequent pseudo-label generation.

[0063] It should be noted that before performing dual-path threshold determination based on the attention pseudo-labels and the SAM segmentation map, the following steps are also included: The attention pseudo-labels are subjected to erosion and dilation to obtain the first pseudo-label image; Perform connected component analysis on the first pseudo-label graph to obtain the second pseudo-label graph; Gaussian smoothing is applied to the second pseudo-label image to obtain optimized attention pseudo-labels; Dual-path thresholding is performed based on the optimized attention pseudo-labels and the SAM segmentation map to obtain adaptive pseudo-labels.

[0064] To improve the accuracy and stability of attention pseudo-labels, this invention performs post-processing optimization on the initially generated attention pseudo-labels: an erosion operation is performed using a 3×3 structuring element to remove isolated noise points; subsequently, a dilation operation is performed to restore the integrity of the main change regions; connected component analysis is performed, the area of ​​connected regions is calculated, an area threshold is set, and connected regions with areas smaller than the area threshold are removed; Gaussian filtering is used to smooth the boundaries to reduce discontinuities in the pseudo-labels, ensuring the accuracy and stability of the pseudo-labels, ultimately obtaining optimized attention pseudo-labels generated based on the attention map. .

[0065] S4. Perform dual-path threshold judgment based on the attention pseudo-label and the SAM segmentation map to obtain adaptive pseudo-label.

[0066] In this embodiment of the invention, the step of performing dual-path threshold judgment based on the attention pseudo-label and the SAM segmentation map to obtain adaptive pseudo-labels includes: The intersection-union ratio (IU) is calculated as the matching degree based on the attention pseudo-labels and the SAM segmentation map; If the matching degree between the attention pseudo-label and the SAM segmentation map is greater than or equal to the adaptive threshold, then the SAM segmentation map is used as the adaptive pseudo-label. If the matching degree between the attention pseudo-label and the SAM segmentation map is less than the adaptive threshold, then the attention pseudo-label is used as the adaptive pseudo-label.

[0067] This invention aims to evaluate the segmentation mask (i.e., SAM segmentation map) generated by SAM. Attention pseudo-labels generated based on fusion attention maps The similarity between them is measured using the Intersection over Union (IoU) ratio as the matching metric:

[0068] An adaptive threshold K is set as the standard for judging the matching degree between the SAM segmentation result and the attention pseudo-label. If the currently calculated IoU value is greater than or equal to the adaptive threshold, it means that the matching degree between the SAM segmentation result and the attention pseudo-label is high; otherwise, the matching degree is low.

[0069] If the IoU value is greater than or equal to the adaptive threshold, the SAM segmentation result is considered relatively accurate and can be used directly. This serves as the final adaptive pseudo-label; if the IoU value is less than the adaptive threshold, it indicates that the attention pseudo-label may be more reliable, and it is selected. As the final adaptive pseudo-label.

[0070] In this embodiment of the invention, SAM has strong generalization ability but may be coarse, while attention pseudo-labels are fine but may be noisy. Adaptive selection combines the advantages of both and can also improve the robustness of detection.

[0071] This invention generates attention pseudo-labels based on fused attention maps and dynamically determines the final adaptive pseudo-labels by combining adaptive thresholds or clustering algorithms, which are used to guide the detection tasks of change detection models.

[0072] S5. Input the dual-temporal remote sensing image into the pre-constructed change detection model to generate road change prediction results, and optimize the change detection model based on the adaptive pseudo-label and the loss value generated by the road change prediction results to obtain the trained change detection model.

[0073] In this embodiment of the invention, the change detection model includes a feature extraction network and a segmentation network. The step of inputting the dual-temporal remote sensing image into the pre-constructed change detection model to generate road change prediction results includes: The feature extraction network is used to extract features from the dual-temporal remote sensing images to obtain multi-scale difference features; The road change prediction result is obtained by using the segmentation network to predict changes based on the multi-scale difference features.

[0074] In this embodiment of the invention, the change detection model includes a feature extraction network and a segmentation network, consisting of multiple convolutional layers, normalization layers, and ReLU activation functions. The feature extraction network is used to extract multi-scale difference features from dual-temporal remote sensing images, and its structure is similar to the ResNet encoder described above. The segmentation network is used to map the "multi-scale difference features" to a binary prediction result of "whether each pixel belongs to a road change area". High-level semantic features can be further extracted through convolutional layers and ReLU. The upsampling layer restores the feature map to the original image resolution and outputs a pixel-level change probability map. A change mask is generated through a binarization operation, where a value of 1 indicates a change and a value of 0 indicates an unchanged area.

[0075] For example, a change detection model can be a segmentation network with an encoder-decoder structure (containing convolution, normalization, ReLU, etc.). It can use lightweight U-Net (U-shaped fully convolutional neural network) or FCN (Fully Convolutional Network) for convolution or downsampling processing, and use upsampling layers to gradually restore spatial resolution and generate road change prediction results.

[0076] Furthermore, the change detection model calculates pixel-level change probabilities through forward propagation and optimizes the loss function using supervised learning. When optimizing with Binary Cross-Entropy (BCE), adaptive pseudo-labels are used as supervision signals to calculate the cross-entropy loss. The network parameters of the change detection model are updated through backpropagation. After the model is trained, it can be used for fast inference.

[0077] This invention obtains high-quality adaptive pseudo-labels by adaptively selecting SAM segmentation results and attention pseudo-labels, thus providing reliable supervision signals for change detection models without the need for pixel-level annotation.

[0078] In summary, this invention extracts different resolution features from dual-temporal images at different stages of ResNet, obtains multi-scale difference features through scale-wise differencing, captures change information at different granularities, enhances change sensitivity, provides rich input for the attention mechanism, and ultimately improves the accuracy and robustness of change detection. Local attention features acquire feature responses of local regions through a small window self-attention mechanism, focusing on fine-grained local changes, while global attention features extract overall environmental information through pooling operations, which helps to capture overall environmental information. The combination of the two can enhance the detection results' ability to perceive road changes. The SAM model uses the original region labels as weak supervision signals to generate a segmentation mask, providing prior information for subsequent pseudo-label generation. The SAM segmentation map has strong generalization ability but may be coarse, while the attention pseudo-labels are fine but may be noisy. Adaptive selection combines the advantages of both, which can improve the robustness of detection and the accuracy of model detection. Using adaptive pseudo-labels as supervisory signals to optimize change detection models can reduce dependence on labeled data and improve detection efficiency.

[0079] In the several embodiments provided by this invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0080] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0081] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0082] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0083] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for training a road change detection model based on regional supervision and SAM model, characterized in that, include: Acquire dual-temporal remote sensing images and corresponding region labels, and perform feature difference on the dual-temporal remote sensing images to obtain multi-scale difference features; Local attention features and global attention features are extracted based on the multi-scale difference features, and the local attention features and global attention features are fused together. Attention pseudo-labels are generated based on the fused result. The difference map generated by subtracting pixels from the dual-temporal remote sensing images and the region labels are input into a pre-trained SAM model to generate a SAM segmentation map. Calculate the matching degree between the attention pseudo-label and the SAM segmentation map, and make a threshold judgment based on the matching degree and a preset adaptive threshold to determine the adaptive pseudo-label; The dual-temporal remote sensing images are input into a pre-constructed change detection model to generate road change prediction results. The change detection model is then optimized based on the adaptive pseudo-labels and the loss values ​​generated from the road change prediction results to obtain a trained change detection model.

2. The road change detection model training method based on regional supervision and SAM model according to claim 1, characterized in that, The step of performing feature difference analysis on the dual-temporal remote sensing images to obtain multi-scale difference features includes: A feature extraction network is used to extract features from the dual-temporal remote sensing images to obtain dual-temporal image feature representations at multiple scales; The dual-time image feature representation is subjected to scale-wise feature difference and normalization processing to obtain multi-scale difference features.

3. The road change detection model training method based on regional supervision and SAM model according to claim 1, characterized in that, Local attention features are extracted based on the multi-scale difference features, including: The multi-scale difference features are divided into multiple non-overlapping local windows; The features within each non-overlapping local window are reshaped to obtain a two-dimensional matrix vector. A linear mapping is performed on the two-dimensional matrix vector corresponding to each non-overlapping local window to obtain the local query vector, local key vector, and local value vector; For each non-overlapping local window, perform in-window self-attention calculation on the local query vector, local key vector, and local value vector to obtain the corresponding self-attention features; The self-attention features corresponding to each non-overlapping local window are reverse-reconstructed in parallel to obtain local attention features.

4. The road change detection model training method based on regional supervision and SAM model according to claim 1, characterized in that, Global attention is extracted based on the multi-scale difference features. Features, including: The multi-scale difference features are divided into multiple non-overlapping local windows; Average pooling is performed on the features within each non-overlapping local window to obtain the corresponding average feature vector, and an average pooled feature map is generated based on the average feature vectors corresponding to all non-overlapping local windows. A linear transformation is performed on the average pooling feature map to obtain a global key vector and a global value vector. A linear transformation is also performed on the multi-scale difference features to obtain a global query vector. Global self-attention is calculated on the global key vector, the global value vector, and the global query vector to obtain global attention features.

5. The road change detection model training method based on regional supervision and SAM model according to claim 1, characterized in that, The fusion of the local attention features and the global attention features includes: The local attention features and the global attention features are concatenated to obtain the concatenated features; The spliced ​​features are normalized to obtain the fused attention feature map.

6. The road change detection model training method based on regional supervision and SAM model according to claim 5, characterized in that, The step of generating attention pseudo-labels based on the fused result includes: Calculate the inter-class variance based on the gray-level histogram corresponding to the fused attention feature map; The optimal segmentation threshold is determined by maximizing the inter-class variance. The fused attention feature map is adaptively divided into regions based on the optimal segmentation threshold to obtain attention pseudo-labels.

7. The road change detection model training method based on regional supervision and SAM model according to claim 1, characterized in that, The step of calculating the matching degree between the attention pseudo-label and the SAM segmentation map, and determining the adaptive pseudo-label based on the matching degree and a preset adaptive threshold, includes: The attention pseudo-labels are subjected to erosion and dilation to obtain the first pseudo-label image; Perform connected component analysis on the first pseudo-label graph to obtain the second pseudo-label graph; Gaussian smoothing is applied to the second pseudo-label image to obtain optimized attention pseudo-labels; The matching degree between the attention pseudo-label and the SAM segmentation map is calculated, and a threshold judgment is made based on the matching degree and a preset adaptive threshold to determine the adaptive pseudo-label.

8. The road change detection model training method based on regional supervision and SAM model according to claim 1, characterized in that, The step of inputting the difference map generated by pixel-by-pixel subtraction of the dual-temporal remote sensing images and the region labels into a pre-trained SAM model to generate a SAM segmentation map includes: The dual-temporal remote sensing images are subtracted pixel by pixel to generate a difference map; The region labels are used as prompts for the SAM model. The difference map is input into the pre-trained SAM model for segmentation processing to obtain multiple candidate segmentation masks. The SAM segmentation map is selected from the candidate segmentation mask.

9. The road change detection model training method based on regional supervision and SAM model according to claim 1, characterized in that, The step of calculating the matching degree between the attention pseudo-label and the SAM segmentation map, and determining the adaptive pseudo-label based on the matching degree and a preset adaptive threshold, includes: The intersection-union ratio (IU) is calculated as the matching degree based on the attention pseudo-labels and the SAM segmentation map; If the matching degree between the attention pseudo-label and the SAM segmentation map is greater than or equal to the adaptive threshold, then the SAM segmentation map is used as the adaptive pseudo-label. If the matching degree between the attention pseudo-label and the SAM segmentation map is less than the adaptive threshold, then the attention pseudo-label is used as the adaptive pseudo-label.

10. The road change detection model training method based on regional supervision and SAM model according to claim 1, characterized in that, The change detection model includes a feature extraction network and a segmentation network. The step of inputting the dual-temporal remote sensing image into the pre-constructed change detection model to generate road change prediction results includes: The feature extraction network is used to extract features from the dual-temporal remote sensing images to obtain multi-scale difference features; The road change prediction result is obtained by using the segmentation network to predict changes based on the multi-scale difference features.

Citation Information

Patent Citations

  • Lightweight remote sensing image change detection method and system based on self-supervision enhancement

    CN117372879A

  • Farmland change detection method and system

    CN121280886A