A weakly supervised SAR image water semantic segmentation method, system, device and medium based on a color matching CAM model

By combining a color-matching CAM model with non-water body target consistency loss, and utilizing the consistent color features of water bodies in SAR images, high-quality pixel-level pseudo-labels are generated, solving the problems of high cost and low accuracy in existing technologies and achieving efficient water body semantic segmentation.

CN118097148BActive Publication Date: 2026-11-20SHAANXI YUANYI INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410315272.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2026-11-20
Estimated Expiration
2044-03-19

AI Technical Summary

Technical Problem

Existing SAR image water semantic segmentation methods require a large amount of manual annotation and fail to effectively utilize the consistent color features of water bodies, resulting in low segmentation accuracy and inter-class confusion issues.

Method used

We employ a weakly supervised method based on a color matching CAM model. We train a water body binary classification model and a segmentation model using image-level labels, generate pixel-level pseudo-labels using water body color features, and combine non-water body target consistency loss to reduce inter-class confusion and improve segmentation accuracy.

Benefits of technology

It achieves high-precision pixel-level semantic segmentation of water bodies using only image-level labels, reducing annotation costs and improving the accuracy and efficiency of water body segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118097148B_ABST
    Figure CN118097148B_ABST
Patent Text Reader

Abstract

A weakly supervised SAR image water semantic segmentation method, system, device and medium based on a color matching CAM model, the method comprising: collecting SAR image data sets, setting water binary classification image level labels for the training set; training a water binary classification model; inputting the data set into the feature encoding module of the trained water binary classification model to obtain a water feature set F; inputting the water feature set F and the data set into a color matching CAM model to obtain a water class activation map set M; obtaining a pixel level water pseudo label set P through a threshold method; training a water segmentation model using the pixel level water pseudo label set P and the data set until the training termination condition is met to obtain a trained water segmentation model; inputting the data set into the trained water segmentation model to obtain a water pixel level segmentation result; the system, device and medium are used to implement the method; the application has the advantages of low labeling cost and high segmentation precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of SAR image segmentation technology, specifically relating to a method, system, device, and medium for semantic segmentation of water bodies in weakly supervised SAR images based on a color matching CAM model. Background Technology

[0002] Synthetic Aperture Radar (SAR) uses the synthetic aperture principle of radar to create images. It is an important technology in the field of remote sensing. It can perform all-day, all-weather remote sensing observations of the earth and has a wide range of applications in disaster prevention and control, land planning and many other areas.

[0003] Semantic segmentation of water bodies in SAR imagery aims to extract water body regions from images pixel by pixel, which can be used for water monitoring, flood control, and water area analysis. Water bodies are typically homogeneous planar areas with low backscattering coefficients and weak radar echoes, so they usually appear dark in SAR images. Unlike passive optical remote sensing images, SAR images acquired through active microwave imaging exhibit more consistent color characteristics of water bodies.

[0004] Existing remote sensing water semantic segmentation methods are typically based on optical remote sensing imagery, which is easier to acquire and process. However, the complex and varied color characteristics of water bodies in optical remote sensing imagery make water extraction extremely difficult. SAR imagery-based water semantic segmentation can naturally solve this problem; however, existing techniques usually require extensive manual annotation and do not consider the consistent color characteristics of water bodies in SAR imagery, thus limiting the performance of SAR imagery water semantic segmentation.

[0005] Existing deep learning-based methods typically require pixel-level water body annotations when training SAR water semantic segmentation models, which is usually very resource-intensive. Weakly supervised methods based on class activation maps (CAMs) can solve this problem, as they can train a pixel-level SAR water semantic segmentation model using only less expensive image-level water body annotations. However, existing methods do not consider the consistent color features of water bodies, resulting in low water segmentation accuracy. Furthermore, because the features of targets such as roads and building shadows in SAR imagery are very similar to those of water bodies, existing methods often suffer from inter-class confusion, leading to low water segmentation accuracy.

[0006] Patent application CN113743383A discloses a method, apparatus, electronic device, and storage medium for water body extraction from SAR images. This method utilizes a DeepLabv3+ semantic segmentation model with an added dual-attention mechanism, trained using a sample set containing SAR images and DEM data, to improve the accuracy and efficiency of water body segmentation in SAR images. However, a drawback of this method is that training the DeepLabv3+-based segmentation model requires a large amount of manually labeled data, resulting in high costs. While adding a dual-attention mechanism can better improve the extraction performance of water body features, it does not consider the unique color characteristics of water in SAR images, leading to inter-class confusion issues.

[0007] Patent application CN116129430A discloses an adaptive environmental water level identification method, apparatus, and device. This method annotates acquired water level monitoring images of various aquatic environments to construct a large dataset, and then builds multiple water body segmentation models. During SAR image segmentation, a target category self-selection model is used to choose a suitable segmentation model, utilizing an adaptive model to improve segmentation accuracy. However, this method has drawbacks: constructing the large dataset requires extensive pixel-level annotation, resulting in high manual costs. Furthermore, training multiple models is cumbersome, and inference efficiency is low. Summary of the Invention

