Remote sensing glacier segmentation method based on deep learning

By using a method based on deep learning, combining CNN and Swin Transformer structures, and using contrastive learning and Dice loss functions, the problem of poor glacier boundary segmentation in remote sensing images is solved, and efficient glacier monitoring and more accurate glacier boundary extraction are achieved.

CN118570229APending Publication Date: 2024-08-30NORTHWEST UNIV

Patent Information

Application Number
CN202410656909.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

The existing technology does not perform well in segmenting glacier boundaries in remote sensing images, resulting in low glacier monitoring efficiency and high error rates. Moreover, deep learning algorithms have been less developed in natural images and have not been effectively applied to remote sensing glacier segmentation.

Method used

Using a method based on deep learning, local features are extracted through the CNN structure, and global features are extracted through the Swin Transformer structure, and multi-feature fusion is performed to construct a remote sensing glacier segmentation network. Global positive and negative label samples and boundary area positive and negative label samples are used for comparative learning. Combined with the Dice loss function, three-stage training is performed to output the segmentation results of the glacier area.

Benefits of technology

It improves the accuracy and efficiency of glacier boundary segmentation, enhances the model's ability to identify glacier areas, reduces the error rate, and provides reliable glacier monitoring data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570229A
    Figure CN118570229A
Patent Text Reader

Abstract

The invention belongs to the technical field of remote sensing image processing, and particularly discloses a remote sensing glacier segmentation method based on deep learning, and the method comprises the steps: carrying out the preprocessing of remote sensing data, so as to construct a data set; generating global positive and negative label samples and boundary region positive and negative label samples; constructing a remote sensing glacier segmentation network based on deep learning; a comparison loss function constructed on the basis of global positive and negative label samples and an L1 loss function is used for guiding the remote sensing glacier segmentation network to carry out first-stage training, and random masking is carried out on an input training image; guiding the remote sensing glacier segmentation network to carry out second-stage training by using a comparison loss function constructed on the basis of positive and negative label samples of a boundary region and an L1 loss function, and randomly masking an input training image; and a Dice loss function is used to guide the remote sensing glacier segmentation network to carry out third-stage training. According to the method, a CNN (convolutional neural network) structure and a Swin Transform (sliding window Transform) structure are combined, and extraction and fusion of remote sensing glacier feature information are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of remote sensing image processing, and in particular relates to a remote sensing glacier segmentation method based on deep learning. Background Art

[0002] Glaciers are flowing ice bodies that evolve from the accumulation of snow and other solid precipitation and are products of nature. Glacier changes are closely related to regional climate and can serve as a sensitive indicator for detecting climate change. They are also one of the important sources of freshwater resources and are of great significance for ecological balance and sustainable utilization of biological resources. Therefore, by segmenting remote sensing images to accurately extract glacier boundaries, reliable data can be provided for monitoring glacier area, long-term climate change, and environmental evolution research.

[0003] The extraction methods of glacier boundaries mainly include field investigation, manual visual interpretation and computer automatic extraction. Initially, mountain glaciers could only be detected by field investigation by practitioners, which was difficult and risky, resulting in low research efficiency. With the gradual advancement of satellite remote sensing technology and the faster development of remote sensing images, researchers began to use manual visual interpretation to monitor glacier areas. Compared with field investigation, data can be obtained more efficiently and risks are reduced, but there are still problems such as time-consuming and labor-intensive, and high error rate. In the early days, computer automatic extraction methods mainly used artificially designed features to extract glacier boundaries. With the abundance of computer resources, deep learning algorithms have made rapid progress in natural images. However, they are relatively rarely used in remote sensing images, especially in the segmentation of glaciers in remote sensing images. Not much attention has been paid to glacier boundaries, resulting in poor segmentation effects at glacier boundaries. Summary of the invention

[0004] The purpose of the present invention is to overcome the defects in the prior art and provide a remote sensing glacier segmentation method based on deep learning.

[0005] The present invention provides a remote sensing glacier segmentation method based on deep learning, comprising the following steps:

[0006] S1, collect remote sensing data, manually annotate the remote sensing data to obtain label samples, and preprocess the remote sensing data and label samples to construct a data set;

[0007] S2, generate global positive label samples, global negative label samples, boundary area positive label samples, and boundary area negative label samples;

[0008] S3, extracts local features of images through CNN structure, extracts global features of images through Swin Transformer structure, and performs multi-feature fusion to build a remote sensing glacier segmentation network based on deep learning;

