Change detection method, electronic device, and storage medium
By combining multi-scale feature extraction and attention model weighting with a dense upsampling model, this method solves the problems of difficult threshold selection and high computational cost in existing change detection methods, and achieves efficient and accurate change detection.
Patent Information
- Application Number
- CN202410414400.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-08
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2044-04-08
AI Technical Summary
Existing change detection methods suffer from problems such as difficulty in selecting thresholds, difficulty in obtaining modeling parameters, high computational cost, and low accuracy. They perform poorly, especially in pixel-based, machine learning, object-level, and deep learning methods. Furthermore, Siamese networks have excessive computational cost and are not suitable for practical applications.
A multi-scale feature extraction model and an attention model are employed. By determining channel weights and spatial weights, feature maps are weighted and then combined with a dense upsampling model to fuse feature maps, achieving lightweight change detection.
It improves the accuracy and speed of change detection, reduces deployment difficulty, and is easy to implement.
Smart Images

Figure CN118229652B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to a change detection method, electronic device, and storage medium. Background Technology
[0002] Change detection typically targets a specific feature of interest, such as buildings, farmland, or vehicles, and then analyzes its changes over different periods.
[0003] Currently, change detection methods primarily employ pixel-based approaches, machine learning methods, object-level methods, and deep learning methods. However, in pixel-based methods, threshold selection is crucial, leading to significant misclassification. Machine learning methods face challenges such as difficulty extracting change information, selecting appropriate modeling parameters, and the time-consuming process of creating sample labels. Object-level methods group pixels with similar attributes together, greatly reducing salt-and-pepper noise; however, they still suffer from difficulties in threshold selection and modeling. Deep learning methods eliminate the need for modeling and parameter tuning, but due to channel stacking issues, conventional pre-trained weights cannot be used, and existing models struggle to adequately address change-related aspects, resulting in low accuracy. While Siamese networks offer improved recognition performance, their computational cost is extremely high, making them unsuitable for practical applications. Summary of the Invention
[0004] In view of the above-mentioned defects or deficiencies in the prior art, this application aims to provide a change detection method, electronic device, and storage medium to improve the accuracy and speed of change detection, and the overall design is lightweight, reducing the difficulty of deployment.
[0005] This application provides a change detection method, the method comprising:
[0006] A first image and a second image are acquired. Based on the first image and a multi-scale feature extraction model, multiple first feature maps corresponding to the first image are determined, and based on the second image and the multi-scale feature extraction model, multiple second feature maps corresponding to the second image are determined; wherein, the scales of each first feature map are different, and the scales of each second feature map are different.
[0007] For each pair of first and second feature maps with the same scale, the channel weights and spatial weights corresponding to the scale are determined based on the first feature map, the second feature map, and the attention model. The first feature map is weighted based on the channel weights and spatial weights to obtain a first weighted map, and the second feature map is weighted based on the channel weights and spatial weights to obtain a second weighted map.
[0008] Based on each first weighted map, each second weighted map, and the dense upsampling model corresponding to each scale, a preset number of upsampling feature maps are determined, and each upsampling feature map is fused to obtain a target change detection map.
[0009] According to the technical solution provided in the embodiments of this application, optionally, determining multiple first feature maps corresponding to the first image based on the first image and the multi-scale feature extraction model includes:
[0010] The first image is sequentially input into a max pooling layer and a first scale layer to obtain a first feature map corresponding to the max pooling layer and the first scale layer; wherein, the max pooling layer and the first scale layer correspond to the first scale.
[0011] The first image is input into each of the second scale layers to obtain a first feature map corresponding to each second scale layer; wherein, different second scale layers correspond to different scales, and each first feature map corresponds to a different scale.
[0012] According to the technical solution provided in the embodiments of this application, optionally, the attention model includes a channel attention model and a spatial attention model, and the step of determining the channel weights and spatial weights corresponding to the scale based on the first feature map, the second feature map, and the attention model includes:
[0013] Based on the first feature map and the second feature map, determine the ratio feature map corresponding to the scale;
[0014] The ratio feature map is processed based on the channel attention model to obtain the channel weights corresponding to the scale;
[0015] The ratio feature map is processed based on a spatial attention model to obtain the spatial weights corresponding to the scale.
[0016] According to the technical solution provided in the embodiments of this application, optionally, determining the ratio feature map corresponding to the scale based on the first feature map and the second feature map includes:
[0017] Divide the first feature map by the second feature map to obtain the ratio feature map;
[0018] For each ratio element in the ratio feature map, if the ratio element is greater than 1, the reciprocal of the ratio element is taken as the new ratio element, and the ratio feature map is updated according to the new ratio element.
[0019] According to the technical solution provided in the embodiments of this application, optionally, the step of processing the ratio feature map based on the channel attention model to obtain the channel weights corresponding to the scale includes:
[0020] Based on the ratio feature map, determine the channel mean feature map corresponding to the channel dimension;
[0021] The channel mean feature map is processed according to a preset activation function to obtain the channel weights corresponding to the scale;
[0022] Accordingly, the process of processing the ratio feature map based on the spatial attention model to obtain the spatial weights corresponding to the scale includes:
[0023] Based on the ratio feature map, determine the spatial mean feature map and the spatial maximum feature map corresponding to the spatial dimension;
[0024] The spatial mean feature map and the spatial maximum feature map are fused to obtain a spatial fused feature map. The spatial fused feature map is then processed according to a preset activation function to obtain the spatial weights corresponding to the scale.
[0025] According to the technical solution provided in the embodiments of this application, optionally, the step of determining a preset number of upsampled feature maps based on each first weighted map, each second weighted map, and the dense upsampling model corresponding to each scale includes:
[0026] Sort each first weighted graph and each second weighted graph in ascending order of scale, take the smallest scale as the current scale, take the first weighted graph corresponding to the current scale as the first graph to be processed, and take the second weighted graph corresponding to the current scale as the second graph to be processed.
[0027] The difference between the first image to be processed and the second image to be processed is used as a difference map, and the difference map is input into the dense upsampling model corresponding to the current scale to obtain the process sampling map;
[0028] If a next scale exists for the current scale, then the next scale is taken as the new current scale. The process sampling map is added to the first weighted map corresponding to the new current scale to obtain the first unprocessed map corresponding to the new current scale. The process sampling map is added to the second weighted map corresponding to the new current scale to obtain the second unprocessed map corresponding to the new current scale. Then, the process sampling map is returned to perform the operation of taking the difference between the first unprocessed map and the second unprocessed map as the difference map and inputting the difference map into the dense upsampling model corresponding to the current scale to obtain the process sampling map, until the current scale is the maximum scale.
[0029] The process sampling images are sorted from largest to smallest scale, and the first preset number of process sampling images are used as upsampled feature images.
[0030] According to the technical solution provided in the embodiments of this application, optionally, the multi-scale feature extraction model, the attention model, and the dense upsampling model corresponding to each scale are trained based on the following method:
[0031] Obtain sample image pairs and corresponding sample change detection maps; wherein, the sample image pair includes a first sample image and a second sample image;
[0032] Based on the sample image pairs and the multi-scale feature extraction model, multiple sample first feature maps corresponding to the sample first image and multiple sample second feature maps corresponding to the sample second image are determined.
[0033] For each pair of sample first feature maps and sample second feature maps with the same scale, the sample channel weights and sample space weights corresponding to the scale are determined based on the sample first feature map, the sample second feature map, and the attention model. The sample first feature map is weighted based on the sample channel weights and sample space weights to obtain the sample first weighted map, and the sample second feature map is weighted based on the sample channel weights and sample space weights to obtain the sample second weighted map.
[0034] Based on the first weighted map of each sample, the second weighted map of each sample, and the dense upsampling model corresponding to each scale, a preset number of sample upsampling feature maps are determined, and the sample upsampling feature maps are fused to obtain the model change detection map.
[0035] Based on the model change detection map, the sample change detection map, and the preset loss function, the sample loss is determined, and the model parameters of the multi-scale feature extraction model, the attention model, and the dense upsampling model corresponding to each scale are adjusted according to the sample loss.
[0036] According to the technical solution provided in the embodiments of this application, optionally, obtaining the first image and the second image includes:
[0037] A first initial image and a second initial image are acquired, and the first initial image and the second initial image are segmented according to the change detection target to obtain a first segmented image and a second segmented image.
[0038] The first cut image is divided into object-level segments to obtain a first object image, and the second cut image is divided into object-level segments to obtain a second object image;
[0039] The second object image is subjected to relative radiometric correction based on the first object image, and the first object image and the second object image after relative radiometric correction are normalized respectively to obtain the first image and the second image.
[0040] This application also provides an electronic device, the electronic device comprising:
[0041] Processor and memory;
[0042] The processor executes the steps of the change detection method as described in any embodiment by calling programs or instructions stored in the memory.
[0043] This application also provides a computer-readable storage medium storing a program or instructions that cause a computer to perform the steps of the change detection method as described in any embodiment.
[0044] In summary, this application proposes a change detection method. It acquires a first image and a second image, and uses a multi-scale feature extraction model to determine multiple first feature maps corresponding to the first image and multiple second feature maps corresponding to the second image for multi-scale feature extraction. Then, for each pair of first and second feature maps with the same scale, an attention model is used to determine the channel weights and spatial weights corresponding to that scale. The first and second feature maps are then weighted based on the channel and spatial weights to obtain a first weighted map and a second weighted map, which better reflect image changes. Based on each first weighted map, each second weighted map, and the dense upsampling model corresponding to each scale, a preset number of upsampled feature maps are determined, and these upsampled feature maps are fused to obtain a target change detection map. This method improves the accuracy and speed of change detection, and is lightweight, reducing deployment difficulty and making it easy to implement. Attached Figure Description
[0045] Figure 1 This is a flowchart of a change detection method provided in an embodiment of this application;
[0046] Figure 2 This is a schematic diagram of a multi-scale feature extraction model provided in an embodiment of this application;
[0047] Figure 3 This is a flowchart of another change detection method provided in the embodiments of this application;
[0048] Figure 4 This is a schematic diagram illustrating a method for solving channel weights and spatial weights according to an embodiment of this application;
[0049] Figure 5 This is a schematic diagram illustrating a process for solving a target change detection map according to an embodiment of this application;
[0050] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0051] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0052] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0053] Figure 1 This is a flowchart of a change detection method provided in an embodiment of this application. See also... Figure 1 The change detection method specifically includes:
[0054] S110. Obtain the first image and the second image. Based on the first image and the multi-scale feature extraction model, determine multiple first feature maps corresponding to the first image. Based on the second image and the multi-scale feature extraction model, determine multiple second feature maps corresponding to the second image.
[0055] Here, the first image and the second image are two images to be changed, which can be images of the same target at different times, such as building A at time T1 and building A at time T2. The multi-scale feature extraction model is a model used to extract features from the first image and the second image at multiple scales. The first feature map is the feature map of the first image at different scales, and the second feature map is the feature map of the second image at different scales. That is, each first feature map has a different scale, and each second feature map has a different scale; however, each scale corresponds to one first feature map and one second feature map.
[0056] Specifically, a first image and a second image for which change detection is required are acquired. The first image is input into a multi-scale feature extraction model, which outputs multiple first feature maps corresponding to the first image. Similarly, the second image is input into the multi-scale feature extraction model, which outputs multiple second feature maps corresponding to the second image.
[0057] Based on the above example, the first and second images can be obtained in the following way:
[0058] A first initial image and a second initial image are acquired, and the first initial image and the second initial image are segmented according to the change detection target to obtain a first segmented image and a second segmented image;
[0059] The first segmented image is divided into object-level segments to obtain the first object image, and the second segmented image is divided into object-level segments to obtain the second object image;
[0060] The second object image is subjected to relative radiometric correction based on the first object image, and the first object image and the second object image after relative radiometric correction are normalized respectively to obtain the first image and the second image.
[0061] The first initial image and the second initial image are a pair of original images that need to be changed. The change detection target is the object to be detected, such as a building. The first cut image is obtained by cutting the first initial image according to the change detection target and scaling it to a preset size. The second cut image is obtained by cutting the second initial image according to the change detection target and scaling it to a preset size. The first object image is obtained by object-level segmentation of the first cut image, and the second object image is obtained by object-level segmentation of the second cut image.
[0062] Specifically, a first initial image and a second initial image are acquired. Based on the change detection targets in the first and second initial images, they are segmented and scaled to obtain a first segmented image and a second segmented image. The first segmented image is then divided into object-level segments to obtain a first object image, and the second segmented image is also divided into object-level segments to obtain a second object image. The object-level segmentation can be performed using Python code based on various segmentation criteria, such as superpixel-based segmentation or graph theory-based segmentation, or it can be performed adaptively using mature commercial software. Relative radiometric correction is then performed on the second object image using the first object image as a basis. The first object image is then normalized to obtain a first image, and the radiometrically corrected second object image is also normalized to obtain a second image. The relative radiometric correction method can be based on histogram matching, statistical methods, wavelet transform, or least binomial methods. Optionally, histogram matching correction can be performed to reduce system load. After correction, the image is normalized to a normalization interval of [0-1], which can further reduce the impact of data size on subsequent model use.
[0063] The change detection method in this embodiment combines object-level methods, resulting in smoother and more easily understood detection results with minimal isolated pixels, thus fitting the real-world scenario from a human eye perspective. Furthermore, the inclusion of relative radiometric correction further reduces misclassification due to color space mismatches, accelerating model training and application.
[0064] Based on the above example, multiple first feature maps corresponding to the first image can be determined using the first image and the multi-scale feature extraction model in the following way:
[0065] The first image is sequentially input into the max pooling layer and the first scale layer to obtain the first feature map corresponding to the max pooling layer and the first scale layer;
[0066] The first image is input into each of the second scale layers to obtain the first feature map corresponding to each second scale layer.
[0067] Among them, the max pooling layer and the first scale layer correspond to the first scale. The first scale is the largest scale among all scales. Different second scale layers correspond to different scales, and each first feature map corresponds to a different scale.
[0068] Specifically, the first image is sequentially input into a max pooling layer and a first scale layer to obtain a first feature map corresponding to the max pooling layer and the first scale layer, i.e., the first feature map corresponding to the first scale. The first image is then input into a second scale layer corresponding to each different scale to obtain a first feature map corresponding to each second scale layer, i.e., the first feature map at different scales.
[0069] It is understandable that the method of processing the second image to obtain multiple second feature maps is similar to the method of processing the first image to obtain multiple first feature maps, and will not be elaborated here.
[0070] For example, multi-scale feature extraction models such as Figure 2 As shown, the lightweight ResNet34 from the ResNet network is selected as the backbone. Maxpool and Layer 1, Layer 2, Layer 3, and Layer 4 are used to extract four multi-scale features from the multi-temporal images (first image and second image) in descending order of size. Here, T1 represents the first image, T2 represents the second image, Maxpool represents the max pooling layer, Layer 1 represents the first-scale layer corresponding to the first scale, Feature 1 represents the first feature map corresponding to the first scale, and Feature 1' represents the second feature map corresponding to the first scale; Layer 2 represents the second-scale layer corresponding to the second scale, Feature 2 represents the first feature map corresponding to the second scale, and Feature 2' represents the second feature map corresponding to the second scale; Layer 3 represents the second-scale layer corresponding to the third scale, Feature 3 represents the first feature map corresponding to the third scale, and Feature 3' represents the second feature map corresponding to the third scale; Layer 4 represents the second-scale layer corresponding to the fourth scale, Feature 4 represents the first feature map corresponding to the fourth scale, and Feature 4' represents the second feature map corresponding to the fourth scale. The order is: first scale > second scale > third scale > fourth scale. For example, the first scale is 1 / 2, the second scale is 1 / 4, the third scale is 1 / 8, and the fourth scale is 1 / 16.
[0071] S120. For each pair of first and second feature maps with the same scale, determine the channel weights and spatial weights corresponding to the scale based on the first feature map, the second feature map, and the attention model. Weight the first feature map based on the channel weights and spatial weights to obtain the first weighted map, and weight the second feature map based on the channel weights and spatial weights to obtain the second weighted map.
[0072] The attention model is used to focus attention on specific parts; it can be a channel attention model focusing on the channel dimension or a spatial attention model focusing on the spatial dimension. Channel weights are weights in the channel dimension, and spatial weights are weights in the spatial dimension. The first weighted map is the result of weighting the first feature map with channel weights and spatial weights, and the second weighted map is the result of weighting the second feature map with channel weights and spatial weights.
[0073] Specifically, for each pair of first and second feature maps with the same scale, the same processing method can be used. Taking one pair of first and second feature maps as an example, the paired first and second feature maps are fused. An attention model is then used to process the channel dimension of the fused image to obtain channel weights. Similarly, an attention model is used to process the spatial dimension of the fused image to obtain spatial weights. The channel weights and spatial weights are multiplied by the first feature map to obtain a first weighted image. Finally, the channel weights and spatial weights are multiplied by the second feature map to obtain a second weighted image, thus enhancing the variation information.
[0074] S130. Based on each first weighted map, each second weighted map, and the dense upsampling model corresponding to each scale, determine a preset number of upsampling feature maps, and perform fusion processing on each upsampling feature map to obtain a target change detection map.
[0075] The dense upsampling model is used to process each first-weighted image and each second-weighted image using the Dense Upsampling Convolution (DUC) method. DUC sacrifices channel dimension by learning amplified filters to fill in the width and height dimensions of the upsampled images. Its advantage is that all operations are performed within the features, without introducing equations that derive the unknown from the known, and the features are not destroyed. The model parameters of the DUC model can differ for different scales. The preset quantity is a pre-defined number of upsampled feature maps to be used subsequently. The upsampled feature map is the image after upsampling and subsequent fusion processing. The target change detection map is used to characterize the changes between the first and second images.
[0076] Specifically, the first and second weighted maps are fused in ascending order of scale, and then sequentially input into the dense upsampling model. Furthermore, the first and second feature maps corresponding to the previous scale are also input into the dense upsampling model, thereby obtaining the result maps for each scale. Then, a predetermined number of maps from each result map are used as upsampled feature maps, and these upsampled feature maps are fused to obtain the target change detection map.
[0077] Based on the above example, the multi-scale feature extraction model, the attention model, and the dense upsampling model corresponding to each scale are trained using the following method:
[0078] Obtain sample image pairs and corresponding sample change detection maps for the sample image pairs;
[0079] Based on the sample image pairs and the multi-scale feature extraction model, multiple sample first feature maps corresponding to the sample first image and multiple sample second feature maps corresponding to the sample second image are determined.
[0080] For each pair of sample first feature maps and sample second feature maps with the same scale, the sample channel weights and sample space weights corresponding to the scale are determined based on the sample first feature map, sample second feature map and attention model. The sample first feature map is weighted based on the sample channel weights and sample space weights to obtain the sample first weighted map. The sample second feature map is weighted based on the sample channel weights and sample space weights to obtain the sample second weighted map.
[0081] Based on the first weighted map of each sample, the second weighted map of each sample, and the dense upsampling model corresponding to each scale, a preset number of sample upsampling feature maps are determined, and the sample upsampling feature maps are fused to obtain the model change detection map.
[0082] Based on the model change detection map, the sample change detection map, and the preset loss function, the sample loss is determined, and the model parameters of the multi-scale feature extraction model, the attention model, and the dense upsampling model corresponding to each scale are adjusted according to the sample loss.
[0083] The sample image pair includes a first sample image and a second sample image, which can be images of the same object collected at different times. The sample change detection map describes the changes between the first and second sample images. The first sample feature map is the feature map of the first sample image at different scales, and the second sample feature map is the feature map of the second sample image at different scales. The sample channel weights and sample space weights are the channel-dimensional weights and spatial-dimensional weights obtained after processing the first and second sample feature maps using the attention model. The first sample weighted map is the image after weighting the first sample feature map with the sample channel weights and sample space weights, and the second sample weighted map is the image after weighting the second sample feature map with the sample channel weights and sample space weights. The sample upsampling feature map is the image after upsampling and subsequent fusion processing. The model change detection map is the output image representing the changes between the first and second sample images. The preset loss function is a pre-selected loss function used to judge the difference between the model change detection map and the sample change detection map. Sample loss is the output of a predefined loss function, used to characterize the difference between the model change detection map and the sample change detection map.
[0084] Specifically, the process of sequentially processing sample image pairs to obtain the model change detection map is similar to the process of sequentially processing the first and second images to obtain the target change detection map, and will not be elaborated here. Further, a loss is calculated on the model change detection map and the sample change detection map using a preset loss function to obtain the sample loss. It is then determined whether the sample loss meets the model requirements. If it does, the multi-scale feature extraction model, attention model, and dense upsampling models corresponding to each scale are considered complete. If not, the model parameters of the multi-scale feature extraction model, attention model, and dense upsampling models corresponding to each scale are adjusted based on the sample loss to return to the steps of determining multiple sample first feature maps corresponding to the first sample image and multiple sample second feature maps corresponding to the second sample image based on the sample image pairs and the multi-scale feature extraction model.
[0085] For example, sample image pairs can be divided according to a certain ratio, such as a training set: validation set: test set = 8:1:1. The acquisition of sample image pairs can be achieved in the following way:
[0086] (1) Open the target software, click New Workspace to create a workspace, and then click Customized Import in the workspace to import the folder containing the images to be processed. The target software is used to process and acquire sample object pairs.
[0087] (2) Click the "tree" option in the Process menu to build a combined algorithm, which facilitates automatic segmentation and extraction of sample image pairs. The combined algorithm mainly consists of three aspects: First, building an automated workflow for "execute child processes," which can automatically complete the segmentation and saving of all images; Second, selecting an automatic segmentation algorithm and importing a plugin, which can assist the software in completing automatic segmentation without requiring any manual parameters; Third, selecting a suitable path to export raster (TIF) data, where the information in the raster data is the segmentation information.
[0088] (3) Using the pyautogui library in Python, automatic batch segmentation is assisted. First, the two-dimensional coordinate information x, y of the first image path, the distance s between each image path, and the two-dimensional coordinate information do_x, do_y of the Do method in the automatic execution process are obtained. Further, based on the existing x, y information, the computer automatically double-clicks the image to load it into the workspace, then clicks the do_x, do_y area and executes the segmentation process. After waiting for a preset time, such as 2 seconds, Ctrl+S is automatically triggered to save the segmentation results. Then, the next image is triggered based on the distance s between the image paths, and this process is repeated. It is also determined whether to flip through the pages to obtain the next image and whether the current image is on the last page. Before processing, the total number of images (total_number), the total number of images on the last page (final_number), and the number of images covered when flipping through a page (page_number, e.g., 3) are calculated. The calculation formulas are as follows:
[0089] n=((total_numbel-final_number)) / page_number
[0090] r=(total_numbel-final_number)%page_number
[0091] Where n is the number of times the page needs to be flipped, and r is the number of images remaining to be covered in one page. % is the modulo operator. When r is not 0, the last page flip will not be performed after each segment has covered a number of images (page_number), but rather after each segment has covered a number of images (page_number). When r is 0, the page flip will be performed after each segment has covered a number of images (page_number).
[0092] For example, change detection tasks are extremely difficult to train compared to other classification tasks. Therefore, a comprehensive pre-defined loss function can be chosen to help train in the right direction. For instance, two loss functions can be combined to assist in model optimization training. The first loss function is the cross-entropy loss function, used to quantify the differences between multiple probability distributions; the second loss function is the Dice Loss, which avoids the loss function from entering local minima, preventing the model from learning optimal parameters. Therefore, the pre-defined loss function is the sum of the first and second loss functions.
[0093] Optionally, the above model training process can be performed on a Windows 11 system, with an NVIDIA GeForce RTX 3060 GPU, Python 3.7, and PyTorch 1.12.0 as the deep learning environment. The `bantch_size` is set to 4, the optimizer strategy is ADAM, the initial learning rate is 0.00005, and pre-trained ResNet34 weights on ImageNet are loaded, for a total of 100 training epochs.
[0094] The change detection method provided in this application acquires a first image and a second image. It then uses a multi-scale feature extraction model to determine multiple first feature maps corresponding to the first image and multiple second feature maps corresponding to the second image for multi-scale feature extraction. Furthermore, for each pair of first and second feature maps with the same scale, it determines the channel weights and spatial weights corresponding to that scale based on an attention model. The first and second feature maps are then weighted based on the channel and spatial weights to obtain a first weighted map and a second weighted map, which better reflect image changes. Based on each first weighted map, each second weighted map, and the dense upsampling model corresponding to each scale, a preset number of upsampled feature maps are determined. These upsampled feature maps are then fused to obtain a target change detection map. This method improves the accuracy and speed of change detection, and is lightweight, reducing deployment difficulty and making it easy to implement.
[0095] Figure 3 This is a flowchart of another change detection method provided in an embodiment of this application. Based on the above embodiments, the methods for determining channel weights and spatial weights at each scale are illustrated. See [link to documentation]. Figure 3 The change detection method specifically includes:
[0096] S210. Obtain the first image and the second image. Based on the first image and the multi-scale feature extraction model, determine multiple first feature maps corresponding to the first image. Based on the second image and the multi-scale feature extraction model, determine multiple second feature maps corresponding to the second image.
[0097] S220. For each pair of first and second feature maps with the same scale, determine the ratio feature map corresponding to the scale based on the first and second feature maps.
[0098] Among them, the ratio feature map is a feature map used to describe the ratio relationship between the first feature map and the second feature map.
[0099] Specifically, taking a single scale as an example, the ratio of corresponding elements in the first and second feature maps corresponding to that scale is calculated. The smaller element is compared to the larger element to obtain the ratio feature map corresponding to that scale. This ratio feature map is then subtracted from 1 to obtain the final ratio feature map used to describe the change between the first and second feature maps. The ratio feature maps corresponding to each scale can be obtained using the above method, and will not be elaborated further here.
[0100] Based on the above example, the ratio feature map corresponding to the scale can be determined from the first feature map and the second feature map in the following way:
[0101] Divide the first feature map by the second feature map to obtain the ratio feature map;
[0102] For each ratio element in the ratio feature map, if the ratio element is greater than 1, the reciprocal of the ratio element is taken as the new ratio element, and the ratio feature map is updated according to the new ratio element.
[0103] Among them, the ratio elements are the elements in the ratio feature map.
[0104] Specifically, the first feature map is divided by the second feature map to obtain an initial ratio feature map. To ensure that each ratio element in the ratio feature map is less than 1, the reciprocals of the ratio elements greater than 1 are taken and used to replace the original ratio elements, so that each ratio element in the processed ratio feature map is less than 1. Furthermore, to reflect the change, each ratio element is subtracted from 1 to obtain a new image, which serves as the new ratio feature map.
[0105] For example: First, calculate the ratio of the first feature map to the second feature map. Then, adjust the ratio to a value between [0-1] as needed, specifically using the following formula:
[0106]
[0107] Where Div represents the ratio elements in the ratio feature map of the first feature map divided by the second feature map. t1 is an element in the first feature map, and t2 is an element in the second feature map; t1 and t2 have a corresponding relationship when calculating the ratio. Div' represents the ratio elements in the ratio feature map after adjusting the ratio elements to the range [0-1].
[0108] Since Div' is between [0-1], the larger the value, the smaller the probability of change; conversely, the smaller the value, the greater the probability of change. Therefore, by subtracting each ratio element from the obtained ratio elements using the constant 1, a new set of ratio elements is obtained, which is the total change feature, and a new ratio feature map is constructed.
[0109] For example, before determining the ratio feature map corresponding to the scale based on the first and second feature maps, the channel dimensions of these first and second feature maps can be uniformly adjusted to a preset number of channels (e.g., 128) to reduce unnecessary channel dimensions. This can be achieved by using a set of 1x1 convolutions, BN (Batch Normalization), and ReLU activation functions to perform channel dimensionality reduction on all first and second feature maps, thereby uniformly adjusting the number of channels to the preset number.
[0110] S230. Based on the channel attention model, the feature map of the comparison value is processed to obtain the channel weights corresponding to the scale.
[0111] Among them, the channel attention model is used to extract channel attention from the ratio feature map.
[0112] Specifically, the ratio feature map is input into the channel attention model to extract channel attention and obtain the channel weights of the scale corresponding to the ratio feature map.
[0113] Building upon the example above, the channel weights corresponding to the scale can be obtained by processing the contrastive feature map based on the channel attention model in the following way:
[0114] Based on the ratio feature map, determine the channel mean feature map corresponding to the channel dimension;
[0115] The channel mean feature map is processed according to a preset activation function to obtain the channel weights corresponding to the scale.
[0116] The channel mean feature map is a feature map composed of the means of each value in the channel dimension of the ratio feature map. The preset activation function is a pre-determined activation function used to process the channel mean feature map.
[0117] Specifically, the mean of the ratio feature map along the channel dimension is calculated, a channel mean feature map is constructed, and then the channel mean feature map is processed with a preset activation function. The result is the channel weights of the scale corresponding to the ratio feature map.
[0118] For example, first, the mean feature of the ratio feature map in the channel dimension is obtained to get the channel mean feature map. Then, the sigmoid function (preset activation function) is applied to the channel mean feature map to obtain the channel weights, as shown in the following formula:
[0119] D=sigmoid(mean_channel(Div_final))
[0120] Where D is the channel weight, sigmoid is the preset activation function, mean_channel is the function used to calculate the mean feature in the channel dimension, Div_final is the ratio feature map, and mean_channel(Div_final) is the channel mean feature map.
[0121] S240. Based on the spatial attention model, the feature map of the contrast value is processed to obtain the spatial weights corresponding to the scale.
[0122] Among them, the spatial attention model is used to extract spatial attention from the ratio feature map.
[0123] Specifically, the ratio feature map is input into the spatial attention model to extract spatial attention and obtain the spatial weights of the scale corresponding to the ratio feature map.
[0124] Building upon the above example, the spatial weights corresponding to the scale can be obtained by processing the contrastive feature map based on the spatial attention model in the following way:
[0125] Based on the ratio feature map, determine the spatial mean feature map and the spatial maximum feature map corresponding to the spatial dimension;
[0126] The spatial mean feature map and the spatial maximum feature map are fused to obtain a spatial fused feature map. The spatial fused feature map is then processed according to a preset activation function to obtain the spatial weights corresponding to the scale.
[0127] The spatial mean feature map is composed of the means of the ratio feature map in the spatial dimension. The spatial maximum feature map is composed of the maximum values of the ratio feature map in the spatial dimension. The spatial fusion feature map is obtained by fusing the spatial mean feature map and the spatial maximum feature map using a preset fusion method, such as stacking fusion, additive fusion, or convolution fusion. The preset activation function is a pre-determined activation function used to process the spatial fusion feature map.
[0128] Specifically, the mean of the ratio feature map in the spatial dimension is calculated to construct a spatial mean feature map. The maximum value of the ratio feature map in the spatial dimension is calculated to construct a spatial maximum feature map. The spatial mean feature map and the spatial maximum feature map are stacked along the channel dimension, and convolution is used to adjust the dimension size to obtain a spatial fusion feature map. Then, the spatial fusion feature map is processed with a preset activation function, and the result is the spatial weight of the scale corresponding to the ratio feature map.
[0129] For example, the mean and maximum features of the ratio feature map are obtained separately in the spatial dimension to construct a spatial mean feature map and a spatial maximum feature map. Then, the spatial mean feature map and the spatial maximum feature map are stacked along the channel dimension and adjusted using convolution. Finally, the adjusted result, i.e., the spatial fusion feature map, is subjected to a sigmoid function (preset activation function) to obtain the spatial weights (A), which are calculated using the following formula:
[0130] A=sigmoid(conv(max_space(Div_final), mean_space(Div_final)))
[0131] Where A is the spatial weight, sigmoid is the preset activation function, mean_space is the function used to calculate the mean feature in the spatial dimension, max_space is the function used to calculate the maximum feature in the spatial dimension, Div_final is the ratio feature map, mean_space(Div_final) is the spatial mean feature map, max_space(Div_final) is the spatial maximum feature map, conv is the convolution function, and conv(max_space(Div_final), mean_space(Div_final)) is the result of stacking the spatial mean feature map and the spatial maximum feature map in the channel dimension and adjusting them using convolution, i.e., the spatial fusion feature map.
[0132] For example, such as Figure 4 The diagram illustrates the calculation of channel weights and spatial weights. Div Feature represents the ratio feature map, Channel Attention represents channel attention, and Spatial Attention represents spatial attention. Calculating only channel and spatial weights is more accurate and, by normalizing all data to [0-1], computational complexity is significantly reduced, resulting in more precise weights. Channel and spatial weights effectively enhance the information about changes in multi-scale features, requiring less attention to invariant features and improving the accuracy of recognition.
[0133] S250. The first feature map is weighted based on channel weight and spatial weight to obtain the first weighted map, and the second feature map is weighted based on channel weight and spatial weight to obtain the second weighted map.
[0134] S260. Based on each first weighted map, each second weighted map, and the dense upsampling model corresponding to each scale, determine a preset number of upsampling feature maps, and perform fusion processing on each upsampling feature map to obtain a target change detection map.
[0135] Based on the above example, a preset number of upsampled feature maps can be determined using the following method, based on each first weighted map, each second weighted map, and the dense upsampling model corresponding to each scale:
[0136] Sort each first weighted graph and each second weighted graph in ascending order of scale, take the smallest scale as the current scale, take the first weighted graph corresponding to the current scale as the first graph to be processed, and take the second weighted graph corresponding to the current scale as the second graph to be processed.
[0137] The difference between the first image to be processed and the second image to be processed is used as the difference map. The difference map is then input into the dense upsampling model corresponding to the current scale to obtain the process sampling map.
[0138] If there exists a next scale for the current scale, then the next scale for the current scale is taken as the new current scale. The process sampling map is added to the first weighted map corresponding to the new current scale to obtain the first unprocessed map corresponding to the new current scale. The process sampling map is added to the second weighted map corresponding to the new current scale to obtain the second unprocessed map corresponding to the new current scale. Then, the difference between the first unprocessed map and the second unprocessed map is taken as the difference map and input into the dense upsampling model corresponding to the current scale to obtain the process sampling map. This process continues until the current scale is the maximum scale.
[0139] The process sampling images are sorted from largest to smallest scale, and the first preset number of process sampling images are used as upsampled feature images.
[0140] The process involves sequentially using each scale, starting from the smallest scale, as the current scale to process the first and second weighted images at each scale. The first image to be processed is the input to the dense upsampling model from the first image, and the second image to be processed is the input to the dense upsampling model from the second image. The difference image is the difference between the first and second images to be processed. The process sampling image is the output of the dense upsampling model.
[0141] Specifically, starting from the smallest scale, the smallest scale is taken as the current scale. The first weighted map corresponding to the current scale is taken as the first map to be processed, and the second weighted map corresponding to the current scale is taken as the second map to be processed. The difference between the first map to be processed and the second map to be processed is calculated as the difference map. Then, the difference map is subjected to dense upsampling processing through the dense upsampling model corresponding to the current scale to obtain the process sampling map corresponding to the current scale, that is, the process sampling map corresponding to the smallest scale. Furthermore, to obtain the process sampling map corresponding to the next scale of the current scale, it can be understood that the next scale of the minimum scale is a scale adjacent to and larger than the minimum scale. Specifically, the next scale of the current scale is taken as the new current scale. The process sampling map is added to the first weighted map corresponding to the new current scale to obtain the first unprocessed map corresponding to the new current scale. The process sampling map is added to the second weighted map corresponding to the new current scale to obtain the second unprocessed map corresponding to the new current scale. Based on this, the difference between the new first unprocessed map and the new second unprocessed map can be calculated as a new difference map. Then, the new difference map is densely upsampled using the dense upsampling model corresponding to the new current scale to obtain the process sampling map corresponding to the new current scale. According to the above iterative method, the process sampling maps corresponding to each scale can be determined sequentially until there is a corresponding process sampling map for each scale. Furthermore, the process sampling maps are sorted from largest to smallest scale, and the first preset number of process sampling maps are used as upsampling feature maps. For example, the process sampling maps corresponding to the two largest scales are used as upsampling feature maps.
[0142] For example, the extracted multi-scale weighted feature maps (each first weighted map and each second weighted map) need to be fused, and deconvolution upsampling is used to restore them to the original image (first image and second image) size to obtain the target change detection map. Figure 5 As shown, DA represents the weighted feature map after weighting by channel weights and spatial weights, including the first weighted map and the second weighted map. Diff represents the difference between the first weighted map and the second weighted map, C1 represents the number of channels corresponding to the 1 / 2 scale, C2 represents the number of channels corresponding to the 1 / 4 scale, C3 represents the number of channels corresponding to the 1 / 8 scale, C4 represents the number of channels corresponding to the 1 / 16 scale, H represents the original image height, W represents the original image width, and RRC is the relative radiometric correction. Starting from the smallest scale feature, the first feature map and the second feature map corresponding to this smallest scale are solved. Figure 5In the Sampling Features (the left side can be considered the first feature map, and the right side the second feature map), the channel weights D and spatial weights A are calculated. The first feature map is weighted to obtain the first weighted map, and the second feature map is weighted to obtain the second weighted map, thus completing the DA processing. Further, the difference between the first and second weighted maps is calculated to obtain the difference map, i.e., a Diff operation is performed. Then, the difference map undergoes dense upsampling processing corresponding to the minimum scale (input to the dense upsampling model corresponding to the minimum scale) to obtain the process sampling map. The process sampling map is added to the upper-level features (the first and second weighted maps at the next smallest scale) to enrich its variation information. The difference map corresponding to the next smallest scale is then obtained and densely upsampled to obtain the process feature map, which is then added to the next upper-level features, continuing until the maximum scale. This process can be understood as repeating until the top-level features (the first and second feature maps corresponding to the maximum scale) are fused. Figure 5 As shown, four process upsampling images can be obtained. The first two (preset number), namely process upsampling images with scales of 1 / 2 and 1 / 4, are selected as upsampling feature images. They are then superimposed in terms of channel dimensions, and then fused using convolution. Finally, dense upsampling convolution is used to adjust the fusion result to the original image size to obtain the target change detection image.
[0143] The semantic information of change detection targets is often very complex and varies greatly in size. Therefore, the upsampling method used has a significant impact on the final result. Currently, most methods use bilinear interpolation for feature recovery. However, bilinear interpolation fills in gaps in features by constructing a linear function, which is unlearnable and leads to the loss of a large amount of detail. Therefore, the change detection method in this embodiment uses dense upsampling to avoid the above problems, better protect features from damage, and is more suitable for change detection because it targets changed features rather than stacking general features. Dense upsampling convolution directly transforms the channel dimension to the spatial dimension without any unnecessary loss, greatly enhancing the connection between features and reducing redundancy conflicts during fusion.
[0144] The change detection method provided in this application determines the ratio feature map corresponding to the scale for each pair of first and second feature maps with the same scale. It then processes the feature map based on the channel attention model to obtain the channel weight corresponding to the scale, and processes the feature map based on the spatial attention model to obtain the spatial weight corresponding to the scale. This method achieves the effect of strengthening the change information of multi-scale features from the root of change detection, improving the subsequent accurate recognition capability. Furthermore, it does not use the computationally intensive Transformer model, making the whole process lightweight and reducing the difficulty of actual deployment.
[0145] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 6 As shown, the electronic device 600 includes one or more processors 601 and memory 602.
[0146] The processor 601 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 600 to perform desired functions.
[0147] The memory 602 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 601 may execute the program instructions to implement the change detection method of any embodiment of this application described above and / or other desired functions. Various contents such as initial extrinsic parameters and thresholds may also be stored in the computer-readable storage medium.
[0148] In one example, electronic device 600 may further include an input device 603 and an output device 604, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown). The input device 603 may include, for example, a keyboard, a mouse, etc. The output device 604 may output various information to the outside, including warning messages, braking force, etc. The output device 604 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0149] Of course, for the sake of simplicity, Figure 6 Only some of the components of the electronic device 600 relevant to this application are shown in this illustration; components such as buses, input / output interfaces, etc., are omitted. In addition, the electronic device 600 may include any other suitable components depending on the specific application.
[0150] In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps of the change detection method provided in any embodiment of this application.
[0151] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0152] Furthermore, embodiments of this application may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the change detection method provided in any embodiment of this application.
[0153] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0154] It should be noted that the terminology used in this application is for the purpose of describing specific embodiments only and is not intended to limit the scope of this application. As shown in the specification and claims of this application, unless the context clearly indicates otherwise, words such as "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, or apparatus. Without further limitations, an element defined by the phrase "comprising an..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element.
[0155] It should also be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application 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 on this application. Unless otherwise expressly specified and limited, the terms "installed," "connected," "linked," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication between two elements. For those skilled in the art, the specific meaning of the above terms in this application can be understood according to the specific circumstances.
[0156] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. The above descriptions are only preferred embodiments of this application. It should be noted that due to the limitations of written expression, while there are objectively infinite specific structures, those skilled in the art can make several improvements, modifications, or changes without departing from the principles of this invention, and can also combine the above technical features in an appropriate manner. These improvements, modifications, changes, or combinations, or the direct application of the inventive concept and technical solution to other situations without modification, should all be considered within the scope of protection of this application.
Claims
1. A change detection method, characterized in that, include: A first image and a second image are acquired. Based on the first image and a multi-scale feature extraction model, multiple first feature maps corresponding to the first image are determined, and based on the second image and the multi-scale feature extraction model, multiple second feature maps corresponding to the second image are determined; wherein, the scales of each first feature map are different, and the scales of each second feature map are different. For each pair of first and second feature maps with the same scale, the channel weights and spatial weights corresponding to the scale are determined based on the first feature map, the second feature map, and the attention model. The first feature map is weighted based on the channel weights and spatial weights to obtain a first weighted map, and the second feature map is weighted based on the channel weights and spatial weights to obtain a second weighted map. Based on each first weighted map, each second weighted map, and the dense upsampling model corresponding to each scale, a preset number of upsampling feature maps are determined, and each upsampling feature map is fused to obtain a target change detection map. The attention model includes a channel attention model and a spatial attention model. Determining the channel weights and spatial weights corresponding to the scale based on the first feature map, the second feature map, and the attention model includes: Based on the first feature map and the second feature map, determine the ratio feature map corresponding to the scale; The ratio feature map is processed based on the channel attention model to obtain the channel weights corresponding to the scale; The ratio feature map is processed based on a spatial attention model to obtain the spatial weights corresponding to the scale.
2. The method according to claim 1, characterized in that, The step of determining multiple first feature maps corresponding to the first image based on the first image and the multi-scale feature extraction model includes: The first image is sequentially input into a max pooling layer and a first scale layer to obtain a first feature map corresponding to the max pooling layer and the first scale layer; wherein, the max pooling layer and the first scale layer correspond to the first scale. The first image is input into each of the second scale layers to obtain a first feature map corresponding to each second scale layer; wherein, different second scale layers correspond to different scales, and each first feature map corresponds to a different scale.
3. The method according to claim 1, characterized in that, The step of determining the ratio feature map corresponding to the scale based on the first feature map and the second feature map includes: Divide the first feature map by the second feature map to obtain the ratio feature map; For each ratio element in the ratio feature map, if the ratio element is greater than 1, the reciprocal of the ratio element is taken as the new ratio element, and the ratio feature map is updated according to the new ratio element.
4. The method according to claim 1, characterized in that, The process of processing the ratio feature map based on the channel attention model to obtain the channel weights corresponding to the scale includes: Based on the ratio feature map, determine the channel mean feature map corresponding to the channel dimension; The channel mean feature map is processed according to a preset activation function to obtain the channel weights corresponding to the scale; Accordingly, the process of processing the ratio feature map based on the spatial attention model to obtain the spatial weights corresponding to the scale includes: Based on the ratio feature map, determine the spatial mean feature map and the spatial maximum feature map corresponding to the spatial dimension; The spatial mean feature map and the spatial maximum feature map are fused to obtain a spatial fused feature map. The spatial fused feature map is then processed according to a preset activation function to obtain the spatial weights corresponding to the scale.
5. The method according to claim 1, characterized in that, The step of determining a preset number of upsampled feature maps based on each first weighted map, each second weighted map, and the dense upsampling model corresponding to each scale includes: Sort each first weighted graph and each second weighted graph in ascending order of scale, take the smallest scale as the current scale, take the first weighted graph corresponding to the current scale as the first graph to be processed, and take the second weighted graph corresponding to the current scale as the second graph to be processed. The difference between the first image to be processed and the second image to be processed is used as a difference map, and the difference map is input into the dense upsampling model corresponding to the current scale to obtain the process sampling map; If a next scale exists for the current scale, then the next scale is taken as the new current scale. The process sampling map is added to the first weighted map corresponding to the new current scale to obtain the first unprocessed map corresponding to the new current scale. The process sampling map is added to the second weighted map corresponding to the new current scale to obtain the second unprocessed map corresponding to the new current scale. Then, the process sampling map is returned to perform the operation of taking the difference between the first unprocessed map and the second unprocessed map as the difference map and inputting the difference map into the dense upsampling model corresponding to the current scale to obtain the process sampling map, until the current scale is the maximum scale. The process sampling images are sorted from largest to smallest scale, and the first preset number of process sampling images are used as upsampled feature images.
6. The method according to claim 1, characterized in that, The multi-scale feature extraction model, the attention model, and the dense upsampling model corresponding to each scale are trained based on the following method: Obtain sample image pairs and corresponding sample change detection maps; wherein, the sample image pair includes a first sample image and a second sample image; Based on the sample image pairs and the multi-scale feature extraction model, multiple sample first feature maps corresponding to the sample first image and multiple sample second feature maps corresponding to the sample second image are determined. For each pair of sample first feature maps and sample second feature maps with the same scale, the sample channel weights and sample space weights corresponding to the scale are determined based on the sample first feature map, the sample second feature map, and the attention model. The sample first feature map is weighted based on the sample channel weights and sample space weights to obtain the sample first weighted map, and the sample second feature map is weighted based on the sample channel weights and sample space weights to obtain the sample second weighted map. Based on the first weighted map of each sample, the second weighted map of each sample, and the dense upsampling model corresponding to each scale, a preset number of sample upsampling feature maps are determined, and the sample upsampling feature maps are fused to obtain the model change detection map. Based on the model change detection map, the sample change detection map, and the preset loss function, the sample loss is determined, and the model parameters of the multi-scale feature extraction model, the attention model, and the dense upsampling model corresponding to each scale are adjusted according to the sample loss.
7. The method according to claim 1, characterized in that, The acquisition of the first image and the second image includes: A first initial image and a second initial image are acquired, and the first initial image and the second initial image are segmented according to the change detection target to obtain a first segmented image and a second segmented image. The first cut image is divided into object-level segments to obtain a first object image, and the second cut image is divided into object-level segments to obtain a second object image; The second object image is subjected to relative radiometric correction based on the first object image, and the first object image and the second object image after relative radiometric correction are normalized respectively to obtain the first image and the second image.
8. An electronic device, characterized in that, The electronic device includes: Processor and memory; The processor executes the steps of the change detection method as described in any one of claims 1 to 7 by calling the program or instructions stored in the memory.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that cause a computer to perform the steps of the change detection method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-task remote sensing image road damage assessment method and system
CN117372876A
Open stope identification and change detection method based on multi-task convolutional neural network
CN117671437A