[0008] To overcome the shortcomings of the prior art, the present invention aims to provide a weakly supervised SAR image water semantic segmentation method, system, device, and medium based on a color matching CAM model. Pixel-level semantic segmentation can be achieved using only image-level labels of water bodies. A water body category activation map is obtained through a color matching CAM model and non-water body target consistency loss. Weakly supervised learning is then performed using the water body category activation map, reducing the model's dependence on pixel-level data annotation and improving the accuracy and efficiency of SAR image water segmentation.

[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0010] A weakly supervised SAR image semantic segmentation method based on a color matching CAM model includes the following steps:

[0011] Step 1: Acquire SAR images, crop the SAR images to obtain image patches, use the image patches as samples to form a dataset, randomly select a portion of the dataset as a training set, and set water body binary classification image-level labels for the training set data.

[0012] Step 2: Construct a water body binary classification model. The water body binary classification model includes a feature encoding module and a classification module. Input the training set data from the dataset in Step 1 into the feature encoding module to obtain intermediate feature maps f1, f2, f3, and f4. Input the intermediate feature map f4 into the classification module to obtain the predicted binary classification result. Based on the predicted binary classification result, the water body binary classification image-level labels set in Step 1, and the intermediate feature map f2, train the water body binary classification model until the training termination condition is met to obtain the trained water body binary classification model.

[0013] Step 3: Input the dataset from Step 1 into the feature encoding module of the water body binary classification model trained in Step 2 to obtain the water body feature set F;

[0014] Step 4: Construct a color matching CAM model. Input the water feature set F obtained in Step 3 and the dataset collected in Step 1 into the color matching CAM model to obtain the water category activation map set M.

[0015] Step 5: Using the water body category activation map set M obtained in Step 4, obtain the pixel-level water body pseudo-label set P by using the thresholding method;

[0016] Step 6: Select a water body segmentation model, and train the water body segmentation model using the pixel-level water body pseudo-label set P obtained in Step 5 and the dataset collected in Step 1 until the training termination condition is met, and obtain the trained water body segmentation model.

[0017] Step 7: Input the dataset collected in Step 1 into the water segmentation model trained in Step 6 to obtain the final pixel-level water segmentation result.

[0018] The feature encoding module in step 2 is used to encode the features of the input SAR image blocks to obtain intermediate feature maps f1, f2, f3, and f4 at different scales. The feature encoding module is composed of a ResNet101 backbone network, which consists of 33 bottleneck blocks. Each bottleneck block consists of two 1×1 convolutional layers and one 3×3 convolutional layer. The intermediate feature maps f1, f2, f3, and f4 are respectively derived from the output results of the 3rd, 7th, 30th, and 33rd bottleneck blocks of the feature encoding module. The feature encoding module extracts different depth features of the SAR image to mine spatial and semantic information in the image.

[0019] Classification module: Used to output the final binary classification result, it consists of two MLP layers;

[0020] The specific training process of the water body binary classification model is as follows:

[0021] Step 2.1: Calculate the loss L based on the predicted binary classification result, the set binary classification labels, and the intermediate feature map f2;

[0022] The loss L includes the water body binary classification loss L. cls Consistency loss of non-aquatic targets L ntc The details are as follows:

[0023] L = L cls +αL ntc

[0024] Where α is the loss weight, the water body binary classification loss and the target consistency loss are as follows:

[0025] Water body two-classification loss L cls :

[0026]

[0027] Among them, y i s represents the true label set for the i-th class. i This represents the prediction result for the i-th class;

[0028] Non-aquatic target consistency loss L ntc :

[0029]

[0030] Where B represents the number of data points in a batch during training, b represents the b-th data point in the current batch, Gate(·) represents a gate function, MSE(·) represents the MSE function, and y represents the set true label; the gate function and MSE function are as follows:

[0031] Gate function:

[0032]

[0033] MSE function:

[0034]

[0035] Step 2.2: Update the parameters of the water body binary classification model based on the loss L;

[0036] Step 2.3: Repeat steps 2.1 and 2.2 until the training termination condition is met, then proceed to step 2.4;

[0037] Step 2.4 yields the trained water body binary classification model.

[0038] The water feature set F in step 3 includes the features obtained from the dataset collected in step 1 through the feature encoding module in step 2, specifically represented as follows:

[0039]

[0040] Where N represents the total number of SAR image patches in the dataset acquired in step 1.

[0041] The color matching CAM model in step 4 consists of a water body color matching weight generation module, a color matching activation map generation module, and a maximized activation map module. The water body color matching weight generation module generates water body color matching weights W; the color matching activation map generation module generates a multi-level category activation map set M' for water bodies; and the maximized activation map module generates a category activation map set M for water bodies. The specific process for obtaining the category activation map set M is as follows:

[0042] Step 4.1: Invert the dataset collected in Step 1, denoted as set I, to obtain I'. For an element i in set I, the specific calculation process for inverting i' is as follows:

[0043] i' x,y =255-i x,y

[0044] Among them, i x,y This represents the pixel value at coordinate (x, y) of position i.

[0045] Step 4.2: Normalize I' obtained in Step 4.1, and then perform interpolation at four different scales. The interpolation scales correspond to the water feature set F. The size of the feature is used to obtain the color matching weight set W;