[0009] S4, using global positive label samples, global negative label samples and L 1 The contrast loss function constructed based on the loss function is used for contrast learning to guide the first stage of training of the remote sensing glacier segmentation network;

[0010] S5, using samples with positive labels in the boundary area, samples with negative labels in the boundary area and L 1 The contrast loss function constructed based on the loss function is used for contrast learning to guide the remote sensing glacier segmentation network to carry out the second stage of training;

[0011] S6, based on the Dice loss function to guide the construction of the third stage of training for remote sensing glacier segmentation network;

[0012] S7, input the test set into the remote sensing glacier segmentation network trained in step S6, and output the segmentation result of the glacier area.

[0013] A further solution is that in S1, preprocessing the remote sensing data to construct a data set includes the following steps:

[0014] S1.1, define the cropping size, number of bands, and origin coordinates for remote sensing images and label samples. In the label sample, 0 represents non-glacier areas and 1 represents glacier areas;

[0015] S1.2, writing the affine transformation parameters, projection information attributes, and origin coordinate information of the remote sensing image into the cropped remote sensing image, and writing the affine transformation parameters, projection information attributes, and origin coordinate information of the label sample into the cropped label sample;

[0016] S1.3, divide the processed remote sensing images into a training set and a test set, and divide the processed labeled samples into a training set and a test set.

[0017] A further solution is that in S2, the method for generating global positive label samples, global negative label samples, boundary area positive label samples, and boundary area negative label samples comprises the following steps:

[0018] S2.1, taking the label sample as the global positive label sample, randomly dilate or corrode the label sample with kernels of different sizes, and taking the dilated sample or corroded sample as the global negative label sample;

[0019] S2.2, perform difference processing on the dilated sample and the eroded sample to obtain the boundary area, set the pixel value of the non-boundary area of ​​the global positive label sample to 0 to obtain the positive label sample of the boundary area, and set the pixel value of the non-boundary area of ​​the global positive label sample to 0 to obtain the negative label sample of the boundary area.

[0020] A further solution is that the generation formula of the global negative label sample, the boundary area positive label sample, and the boundary area negative label sample is:

[0021]

[0022] Among them, B i The value of i is 1 or 2, B 1 Indicates the expansion operation of the label sample, B 2 Indicates that the label sample is corroded, area indicates that the pixel values ​​in the boundary area are all 1, and the pixel values ​​in the non-boundary area are all 0, Wh(area=0) indicates the position where the value is 0 in area, and J(Wh(area=0)=0) indicates that the pixel values ​​in the non-boundary area of ​​the global positive label sample J are set to 0. represents the positive label sample in the boundary area, I(Wh(area=0)=0) represents setting the pixel value of the non-boundary area of ​​the global negative label sample I to 0, Represents positive label samples in the boundary area.

[0023] A further solution is that the remote sensing glacier segmentation network in S3 is a segmentation network model based on an encoder-decoder structure, and the construction method includes the following steps:

[0024] S3.1, extracting global feature information of the remote sensing image through an encoder module, and then generating a global feature attention map; the encoder module is set to four layers, and each layer is set to two Swin Transformer structures, and a corresponding downsampling layer is set after each layer of the encoder module;

[0025] S3.2, extracting and supplementing the boundary feature information of the remote sensing image through a boundary feature information supplementation module, wherein the boundary feature information supplementation module is composed of two CNN structures and a downsampling layer, the first CNN structure is used to extract boundary information, and the second CNN structure is used to supplement the boundary feature information to the upsampled feature information;

[0026] S3.3, the feature information extracted by the encoder is passed to the decoder in the form of skip connection to supplement the feature information of different scales;

[0027] S3.4, the decoder module fuses the incoming global feature information, upsampled feature information, and boundary feature information. The decoder module is set to four layers, and each layer is set to two CNN structures. At the same time, a corresponding upsampling layer is set before each layer of the decoder module to fuse the feature information of the jump connection, the upsampled feature information, and the boundary feature information;

[0028] The process formula of the construction method is:

[0029]

[0030] Among them, PE represents the slicing operation of the input image, Down represents the downsampling operation of the feature information, Up represents the upsampling operation of the feature information, T represents the encoder module, C represents the decoder module, Concat represents the fusion of global feature information, local feature information and boundary feature information, Conv represents the convolution operation, X represents the input image, and X represents the B represents the encoder output and the feature information of the jump connection, X T Represents boundary feature information, X J represents the output of the decoder module, Represents the features after fusion of multiple feature information.

