Building extraction method for single-polarization SAR image of complex scene

By designing a lightweight encoder-decoder network structure and appropriate data augmentation strategies, the problem of low building extraction accuracy and high computational cost in single-polarization SAR images is solved, and efficient and accurate detection in complex scenes is achieved. Building extraction improves the generalization ability and practicality of the model.

CN118628902APending Publication Date: 2024-09-10XIDIAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410390028.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-02
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing technologies have problems with low accuracy, high computational cost, and insufficient adaptability to complex scenes in extracting buildings from single-polarization SAR images, especially in the absence of full-polarization SAR data and high computing resources.

Method used

A lightweight encoder-decoder network structure is designed, combining a hybrid attention encoder block and a multi-scale attention residual decoder module, to extract and characterize building features in single-polarization SAR images, and Use appropriate data augmentation strategies to improve the model's generalization ability and accuracy.

Benefits of technology

It achieves fast and efficient extraction of buildings in complex scenes, improves extraction accuracy and robustness, reduces computational complexity, reduces dependence on high-quality labels, and improves the model's generalization ability and practicality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118628902A
    Figure CN118628902A
Patent Text Reader

Abstract

A complex scene-oriented single-polarized SAR image building extraction method comprises the steps of collecting a single-polarized SAR remote sensing image, constructing a single-polarized SAR image building data set in a complex scene, and dividing the single-polarized SAR image building data set into a training set, a verification set and a test set or the training set and the verification test set; the method comprises the following steps: preprocessing a single-polarized SAR image building data set in a complex scene to obtain an iterable training set, a verification set and a test set or a training set and a verification test set; constructing an encoder E-decoder D network model; inputting the iterable training set and verification set or verification test set into the encoder E-decoder D network model for training and verification to obtain a trained encoder E-decoder D network model; inputting the iterable test set or verification test set into the trained encoder E-decoder D network model to verify the effect, obtaining a prediction probability value, and evaluating the network performance; according to the invention, the accuracy and robustness of building extraction in a complex scene are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of SAR image intelligent interpretation, and in particular relates to a building extraction method for single-polarization SAR images facing complex scenes. Background Art

[0002] Synthetic Aperture Radar (SAR) has the ability to acquire data all day long, and its imaging is not affected by factors such as light, climate, and geography. It has become a key technology in many fields such as urban planning, disaster assessment, and military reconnaissance. It has broad application prospects. Among them, the main objects in SAR images, such as buildings, are one of the most common objects in SAR images. The refined segmentation task for SAR buildings focuses on accurately identifying and extracting building information from SAR images, which plays an important role in understanding and analyzing regional structures, monitoring urban construction and management, and assessing the impact of natural disasters. Due to its unique advantages in the field of remote sensing, SAR technology is widely used in tasks such as building extraction and surface cover classification.

[0003] Single-polarization SAR data is a common form of SAR remote sensing imagery, whose reflected echoes only contain the same polarization information in the horizontal or vertical direction, but not cross-polarization or mixed polarization information. In complex scenes, the extraction of buildings from single-polarization SAR images faces a series of challenges. First, the backscattering characteristics of buildings in SAR images are complex, mainly secondary scattering from building materials, structures, and surrounding objects, showing strong backscattering mixed pixels, which are similar to the reflection characteristics of other objects (such as trees, roads, etc.) and are difficult to accurately distinguish. Secondly, in complex scenes, such as complex terrain, sparse buildings, and diverse building shapes, there is a large amount of interference information in single-polarization SAR images, which affects the extraction accuracy of buildings.

[0004] Traditional building extraction methods, such as pixel-level threshold segmentation, morphological processing, texture analysis, etc., often rely on manually designed feature extraction algorithms, which have limited adaptability to complex scenes and the extraction effect is difficult to meet actual needs. Intelligent interpretation of SAR image building analysis can significantly improve the efficiency and accuracy of data processing, which is more efficient and accurate than traditional manual interpretation methods. At present, deep learning models can automatically learn feature representations in data, have strong representation and generalization capabilities, and can effectively reduce the limitations of traditional methods in processing complex scenes, but there are problems with complex structures.

[0005] However, the existing building extraction methods are mainly aimed at dual-polarization or fully polarized SAR images, and there is relatively little research on single-polarized SAR images. The patent application with publication number CN115797768A discloses a new texture feature SAR building earthquake damage estimation method, which imports the original fully polarized synthetic aperture radar (PolSAR) data for preprocessing, uses the improved Yamaguchi four-component decomposition method to polarize the fully polarized synthetic aperture radar data, extracts the secondary scattering component and the volume scattering component, and classifies the to-be-identified ground objects in the fully polarized synthetic aperture radar image corresponding to the secondary scattering component as parallel intact buildings. However, there are two key problems with this method. First, this method requires original fully polarized SAR data, which is very rare; second, the operation is relatively complicated, and there is no end-to-end automated building extraction method that is simple and convenient.

[0006] The patent application with publication number CN114332636A discloses a polarimetric SAR building area extraction method, device and medium. It inputs the C matrix of the polarimetric SAR data to be processed into a trained first deep semantic extraction network to generate multi-level polarimetric features with different deep semantic information; at the same time, the polarimetric wave decomposition (Polarimetric Wave Decomposition, PWF) result is input into the trained second deep semantic extraction network to generate multi-level PWF features with different deep semantic information; the polarimetric features and PWF features are fused to obtain multi-level dual-path fusion features and inter-level fusion, and the building area extraction result of the polarimetric SAR data to be processed is generated according to the obtained inter-level fusion features. This method not only requires precious polarimetric SAR data, which may limit the scope of application of this method, but also uses multi-level feature fusion and inter-level fusion, which will lead to a high computational cost of the algorithm, and easily cause overfitting in scarce SAR images. Summary of the invention

[0007] In order to overcome the deficiencies of the above-mentioned prior art, the purpose of the present invention is to provide a building extraction method for single-polarization SAR images for complex scenes, by designing a relatively lightweight encoder-decoder network structure for building extraction in single-polarization SAR images, improving the feature extraction capability of the classification model, achieving effective representation of building features, and improving the accuracy and overall extraction effect of building extraction in complex scenes; through an improved encoder module and an improved decoder module, the key information of the building in the image is captured and retained, and at the same time, a data augmentation strategy suitable for building segmentation is adopted in a small amount of SAR image data sets, so as to achieve fast, efficient and accurate extraction of buildings in complex scenes, such as complex terrain, sparse buildings and the like.

[0008] In order to achieve the above object, the technical solution adopted by the present invention is:

[0009] A building extraction method for single-polarization SAR images of complex scenes comprises the following steps:

[0010] Step 1, collecting single-polarization SAR remote sensing images, the single-polarization SAR remote sensing images include single-polarization SAR remote sensing images and corresponding pixel-level labels, constructing a single-polarization SAR image building dataset under complex scenes, and dividing the single-polarization SAR image building dataset into a training set, a validation set and a test set or a training set and a validation test set;

[0011] Step 2, performing data preprocessing on the single-polarization SAR image building dataset under complex scenes obtained in step 1 to obtain an iterative single-polarization SAR image building dataset under complex scenes, wherein the iterative single-polarization SAR image building dataset under complex scenes includes a training set, a validation set and a test set or a training set and a validation test set;

[0012] Step 3, construct an encoder E-decoder D network model, which includes a hybrid attention encoder block FAE, a multi-scale attention residual decoder module MAD and a convolution layer LC; the encoder E is used to extract the feature information of buildings in the SAR image, and gradually reduce the size of the feature map and gradually expand the number of channels of the feature map to form high-level semantic information; the decoder D gradually restores the size and resolution of the original image through feature alignment and superposition fusion; the convolution layer LC is used to output the predicted logical value;