[0046] Step 4.3: Perform a dot product between each element in the color matching weight set W obtained in step 4.2 and the corresponding element in the water feature set F obtained in step 3 to obtain the color correction feature set F'.

[0047] Step 4.4: Using the GradCAM method, the color correction feature set F' obtained in step 4.3 is converted into a water body multi-level category activation map set M';

[0048] Step 4.5: Take the maximum pixel value of the water body multi-level category activation map set M' obtained in step 4.4 to obtain the water body category activation map set M.

[0049] Each element p in the pixel-level water body pseudo-label set P obtained in step 5 is a pixel-level semantic label for the corresponding SAR image patch;

[0050] The specific process of the threshold method is as follows: Each pixel in each category activation map m in the water body category activation map set M is converted to 0 or 1 by a threshold. The converted set is P. The specific calculation method of the threshold is as follows:

[0051]

[0052] Where θ represents the threshold and the subscript (x,y) represents the coordinates of the pixel value.

[0053] The water segmentation model selected in step 6 is either the DeepLabV3+ model, the Segformer model, or the U-Net model.

[0054] The specific training process of the water segmentation model in step 6 is as follows:

[0055] Step 6.1: Input the dataset collected in Step 1 into the selected water body segmentation model to obtain pixel-level water body segmentation results;

[0056] Step 6.2: Calculate the cross-entropy loss L using the pixel-level water body segmentation results from Step 6.1 and the corresponding pseudo-label p from the pixel-level water body pseudo-label set P from Step 5. cro The specific calculations are as follows:

[0057]

[0058] Where, p i Let s represent the i-th type of pseudo-label. i This represents the prediction result for the i-th class;

[0059] Step 6.3, using the cross-entropy loss L calculated in step 6.2. cro Update the parameters of the water segmentation model, and repeat steps 6.1 and 6.2 until the training termination condition is met, and obtain the trained water segmentation model.

[0060] This invention also provides a weakly supervised SAR image water semantic segmentation system based on a color matching CAM model, comprising:

[0061] The dataset processing module is used to acquire SAR images, crop the SAR images to obtain image patches, use the image patches as samples to form a dataset, randomly select a portion of the dataset as a training set, and set water body binary classification image-level labels for the training set data.

[0062] The water body binary classification model training module is used to construct a water body binary classification model. The water body binary classification model includes a feature encoding module and a classification module. The training set data is input into the feature encoding module to obtain intermediate feature maps f1, f2, f3, and f4. The intermediate feature map f4 is input into the classification module to obtain the predicted binary classification result. Based on the predicted binary classification result, the set water body binary classification image-level labels, and the intermediate feature map f2, the water body binary classification model is trained until the training termination condition is met, resulting in a trained water body binary classification model.

[0063] The water feature set F acquisition module is used to input the collected dataset into the feature encoding module of the trained water binary classification model to obtain the water feature set F;

[0064] The module for obtaining the water body category activation map set M is used to construct the color matching CAM model. The obtained water body feature set F and the collected dataset are input into the color matching CAM model to obtain the water body category activation map set M.

[0065] The pixel-level water body pseudo-label set P acquisition module is used to obtain the pixel-level water body pseudo-label set P by using the obtained water body category activation map set M and the threshold method.

[0066] The water segmentation model training module is used to select a water segmentation model, and train the water segmentation model using the obtained pixel-level water pseudo-label set P and the collected dataset until the training termination condition is met, thus obtaining a trained water segmentation model.

[0067] The water body pixel-level segmentation result acquisition module is used to input the collected dataset into the trained water body segmentation model to obtain the final water body pixel-level segmentation result.

[0068] This invention also provides a water body semantic segmentation device based on a color-matching CAM model for weakly supervised SAR images, comprising:

[0069] Memory: A computer program that stores the above-mentioned weakly supervised SAR image water semantic segmentation method based on color matching CAM model, and is a computer-readable device;

[0070] Processor: Used to implement the described weakly supervised SAR image water semantic segmentation method based on color matching CAM model when executing the computer program.

[0071] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the aforementioned method for semantic segmentation of water bodies in weakly supervised SAR images based on a color matching CAM model.

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

[0073] First, Fa Benming designed a weakly supervised water body semantic segmentation method based on a color matching CAM model for SAR images. This method can achieve pixel-level semantic segmentation using only the image-level labels of the water body, solving the problem that existing solutions require a lot of manpower and resources for pixel-level annotation. This reduces annotation costs while also achieving high water body segmentation accuracy.

[0074] Second, this invention designs a color matching CAM model, which can use the consistent color features of water bodies in SAR images to correct the multi-level features extracted by the feature extraction network, and use the corrected multi-level features to generate accurate and complete water body CAMs, ultimately generating high-quality pixel-level pseudo-labels for water bodies, enabling the water body segmentation model to better learn water body features and improve the accuracy of water body segmentation.

[0075] Third, this invention designs a non-water body target consistency loss, which can reduce inter-class confusion and increase intra-class consistency of water body targets when training a water body binary classification model, thereby improving the water body feature capture performance of the water body binary classification model to generate more accurate CAMs and pseudo-labels, ultimately reducing misclassification of the water body segmentation model and improving water body segmentation performance.