[0031] A further solution is that the steps S4 and S5 further include performing a random mask operation on the image input during training, specifically:

[0032] 1), perform PE slicing operation on the input image;

[0033] 2) The sliced ​​image is subjected to multi-dimensional feature extraction through the CNN structure;

[0034] 3), convert the extracted multi-dimensional features into one-dimensional vectors and transpose them to obtain serialized features;

[0035] 4) In order to increase the difficulty of the image, improve the robustness of the model and avoid overfitting, a certain proportion of the serialized features are randomly masked and the pixel values ​​at the corresponding positions are set to 0.

[0036] A further solution is that the contrast loss function described in S4 and S5 is:

[0037]

[0038] in, Represents the L between the segmentation result and the label sample 1 norm loss, D(·) represents J or I and L 1 Distance, i.e. L 1 norm loss, β is the weight, J, I and In the first stage of contrastive learning, the global positive label samples, global negative label samples and segmentation results are represented respectively. The contrastive loss function used in the second stage of contrastive learning is similar to that in the first stage, except that the global positive and negative samples are replaced by the positive and negative samples in the boundary area.

[0039] The contrastive learning method enables the model to better learn the information of the glacier boundary. In the first stage, the global positive label sample J and the global negative label sample I need to be used to guide the model training at the same time, so as to make the segmentation result Close to the global positive label sample J and far away from the global negative label sample I. The contrastive learning method in the second stage is similar to that in the first stage, except that the global positive and negative label samples are replaced with the positive and negative label samples in the boundary area.

[0040] A further solution is that the contrastive learning method described in S4 and S5 is:

[0041] 1) The first-stage contrast loss function is constructed by global positive label samples and global negative label samples, and the second-stage contrast loss function is constructed by boundary area positive label samples and boundary area negative label samples;

[0042] 2) In the first stage, the positive sample loss between the global positive label sample and the segmentation result and the negative sample loss between the global negative label sample and the segmentation result are calculated; in the second stage, the positive sample loss between the boundary area positive label sample and the segmentation result and the negative sample loss between the boundary area negative label sample and the segmentation result are calculated;

[0043] 3) By comparing the loss function and calculating the error and performing back propagation, the segmentation result gradually reduces the distance with the positive label samples and expands the distance with the negative label samples.

[0044] A further solution is that the Dice loss function described in S6 is:

[0045]

[0046] Among them, y i and They represent the label value and predicted value of pixel i respectively, and N is the total number of pixels, that is, the number of pixels in a single image multiplied by the number of input images.

[0047] Compared with the prior art, the beneficial effects of the present invention are as follows: for the problem of remote sensing glacier image segmentation, the present invention first pre-processes the original data and constructs a data set; secondly, uses label samples to generate global positive and negative label samples based on the glacier boundary area and positive and negative label samples in the boundary area; then uses the CNN structure and the Swin Transformer structure to construct a remote sensing glacier segmentation network based on deep learning, and by utilizing the characteristics of the CNN structure being good at capturing local feature information and the Swin Transformer structure being good at capturing global feature information, the global feature information, local feature information and boundary feature information of the remote sensing glacier data are extracted and fused; then, the contrast loss function constructed based on the global positive and negative label samples is used to guide the network to perform the first stage of training; then, the contrast loss function constructed based on the positive and negative label samples in the boundary area is used to guide the network to perform the second stage of training; finally, the Dice loss function is used to guide the network to perform the third stage of training, so that the model further improves the segmentation result of the non-boundary area. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The following drawings are only used to illustrate and explain the present invention, and are not used to limit the scope of the present invention, wherein:

[0049] Figure 1 is a flow chart of the remote sensing glacier segmentation method of the present invention;

[0050] Figure 2 This is a network model structure diagram of the remote sensing glacier segmentation method of the present invention;

[0051] Figure 3 This is a schematic diagram of the contrast loss in the first stage of the present invention;

[0052] Figure 4 This is a schematic diagram of the contrast loss in the second stage of the present invention;

[0053] Figure 5 This is a structural diagram of the boundary feature supplement module in the present invention;

