Remote sensing intelligent change detection method and device based on metric learning, electronic equipment and medium
By employing a metric learning-based remote sensing change detection method, and utilizing an adversarial network training model with generators and discriminators, the method addresses the difficulty of detecting changes in remote sensing images caused by differences in spectral, topographic, and temporal factors, achieving accurate identification and stable detection of changes in remote sensing images.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NAT GEOMATICS CENT OF CHINA
- Filing Date
- 2026-04-03
- Publication Date
- 2026-06-19
Smart Images

Figure CN122243993A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of remote sensing science and technology and artificial intelligence, and more specifically, to a remote sensing intelligent change detection method, device, electronic device and medium based on metric learning. Background Technology
[0002] Land use and its changes (such as farmland becoming built-up areas, water bodies becoming built-up areas, etc.) are essential foundational data for optimizing land resource allocation, formulating protection policies, studying ecological and environmental changes, and developing sustainable development plans. Remote sensing technology, due to its macroscopic, efficient, and convenient advantages, has become the primary means of measuring its spatial distribution and changes. Early change detection methods mainly relied on image differencing, image ratio analysis, and change vector analysis combined with two remote sensing images. However, these methods often depend on thresholding or dual-temporal differencing techniques to extract change information. With the development of machine learning methods such as SVM (Support Vector Machine) and RF (Random Forest), these methods have been increasingly applied to change detection tasks. However, machine learning methods rely on explicit spectral or spatial differences, making it difficult to handle complex change patterns and large-scale data. In particular, differences in spectral, topographical, and temporal factors among different remote sensing images make it difficult to accurately capture dynamic changes over time. Summary of the Invention
[0003] The purpose of this invention is to provide a remote sensing intelligent change detection method, device, electronic device, and medium based on metric learning.
[0004] The embodiments of the present invention can be implemented as follows: In a first aspect, the present invention provides a remote sensing intelligent change detection method based on metric learning, the method comprising: Multiple sample groups are acquired, each of which includes remote sensing sample images taken at two different times for the same area and a label image characterizing the change of ground features between two of the remote sensing sample images in the sample group. Analyze the spectral changes of the two remote sensing sample images within each sample group to obtain a pseudo-change image for each sample group. The pseudo-change image represents the non-ground feature changes of the two remote sensing sample images within the sample group. Two remote sensing sample images, the label image, and the pseudo-change image from each sample group are input into a pre-constructed change detection model. The change detection model is then trained to obtain a trained change detection model, which is used to detect remote sensing changes.
[0005] In an optional implementation, the step of analyzing the spectral changes of two remote sensing sample images within each sample group to obtain a pseudo-change image for each sample group includes: For any sample group, the two remote sensing sample images in the sample group are respectively used as the first image and the second image; Calculate the intensity of change between each pixel in the first image and the corresponding pixel in the second image in each preset spectral band; Based on the change intensity of each pixel, the change vector of each pixel in the first image and the corresponding pixel in the second image in each preset spectral segment is calculated to obtain the pseudo change image of the sample group, so as to obtain the pseudo change image of each sample group. The pseudo change image includes all the change vectors of the corresponding sample group.
[0006] In an optional implementation, the formula for calculating the pseudo-change image of the sample group is: ,in, This is a pseudo-change image of the sample group. and Let be the spectral values of the pixel located at (i, j) in spectral segment k in the first image t1 and the second image t2, respectively, and let n be the total number of spectral segments. For vectors norm, The intensity of the change.
[0007] In an optional implementation, the change detection model includes a generator and a discriminator. The step of inputting two remote sensing sample images, the label image, and the pseudo-change image from each sample group into a pre-constructed change detection model, and training the change detection model to obtain the trained change detection model includes: The generator is input into the two remote sensing sample images, the label image, and the pseudo-change image within each sample group to predict the prediction result characterizing the change of ground features between the two remote sensing sample images within each sample group. The two remote sensing sample images, the label image, and the prediction result of each sample group are input into the discriminator. The loss value of each sample group is calculated using a preset objective function. The preset objective function includes an adversarial loss function that quantifies the adversarial relationship between the generator and the discriminator and a metric learning loss function that quantifies the distance relationship between the label image and the prediction result. The parameters of the change detection model are adjusted based on each loss value to obtain the trained change detection model.
[0008] In an optional implementation, the step of inputting two remote sensing sample images, the label image, and the pseudo-change image from each sample group into the generator to predict the predicted result characterizing the change in ground features between the two remote sensing sample images in each sample group includes: Each remote sensing sample image within each sample group is processed into grayscale to obtain a grayscale image of each remote sensing sample image within each sample group. Each grayscale image, the label image, and the pseudo-transformation image within each sample group are input into the generator to predict the prediction result.
[0009] In an optional implementation, the step of inputting two remote sensing sample images, the label image, and the prediction result of each sample group into the discriminator, and calculating the loss value of each sample group using a preset objective function, includes: For any target sample group, the adversarial loss function is used to calculate the adversarial loss between the first output and the second output of the discriminator. The first output is obtained by inputting two remote sensing sample images of the target sample group and the label image into the discriminator. The second output is obtained by inputting two remote sensing sample images of the target sample group and the prediction result into the discriminator. Using the metric learning loss function, the nonlinear distance between the first feature and the second feature of the target sample group is calculated to obtain the metric learning loss of the target sample group. The first feature is obtained by the intermediate layer of the discriminator extracting features from the label image of the target sample group, and the second feature is obtained by the intermediate layer of the discriminator extracting features from the prediction result of the target sample group. Calculate the loss value of the target sample group based on the adversarial loss and the metric learning loss of the target sample group; Each of the sample groups is used as the target sample group to obtain the loss value of each sample group.
[0010] In an optional implementation, the method further includes: Acquire a pair of remote sensing images to be processed; the pair of remote sensing images to be processed includes remote sensing images taken at two different times for the same area; The remote sensing image to be processed is input into the trained change detection model to predict the change image representing the change of ground features between the two remote sensing images.
[0011] Secondly, the present invention provides a remote sensing intelligent change detection device based on metric learning, the device comprising: The acquisition module is used to acquire multiple sample groups, each of which includes remote sensing sample images taken at two different times for the same area and a label image representing the change of ground features between two remote sensing sample images in the sample group. The analysis module is used to analyze the spectral changes of two remote sensing sample images in each sample group to obtain a pseudo-change image for each sample group. The pseudo-change image represents the non-ground feature changes of the two remote sensing sample images in the sample group. The training module is used to input two remote sensing sample images, the label image, and the pseudo-change image from each sample group into a pre-constructed change detection model, train the change detection model, and obtain a trained change detection model to detect remote sensing changes based on the trained change detection model.
[0012] Thirdly, the present invention provides an electronic device including a processor and a memory, the memory being used to store a program, and the processor being used to implement, when executing the program, the remote sensing intelligent change detection method based on metric learning as described in any of the foregoing embodiments.
[0013] Fourthly, the present invention provides a computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the remote sensing intelligent change detection method based on metric learning as described in any of the foregoing embodiments.
[0014] Compared with the prior art, the present invention has the following beneficial effects: In training a change detection model for detecting changes in ground features between remote sensing sample images, this invention analyzes the spectral changes of two remote sensing sample images taken at two different times for the same area to obtain pseudo-change images that characterize non-ground feature changes in the remote sensing sample images. Based on the remote sensing sample images, the label images characterizing ground feature changes between the remote sensing sample images, and the pseudo-change images, the change detection model is trained to suppress pseudo-changes caused by non-ground feature changes to the greatest extent possible, enabling the trained change detection model to accurately identify ground feature changes between remote sensing images. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1A flowchart of the remote sensing intelligent change detection method based on metric learning provided in this embodiment. Figure 1 .
[0017] Figure 2 A flowchart of the remote sensing intelligent change detection method based on metric learning provided in this embodiment. Figure 2 .
[0018] Figure 3 This is a block diagram of the remote sensing intelligent change detection device based on metric learning provided in this embodiment.
[0019] Figure 4 This is a block diagram of the electronic device provided in this embodiment.
[0020] Icons: 10-Electronic device; 11-Processor; 12-Memory; 13-Bus; 100-Remote sensing intelligent change detection device based on metric learning; 110-Acquisition module; 120-Analysis module; 130-Training module; 140-Detection module. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0022] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0023] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0024] In the description of this invention, it should be noted that if terms such as "upper," "lower," "inner," or "outer" are used to indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship in which the product of this invention is usually placed, they are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention.
[0025] Furthermore, the terms "first" and "second" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.
[0026] It should be noted that, where there is no conflict, the features in the embodiments of the present invention can be combined with each other.
[0027] With the rapid development of the remote sensing industry, it has become possible to detect environmental changes at a fine observation scale by acquiring satellite images in real time. Change detection aims to identify temporal changes in the Earth's surface by analyzing images of the same geographic area taken at different times. This technology has been widely used in urban planning, disaster management, and land use monitoring. However, due to the non-uniformity of remote sensing images (including seasonal differences and spurious changes), change detection tasks still face significant challenges, requiring the development of effective strategies to identify genuine changes from complex backgrounds.
[0028] To effectively eliminate spurious changes, finding robust image features that can accurately and stably represent land cover information is crucial. Unlike manually designed image features, deep learning frameworks can automatically extract high-level invariant features to represent complex image targets. For modeling nonlinear change patterns in bi-temporal images, Recurrent Neural Networks (RNNs) are ideal for handling such complex transitional features because they can continuously acquire labeled data from the training pool to automatically identify anomalous changes in the sequence. Recent research has employed LSTM-based RNN networks to learn joint spectral and temporal feature representations from bi-temporal image sequences and applied the trained RNN model to detect image content changes based on specific land cover types. Similarly, there are also RNN models built using LSTM to extract spectral and temporal features of land cover information. However, traditional RNN models only focus on the spectral sequence information of a single pixel, ignoring the spatial pattern in bi-temporal images. Therefore, some studies utilize ReCNNs (Recursive Convolutional Neural Networks) to capture the spectral, spatial, and temporal feature representations in complex bi-temporal images. However, both RNN and ReCNN require a large number of samples for support, and manually labeling samples from pseudo-changes is extremely difficult, especially in large-scale change detection tasks.
[0029] Generative Adversarial Networks (GANs), as an unsupervised / semi-supervised learning framework, can learn bi-temporal transition patterns with only a small number of training samples. For example, CGAN (Conditional Generative Adversarial Network) can achieve efficient change detection by jointly utilizing optical and SAR (Synthetic Aperture Radar) images. This method significantly reduces false change interference by transforming optical images to the SAR data distribution space, and then performs pixel-level detection in the shared observation space to identify changed regions. However, GAN models based on maximum likelihood estimation suffer from insufficient training stability, and even gradient vanishing can occur during training, especially when dealing with samples containing seasonal changes (such as the leaf drop and leaf growth states of trees).
[0030] In view of this, this embodiment provides a remote sensing intelligent change detection method, device, electronic device and medium based on metric learning. It introduces a seasonal invariant transition term to suppress spurious changes in bi-temporal images, and at the same time adopts a metric learning strategy to improve the performance of traditional generative adversarial networks in change detection tasks. It will be described in detail below.
[0031] Please refer to Figure 1 , Figure 1 A flowchart of the remote sensing intelligent change detection method based on metric learning provided in this embodiment. Figure 1 The method includes the following steps: Step S101: Obtain multiple sample groups. Each sample group includes remote sensing sample images taken at two different times for the same area and a label image representing the change of ground features between two remote sensing sample images within the sample group.
[0032] In this embodiment, remote sensing sample images taken at two different times for the same area are also referred to as dual-temporal images. Different times include, but are not limited to, two times belonging to different seasons, two times belonging to different weather conditions, or two times with different lighting conditions at different times of the same day.
[0033] In this embodiment, the remote sensing sample images are derived from a multi-temporal satellite imagery dataset, which shares the same spatial coverage and geometric registration relationship, ensuring the validity of pixel-level correspondence. The label images can be manually annotated or generated based on existing map data; these label images characterize which pixels in the two remote sensing sample images have undergone land feature changes. These changes can be caused by human activities or natural time processes, such as the conversion of farmland to construction land, water body shrinkage, or water bodies being converted to construction land.
[0034] Step S102: Analyze the spectral changes of the two remote sensing sample images in each sample group to obtain the pseudo-change image of each sample group. The pseudo-change image represents the non-ground feature changes of the two remote sensing sample images in the sample group.
[0035] In this embodiment, due to the influence of factors such as vegetation growth cycle and changes in light conditions, the spectral response of the same land cover varies significantly at different time phases. This results in differences in the land cover state even though the land cover state does not change substantially in the same geographical area. Such a situation where the land cover state changes but the land cover does not change substantially is called non-land cover change.
[0036] Step S103: Input two remote sensing sample images, a label image, and a pseudo-change image from each sample group into a pre-constructed change detection model, train the change detection model, and obtain a trained change detection model to detect remote sensing changes based on the trained change detection model.
[0037] In this embodiment, the change detection model can be based on adversarial network models such as GAN and CGAN. Remote sensing sample images serve as the main input to provide raw observation information, while labeled images serve as ground truth to guide the generator to approximate the real change distribution. Pseudo-change images serve as auxiliary input to introduce prior knowledge about non-ground feature change disturbances, enabling the change detection model to learn to distinguish between non-ground feature changes caused by environmental factors and actual ground feature changes within an adversarial training framework.
[0038] The method provided in this embodiment analyzes the spectral changes of two remote sensing sample images taken at two different times for the same area to obtain pseudo-change images that characterize non-ground feature changes in the remote sensing sample images. Then, based on the remote sensing sample images, the label images characterizing ground feature changes between the remote sensing sample images, and the pseudo-change images, the change detection model is trained to suppress pseudo-changes caused by non-ground feature changes to the greatest extent, so that the trained change detection model can accurately identify ground feature changes between remote sensing images.
[0039] In optional implementations, the differences between the two temporal images not only stem from changes in the actual land cover categories but are also influenced by non-structural factors such as vegetation growth cycles, changes in solar altitude angle, and fluctuations in atmospheric conditions. These non-structural factors causing non-land cover changes are often misidentified as change areas, thus creating pseudo-change phenomena. To effectively distinguish such interference items from real changes, this embodiment provides an implementation method for obtaining pseudo-change images of the sample group, applicable to any sample group: First, for any sample group, the two remote sensing sample images in the sample group are used as the first image and the second image, respectively; In this embodiment, the first image can correspond to remote sensing observation data acquired at an earlier time point t1, and the second image can correspond to the imaging results of the same area at a slightly later time point t2. The two images have been precisely registered in space to ensure that the pixel positions correspond one-to-one. This allows the difference in spectral values of pixels at any (i, j) position to directly reflect the change in the spectral response of the geographic unit between the two times, thereby supporting the quantitative calculation of the intensity and direction of the change.
[0040] Next, calculate the intensity of change of each pixel in the first image and the corresponding pixel in the second image in each preset spectral band; In this embodiment, the preset spectral bands include, but are not limited to, blue, green, red, and near-infrared. For each preset band k, the spectral values at the same pixel position (i, j) in the first and second images are extracted, and the absolute or squared value of their difference is calculated as a measure of local change in that band. This operation traverses all preset spectral bands, forming a multidimensional change response vector. The change intensity reflects the degree of reflectance shift within each preset spectral band. The change intensity can be a vector including the difference in spectral values and the direction of spectral change from the first image to the second image. For example, for a pixel at the same position in the first and second images, the starting point of the vector can be the multi-band spectral value of the first image at that pixel, and the ending point can be the multi-band spectral value of the second image at the same position. This vector characterizes the change of that pixel in the entire spectral space.
[0041] Third, based on the change intensity of each pixel, calculate the change vector of each pixel in the first image and the corresponding pixel in the second image in each preset spectral segment to obtain the pseudo change image of the sample group, so as to obtain the pseudo change image of each sample group. The pseudo change image includes all the change vectors of the corresponding sample group.
[0042] In this embodiment, the intensity changes of each band in a preset spectral range are organized into an n-dimensional vector according to spectral order, where n is the total number of preset spectral ranges. This vector represents the spectral migration path from the first image to the second image, and its direction reflects the main band combination characteristics that have changed. Since vegetation exhibits significant differences in its response to specific bands at different growth stages, such vectors often show certain regular patterns. These patterns reflect more the periodic succession of the ecosystem (e.g., seasonal changes) than substantial changes in land cover. Integrating the change vectors of all pixels into a spatial distribution map constitutes a pseudo-change image. Thus, by constructing a spatial vector field containing multispectral dimension change directions, a structured expression of seasonal interference factors is achieved, which helps improve the discrimination accuracy of the change detection model under complex temporal conditions.
[0043] In an optional implementation, the formula for calculating the pseudo-change image of the sample group is: ,in, The pseudo-change image of the sample group, and Let be the spectral values of the pixel located at (i, j) in spectral segment k in the first image t1 and the second image t2, respectively, and let n be the total number of spectral segments. For vectors norm, The intensity of the change.
[0044] In an optional implementation, since GAN adversarial networks require only a small number of training samples to learn the transition patterns of bi-temporal images, but in order to overcome the problem of insufficient stability during the training process of GAN adversarial networks, this embodiment can build a change detection model based on GAN adversarial networks. Therefore, this embodiment provides a training method for the change detection model: First, input the two remote sensing sample images, the label image, and the pseudo-change image in each sample group into the generator to predict the prediction results that characterize the changes in land cover between the two remote sensing sample images in each sample group. In this embodiment, the generator in the change detection model is used to predict ground feature changes from the input image. For any sample group, the generator's input image includes two remote sensing sample images within the sample group, a label image, and a pseudo-change image. The generator learns to distinguish between changes caused by actual ground feature evolution and pseudo-changes caused only by imaging conditions, lighting, or atmospheric factors by performing feature extraction and fusion processing on these multimodal input information. Finally, it outputs a change prediction map with the same size as the label image, i.e., the prediction result, whose pixel values reflect the probability or category of ground feature changes occurring at the corresponding location.
[0045] Secondly, the two remote sensing sample images, the label image, and the prediction result of each sample group are input into the discriminator. The loss value of each sample group is calculated using a preset objective function. The preset objective function includes an adversarial loss function that quantifies the adversarial relationship between the generator and the discriminator and a metric learning loss function that quantifies the distance relationship between the label image and the prediction result. In this embodiment, the discriminator in the change detection model is used to evaluate the realism of the prediction results output by the generator. For any sample group, the discriminator receives two input combinations: one is an input group containing the label image, i.e., a joint representation of the two remote sensing sample images and the label image; the other is an input group containing the prediction results output by the generator, i.e., a joint representation of the same remote sensing image pair and the prediction results. By comparing the response differences under these two input combinations, the discriminator can learn to identify whether the prediction results are close to the actual distribution of ground cover changes.
[0046] In this embodiment, the preset objective function comprehensively considers two types of loss terms: one is an adversarial loss function, used to quantify the game relationship between the generator and the discriminator, prompting the generator to produce more realistic prediction results; the other is a metric learning loss function, used to measure the nonlinear distance between the label image and the prediction result in the feature space, thereby enhancing the ability to restore fine-grained change boundaries. As a way to optimize the preset objective function, it can be implemented with the assistance of the Adam optimizer.
[0047] Finally, the parameters of the change detection model are adjusted based on each loss value to obtain the trained change detection model.
[0048] In this embodiment, the adversarial loss, derived from the adversarial loss function, guides the generator to optimize its structure to generate change maps that are more difficult to distinguish from false ones, while simultaneously driving the discriminator to improve its discrimination accuracy. Meanwhile, the metric learning loss, derived from the metric learning loss function, directly applies to the generator as a penalty term, ensuring that its predictions approximate the representation of the labeled image at the deep semantic feature level. By alternately optimizing these two mutually constraining objectives, the entire change detection model gradually converges to a stable state, enabling the generator to possess strong generalization ability, accurately identifying real-world changes in unknown scenarios and suppressing false change interference.
[0049] In an optional implementation, to reduce computational complexity, this embodiment also provides an implementation method that uses a generator to obtain the prediction result: First, each remote sensing sample image within each sample group is converted to grayscale to obtain a grayscale image of each remote sensing sample image within each sample group. In this embodiment, remote sensing sample images typically contain multiple spectral bands (such as red, green, blue, near-infrared, etc.), and their original format is multi-channel matrix data. Grayscale processing aims to convert this multi-channel image into a single-channel intensity image, thereby reducing the input dimensionality and highlighting the spatial structure information of ground features. During this process, the multi-band spectral values of each pixel are mapped to a scalar grayscale value through weighted averaging or channel selection, forming a two-dimensional grayscale map that reflects the overall changes in the surface reflectance characteristics.
[0050] Secondly, each grayscale image, label image, and pseudo-transformation image in each sample group is input into the generator to predict the prediction result.
[0051] In this embodiment, the grayscale image provides surface appearance information at two time points, revealing potential areas of change; the label image serves as a supervisory signal, introducing prior knowledge of the true change distribution to guide the generator in learning the correct output pattern; and the pseudo-change image explicitly models non-ground object changes caused by factors such as illumination, imaging angle, or atmospheric conditions, helping the generator distinguish between true and pseudo changes.
[0052] In an optional implementation, to ensure that the generator pursues global realism while also preserving local feature fidelity, and to enable the generator to receive feedback information from different levels, this embodiment provides a method for calculating the loss value of each sample group using a preset objective function: First, for any target sample group, the adversarial loss function is used to calculate the adversarial loss between the first output and the second output of the discriminator. The first output is obtained by inputting two remote sensing sample images and the label image of the target sample group into the discriminator, and the second output is obtained by inputting two remote sensing sample images and the prediction result of the target sample group into the discriminator. In this embodiment, the target sample group is any one of multiple sample groups. The loss value calculation method provided in this embodiment is applicable to each sample group. This embodiment uses the target sample group to illustrate the loss value calculation process of a sample group.
[0053] In this embodiment, the first output represents the discriminator's confidence in identifying the true change distribution; the second output represents the discriminator's judgment on whether the generator's output is close to the truth. During this process, the adversarial loss function, based on the difference in their responses, measures the degree to which the generator's prediction matches the true label in terms of global structure and spatial consistency, thus forming a game-theoretic mechanism: the generator attempts to generate a more realistic change map to "deceive" the discriminator, while the discriminator continuously optimizes its discrimination boundary to accurately distinguish between true and false data.
[0054] Secondly, using the metric learning loss function, the nonlinear distance between the first feature and the second feature of the target sample group is calculated to obtain the metric learning loss of the target sample group. The first feature is obtained by the intermediate layer of the discriminator extracting features from the label image of the target sample group, and the second feature is obtained by the intermediate layer of the discriminator extracting features from the prediction result of the target sample group. In this embodiment, the first feature captures the distribution pattern of the real variation region in the deep semantic space; the second feature reflects the expression quality of the generator output at similar semantic levels. During this process, the metric learning loss function quantifies the deviation between the predicted result and the true label in terms of structural details, edge preservation, and local texture by calculating the distance between these two features in the nonlinear mapping space.
[0055] In this embodiment, if the discriminator includes multiple intermediate layers, it can capture the first and second features of each of the multiple intermediate layers (two or more), calculate the distance between the first and second features of each intermediate layer, and then sum or average the distances of all intermediate layers to obtain the final metric learning loss. For example, the non-linear distance between the first and second features can be represented by the Mahalanobis distance, and the metric learning loss function can be expressed as: ,in, To measure the learning loss, and These are the first and second features output from the i-th intermediate layer of the discriminator, respectively. For vectors The second norm. Besides the Mahalanobis distance, the Manhattan distance, Euclidean distance, and Chebyshev distance can also be used. Based on this representation of the metric learning loss function, this embodiment also provides a representation of a preset objective function: , Where D and G are the discriminator and generator, respectively. The set of input groups contains labeled images, and each input group in the set includes two remote sensing sample images and a label image; The set of input groups includes the prediction results from the generator output. Each input group in this combination consists of two remote sensing sample images and the prediction results from the generator output. and These are the input groups in their respective input group sets for the same set of remote sensing sample images. The output of the discriminator is the input of input group x. The output of the discriminator is given by input group z, which includes the remote sensing sample images and label images from input group x that are input to the generator, and the predicted output of the generator. and These are the features extracted from the intermediate layer when input groups x and z are fed into the discriminator. To counteract the loss function, This is the loss function used to measure learning.
[0056] Third, calculate the loss value of the target sample group based on the adversarial loss and metric learning loss of the target sample group; In this embodiment, the adversarial loss provides macroscopic discrimination guidance, ensuring that the overall output conforms to the real data distribution; the metric learning loss provides microscopic structural correction, enhancing the ability to restore details in key areas. The loss value can be composed of the weighted sum of the adversarial loss and the metric learning loss according to preset weights.
[0057] Fourth, each sample group is used as the target sample group to obtain the loss value for each sample group.
[0058] After obtaining the trained change detection model, in order to use the trained change detection model to predict changes in remotely sensed images, please refer to... Figure 2 , Figure 2 A flowchart of the remote sensing intelligent change detection method based on metric learning provided in this embodiment. Figure 2 The method includes the following steps: Step S201: Obtain the remote sensing image pair to be processed; the remote sensing image pair to be processed includes remote sensing images taken at two different times for the same area; In this embodiment, the two remote sensing images in the remote sensing image pair to be processed are also dual-temporal images. These two remote sensing images can come from satellite or airborne sensor platforms and have a spatial registration relationship, ensuring that the corresponding pixels reflect the ground features at the same location on the ground, thereby meeting the basic requirements of spatiotemporal consistency for change detection tasks.
[0059] It should be noted that remote sensing images can refer to surface observation images containing multispectral, hyperspectral, or panchromatic bands. The reflectance characteristics of ground objects carried by these images can be used to identify the cover types and their evolution at different time phases.
[0060] Step S202: Input the remote sensing image to be processed into the trained change detection model to predict the change image representing the change of ground features between the two remote sensing images.
[0061] In this embodiment, the change detection model analyzes the difference patterns between two remote sensing images to be processed based on its internally learned feature mapping mechanism, and outputs a binary or multi-class labeled image with the same spatial resolution as the input remote sensing images to be processed, i.e., the change image. Each pixel in the change image represents whether there is a change in the state of land features at the corresponding geographical location, such as whether new buildings have been constructed, vegetation has degraded, or water bodies have expanded.
[0062] The core concept of this embodiment is that by utilizing a deep learning architecture that has been fully trained on samples containing real change labels and spurious change interference, the model can focus on identifying ground feature change behaviors that have real geographical semantic significance, while eliminating the influence of non-essential spectral fluctuations caused by factors such as illumination, atmospheric conditions, and sensor noise.
[0063] It should be noted that the executing entity of steps 201-202 and the executing entity of the aforementioned steps S101-S103 and their sub-steps can be the same electronic device or different electronic devices.
[0064] To perform the corresponding steps in the above embodiments and various possible implementations, an implementation method of the remote sensing intelligent change detection device 100 based on metric learning is given below. Please refer to... Figure 3 , Figure 3 This is a block diagram of the remote sensing intelligent change detection device based on metric learning provided in this embodiment. It should be noted that the basic principle and technical effects of the remote sensing intelligent change detection device 100 based on metric learning provided by the present invention are the same as those of the corresponding embodiments described above. For the sake of brevity, some of these aspects are not mentioned in this embodiment.
[0065] The remote sensing intelligent change detection device 100 based on metric learning includes an acquisition module 110, an analysis module 120, and a training module 130.
[0066] The acquisition module 110 is used to acquire multiple sample groups, each sample group including remote sensing sample images taken at two different times for the same area and a label image representing the change of ground features between two remote sensing sample images within the sample group.
[0067] The analysis module 120 is used to analyze the spectral changes of two remote sensing sample images in each sample group to obtain a pseudo-change image for each group. The pseudo-change image represents the non-ground feature changes of the two remote sensing sample images in the sample group.
[0068] The training module 130 is used to input two remote sensing sample images, a label image, and a pseudo-change image from each sample group into a pre-built change detection model, train the change detection model, and obtain a trained change detection model to detect remote sensing changes based on the trained change detection model.
[0069] In an optional implementation, the analysis module 120 is specifically used for: For any sample group, the two remote sensing sample images in the sample group are used as the first image and the second image, respectively; Calculate the intensity of change between each pixel in the first image and the corresponding pixel in the second image in each preset spectral band; Based on the change intensity of each pixel, the change vector of each pixel in the first image and the corresponding pixel in the second image in each preset spectral segment is calculated to obtain the pseudo change image of the sample group. The pseudo change image includes all the change vectors of the corresponding sample group.
[0070] In an optional implementation, the analysis module 120 uses the following formula to calculate the pseudo-change image of the sample group: ,in, The pseudo-change image of the sample group, and Let be the spectral values of the pixel located at (i, j) in spectral segment k in the first image t1 and the second image t2, respectively, and let n be the total number of spectral segments. For vectors norm, The intensity of the change.
[0071] In an optional implementation, the change detection model includes a generator and a discriminator, and the training module 130 is specifically used for: Input two remote sensing sample images, a label image, and a pseudo-change image from each sample group into the generator to predict the predicted results that characterize the changes in land cover between the two remote sensing sample images in each sample group. Two remote sensing sample images, a label image, and a prediction result for each sample group are input into the discriminator. The loss value for each sample group is calculated using a preset objective function. The preset objective function includes an adversarial loss function that quantifies the adversarial relationship between the generator and the discriminator, and a metric learning loss function that quantifies the distance relationship between the label image and the prediction result. The parameters of the change detection model are adjusted based on each loss value to obtain the trained change detection model.
[0072] In an optional implementation, the training module 130 is specifically used to input two remote sensing sample images, a label image, and a pseudo-change image from each sample group into the generator to predict the prediction result characterizing the change in ground features between the two remote sensing sample images in each sample group: Each remote sensing sample image within each sample group is converted to grayscale to obtain a grayscale image of each remote sensing sample image within each sample group. Each grayscale image, label image, and pseudo-transformation image within each sample group is input into the generator to predict the result.
[0073] In an optional implementation, the training module 130 is specifically used to input two remote sensing sample images, a label image, and the prediction result of each sample group into the discriminator, and to calculate the loss value of each sample group using a preset objective function: For any target sample group, the adversarial loss function is used to calculate the adversarial loss between the first output and the second output of the discriminator. The first output is obtained by inputting two remote sensing sample images and the label image of the target sample group into the discriminator, and the second output is obtained by inputting two remote sensing sample images and the prediction result of the target sample group into the discriminator. Using the metric learning loss function, the nonlinear distance between the first feature and the second feature of the target sample group is calculated to obtain the metric learning loss of the target sample group. The first feature is obtained by the intermediate layer of the discriminator extracting features from the label image of the target sample group, and the second feature is obtained by the intermediate layer of the discriminator extracting features from the prediction result of the target sample group. Calculate the loss value of the target sample group based on the adversarial loss and metric learning loss of the target sample group; Each sample group is used as the target sample group, and the loss value of each sample group is obtained.
[0074] In an optional implementation, the remote sensing intelligent change detection device 100 based on metric learning further includes a detection module 140. The detection module 140 is used for: Acquire the remote sensing image pair to be processed; the remote sensing image pair to be processed includes remote sensing images taken at two different times for the same area; The remote sensing image to be processed is input into the trained change detection model to predict the change image representing the change of ground features between the two remote sensing images.
[0075] This embodiment provides a computer storage medium storing a computer program that, when executed by a processor, implements the remote sensing intelligent change detection method based on metric learning as described in the foregoing embodiments.
[0076] This invention also provides a block diagram of an electronic device 10, which implements the remote sensing intelligent change detection method based on metric learning described in the foregoing embodiments. Please refer to... Figure 4 , Figure 4 This is a block diagram of the electronic device 10 provided in this embodiment. The electronic device 10 includes a processor 11, a memory 12 and a bus 13. The processor 11 and the memory 12 are connected through the bus 13.
[0077] The processor 11 can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the metric learning-based remote sensing intelligent change detection method described above can be completed by the integrated logic circuitry in the processor 11 or by software instructions. The processor 11 can be a general-purpose processor, including a CPU (Central Processing Unit), NP (Network Processor), GPU (Graphics Processing Unit), etc.; it can also be a DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Logic Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0078] The memory 12 is used to store the program for implementing the remote sensing intelligent change detection method based on metric learning. The program can be a software function module stored in the memory 12 in the form of software or firmware or embedded in the OS (Operating System) of the electronic device 10.
[0079] After receiving the execution instruction, the processor 11 executes the program to implement the remote sensing intelligent change detection method based on metric learning in the aforementioned embodiment.
[0080] In summary, the embodiments of the present invention provide a remote sensing intelligent change detection method, device, electronic device, and medium based on metric learning. The method includes: acquiring multiple sample groups, each sample group including remote sensing sample images taken at two different times for the same area and a label image representing the change of ground features between two remote sensing sample images within the sample group; analyzing the spectral changes of the two remote sensing sample images within each sample group to obtain a pseudo-change image for each sample group, the pseudo-change image representing the non-ground feature changes between the two remote sensing sample images within the sample group; inputting the two remote sensing sample images, the label image, and the pseudo-change image within each sample group into a pre-constructed change detection model, training the change detection model to obtain a trained change detection model, and detecting remote sensing changes based on the trained change detection model. Compared with the prior art, this embodiment has at least the following advantages: (1) By analyzing the spectral changes of two remote sensing sample images taken at two different times for the same area, a pseudo-change image representing non-ground object changes in the remote sensing sample image is obtained. Then, based on the remote sensing sample image, the label image representing ground object changes between the remote sensing sample images, and the pseudo-change image, the change detection model is trained to suppress pseudo-changes caused by non-ground object changes to the maximum extent, so that the trained change detection model can accurately identify ground object changes between remote sensing images; (2) It can automatically learn the change patterns in the spectral-spatial-temporal domain without human intervention; (3) Metric learning is used to make the distance between similar data points smaller than the distance between dissimilar data points, so as to improve the performance of the traditional change detection model based on generative adversarial networks in the change detection task; (4) The label image and the result generated by the generator are respectively input into the discriminator. The activation output of the intermediate layer of the discriminator is used to calculate the nonlinear distance between the features extracted by the two, and it is used as the penalty term of the generator in the objective function of the change detection model, so as to generate realistic samples while measuring the distance loss between the generator and the discriminator.
[0081] The above descriptions are merely various embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A remote sensing intelligent change detection method based on metric learning, characterized in that, The method includes: Multiple sample groups are acquired, each of which includes remote sensing sample images taken at two different times for the same area and a label image characterizing the change of ground features between two of the remote sensing sample images in the sample group. Analyze the spectral changes of the two remote sensing sample images within each sample group to obtain a pseudo-change image for each sample group. The pseudo-change image represents the non-ground feature changes of the two remote sensing sample images within the sample group. Two remote sensing sample images, the label image, and the pseudo-change image from each sample group are input into a pre-constructed change detection model. The change detection model is then trained to obtain a trained change detection model, which is used to detect remote sensing changes.
2. The method according to claim 1, characterized in that, The step of analyzing the spectral changes of two remote sensing sample images within each sample group to obtain a pseudo-change image for each sample group includes: For any sample group, the two remote sensing sample images in the sample group are respectively used as the first image and the second image; Calculate the intensity of change between each pixel in the first image and the corresponding pixel in the second image in each preset spectral band; Based on the change intensity of each pixel, the change vector of each pixel in the first image and the corresponding pixel in the second image in each preset spectral segment is calculated to obtain the pseudo change image of the sample group, so as to obtain the pseudo change image of each sample group. The pseudo change image includes all the change vectors of the corresponding sample group.
3. The method according to claim 2, characterized in that, The formula for calculating the pseudo-change image of the sample group is: ,in, This is a pseudo-change image of the sample group. and Let be the spectral values of the pixel located at (i, j) in spectral segment k in the first image t1 and the second image t2, respectively, and let n be the total number of spectral segments. For vectors norm, The intensity of the change.
4. The method according to claim 1, characterized in that, The change detection model includes a generator and a discriminator. The step of inputting two remote sensing sample images, the label image, and the pseudo-change image from each sample group into the pre-constructed change detection model, and training the change detection model to obtain the trained change detection model includes: The generator is input into the two remote sensing sample images, the label image, and the pseudo-change image within each sample group to predict the prediction result characterizing the change of ground features between the two remote sensing sample images within each sample group. The two remote sensing sample images, the label image, and the prediction result of each sample group are input into the discriminator. The loss value of each sample group is calculated using a preset objective function. The preset objective function includes an adversarial loss function that quantifies the adversarial relationship between the generator and the discriminator and a metric learning loss function that quantifies the distance relationship between the label image and the prediction result. The parameters of the change detection model are adjusted based on each loss value to obtain the trained change detection model.
5. The method according to claim 4, characterized in that, The step of inputting two remote sensing sample images, the label image, and the pseudo-change image from each sample group into the generator to predict the prediction result characterizing the change in ground features between the two remote sensing sample images in each sample group includes: Each remote sensing sample image within each sample group is processed into grayscale to obtain a grayscale image of each remote sensing sample image within each sample group. Each grayscale image, the label image, and the pseudo-transformation image within each sample group are input into the generator to predict the prediction result.
6. The method according to claim 4, characterized in that, The step of inputting two remote sensing sample images, the label image, and the prediction result of each sample group into the discriminator, and calculating the loss value of each sample group using a preset objective function includes: For any target sample group, the adversarial loss function is used to calculate the adversarial loss between the first output and the second output of the discriminator. The first output is obtained by inputting two remote sensing sample images of the target sample group and the label image into the discriminator. The second output is obtained by inputting two remote sensing sample images of the target sample group and the prediction result into the discriminator. Using the metric learning loss function, the nonlinear distance between the first feature and the second feature of the target sample group is calculated to obtain the metric learning loss of the target sample group. The first feature is obtained by the intermediate layer of the discriminator extracting features from the label image of the target sample group, and the second feature is obtained by the intermediate layer of the discriminator extracting features from the prediction result of the target sample group. Calculate the loss value of the target sample group based on the adversarial loss and the metric learning loss of the target sample group; Each of the sample groups is used as the target sample group to obtain the loss value of each sample group.
7. The method according to any one of claims 1-6, characterized in that, The method further includes: Acquire a pair of remote sensing images to be processed; the pair of remote sensing images to be processed includes remote sensing images taken at two different times for the same area; The remote sensing image to be processed is input into the trained change detection model to predict the change image representing the change of ground features between the two remote sensing images.
8. A remote sensing intelligent change detection device based on metric learning, characterized in that, The device includes: The acquisition module is used to acquire multiple sample groups, each of which includes remote sensing sample images taken at two different times for the same area and a label image representing the change of ground features between two remote sensing sample images in the sample group. The analysis module is used to analyze the spectral changes of two remote sensing sample images in each sample group to obtain a pseudo-change image for each sample group. The pseudo-change image represents the non-ground feature changes of the two remote sensing sample images in the sample group. The training module is used to input two remote sensing sample images, the label image, and the pseudo-change image from each sample group into a pre-constructed change detection model, train the change detection model, and obtain a trained change detection model to detect remote sensing changes based on the trained change detection model.
9. An electronic device, characterized in that, It includes a processor and a memory, the memory being used to store a program, and the processor being used to implement the remote sensing intelligent change detection method based on metric learning as described in any one of claims 1-7 when executing the program.
10. A computer storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the remote sensing intelligent change detection method based on metric learning as described in any one of claims 1-7.