[0013] Step 4, input the iterative training set and validation set or validation test set obtained in step 2 into the encoder E-decoder D network model constructed in step 3 for training and validation until the training termination condition is met, thereby obtaining a trained encoder E-decoder D network model;

[0014] Step 5, input the iterative test set or verification test set obtained in step 2 into the trained encoder E-decoder D network model obtained in step 4 to verify the effect, obtain the predicted probability value, calculate the building category evaluation index and the overall evaluation index according to the predicted probability value and the corresponding single-polarization SAR building label, evaluate the network performance, and obtain the prediction result graph by setting the set threshold and visualizing it.

[0015] The specific method of step 1 is:

[0016] Step 1.1, obtaining single-polarization SAR remote sensing images;

[0017] Step 1.2, if the single-polarization SAR remote sensing image obtained in step 1.1 does not belong to the binary label type of the building / non-building category, then the single-polarization SAR remote sensing image obtained in step 1.1 is subjected to label conversion processing, the building category in the label is retained, and other categories and background categories are converted into non-building categories; if the single-polarization SAR remote sensing image obtained in step 1.1 belongs to the binary label type of the building / non-building category, no additional processing operation is required; if the binary label type SAR image data is a large scene image, it is non-overlappingly cropped into a small-scale image of A*A, and data without buildings that are all background or erroneous data with abnormal labels are eliminated to obtain a SAR image building data set;

[0018] Step 1.3, the SAR image building dataset obtained in step 1.2 is formed into a SAR image building dataset under complex scenes according to the complexity of the image. If the dataset is a small dataset, the SAR image building dataset under complex scenes is divided into a training set and a validation test set; if the dataset is a medium or large dataset, the SAR image building dataset under complex scenes is divided into a training set, a validation set, and a test set.

[0019] The specific method of step 2 is:

[0020] Step 2.1, encoding the single-polarization SAR image building dataset including a training set, a validation set and a test set or a training set and a validation test set obtained in step 1 into MindRecord type data suitable for the MindSpore framework;

[0021] Step 2.2, calculate the mean and variance of the training set of the single-polarization SAR image building dataset obtained in step 1, decode the MindRecord type data obtained in step 2.1, use the mean and variance to perform standardization operations, and then perform dimensionality expansion, random shuffling and batch processing operations to obtain an iterative single-polarization SAR image building dataset in complex scenarios containing a training set, a validation set and a test set or a training set and a validation test set.

[0022] The specific method of step 3 is:

[0023] Step 3.1, construct encoder E, encoder E adopts a layered architecture, and each layer uses a hybrid attention encoder block FAE;

[0024] The hybrid attention encoder block FAE includes 2 attention weighted convolution structures and 1 hybrid attention structure. Each attention weighted convolution structure consists of a 3*3 convolution layer, a batch normalization layer, a weighted attention layer and a ReLU activation function. The weighted attention layer includes spatial attention and channel attention. The 3*3 convolution layer and the ReLU activation function are used to extract features and add nonlinear transformations. The weighted attention layer weights the features to emphasize important features and suppress unimportant features. The hybrid attention structure consists of two types of attention: weighted attention and spatial attention in parallel.

[0025] The iterative single-polarization SAR image building dataset in complex scenes obtained in step 2 is input into the hybrid attention encoder block FAE, and the features are obtained through two attention weighted convolution structures. Will Input the weighted attention and spatial attention of the hybrid attention structure respectively to obtain and and Add the elements to get F E1 , F E2 ...F E5 And so on;

[0026] Step 3.2, construct a decoder D. The decoder D adopts a layered architecture, and each layer uses a multi-scale attention residual decoder module MAD; the multi-scale attention residual decoder module MAD is a feature-aware fusion structure composed of feature alignment and concatenation of different scales, channel attention, convolution operation and residual connection;

[0027] In the multi-scale attention residual decoder module MAD, the basic fusion feature F is first obtained by aligning and concatenating features of different scales. fi , i = 4, 3…1, and then use channel attention to learn the basic fusion feature F fi The global information of the basic fusion feature F fi Perform weighted processing and convolution operations to obtain high-level attention features F h ; Among them, the convolution operation includes a 3*3 convolution layer, batch normalization and ReLU activation function, and the number of channels N remains unchanged; finally, the basic fusion feature F fi With the high-level attention feature F h Residual connection obtains feature F Di , i=4,3…1;

[0028] Step 3.3, construct the convolution layer LC. The convolution layer LC consists of a 3*3 convolution layer. This layer can be transformed from F D1The most important features for the binary segmentation task are extracted and emphasized; the number of channels in the final output feature map is 1, corresponding to the final predicted logical value of the binary segmentation;

[0029] Step 3.4, use the five hybrid attention encoder blocks FAE constructed in step 3.1 and the four multi-scale attention residual decoder modules MAD established in step 3.2 to form a 5-layer basic encoder E-decoder D network structure, connect the convolution layer LC constructed in step 3.3 behind the last multi-scale attention residual decoder module MAD, and construct a complete encoder E-decoder D network structure for outputting a predicted logical value consistent with the input image size; the encoder E stage after five hybrid attention encoder blocks FAE has a feature map channel number of [16, 32, 64, 128, 256], and the feature map size scaling ratio between each layer is [1 / 2, 1 / 4, 1 / 8, 1 / 16]; the feature map output by the last hybrid attention encoder block FAE and the first three multi-scale attention residual decoder modules MAD is upsampled layer by layer, and the feature map size is doubled. The feature map output by the fourth multi-scale attention residual decoder module MAD is consistent with the size of the input sample, and finally the number of channels is adjusted through the convolution layer LC to be consistent with the input sample.

[0030] The specific process of training in step 4 includes:

[0031] Step 4.1, input the training set in the iterative complex scene single-polarization SAR image building data set obtained in step 2 into the encoder E-decoder D network model constructed in step 3, obtain the model prediction logic value, and use the Sigmoid operator to convert the model prediction logic value into a prediction probability value, and use the prediction probability value and the label corresponding to the training set obtained in step 2 to calculate the network loss L;

[0032] Step 4.2, update the learnable parameters of the hybrid attention encoder block FAE, the multi-scale attention residual decoder block MAD, and the convolutional layer LC according to the network loss L;

[0033] Step 4.3, repeat steps 4.1 and 4.2, and use the training set obtained in step 2 and the validation set or validation test set obtained in step 2 to monitor the training process until the training termination condition is met;

[0034] Step 4.4, according to the monitoring process of the training set and the validation set or the validation test set in step 4.3, adjust the training process and hyperparameters to obtain the trained encoder E-decoder D network model.

[0035] The image complexity in step 1.3 includes but is not limited to the following situations: sparse and scattered buildings; irregular and cluttered building shapes; a small number of building data samples; mixed building types; and building data involving multiple types of urban buildings and mountain buildings.

[0036] In step 1.3, if the acquired data set is a small data set, the data volume is expanded by using a data augmentation strategy suitable for SAR buildings on the training set, including rotation, flipping, and random color adjustment, to obtain a data augmented training set.

[0037] In the step 2.2, during the batch operation, if the last batch of samples in the training set is less than the batch size, the last batch of samples is discarded; if the last batch of samples in the test set and the validation test set is less than the batch size, the last batch of samples is not discarded.

[0038] The specific steps of aligning and splicing features of different scales in step 3.2 are as follows:

[0039] Step 3.2.1, obtain basic features of different scales, where the basic features of different scales input to the multi-scale attention residual decoder block MAD are partly derived from the features F output by the hybrid attention encoder block FAE at the same layer and below the same layer Ei , i = 1, 2…5, and the other part comes from the feature F output by the multi-scale attention residual decoder block MAD above this layer Di , i=4,3…1;

[0040] Step 3.2.2, perform up- and down-sampling and convolution operations on the basic features of different scales obtained in step 3.2.1 to achieve the alignment effect; the convolution operation uses a 3*3 convolution layer, batch normalization and ReLU activation function to convert the number of channels to the same number N; feature F E1 , F E2 …F E4 After the maximum pooling operation, it is reduced to the size of the corresponding level of the decoder, and then the convolution operation is performed to form features Achieve scale alignment effect; Feature F E5 , F D4 , F D3 …F D1 After bilinear interpolation, it is expanded to the size of the corresponding level of the decoder, and the features are formed after the convolution operation. Achieve the effect of scale alignment; the scale-aligned features are cascaded and spliced ​​to obtain the basic fusion feature F fi ; Basic fusion features F at different layers fi The calculation formula is as follows:

[0041]

[0042] Among them, F fi represents the basic fusion features in the i-th layer multi-scale attention residual decoder block MAD, Indicates from arrive Perform convolution operation, Express Perform convolution operation, Indicates from arrive The convolution operation of , ⊕ represents the feature cascade concatenation operation.

[0043] The network loss L in step 4.1 includes the binary cross entropy loss L BCE and soft Dice loss L SD , as follows:

[0044] Binary cross entropy loss L BCE :

[0045]

[0046] Where N is the number of samples, y i is the true label (0 or 1) of the i-th sample, p i is the probability that the i-th sample predicted by the model is a positive class, and log represents the natural logarithm;

[0047] Soft Dice loss L SD :

[0048]

[0049] Where N is the number of samples, y i is the true label (0 or 1) of the i-th sample, p i is the segmentation probability of the i-th sample predicted by the model;

[0050] Total network loss L:

[0051] L=αL BCE +βL SD

[0052] Among them, α and β are the binary cross entropy losses L BCE and soft Dice loss L SD The combination coefficient of is two constants.

[0053] Compared with the prior art, the present invention has the following advantages:

[0054] First, a relatively lightweight encoder-decoder network structure designed specifically for building extraction from single-polarization SAR images. The present invention designs a structural model based on an encoder E-decoder D to construct a network structure suitable for building extraction tasks from single-polarization SAR images. The encoder E-decoder D passes information to the decoder part for decoding and reconstruction through the semantic features extracted by the encoder part. In this way, the semantic information of the image can be retained, which helps to better distinguish the target object from the background in the image segmentation task. At the same time, this network structure has fewer parameters and computational complexity, can efficiently extract and characterize building features in SAR images, and combines the hybrid attention encoder block FAE and the multi-scale attention residual decoder module MAD, thereby improving the accuracy and robustness of building extraction.

[0055] Second, the present invention designs a hybrid attention encoder block FAE and a multi-scale attention residual decoder module MAD; the hybrid attention encoder block FAE adopts the attention mechanism to weightedly process the features, emphasizes important features and suppresses unimportant features, thereby improving the feature representation ability; the multi-scale attention residual decoder module MAD can decode the aligned features at different scales, gradually parse out the key information in the features, further improve the feature decoding ability, and achieve high-precision SAR image building segmentation.

[0056] Third, the present invention studies the problem of building extraction in complex scenes, and realizes fast, efficient and accurate extraction of buildings in complex scenes through improved network structure and feature extraction method. This includes processing buildings in mixed terrain areas, sparse buildings, etc., making the extraction results more robust and reliable.

[0057] Fourth, while ensuring segmentation performance, a data augmentation strategy suitable for building segmentation is adopted in a small number of SAR image datasets, which further improves the generalization ability and accuracy of the building extraction model. This data augmentation strategy can effectively utilize limited data resources, improve the performance and robustness of the model, reduce the constraints and restrictions of high-quality labels, and save labor annotation costs.

[0058] In summary, the present invention designs a relatively lightweight encoder-decoder network structure for the task of extracting buildings from single-polarized SAR images, including a hybrid attention encoder block FAE, a multi-scale attention residual decoder module MAD, and a convolutional layer LC. The feature representation capability is improved by means of attention mechanism, multi-scale feature cascade, residual addition, etc., which is suitable for complex scenes, and uses a suitable data augmentation strategy that can be used in small data, so as to achieve efficient and accurate extraction of buildings under single-polarized SAR images in complex scenes, with high practicality and generalization ability. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a step diagram of the overall method of the present invention.

[0060] Figure 2 The present invention is a flowchart of a method for extracting buildings from single-polarization SAR images.

[0061] Figure 3 is a comparison chart of the SAR-Building1 dataset before and after label conversion in an embodiment of the present invention; wherein, Figure 3 (a) is the original multi-label data mask image, Figure 3 (b) is the building / non-building data mask image.

[0062] Figure 4 It is a partial single-polarization SAR building image of the SAR-Building1 data set in the embodiment of the present invention.

[0063] Figure 5 is a comparison diagram of the data enhancement of the SAR-Building1 dataset in an embodiment of the present invention; wherein, Figure 5 (a) is the original data image, Figure 5 (b) is the single-polarization SAR image effect after flipping. Figure 5 (b) is the single-polarization SAR image effect after rotation. Figure 5 (c) is the single-polarization SAR image effect after color adjustment.

[0064] Figure 6 It is a comparison diagram of single-polarization SAR buildings in different regions of the SAR-Building2 data set in an embodiment of the present invention.

[0065] Figure 7 is a block diagram of the encoder and decoder of the present invention; wherein, Figure 7 (a) is the structure diagram of the hybrid attention encoder block FAE, Figure 7 (b) is the structure diagram of the multi-scale attention residual decoder module MAD.

[0066] Figure 8 is a comparison chart of some test set results of the SAR-Building1 data set in an embodiment of the present invention; wherein, Figure 8 (a) and Figure 8 (d) is the GT label image of part of the test set. Figure 8 (b) and Figure 8 (e) is a visualization of the prediction results of part of the test set using the comparison method Model_2. Figure 8 (c) and Figure 8 (f) is a visualization result diagram of the prediction of part of the test set using the present invention.

[0067] Fig. 9 is a comparison chart of some test set results of the SAR-Building2 data set in an embodiment of the present invention; wherein, Fig. 9 (a) and Fig. 9 (d) is the GT label image of part of the test set. Fig. 9 (b) and Fig. 9 (e) is a visualization of the prediction results of part of the test set using the comparison method Model_2. Fig. 9 (c) and Fig. 9 (f) is a visualization result diagram of the prediction of part of the test set using the present invention. DETAILED DESCRIPTION

[0068] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and embodiments.

[0069] Reference Figure 1 and Figure 2 A building extraction method for single-polarization SAR images of complex scenes includes the following steps:

[0070] Step 1, collect single-polarization SAR remote sensing images, by retrieving public SAR data or creating a new building dataset, considering factors such as image coverage and building size sparsity, single-polarization SAR remote sensing images include single-polarization SAR remote sensing images and corresponding pixel-level labels, construct a single-polarization SAR image building dataset in complex scenes, and divide the single-polarization SAR image building dataset into a training set, a validation set and a test set or a training set and a validation test set;

[0071] The specific method of step 1 is:

[0072] Step 1.1, obtaining single-polarization SAR remote sensing images;