[0076] In summary, this invention designs a weakly supervised SAR image water semantic segmentation method based on a color matching CAM model, which can achieve high-precision pixel-level semantic segmentation of SAR images using only image-level labels, and has the advantages of low labeling cost and high segmentation accuracy. Attached Figure Description

[0077] Figure 1 This is a flowchart illustrating the implementation of the present invention.

[0078] Figure 2 These are the original SAR image maps of various regions used in the experiments of this invention; among them, Figure 2 (a) is the original SAR image of the Pohang area in South Korea. Figure 2 (b) is the original SAR image of Dongying City, China. Figure 2 (c) is the original SAR image of Xi'an City.

[0079] Figure 3 This is a comparison chart between the category activation map generated using the method of this invention and the category activation map generated using the original CAM method; wherein, Figure 3 (a) is the original image of the image patch. Figure 3 (b) is the actual label image. Figure 3 (c) is the category activation map generated by the CAM method. Figure 3 (d) is the category activation map generated by the method of the present invention.

[0080] Figure 4 This is a comparison diagram between the water body semantic segmentation map generated using the method of this invention and the water body semantic segmentation map generated using a weakly supervised semantic segmentation method based on the original CAM method; wherein, Figure 4 (a) is the original SAR image. Figure 4 (b) is the actual label image. Figure 4 (c) is a segmentation result image based on the CAM method. Figure 4(d) is a segmentation result diagram based on the method of the present invention. Detailed Implementation

[0081] The embodiments and effects of the present invention will be further described below with reference to the accompanying drawings.

[0082] like Figure 1 As shown, a weakly supervised SAR image water semantic segmentation method based on a color matching CAM model includes the following steps:

[0083] Step 1: Acquire SAR images, crop the SAR images to obtain image patches, and use these image patches as samples to form a dataset. A portion of this dataset is used as the training set. Then, only the training set data is labeled with water body binary classification image-level labels. The SAR image resolution is 1m. Specifically:

[0084] The SAR image dataset required for the experiment was selected from images of Xi'an and Dongying cities in China and Pohang city in South Korea, taken by the GF-3 satellite, with a resolution of 1m. These SAR images were cropped into 512×512 image patches, and 80% of the data was used as the training set. All image patches in the training set were assigned binary water body labels, including pixel-level and image-level labels. Pixel-level labels assigned a category (water body or non-water body) to each pixel in the image patch, while image-level labels assigned a category (water body or non-water body) to the entire image patch through manual identification. During training, only the training set and its image-level water body binary classification labels were used.

[0085] Step 2: Construct a water body binary classification model. The water body binary classification model includes a feature encoding module and a classification module. Input the training set data from Step 1 into the feature encoding module to obtain intermediate feature maps f1, f2, f3, and f4. Then, input the intermediate feature map f4 into the classification module to obtain the predicted binary classification result. Based on the predicted binary classification result, the water body binary classification image-level labels set in Step 1, and the intermediate feature map f2, train the water body binary classification model until the training termination condition is met to obtain the trained water body binary classification model.

[0086] The water body binary classification model in step 2 is composed of a feature encoding module and a classification module:

[0087] The feature encoding module is used to encode features from the input SAR image patches, obtaining intermediate feature maps f1, f2, f3, and f4 at different scales. The feature encoding module consists of a ResNet101 backbone network, which comprises 33 bottleneck blocks, each consisting of two 1×1 convolutional layers and one 3×3 convolutional layer. The intermediate feature maps f1, f2, f3, and f4 are derived from the outputs of the 3rd, 7th, 30th, and 33rd bottleneck blocks of the feature encoding module, respectively. The feature encoding module can extract different depth features from SAR images to mine spatial and semantic information within the images.

[0088] Classification module: Used to output the final binary classification result, it consists of two MLP layers;

[0089] The specific training process of the water body binary classification model is as follows:

[0090] Step 2.1: Calculate the loss L based on the predicted binary classification result, the set binary classification labels, and the intermediate feature map f2;

[0091] Loss L includes water body binary loss L cls Consistency loss of non-aquatic targets L ntc The details are as follows:

[0092] L = L cls +αL ntc

[0093] Where α is the loss weight, the water body binary classification loss and the target consistency loss are as follows:

[0094] Water body two-classification loss L cls :

[0095]

[0096] Among them, y i s represents the true label set for the i-th class. i This represents the prediction result for the i-th class;

[0097] Non-aquatic target consistency loss L ntc :

[0098]

[0099] Where B represents the number of data points in a batch during training, b represents the b-th data point in the current batch, Gate(·) represents a gate function, MSE(·) represents the MSE function, and y represents the set true label. The gate function and MSE function are as follows:

[0100] Gate function:

[0101]

[0102] MSE function:

[0103]

[0104] Step 2.2: Update the parameters of the water body binary classification model based on the loss L;

[0105] Step 2.3: Repeat steps 2.1 and 2.2 until the training termination condition is met, then proceed to step 2.4;

[0106] Step 2.4 yields the trained water body binary classification model.

