Road extraction method, system and storage medium based on remote sensing image
By using the UGD-DLinkNet model and the uncertainty-guided knowledge distillation strategy in remote sensing images, the problem of low accuracy of road extraction in remote sensing images is solved and the accuracy of road extraction is improved.
Patent Information
- Application Number
- CN202410871978.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-01
AI Technical Summary
In high-resolution remote sensing images, road extraction accuracy is not high, mainly because roads in remote sensing images are blocked by buildings and vegetation, and label errors in training data make model learning difficult.
The UGD-DLinkNet model built based on the D-LinkNet model is used, combined with the uncertainty-guided knowledge distillation strategy, to gradually filter out pixels with lower uncertainty during the training process of the teacher model and student model, and improve the model's segmentation of remote sensing images. accuracy.
The accuracy of road extraction in remote sensing images is improved. Through the uncertainty-guided knowledge distillation strategy, the accuracy of road extraction by the student model is enhanced, and the problem of low accuracy of road extraction in remote sensing images is overcome.
Smart Images

Figure CN118397464B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a road extraction method, system and storage medium based on remote sensing images. Background Art
[0002] In the field of road extraction from high-resolution remote sensing images, since the roads in remote sensing images are blocked by buildings and vegetation, there are label errors in the remote sensing image datasets used to train deep learning algorithms. That is, some roads are not marked in the labels, resulting in low accuracy of road extraction in high-resolution remote sensing images. Summary of the invention
[0003] The present invention aims to provide a road extraction method, system and storage medium based on remote sensing images, which can improve the accuracy of road extraction in remote sensing images.
[0004] In order to achieve the above object, the present invention provides the following technical solutions:
[0005] In a first aspect, an embodiment of the present invention provides a road extraction method based on remote sensing images, the method comprising the following steps:
[0006] Establishing a teacher-student model, wherein the teacher-student model includes a teacher model and a student model, wherein both the teacher model and the student model include a UGD-DLinkNet model constructed based on a D-LinkNet model, wherein the UGD-DLinkNet model includes an encoder, a bridge network, and a decoder connected in sequence;
[0007] Acquire a data set, train a teacher model using the data set, and after completing the training of the teacher model, train a student model using an uncertainty-guided knowledge distillation strategy to obtain a trained student model; wherein the data set includes a plurality of remote sensing images;
[0008] A remote sensing image to be extracted is obtained, and a trained student model is used to predict the remote sensing image to be extracted and generate a road extraction result.
[0009] In a second aspect, an embodiment of the present invention provides a road extraction system based on remote sensing images, the system comprising:
[0010] at least one processor;
[0011] at least one memory for storing at least one program;
[0012] When the at least one program is executed by the at least one processor, the at least one processor implements the road extraction method of the remote sensing image as described in any one of the above items.
[0013] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium storing a program executable by a processor, wherein the program executable by the processor is used to execute the road extraction method for remote sensing images as described in any one of the above when executed by the processor.
[0014] The beneficial effects of the present invention are as follows: the present invention discloses a road extraction method, system and storage medium based on remote sensing images. The present invention adopts, after completing the training of the teacher model, an uncertainty-guided knowledge distillation strategy to train the student model. In the process of training the student model, pixels with lower uncertainty will be gradually filtered out to guide the student model learning and improve the accuracy of the learning model in remote sensing image segmentation. The trained student model can improve the accuracy of road extraction in remote sensing images. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0016] Figure 1 is a schematic flow chart of a method for extracting roads from a remote sensing image in an embodiment of the present invention;
[0017] Figure 2 is an architecture diagram of a road extraction method for remote sensing images in an embodiment of the present invention;
[0018] Figure 3 : is a network architecture diagram of the UGD-DLinkNet model in an embodiment of the present invention;
[0019] Figure 4 is a schematic diagram of a bridge network in an embodiment of the present invention;
[0020] Figure 5 Schematic diagram of the structure of the road extraction system of the remote sensing image in the embodiment of the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.
[0022] See also Figure 1 and Figure 2 , Figure 1 The invention provides a road extraction method based on remote sensing images, which comprises the following steps:
[0023] S100, establishing a teacher-student model, wherein the teacher-student model includes a teacher model and a student model, wherein both the teacher model and the student model adopt a UGD-DLinkNet model constructed based on a D-LinkNet model, wherein the UGD-DLinkNet model includes an encoder, a bridge network, and a decoder connected in sequence;
[0024] Specifically, the bridge network is used to capture global contextual semantic information.
[0025] S200, obtaining a data set, training a teacher model using the data set, and after completing the training of the teacher model, training a student model using an uncertainty-guided knowledge distillation strategy to obtain a trained student model; wherein the data set includes a plurality of remote sensing images;
[0026] S300, obtaining a remote sensing image to be extracted, using a trained student model to predict the remote sensing image to be extracted and generating a road extraction result.
[0027] The present invention proposes a UGD-DLinkNet model based on the DLinkNet model. The network architecture of the UGD-DLinkNet model is as follows: Figure 2 In the encoder network, the ResNet34 network pre-trained on the ImageNet image classification dataset is used as the encoder to improve the network's ability to extract important features and structural information from shallow semantic information.
[0028] Since the road network information in remote sensing images has a large span, it usually presents complex spatial topological features such as different widths, and the model has a limited receptive field, which makes it impossible for the model to completely extract the road. Therefore, in the bridging network part, a dilated convolutional attention module consisting of a dilated convolutional attention module and a self-attention unit is used to capture global contextual semantic information.
[0029] Based on the UGD-DLinkNet model, this paper proposes an uncertainty-guided knowledge distillation strategy. In the process of training the student model, the uncertainty threshold is continuously increased using a time-dependent Gaussian warm-up function. As the training progresses, this method will gradually filter out pixels with lower uncertainty, allowing the student model to learn and improve the accuracy of the student model in remote sensing image segmentation, thereby improving the accuracy of road extraction in remote sensing images.
[0030] In some embodiments, the UGD-DLinkNet model includes an encoder, a bridge network, and a decoder connected in sequence, and two ends of the bridge network are respectively connected to the encoder and the decoder;
[0031] Combination Figure 3and Figure 4 The encoder includes a ResNet34 network, and the ResNet34 network includes an initial convolution block and four encoding blocks cascaded in sequence; the decoder includes four decoding blocks cascaded in sequence; the encoding block of the lowest layer is connected to the decoding block of the lowest layer through a bridging network; the bridging network is a Distributed Convolutional Attention Module (DCAM), and the Distributed Convolutional Attention Module includes a dilated convolution unit and a self-attention unit, which is used to process the feature map output by the encoder of the lowest layer, and output the processed feature map to the decoder of the lowest layer.
[0032] In S200, the step of obtaining a data set, training a teacher model using the data set, and training a student model using an uncertainty-guided knowledge distillation strategy after completing the training of the teacher model to obtain a trained student model includes:
[0033] S201, adding dropout layers to the front end of the bridge network and the front end of the output layer in the teacher model, respectively, to obtain an adjusted teacher model;
[0034] S202, obtaining a data set, inputting the remote sensing images in the data set into the adjusted teacher model for training, and obtaining a trained teacher model;
[0035] Specifically, the adjusted teacher model is iteratively trained using the sum of the DICE loss and the cross entropy loss in the subsequent embodiments until the sum of the DICE loss and the cross entropy loss is lower than a set threshold, thereby obtaining a trained teacher model.
[0036] S203, adding a dropout layer to the front end of the bridge network and the front end of the output layer in the student model, respectively, to obtain an adjusted student model;
[0037] S204, training the adjusted student model, and in the process of training the adjusted student model, performing multiple forward passes on the trained teacher model using the MCDropout method to obtain predicted logical scores of each category in the multiple forward passes, and calculating the segmentation uncertainty based on the predicted logical scores;
[0038] Specifically, based on the segmentation uncertainty, the knowledge distillation loss is determined, and then the fusion loss is determined, and the fusion loss is used as the end condition of iteratively training the student model to obtain a trained student model. The categories in this embodiment include road categories and non-road categories.
[0039] S205: Train a student model based on the segmentation uncertainty to obtain a trained student model.
[0040] Specifically, since roads in high-resolution remote sensing images have complex geometric features such as slenderness, diverse backgrounds, and contextual features blocked by trees and buildings, and some roads in the image are not marked in the label, this brings a high degree of uncertainty to the model during road extraction. Therefore, the present invention proposes an uncertainty-guided knowledge distillation strategy, which uses the MCDropout method to perform T random forward passes on the teacher model with a dropout layer to approximate the segmentation uncertainty of the teacher model, and then guides the student model to learn through this uncertainty.
[0041] Specifically, for both the teacher model and the student model, a dropout layer with a probability set to 0.5 is added to the front end of the bridge network and the front end of the output layer in the corresponding UGD-DLinkNet model to quantify the segmentation uncertainty of the teacher model using the MCDropout method. By using the MCDropout method, after the teacher model is trained, the dropout layer is enabled when training the student model, and multiple forward passes are performed on the same remote sensing image to obtain multiple Monte Carlo samples of approximate segmentation prediction probability distributions. Based on the multiple Monte Carlo samples, the prediction entropy is used to approximate the segmentation uncertainty of the teacher model.
[0042] In some embodiments, the segmentation uncertainty is calculated by the following formula:
[0043] :
[0044] Where T is the total number of sampling times, is the number of forward passes, It is The predicted logistic score of category k in the forward pass, C is the number of categories in the segmentation task, is the average Softmax probability of class k in T forward passes of the teacher model, and u is the segmentation uncertainty of the teacher model.
[0045] Based on the results of uncertainty estimation, the present invention proposes an uncertainty-guided knowledge distillation strategy. Specifically, during the training process, the teacher model is first used to perform uncertainty estimation to obtain the segmentation uncertainty u of the teacher model. Then, under the guidance of the segmentation uncertainty u, predictions with too high uncertainty are filtered out, and only some relatively reliable predictions are selected to guide the student model learning.
[0046] The feature maps in which both the segmentation uncertainty u and the uncertainty threshold H are consistent with the size of the output feature map. However, the values in the segmentation uncertainty u represent uncertainties, while the values in the uncertainty threshold H are a threshold. For example, the values in the segmentation uncertainty u are 0.6, 0.7, 0.8, 0.9 respectively. The values in the uncertainty threshold H are 0.8, 0.8, 0.9, 0.8 respectively. The results obtained according to the conditional expression u < H are 1, 1, 1, 0. When calculating the loss function in this way, only the pixel points corresponding to 1 in the output feature map participate in the calculation of the loss function, and the pixel points corresponding to 0 do not participate in the calculation of the loss function.
[0047] In some embodiments, in S205, training the student model based on the segmentation uncertainty to obtain a trained student model includes:
[0048] S251, inputting the remote sensing images in the dataset into the teacher model and the student model respectively to obtain the intermediate feature map and the output feature map of the teacher model, and the intermediate feature map and the output feature map of the student model;
[0049] S252, obtaining the loss of the fitting feature map and the loss of the imitation output according to the intermediate feature map and the output feature map of the teacher model, and the intermediate feature map and the output feature map of the student model;
[0050] S253, obtaining the knowledge distillation loss according to the loss of the fitting feature map and the loss of the imitation output;
[0051] S254, in the process of iteratively training the student model, determining the fusion loss based on the knowledge distillation loss, and iteratively training the student model based on the fusion loss to obtain a trained student model.
[0052] Specifically, when the fusion loss is lower than the set fusion loss threshold, stop iteratively training the student model to obtain a trained student model.
[0053] The uncertainty-guided knowledge distillation strategy proposed by the present invention includes two parts: fitting feature maps and imitating outputs. By fitting the intermediate feature maps, the student model can imitate the feature learning process of the teacher model and better focus on the global feature information of the road. Compared with the binary labels, the output feature map based on the output of the teacher model can use its road extraction result as a soft label for the student model to learn, so as to transfer the category information in the remote sensing image to the student model. The fitting feature maps and imitating outputs in the above knowledge distillation strategy can be obtained by calculating the difference loss between the corresponding feature maps and outputs of the teacher model and the student model.
[0054] Use uncertainty to filter the intermediate feature maps and output feature maps of the student model, and select pixels in the intermediate feature maps and output feature maps whose segmentation uncertainty is greater than the uncertainty threshold. Pixels with higher uncertainty do not participate in the subsequent fusion loss calculation, and only relatively certain pixels participate in the calculation of the fusion loss. The student model is updated based on the calculated loss function.
[0055] In some embodiments, the knowledge distillation loss is obtained according to the loss of the fitting feature map and the loss of the imitation output, including:
[0056] The loss of the fitted feature map is calculated by the following formula:
[0057] ;
[0058] The loss of imitating the output is calculated by the following formula:
[0059] ;
[0060] Among them, i represents the number of the intermediate feature map, j represents the number of the output feature map, N represents the total number of intermediate feature maps and the total number of output feature maps, and L f and L o Represent the loss of fitting feature maps and the loss of imitating outputs respectively; represents the i-th intermediate feature map of the teacher model, represents the j-th output feature map of the teacher model; represents the i-th intermediate feature map of the student model, Represents the j-th output feature map of the student model.
[0061] Combine the student model to fit the teacher model feature map loss L f and the loss L that mimics the output of the teacher model o The knowledge distillation loss L based on uncertainty estimation can be obtained dis .
[0062] The knowledge distillation loss is calculated by the following formula:
[0063] ;
[0064] Among them, u j represents the segmentation uncertainty estimated by the teacher model for the jth output feature map, and γ is the loss L used to balance the fitted feature map. f and the loss L of the simulated output o The hyperparameters are, λ(t) is the time-dependent Gaussian warm-up function, and H is the uncertainty threshold;
[0065] The expression of Gaussian warm-up function is:
[0066] ;
[0067] Among them, t represents the number of iterations currently reached, t max Indicates the maximum number of iterations set. Using this warm-up function can reduce the interference of distillation loss at the beginning of training.
[0068] During the experiment, the same Gaussian ramp-up paradigm λ(t) was used to increase the threshold from 0.75Umax to Umax, where Umax represents the maximum uncertainty value (set to ln2 in the experiment), and H represents the threshold of the most certain sample of the teacher model. The calculation formula of the uncertainty threshold H is:
[0069] H = (0.75 + 0.25 × λ (t)) × Umax; where Umax represents the maximum uncertainty value.
[0070] Through this formula, in the process of training the student model, the teacher model's segmentation uncertainty threshold for samples will rise from 0.75Umax to Umax, thereby filtering out fewer and fewer data samples and allowing the student model to learn from relatively certain examples to relatively unreliable samples.
[0071] In some embodiments, the calculation formula of the fusion loss is:
[0072] ;
[0073] Among them, Ltotal represents the fusion loss, α and β are the adjustment dice losses And the knowledge distillation loss function The hyperparameters of the weight are: α=0.5, β=10; represents the cross entropy loss;
[0074] The calculation formula for cross entropy loss is:
[0075] ;
[0076] The calculation formula of dice loss is:
[0077] ;
[0078] Where M represents the total number of samples used for training, h represents the number of the current sample, To predict the probability that sample h is a positive example, is the label of sample h. If the sample is a positive example, the value of the sample label is 1, otherwise it is 0.
[0079] Specifically, when training the teacher model, it is trained using the sum of DICE loss and cross entropy loss. M represents the total number of samples for training the teacher model. The probability that the teacher model predicts that the sample is a positive example, is the label of sample h; when training the student model, it is trained using the fusion loss, M represents the total number of samples for training the student model, The probability that the student model predicts that the sample is a positive example, is the label of sample h, and the label of sample h is pre-marked.
[0080] Exemplarily, the label is a feature map of size 512×512. If the label of a pixel in the feature map is road, the label of the pixel is a positive example, and the value of the label is 1; if the label of the pixel is not road, the value of the label of the pixel is 0.
[0081] and Figure 1 Corresponding to the method, refer to Figure 5 , an embodiment of the present invention provides a road extraction system based on remote sensing images, comprising:
[0082] at least one processor;
[0083] at least one memory for storing at least one program;
[0084] When the at least one program is executed by the at least one processor, the at least one processor implements the above method.
[0085] It can be seen that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0086] In addition, an embodiment of the present invention further discloses a computer program product or a computer program, which is stored in a computer-readable storage medium. A processor of a computer device can read the computer program from a computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above method. Similarly, the contents of the above method embodiment are all applicable to the storage medium embodiment, and the functions specifically implemented by the storage medium embodiment are the same as those of the above method embodiment, and the beneficial effects achieved are also the same as those achieved by the above method embodiment.
[0087] It will be appreciated by those skilled in the art that all or some of the methods disclosed above and the system may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or transient medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0088] The above is a specific description of the preferred implementation of the present disclosure, but the present disclosure is not limited to the above-mentioned implementation mode. Technical personnel familiar with the field can also make various equivalent deformations or substitutions without violating the spirit of the present disclosure. These equivalent deformations or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. A road extraction method based on remote sensing images, characterized in that: The method comprises the following steps: Establishing a teacher-student model, wherein the teacher-student model includes a teacher model and a student model, wherein both the teacher model and the student model include a UGD-DLinkNet model constructed based on a D-LinkNet model, wherein the UGD-DLinkNet model includes an encoder, a bridge network, and a decoder connected in sequence; Acquire a data set, train a teacher model using the data set, and after completing the training of the teacher model, train a student model using an uncertainty-guided knowledge distillation strategy to obtain a trained student model; wherein the data set includes a plurality of remote sensing images; Acquire a remote sensing image to be extracted, use the trained student model to predict the remote sensing image to be extracted and generate a road extraction result; The step of obtaining a data set, training a teacher model by using the data set, and after completing the training of the teacher model, training a student model by using an uncertainty-guided knowledge distillation strategy to obtain a trained student model includes: Add dropout layers to the front end of the bridge network and the front end of the output layer in the teacher model to obtain the adjusted teacher model; Acquire a data set, input the remote sensing images in the data set into the adjusted teacher model for training, and obtain a trained teacher model; In the student model, dropout layers are added to the front end of the bridge network and the front end of the output layer to obtain the adjusted student model; Training the adjusted student model, and in the process of training the adjusted student model, performing multiple forward passes on the trained teacher model using the MCDropout method to obtain predicted logical scores of each category in the multiple forward passes, and calculating the segmentation uncertainty based on the predicted logical scores; Training a student model based on the segmentation uncertainty to obtain a trained student model; The segmentation uncertainty is calculated by the following formula: : Where T is the total number of sampling times, is the number of forward passes, It is The predicted logistic score of category k in the forward pass, C is the number of categories in the segmentation task, is the average Softmax probability of category k in T forward passes of the teacher model, and u is the segmentation uncertainty of the teacher model; The step of training the student model based on the segmentation uncertainty to obtain a trained student model includes: Inputting the remote sensing images in the data set into the teacher model and the student model respectively, obtaining the intermediate feature map and the output feature map of the teacher model, and the intermediate feature map and the output feature map of the student model; According to the intermediate feature map and output feature map of the teacher model and the intermediate feature map and output feature map of the student model, the loss of the fitted feature map and the loss of the imitated output are obtained; Obtaining a knowledge distillation loss according to the loss of the fitted feature map and the loss of the imitation output; In the process of iteratively training the student model, determining the fusion loss based on the knowledge distillation loss, and iteratively training the student model based on the fusion loss to obtain a trained student model; The knowledge distillation loss is obtained according to the loss of the fitting feature map and the loss of the imitation output, including: The loss of the fitted feature map is calculated by the following formula: ; The loss of imitating the output is calculated by the following formula: ; Among them, i represents the number of the intermediate feature map, j represents the number of the output feature map, N represents the total number of intermediate feature maps and the total number of output feature maps, and L f and L o Represent the loss of fitting feature maps and the loss of imitating outputs respectively; represents the i-th intermediate feature map of the teacher model, represents the j-th output feature map of the teacher model; represents the i-th intermediate feature map of the student model, Represents the j-th output feature map of the student model; The knowledge distillation loss is calculated by the following formula: ; Among them, u j represents the segmentation uncertainty estimated by the teacher model for the jth output feature map, and γ is the loss L used to balance the fitted feature map. f and the loss L of the simulated output o The hyperparameters are, λ(t) is the time-dependent Gaussian warm-up function, and H is the uncertainty threshold; The expression of Gaussian warm-up function is: ; Among them, t represents the number of iterations currently reached, t max Indicates the maximum number of iterations set; The calculation formula of the uncertainty threshold H is: H = (0.75 + 0.25 × λ(t)) × Umax; where Umax represents the maximum uncertainty value; The calculation formula of the fusion loss is: ; Among them, Ltotal represents the fusion loss, α and β are the adjustment dice losses and knowledge distillation loss The hyperparameters of weight; represents the cross entropy loss; The calculation formula for cross entropy loss is: ; The calculation formula of dice loss is: ; Where M represents the total number of samples used for training, h represents the number of the current sample, Predict the probability that sample h is a positive example, is the label of sample h.
2. A road extraction system based on remote sensing images, characterized in that: The system comprises: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method as claimed in claim 1.
3. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to perform the method according to claim 1 when being executed by the processor.
Citation Information
Patent Citations
Remote sensing image semantic segmentation model training method and device for contrast consistency learning
CN114299380A
Target detection method and device based on knowledge distillation
CN114663848A
Model transmission method and device
CN117220734A
Knowledge distillation-based system for learning of teacher model and student model
US20240119571A1