[0054] Figure 6 This is a diagram of the encoder-decoder structure of the present invention. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical solution, design method and advantages of the present invention clearer, the present invention is further described in detail by specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0056] The present invention proposes a remote sensing glacier segmentation method based on deep learning. In order to effectively utilize the global and local information of remote sensing glacier images, the CNN structure is good at capturing local feature information and the Swin Transformer structure is good at capturing global feature information. Jump connections are used to realize the transmission of feature information, and then the CNN structure is used to realize the effective fusion of global feature information and local feature information. At the same time, in order to solve the problem of unsatisfactory segmentation of glacier boundary areas, a model based on contrastive learning is designed to improve the segmentation accuracy of boundary areas. Figure 1 As shown, the following steps are included:

[0057] Step 1: collect remote sensing data, manually annotate the remote sensing data to obtain label samples, and preprocess the remote sensing data and label samples to construct a data set;

[0058] Step 2, generate global positive label samples, global negative label samples, boundary area positive label samples, and boundary area negative label samples;

[0059] Step 3: Through the CNN structure and Swin Transformer structure design module, the local features and global features of the image are extracted respectively, and multi-feature fusion is performed to build a remote sensing glacier segmentation network based on deep learning;

[0060] Step 4: Use the global positive label samples, global negative label samples and L 1 The contrast loss function constructed based on the loss function is used for contrast learning to guide the first stage of training of the remote sensing glacier segmentation network;

[0061] Step 5: Use the boundary area positive label samples, boundary area negative label samples and L 1 The contrast loss function constructed based on the loss function is used for contrast learning to guide the remote sensing glacier segmentation network to carry out the second stage of training;

[0062] Step 6, based on the Dice loss function, the remote sensing glacier segmentation network is trained in the third stage;

[0063] Step 7: Input the test set into the remote sensing glacier segmentation network trained in step 6, and output the segmentation result of the glacier area.

[0064] Among them, in step 1, the process of preprocessing remote sensing data to construct a data set is:

[0065] S1, defines the cropping size, number of bands, origin coordinates and other information for remote sensing images and label samples. Among them, 0 in the label sample represents non-glacier area and 1 represents glacier area;

[0066] S2, writing the affine transformation parameters, projection information attributes, origin coordinates and other information of the remote sensing image into the cropped remote sensing image, and writing the affine transformation parameters, projection information attributes, origin coordinates and other information of the label sample into the cropped label sample;

[0067] S3, dividing the processed remote sensing images into a training set and a test set, and dividing the processed labeled samples into a training set and a test set.

[0068] In this embodiment, contrastive learning requires not only positive label samples but also negative label samples. In step 2, the method for generating global positive and negative label samples and boundary area positive and negative label samples is as follows:

[0069] S1, taking the label sample as the global positive label sample, randomly dilate or corrode the label sample with kernels of different sizes, and taking the dilated sample or corroded sample as the global negative label sample;

[0070] S2, perform difference processing on the dilated sample and the eroded sample to obtain the boundary area, set the pixel value of the non-boundary area of ​​the global positive label sample to 0, obtain the positive label sample of the boundary area, set the pixel value of the non-boundary area of ​​the global negative label sample to 0, and obtain the negative label sample of the boundary area;

[0071] Furthermore, the generation formula of the global negative label samples and the boundary area positive and negative label samples is:

[0072]

[0073] Among them, B i The value of i is 1 or 2, B 1 Indicates the expansion operation of the label sample, B 2 Indicates that the label sample is corroded, area indicates that the pixel values ​​in the boundary area are all 1, and the pixel values ​​in the non-boundary area are all 0, Wh(area=0) indicates the position where the value is 0 in area, and J(Wh(area=0)=0) indicates that the pixel values ​​in the non-boundary area of ​​the global positive label sample J are set to 0. represents the positive label sample in the boundary area, I(Wh(area==0)=0) represents setting the pixel value of the non-boundary area of ​​the global negative label sample I to 0, Represents positive label samples in the boundary area.

[0074] The method for constructing the remote sensing glacier segmentation network based on deep learning described in step 3 is:

[0075] S3.1, extracting global feature information of the remote sensing image through an encoder module, and then generating a global feature attention map; the encoder module is set to four layers and each layer is set to two Swin Transformer structures, and a corresponding downsampling layer is set after each layer of the encoder module;

[0076] S3.2, extracting and supplementing the boundary feature information of the remote sensing image through a boundary feature information supplementation module, wherein the boundary feature information supplementation module is composed of two CNN structures and a downsampling layer, the first CNN structure is used to extract boundary information, and the second CNN structure is used to supplement the boundary feature information to the upsampled feature information;