[0107] Step 3: Input the dataset from Step 1 into the feature encoding module of the water body binary classification model trained in Step 2 to obtain the water body feature set F;

[0108] The water feature set F includes the features obtained from the dataset collected in step 1 through the feature encoding module in step 2, which can be specifically represented as:

[0109]

[0110] Where N represents the total number of SAR image patches in the dataset acquired in step 1.

[0111] Step 4: Construct a color matching CAM model. Input the water feature set F obtained in Step 3 and the dataset collected in Step 1 into the color matching CAM model to obtain the water category activation map set M.

[0112] The color matching CAM model in step 4 consists of a water body color matching weight generation module, a color matching activation map generation module, and a maximized activation map module. The water body color matching weight generation module generates water body color matching weights W; the color matching activation map generation module generates a multi-level category activation map set M' for water bodies; and the maximized activation map module generates a category activation map set M for water bodies. The specific process for obtaining the category activation map set M is as follows:

[0113] Step 4.1: Invert the dataset collected in Step 1, denoted as set I, to obtain I'. For an element i in set I, the specific calculation process for inverting i' is as follows:

[0114] i' x,y =255-i x,y

[0115] Among them, i x,y This represents the pixel value at coordinate (x, y) of position i.

[0116] Step 4.2: Normalize I' obtained in Step 4.1, and then perform interpolation at four different scales. The interpolation scales correspond to the water feature set F. The size of the feature is used to obtain the color matching weight set W;

[0117] Step 4.3: Perform a dot product between each element in the color matching weight set W obtained in step 4.2 and the corresponding element in the water feature set F obtained in step 3 to obtain the color correction feature set F'.

[0118] Step 4.4: Using the GradCAM method, the color correction feature set F' obtained in step 4.3 is converted into a water body multi-level category activation map set M';

[0119] Step 4.5: Take the maximum pixel value of the water body multi-level category activation map set M' obtained in step 4.4 to obtain the water body category activation map set M.

[0120] Step 5: Using the water body category activation map set M obtained in Step 4, obtain the pixel-level water body pseudo-label set P by using the thresholding method;

[0121] Each element p in the pixel-level water body pseudo-label set P is a pixel-level semantic label for the corresponding SAR image patch.

[0122] The specific process of the thresholding method is as follows: Each pixel in each category activation map m within the water body category activation map set M is converted to 0 or 1 using a threshold constraint. The resulting set is P. The specific calculation method for the threshold constraint is as follows:

[0123]

[0124] Where θ represents the threshold and the subscript (x,y) represents the coordinates of the pixel value.

[0125] Step 6: Select a water body segmentation model. Use the pixel-level water body pseudo-label set P obtained in Step 5 and the 1m resolution SAR image to be predicted collected in Step 1 to train the water body segmentation model until the training termination condition is met, and obtain the trained water body segmentation model.

[0126] The selected water segmentation models are DeepLabV3+, Segformer, or U-Net.

[0127] The specific training process of the water segmentation model in step 6 is as follows:

[0128] Step 6.1: Using the dataset collected in Step 1, i.e., the 1m resolution SAR image, input into the DeepLabV3+ segmentation model to obtain pixel-level water body segmentation results;

[0129] Step 6.2: Calculate the cross-entropy loss L using the pixel-level water body segmentation results from Step 6.1 and the corresponding pseudo-label p in the pixel-level water body pseudo-label set P from Step 5. cro The specific calculations are as follows:

[0130]

[0131] Where, p i Let s represent the i-th type of pseudo-label. i This represents the prediction result for the i-th class;

[0132] Step 6.3, using the cross-entropy loss L calculated in step 6.2. cro Update the parameters of the DeepLabV3+ segmentation model. Repeat steps 6.1 and 6.2 until the training termination condition is met, and you will get the trained DeepLabV3+ segmentation model.

[0133] Step 7: Input the dataset collected in Step 1 into the DeepLabV3+ segmentation model trained in Step 6 to obtain the final pixel-level segmentation result of the water body.

[0134] This invention proposes a weakly supervised SAR image water semantic segmentation method based on a color-matching CAM model. This method achieves high-precision pixel-level water semantic segmentation using only image-level water body labels, whereas existing solutions typically require a large number of pixel-level labels, consuming significant manpower and resources. Furthermore, existing weakly supervised methods, when directly applied to SAR image water segmentation, often generate inaccurate and incomplete pseudo-labels due to the lack of consideration for the unique color features of water bodies in SAR images, resulting in lower segmentation accuracy. The color-matching CAM model designed in this invention utilizes the consistent color features of water bodies in SAR images to correct the multi-level features extracted by the feature extraction network. It then uses these corrected multi-level features to generate accurate and complete water body CAMs, ultimately producing high-quality pixel-level pseudo-labels for water bodies. This allows the water segmentation model to better learn water body features, improving segmentation accuracy. The non-water body target consistency loss designed in this invention reduces inter-class confusion and increases intra-class consistency of water body targets during training of the binary classification model, thereby improving the water feature capture performance of the binary classification model. This leads to more accurate CAMs and pseudo-labels, ultimately reducing misclassification in the water segmentation model and improving overall water segmentation performance.