[0073] Step 1.2, if the single-polarization SAR remote sensing image obtained in step 1.1 does not belong to the binary label type of the building / non-building category, then the single-polarization SAR remote sensing image obtained in step 1.1 is subjected to label conversion processing, the building category in the label is retained, and other categories and background categories are converted into non-building categories; if the single-polarization SAR remote sensing image obtained in step 1.1 belongs to the binary label type of the building / non-building category, no additional processing operation is required; if the binary label type SAR image data is a large scene image, it is non-overlappingly cropped into a small-scale image of A*A, and data without buildings that are all background or erroneous data with abnormal labels are eliminated to obtain a SAR image building data set;

[0074] Step 1.3, the SAR image building dataset obtained in step 1.2 is formed into a SAR image building dataset under complex scenes according to the complexity of the image. If the dataset contains hundreds to thousands of samples, it is considered a small dataset, and the SAR image building dataset under complex scenes is divided into a training set and a validation test set at a ratio of 8:2; if the dataset contains from thousands to tens of thousands of samples or more, it is considered a medium-to-large dataset, and the SAR image building dataset under complex scenes is divided into a training set, a validation set, and a test set at a ratio of 6:2:2;

[0075] The image complexity in step 1.3 includes but is not limited to the following situations: sparse and scattered buildings; irregular and cluttered building shapes; a small number of building data samples; mixed building types; and building data involving multiple types of urban buildings and mountain buildings.

[0076] In step 1.3, if the acquired data set is a small data set, the data volume is expanded by using a data augmentation strategy suitable for SAR buildings on the training set, including rotation, flipping, and random color adjustment, to obtain a data augmented training set.

[0077] In view of different complex scenes and different forms of data processing, this embodiment adopts a self-made complex scene building dataset SAR-Building1 and a public complex scene building dataset SAR-Building2.

[0078] For the SAR-Building1 dataset, since the original SAR-Building1 is a large-view image, according to step 1.2, the SAR-Building1 image is processed by performing label conversion, non-overlapping cropping and background removal. The mask comparison before and after label conversion is as follows: Figure 3 As shown, Figure 3 (a) shows the original multi-label sample data. Figure 3 (b) is the result after converting all non-building categories into one category. From the overall effect, we can see that the buildings in this scene are sparse and scattered, and the shapes of the buildings are extremely irregular. After processing, 199 256*256 data samples are generated. Figure 4 Two sample examples of small images are shown. According to step 1.3, the processed samples are small data sets, which are divided into training set and validation test set in a ratio of 8:2. Due to the small amount of sample data, according to step 1.3, the sample data of the training set is appropriately augmented and incorporated into the training set to expand the data volume. Figure 5 The sample effect comparison before and after data augmentation is shown. Figure 5 (a) is the original data image, Figure 5 (b)- Figure 5(d) shows the effect of single-polarization SAR image after flipping, rotation and color adjustment.

[0079] The SAR-Building2 dataset contains building types in 15 provinces or cities in China, mainly involving urban buildings, mountainous buildings and other types. The scene complexity is extremely high, such as Figure 6 As shown in the figure, the SAR-Building2 dataset belongs to the binary label type of building / non-building category, and consists of 25,000 256*256 data samples. No additional processing is required according to step 1.2. Considering the diversity of data requirements, the training set, validation set, and test set all contain data samples from each province or city, and are divided into training set, validation set, and test set according to the ratio of 6:2:2 in step 1.3.

[0080] Step 2, performing data preprocessing on the single-polarization SAR image building dataset under complex scenes obtained in step 1 to obtain an iterative single-polarization SAR image building dataset under complex scenes, wherein the iterative single-polarization SAR image building dataset under complex scenes includes a training set, a validation set and a test set or a training set and a validation test set;

[0081] The specific method of step 2 is:

[0082] Step 2.1, encoding the single-polarization SAR image building dataset including a training set, a validation set and a test set or a training set and a validation test set obtained in step 1 into MindRecord type data suitable for the MindSpore framework;

[0083] Step 2.2, calculate the mean and variance of the training set samples of the single-polarization SAR image building dataset obtained in step 1, decode the MindRecord type data obtained in step 2.1, use the mean and variance to standardize all set samples, and then perform dimension expansion, random shuffling and batch processing operations. During batch processing, if the last batch of samples in the training set is less than the batch size, the last batch of samples will be discarded; if the last batch of samples in the test set and the validation test set are less than the batch size, the last batch of samples will not be discarded; obtain an iterative single-polarization SAR image building dataset in complex scenarios containing a training set, a validation set and a test set or a training set and a validation test set.

[0084] In this embodiment, according to step 2, data preprocessing is performed on the SAR-Building1 dataset and the SAR-Building2 dataset, including converting the dataset into MindRecord type data suitable for the MindSpore framework, calculating the mean and variance of the training set for standardization, dimension expansion, random shuffling and batch processing operations to form an iterative single-polarization SAR building dataset. Table 1 records the mean and variance of the SAR-Building1-DB dataset before data augmentation, the SAR-Building1 dataset after data augmentation, and the SAR-Building2 dataset.

[0085] Table 1 Mean and variance of SAR image dataset

[0086]

[0087]

[0088] Step 3, construct the encoder E-decoder network model, the encoder E-decoder D network model includes a hybrid attention encoder block FAE, a multi-scale attention residual decoder module MAD and a convolution layer LC; the encoder E is used to extract the feature information of buildings in the SAR image, and gradually reduce the size of the feature map and gradually expand the number of channels of the feature map to form high-level semantic information; the decoder D gradually restores the size and resolution of the original image through feature alignment and superposition fusion; the convolution layer LC is used to output the predicted logical value;

[0089] The specific method of step 3 is:

[0090] Step 3.1, construct encoder E, encoder E adopts a layered architecture, and each layer uses a hybrid attention encoder block FAE;

[0091] The hybrid attention encoder block FAE includes 2 attention weighted convolution structures and 1 hybrid attention structure. Each attention weighted convolution structure consists of a 3*3 convolution layer, a batch normalization layer, a weighted attention layer, and a ReLU activation function. The weighted attention layer contains spatial attention and channel attention; 3*3 convolution layer and ReLU activation function are used to extract features and add nonlinear transformations. The weighted attention layer weights the features to emphasize important features and suppress unimportant features. The hybrid attention structure consists of two types of attention in parallel: weighted attention and spatial attention.

[0092] The iterative single-polarization SAR image building dataset in complex scenes obtained in step 2 is input into the hybrid attention encoder block FAE, and the features are obtained through two attention weighted convolution structures. Will Input the weighted attention and spatial attention of the hybrid attention structure respectively to obtain and and Add the elements to get F E1 , F E2 ...F E5 And so on;

[0093] Step 3.2, construct a decoder D. The decoder D adopts a layered architecture, and each layer uses a multi-scale attention residual decoder module MAD; the multi-scale attention residual decoder module MAD is a feature-aware fusion structure composed of feature alignment and concatenation of different scales, channel attention, convolution operation and residual connection;

[0094] In the multi-scale attention residual decoder module MAD, the basic fusion feature F is first obtained by aligning and concatenating features of different scales. fi , i = 4, 3…1, and then use channel attention to learn the basic fusion feature F fi The global information of the basic fusion feature F fi Perform weighted processing and convolution operations to obtain high-level attention features F h ; Among them, the convolution operation includes a 3*3 convolution layer, batch normalization and ReLU activation function, and the number of channels N remains unchanged; finally, the basic fusion feature F fi With the high-level attention feature F h Residual connection obtains feature F Di , i=4,3…1;