[0077] S3.3, the feature information extracted by the encoder is passed to the decoder in the form of skip connection to supplement the feature information of different scales;

[0078] S3.4, the decoder module fuses the incoming global feature information, upsampled feature information, and boundary feature information. The decoder module is set to four layers, and each layer is set to two CNN structures. At the same time, a corresponding upsampling layer is set before each layer of the decoder module to fuse the feature information of the jump connection, the upsampled feature information, and the boundary feature information;

[0079] Furthermore, the process formula of the construction method of the remote sensing glacier segmentation network model based on deep learning is:

[0080]

[0081] Among them, PE represents the slicing operation of the input image, Down represents the downsampling operation of the feature information, Up represents the upsampling operation of the feature information, T represents the encoder module, C represents the decoder module, Concat represents the fusion of global feature information, local feature information and boundary feature information, Conv represents the convolution operation, X represents the input image, and X represents the B represents the output of the encoder module, i.e., the feature information of the skip connection, X T Represents boundary feature information, X J represents the output of the decoder module, Represents the features after fusion of multiple feature information.

[0082] The specific operation of randomly masking the input image described in step 4 and step 5 is:

[0083] S1, perform PE slicing operation on the input image;

[0084] S2, extract features from the sliced ​​image through the CNN structure;

[0085] S3, converting the extracted multi-dimensional features into one-dimensional vectors and transposing them to obtain serialized features;

[0086] S4, in order to increase the image difficulty, improve the model robustness and avoid overfitting, a certain proportion of the serialized features are randomly masked, that is, the pixel values ​​at the corresponding positions are set to 0.

[0087] like Figure 2 As shown, the processing module in step 3 includes an encoder module, a decoder module and a boundary feature information supplementation module:

[0088] like Figure 6 As shown, the encoder module extracts the global features of the image and generates a global feature attention map; the encoder module is set to four layers and each layer is set to two Swin Transformer structures, and a corresponding downsampling layer is set after each layer of the encoder module; the decoder module is set to four layers and each layer is set to two convolution structures, and a corresponding upsampling layer is set before each layer of the decoder module to fuse the feature information of the jump connection, the upsampled feature information and the boundary feature information; Figure 5 As shown in Figure 1, the boundary feature information supplementation module consists of two convolution structures and a downsampling layer. The first convolution structure is used to extract boundary information, and the second convolution structure is used to supplement the boundary feature information to the upsampled feature information.

[0089] In the above, the loss function described in step 4 and step 5 is a contrast loss function, and its formula is:

[0090]

[0091] in, Represents the L between the segmentation result and the label sample 1 norm loss, D(·) represents the difference between J or I and L 1 Distance, i.e. L 1 norm loss, β is the weight, J, I and In the first stage of contrastive learning, the global positive label samples, global negative label samples and segmentation results are represented respectively. The contrastive loss function used in the second stage of contrastive learning is similar to that in the first stage, except that the global positive and negative samples are replaced by the positive and negative samples in the boundary area.

[0092] The contrastive learning method can enable the model to better learn the information of the glacier boundary. In the first stage, the global positive label sample J and the global negative label sample I need to be used to guide the model learning at the same time, so as to make the segmentation result Close to the global positive label sample J and far away from the global negative label sample I. The contrastive learning in the second stage is similar to the first stage, only the global positive and negative samples are replaced by the positive and negative samples in the boundary area.

[0093] like Figure 3 and Figure 4 As shown, the contrastive learning method is:

[0094] S1, constructs the first-stage contrast loss function through global positive label samples and global negative label samples, and constructs the second-stage contrast loss function through boundary area positive label samples and boundary area negative label samples;

[0095] S2, in the first stage, the positive sample loss of the global positive label sample and the segmentation result and the negative sample loss of the global negative label sample and the segmentation result are calculated; in the second stage, the positive sample loss of the boundary area positive label sample and the segmentation result and the negative sample loss of the boundary area negative label sample and the segmentation result are calculated;

[0096] S3, by comparing the loss function to calculate the error and performing back propagation, gradually makes the segmentation result narrow the distance with the positive label sample and widen the distance with the negative label sample.

[0097] The Dice loss function formula described in step 6 is:

[0098]

[0099] Among them, y i and They represent the label value and predicted value of pixel i respectively, and N is the total number of pixels, that is, the number of pixels in a single image multiplied by the number of input images.