[0135] The effects of the present invention will be further explained below with reference to simulation experiments.

[0136] Experimental Analysis

[0137] 1. Simulation experimental conditions:

[0138] The hardware testing platform for the simulation experiment of this invention is: CPU 48 cores 2.30GHz; graphics card is Nvidia 2080Ti10G.

[0139] The software platform for the simulation experiment of this invention is as follows: Operating system: Ubuntu 20.04; Development environment: Python 3.7.6;

[0140] Experimental methods: Existing weakly supervised methods based on CAM and the present invention's weakly supervised SAR image water semantic segmentation method based on a color matching CAM model.

[0141] 2. Simulation content and result analysis:

[0142] like Figure 2 The image shown is the original SAR image of each region used in the experiment of this invention; among which, Figure 2 (a) is the original SAR image of the Pohang area in South Korea. Figure 2 (b) is the original SAR image of Dongying City, China. Figure 2 (c) is the original SAR image of Xi'an City.

[0143] like Figure 3 The image shown is a comparison chart between the category activation map generated using the method of this invention and the category activation map generated using the original CAM method; wherein, Figure 3 (a) is the original image of the image patch. Figure 3 (b) is the actual label image. Figure 3 (c) is the category activation map generated by the CAM method. Figure 3 (d) is the category activation map generated by the method of the present invention.

[0144] like Figure 4 The image shown is a comparison between the water body semantic segmentation map generated using the method of this invention and the water body semantic segmentation map generated using a weakly supervised semantic segmentation method based on the original CAM method; wherein, Figure 4 (a) is the original SAR image. Figure 4 (b) is the actual label image. Figure 4 (c) is a segmentation result image based on the CAM method. Figure 4 (d) is a segmentation result diagram based on the method of the present invention.

[0145] The simulation experiment of this invention was conducted on SAR images of Dongying City and Xi'an City in China and Pohang City in South Korea taken by the GF-3 satellite for training and testing. The detailed parameters of the data used in this invention are shown in Table 1.

[0146] Table 1. Detailed parameters of the data used in this invention.

[0147]

[0148]

[0149] The comparative experimental results of the simulation experiments of this invention on water body CAM on the overall dataset are shown in Table 2, and the comparative experimental results on downstream water body segmentation tasks on the overall dataset are shown in Table 3. From Figure 3 From this perspective, the method of the present invention is superior to existing CAM methods in the generation of water body CAM; from Figure 4 As shown in Table 2, the water segmentation results of the method of the present invention on three images are more complete and accurate than those of CAM-based methods. Table 3 shows that the method of the present invention outperforms existing methods in CAM evaluation metrics such as MIoU, F1, and OA. Furthermore, Table 3 shows that the method of the present invention outperforms existing methods in downstream water segmentation evaluation metrics such as OA, Kappa, MIoU, and FWIoU.

[0150] Table 2 Comparative experimental results of water body CAM on the overall dataset of this invention.

[0151] Evaluation indicators CAM method Method of the present invention MIoU 13.52% 66.37% F1 23.82% 79.78% OA 87.15% 95.45%

[0152] Table 3 Comparative experimental results of the present invention on downstream water segmentation tasks on the overall dataset.

[0153]

[0154] The simulation experiments above show that, on data with a resolution of 1m taken by the GF-3 satellite in the regions of China and South Korea, the average cross-union ratio of water body CAM is improved by 52.85% compared with the existing technology, and the activation of water body CAM is more complete and accurate; in the downstream segmentation task, the average cross-union ratio of the segmentation results is improved by 29.17% compared with the existing technology, and the segmentation visual results are significantly improved.

[0155] In the weakly supervised SAR water semantic segmentation task, compared with existing CAM-based segmentation methods, this invention generates a more complete and accurate category activation map, resulting in more accurate water semantic segmentation results; from Figure 4 As can be seen, although the method of the present invention only uses image-level water body labels, it has good performance in pixel-level segmentation tasks and is closer to the real labels than existing methods.

[0156] This invention also provides a weakly supervised SAR image water semantic segmentation system based on a color matching CAM model, comprising:

[0157] The dataset processing module is used to acquire SAR images in step 1, crop the SAR images to obtain image patches, use the image patches as samples to form a dataset, randomly select a portion of the dataset as a training set, and set water body binary classification image-level labels for the training set data.

[0158] The water body binary classification model training module is used to construct the water body binary classification model in step 2. The water body binary classification model includes a feature encoding module and a classification module. The training set data in the dataset from step 1 is input into the feature encoding module to obtain intermediate feature maps f1, f2, f3, and f4. The intermediate feature map f4 is input into the classification module to obtain the predicted binary classification result. Based on the predicted binary classification result, the water body binary classification image-level label set in step 1, and the intermediate feature map f2, the water body binary classification model is trained until the training termination condition is met, and the trained water body binary classification model is obtained.

[0159] The water feature set F acquisition module is used to input the dataset from step 1 into the feature encoding module of the water body binary classification model trained in step 2 in step 3, so as to obtain the water feature set F;

[0160] The module for obtaining the water body category activation map set M is used to construct the color matching CAM model in step 4. It inputs the water body feature set F obtained in step 3 and the dataset collected in step 1 into the color matching CAM model to obtain the water body category activation map set M.

