General remote sensing image change detection method for binary change detection and semantic change detection
By combining dynamic rare-class perceptual sampling and multi-scale attention-enhanced encoder, the problems of high model computational resources and class imbalance in remote sensing image change detection are solved, achieving efficient binary and semantic change detection and improving detection accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-25
- Publication Date
- 2026-04-03
AI Technical Summary
Existing deep learning models struggle to simultaneously handle binary change detection and semantic change detection in remote sensing image change detection, and suffer from high computational resource consumption and class imbalance, resulting in poor detection performance.
We employ a dynamic rare class perception sampling module for weighted sampling, combined with a multi-scale attention-enhanced encoder and a contrastive learning module to construct fine-grained features and optimize the feature space distribution. By using a multi-scale attention-enhanced encoder with shared weights, we achieve the fusion of global and local information, alleviate the class imbalance problem, and enhance the model's discriminative power.
It improves detection accuracy, reduces computational resource consumption, enhances the ability to identify subtle changes and complex features, and maintains high efficiency and robustness in binary change detection and semantic change detection tasks.
Smart Images

Figure CN121789032A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this application relate to the field of remote sensing image processing technology, and in particular to a general remote sensing image change detection method for binary change detection and semantic change detection. Background Technology
[0002] Change detection is a fundamental task in remote sensing image analysis. By comparing remote sensing images of the same area acquired at different times, changes in surface targets or regions can be identified and located. This has significant application value in urban planning, land management, and ecological monitoring. Depending on the detection target, change detection tasks can be divided into binary change detection and semantic change detection. The former mainly detects the location of changed areas, while the latter not only needs to detect changed areas but also needs to identify their specific category information.
[0003] In recent years, change detection methods based on deep learning have become a research hotspot. CNN models, relying on their local convolutional operations, possess strong feature extraction capabilities and computational efficiency. For example, Zhang et al. proposed a model called SSCLNet, which uses HRNet to extract semantic context features in the encoder stage and combines semi-supervised contrastive learning to enhance feature representation capabilities, thereby improving the accuracy of semantic change detection. However, due to the limited receptive field of convolution, CNN models struggle to capture long-distance dependencies, which limits their ability to model global change patterns.
[0004] To address this issue, researchers have proposed Transformer-based methods. Bandara et al. proposed a model called ChangeFormer, which utilizes a hierarchical Transformer encoder to extract multi-scale spatiotemporal features, achieving excellent results in binary change detection tasks. Chen et al. utilized a self-attention mechanism to effectively capture long-range dependencies between arbitrary pixels, further enhancing the model's ability to model image structure and changes. Unfortunately, most of these methods are designed only for single-task binary change detection or semantic change detection tasks. For example, K. Chen et al. proposed a model called ChangeMamba based on the Mamba architecture, which can handle both binary change detection and semantic change detection simultaneously, but its computational cost remains high. Guo et al. proposed using pre-trained remote sensing base models to extract general features. While this method improves the model's generalization ability, its training and inference require extremely high computational resources, severely limiting its practical application.
[0005] Furthermore, change detection tasks commonly face the problem of class imbalance. In practical applications, the number of unchanged samples is usually much larger than the number of changed samples. This causes deep learning models to be easily dominated by the majority class during training, resulting in poor detection performance on the minority class. Therefore, designing a general change detection method that can handle both binary and semantic change detection tasks while also taking into account feature extraction capabilities, global modeling capabilities, and the class imbalance problem has become a key technical problem that urgently needs to be solved. Summary of the Invention
[0006] In view of this, embodiments of this application propose a general remote sensing image change detection method for binary change detection and semantic change detection. It aims to extract fine-grained features and improve the ability to identify subtle changes and complex features, avoid overfitting caused by too many common classes, enhance the model's ability to distinguish between changed and unchanged areas, and maintain high inference efficiency and robustness while improving detection accuracy.
[0007] To achieve the above objectives, embodiments of this application propose a general remote sensing image change detection method for binary change detection and semantic change detection. The method includes: utilizing a dynamic rare category-aware sampling module to evaluate the rarity of each semantic category based on the pixel proportion of each semantic category in the dual-temporal image pair dataset, and dynamically scheduling the sampling based on temperature parameters to perform weighted sampling on the dual-temporal image pairs, selecting dual-temporal image pairs containing rare semantic categories to form a training set; inputting the dual-temporal image pairs in the training set to a multi-scale attention-enhanced encoder with shared weights, performing feature extraction combining channel attention, spatial attention, and cross-layer multi-scale fusion to construct low-level differential features and high-level differential features; concatenating the low-level and high-level differential features to obtain a comprehensive change representation; and then... The representations are input to the change detection decoder and the contrastive learning module, respectively. The change detection decoder outputs the change detection result based on the comprehensive change representation, and the contrastive learning module establishes a contrastive learning loss based on the comprehensive change representation by constructing anchor points and feature relationships between positive and negative samples. Based on the change detection result and the ground truth label, semantic change detection loss and binary change detection loss are established. Combined with the contrastive learning loss, the overall loss function is obtained. The training framework consisting of the dynamic rare category perception sampling module, the multi-scale attention-enhanced encoder, the change detection decoder, and the contrastive learning module is iteratively trained until convergence based on the overall loss function. The dual-temporal image pairs to be detected are input to the general change detection model consisting of the trained multi-scale attention-enhanced encoder and the change detection decoder to obtain the corresponding change detection results.
[0008] To achieve the above objectives, embodiments of this application also propose an electronic device, including: a processor and a memory, wherein the memory stores instructions executable by the processor, and the processor is configured to execute the instructions such that the electronic device can implement a general remote sensing image change detection method for binary change detection and semantic change detection as described above.
[0009] To achieve the above objectives, embodiments of this application also propose a computer-readable storage medium storing a computer program that, when executed by a processor, enables a general remote sensing image change detection method for binary change detection and semantic change detection as described above.
[0010] Optionally, the rarity of each semantic category is evaluated based on the pixel proportion of each semantic category in the dual-temporal image pair dataset, using the following formula: ; in, This represents the total number of bi-temporal image pairs in the bi-temporal image pair dataset. Indicates the first A pair of dual-temporal images, Represents the first phase in a two-phase image pair Image , and These represent the height and then the width of the image, respectively. Indicates the first The first in the bi-temporal image pair The first image Does the pixel belong to the ? A semantic category, Indicates the first The percentage of pixels belonging to each semantic category in a two-phase image pair dataset.
[0011] Optionally, the dynamic scheduling based on temperature parameters to perform weighted sampling on bi-temporal image pairs and select bi-temporal image pairs containing rare semantic categories to form a training set includes: The following formula is used to calculate the first [value] based on the temperature parameter. Sampling frequency of each semantic category: ; ; in, Indicates temperature parameter, and These represent the initial temperature and the final temperature, respectively. Indicates the current training round. This represents the total number of training rounds. Indicates the first The percentage of pixels belonging to each semantic category in the dual-temporal image pair dataset. This represents the total number of semantic categories. Indicates the first The sampling frequency of each semantic category; Based on the following formula, Calculate the first Sampling weights for each biphase image pair: ; in, Indicates the first The first image of the two-temporal image pair belongs to the... The number of pixels in each semantic category Indicates the first The second image of the first two-temporal image pair belongs to the... The number of pixels in each semantic category Indicates the first Sampling weights for each pair of bi-temporal images; according to For the We perform weighted random sampling on each pair of biphase images in the dataset. After completing the weighted random sampling on all biphase images in the dataset, we obtain the training set.
[0012] Optionally, the step of inputting the bi-temporal image pairs from the training set into a multi-scale attention-enhanced encoder with shared weights, and performing feature extraction combining channel attention, spatial attention, and cross-layer multi-scale fusion to construct low-level difference features and high-level difference features includes: The encoder enhances the processing of bi-temporal images in the training set using a multi-scale attention enhancement method. and Perform four-layer encoding to obtain four layers of basic features. and , ; based on and Construct low-level differential features; right and By sequentially applying channel attention and spatial attention, more detailed texture and semantic information is extracted, resulting in four layers of detailed features. and , ; The process iterates through the detailed features of each layer. Using the detailed features of the current layer as a benchmark, the detailed features of the other layers are scale-aligned and channel-matched, and then equivalently fused with the detailed features of the current layer. After the traversal is complete, four scales of fused features are obtained. and , ; Each and The corresponding four-scale fused features are concatenated and convolved along the channels to obtain multi-scale fine-grained semantic features. and ; based on and Construct high-level differential features.
[0013] Optionally, the basis and The low-level difference features are constructed using the following formula: ; in, Indicates low-level difference features; The basis and The high-level differential features are constructed using the following formula: ; ; ; , ; , ; ; ; in, Indicates high-level differential characteristics, This represents the convolution aggregation operation. This indicates a splicing operation along the channel. This indicates an equivalent fusion operation. This indicates scale alignment and channel matching operations. This represents spatial attention operations. This indicates a channel attention operation.
[0014] Optionally, the low-level difference features and high-level difference features are concatenated to obtain a comprehensive change representation, which is achieved through the following formula: ; in, This represents a comprehensive change.
[0015] Optionally, the contrastive learning loss is expressed by the formula: ; in, Indicates the first The th semantic category Feature vectors of anchor point samples Indicates the first The average representation of the feature vectors of all positive samples in the semantic category is used as the _th _ ... The aggregation center of semantic categories, Indicates from the first The sampled from semantic categories other than the first semantic category. The feature vector of each negative sample This represents the total number of anchor point samples. These are the preset adjustment parameters. This represents the learning loss compared to the comparison.
[0016] Alternatively, the overall loss function can be expressed by the formula: ; ; ; ; in, , , These represent the semantic change detection loss, the binary change detection loss, and the contrastive learning loss, respectively. , , They are respectively , , The corresponding loss weight coefficient, This represents the total number of pixels in each image of a two-phase image pair. and These represent the first image in the dual-temporal image pair. The true label and predicted probability corresponding to each pixel. and These represent the second image in the dual-temporal image pair. The true label and predicted probability corresponding to each pixel.
[0017] This application proposes a general remote sensing image change detection method applicable to both binary and semantic change detection tasks, avoiding the limitations of traditional methods that require separate model design for different tasks. This application achieves the fusion of global and local information through a multi-scale attention-enhanced encoder with shared weights, effectively extracting fine-grained features and improving the ability to identify subtle changes and complex features. Dynamic rare-perception sampling effectively alleviates the class imbalance problem, avoiding overfitting caused by an excessive number of common classes, thereby improving the model's detection accuracy for rare change categories. This application also introduces a contrastive learning module to optimize the feature space distribution, enhancing the model's discriminative power to distinguish changed and unchanged regions without adding extra overhead during the inference stage. This allows the general remote sensing image change detection model designed in this application to maintain high inference efficiency and robustness while ensuring improved detection accuracy, effectively completing the general remote sensing image change detection task. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies of this application will be briefly introduced below. Obviously, the following drawings are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. The drawings described herein are only used to explain this application and are not intended to limit this application.
[0019] Figure 1 This is a flowchart of a general remote sensing image change detection method for binary change detection and semantic change detection provided in one embodiment of this application; Figure 2 This is a structural diagram of the training framework provided in one embodiment of this application; Figure 3 This is a schematic diagram of a dynamic sampling strategy provided in one embodiment of this application; Figure 4 This is a structural diagram of a multi-scale attention enhancement encoder provided in one embodiment of this application; Figure 5 This is a structural diagram of the contrast learning module provided in one embodiment of this application; Figure 6 This is a T-SNE dimensionality reduction visualization of G-CDNet on a semantic change detection dataset provided in one embodiment of this application; Figure 7 This is a heatmap of G-CDNet on a binary change detection dataset and a semantic change detection dataset provided in one embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. Those skilled in the art will understand that many technical details have been presented in the embodiments of this application to facilitate better understanding. However, the technical solutions claimed in this application can be implemented even without these technical details and various variations and modifications based on the following embodiments. The division of the following embodiments is for ease of description and should not constitute any limitation on the specific implementation of this application. The following embodiments can be combined with and referenced by each other without contradiction.
[0021] One embodiment of this application proposes a general remote sensing image change detection method for binary change detection and semantic change detection, applied to an electronic device, wherein the electronic device can be a terminal or a server. This embodiment and the following embodiments will use a server as an example for description. The implementation details of the general remote sensing image change detection method for binary change detection and semantic change detection proposed in this embodiment are described in detail below. The following implementation details are provided for ease of understanding and are not necessary for implementing this solution.
[0022] This embodiment effectively overcomes the following three technical problems. First, traditional models are generally designed for single tasks and struggle to simultaneously handle binary change detection and semantic change detection tasks. Second, traditional models struggle to balance global context modeling and fine-grained change representation. Third, traditional models suffer from significant class imbalance during the training phase, leading to difficulties in identifying minority and rare change categories.
[0023] The specific process of the general remote sensing image change detection method proposed in this embodiment, which is oriented towards binary change detection and semantic change detection, can be as follows: Figure 1 As shown, it includes: Step 11: Using the dynamic rare category-aware sampling module, the rarity of each semantic category is evaluated based on the pixel proportion of each semantic category in the dual-temporal image pair dataset. Based on the temperature parameter, dynamic scheduling is performed to perform weighted sampling on the dual-temporal image pairs, and dual-temporal image pairs containing rare semantic categories are selected to form the training set.
[0024] In the specific implementation, during the training phase, for the acquired dual-temporal image pair dataset, the dynamic rare category-aware sampling module is first used to evaluate the rarity of each semantic category based on the pixel proportion of each semantic category in the dual-temporal image pair dataset, and to dynamically schedule based on temperature parameters, thereby performing weighted sampling on the dual-temporal image pairs and selecting dual-temporal image pairs containing rare semantic categories to form the training set.
[0025] like Figure 2 As shown, the training framework consists of a dynamic rare category perception sampling module, a multi-scale attention-enhanced encoder, a change detection decoder, and a contrastive learning module.
[0026] To ensure class balance, during the training phase, the "rarity" of each semantic class needs to be evaluated based on its pixel proportion in the dual-temporal training set. Dynamic scheduling based on temperature parameters is then used to weight sample pairs, prioritizing samples containing rare classes for training. This process can be described as follows: Figure 3 As shown.
[0027] In one example, the rarity of each semantic category is evaluated based on the pixel proportion of each semantic category in the bi-temporal image pair dataset, using the following formula: ; in, This represents the total number of bi-temporal image pairs in the bi-temporal image pair dataset. Indicates the first A pair of dual-temporal images, Represents the first phase in a two-phase image pair Image , and These represent the height and then the width of the image, respectively. Indicates the first The first in the bi-temporal image pair The first image Does the pixel belong to the ? A semantic category, Indicates the first The percentage of pixels belonging to each semantic category in a two-phase image pair dataset.
[0028] In one example, when dynamically scheduling bi-temporal image pairs based on temperature parameters to weighted sample the selected bi-temporal image pairs containing rare semantic categories to form the training set, the following formula is first used to calculate the first... Sampling frequency of each semantic category: ; ; in, Indicates temperature parameter, and These represent the initial temperature and the final temperature, respectively. Indicates the current training round. This represents the total number of training rounds. Indicates the first The percentage of pixels belonging to each semantic category in the dual-temporal image pair dataset. This represents the total number of semantic categories. Indicates the first The sampling frequency for each semantic category is adjusted exponentially as training epochs progress, aiming to strike a balance between "focusing on difficult examples" and "training stability".
[0029] Next, based on the following formula, Calculate the first Sampling weights for each biphase image pair: ; in, Indicates the first The first image of the two-temporal image pair belongs to the... The number of pixels in each semantic category Indicates the first The second image of the first two-temporal image pair belongs to the... The number of pixels in each semantic category Indicates the first Sampling weights for each pair of biphase images.
[0030] Finally, you can follow the instructions. For the We perform weighted random sampling on each pair of biphase images in the dataset. After completing the weighted random sampling on all biphase images in the dataset, we obtain the training set.
[0031] This strategy not only significantly improves the model's learning ability for minority and rare variant classes during training, but also dynamically adjusts sampling weights to adaptively balance the contributions of common and rare classes at different training stages. This effectively avoids performance degradation caused by majority class samples dominating training. Common classes, due to their large number, can easily lead to overfitting of these class features during optimization, causing the model to favor learning the majority class's discrimination patterns while neglecting the feature representations of minority and rare classes. This phenomenon not only reduces the model's detection accuracy on minority classes but also weakens its generalization ability in complex scenarios. This embodiment, through a dynamic rare-aware sampling mechanism, adaptively increases the weight of rare class samples during training, mitigating the overfitting risk caused by majority class dominance. This allows the model to achieve more balanced feature learning across all classes, thereby improving detection performance and stability across all classes.
[0032] Step 12: Input the dual-temporal image pairs from the training set into a multi-scale attention-enhanced encoder with shared weights, and perform feature extraction by combining channel attention, spatial attention, and cross-layer multi-scale fusion to construct low-level differential features and high-level differential features.
[0033] In the specific implementation, in order to take into account both global context and fine-grained changes, it is necessary to input the dual-temporal images in the training set into a multi-scale attention-enhanced encoder with shared weights, and perform feature extraction by combining channel attention, spatial attention and cross-layer multi-scale fusion to construct low-level difference features and high-level difference features.
[0034] In one example, the structure and working principle of a multi-scale attention-enhanced encoder are as follows: Figure 4 As shown. The multi-scale attention-enhanced encoder processes bi-temporal images in the training set. and Perform four-layer encoding to obtain four layers of basic features. and , At this point, it is necessary to base it on and Construct low-level differential features.
[0035] Next, for and By sequentially applying channel attention and spatial attention, more detailed texture and semantic information is extracted, resulting in four layers of detailed features. and , Applying channel attention and spatial attention can enhance the model's ability to characterize features at both the global and local levels. This not only allows for the extraction of more detailed texture and semantic information but also enables the model to focus on changing regions, boundary regions, and task-related key locations, thereby improving overall detection performance.
[0036] Subsequently, the detailed features of each layer are traversed. Using the detailed features of the current layer as a benchmark, the detailed features of the other layers are scale-aligned and channel-matched, and then equivalently fused with the detailed features of the current layer. After the traversal is completed, fused features at four scales are obtained. and , Then separately and The corresponding four-scale fused features are concatenated and convolved along the channels to obtain multi-scale fine-grained semantic features. and Ultimately based on and Construct high-level differential features.
[0037] This process integrates contextual information at different levels, achieving a unified representation from local details to global structure. Through channel attention and spatial attention mechanisms, the model can adaptively adjust weights during feature extraction, enhancing the response to key regions and locations of significant changes. This results in more accurate modeling of edges, textures, and small-scale targets, and the resulting multi-scale fine-grained semantic features can capture large-scale semantic differences while maintaining sensitivity to subtle changes.
[0038] In one example, based on and The low-level difference features are constructed using the following formula: ; in, This represents low-level difference features.
[0039] In one example, based on and The high-level differential features are constructed using the following formula: ; ; ; , ; , ; ; ; in, Indicates high-level differential characteristics, This represents the convolution aggregation operation. This indicates a splicing operation along the channel. This indicates an equivalent fusion operation. This indicates scale alignment and channel matching operations. This represents spatial attention operations. This indicates a channel attention operation.
[0040] Low-level differential features High-level difference features emphasize low-level details in images, including edge contours, texture patterns, and differences in small-scale objects, effectively reflecting areas of subtle change. This emphasizes high-level semantic information, including land cover categories, regional shapes, and cross-scale structural differences, enabling accurate capture of macroscopic semantic changes. By... and By integrating detailed information and semantic information in the feature space, this embodiment achieves complementarity between detailed information and semantic information, ensuring both sensitivity to fine-grained changes and the ability to discriminate complex semantic changes, thereby providing more comprehensive and robust feature inputs for subsequent detection heads and contrastive learning modules.
[0041] Step 13: Concatenate the low-level differential features and the high-level differential features to obtain a comprehensive change representation. Input the comprehensive change representation into the change detection decoding head and the contrastive learning module respectively. The change detection decoding head outputs the change detection result based on the comprehensive change representation. The contrastive learning module establishes the contrastive learning loss based on the comprehensive change representation by constructing anchor points and the feature relationship between positive and negative samples.
[0042] In the specific implementation, after obtaining the low-level differential features and the high-level differential features, the low-level differential features and the high-level differential features are concatenated to obtain a comprehensive change representation. The comprehensive change representation is then input into the change detection decoding head and the contrastive learning module, respectively. The change detection decoding head outputs the change detection result based on the comprehensive change representation, and the contrastive learning module establishes the contrastive learning loss based on the comprehensive change representation by constructing anchor points and the feature relationship between positive and negative samples.
[0043] In one example, concatenating low-level and high-level difference features to obtain a comprehensive change representation can be achieved using the following formula: ; in, This represents a comprehensive change.
[0044] In one example, the specific structure of the contrastive learning module is as follows: Figure 5As shown, the contrastive learning module constructs anchor points and the feature relationships between positive and negative samples, and optimizes the contrastive learning loss to compress intra-class distances and expand inter-class margins in the feature space, thereby enhancing the model's ability to distinguish between changed and unchanged regions.
[0045] In one example, the contrastive learning loss is expressed by the formula: ; in, Indicates the first The th semantic category Feature vectors of anchor point samples Indicates the first The average representation of the feature vectors of all positive samples in the semantic category is used as the _th _ ... The aggregation center of semantic categories, Indicates from the first The sampled from semantic categories other than the first semantic category. The feature vector of each negative sample This represents the total number of anchor point samples. These are the preset adjustment parameters. This represents the learning loss compared to the comparison.
[0046] Through this design, the model can simultaneously construct contrastive relationships between "anchor points and positive samples" and "anchor points and negative samples" in the feature space. During optimization, the contrastive learning loss drives the model to continuously reduce the distance between anchor points and positive samples, making features of the same class more compact in the embedding space. At the same time, it increases the distance between anchor points and negative samples, making the feature boundaries between different classes clearer. In this way, the model can gradually learn feature distributions with high intra-class consistency and strong inter-class discriminative power during the training phase.
[0047] Step 14: Based on the change detection results and the real labels, establish semantic change detection loss and binary change detection loss. Combine them with contrastive learning loss to obtain the overall loss function. Based on the overall loss function, iteratively train the training framework consisting of the dynamic rare category perception sampling module, the multi-scale attention-enhanced encoder, the change detection decoder, and the contrastive learning module until convergence.
[0048] In the specific implementation, after establishing the contrastive learning loss, semantic change detection loss and binary change detection loss can be established based on the change detection results and the real labels. Combined with the contrastive learning loss, the overall loss function is obtained. Based on the overall loss function, the training framework consisting of the dynamic rare category perception sampling module, the multi-scale attention-enhanced encoder, the change detection decoder and the contrastive learning module is iteratively trained until convergence.
[0049] In one example, the overall loss function is expressed by the formula: ; ; ; ; in, , , These represent the semantic change detection loss, the binary change detection loss, and the contrastive learning loss, respectively. , , They are respectively , , The corresponding loss weight coefficient, This represents the total number of pixels in each image of a two-phase image pair. and These represent the first image in the dual-temporal image pair. The true label and predicted probability corresponding to each pixel. and These represent the second image in the dual-temporal image pair. The true label and predicted probability corresponding to each pixel.
[0050] After obtaining the overall loss function, the backpropagation process is performed on the training framework, the AdamW optimizer is used to update the model parameters, and training is continuously iterated until the number of iterations reaches a preset threshold and then training is terminated.
[0051] Step 15: Input the dual-temporal image pair to be detected into a general change detection model composed of a trained multi-scale attention-enhanced encoder and a change detection decoder to obtain the corresponding change detection results.
[0052] In the specific implementation, after training is completed, a general change detection model is formed based on the trained multi-scale attention-enhanced encoder and change detection decoder. The dual-temporal image pairs to be detected are input into the general change detection model to obtain the corresponding change detection results.
[0053] This embodiment proposes a general remote sensing image change detection method applicable to both binary and semantic change detection tasks, avoiding the limitations of traditional methods that require separate model design for different tasks. This embodiment achieves the fusion of global and local information through a multi-scale attention-enhanced encoder with shared weights, effectively extracting fine-grained features and improving the ability to identify subtle changes and complex features. Dynamic rare-perception sampling effectively alleviates the class imbalance problem, avoiding overfitting caused by an excessive number of common classes, thereby improving the model's detection accuracy for rare change categories. This embodiment also introduces a contrastive learning module to optimize the feature space distribution, enhancing the model's discriminative power to distinguish changed and unchanged regions without adding extra overhead during the inference phase. This allows the general remote sensing image change detection model designed in this embodiment to maintain high inference efficiency and robustness while ensuring improved detection accuracy, effectively completing the general remote sensing image change detection task.
[0054] The steps described above are merely for clarity in describing the technical solution. In actual implementation, they can be combined into one step, or certain steps can be broken down into multiple steps, as long as they involve the same logical relationship, they are all within the scope of protection of this application. Any insignificant modifications or designs added to the algorithm or process, as long as they do not change the core of the algorithm or process, are also within the scope of protection of this application.
[0055] In one embodiment, to verify the effectiveness of the proposed general remote sensing image change detection method (G-CDNet) for binary change detection and semantic change detection, we used four publicly available remote sensing change detection datasets to train and test the network framework.
[0056] The SECOND dataset is a publicly available high-resolution semantic change detection dataset. Each image is 512×512 pixels, with a spatial resolution between 0.3 meters and 5 meters. This dataset contains seven categories: one unchanged category and six changed categories, namely water, ground, low vegetation, trees, buildings, and playgrounds. The Landsat-SCD dataset is a medium-resolution semantic change detection dataset. Each image is 416×416 pixels, with a spatial resolution of 30 meters. This dataset contains five categories: one unchanged category and four changed categories, namely farmland, desert, buildings, and water. In the experiment, the training and test sets were split in a 9:1 ratio to evaluate the model's performance on semantic change detection tasks. The LEVIR-CD dataset is a publicly available remote sensing binary change detection dataset containing numerous real-world examples of building additions and demolitions. This simulation experiment cuts it into 512×512 image patches. The WHU-CD dataset is a typical remote sensing binary change detection dataset. In this simulation experiment, the dataset is cut into image patches of size 512×512 and randomly divided into training and test sets in an 8:2 ratio to evaluate the performance of the model in the binary change detection task.
[0057] In the binary change detection experiments, precision, recall, and F1 score were used as evaluation metrics. Experimental results show that on the WHU-CD dataset, G-CDNet achieves precision, recall, and F1 score of 95.19%, 96.00%, and 95.59%, respectively, outperforming traditional mainstream methods. On the LEVIR-CD dataset, G-CDNet surpasses the performance of all non-VFM methods without relying on a visual base model and performs comparably to CLIP-based large model methods. This demonstrates the superiority and robustness of G-CDNet in binary change detection tasks.
[0058] In our semantic change detection experiments, we used mean Intersection over Union (mIoU), the Sek metric, and the overall score as evaluation metrics. The results show that on the SECOND dataset, G-CDNet achieves mIoU, Sek, and Score of 73.03%, 25.55%, and 39.79%, respectively, outperforming other comparative methods overall. On the Landsat-SCD dataset, G-CDNet achieves 92.20%, 67.77%, and 75.10% for the three metrics, significantly surpassing traditional Transformer architecture methods and even outperforming state-of-the-art methods based on visual models by 8.18%, demonstrating a significant performance improvement.
[0059] The specific evaluation results are shown in Tables 1 to 4.
[0060] Table 1: Simulation Results of the LEVIRCD Dataset
[0061] Table 2: Simulation Results of WHUCD Dataset
[0062] Table 3: Simulation Results of SECOND Dataset
[0063] Table 4: Simulation Results of Landsat-SCD Dataset
[0064] Further visualization comparison results show that ( Figure 6 , Figure 7 G-CDNet performs better in class discrimination, boundary preservation, and detail rendering. It predicts semantically variable regions completely and with clear outlines.
[0065] Another embodiment of this application provides an electronic device, such as Figure 8 As shown, it includes a processor 21 and a memory 22. The memory 22 stores instructions that the processor 21 can execute. When the processor 21 is configured to execute the instructions, the electronic device can implement a general remote sensing image change detection method for binary change detection and semantic change detection as described in the above method embodiment.
[0066] The memory and processor are connected via a bus, which includes any number of interconnecting buses and bridges, connecting various circuits of one or more processors and the memory. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.
[0067] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.
[0068] Another embodiment of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, can implement a general remote sensing image change detection method for binary change detection and semantic change detection as described in the above method embodiments.
[0069] That is, those skilled in the art will understand that all or part of the steps in the above method embodiments can be implemented by a program instructing related hardware. The program is stored in a storage medium and includes several instructions to cause a device (such as a microcontroller, chip, etc.) or processor to execute all or part of the steps of the method described in the method embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0070] It will be understood by those skilled in the art that the above embodiments are specific implementations of this application, and various changes in form and detail can be made in practical applications without departing from the spirit and scope of this application. For those skilled in the art, several improvements and modifications can be made without departing from the principles of this application, and these improvements and modifications are also considered to be within the scope of protection of this application.
Claims
1. A general remote sensing image change detection method for both binary and semantic change detection, characterized in that, The method includes: Using a dynamic rare category-aware sampling module, the rarity of each semantic category is evaluated based on the pixel proportion of each semantic category in the dual-temporal image pair dataset. Dynamic scheduling is performed based on temperature parameters to perform weighted sampling on dual-temporal image pairs, and dual-temporal image pairs containing rare semantic categories are selected to form the training set. The dual-temporal images in the training set are input to a multi-scale attention-enhanced encoder with shared weights. Feature extraction is performed by combining channel attention, spatial attention, and cross-layer multi-scale fusion to construct low-level difference features and high-level difference features. The low-level differential features and high-level differential features are concatenated to obtain a comprehensive change representation. The comprehensive change representation is then input into the change detection decoding head and the contrastive learning module, respectively. The change detection decoding head outputs the change detection result based on the comprehensive change representation, and the contrastive learning module establishes a contrastive learning loss based on the comprehensive change representation by constructing anchor points and the feature relationship between positive and negative samples. Based on the change detection results and the real labels, semantic change detection loss and binary change detection loss are established. Combined with the contrastive learning loss, the overall loss function is obtained. Based on the overall loss function, the training framework consisting of a dynamic rare category perception sampling module, a multi-scale attention-enhanced encoder, a change detection decoder and a contrastive learning module is iteratively trained until convergence. The two-phase image pairs to be detected are input into a general change detection model consisting of a trained multi-scale attention-enhanced encoder and a change detection decoder to obtain the corresponding change detection results.
2. The general remote sensing image change detection method for binary change detection and semantic change detection according to claim 1, characterized in that, The rarity of each semantic category is evaluated based on the pixel proportion of each semantic category in the dual-temporal image pair dataset, which is achieved through the following formula: ; in, This represents the total number of bi-temporal image pairs in the bi-temporal image pair dataset. Indicates the first A pair of dual-temporal images, Represents the first phase in a two-phase image pair Image , and These represent the height and then the width of the image, respectively. Indicates the first The first in the bi-temporal image pair The first image Does the pixel belong to the ? A semantic category, Indicates the first The percentage of pixels belonging to each semantic category in a two-phase image pair dataset.
3. The general remote sensing image change detection method for binary change detection and semantic change detection according to claim 2, characterized in that, The dynamic scheduling based on temperature parameters, which weights the sampling of bi-temporal image pairs and selects bi-temporal image pairs containing rare semantic categories to form a training set, includes: The following formula is used to calculate the first value based on the temperature parameter. Sampling frequency of each semantic category: ; ; in, Indicates temperature parameter, and These represent the initial temperature and the final temperature, respectively. Indicates the current training round. This represents the total number of training rounds. Indicates the first The percentage of pixels belonging to each semantic category in the dual-temporal image pair dataset. This represents the total number of semantic categories. Indicates the first Sampling frequency of each semantic category; Based on the following formula, Calculate the first Sampling weights for each bi-temporal image pair: ; in, Indicates the first The first image of the two-temporal image pair belongs to the... The number of pixels in each semantic category Indicates the first The second image of the first two-temporal image pair belongs to the... The number of pixels in each semantic category Indicates the first Sampling weights for each pair of biphase images; according to For the We perform weighted random sampling on each pair of biphase images in the dataset. After completing the weighted random sampling on all biphase images in the dataset, we obtain the training set.
4. The general remote sensing image change detection method for binary change detection and semantic change detection according to claim 1, characterized in that, The step involves inputting bi-temporal images from the training set into a multi-scale attention-enhanced encoder with shared weights, and performing feature extraction combining channel attention, spatial attention, and cross-layer multi-scale fusion to construct low-level and high-level differential features, including: The encoder enhances the processing of bi-temporal images in the training set using a multi-scale attention enhancement method. and Perform four-layer encoding to obtain four layers of basic features. and , ; based on and Construct low-level differential features; right and By sequentially applying channel attention and spatial attention, more detailed texture and semantic information is extracted, resulting in four layers of detailed features. and , ; The process iterates through the detailed features of each layer. Using the detailed features of the current layer as a benchmark, the detailed features of the other layers are scale-aligned and channel-matched, and then equivalently fused with the detailed features of the current layer. After the traversal is complete, four scales of fused features are obtained. and , ; Each and The corresponding four-scale fused features are concatenated and convolved along the channel to obtain multi-scale fine-grained semantic features. and ; based on and Construct high-level differential features.
5. A general remote sensing image change detection method for binary change detection and semantic change detection according to claim 4, characterized in that, The basis and The low-level difference features are constructed using the following formula: ; in, Indicates low-level difference features; The basis and The high-level differential features are constructed using the following formula: ; ; ; , ; , ; ; ; in, Indicates high-level differential characteristics, This represents the convolution aggregation operation. This indicates a splicing operation along the channel. This indicates an equivalent fusion operation. This indicates scale alignment and channel matching operations. This represents spatial attention operations. This indicates a channel attention operation.
6. A general remote sensing image change detection method for binary change detection and semantic change detection according to claim 5, characterized in that, By concatenating the low-level and high-level differential features, a comprehensive change representation is obtained, which is achieved through the following formula: ; in, This represents a comprehensive change.
7. A general remote sensing image change detection method for binary change detection and semantic change detection according to claim 1, characterized in that, Contrastive learning loss is expressed by the formula: ; in, Indicates the first The th semantic category Feature vectors of anchor point samples Indicates the first The average representation of the feature vectors of all positive samples in the semantic category is used as the _th _ ... The aggregation center of semantic categories, Indicates from the first The sampled from semantic categories other than the first semantic category. The feature vector of each negative sample This represents the total number of anchor point samples. These are the preset adjustment parameters. This represents the learning loss from comparison.
8. A general remote sensing image change detection method for binary change detection and semantic change detection according to claim 7, characterized in that, The overall loss function is expressed by the formula: ; ; ; ; in, , , These represent the semantic change detection loss, the binary change detection loss, and the contrastive learning loss, respectively. , , They are respectively , , The corresponding loss weight coefficient, This represents the total number of pixels in each image of a two-phase image pair. and These represent the first image in the dual-temporal image pair. The true label and predicted probability corresponding to each pixel. and These represent the second image in the dual-temporal image pair. The true label and predicted probability corresponding to each pixel.
9. An electronic device, characterized in that, include: The electronic device includes a processor and a memory, the memory storing instructions executable by the processor, the processor being configured to, when executing the instructions, enable the electronic device to implement a general remote sensing image change detection method for binary change detection and semantic change detection as described in any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it can implement a general remote sensing image change detection method for binary change detection and semantic change detection as described in any one of claims 1 to 8.