[0100] Furthermore, in step 6, in response to the problem that the first two stages paid too much attention to the boundary area, resulting in unsatisfactory segmentation results for the non-boundary area, a third-stage loss function was designed for the third-stage training to further improve the model's segmentation results for the non-boundary area. To solve the problem of unsatisfactory segmentation results for the non-boundary area, the input remote sensing glacier image is no longer randomly masked; to solve the problem of unsatisfactory segmentation results for the non-boundary area, the third-stage training is constructed with the Dice loss function as a guide; the remote sensing glacier segmentation network model is used to further train the input image of the first step to further improve the model's segmentation results for the non-boundary area.

[0101] It should be noted that:

[0102] The Transformer structure in the present invention is based on a SwinTransformer network proposed by Hu Cao et al. in the paper "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows". The CNN structure and jump connection in the present invention are based on a multi-level jump connection method and an improved UNet model with step-by-step upsampling proposed by Zongwei Zhou et al. in the paper "UNet++: A Nested U-Net Architecture for Medical Image Segmentation". In view of the glacier segmentation problem, the present invention refers to the SwinTransformer structure and the CNN structure to construct a new encoder-decoder model based on the U-shaped structure. In the present invention, the encoder module adopts the Swin Transformer structure, and adopts a jump connection method to pass the global feature information extracted by the encoder part to the decoder. In addition, the model also adds a boundary feature information supplement module, which extracts the boundary feature information by using the CNN structure and passes it to the decoder. The CNN structure is used in the decoder part to realize the fusion of the feature information obtained by the jump connection, the upsampled feature information and the boundary feature information.

[0103] The random masking operation of the input image in the present invention is based on the idea of ​​randomly masking part of the input image blocks and reconstructing them proposed by Kaiming He et al. in "Masked Autoencoders Are Scalable Vision Learners". 1The method of norm loss function is based on a contrast regularization based on contrast learning proposed by Haiyan Wu et al. in "Contrastive Learning for Compact Single Image Dehazing", which uses positive and negative samples to ensure that the restored image is closer to the positive sample and the restored image is farther away from the negative sample. The Dice loss function adopted by the present invention is based on the Dice loss function proposed by Fausto Milletari et al. in "V-Net: Fully Convolutional Neural Networks for Volumetric Medical Image Segmentation". In view of the difficulty in segmenting the glacier boundary area, the present invention designs a global positive and negative sample contrast learning stage and a boundary positive and negative sample contrast learning stage to enable the model to better learn the information of the glacier boundary. At the same time, in order to eliminate redundant information and increase the difficulty of learning, the present invention performs random masking operations on the input image in these two contrast learning stages; in view of the problem that the first two stages pay too much attention to the boundary area, resulting in unsatisfactory segmentation results of the non-boundary area, the present invention adds a third stage of training guided by the Dice loss function to further improve the segmentation results of the non-boundary area.

[0104] The present invention is described in detail below through specific embodiments.

[0105] This embodiment describes the training process in three stages in detail, where the first and second stages are contrastive learning, and the third stage is a fine-tuning stage. At the same time, the generation of positive and negative samples in the first and second stages and the training in the third stage are described in detail. The specific operations of generating global positive and negative samples based on the data set and performing contrastive learning in the first stage are:

[0106] First, obtain the labeled samples of glacier images and use them as global positive samples;

[0107] Secondly, dilation and erosion operations are performed on the labeled samples to obtain global negative samples.

[0108] Finally, a contrastive learning training method is used to make the model's predictions closer to the global positive samples and further away from the global negative samples.

[0109] Based on the contrastive learning of global positive and negative samples in the first stage, the specific operation of using positive and negative samples in the boundary area to perform contrastive learning in the second stage is as follows:

[0110] First, we obtain label samples of glacier remote sensing images, perform dilation and erosion operations on them, and use the difference to get the range of the boundary area.

[0111] Secondly, use the boundary area obtained in the previous step to extract the boundary part of the global positive and negative samples in the first stage, and then obtain the positive and negative samples in the boundary area;

[0112] Finally, contrastive learning is used to further learn and locate the boundary part of the glacier remote sensing image, making its boundary closer to the boundary positive sample and farther away from the boundary negative sample.

[0113] It is worth noting that in order to increase the image difficulty, improve the model robustness, and avoid overfitting during contrastive learning, the present invention uses random mask operations to increase the learning difficulty of the model.