[0161] The pixel-level water body pseudo-label set P acquisition module is used to obtain the pixel-level water body pseudo-label set P by using the water body category activation map set M obtained in step 4 in step 5 and the threshold method.

[0162] The water body segmentation model training module is used to select a water body segmentation model in step 6, and train the water body segmentation model using the pixel-level water body pseudo-label set P obtained in step 5 and the dataset collected in step 1 until the training termination condition is met, and obtain the trained water body segmentation model.

[0163] The water body pixel-level segmentation result acquisition module is used to input the dataset collected in step 1 into the water body segmentation model trained in step 6 in step 7, so as to obtain the final water body pixel-level segmentation result.

[0164] This invention also provides a water body semantic segmentation device for weakly supervised SAR images based on a color matching CAM model, comprising:

[0165] Memory: A computer program that stores the above-mentioned weakly supervised SAR image water semantic segmentation method based on color matching CAM model, and is a computer-readable device;

[0166] Processor: Used to implement the described weakly supervised SAR image water semantic segmentation method based on color matching CAM model when executing the computer program.

[0167] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the aforementioned method for semantic segmentation of water bodies in weakly supervised SAR images based on a color-matching CAM model.

Claims

1. A semantic segmentation method for water bodies in weakly supervised SAR images based on a color-matching CAM model, characterized in that: Includes the following steps: Step 1: Acquire SAR images, crop the SAR images to obtain image patches, use the image patches as samples to form a dataset, randomly select a portion of the dataset as a training set, and set water body binary classification image-level labels for the training set data. Step 2: Construct a water body binary classification model. The water body binary classification model includes a feature encoding module and a classification module. Input the training set data from the dataset in Step 1 into the feature encoding module to obtain intermediate feature maps. intermediate feature map The data is input into the classification module to obtain the predicted binary classification result; based on the predicted binary classification result, the water body binary classification image-level labels set in step 1, and the intermediate feature maps... Train the water body binary classification model until the training termination condition is met to obtain a well-trained water body binary classification model. Step 3: Input the dataset from Step 1 into the feature encoding module of the water body binary classification model trained in Step 2 to obtain the water body feature set. ; Step 4: Construct a color matching CAM model, which incorporates the water feature set obtained in Step 3. The dataset obtained in step 1 is input into the color matching CAM model to obtain a set of water body category activation maps. ; Step 5: Utilize the water body category activation map set obtained in Step 4. A pixel-level set of pseudo-labels for water bodies was obtained using a thresholding method. ; Step 6: Select a water body segmentation model and use the pixel-level water body pseudo-label set obtained in Step 5. Train the water body segmentation model with the dataset collected in step 1 until the training termination condition is met, and obtain the trained water body segmentation model. Step 7: Input the dataset collected in Step 1 into the water segmentation model trained in Step 6 to obtain the final pixel-level water segmentation result. The feature encoding module in step 2 is used to perform feature encoding on the input SAR image patches to obtain intermediate feature maps at different scales. The feature encoding module consists of a backbone network ResNet101, which comprises 33 bottleneck blocks, each of which consists of 2... Convolutional layer and 1 Convolutional layer composition, intermediate feature maps The outputs are from the 3rd, 7th, 30th, and 33rd bottleneck blocks of the feature encoding module, respectively. feature The encoding module extracts different depth features from SAR images to mine spatial and semantic information in the images; Classification module: Used to output the final binary classification result, it consists of two MLP layers; The specific training process of the water body binary classification model is as follows: Step 2.1: Based on the predicted binary classification results, the set binary classification labels, and the intermediate feature maps... Calculate loss ; The loss Including water body two-category losses Consistency loss of non-aquatic targets The details are as follows: in, The specific loss weights for water body binary classification and target consistency loss are as follows: Water body two-category loss : in, Indicates the first The actual label set by the class Indicates the first The prediction results for the class; Non-aquatic target consistency loss : in, This indicates the number of data points in a batch during training. Indicates the number of the current batch One data point, ·) represents a function. ·) represents the MSE function. This indicates the actual label being set; the gate function and MSE function are as follows: Gate function: MSE function: Step 2.2, based on the loss Update the parameters of the water body binary classification model; Step 2.3: Repeat steps 2.1 and 2.2 until the training termination condition is met, then proceed to step 2.4; Step 2.4 yields the trained water body binary classification model.

2. The water semantic segmentation method for weakly supervised SAR images based on a color matching CAM model according to claim 1, characterized in that: The set of water features in step 3 This includes the features obtained from the dataset collected in step 1 through the feature encoding module in step 2, specifically represented as follows: in, This indicates the total number of SAR image patches in the dataset acquired in step 1.

