Remote sensing image change detection method based on convolutional neural network
Through sliding window and pyramid feature extraction technology, combined with the change comparison network, the problem of convolutional neural network's difficulty in paying attention to the global context in remote sensing image change detection is solved, and the detection precision and accuracy are improved.
Patent Information
- Application Number
- CN202310459073.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2043-04-26
AI Technical Summary
It is difficult for convolutional neural networks to pay attention to the global context information in complex scenes in remote sensing image change detection, resulting in low detection accuracy.
A sliding window is used to traverse the feature map, overlay feature blocks and perform convolution operations to generate a changing feature intensity map. It combines pyramid feature extraction and changing comparison networks to make full use of the contextual information of remote sensing images.
It improves the accuracy and precision of change detection, avoids information loss during feature extraction, expands the receptive field and retains multi-scale information.
Smart Images

Figure CN116563231B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a remote sensing image change detection method based on a convolutional neural network. Background Art
[0002] Change detection refers to the process of identifying differences in the state of an object or phenomenon by observing the same area at different times. Change detection frameworks use multi-temporal datasets to qualitatively analyze the temporal effects of phenomena and quantify changes.
[0003] Change detection analysis is usually divided into three levels, namely pixel level, feature level and target level. Pixel-level change detection refers to directly detecting the changes in the pixels of two images. This method has many limitations, but the pixel information represents the most original information of the image and can provide subtle information. Feature-level change detection refers to extracting features in the image by some means, such as edges, textures, shapes, contours, etc., and then combining the features to comprehensively analyze the changes. The change detection results obtained by this processing method have higher confidence and accuracy, but some information may be lost in the process of extracting features. Target-level change detection refers to the specific analysis of a certain type of changing objects in the image, such as buildings, roads, forests, waters, etc. The premise of this level of change detection analysis is that the area of interest can be well extracted. The three levels of change detection analysis methods have their own advantages. In practical applications, it is necessary to select the most appropriate analysis method according to different purposes and data conditions.
[0004] Traditional change detection methods are divided into pixel-based methods and object-based methods. Pixel-based methods use pixels as the basic unit of change detection analysis, detect changes by using information such as the spectral characteristics of pixels, and do not consider the spatial relationship between pixels. The ability of object-based methods to process high-resolution multispectral images is reflected by objects extracted from images. Pixel-based methods mainly include direct comparison, image conversion, classification-based change detection, and machine learning methods. Among them, direct comparison includes image difference, image ratio, and regression analysis. Image conversion includes vegetation index difference, change vector analysis, principal component analysis, and tasseled cap transformation. Object-based methods mainly include object-based classification comparison and stacked multi-temporal image comparison. Machine learning methods mainly include artificial neural networks, support vector machines, and decision trees.
[0005] The results obtained by traditional remote sensing image change detection schemes often have problems such as incomplete information, low accuracy, and low detection precision. In recent years, with the development of deep learning methods and the emergence of available large-scale remote sensing change detection datasets, change detection methods based on deep learning have made great progress. Compared with traditional methods, their performance has been greatly improved. At present, deep learning methods with the ability to automatically extract deep features are widely used in change detection tasks. Although convolutional neural network-based methods have been proven to be effective in hyperspectral image change detection tasks, there are still some serious problems. Specifically, the receptive field of convolutional neural networks is severely limited by the size of the convolution kernel, which makes it only focus on local features and difficult to model global contextual information in complex scenes. Summary of the invention
[0006] In order to overcome the limitations of convolutional neural networks in traditional machine learning methods and deep learning methods in change detection, the purpose of the present invention is to provide a remote sensing image change detection method based on convolutional neural networks, which uses a sliding window to traverse one of the time-phase feature maps, superimposes the feature blocks at the corresponding position of another feature map, and calculates the compatibility of the feature block with its surrounding features to determine whether a change has occurred. The present invention can retain the features extracted from the original feature map while extracting differences, obtain multi-scale information, and make full use of the rich contextual information in remote sensing images, thereby improving the accuracy of change detection.
[0007] The technical solution of the present invention is as follows:
[0008] A remote sensing image change detection method based on convolutional neural network, comprising:
[0009] S1 obtains the pre-phase image and the post-phase image of the target area, and pre-processes the pre-phase image and the post-phase image;
[0010] S2 constructs a change detection model and performs pre-training, wherein the change detection model includes a feature extraction network and a change comparison network;
[0011] S3 performs pyramid feature extraction on the front phase image and the back phase image respectively through a feature extraction network to obtain a first feature map and a second feature map;
[0012] S4 sets a sliding window, and uses the sliding window to traverse the first feature map and the second feature map respectively. When traversing one of the feature maps, the feature block at the center of the sliding window is superimposed with the feature block at the corresponding position of the other feature map to obtain a new sliding window, and the new sliding window is multiplied by the mask and then a convolution operation is performed to obtain a convolution operation result;
[0013] S5 inputs the convolution operation result into the change contrast network to obtain feature compatibility and generate a change feature intensity map;
[0014] S6 processes the change feature intensity map to obtain a change detection result.
[0015] In one embodiment of the present invention, step S4 includes:
[0016] S41 divides the sliding window into 3*3 equal parts;
[0017] S42, when traversing the first feature map, superimposes the feature block at the center of the sliding window with the feature block at the corresponding position of the second feature map to obtain a first new sliding window, multiplies the first new sliding window by the first mask to perform a convolution operation, and obtains a first convolution operation result;
[0018] S43, when traversing the second feature map, superimposing the feature block at the center of the sliding window with the feature block at the corresponding position of the first feature map to obtain a second new sliding window, and multiplying the second new sliding window by the second mask to perform a convolution operation to obtain a second convolution operation result;
[0019] Specifically, step S5 includes:
[0020] S51 change comparison network includes feature comparison layer, 1*1 convolution layer, feature concatenation layer, and MLP layer;
[0021] S52 Input the result of the first convolution operation into the feature comparison layer, calculate the compatibility of the feature block at the center of the first new sliding window in the first feature map with the surrounding feature blocks, and obtain the first feature compatibility S k ;
[0022] S53: Input the result of the second convolution operation into the feature comparison layer, calculate the compatibility between the feature block at the center of the second new sliding window in the second feature map and the surrounding feature blocks, and obtain the second feature compatibility S L ;
[0023] S54 will S k and S L After addition, the change vector is obtained by feature vector operation, and its Euclidean distance is calculated to generate a change feature intensity map.
[0024] In one embodiment of the present invention, the first feature compatibility S is calculated k and the second characteristic compatibility S L The same method includes the following steps:
[0025] Taking the feature block q(m,n) at the center of the sliding window as the center, define a neighborhood Ω of length 2W+1 (1≤W≤5), Ω={(m1,n1)||m1-m|≤W, |n1-n|≤W};
[0026] Calculate the first characteristic compatibility S k ;
[0027]
[0028] Calculate the second characteristic compatibility S L ;
[0029]
[0030] in, Represents the result of the first convolution operation; Represents the result of the second convolution operation; Represents the changes in the contrast network parameters.
[0031] Specifically, step S3 includes:
[0032] The front phase image and the back phase image are respectively input into the feature extraction network, a pyramid is constructed, multi-scale features are extracted according to the scale space of the pyramid, and the first feature map and the second feature map are obtained after output;
[0033] Among them, the feature extraction network includes a 7*7 convolutional layer, a maximum pooling layer, and 4 residual blocks, wherein each residual block includes 2 residual units, each residual unit includes 2 3*3 convolutional layers, and shortcuts are set between the residual units for connection.
[0034] Specifically, the extraction process of the first feature map and the second feature map is the same, and the feature extraction process is:
[0035] Input the previous phase image or the next phase image into the feature extraction network, extract the first feature map according to the 7*7 convolution layer, denoted as X1, and then input 4 residual blocks in sequence to extract 4 feature maps, denoted as X2, X3, X4, and X5, respectively. The scale of each feature map is different, and the scale of the feature map increases in sequence according to the data flow direction;
[0036] Build the framework of the pyramid:
[0037] Take X5 as the highest level pyramid feature;
[0038] Upsample X5 and concatenate it with X4 to obtain the second-layer pyramid features.
[0039] The second-layer pyramid features are upsampled and concatenated with X3 to obtain the third-layer pyramid features.
[0040] The third-layer pyramid features are upsampled and concatenated with X2 to obtain the fourth-layer pyramid features.
[0041] The fourth-layer pyramid features are upsampled and concatenated with X1 to obtain the fifth-layer pyramid features;
[0042] The highest-level pyramid features, the second-level pyramid features, the third-level pyramid features, the fourth-level pyramid features, and the fifth-level pyramid features are arranged in order to form a feature pyramid, that is, the first feature map or the second feature map.
[0043] Specifically, the pre-training process of the change detection model in step S2 is as follows:
[0044] Obtain training samples, which include remote sensing images of two phases and corresponding true labels;
[0045] The remote sensing images of the previous and next two time phases are input into the preset initial change detection model, and the predicted change feature map is output through the initial change detection model;
[0046] According to the predicted change feature map and the true label, the loss function is obtained;
[0047] Based on the loss function, the initial change detection model is trained to obtain a trained change detection model.
[0048] Specifically, according to the predicted change feature map and the true label, the process of obtaining the loss function includes:
[0049] The binary cross entropy loss is calculated through the predicted change feature map and the true label, where the binary cross entropy loss function is used to measure the similarity between the predicted change pixels and the true change pixels;
[0050] The Dice loss is calculated through the predicted change feature map and the true label. The Dice loss function is used to alleviate the problem of imbalance between changed and unchanged samples in the change detection process.
[0051] Add the binary cross entropy loss function and the Dice loss function to get the total loss function.
[0052] Specifically, step S6 includes:
[0053] S61 adjusts the channel through a 1*1 convolution layer, resamples and splices the change feature intensity map in the feature splicing layer, and obtains a change feature splicing map;
[0054] S62 performs pixel-level change determination on the change feature mosaic image through the MLP layer, and obtains the change detection result through the output layer.
[0055] Specifically, step S62 includes:
[0056] The value range of the pixel values in the change feature mosaic is set to [0,1], and the classification threshold is set. The pixels corresponding to the value range greater than the classification threshold are marked as changed, and the pixels corresponding to the value range less than the classification threshold are marked as unchanged, thereby obtaining the change detection result.
[0057] The beneficial effects of the present invention are:
[0058] (1) Since pyramid features can retain image features at all levels, the accuracy of change detection results can be increased by extracting pyramid features for change detection.
[0059] (2) Using a sliding window, when traversing a feature map, the feature blocks at the corresponding position in another feature map are spliced with it, and they participate in the convolution operation together, so as to retain the features extracted from the original feature map while extracting the difference; while extracting the difference, the features extracted from the original feature map are retained, avoiding the destruction of effective information and improving the accuracy of detection;
[0060] (3) The specific parameters obtained through learning are retained and passed to the subsequent network, which expands the receptive field while retaining the size characteristics and obtaining multi-scale information.
[0061] (4) By calculating the compatibility of the feature block in the center of the sliding window in the feature map with its surrounding feature blocks, a change feature intensity map is generated to judge the change detection result. This can make full use of the rich contextual information in the remote sensing image and further improve the change detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] By reading the detailed description of the preferred embodiment below, various other advantages and benefits will become clear to those of ordinary skill in the art. The accompanying drawings are only used for the purpose of illustrating the preferred embodiment and are not considered to be limitations of the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings.
[0063] Figure 1 is a flow chart of a method according to an embodiment of the present invention;
[0064] Figure 2 It is a technical processing flow chart of an embodiment of the present invention;
[0065] Figure 3 This is a training result data diagram of an embodiment of the present invention;
[0066] Figure 4 is a processing flow chart of a feature extraction network according to an embodiment of the present invention;
[0067] Figure 5 It is a schematic diagram of a sliding window traversing a feature graph according to an embodiment of the present invention;
[0068] Figure 6A processing flow chart of a change comparison network according to an embodiment of the present invention; DETAILED DESCRIPTION
[0069] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0070] See also Figure 1 and Figure 2 The present invention provides a remote sensing image change detection method based on a convolutional neural network, comprising:
[0071] S1 obtains the pre-phase image and the post-phase image of the target area, and pre-processes the pre-phase image and the post-phase image;
[0072] In step S1 of the embodiment of the present invention, the preprocessing process includes radiation correction and alignment, wherein radiation correction is performed on the two remote sensing images to eliminate the image radiation error caused by differences in sensor sensitivity characteristics, solar altitude angle, atmospheric conditions, terrain undulations and other factors; the specific radiation correction method is the same as the relevant prior art and will not be repeated in the embodiment of the present invention.
[0073] S2 constructs a change detection model and performs pre-training, wherein the change detection model includes a feature extraction network and a change comparison network;
[0074] Specifically, the pre-training process of the change detection model is as follows:
[0075] Step 1: Obtain training samples, which include remote sensing images of two phases before and after and the corresponding real labels.
[0076] In one embodiment of the present invention, the true label is automatically calculated according to the labeling method.
[0077] In an embodiment of the present invention, the marking method includes:
[0078] Compare the spectral characteristics of the remote sensing images of the previous and next phases to obtain the spectral characteristic difference map;
[0079] Performing superpixel segmentation on the spectral feature difference map to obtain a first segmentation result;
[0080] Taking the centroid position coordinates of each superpixel in the first segmentation result as the center of the image block and taking a preset size as the size of the image block, calculating the overlap of each pair of image blocks between the remote sensing images of the previous and next two phases;
[0081] The true label is constructed based on each pair of image blocks between the remote sensing images of the previous and next phases and the overlap between the image blocks.
[0082] Let's take a specific example to illustrate:
[0083] (1) Use change vector analysis to compare the spectral characteristics of a pair of remote sensing images.
[0084]
[0085] in, and They represent the pixel values of image I1 and image I2 in the kth band respectively; K represents the number of spectral bands; and P is the spectral feature difference map.
[0086] (2) The spectral feature difference map P is segmented into superpixels. A superpixel refers to an irregular pixel block with certain visual significance composed of adjacent pixels with similar texture, color, brightness and other characteristics. The superpixel segmentation method can adopt a linear iterative clustering method, and specifically, a segmentation scale H is set. In this embodiment, H can be 8. The spectral feature difference map is segmented to obtain superpixels with similar spectra and adjacent spaces, and a segmentation mask of the corresponding superpixel is obtained, that is, the first segmentation result.
[0087] (3) For each superpixel, use the segmentation mask to calculate the centroid position coordinates of the superpixel, and take an image block of size m×m with the centroid position as the center in each of the two remote sensing images included in the remote sensing image pair. Calculate the overlap of each pair of image blocks between the remote sensing image pairs. For example, if the first segmentation result includes 10 superpixels, then each remote sensing image can take 10 image blocks, and it is necessary to calculate the overlap of 10×10=100 pairs of image blocks between the remote sensing image pairs.
[0088] In the embodiment of the present invention, the overlap degree may be calculated by calculating the intersection-and-union ratio of two image blocks, and the formula is as follows:
[0089]
[0090] Among them, x and y are two image blocks, which come from two images in a remote sensing image pair respectively; O(x, y) is the overlap of the two image blocks, and IoU represents the intersection over union ratio between the two image blocks.
[0091] (4) The overlap is used as the category label of the two image blocks. Specifically, if the intersection-and-union ratio between the two image blocks is in [0, 0.5), the two image blocks are regarded as an image pair, and their category label is 0. If the intersection-and-union ratio between the two image blocks is in [0.5, 1], the category label of the image pair composed of the two image blocks is 0. The larger the intersection-and-union ratio, the smaller the degree of change between the two image blocks, that is, the category label of 0 can be regarded as "unchanged", and the smaller the intersection-and-union ratio, the greater the degree of change between the two image blocks, so the category label of 1 can be regarded as "changed". After labeling all the image pairs, the training samples and their true labels are obtained.
[0092] Step 2: Input the remote sensing images of the previous and next two phases into a preset initial change detection model, and output the predicted change feature map through the initial change detection model.
[0093] In an embodiment of the present invention, the model can be trained according to the training samples and their true labels. During the training, the change feature map predicted by the model is a pixel-level change feature intensity map, and the pixel value of the change feature intensity map is obtained, and its value range is [0,1]. The larger the value, the higher the possibility of change. Similarly, the value range is divided into two equal parts. If the pixel value is in [0,0.5), it means that the pixel has not changed, and the pseudo label of the pixel is 0. If the pixel value is in [0.5,1], the pixel has changed, and the pseudo label of the pixel is 1.
[0094] Step 3: Obtain the loss function based on the predicted change feature map and the true label.
[0095] In one embodiment of the present invention, the specific method of this step is:
[0096] The cross entropy loss is calculated through the predicted change feature map and the true label, where the cross entropy loss function is used to measure the similarity between the predicted change pixels and the true change pixels;
[0097] The Dice loss is calculated through the predicted change feature map and the true label. The Dice loss function is used to alleviate the problem of imbalance between changed and unchanged samples in the change detection process.
[0098] Add the cross entropy loss function and the Dice loss function to get the total loss function.
[0099] In another embodiment of the present invention, the loss function may also be an energy loss function.
[0100] Step 4: Based on the loss function, the initial change detection model is trained to obtain a trained change detection model.
[0101] In the above training process, the quality of model training is evaluated based on mF1. mF1 refers to the average value of the F1 score. F1 is an indicator to measure the accuracy of the model. Its maximum value is 1 and its minimum value is 0. The larger the value, the better the model. The formula of F1 is as follows:
[0102]
[0103] Among them, precision refers to the accuracy rate and recall refers to the recall rate.
[0104]
[0105]
[0106] During training, the true labels used are of two categories, one for changes and the other for unchanged. Among them, TP refers to the number of samples whose predicted changed labels are consistent with the true labels of the samples, FP refers to the number of samples whose unchanged true labels are predicted as changed labels, and FN refers to the number of samples whose changed true labels are predicted as unchanged labels.
[0107] In a specific embodiment of the present invention, the feature extraction network includes 1 7*7 convolutional layer, 1 maximum pooling layer, and 4 residual blocks according to the data flow direction, wherein each residual block includes 2 residual units, each residual unit includes 2 3*3 convolutional layers, and shortcuts are set between adjacent residual units for connection; the change contrast network includes a feature comparison layer, 3 1*1 convolutional layers, a feature splicing layer, and an MLP layer.
[0108] The training steps of the change detection model are as follows: obtain the training data set, divide the training data set into training samples and verification samples, where the number of training samples and verification samples is 7:3, and both training samples and verification samples are remote sensing images of two phases with real labels. The training evaluation method uses mF1, Figure 3 This is the training result of this embodiment.
[0109] It can be seen from the data of the training results that the change detection model of the present invention has good performance, and its mean accuracy has reached a relatively high level, indicating that the change detection model of the present invention can retain size features while expanding the receptive field, make full use of the contextual information in the image, and improve the accuracy and precision of change detection.
[0110] S3 performs pyramid feature extraction on the front phase image and the back phase image respectively through the feature extraction network to obtain the first feature map and the second feature map.
[0111] See also Figure 4 Specifically, step S3 includes:
[0112] The front phase image and the back phase image are respectively input into the feature extraction network, a pyramid is constructed, multi-scale features are extracted according to the scale space of the pyramid, and the first feature map and the second feature map are obtained after output;
[0113] The feature extraction network includes a 7*7 convolutional layer, a maximum pooling layer, and 4 residual blocks. Each residual block includes 2 residual units, each residual unit contains 2 3*3 convolutional layers, and shortcuts are set between the residual units for connection.
[0114] Optionally, in one embodiment of the present invention, the feature extraction is described by taking the previous phase image as an example:
[0115] The previous phase image is input into the feature extraction network, and the first feature map is extracted according to the 7*7 convolutional layer, which is denoted as X1. Then, four residual blocks are input in sequence to extract four feature maps, which are denoted as X2, X3, X4, and X5. The scale of each feature map is different, and the scale of the feature map increases in sequence according to the data flow.
[0116] A pyramid framework is constructed, where X5 is the highest-level pyramid feature. X5 is upsampled and concatenated with X4 to obtain the second-level pyramid feature. The second-level pyramid feature is also upsampled and concatenated with X3 to obtain the third-level pyramid feature. The third-level pyramid feature is upsampled and concatenated with X2 to obtain the fourth-level pyramid feature. The fourth-level pyramid feature is upsampled and concatenated with X1 to obtain the fifth-level pyramid feature.
[0117] Arrange the highest-level pyramid features, the second-level pyramid features, the third-level pyramid features, the fourth-level pyramid features, and the fifth-level pyramid features in order to form a feature pyramid, i.e., the first feature map.
[0118] The extraction process of the second feature map is the same as that of the first feature map, and will not be repeated here.
[0119] S4 sets a sliding window, and uses the sliding window to traverse the first feature map and the second feature map respectively. When traversing one of the feature maps, the feature block at the center of the sliding window is superimposed with the feature block at the corresponding position of the other feature map to obtain a new sliding window, and the new sliding window is multiplied by the mask and then a convolution operation is performed to obtain a convolution operation result;
[0120] See also Figure 5 Specifically, step S4 also includes:
[0121] S41 divides the sliding window into 3*3 equal parts;
[0122] S42, when traversing the first feature map, superimposes the feature block at the center of the sliding window with the feature block at the corresponding position of the second feature map to obtain a first new sliding window, multiplies the first new sliding window by the first mask to perform a convolution operation, and obtains a first convolution operation result;
[0123] S43, when traversing the second feature map, superimposing the feature block at the center of the sliding window with the feature block at the corresponding position of the first feature map to obtain a second new sliding window, and multiplying the second new sliding window by the second mask to perform a convolution operation to obtain a second convolution operation result;
[0124] In the embodiment of the present invention, the sliding window is divided into 3*3 equal parts to obtain a small window of 3*3 size, and the center position is the feature block at the center of the sliding window; the sliding window is used to start from the upper left corner of the feature map and slide the window along the x and y directions until the window covers the entire feature map, and the sliding step length of the sliding window is one feature block;
[0125] When traversing the first feature map, the feature block at the center of the sliding window is superimposed with the feature block at the corresponding position of the second feature map according to the channel dimension to obtain the first new sliding window; the first new sliding window is multiplied by the first mask to obtain the mosaic feature of the central pixel of the first new window and the surrounding pixels, and then the mosaic feature is multiplied and added with the convolution kernel; after traversing the entire first feature map, the complete first convolution operation result is obtained. Among them, the first mask is a fixed parameter used in the convolution operation, which is used to slide the two superimposed feature blocks in the first new sliding window.
[0126] The second convolution operation result is obtained by traversing the second feature map, which is the same as the first feature map and will not be repeated here.
[0127] The present invention uses a sliding window. When traversing a feature map, the feature blocks at the corresponding position in another feature map are spliced with it to jointly participate in the convolution operation. While extracting the difference, the features extracted from the original feature map are retained to avoid destroying the effective information and improve the accuracy of detection. The specific parameters obtained through learning are retained and passed to the subsequent network to obtain multi-scale information.
[0128] Compared with the simple calculation of feature differences in the prior art, it has the following advantages:
[0129] (1) This method does not destroy the feature information extracted by the feature extraction network, but the features contained in the original vector will be erased when the difference is calculated, leaving only the "difference", resulting in the loss of effective information and reducing the accuracy of detection;
[0130] For example, the difference between the vector (1, 9, 0) and the vector (1, 8, 0) is (0, 1, 0), and the difference between the vector (12, 1, 5) and the vector (12, 0, 5) is also (0, 1, 0). The original eigenvector is replaced by the vector difference (0, 1, 0).
[0131] (2) The method adopted by the present invention can retain the features by learning specific parameters and pass them to the subsequent network, so that the receptive field is larger and more context information can be utilized.
[0132] S5 inputs the convolution operation result into the change contrast network to obtain feature compatibility and generate a change feature intensity map;
[0133] In this embodiment of the present invention, step S5 further includes:
[0134] S51 change comparison network includes feature comparison layer, 1*1 convolution layer, feature concatenation layer, and MLP layer;
[0135] S52 Input the first convolution operation result into the change comparison network, calculate the compatibility of the feature block at the center of the first new sliding window in the first feature map with the surrounding feature blocks, and obtain the first feature compatibility S k ;
[0136] S53 Input the second convolution operation result into the change contrast network, calculate the compatibility of the feature block at the center of the second new sliding window in the second feature map with the surrounding feature blocks, and obtain the second feature compatibility S L ;
[0137] In the embodiment of the present invention, the first feature compatibility S is calculated k and the second characteristic compatibility S L The same method includes the following steps:
[0138] Taking the feature block q(m,n) at the center of the sliding window as the center, define a neighborhood Ω of length 2W+1 (1≤W≤5), Ω={(m1,n1)|m1-m|≤W,|n1-n|≤W};
[0139] Calculate the first characteristic compatibility S k ;
[0140]
[0141] Calculate the second characteristic compatibility S L ;
[0142]
[0143] in, Represents the result of the first convolution operation; Represents the result of the second convolution operation; Represents the changes in the contrast network parameters.
[0144] The present invention uses the product of the variation contrast network parameters and the convolution result, and the ratio of the square of the neighborhood Ω set by the length of the feature block to calculate the compatibility. These three indicators can more comprehensively reflect the compatibility between the feature block at the center of the sliding window and the surrounding feature blocks and the relationship between the two in space. Specifically, the feature extraction ability of the variation contrast network and the spatial locality of the convolution operation can reflect the similarity between the feature block at the center of the sliding window and the surrounding feature blocks in the feature space; combined with the neighborhood Ω, the spatial distribution of the feature block and its compatibility with the edge feature can be reflected. The use of this calculation method can better reflect the feature compatibility between the feature block at the center of the sliding window and the surrounding feature blocks; if the compatibility value is smaller, the compatibility between the feature block at the center of the new sliding window and the surrounding feature blocks is worse.
[0145] S54 will S k and S L After addition, the change vector is obtained by the characteristic vector operation, and its
[0146] Euclidean distance generates a map of varying feature intensities.
[0147] In the embodiment of the present invention, the present invention obtains the change vector by performing a feature vector difference operation. , calculate its Euclidean distance to generate a change intensity map, and use the classification threshold segmentation method to analyze the change intensity map to identify the changed area and the unchanged area.
[0148] In the embodiment of the present invention, the first feature compatibility , represents the vector of n bands of a single feature block transformed in n-dimensional space; the second feature compatibility , represents the vector of n bands of a single feature block transformed in n-dimensional space;
[0149]
[0150] Change Vector contains all the change information of a feature block in the dual-temporal remote sensing image. The size of the change vector reflects the change intensity of the feature block, and the direction of the change vector indicates the change type of the pixel. Therefore, the larger the absolute value of the change vector, the greater the change at that location, and vice versa. The size of the change vector can be calculated by Euclidean distance, and CM pixel Indicates, specifically:
[0151]
[0152] Among them, x i With y i Respectively refers to Sk , S L The grayscale value of a feature block in the i-th band, where i ranges from 1≤i≤n and is usually an integer.
[0153] The present invention starts from the compatibility of the feature block in the center of the sliding window in the feature map with its surrounding feature blocks, generates a change feature intensity map to judge the change detection result, and can make full use of the rich contextual information in the remote sensing image to further improve the change detection accuracy.
[0154] S6 processes the change feature intensity map to obtain a change detection result.
[0155] See also Figure 6 Specifically, step S6 includes:
[0156] The change comparison network includes feature comparison layer, 1*1 convolution layer, feature concatenation layer and MLP layer.
[0157] After the 1*1 convolution layer adjusts the channel, the feature concatenation layer resamples and concatenates the change feature intensity map to obtain a change feature concatenation map. Specifically, in this embodiment, there are three 1*1 convolution layers.
[0158] The MLP is used to perform pixel-level change determination on the change feature mosaic image, and the change detection result is output. Specifically, in this embodiment, the MLP layer may include three 1*1 convolutional layers.
[0159] The value range of the pixel values in the change feature mosaic is set to [0, 1], a classification threshold is set, pixels corresponding to the value range greater than the classification threshold are marked as changed, and pixels corresponding to the value range less than the classification threshold are marked as unchanged, to obtain a change detection result. In this embodiment, the classification threshold is 0.5.
[0160] The above implementation modes are only used to illustrate the present invention, but not to limit the present invention. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, all equivalent technical solutions also belong to the scope of the present invention. The patent protection scope of the present invention should be defined by the claims.
Claims
1. A remote sensing image change detection method based on convolutional neural network, characterized in that: include: S1 obtains a front-phase image and a back-phase image of a target area, and pre-processes the front-phase image and the back-phase image; S2 constructs a change detection model and performs pre-training, wherein the change detection model includes a feature extraction network and a change comparison network; S3 performs pyramid feature extraction on the front phase image and the back phase image respectively through a feature extraction network to obtain a first feature map and a second feature map; S4 sets a sliding window, and uses the sliding window to traverse the first feature map and the second feature map respectively. When traversing one of the feature maps, the feature block at the center of the sliding window is superimposed on the feature block at the corresponding position of the other feature map to obtain a new sliding window, and the new sliding window is multiplied by the mask and then a convolution operation is performed to obtain a convolution operation result; S5 inputs the convolution operation result into the change contrast network to obtain feature compatibility and generate a change feature intensity map; S6 processes the change feature intensity map to obtain a change detection result; Wherein, step S4 comprises: S41 divides the sliding window into 3*3 equal parts; When traversing the first feature map, S42 superimposes the feature block at the center of the sliding window with the feature block at the corresponding position of the second feature map to obtain a first new sliding window, and multiplies the first new sliding window by the first mask to perform a convolution operation to obtain a first convolution operation result; When traversing the second feature map, S43 superimposes the feature block at the center of the sliding window with the feature block at the corresponding position of the first feature map to obtain a second new sliding window, and multiplies the second new sliding window by the second mask to perform a convolution operation to obtain a second convolution operation result; Wherein, step S5 further includes: The S51 change comparison network includes a feature comparison layer, a 1*1 convolution layer, a feature concatenation layer, and an MLP layer; S52 inputs the first convolution operation result into the feature comparison layer, calculates the compatibility of the feature block at the center of the first new sliding window in the first feature map with the surrounding feature blocks, and obtains the first feature compatibility S k ; S53 inputs the second convolution operation result into the feature comparison layer, calculates the compatibility between the feature block at the center of the second new sliding window in the second feature graph and the surrounding feature blocks, and obtains the second feature compatibility S L ; S54 will S k and S L After addition, the change vector is obtained by feature vector operation, and its Euclidean distance is calculated to generate a change feature intensity map; Among them, the first characteristic compatibility S is calculated k and the second characteristic compatibility S L The same method includes the following steps: Taking the feature block q(m,n) at the center of the sliding window as the center, define a neighborhood Ω of length 2W+1, Ω={(m1,n1)|m1-m|≤W,|n1-n|≤W}, where 1≤W≤5; Calculate the first characteristic compatibility S k ; Calculate the second characteristic compatibility S L ; Among them, num k Indicates the result of the first convolution operation; num L Represents the result of the second convolution operation; Represents the changes in the contrast network parameters.
2. The method according to claim 1, characterized in that Step S3 includes: The front phase image and the back phase image are respectively input into the feature extraction network to construct a pyramid, and multi-scale features are extracted according to the scale space of the pyramid, and the first feature map and the second feature map are obtained after output; Among them, the feature extraction network includes a 7*7 convolutional layer, a maximum pooling layer, and 4 residual blocks, wherein each residual block includes 2 residual units, each residual unit includes 2 3*3 convolutional layers, and shortcuts are set between the residual units for connection.
3. The method according to claim 2, characterized in that The extraction process of the first feature map and the second feature map is the same, and the feature extraction process is: Input the previous phase image or the next phase image into the feature extraction network, extract the first feature map according to the 7*7 convolution layer, denoted as X1, and then input 4 residual blocks in sequence to extract 4 feature maps, denoted as X2, X3, X4, and X5, respectively. The scale of each feature map is different, and the scale of the feature map increases in sequence according to the data flow direction; Build the framework of the pyramid: Take X5 as the highest level pyramid feature; Upsample X5 and concatenate it with X4 to obtain the second-layer pyramid features. The second-layer pyramid features are upsampled and concatenated with X3 to obtain the third-layer pyramid features. The third-layer pyramid features are upsampled and concatenated with X2 to obtain the fourth-layer pyramid features. The fourth-layer pyramid features are upsampled and concatenated with X1 to obtain the fifth-layer pyramid features; The highest-level pyramid features, the second-level pyramid features, the third-level pyramid features, the fourth-level pyramid features, and the fifth-level pyramid features are arranged in order to form a feature pyramid, that is, the first feature map or the second feature map.
4. The method according to claim 1, characterized in that: The pre-training process of the change detection model in step S2 is as follows: Obtain training samples, which include remote sensing images of two phases and corresponding true labels; The remote sensing images of the previous and next two time phases are input into the preset initial change detection model, and the predicted change feature map is output through the initial change detection model; According to the predicted change feature map and the true label, the loss function is obtained; Based on the loss function, the initial change detection model is trained to obtain a trained change detection model.
5. The method according to claim 4, characterized in that According to the predicted change feature map and the true label, the process of obtaining the loss function includes: The binary cross entropy loss is calculated through the predicted change feature map and the true label, where the binary cross entropy loss function is used to measure the similarity between the predicted change pixels and the true change pixels; The Dice loss is calculated through the predicted change feature map and the true label. The Dice loss function is used to alleviate the problem of imbalance between changed and unchanged samples in the change detection process. Add the binary cross entropy loss function and the Dice loss function to get the total loss function.
6. The method according to claim 1, characterized in that Step S6 includes: S61 adjusts the channel through a 1*1 convolution layer, resamples and splices the change feature intensity map in the feature splicing layer, and obtains a change feature splicing map; S62 performs pixel-level change determination on the change feature mosaic image through the MLP layer, and obtains the change detection result through the output layer.
7. The method according to claim 6, characterized in that Step S62 includes: The value range of the pixel values in the change feature mosaic is set to [0, 1], and the classification threshold is set. The pixels corresponding to the value range greater than the classification threshold are marked as changed, and the pixels corresponding to the value range less than the classification threshold are marked as unchanged, thereby obtaining the change detection result.
Citation Information
Patent Citations
Remote sensing image change detection method based on twin convolutional neural network
CN111640159A
Multi-scale sparse convolution change detection method for high-resolution remote sensing image
CN112348814A