[0114] It is worth noting that the loss function and input image used in the third stage of training are different. The specific differences are as follows:

[0115] On the one hand, in order to enable the model to better learn the global feature information of the input image, the input image is no longer randomly masked during the third stage of training to ensure the integrity of the image.

[0116] On the other hand, in order to address the problem that the first two stages paid too much attention to the boundary area, resulting in unsatisfactory segmentation results in the non-boundary area, the contrast loss was replaced with Dice loss in the third stage and the model was trained to further improve the segmentation results of the model in the non-boundary area.

[0117] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A remote sensing glacier segmentation method based on deep learning, characterized in that: The following steps are involved: S1, collect remote sensing data, manually annotate the remote sensing data to obtain label samples, and preprocess the remote sensing data and label samples to construct a data set; S2, generate global positive label samples, global negative label samples, boundary area positive label samples, and boundary area negative label samples; S3, extracts local features of images through CNN structure, extracts global features of images through Swin Transformer structure, and performs multi-feature fusion to build a remote sensing glacier segmentation network based on deep learning; S4, using the contrastive loss function constructed based on global positive label samples, global negative label samples and L1 loss function to conduct contrastive learning to guide the first stage of training of the remote sensing glacier segmentation network; S5, using the contrast loss function constructed based on the positive label samples in the boundary area, the negative label samples in the boundary area and the L1 loss function to conduct contrast learning, so as to guide the remote sensing glacier segmentation network to perform the second stage of training; S6, the third stage of training is conducted based on the Dice loss function to guide the remote sensing glacier segmentation network; S7, input the test set into the remote sensing glacier segmentation network trained in step S6, and output the segmentation result of the glacier area.

2. A remote sensing glacier segmentation method based on deep learning according to claim 1, characterized in that: In S1, preprocessing the remote sensing data to construct a data set includes the following steps: S1.1, define the cropping size, number of bands, and origin coordinates for remote sensing images and label samples. In the label sample, 0 represents non-glacier areas and 1 represents glacier areas; S1.2, writing the affine transformation parameters, projection information attributes, and origin coordinate information of the remote sensing image into the cropped remote sensing image, and writing the affine transformation parameters, projection information attributes, and origin coordinate information of the label sample into the cropped label sample; S1.3, divide the processed remote sensing images into a training set and a test set, and divide the processed labeled samples into a training set and a test set.

3. The remote sensing glacier segmentation method based on deep learning according to claim 1, characterized in that: In S2, the method for generating global positive label samples, global negative label samples, boundary area positive label samples, and boundary area negative label samples includes the following steps: S2.1, taking the label sample as the global positive label sample, randomly dilate or corrode the label sample with kernels of different sizes, and taking the dilated sample and corroded sample as the global negative label sample; S2.2, perform difference processing on the dilated sample and the eroded sample to obtain the boundary area, set the pixel value of the non-boundary area of ​​the global positive label sample to 0 to obtain the positive label sample of the boundary area, and set the pixel value of the non-boundary area of ​​the global negative label sample to 0 to obtain the negative label sample of the boundary area.

4. The remote sensing glacier segmentation method based on deep learning according to claim 3 is characterized in that: The generation formula of the global negative label sample, the boundary area positive label sample, and the boundary area negative label sample is: Among them, B i The value of i is 1 or 2, B1 represents the expansion operation on the label sample, B2 represents the corrosion operation on the label sample, area represents that the pixel values ​​in the boundary area are all 1, and the pixel values ​​in the non-boundary area are all 0, Wh(area=0) represents the position where the value in area is 0, and J(Wh(area=0)=0) represents setting the pixel values ​​in the non-boundary area of ​​the global positive label sample J to 0. represents the positive label sample in the boundary area, I(Wh(area=0)=0) represents setting the pixel value of the non-boundary area of ​​the global negative label sample I to 0, Represents positive label samples in the boundary area.