3. The water semantic segmentation method for weakly supervised SAR images based on a color matching CAM model according to claim 1, characterized in that: The color matching CAM model in step 4 consists of a water body color matching weight generation module, a color matching activation map generation module, and a maximized activation map module; the water body color matching weight generation module is used to generate water body color matching weights. Color Matching Activation Map Generation Module: Used to generate a set of multi-level category activation maps for water bodies. Maximize Activation Graph Module: Used to generate a set of activation graphs for different water body categories. Water body category activation map set The specific acquisition process is as follows: Step 4.1, denote the dataset collected in Step 1 as a set. Invert the phase to obtain For sets one of the elements Inverse phase The specific calculation process is as follows: in, express The coordinates are Pixel value at location; Step 4.2, take the result obtained in step 4.1 Normalization is performed, followed by interpolation at four different scales, each corresponding to a set of water body features. In The size of the feature yields the set of color matching weights. ; Step 4.3, use the color matching weight set obtained in Step 4.

2. Each element in the set of water features obtained in step 3 Perform a dot product on the corresponding elements in the matrix to obtain the color correction feature set. ; Step 4.4: Using the GradCAM method, extract the color correction feature set obtained in Step 4.

3. Convert to a set of multi-level category activation maps for water bodies ; Step 4.5: Activate the multi-level water body category set obtained in Step 4.

4. By taking the maximum pixel value from each group, we obtain the set of activation maps for water body categories. .

4. The water semantic segmentation method for weakly supervised SAR images based on a color matching CAM model according to claim 1, characterized in that: The pixel-level water body pseudo-label set obtained in step 5 Each element in These are pixel-level semantic labels corresponding to SAR image patches; The specific process of the threshold method is as follows: The water body category activation map set is... Each category activation graph Each pixel in the set is converted to either 0 or 1 by applying a threshold; the resulting set is the set of values. The specific calculation method for the limit threshold is as follows: in, Indicates threshold, subscript The coordinates representing the pixel value.

5. The water semantic segmentation method for weakly supervised SAR images based on a color matching CAM model according to claim 1, characterized in that: The water segmentation model selected in step 6 is either the DeepLabV3+ model, the Segformer model, or the U-Net model.

6. A water body semantic segmentation method for weakly supervised SAR images based on a color matching CAM model according to claim 1 or 5, characterized in that: The specific training process of the water segmentation model in step 6 is as follows: Step 6.1: Input the dataset collected in Step 1 into the selected water body segmentation model to obtain pixel-level water body segmentation results; Step 6.2 utilizes the pixel-level water body segmentation results from Step 6.1 and the pixel-level water body pseudo-label set from Step 5. The corresponding pseudo-tags in To calculate cross-entropy loss The specific calculations are as follows: in, Indicates the first pseudo-tags Indicates the first The prediction results for the class; Step 6.3, use the cross-entropy loss calculated in step 6.

2. Update the parameters of the water segmentation model, and repeat steps 6.1 and 6.2 until the training termination condition is met, and obtain the trained water segmentation model.

7. A water semantic segmentation system for weakly supervised SAR images based on a color-matching CAM model, as described in any one of claims 1 to 6, characterized in that: include: The dataset processing module is used to acquire SAR images, crop the SAR images to obtain image patches, use the image patches as samples to form a dataset, randomly select a portion of the dataset as a training set, and set water body binary classification image-level labels for the training set data. The water body binary classification model training module is used to construct a water body binary classification model. This model includes a feature encoding module and a classification module. Training set data is input into the feature encoding module to obtain intermediate feature maps. intermediate feature map The data is input into the classification module to obtain the predicted binary classification result; based on the predicted binary classification result, the set water body binary classification image-level labels, and intermediate feature maps... Train the water body binary classification model until the training termination condition is met to obtain a well-trained water body binary classification model. Water body feature set The acquisition module is used to input the collected dataset into the feature encoding module of the trained water body binary classification model to obtain the water body feature set. ; Water body category activation map set The acquisition module is used to build a color matching CAM model and obtain a set of water body features. The collected dataset is input into the color matching CAM model to obtain a set of water body category activation maps. ; Pixel-level water body pseudo-label collection The acquisition module is used to activate the set of water body categories. A pixel-level set of pseudo-labels for water bodies was obtained using a thresholding method. ; The water segmentation model training module is used to select a water segmentation model and utilize the obtained pixel-level water pseudo-label set. The water segmentation model is trained using the collected dataset until the training termination condition is met, resulting in a well-trained water segmentation model. The water body pixel-level segmentation result acquisition module is used to input the collected dataset into the trained water body segmentation model to obtain the final water body pixel-level segmentation result.

8. A semantic segmentation device for water bodies in weakly supervised SAR images based on a color-matching CAM model, characterized in that: include: Memory: A computer program for a weakly supervised SAR image water semantic segmentation method based on a color matching CAM model as described in any one of claims 1-6, and is a computer-readable device; Processor: Used to implement the weakly supervised SAR image water semantic segmentation method based on color matching CAM model as described in any one of claims 1-6 when executing the computer program.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that, when executed by a processor, enables the implementation of the weakly supervised SAR image water semantic segmentation method based on a color matching CAM model as described in any one of claims 1-6.

Citation Information

Patent Citations

  • SAR image water body extraction method, device, electronic equipment and storage medium

    CN113743383A

  • Self-adaptive environment water level identification method, device and equipment

    CN116129430A

  • Domain adversarial neural network training method

    CN113392967A

  • Non-cyanobacterial bloom monitoring method and system based on satellite remote sensing

    CN115984711A