[0095] Step 3.3, construct the convolution layer LC. The convolution layer LC consists of a 3*3 convolution layer. This layer can be transformed from F D1 The most important features for the binary segmentation task are extracted and emphasized. The number of channels in the final output feature map is 1, corresponding to the final predicted logical value of the binary segmentation;

[0096] Step 3.4, use the five hybrid attention encoder blocks FAE constructed in step 3.1 and the four multi-scale attention residual decoder modules MAD established in step 3.2 to form a 5-layer basic encoder E-decoder D network structure, connect the convolution layer LC constructed in step 3.3 behind the last multi-scale attention residual decoder module MAD, and construct a complete encoder E-decoder D network structure for outputting a predicted logical value consistent with the input image size; the encoder E stage after five hybrid attention encoder blocks FAE has a feature map channel number of [16, 32, 64, 128, 256], and the feature map size scaling ratio between each layer is [1 / 2, 1 / 4, 1 / 8, 1 / 16]; the feature map output by the last hybrid attention encoder block FAE and the first three multi-scale attention residual decoder modules MAD is upsampled layer by layer, and the feature map size is doubled. The feature map output by the fourth multi-scale attention residual decoder module MAD is consistent with the size of the input sample, and finally the number of channels is adjusted through the convolution layer LC to be consistent with the input sample.

[0097] The specific steps of aligning and splicing features of different scales in step 3.2 are as follows:

[0098] Step 3.2.1, obtain basic features of different scales, where the basic features of different scales input to the multi-scale attention residual decoder block MAD are partly derived from the features F output by the hybrid attention encoder block FAE at the same layer and below the same layer Ei , i = 1, 2…5, and the other part comes from the feature F output by the multi-scale attention residual decoder block MAD above this layer Di , i=4,3…1;

[0099] Step 3.2.2, perform up- and down-sampling and convolution operations on the basic features of different scales obtained in step 3.2.1 to achieve the alignment effect; the convolution operation uses a 3*3 convolution layer, batch normalization and ReLU activation function to convert the number of channels to the same number N; feature F E1 , F E2 …F E4 After the maximum pooling operation, it is reduced to the size of the corresponding level of the decoder, and then the convolution operation is performed to form features Achieve scale alignment effect; Feature F E5 , F D4 , F D3 …F D1 After bilinear interpolation, it is expanded to the size of the corresponding level of the decoder, and the features are formed after the convolution operation. The scale alignment effect is achieved. The scale-aligned features are concatenated to obtain the basic fusion feature F fi The basic fusion features F at different layers fiThe calculation formula is as follows:

[0100]

[0101] Among them, F fi represents the basic fusion features in the i-th layer multi-scale attention residual decoder block MAD, Indicates from arrive Perform convolution operation, Express Perform convolution operation, Indicates from arrive The convolution operation of , ⊕ represents the feature cascade concatenation operation.

[0102] In this example, the input data sample size is [N, 1, 256, 256], where N is the number of samples in the batch. After passing through the encoder E, the feature size is [N, 256, 16, 16]; after passing through the decoder D and the convolutional layer FC, the feature is reshaped to [N, 1, 256, 256]. The overall structure of the hybrid attention encoder block FAE in step 3.1 is shown below. Figure 7 As shown in (a), the overall structure effect of the multi-scale attention residual decoder module MAD in step 3.2 is as follows Figure 7 (b) as shown.

[0103] Step 4, inputting the training set and the validation set or the validation test set in the iterative complex scene single-polarization SAR image building data set obtained in step 2 into the encoder E-decoder D network model constructed in step 3 for training and validation until the training termination condition is met, thereby obtaining a trained encoder E-decoder D network model;

[0104] Within the set maximum number of training times, observe the training situation until the requirements are met; the maximum number of training times set in this embodiment is 600 times. During training, the initial learning rate is 0.01, β 1 is 0.9, β 2 The Adam optimizer is 0.999.

[0105] The specific process of training in step 4 includes:

[0106] Step 4.1, input the training set data in the iterative complex scene single-polarization SAR image building data set obtained in step 2 into the encoder E-decoder D network model constructed in step 3, obtain the model prediction logic value, and use the Sigmoid operator to convert the model prediction logic value into a prediction probability value, and use the prediction probability value and the label corresponding to the training set sample obtained in step 2 to calculate the network loss L;

[0107] Step 4.2, update the learnable parameters of the hybrid attention encoder block FAE, the multi-scale attention residual decoder block MAD, and the convolutional layer LC according to the network loss L;

[0108] Step 4.3, repeat steps 4.1 and 4.2, and use the training set obtained in step 2 and the validation set or validation test set obtained in step 2 to monitor the training process until the training termination condition is met.

[0109] Step 4.4, according to the monitoring process of the training set and the validation set or the validation test set in step 4.3, adjust the training process and hyperparameters to obtain the trained encoder E-decoder D network model.

[0110] The network loss L in step 4.1 includes the binary cross entropy loss L BCE and soft Dice loss L SD , as follows:

[0111] Binary cross entropy loss L BCE :

[0112]

[0113] Where N is the number of samples, y i is the true label (0 or 1) of the i-th sample, p i is the probability that the i-th sample predicted by the model is a positive class, and log represents the natural logarithm;

[0114] Soft Dice loss L SD :

[0115]

[0116] Where N is the number of samples, y i is the true label (0 or 1) of the i-th sample, p i is the segmentation probability of the i-th sample predicted by the model;

[0117] Total network loss L:

[0118] L=αK BCE +βL SD

[0119] Among them, α and β are the binary cross entropy losses L BCE and soft Dice loss L SD The combination coefficient of is two constants.

[0120] The optimization goal of this embodiment is to minimize the total network loss L between the category score output by the model and the actual category, where the binary cross entropy loss L BCE and soft Dice loss L SDThe constant coefficients are 0.5 and 1.

[0121] Step 5, input the iterative test set or verification test set obtained in step 2 into the trained encoder E-decoder D network model obtained in step 4 to verify the effect. The test set or verification test set does not use any data augmentation operation to obtain the predicted probability value, and calculate the building category evaluation index and the overall evaluation index according to the predicted probability value and the corresponding single-polarization SAR building label to evaluate the network performance. By setting the set threshold and visualizing it, a prediction result graph is obtained.

[0122] In this implementation, the threshold is set to 0.5 when predicting the final result graph. At the same time, the calculation indicators in the present invention include precision, recall, F1 Score, Soft Dice coefficient, overall accuracy OA, Kappa coefficient, intersection over union (IoU), average intersection over union (MIoU), and frequency-weighted intersection over union (FWIoU).

[0123] The effect of the present invention is further described below in conjunction with simulation experiments.

[0124] 1. Simulation experiment conditions:

[0125] The hardware test platform of the simulation experiment of the present invention is: CPU 48 cores 192G; graphics card is Ascend 910PremiumA32G;

[0126] The software platform of the simulation experiment of the present invention is: operating system: EulerOS2.8.3 (SP8); MindSpore version: MindSpore 2.1.0; online platform: ModelArts; Notebook integrated development environment, Python3.7.10; hardware platform: Ascend 910;

[0127] Experimental method: Building extraction method for single-polarization SAR images of complex scenes.

[0128] 2. Simulation content and results:

[0129] Figure 3 It is a comparison diagram of the SAR-Building1 dataset before and after label conversion in an embodiment of the present invention.

[0130] Figure 4 It is a partial single-polarization SAR building image of the SAR-Building1 data set in the embodiment of the present invention.

[0131] Figure 5 It is a comparison chart of data enhancement of the SAR-Building1 dataset in an embodiment of the present invention.

