Building change area detection method and device, electronic equipment and storage medium
By introducing attention modules into the detection network, the training network detects the building's changing areas, solving the problem of low change detection accuracy in the prior art, and achieving higher accuracy change area detection.
Patent Information
- Application Number
- CN202411593811.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-11-08
AI Technical Summary
The prior art obtains building change information by making differences in characteristics of similar areas, resulting in low accuracy of change detection results.
The detection network trained by the attention module accurately detects the changed areas of the building, improving the detection accuracy of the changed areas of the position changed. The detection network is trained based on a plurality of sets of training image pairs, each set of training image pairs including a first training image and a second training image, and the second training image is marked with an annotation change region that changes relative to the first training image. The attention module is used to give higher weight to areas where there is a change in position.
Accurate detection of changing areas of the building is achieved, the accuracy of testing of changing areas is improved, and the problem of low accuracy of changing detection results in the existing technology is solved.
Smart Images

Figure CN119810632A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic equipment and storage medium for detecting a building change area. Background Art
[0002] Building change detection (such as road change detection) is mainly based on observing or detecting subtle changes in buildings (such as roads) in the same scene in remote sensing images of different phases / sequences. This detection technology is widely used in urban and rural planning. Generally, to accurately detect changes in buildings, it is usually necessary to rely on expert experience for change detection, which is time-consuming and expensive.
[0003] With the continuous development of deep learning technology, deep learning technology has been used to detect building changes. Taking road change detection as an example, a convolutional network can be used to learn similar areas of roads in remote sensing images of different time series, and the features of these similar areas can be subtracted to obtain information about road changes in the same scene.
[0004] However, the above technology has the problem of low accuracy of change detection results. Summary of the invention
[0005] The present invention provides a method, device, electronic device and storage medium for detecting building change areas, which are used to solve the defect in the prior art that building change information is obtained by subtracting the features of similar areas, resulting in low accuracy of change detection results, and to achieve accurate detection of building change areas by a detection network trained by an attention module, thereby improving the detection accuracy of the obtained change areas with position changes.
[0006] The present invention provides a method for detecting a building change area, comprising: Acquire historical images obtained by photographing the building area at historical times and current images obtained by photographing the building area at current times; Input the historical image and the current image into a preset detection network to detect the changed area and determine the corresponding target changed area in the current image; The detection network is trained based on multiple sets of training image pairs, each set of training image pairs includes a first training image and a second training image, and each second training image is annotated with a marked change area relative to the corresponding first training image; the detection network includes an attention module, and the attention module is used to assign a weight to the area with a position change in each set of training image pairs that is higher than the weight assigned to the area without a position change.
[0007] According to a method for detecting building change areas provided by the present invention, the training process of the detection network includes: Inputting the first training image and the second training image in each training image pair into the initial detection network to perform detection processing on the changed region, and determining the changed region prediction result corresponding to each training image pair; the changed region prediction result includes the predicted changed region in the corresponding second training image; A variety of loss functions are used to calculate the various losses between the change region prediction results and the corresponding labeled change regions of each set of training image pairs, and the initial detection network is trained using the values of the various losses to obtain a trained detection network.
[0008] According to a method for detecting building change areas provided by the present invention, the initial detection network includes a feature extraction module, an encoding module, a decoding module and a fusion module. The first training image and the second training image in each group of training image pairs are input into the initial detection network to perform detection processing of the change area, and the change area prediction result corresponding to each group of training image pairs is determined, including: For each set of training image pairs, the first training image and the second training image are input into the feature extraction module of the initial detection network for feature extraction processing to obtain a first initial feature corresponding to the first training image and a second initial feature corresponding to the second training image; Inputting the first initial feature and the second initial feature into the encoding module of the initial detection network to perform multi-scale encoding feature extraction processing, and determining the first encoding feature map of different scales corresponding to the first training image and the second encoding feature map of different scales corresponding to the second training image; Inputting the first encoded feature maps of different scales and the second encoded feature maps of different scales into the decoding module of the initial detection network for decoding processing, and determining the first decoded feature maps of different scales corresponding to the first training image and the second decoded feature maps of different scales corresponding to the second training image; The first encoding feature maps of different scales, the second encoding feature maps of different scales, the first decoding feature maps of different scales and the second decoding feature maps of different scales are input into the fusion module of the initial detection network for feature fusion processing to determine the prediction results of the change areas corresponding to the training image pairs.
[0009] According to a building change area detection method provided by the present invention, the above encoding module includes an attention module, and the attention module includes a position attention module and a spatial channel attention module; The above-mentioned position attention module and spatial channel attention module are used to assign higher weights to the initial features of the areas with position changes in the first initial features than to the initial features of the areas without position changes in the time dimension and the spatial dimension.
[0010] According to a method for detecting a building change area provided by the present invention, the first coded feature maps of different scales, the second coded feature maps of different scales, the first decoded feature maps of different scales, and the second decoded feature maps of different scales are input into a fusion module of an initial detection network for feature fusion processing, and a prediction result of a change area corresponding to a training image pair is determined, including: Using a fusion module of the initial detection network, fusing first encoding feature maps of different scales and first decoding feature maps of different scales to determine a first fused feature map corresponding to the first training image; Using the fusion module of the initial detection network, fusing the second encoding feature maps of different scales and the second decoding feature maps of different scales to determine the second fused feature map corresponding to the second training image; The first fused feature map and the second fused feature map are subjected to matrix difference processing to determine the prediction result of the change area corresponding to the training image pair.
[0011] According to a method for detecting a building change area provided by the present invention, the fusion module includes a local attention embedding module, and the fusion processing of the first encoding feature maps of different scales and the first decoding feature maps of different scales is performed to determine the first fused feature map corresponding to the first training image, including: Using a local attention embedding module to perform local attention embedding processing on the first encoding feature map and the first decoding feature map of the same scale, and determine the key features in the first encoding feature map and the key features in the first decoding feature map of the same scale; Adaptive pooling is performed on key features in the first encoding feature map and key features in the first decoding feature map of the same scale to determine a first fused feature map corresponding to the first training image.
[0012] According to a method for detecting building change areas provided by the present invention, the fusion module further includes a mapping module, and the first fusion feature map and the second fusion feature map are subjected to matrix difference processing to determine the prediction result of the change area corresponding to the training image pair, including: Perform matrix difference processing on the first fused feature map and the second fused feature map to determine a change feature map corresponding to the training image pair; A mapping module is used to map the values of each pixel point in the change feature map to determine the change area prediction result corresponding to the training image pair; the above-mentioned change area prediction result specifically includes the prediction result of each pixel point in the corresponding second training image, and the above-mentioned prediction result is used to characterize whether the corresponding pixel point is a predicted change area.
[0013] The present invention also provides a building change area detection device, comprising the following modules: An acquisition module, used to acquire historical images obtained by photographing the building area at historical times and current images obtained by photographing the building area at current time; The detection module is used to input the historical image and the current image into a preset detection network to perform detection processing on the changed area and determine the corresponding target changed area in the current image; The detection network is trained based on multiple sets of training image pairs, each set of training image pairs includes a first training image and a second training image, and each second training image is annotated with a marked change area relative to the corresponding first training image; the detection network includes an attention module, and the attention module is used to assign a weight to the area with a position change in each set of training image pairs that is higher than the weight assigned to the area without a position change.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for detecting a building change area as described above is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the building change area detection method as described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for detecting a building change area as described above is implemented.
[0017] The invention provides a method, device, electronic device and storage medium for detecting a changed area of a building. The method obtains a historical image and a current image taken at a historical time and a current time respectively for the same building area, and inputs both the historical image and the current image into a pre-trained detection network for detecting the changed area, and determines the corresponding target changed area in the current image; wherein the detection network is obtained by training based on multiple sets of training image pairs, each set of training image pairs includes a first training image and a second training image, and each second training image is annotated with a marked changed area that has changed relative to the corresponding first training image, and the detection network also includes an attention module, which is used to give a higher weight to the area with position change in each set of training image pairs than to the area without position change. In the method, since a higher weight can be given to the position change area through the attention module when the detection network is trained, the detection network pays more attention to the detection of position change during the training process, so when the changed area of the building is detected by the trained detection network, a more accurate position change area detection result can be obtained, that is, the accuracy of the changed area obtained by the final detection can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 This is one of the flow charts of the building change area detection method provided by the present invention.
[0020] Figure 2 This is the second flow chart of the building change area detection method provided by the present invention.
[0021] Figure 3 This is the third flow chart of the building change area detection method provided by the present invention.
[0022] Figure 4 It is a schematic diagram of the visualization effect of road change detection provided by the present invention.
[0023] Figure 5 It is a structural schematic diagram of the building change area detection device provided by the present invention.
[0024] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] In order to better illustrate the technical solution of the embodiment of the present invention, the technical background of the embodiment of the present invention is first described below.
[0027] Building change detection, taking road change detection as an example, is mainly achieved by observing or detecting subtle changes in roads in the same scene in remote sensing images of different phases / time sequences. Two remote sensing road images of the same area at different times bring huge challenges to the detection of road change areas due to the influence of various factors such as the surrounding ecological environment, road paving materials and traffic signs.
[0028] When it is necessary to accurately detect changes in roads, the initial change detection method technology mainly relies on expert experience, but this technology is time-consuming and expensive. At the same time, some change detection methods are mostly divided into two parts, such as single pixel analysis and regional change recognition. Single pixel analysis aims to construct feature information centered on a single pixel from the original remote sensing image data. Image pixels and image objects are the two main categories of analyzing single pixels. Different forms of analyzing single pixels share similar feature extraction techniques. Then, in order to further improve the accuracy of change detection, spectral features and spatial features are widely studied. Regional change recognition usually uses manual or learned rules to compare and analyze the representation of single pixels to determine the change category or area. In addition, there is a simple method to calculate the feature difference map and separate the change area by threshold. These change detection methods mostly use manual participation in feature design and screening, and there is a lot of room for improvement in detection accuracy.
[0029] With the rapid development of deep learning technology and remote sensing imaging technology, it is proposed to use deep learning technology for change detection to alleviate the errors caused by artificial features. However, the current deep learning technology is still insufficient in capturing deep semantic information and subtle changes. Therefore, how to accurately and efficiently detect the change area of the corresponding road from remote sensing images has become a research hotspot. For example, some technologies propose to use convolutional networks to learn similar areas of roads in remote sensing images of different time series, and to subtract the features of similar areas to obtain information about road changes in the same scene. Some other technologies use a combination of convolution and long-term and short-term networks to obtain spatial local and global temporal information of corresponding areas in a set of images, and fuse these feature information to accurately judge the change information, thereby improving the detection performance of the overall framework. Some other technologies use Transformer models to obtain local details and global semantics of roads in images and corresponding contextual information, thereby improving the network's ability to perceive subtle changes. Although these technologies can effectively improve the network's ability to detect road changes in remote sensing images, they ignore the ability of low-level semantic information to represent properties such as the physical appearance of the target road. At the same time, the feature flow causes a large amount of redundant information to be reused when it is transmitted between layers, so that no attention is paid to significant features, resulting in insufficient representation of significant information.
[0030] Through the above technologies, we can find that roads are important transportation hubs between cities or different cities. Their backgrounds are relatively complex, and their distribution is intricate, dense and extensive. The appearance of roads in remote sensing images, such as color and shape, may be completely different at different times. This situation makes it easy for simple road changes to be ignored or misclassified. Simply put, it is not possible to directly locate the changed area based solely on deep features or physical appearance. Pseudo-information changes such as noise may also cause the model to lack robustness. In addition, the quality and category balance of road samples are also very important. In the relevant technologies, there is currently no corresponding screening of sample quality, and non-positive samples are mistakenly used as positive samples, or the boundary pixels are not effectively located and annotated during the sample annotation process. At the same time, the change class may be much smaller than the unchanged class, resulting in serious category imbalance problems, which ultimately leads to a decrease in the accuracy of change detection. Furthermore, roads are diverse and have a large scale span. Traditional single-scale feature extractors cannot obtain effective target information from remote sensing road images, and the road details are insufficiently described. Similarly, when using a simple feature extractor to obtain the deep features of the road, redundant information is reused multiple times, and the representation capabilities of context, global and local details are ignored. A simple splicing strategy is used to fuse the features, resulting in serious loss of target detail information, which ultimately affects the performance of road area change detection.
[0031] Based on this, an embodiment of the present invention provides a method, device, electronic device and storage medium for detecting a building change area, which can solve the above technical problems.
[0032] Combine the following Figure 1-Figure 4 A method for detecting a building change area according to an embodiment of the present invention is described.
[0033] It should be noted that the execution subject of the embodiments of the present invention can be a building change area detection device, or an electronic device, or other equipment, devices or systems. No specific limitation is made here. The following embodiments will be described using an electronic device as the execution subject.
[0034] Figure 1 It is one of the flow charts of the building change area detection method provided by the present invention, such as Figure 1 As shown, the method comprises the following steps: S102, acquiring historical images obtained by photographing the building area at historical times and current images obtained by photographing the building area at current time.
[0035] The construction area may be a larger area, such as an area including one or more buildings, where the buildings may include buildings, roads, etc. The construction area may generally be an area including multiple roads.
[0036] The historical time may be a time before the current time. There is no specific limitation on the time interval before the current time. For example, the historical time may be one year before the current time, or half a year before the current time.
[0037] At the historical time and the current time, the same building area can be photographed by using image acquisition equipment to obtain images of the building area at the corresponding time, which are recorded as historical images and current images respectively. The image acquisition equipment here can be, for example, a camera, a video camera, a capture machine, a drone, or other acquisition equipment with a camera.
[0038] Since architectural changes may occur in the construction area at different times (such as changes in the planned roads), it is necessary to detect the areas with changes in the current image of the construction area in order to perform subsequent data processing.
[0039] S104, inputting both the historical image and the current image into a preset detection network to perform detection processing on the changed area, and determining the corresponding target changed area in the current image; wherein the above-mentioned detection network is trained based on multiple groups of training image pairs, each group of training image pairs includes a first training image and a second training image, and each second training image is annotated with annotated changed areas that have changed relative to the corresponding first training image; the above-mentioned detection network includes an attention module, and the attention module is used to assign a weight to the area with a position change in each group of training image pairs that is higher than the weight assigned to the area without a position change.
[0040] In this step, a pre-trained detection network can be used to detect the changed area in the current building area image. The detection network can be a neural network. Optionally, the detection network can be a neural network based on a U-net architecture. In addition, the detection network focuses on the detection of changes in the spatial position of the region. For example, the detection network can be a U-shaped detection network with enhanced spatial position.
[0041] The detection network can be pre-trained, and its training process is briefly described as follows: obtain multiple groups of training image pairs and the annotated change regions corresponding to each group of training image pairs, and use each group of training image pairs as the reference input of the initial detection network, and use the annotated change regions of each group of training image pairs as the reference output of the initial detection network, and train the initial detection network to obtain a trained detection network.
[0042] Each of the above-mentioned training image pairs includes two training images, which are respectively recorded as the first training image and the second training image. The first training image and the second training image in each training image pair are images obtained by shooting the same sample building area, and the shooting events / time sequences of the first training image and the second training image are different. Specifically, the shooting time of the first training image is earlier than that of the second training image, that is, taking the first training image as a reference, the main detection is the changed area of the second training image relative to the first training image; at the same time, each second training image can be marked with the area where there is a change and the area where there is no change compared with the corresponding first training image. Here, the marking of the changed area in the second training image can be marked in the form of pixels, for example, each pixel in the second training image can be marked, for example, the label of a certain pixel is 1, which means that the pixel is a changed area, and for another example, the label of a certain pixel is 0, which means that the pixel is a non-changed area / unchanged area. By marking as above, the marked changed area and the marked unchanged area in each first training image can be obtained, which can be used as the gold standard / reference when training the detection network.
[0043] In addition, the above-mentioned detection network may include an attention module, which may be composed of a network layer or a logical algorithm. During the detection network training process, the attention module may assign higher weights to the features of the area whose position has changed, and assign lower weights to the features of the area whose position has not changed, so that the detection network can focus more on learning the significant feature of position change, and ultimately improve the fine detection of the feature of position change.
[0044] The detection network can be trained in the above manner. The training process of the detection network will be described in detail in the following embodiments, and only a brief description is given here. After obtaining the trained detection network, the historical image and the current image of the same building area can be input into the trained detection network for detection of the changed area to detect the area in the current image that has changed relative to the historical image. The changed area detected here can be recorded as the target changed area. In addition, the change here generally refers to a change in spatial position.
[0045] In this embodiment, by obtaining historical images and current images taken of the same building area at historical time and current time respectively, and inputting both the historical images and the current images into a pre-trained detection network for detection processing of the changed area, the corresponding target changed area in the current image is determined; wherein, the detection network is obtained by training based on multiple sets of training image pairs, each set of training image pairs includes a first training image and a second training image, and each second training image is annotated with its annotated changed area relative to the corresponding first training image, and the detection network also includes an attention module, which is used to give a higher weight to the area with position change in each set of training image pairs than to the area without position change. In this method, since a higher weight can be given to the position change area through the attention module when the detection network is trained, the detection network pays more attention to the detection of position change during the training process, so when the changed area of the building is detected by the trained detection network, a more accurate position change area detection result can be obtained, that is, the accuracy of the changed area obtained by the final detection can be improved.
[0046] The following embodiments illustrate the specific training process of the detection network.
[0047] Figure 2 FIG. 2 is a flow chart of the method for detecting building change areas provided by the present invention. Figure 2 As shown, the training process / method of the above detection network may include the following steps: S202, inputting the first training image and the second training image in each group of training image pairs into the initial detection network to perform detection processing on the changed area, and determining the changed area prediction results corresponding to each group of training image pairs; the above-mentioned changed area prediction results include the predicted changed area in the corresponding second training image.
[0048] In this step, as mentioned above, when the detection network is trained, multiple sets of training image pairs can be obtained first. When obtaining multiple sets of training image pairs, a set of training image pairs of different time sequences of the building area (for example, a set of remote sensing road images of different time sequences) can be obtained, and then the labelme annotation software is used to annotate the changed areas in the second training image of the group of training image pairs and the unchanged areas. For example, the changed areas can be marked as 1, and the pixels of the unchanged areas can be marked as 0. Of course, multiple sets of training image pairs can also be obtained and annotated separately. Then the same preprocessing operation can be performed on the two training images in each group of training image pairs, so that more sets of training image pairs can be obtained. The preprocessing can ensure the validity of the training samples and highlight the differences and diversity between the training samples, while expanding the number of training samples. The preprocessing operations here can include operations such as translation, rotation, color conversion, inversion, and random cropping.
[0049] Here, multiple preprocessings are performed on the training samples, and the training samples are expanded through preprocessing to highlight the differences between buildings (such as roads) and the surrounding background, thereby alleviating the semantic ambiguity between buildings and surrounding organizational structures, especially the boundary pixel attributes between buildings and surrounding organizational structures.
[0050] In addition, considering that the size and shape of the buildings in the change area are different, extracting features from a suitable range can better represent the change area. Therefore, in order to facilitate the smooth input of the training images in each set of training image pairs into the framework of the designed detection network, each training image in the original and amplified sets of training image pairs can be cropped to a preset size according to a preset cropping ratio r. The preset size here can be determined according to the input size of the detection network, for example, it can be 512×512 size. The preset cropping ratio r here can be, for example, 0.1. By adopting the preset cropping ratio, it can be ensured that more detail information is retained in the cropped image, so as to facilitate the subsequent accurate detection of the change area.
[0051] Furthermore, in order to demonstrate the superiority of the designed detection network on small samples, in this embodiment, the multiple sets of training image pairs formed by the final amplification can be divided into three parts: training set, test set and validation set, and their respective proportions in the total training image pairs are 40%, 10% and 50% respectively.
[0052] After the training set is divided as above, the two training images included in the multiple groups of training image pairs in the training set can be input into the initial detection network for change area detection processing to obtain the change area prediction results corresponding to each group of training image pairs, which may include the change area predicted in the second training image, recorded as the predicted change area.
[0053] S204, using multiple loss functions to calculate multiple losses between the change region prediction results of each group of training image pairs and the corresponding labeled change regions, and using the values of the multiple losses to train the initial detection network to obtain a trained detection network.
[0054] In this step, after obtaining the predicted change region of each group of training image pairs, a variety of loss functions can be used to calculate the loss between the predicted change region and its corresponding labeled change region. The various loss functions here may include, for example, binary cross entropy loss function, focal loss function, dice loss function, etc.
[0055] After calculating various losses between the predicted change area and the corresponding labeled change area of each group of training image pairs through various loss functions, the values of multiple losses of each group of training image pairs can be summed (including weighted summation or direct summation) to obtain the total loss value of the group of training image pairs. Then, the total loss value can be used for reverse parameter adjustment to train the initial detection network and finally obtain a trained detection network.
[0056] The above method of summing the values of multiple losses for each set of training image pairs can be seen in the following formula: .
[0057] in, λ , α , β Represents a learnable balance factor, whose values can be, for example, 0.25, 0.4, or 1. L bce , L fl , L dice They represent binary cross entropy loss, focal loss, and dice loss respectively.
[0058] In this embodiment, multiple loss functions are used to perform multiple loss calculations on the predicted change areas and the labeled change areas of each group of training image pairs, and the calculated multiple losses are used to train the initial detection network. This can alleviate the problem of reduced detection accuracy caused by category imbalance, that is, the detection accuracy of the trained detection network for change areas can be improved.
[0059] In some embodiments, the above-mentioned initial detection network includes a feature extraction module, an encoding module, a decoding module and a fusion module. The following embodiments illustrate how to perform change region detection processing and obtain the predicted change region through these modules of the initial detection network.
[0060] Figure 3 FIG. 3 is a flow chart of the method for detecting building change areas provided by the present invention. Figure 3 As shown, the above S202 may include the following steps: S302: For each group of training image pairs, the first training image and the second training image are input into a feature extraction module of an initial detection network for feature extraction processing to obtain a first initial feature corresponding to the first training image and a second initial feature corresponding to the second training image.
[0061] Taking a group of training image pairs as an example, the detection network has two input channels, which are respectively used to input the two training images in each group of training image pairs. Specifically, the first training image and the second training image in the group of training image pairs are respectively input into the feature extraction module of the initial detection network through these two channels.
[0062] Optionally, the initial detection network may include two identical feature extraction modules, and the first training image and the second training image may be respectively input into one feature extraction module for feature extraction processing to obtain respective extracted initial features. Here, the feature extracted from the first training image is recorded as the first initial feature, and the feature extracted from the second training image is recorded as the second initial feature.
[0063] For example, the following formula may be used to perform initial feature extraction processing on the first training image to obtain the first initial feature.
[0064] .
[0065] in, X A represents the first training image, X B represents the second training image, and the range of the two training images is expressed as , where R represents a real number, C, H, and W represent the spatial channel, image height, and image width, respectively; A first initial feature representing a first training image; Represents the maximum pooling operation; Represents a 7×7 convolution operation; Represents the activation function of Relu, that is, the activation operation; Represents a batch normalization layer, that is, performs batch normalization operations.
[0066] Similarly, the second initial feature of the second training image can be obtained according to the above formula: .
[0067] S304, inputting the first initial feature and the second initial feature into the encoding module of the initial detection network to perform multi-scale encoding feature extraction processing, and determining the first encoding feature map of different scales corresponding to the first training image and the second encoding feature map of different scales corresponding to the second training image.
[0068] In this step, the initial detection network may include two groups of identical encoding modules (for example, Resnet residual modules), and each group of encoding modules is used to perform encoding feature extraction processing of different scales on an initial feature. After obtaining the first initial feature and the second initial feature, the first initial feature and the second initial feature can be respectively input into a corresponding group of encoding modules for encoding feature extraction processing of different scales, and multiple encoding feature maps of different scales corresponding to the first initial feature / first training image are obtained (all recorded as first encoding feature maps) and multiple encoding feature maps of different scales corresponding to the second initial feature / second training image are obtained (all recorded as second encoding feature maps).
[0069] For each group of encoding modules, it may include multiple encoding modules of different scales, which are used to extract local spatial details and global contextual temporal information of different scales in the training image / initial features.
[0070] As an optional embodiment, the above encoding module may also include an attention module, and the attention module includes a position attention module and a spatial channel attention module; the above position attention module and the spatial channel attention module are used to give a higher weight to the initial features of the area with position changes in the first initial features than to the initial features of the area without position changes in the time dimension and the spatial dimension. Specifically, the encoding module of each scale may include an attention module and a spatial channel attention module, so that when each encoding module extracts the encoding feature map of the corresponding scale, it focuses more on extracting the local details and global features of the position change area.
[0071] For example, taking the first training image as an example, for the first training image X A The multi-scale first coding feature map of , taking the first coding feature maps of four different scales as an example, can be defined as: ,in, represents the first coding feature map of a certain scale, and s represents different scales. In addition, the input of the first coding module of each group of coding modules is the first initial feature, and the input of each subsequent coding module is the first coding feature of different scales output by the previous coding module. For example, the following formula can be used to extract the first initial feature of the first training image to obtain the first coding feature map: .
[0072] in express The first encoding feature map output by the corresponding previous encoding module, Represents encoding modules of different scales.
[0073] The encoding feature extraction process of the first encoding module of the first training image can be performed using the following formula: .
[0074] in, represents the position attention module; represents the spatial channel attention module; Represents the feature matrix concatenation operation; , Represent 1×1 convolution operation and 3×3 convolution operation respectively; Represents the characteristic matrix element addition operation.
[0075] Specifically, the above-mentioned first initial feature is input into the first encoding module, and the encoding feature extraction processing is performed through different encoding modules in a group of encoding modules corresponding to the first training image, and a coding feature map of a scale can be obtained respectively. In this way, multiple coding feature maps of different scales can be obtained for each training image encoding.
[0076] From the above description, it can be seen that in this embodiment, a position attention module and a spatial channel attention module are embedded in each encoding module to perform enhanced feature extraction processing on a set of training image pairs, so that the correlation between the same positions in a set of training image pairs can be focused, that is, a position association can be established between the first training image and the second training image of different time sequences, and feature sharing between the same level and across levels can be achieved without additional auxiliary information. At the same time, an adaptive average pooling layer is used to aggregate the global context, which can effectively perceive the subtle changes between a set of training image pairs, which is more beneficial to the change detection performance of the detection network. In addition, an excitation squeeze layer can also be introduced in the change detection head module of the detection network (that is, the initial input module of the detection network), which can reduce the amount of calculation while ensuring the detection accuracy.
[0077] S306, inputting the first encoded feature maps of different scales and the second encoded feature maps of different scales into the decoding module of the initial detection network for decoding processing, and determining the first decoded feature maps of different scales corresponding to the first training image and the second decoded feature maps of different scales corresponding to the second training image.
[0078] In this step, the initial detection module may also include two groups of identical decoding modules, each group of decoding modules is used to decode the multi-scale coding features of a training image. After obtaining the multi-scale coding features of each training image, they can be input into the corresponding group of decoding modules for decoding processing to obtain the multi-scale decoding features corresponding to the two training images. The multi-scale decoding features here correspond to the scales of the corresponding multi-scale coding features one by one, so as to facilitate the enhancement of feature representation.
[0079] In addition, each group of decoding modules here may also include multiple decoding modules, which are respectively used to decode the encoding features of the corresponding scale to obtain the decoding feature map of the corresponding scale; or, according to the upsampling or downsampling structure of the U-type network, the input of the first decoding module is the encoding feature map output by the last encoding module of the corresponding training image, and then upsampling is continuously performed through each decoding module to obtain decoding feature maps of different scales.
[0080] Here, the multi-scale decoded feature maps obtained after decoding the multi-scale encoded feature map of the first training image can be recorded as the first decoded feature map, and the multi-scale decoded feature maps obtained after decoding the multi-scale encoded feature map of the second training image can be recorded as the second decoded feature map.
[0081] For example, the first decoded feature map of the first training image can be recorded as , the second decoded feature map of the second training image can be recorded as .
[0082] S308, inputting the first encoding feature maps of different scales, the second encoding feature maps of different scales, the first decoding feature maps of different scales, and the second decoding feature maps of different scales into the fusion module of the initial detection network for feature fusion processing to determine the prediction results of the change areas corresponding to the training image pairs.
[0083] In this step, the initial detection network may also include a fusion module, and the first encoding feature map of different scales, the second encoding feature map of different scales, the first decoding feature map of different scales, and the second decoding feature map of different scales obtained above may all be input into the fusion module for feature fusion processing. During the specific feature fusion processing, the encoding features and decoding features of the same scale of each training image may be first fused to obtain the fusion features of each training image, and then the fusion features of the two training images may be fused to obtain the final fusion features. Afterwards, the prediction result of the change area corresponding to the training image pair may be obtained through the final fusion feature.
[0084] It can be understood that, for each group of training image pairs, the change region prediction result corresponding to each group of training image pairs can be obtained according to the above steps.
[0085] From the above description, it can be seen that the building change area detection data in this embodiment has time and space dimensions. In this embodiment, the spatial and positional attention mechanisms are used to jointly strengthen the encoding features and decoding features of a set of training image pairs, and through the hidden correlation between the space and position of the two training images, the effect of building change area detection can be improved.
[0086] In this embodiment, the feature extraction module, multi-scale encoding module, multi-scale decoding module and feature fusion module in the detection network respectively perform initial feature extraction, multi-scale encoding processing, multi-scale decoding processing and feature fusion processing on the two training images, and finally obtain the change area prediction result of the training image pair. In this way, in the process of multi-scale features, multi-level local and global feature fusion, the encoding and decoding features of different scales can be modeled, and the models with different weights can be used to flexibly focus on significant features, and spatial heterogeneous semantics can be learned from multi-time series training image data, paying more attention to context, global and local detail information, that is, rich architectural detail information in the image can be collaboratively inferred and discovered, thereby improving the accuracy of change area detection.
[0087] The following embodiment illustrates the specific process of feature fusion of the multi-scale encoding feature map and the decoding feature map.
[0088] In some embodiments, the above S308 may include the following steps: Step A1, using the fusion module of the initial detection network, fuses the first encoding feature maps of different scales and the first decoding feature maps of different scales to determine the first fused feature map corresponding to the first training image.
[0089] Among them, the encoding feature map and the decoding feature map of the same scale of the first training image can be firstly subjected to feature fusion processing to obtain a fused feature map of each scale, and then the fused feature maps of multiple different scales are further subjected to feature fusion processing to obtain a final fused feature map, which is recorded as the first fused feature map.
[0090] In addition, in order to avoid fusing all features during the feature fusion process and repeatedly using redundant information, which leads to serious loss of target detail information and ultimately affects the performance of building area change detection, as an optional embodiment, the above-mentioned fusion module may include a local attention embedding module. In this step, the local attention embedding module can be used to perform local attention embedding processing on the first encoding feature map and the first decoding feature map of the same scale during the feature fusion process to determine the key features in the first encoding feature map and the key features in the first decoding feature map of the same scale; adaptive pooling processing is performed on the key features in the first encoding feature map and the key features in the first decoding feature map of the same scale to determine the first fused feature map corresponding to the first training image.
[0091] That is to say, in the process of feature fusion of the encoding feature map and the decoding feature map of the same scale, the local attention embedding module can be used to extract the key detail information in both the encoding feature map and the decoding feature map, and perform feature fusion processing on the key detail information to retain more local detail information and improve the detection accuracy of the changed area of the building.
[0092] For example, the feature fusion processing process of the first training image using the local attention embedding module can be expressed by the following formula: .
[0093] in, represents the first fused feature map; Represents an adaptive pooling operation; A local attention embedding module for representation space; Respectively represent a multi-scale first encoding feature map and a multi-scale first decoding feature map of the first training image.
[0094] Step A2, using the fusion module of the initial detection network, fuses the second encoding feature maps of different scales and the second decoding feature maps of different scales to determine the second fused feature map corresponding to the second training image.
[0095] In this step, the second fused feature map corresponding to the second training image can be obtained in the manner of step A1 above, which will not be described in detail here.
[0096] Step A3, performing matrix difference processing on the first fused feature map and the second fused feature map to determine the prediction result of the change area corresponding to the training image pair.
[0097] In this step, the fusion feature maps of the two training images can be processed by the following formula: .
[0098] in, represents the matrix difference operation; O represents the final change feature map.
[0099] The difference between the first fused feature map and the second fused feature map can be calculated by the above matrix difference operation, and the difference can represent the feature difference or feature change between the two training images, which is recorded as a change feature map. Then, the change region prediction result can be obtained through the change feature map.
[0100] As an optional embodiment, the above fusion module also includes a mapping module, and this step may include the following steps: The first fused feature map and the second fused feature map are subjected to matrix difference processing to determine the change feature map corresponding to the training image pair; a mapping module is used to map the values of each pixel in the change feature map to determine the change area prediction result corresponding to the training image pair; the above-mentioned change area prediction result specifically includes the prediction result of each pixel in the corresponding second training image, and the above-mentioned prediction result is used to characterize whether the corresponding pixel is a predicted change area.
[0101] That is, after obtaining the change feature map, the size of the change feature map is generally the same as the size of the first training image and the second training image input to the detection network, which may include multiple pixels. Here, the mapping module in the detection network can be used to map the values of each pixel in the change feature map. Specifically, the values of each pixel in the change feature map can be normalized, such as comparing the values of each pixel with the threshold respectively. If the value of a certain pixel is greater than the threshold, the value of the pixel is set to 1. If the value of a certain pixel is not greater than the threshold, the value of the pixel is set to 0. In this way, a binary change feature map can be obtained. The binary change feature map is the change region prediction result corresponding to the training image pair. The value of each pixel in the change region prediction result can indicate whether the pixel is a change region. For example, if the value of a certain pixel is 1, it indicates that the pixel is a predicted change region. For example, if the value of a certain pixel is 0, it indicates that the pixel is a predicted unchanged region.
[0102] It can be understood that, based on the explanation of this embodiment, the target change region obtained in the above S104 can be a change region detection result output by the detection network. The change region detection result is actually a binary change feature map. The change region therein can be obtained by the value of each pixel point in the binary change feature map. Finally, these change regions are combined to obtain the target change region.
[0103] In the process of fusing multi-scale features, multi-level local and global features in this embodiment, the encoding features and decoding features of different scales are modeled through the spatial local embedding module, and a network with different weights is used to flexibly focus on the significant features in the building change area. The spatial heterogeneous semantics learned from multi-temporal building training image pairs are used to collaboratively infer and discover rich architectural details in the image, so as to improve the detection accuracy of the building change area.
[0104] In this embodiment, by first fusing the multi-scale decoding features and decoding features of each training image, and then performing a matrix difference operation on the fused features of the two training images to obtain a prediction result of the changed area, the multi-scale encoding and decoding feature fusion and the matrix difference operation can be used to describe the building area from different angles, and the information is richer, thereby improving the accuracy of the final detected changed area. In addition, the local attention embedding module can be used to extract key features for fusion when fusing features, so that more detailed information can be retained for feature fusion, and ultimately improve the accuracy of detecting the changed area, while also improving the efficiency of detecting the changed area. Furthermore, by mapping the values of the pixel points in the change feature map after the fusion feature difference operation, a binary change feature map is obtained, so that the detection result of the changed area can be obtained more intuitively, and the readability and accuracy of the detection result of the changed area finally obtained are improved.
[0105] Furthermore, the detection network can be trained through the above embodiment, and the trained detection network can be tested and verified through the above test set and verification set, and efficiency and performance tests are carried out on large-scale images. The test and verification can prove that the detection network finally obtained in this embodiment is more effective and robust in detecting changed areas.
[0106] Take the change area detection of a road area as an example, see Figure 4 The figure shows a schematic diagram of the visualization effect of road change detection, where the left image (a) in the first row is the historical image before the change, the right image (b) is the current image after the change, the left image (c) in the second row is the generated change mask (i.e. the above-mentioned binary change feature map), and the right image (d) is the visualization area, that is, the change area of the road is displayed in a visualized manner in the current image.
[0107] It can be seen that the change area detection method of this embodiment can better detect subtle changes in the road and improve the accuracy of road area detection.
[0108] The building change area detection device provided by the present invention is described below. The building change area detection device described below and the building change area detection method described above can be referred to each other.
[0109] Figure 5 is a schematic diagram of the structure of the building change area detection device provided by the present invention, see Figure 5 As shown, the device may include: An acquisition module 510 is used to acquire historical images obtained by photographing the building area at historical times and current images obtained by photographing the building area at current time; The detection module 520 is used to input the historical image and the current image into a preset detection network to perform detection processing on the changed area, and determine the corresponding target changed area in the current image; The detection network is trained based on multiple sets of training image pairs, each set of training image pairs includes a first training image and a second training image, and each second training image is annotated with a marked change area relative to the corresponding first training image; the detection network includes an attention module, and the attention module is used to assign a weight to the area with a position change in each set of training image pairs that is higher than the weight assigned to the area without a position change.
[0110] In some embodiments, the above apparatus may further include a training module, the training module including: A prediction unit, used for inputting the first training image and the second training image in each group of training image pairs into the initial detection network to perform detection processing on the changed region, and determining a predicted result of the changed region corresponding to each group of training image pairs; the predicted result of the changed region includes the predicted changed region in the corresponding second training image; The training unit is used to calculate the multiple losses between the change region prediction results and the corresponding labeled change regions of each group of training image pairs using multiple loss functions, and train the initial detection network using the values of the multiple losses to obtain a trained detection network.
[0111] In some embodiments, the above-mentioned initial detection network includes a feature extraction module, an encoding module, a decoding module and a fusion module. The above-mentioned prediction unit is specifically used to input the first training image and the second training image into the feature extraction module of the initial detection network for each group of training image pairs for feature extraction processing to obtain the first initial feature corresponding to the first training image and the second initial feature corresponding to the second training image; input the first initial feature and the second initial feature into the encoding module of the initial detection network for multi-scale encoding feature extraction processing to determine the first encoding feature map of different scales corresponding to the first training image and the second encoding feature map of different scales corresponding to the second training image; input the first encoding feature map of different scales and the second encoding feature map of different scales into the decoding module of the initial detection network for decoding processing to determine the first decoding feature map of different scales corresponding to the first training image and the second decoding feature map of different scales corresponding to the second training image; input the first encoding feature map of different scales, the second encoding feature map of different scales, the first decoding feature map of different scales and the second decoding feature map of different scales into the fusion module of the initial detection network for feature fusion processing to determine the change area prediction result corresponding to the training image pair.
[0112] Optionally, the above-mentioned encoding module includes an attention module, and the attention module includes a position attention module and a spatial channel attention module; the above-mentioned position attention module and the spatial channel attention module are used to assign a higher weight to the initial features of the area with position changes in the first initial features than the weight assigned to the initial features of the area without position changes in the time dimension and the spatial dimension.
[0113] In some embodiments, the above-mentioned prediction unit is specifically used to use the fusion module of the initial detection network to fuse the first encoding feature maps of different scales and the first decoding feature maps of different scales to determine the first fused feature map corresponding to the first training image; use the fusion module of the initial detection network to fuse the second encoding feature maps of different scales and the second decoding feature maps of different scales to determine the second fused feature map corresponding to the second training image; perform matrix difference processing on the first fused feature map and the second fused feature map to determine the prediction result of the change area corresponding to the training image pair.
[0114] Optionally, the above-mentioned fusion module includes a local attention embedding module, and the above-mentioned prediction unit is specifically used to use the local attention embedding module to perform local attention embedding processing on the first encoding feature map and the first decoding feature map of the same scale, and determine the key features in the first encoding feature map and the key features in the first decoding feature map of the same scale; perform adaptive pooling processing on the key features in the first encoding feature map and the key features in the first decoding feature map of the same scale, and determine the first fused feature map corresponding to the first training image.
[0115] Optionally, the above-mentioned fusion module also includes a mapping module, and the above-mentioned prediction unit is specifically used to perform matrix difference processing on the first fusion feature map and the second fusion feature map to determine the change feature map corresponding to the training image pair; the mapping module is used to map the values of each pixel point in the change feature map to determine the change area prediction result corresponding to the training image pair; the above-mentioned change area prediction result specifically includes the prediction result of each pixel point in the corresponding second training image, and the above-mentioned prediction result is used to characterize whether the corresponding pixel point is a predicted change area.
[0116] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.
[0117] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute a method for detecting a building change area, the method comprising: obtaining a historical image obtained by photographing a building area at a historical time and a current image obtained after photographing the building area at a current time; inputting both the historical image and the current image into a preset detection network for detecting the change area, and determining the corresponding target change area in the current image; wherein the detection network is obtained by training based on multiple sets of training image pairs, each set of training image pairs includes a first training image and a second training image, and each second training image is annotated with an annotated change area that has changed relative to the corresponding first training image; the detection network includes an attention module, and the attention module is used to assign a weight to the area with a position change in each set of training image pairs higher than the weight assigned to the area without a position change.
[0118] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0119] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the building change area detection method provided by the above-mentioned methods, which includes: obtaining a historical image obtained by photographing the building area at a historical time and a current image obtained after photographing the building area at a current time; inputting both the historical image and the current image into a preset detection network to perform detection processing on the change area, and determining the corresponding target change area in the current image; wherein the above-mentioned detection network is obtained by training based on multiple groups of training image pairs, each group of training image pairs includes a first training image and a second training image, and each second training image is annotated with an annotated change area that has changed relative to the corresponding first training image; the above-mentioned detection network includes an attention module, and the attention module is used to assign a weight to the area with a position change in each group of training image pairs that is higher than the weight assigned to the area without a position change.
[0120] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the building change area detection method provided by the above-mentioned methods, the method comprising: obtaining a historical image obtained by photographing the building area at a historical time and a current image obtained after photographing the building area at a current time; inputting both the historical image and the current image into a preset detection network for detection processing of the change area, and determining the corresponding target change area in the current image; wherein the above-mentioned detection network is obtained by training based on multiple groups of training image pairs, each group of training image pairs includes a first training image and a second training image, and each second training image is annotated with an annotated change area that has changed relative to the corresponding first training image; the above-mentioned detection network includes an attention module, and the attention module is used to assign a weight to the area with a position change in each group of training image pairs that is higher than the weight assigned to the area without a position change.
[0121] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting building change areas, characterized in that: include: Acquire historical images obtained by photographing the building area at historical times and current images obtained by photographing the building area at current time; Inputting both the historical image and the current image into a preset detection network to perform detection processing on the changed area, and determining the corresponding target changed area in the current image; The detection network is trained based on multiple groups of training image pairs, each group of training image pairs includes a first training image and a second training image, and each second training image is annotated with a marked change area relative to the corresponding first training image; the detection network includes an attention module, and the attention module is used to assign a weight to the area with a position change in each group of training image pairs that is higher than the weight assigned to the area without a position change.
2. The building change area detection method according to claim 1, characterized in that: The training process of the detection network includes: Inputting the first training image and the second training image in each group of the training image pairs into the initial detection network to perform detection processing on the changed region, and determining the changed region prediction result corresponding to each group of the training image pairs; the changed region prediction result includes the predicted changed region in the corresponding second training image; A plurality of loss functions are used to calculate a plurality of losses between the change region prediction results and the corresponding annotated change regions of each group of the training image pairs, and the initial detection network is trained using the values of the plurality of losses to obtain the trained detection network.
3. The building change area detection method according to claim 2, characterized in that: The initial detection network includes a feature extraction module, an encoding module, a decoding module and a fusion module. The first training image and the second training image in each group of the training image pairs are input into the initial detection network to perform detection processing on the changed area, and the prediction result of the changed area corresponding to each group of the training image pairs is determined, including: For each group of the training image pairs, the first training image and the second training image are input into the feature extraction module of the initial detection network for feature extraction processing to obtain a first initial feature corresponding to the first training image and a second initial feature corresponding to the second training image; Inputting the first initial feature and the second initial feature into the encoding module of the initial detection network to perform multi-scale encoding feature extraction processing, and determining first encoding feature maps of different scales corresponding to the first training image and second encoding feature maps of different scales corresponding to the second training image; Inputting the first encoded feature maps of different scales and the second encoded feature maps of different scales into the decoding module of the initial detection network for decoding processing, and determining the first decoded feature maps of different scales corresponding to the first training image and the second decoded feature maps of different scales corresponding to the second training image; The first encoding feature maps of different scales, the second encoding feature maps of different scales, the first decoding feature maps of different scales, and the second decoding feature maps of different scales are input into the fusion module of the initial detection network for feature fusion processing to determine the prediction result of the change area corresponding to the training image pair.
4. The building change area detection method according to claim 3, characterized in that: The encoding module includes the attention module, and the attention module includes a position attention module and a spatial channel attention module; The position attention module and the spatial channel attention module are used to assign a higher weight to the initial features of the area with position changes in the first initial features than the weight assigned to the initial features of the area without position changes in the time dimension and the spatial dimension.
5. The building change area detection method according to claim 3, characterized in that: The step of inputting the first encoding feature maps of different scales, the second encoding feature maps of different scales, the first decoding feature maps of different scales, and the second decoding feature maps of different scales into the fusion module of the initial detection network for feature fusion processing, and determining the prediction result of the change area corresponding to the training image pair, comprises: Using the fusion module of the initial detection network, the first encoding feature maps of different scales and the first decoding feature maps of different scales are fused to determine a first fused feature map corresponding to the first training image; Using the fusion module of the initial detection network, fusing the second encoding feature maps of different scales and the second decoding feature maps of different scales to determine a second fused feature map corresponding to the second training image; The first fused feature map and the second fused feature map are subjected to matrix difference processing to determine a prediction result of a change region corresponding to the training image pair.
6. The building change area detection method according to claim 5, characterized in that: The fusion module includes a local attention embedding module, and the fusion processing of the first encoding feature maps of different scales and the first decoding feature maps of different scales is performed to determine the first fused feature map corresponding to the first training image, including: Using the local attention embedding module to perform local attention embedding processing on the first encoding feature map and the first decoding feature map of the same scale, and determine the key features in the first encoding feature map and the key features in the first decoding feature map of the same scale; Adaptively pooling the key features in the first encoding feature map and the key features in the first decoding feature map of the same scale to determine a first fused feature map corresponding to the first training image.
7. The building change area detection method according to claim 5, characterized in that: The fusion module also includes a mapping module, and the first fusion feature map and the second fusion feature map are subjected to matrix difference processing to determine the prediction result of the change area corresponding to the training image pair, including: Performing matrix difference processing on the first fused feature map and the second fused feature map to determine a change feature map corresponding to the training image pair; The mapping module is used to map the values of each pixel point in the change feature map to determine the change area prediction result corresponding to the training image pair; the change area prediction result specifically includes the prediction result of each pixel point in the corresponding second training image, and the prediction result is used to characterize whether the corresponding pixel point is a predicted change area.
8. A building change area detection device, characterized in that: include: An acquisition module, used to acquire historical images obtained by photographing the building area at historical times and current images obtained by photographing the building area at current time; A detection module, used to input the historical image and the current image into a preset detection network to perform detection processing on the changed area, and determine the corresponding target changed area in the current image; The detection network is trained based on multiple groups of training image pairs, each group of training image pairs includes a first training image and a second training image, and each second training image is annotated with a marked change area relative to the corresponding first training image; the detection network includes an attention module, and the attention module is used to assign a weight to the area with a position change in each group of training image pairs that is higher than the weight assigned to the area without a position change.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the building change area detection method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the building change area detection method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Two-dimensional follicle detection method and device, ultrasonic equipment and readable storage medium
CN110570350A
Remote sensing image road segmentation method based on context information and attention mechanism
CN112183258A
Road water body detection method combining reflection attention mechanism and self-attention mechanism
CN112699727A
Remote sensing image change detection method based on twinborn multi-scale difference feature fusion
CN113420662A
Remote sensing image change detection method and device, computer equipment and storage medium
CN114022788A
Cited By
Building deviation area detection method, device and equipment and storage medium
CN121258918A