5. The remote sensing glacier segmentation method based on deep learning according to claim 1, characterized in that: The remote sensing glacier segmentation network in S3 is a segmentation network model based on an encoder-decoder structure, and the construction method includes the following steps: S3.1, extracting global feature information of the remote sensing image through an encoder module, and then generating a global feature attention map; the encoder module is set to four layers, and each layer is set to two Swin Transformer structures, and a corresponding downsampling layer is set after each layer of the encoder module; S3.2, extracting and supplementing the boundary feature information of the remote sensing image through a boundary feature information supplementation module, wherein the boundary feature information supplementation module is composed of two CNN structures and a downsampling layer, the first CNN structure is used to extract boundary information, and the second CNN structure is used to supplement the boundary feature information to the upsampled feature information; S3.3, the feature information extracted by the encoder is passed to the decoder in the form of skip connection to supplement the feature information of different scales; S3.4, the decoder module fuses the incoming global feature information, upsampled feature information, and boundary feature information. The decoder module is set to four layers, and each layer is set to two CNN structures. At the same time, a corresponding upsampling layer is set before each layer of the decoder module to fuse the feature information of the jump connection, the upsampled feature information, and the boundary feature information; The process formula of the construction method is: Among them, PE represents the slicing operation of the input image, Down represents the downsampling operation of the feature information, Up represents the upsampling operation of the feature information, T represents the encoder module, C represents the decoder module, Concat represents the fusion of global feature information, local feature information and boundary feature information, Conv represents the convolution operation, X represents the input image, and X represents the B represents the output of the encoder module, i.e., the feature information of the skip connection, X T Represents boundary feature information, X J represents the output of the decoder module, Represents the features after fusion of multiple feature information.

6. The remote sensing glacier segmentation method based on deep learning according to claim 5, characterized in that: The steps S4 and S5 also include performing a random mask operation on the image input during training, specifically: 1), perform PE slicing operation on the input image; 2) The sliced ​​image is subjected to multi-dimensional feature extraction through the CNN structure; 3), convert the extracted multi-dimensional features into one-dimensional vectors and transpose them to obtain serialized features; 4) In order to increase the difficulty of the image, improve the robustness of the model and avoid overfitting, a certain proportion of random masking is performed on the serialized features, that is, the pixel values ​​at the corresponding positions are set to 0.

7. The remote sensing glacier segmentation method based on deep learning according to claim 1, characterized in that: The contrastive loss function described in S4 and S5 is: in, represents the L1 norm loss between the segmentation result and the label sample, and D(·) represents the loss between J, I and The L1 distance between them, that is, the L1 norm loss, β is the weight, J, I and In the first stage of contrastive learning, the global positive label samples, global negative label samples and segmentation results are represented respectively. The contrastive loss function used in the second stage of contrastive learning is similar to that in the first stage, except that the global positive and negative samples are replaced by the positive and negative samples in the boundary area. The contrastive learning method enables the model to better learn the information of the glacier boundary. In the first stage, the global positive label sample J and the global negative label sample I need to be used to guide the model training at the same time, so as to make the segmentation result Close to the global positive label sample J and far away from the global negative label sample I. The contrastive learning method in the second stage is similar to that in the first stage, except that the global positive and negative samples are replaced by the positive and negative samples in the boundary area.

8. The remote sensing glacier segmentation method based on deep learning according to claim 7, characterized in that: The contrastive learning method described in S4 and S5 is: 1) The first-stage contrast loss function is constructed by global positive label samples and global negative label samples, and the second-stage contrast loss function is constructed by boundary area positive label samples and boundary area negative label samples; 2) In the first stage, the positive sample loss between the global positive label sample and the segmentation result and the negative sample loss between the global negative label sample and the segmentation result are calculated; In the second stage, the positive sample loss between the positive label samples in the boundary area and the segmentation result and the negative sample loss between the negative label samples in the boundary area and the segmentation result are calculated; 3) By comparing the loss function and calculating the error and performing back propagation, the segmentation result gradually reduces the distance with the positive label samples and expands the distance with the negative label samples.

9. The remote sensing glacier segmentation method based on deep learning according to claim 1, characterized in that: The Dice loss function described in S6 is: Among them, y i and They represent the label value and predicted value of pixel i respectively, and N is the total number of pixels, that is, the number of pixels in a single image multiplied by the number of input images.

Citation Information

Patent Citations

  • Remote sensing image semantic segmentation method and device for boundary optimization, equipment and medium

    CN114120102A

  • Remote sensing image semantic segmentation method based on shared convolution kernel and boundary loss function

    CN115035295A

  • Image denoising method and device, computer equipment and storage medium

    CN116228583A

  • Boundary-optimized remote sensing image semantic segmentation method and apparatus, and device and medium

    WO2023077816A1

Cited By

  • Domain adaptation cross-modal medical image segmentation method and device based on boundary comparison, equipment and medium

    CN119295491A

  • Multi-scale lightweight glacier segmentation method based on global context

    CN120563829A