[0132] Figure 6 It is a comparison diagram of single-polarization SAR buildings in different regions of the SAR-Building2 data set in an embodiment of the present invention.

[0133] Figure 7 It is a structural diagram of the encoder block and decoder block of the present invention.

[0134] Figure 8 It is a comparison chart of some test set results of the SAR-Building1 data set in an embodiment of the present invention.

[0135] Fig. 9 It is a comparison chart of some test set results of the SAR-Building2 data set in an embodiment of the present invention.

[0136] The detailed parameters of the data used in the simulation experiment of the present invention are shown in Table 2 below.

[0137] Table 2 Dataset information table

[0138]

[0139] The SAR-Building1 dataset needs to convert the original multi-label data into binary labeled samples in the form of buildings / non-buildings. Figure 3 The mask comparison effect before and after label conversion is shown, where Figure 3 (a) shows the original multi-label sample data. Figure 3 (b) is the result after converting all non-building categories into one category. After non-overlapping cropping, the training set and validation test set are randomly divided into 8:2 ratios, with a total of 160 training sets and 39 validation test sets. Figure 4 The following are sample examples of two small images. Data augmentation operations are performed on the training set, including rotation (50% probability of 90-degree clockwise rotation, 50% probability of 90-degree counterclockwise rotation), flipping (50% probability of horizontal flipping, 50% probability of vertical flipping), and random color adjustment (adjusting brightness, contrast, and saturation within a certain range). The data augmentation effect is shown in Figure 2. Figure 5 As shown, Figure 5 The sample effect comparison before and after data augmentation is shown. Figure 5 (a) is the original data image, Figure 5 (b)- Figure 5 (d) shows the effect of flipping, rotating and color-adjusting single-polarization SAR images. The expanded training set contains 640 256*256 training sets. The SAR-Building2 dataset is randomly divided into training set: validation set: test set in a ratio of 6:2:2, with a total of 15,000 training sets, 5,000 validation sets and 5,000 test sets.

[0140] The model outputs the predicted logical value, performs Sigmoid operation on the predicted logical value, and converts the result into a predicted probability value between [0,1]. The confusion matrix is ​​calculated based on the predicted logical value and the true label. Based on the confusion matrix, the evaluation index is calculated. When visualizing, the predicted probability value is divided into labels according to the threshold of 0.5, and the pixels with probability values ​​greater than or equal to 0.5 are divided into building categories. The prediction result map is visualized according to the RGB value in Table 3. The specific category map is shown in Table 3.

[0141] Table 3 Category use case table

[0142]

[0143] The definitions of various evaluation indicators are as follows:

[0144] (1) Precision: The ratio of correctly predicted positives in each category to all positive predictions in that category. It is defined as follows:

[0145]

[0146] Among them, p ij It represents the number of samples whose true category is class j but predicted to be class i. N represents the number of categories, which is 2 in this simulation.

[0147] (2) Recall: The ratio of correctly predicted positive samples in each category to all positive samples in that category. It is defined as follows:

[0148]

[0149] Among them, p ji It represents the number of samples whose true category is category i but predicted to be category j, N represents the number of ground object categories, which is 2 in this simulation;

[0150] (3) F1 value: It is the harmonic mean of recall and precision and is defined as follows:

[0151]

[0152] Among them, F 1 represents the F1 Score value, R represents the recall rate, that is, the proportion of correctly predicted positive samples to all positive samples; P represents the precision rate, that is, the proportion of correctly predicted positive samples to all positive samples;

[0153] (4) Soft Dice coefficient: also known as Soft Dice or Soft Dice similarity. It is used to measure the similarity between the segmentation results predicted by the model and the true label, and is defined as follows:

[0154]

[0155] Among them, Pi represents the predicted segmentation result, g i Represents the true label result, N represents the number of pixels in the sample, and ε is a very small number used to avoid the denominator being zero;

[0156] (5) Overall accuracy OA: the ratio of correctly labeled pixels to total pixels, defined as follows:

[0157]

[0158] Among them, p ij represents the number of samples whose true category is category j but predicted to be category i, N represents the number of ground object categories, which is 2 in this simulation;

[0159] (6) Kappa coefficient: Penalizes the "bias" of the model to obtain a more fair model, defined as follows:

[0160]

[0161]

[0162] Among them, OA represents the overall accuracy, a i represents the number of true samples of the i-th category, b i represents the number of samples predicted to be of the i-th category, M is the total number of samples, and N represents the number of ground object categories, which is 2 in this simulation;

[0163] (7) Intersection over Union (IoU): The ratio of the intersection and union of each type of prediction result and the true value, defined as follows:

[0164]

[0165] Among them, i represents a positive example, j represents a negative example, and N represents the number of ground object categories, which is 2 in this simulation; p ii represents the total number of pixels whose true category is i and whose identification is category i; p ij represents the total number of pixels whose true category is j and whose identity is category i; p ji Indicates the total number of pixels whose true category is i and whose identity is category j;

[0166] (8) Mean Intersection over Union (MIoU): The average of the intersection and union ratios of each type of prediction result and the true value, defined as follows:

[0167]

[0168] Among them, p ij represents the number of samples whose true category is category j but predicted to be category i, N represents the number of ground object categories, which is 2 in this simulation;

[0169] (9) Frequency Weighted Intersection over Union (FWIoU): This is an improvement on MIoU. The weights are set according to the frequency of occurrence of the categories. The definition is as follows:

[0170]

[0171] Among them, pij represents the number of samples whose true category is category j but predicted to be category i, and N represents the number of ground object categories, which is 2 in this simulation;

[0172] The experimental results of the SAR-Building1 dataset are shown in Tables 4 and 5 below, where Model_1 is the method proposed in this paper, Model_2 is a relatively lightweight supervised algorithm using a convolutional neural network architecture as the segmentation network, and Model_3 is a U 2 Net model has superior segmentation performance in natural images. The experimental simulation comparison results of the SAR-Building1 dataset are shown in the figure. Figure 8 shown.

[0173] Table 4 Quantitative evaluation indicators on the SAR-Building1 validation test set

[0174]

[0175] Table 5 Overall quantitative evaluation index of the present invention on the SAR-Building1 verification test set

[0176] Evaluation indicators Method of the present invention OA 0.8812 Kappa 0.7037 MIoU 0.7474 FWf 0.7887

[0177] In view of the particularity of SAR data, data augmentation strategies may have negative effects. Therefore, Table 6 records the experimental evaluation index results of the SAR-Building1 dataset before and after data augmentation. Among them, Model_1 is the method proposed in this invention, combined with data augmentation, Model_1-DB also represents the method proposed in this invention, but does not use any data augmentation method, and Model_2 is a relatively lightweight supervised algorithm using a convolutional neural network architecture as the segmentation network.

[0178] Table 6 Comparison of quantitative evaluation indicators of data augmentation

[0179] Precision F1 value IoU SoftDice Model_1 0.8397 0.7855 0.6467 0.7450 Model_1–DB 0.7826 0.7807 0.6403 0.7351 Model_2 0.7858 0.7675 0.6228 0.7299

[0180] The experimental results of the SAR-Building2 dataset are shown in Tables 7 and 8 below, where Model_1 is the method proposed by the present invention, Model_2 is a relatively lightweight supervised algorithm using a convolutional neural network architecture as the segmentation network, and Model_4 is the classic segmentation model DeepLabV3+, whose main structure is the Resnet101 backbone network and the ASPP module, with a relatively medium number of parameters. Fig. 9 shown.

[0181] Table 7 Quantitative evaluation indicators on the SAR-Building2 test set

[0182]

[0183] Table 8 Overall quantitative evaluation index of the present invention on the SAR-Building2 test set

[0184] Evaluation indicators Method of the present invention OA 0.9491 Kappa 0.7550 MIoU 0.7942 FWf 0.9079

[0185] 3. Analysis of experimental results:

[0186] As for the results shown in Table 4, that is, the quantitative experimental effect of the present invention on the SAR-Building1 data set, when the parameters are similar (Model_1 and Model_2), the Model_1 of the present invention (core module structure as shown in Figure 7 As shown in the figure, the precision, IoU, Soft Dice and F1 value indicators all have the highest quantitative results. Among them, the precision of Model_1 is more than 4% higher than that of Model_2, and 9% higher than that of Model_3 with a larger number of parameters. The number of parameters of Model_1 and Model_3 differs by nearly 25 times, but the lightweight network structure of Model_1 of the present invention can better extract and characterize the building features in SAR images, thereby achieving better performance on the SAR-Building1 dataset. Table 5 shows the overall quantitative evaluation indicators of the present invention on the SAR-Building1 verification test set. Comparison of model prediction results of Model_1 and Model_2 Figure 8 As shown, Figure 8(a) and (d) are GT label images, (c) and (f) are visualization results of the predictions of the present invention. The key differences are circled in red. The prediction results of the present invention are more complete for the segmentation of building categories and have better overall effects. In Table 6, the experimental evaluation comparison results of the SAR-Building1 dataset with appropriate data augmentation operations show that the Model_1-DB model, which is not trained with such augmented data, has a significant decrease in Precision, F1 value, IoU, and Soft Dice indicators. The Model_1 model after data augmentation has an improvement of 5%-6% in Precision indicator compared to Model_2. This proves the effectiveness of this data augmentation method for the data and the experiment of the present invention.

[0187] As shown in the quantitative evaluation indicators on the SAR-Building2 test set in Table 7, the method of the present invention (Model_1) has similar parameters compared with the relatively lightweight supervised algorithm (Model_2) in this extremely complex scene data, but has achieved better performance in Precision, Recall, IoU and F1 value. The Precision and IoU of the building category in the method of the present invention have a performance improvement of about 3%-4%, which shows that the method of the present invention adopts a more effective feature extraction and representation method, thereby achieving better performance under similar parameter amounts. Although the classic segmentation model DeepLabV3+ (Model_4) has more parameters, and the parameter amounts of the two differ by 33 times, Model_4 differs by 3%-5% in Precision and IoU. In each quantitative indicator, Model_1 has achieved better performance, which shows the effectiveness and superiority of the method in the building segmentation task in complex scenes. Fig. 9 This is a comparison chart of building segmentation under the SAR-Building2 dataset. Fig. 9 (a) and (d) are GT label images, (c) and (f) are visualization results predicted by the present invention, which have more accurate recognition effects on building shapes in complex scenes, and reduce the over-segmentation of non-buildings into buildings and the omission of buildings. As for the indicators in Table 8, through the comparison of the overall quantitative evaluation indicators (OA, Kappa, MIoU, FWIoU), it can be found that the method of the present invention performs well in overall performance, has high accuracy and robustness, and can effectively extract and segment buildings in complex scenes.

[0188] Based on the analysis of the above simulation results, the building extraction method for single-polarization SAR images of complex scenes of the present invention shows obvious effectiveness in SAR image building segmentation under two different complex scene data sets. The present invention adopts a lightweight network structure designed for the characteristics of SAR images, combined with a hybrid attention mechanism, multi-level multi-scale feature cascade, residual connection, etc., which can effectively extract building features and improve the accuracy and robustness of building segmentation tasks, and has high practical value and promotion and application prospects.

[0189] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof; when it is implemented in whole or in part in the form of a computer program product, the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (e.g., infrared, wireless, microwave, etc.)). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0190] The above descriptions are merely embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the protection scope of the present invention.

Claims

1. A building extraction method for single-polarization SAR images of complex scenes, characterized by: The following steps are involved: Step 1, collecting single-polarization SAR remote sensing images, the single-polarization SAR remote sensing images include single-polarization SAR remote sensing images and corresponding pixel-level labels, constructing a single-polarization SAR image building dataset under complex scenes, and dividing the single-polarization SAR image building dataset into a training set, a validation set and a test set or a training set and a validation test set; Step 2, performing data preprocessing on the single-polarization SAR image building dataset under complex scenes obtained in step 1 to obtain an iterative single-polarization SAR image building dataset under complex scenes, wherein the iterative single-polarization SAR image building dataset under complex scenes includes a training set, a validation set and a test set or a training set and a validation test set; Step 3, construct an encoder E-decoder D network model, which includes a hybrid attention encoder block FAE, a multi-scale attention residual decoder module MAD and a convolution layer LC; the encoder E is used to extract the feature information of buildings in the SAR image, and gradually reduce the size of the feature map and gradually expand the number of channels of the feature map to form high-level semantic information; the decoder D gradually restores the size and resolution of the original image through feature alignment and superposition fusion; the convolution layer LC is used to output the predicted logical value; Step 4, input the iterative training set and validation set or validation test set obtained in step 2 into the encoder E-decoder D network model constructed in step 3 for training and validation until the training termination condition is met, thereby obtaining a trained encoder E-decoder D network model; Step 5, input the iterative test set or verification test set obtained in step 2 into the trained encoder E-decoder D network model obtained in step 4 to verify the effect, obtain the predicted probability value, calculate the building category evaluation index and the overall evaluation index according to the predicted probability value and the corresponding single-polarization SAR building label, evaluate the network performance, and obtain the prediction result graph by setting the set threshold and visualizing it.

2. The building extraction method for single-polarization SAR images of complex scenes according to claim 1, characterized in that: The specific method of step 1 is: Step 1.1, obtaining single-polarization SAR remote sensing images; Step 1.2, if the single-polarization SAR remote sensing image obtained in step 1.1 does not belong to the binary label type of the building / non-building category, then the single-polarization SAR remote sensing image obtained in step 1.1 is subjected to label conversion processing, the building category in the label is retained, and other categories and background categories are converted into non-building categories; if the single-polarization SAR remote sensing image obtained in step 1.1 belongs to the binary label type of the building / non-building category, no additional processing operation is required; If the binary label type SAR image data is a large scene image, it is cropped into small-scale images of A*A without overlapping, and the data without buildings that are all background or the erroneous data with abnormal labels are eliminated to obtain the SAR image building data set; Step 1.3, the SAR image building dataset obtained in step 1.2 is formed into a SAR image building dataset under complex scenes according to the complexity of the image. If the dataset is a small dataset, the SAR image building dataset under complex scenes is divided into a training set and a validation test set; if the dataset is a medium or large dataset, the SAR image building dataset under complex scenes is divided into a training set, a validation set, and a test set.

3. The building extraction method for single-polarization SAR images of complex scenes according to claim 1, characterized in that: The specific method of step 2 is: Step 2.1, encoding the single-polarization SAR image building dataset including a training set, a validation set and a test set or a training set and a validation test set obtained in step 1 into MindRecord type data suitable for the MindSpore framework; Step 2.2, calculate the mean and variance of the training set of the single-polarization SAR image building dataset obtained in step 1, decode the MindRecord type data obtained in step 2.1, use the mean and variance to perform standardization operations, and then perform dimensionality expansion, random shuffling and batch processing operations to obtain an iterative single-polarization SAR image building dataset in complex scenarios containing a training set, a validation set and a test set or a training set and a validation test set.

4. The building extraction method for single-polarization SAR images of complex scenes according to claim 1, characterized in that: The specific method of step 3 is: Step 3.1, construct encoder E, encoder E adopts a layered architecture, and each layer uses a hybrid attention encoder block FAE; The hybrid attention encoder block FAE includes 2 attention weighted convolution structures and 1 hybrid attention structure. Each attention weighted convolution structure consists of a 3*3 convolution layer, a batch normalization layer, a weighted attention layer and a ReLU activation function. The weighted attention layer includes spatial attention and channel attention. 3*3 convolutional layer and ReLU activation function are used to extract features and add nonlinear transformation; The weighted attention layer weights the features to emphasize important features and suppress unimportant features; the hybrid attention structure consists of two types of attention: weighted attention and spatial attention in parallel; The iterative single-polarization SAR image building dataset in complex scenes obtained in step 2 is input into the hybrid attention encoder block FAE, and the features are obtained through two attention weighted convolution structures. Will Input the weighted attention and spatial attention of the hybrid attention structure respectively to obtain and and Add the elements to get F E1 , F E2 ...F E5 And so on; Step 3.2, construct a decoder D. The decoder D adopts a layered architecture, and each layer uses a multi-scale attention residual decoder module MAD; the multi-scale attention residual decoder module MAD is a feature-aware fusion structure composed of feature alignment and concatenation of different scales, channel attention, convolution operation and residual connection; In the multi-scale attention residual decoder module MAD, the basic fusion feature F is first obtained by aligning and concatenating features of different scales. fi , i = 4, 3…1, and then use channel attention to learn the basic fusion feature F fi The global information of the basic fusion feature F fi Perform weighted processing and convolution operations to obtain high-level attention features F h ; The convolution operation includes a 3*3 convolution layer, batch normalization and ReLU activation function, and the number of channels N remains unchanged; finally, the basic fusion feature F fi With the high-level attention feature F h Residual connection obtains feature F Di , i=4,3…1; Step 3.3, construct the convolution layer LC. The convolution layer LC consists of a 3*3 convolution layer. This layer can be transformed from F D1 The most important features for the binary segmentation task are extracted and emphasized; the number of channels in the final output feature map is 1, corresponding to the final predicted logical value of the binary segmentation; Step 3.4, use the five hybrid attention encoder blocks FAE constructed in step 3.1 and the four multi-scale attention residual decoder modules MAD established in step 3.2 to form a 5-layer basic encoder E-decoder D network structure, connect the convolution layer LC constructed in step 3.3 behind the last multi-scale attention residual decoder module MAD, and construct a complete encoder E-decoder D network structure for outputting a predicted logical value consistent with the input image size; the encoder E stage after five hybrid attention encoder blocks FAE has a feature map channel number of [16, 32, 64, 128, 256], and the feature map size scaling ratio between each layer is [1 / 2, 1 / 4, 1 / 8, 1 / 16]; the feature map output by the last hybrid attention encoder block FAE and the first three multi-scale attention residual decoder modules MAD is upsampled layer by layer, and the feature map size is doubled. The feature map output by the fourth multi-scale attention residual decoder module MAD is consistent with the size of the input sample, and finally the number of channels is adjusted through the convolution layer LC to be consistent with the input sample.

5. The building extraction method for single-polarization SAR images of complex scenes according to claim 1, characterized in that: The specific process of training in step 4 includes: Step 4.1, input the training set in the iterative complex scene single-polarization SAR image building data set obtained in step 2 into the encoder E-decoder D network model constructed in step 3, obtain the model prediction logic value, and use the Sigmoid operator to convert the model prediction logic value into a prediction probability value, and use the prediction probability value and the label corresponding to the training set obtained in step 2 to calculate the network loss L; Step 4.2, update the learnable parameters of the hybrid attention encoder block FAE, the multi-scale attention residual decoder block MAD, and the convolutional layer LC according to the network loss L; Step 4.3, repeat steps 4.1 and 4.2, and use the training set obtained in step 2 and the validation set or validation test set obtained in step 2 to monitor the training process until the training termination condition is met; Step 4.4, according to the monitoring process of the training set and the validation set or the validation test set in step 4.3, adjust the training process and hyperparameters to obtain the trained encoder E-decoder D network model.

6. The building extraction method for single-polarization SAR images of complex scenes according to claim 2, characterized in that: The image complexity in step 1.3 includes but is not limited to the following situations: buildings are sparse and scattered; Irregular and cluttered building shapes; a small number of building data samples; mixed building types; building data involving various types of buildings, including urban buildings and mountainous buildings.

7. The method for extracting buildings from single-polarization SAR images for complex scenes according to claim 2, characterized in that: In step 1.3, if the acquired data set is a small data set, the data volume is expanded by using a data augmentation strategy suitable for SAR buildings on the training set, including rotation, flipping, and random color adjustment, to obtain a data augmented training set.

8. The method for extracting buildings from single-polarization SAR images for complex scenes according to claim 3, characterized in that: In the step 2.2, during the batch operation, if the last batch of samples in the training set is less than the batch size, the last batch of samples is discarded; if the last batch of samples in the test set and the validation test set is less than the batch size, the last batch of samples is not discarded.

9. The method for extracting buildings from single-polarization SAR images for complex scenes according to claim 4, characterized in that: The specific steps of aligning and splicing features of different scales in step 3.2 are as follows: Step 3.2.1, obtain basic features of different scales, where the basic features of different scales input to the multi-scale attention residual decoder block MAD are partly derived from the features F output by the hybrid attention encoder block FAE at the same layer and below the same layer Ei , i = 1, 2…5, and the other part comes from the feature F output by the multi-scale attention residual decoder block MAD above this layer Di , i=4,3…1; Step 3.2.2, perform up- and down-sampling and convolution operations on the basic features of different scales obtained in step 3.2.1 to achieve the alignment effect; the convolution operation uses a 3*3 convolution layer, batch normalization and ReLU activation function to convert the number of channels to the same number N; feature F E1 , F E2 …F E4 After the maximum pooling operation, it is reduced to the size of the corresponding level of the decoder, and then the convolution operation is performed to form features Achieve scale alignment effect; Feature F E5 , F D4 , F D3 …F D1 After bilinear interpolation, it is expanded to the size of the corresponding level of the decoder, and the features are formed after the convolution operation. Achieve the effect of scale alignment; the scale-aligned features are cascaded and spliced ​​to obtain the basic fusion feature F fi ; Basic fusion features F at different layers fi The calculation formula is as follows: Among them, F fi represents the basic fusion features in the i-th layer multi-scale attention residual decoder block MAD, Indicates from arrive Perform convolution operation, Express Perform convolution operation, Indicates from arrive The convolution operation, Represents a feature cascade concatenation operation.

10. The method for extracting buildings from single-polarization SAR images for complex scenes according to claim 5, characterized in that: The network loss L in step 4.1 includes the binary cross entropy loss L BCE and soft Dice loss L SD , as follows: Binary cross entropy loss L BCE : Where N is the number of samples, y i is the true label (0 or 1) of the i-th sample, p i is the probability that the i-th sample predicted by the model is a positive class, and log represents the natural logarithm; Soft Dice loss L SD : Where N is the number of samples, y i is the true label (0 or 1) of the i-th sample, p i is the segmentation probability of the i-th sample predicted by the model; Total network loss L: L=αL BCE +βL SD Among them, α and β are the binary cross entropy losses L BCE and soft Dice loss L SD The combination coefficient of is two constants.

Citation Information

Patent Citations

  • Polarimetric SAR building area extraction method, equipment and medium

    CN114332636A

  • Novel texture feature SAR building earthquake damage estimation method

    CN115797768A