Remote sensing image road extraction method, device and readable storage medium based on knowledge distillation

By using a knowledge distillation method in remote sensing image road extraction, teachers and students models are constructed and intermediate knowledge distillation is carried out, the problems of large amount of parameters and high computational complexity in the existing technology are solved, and efficient and fast real-time road extraction effect is achieved.

CN119251705BActive Publication Date: 2025-03-04XIAMEN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411786671.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-04
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

Existing deep learning methods have problems with large parameters and high computational complexity in remote sensing image road extraction, which is difficult to meet the needs of real-time road extraction.

Method used

Using a knowledge-based distillation method, by constructing teacher models and student models, isomorphic distillation is performed using intermediate layers to reduce the parameter quantity of student models and the complexity of network structure and improve the fitting speed.

Benefits of technology

It achieves higher efficiency, lower cost and less energy consumption, enhances the road extraction effect, and can quickly and accurately complete real-time inference to meet the needs of real-time road extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251705B_ABST
    Figure CN119251705B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of road extraction from remote sensing images. The present invention provides a method, device and readable storage medium for extracting roads from remote sensing images based on knowledge distillation, which includes constructing a teacher model and a student model. The neural networks of the teacher model and the student model adopt an encoder-decoder architecture to learn road features. The number of layers of the student model neural network is less than that of the teacher model neural network. The knowledge distillation is performed in the middle layer, and the knowledge distillation in the middle layer is isomorphic distillation. The model outputs the result based on the target training. The problem of large number of parameters and high computational complexity of the traditional method is solved, and real-time reasoning can be completed quickly and accurately to meet the needs of real-time road extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of remote sensing image road extraction, and in particular to a remote sensing image road extraction method, device and readable storage medium based on knowledge distillation. Background Art

[0002] Remote sensing images play an important role in urban planning, traffic management, and environmental monitoring. Among them, extracting road information is a key task in remote sensing image processing. The extracted road information can help urban planners and managers understand the structure, density, and distribution of urban road networks, and provide data support for urban traffic planning, road construction, and maintenance.

[0003] At present, traditional road extraction methods are often limited by complex road environments, lighting changes and image noise, resulting in unsatisfactory extraction results. The rise of deep learning technology has brought new hope for road extraction from remote sensing images. Many studies have shown that deep learning-based methods can better capture features in images, thereby achieving more accurate road extraction. However, current deep learning methods also have some problems in road extraction, such as high model complexity and high consumption of computing resources. Taking the deep learning models Fully Convolutional Network (FCN) and U-Net (U-Net) as examples, although they have achieved certain success in road extraction tasks, they still have problems with large number of parameters and high computational complexity; and these models usually take a long time to perform real-time reasoning, which makes it difficult to meet the needs of real-time road extraction.

[0004] Therefore, the present invention provides a remote sensing image road extraction method based on knowledge distillation to solve the above problems.

[0005] It should be noted that the information disclosed in this background technology section is only intended to increase the understanding of the overall background of the present invention, and should not be regarded as acknowledging or suggesting in any form that the information constitutes prior art already known to a person skilled in the art. Summary of the invention

[0006] In order to solve the above problems, the present invention proposes a method for extracting roads from remote sensing images based on knowledge distillation. The present invention provides a method for extracting roads from remote sensing images based on knowledge distillation, which comprises the following steps:

[0007] CoANet is used to build a teacher model. The neural network of the teacher model uses an encoder-decoder architecture to learn road features. After the data passes through the encoder, the first feature map is output. , after the decoder outputs the second feature map ;

[0008] Use CoANet to build a student model. The neural network of the student model adopts an encoder-decoder architecture. The number of layers of the student model neural network is less than that of the teacher model neural network. After the data passes through the encoder, the third feature map is output. , after the decoder outputs the fourth feature map ;

[0009] The knowledge distillation is performed in the middle layer, which is isomorphic distillation. The third feature map is minimized by fitting the formula of loss. Fitting the first feature map , the fourth characteristic map Fitting the second feature map ;

[0010] The formula for minimizing the loss fit is as follows:

[0011]

[0012] Among them, S and T represent the image data of the student model and the image data of the teacher model respectively. Data S is an abstract symbol representing the feature map of a certain part of the output of the student model. Data T is an abstract symbol representing the feature map of a certain part of the output of the teacher network. N is the feature map and The total number of elements in N=batch×channel×width×height, batch is the number of samples selected for one training, channel is the number of channels, width is the width, and height is the height. is a pixel in the data S, is a pixel point in data T. and When the loss Put it into the position of S, Substitute T for calculation, the value range of i is 1~N, where the formula It means that each time we take a point at the corresponding position of the N pixels of the feature map S and T, we calculate the difference between them. Then the formula calculates the difference of all pixels from the 1st to the Nth point and then calculates their average to get the loss.

[0013] The output layer of the student model segmentation branch learns the output layer knowledge of the teacher model segmentation branch by minimizing the binary cross entropy loss formula, and the formula for minimizing the binary cross entropy loss is as follows:

[0014] Where N is the same as N in the minimization loss fitting formula, The fourth characteristic graph The split branch, The second feature map The split branch, for A pixel in for A pixel point in , the value range of i is 1~N;

[0015] The learning fit of the segmentation branch of the student model and the teacher model is jointly measured based on DiceLoss and BCELoss;

[0016]

[0017] α is a bias term used to smooth the calculation results. Label is the ground truth image, which serves as a label. i One of the pixels in the label;

[0018] The total loss of the student model and labels is as follows:

[0019]

[0020]

[0021] ,

[0022] Where a and b are constants, and The fourth characteristic graph The connected branches of for The true value label of for The true value label of for The true value label of

[0023] The total loss of the knowledge distillation process is as follows:

[0024] MSELoss( )+MSELoss( )+ +Out_Loss;

[0025] Conduct the first target training, the first target training uses MSELoss ( , ) performs multiple iterations, and when the error is less than the specified threshold d1, performs the second target training;

[0026] The second target training uses MSELoss ( , ) performs multiple iterations, and when the error is less than the specified threshold d2, performs the third target training;

[0027] The third objective training uses c×BCELoss(S sem , T sem )+d×Out Loss, c and d are weights;

[0028] The model outputs the results after training based on the third objective.

[0029] Furthermore, the encoder-decoder architecture includes a convolution layer, a dilated spatial convolution pooling pyramid layer and a strip convolution block. When data is input, the data passes through the convolution layer to output a first feature map, and then enters the dilated spatial convolution pooling pyramid layer. The dilated spatial convolution pooling pyramid layer is used to increase the receptive field of feature points in the first feature map and capture multi-scale features. The processed first feature map is then used by the strip convolution block to extract the linear features of the road and output the second feature map as a prediction result.

[0030] Furthermore, the convolutional layers, atrous spatial convolutional pooling pyramid layers, and strip convolutional blocks are pruned;

[0031] Use the DepGraph method to automatically prune the convolutional layer;

[0032] Replace the atrous spatial convolutional pooling pyramid layer with the basic 1x1 convolutional pooling;

[0033] The decoder is manually pruned, and the pruning rate is calculated by the prune function. According to the pruning rate, the number of channels of the strip convolutional blocks of the decoder is changed from 256, 512, 256, and 128 to 256, 50, 128, and 64 respectively.

[0034] The present invention also provides a device for a method for extracting roads from remote sensing images based on knowledge distillation, which includes a memory and a processor. The memory is used to store an embedded software program. The processor is used to execute the embedded software program stored in the memory, and when the embedded software program is executed, the steps of the method for extracting roads from remote sensing images based on knowledge distillation are implemented.

[0035] The present invention also provides a computer-readable storage medium, on which is stored a program for implementing the remote sensing image road extraction method. The program for implementing the remote sensing image road extraction method is executed by a processor to implement the steps of any one of the remote sensing image road extraction methods based on knowledge distillation described above.

[0036] An embodiment of the present invention provides a remote sensing image road extraction method, device and readable storage medium based on knowledge distillation. On the basis of the teacher network CoANet, a student network with fewer parameters, relatively simple network structure and faster fitting speed is established, and on the basis of the output layer knowledge distillation, intermediate layer knowledge distillation is added, which can bring higher efficiency, lower cost and less energy consumption, enhance the overall road extraction effect, solve the problems of large parameters and high computational complexity of traditional methods, and can quickly and accurately complete real-time reasoning to meet the needs of real-time road extraction.

[0037] Other features and beneficial effects of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other beneficial effects of the present invention can be achieved and obtained by the structures specifically pointed out in the description, claims, etc. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The positional relationships described in the drawings in the following description are based on the directions in which the components are drawn in the diagrams, unless otherwise specified.

[0039] Figure 1 It is a flow chart of a method for extracting roads from remote sensing images based on knowledge distillation of the present invention;

[0040] Figure 2 is a schematic diagram of the system structure of a teacher model provided by an embodiment of the present invention;

[0041] Figure 3 is a schematic diagram of the system structure of a pruned teacher model provided by an embodiment of the present invention;

[0042] Figure 4 is a schematic diagram of the system structure of a student model provided by an embodiment of the present invention;

[0043] Figure 5 Schematic diagram of the teacher model and the student model of the present invention performing intermediate layer knowledge distillation;

[0044] Figure 6 It is a comparative schematic diagram of ResNet50 and ResNet101 of the present invention;

[0045] Figure 7 This is a schematic diagram of the network structure of the first module of ResNet;

[0046] Figure 8 It is a schematic diagram of road extraction from remote sensing images provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments; the technical features designed in different implementation modes of the present invention described below can be combined with each other as long as they do not conflict with each other; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0048] In the description of the present invention, it should be understood that the terms "center", "lateral", "up", "down", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or component referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "multiple" means two or more. In addition, the term "including" and any variation thereof all mean "at least including".

[0049] See also Figures 1 to 7 , Figure 1 is a flow chart of a method for extracting roads from remote sensing images based on knowledge distillation of the present invention. Figure 2 is a schematic diagram of the system structure of a teacher model provided by an embodiment of the present invention, Figure 3 is a schematic diagram of the system structure of a pruned teacher model provided by an embodiment of the present invention, Figure 4 is a schematic diagram of the system structure of a student model provided by an embodiment of the present invention, Figure 5 Schematic diagram of the teacher model and the student model of the present invention performing intermediate layer knowledge distillation. Figure 6 It is a comparative diagram of ResNet50 and ResNet101 of the present invention. Figure 7is a schematic diagram of the network structure of the first module of ResNet. In order to achieve at least one of the above advantages or other advantages, an embodiment of the present invention provides a method for extracting roads from remote sensing images based on knowledge distillation. As shown in the figure, the method for extracting roads from remote sensing images based on knowledge distillation includes the following steps:

[0050] Use CoANet to build a teacher model. The neural network of the teacher model uses an encoder-decoder architecture to learn road features. After the data passes through the encoder, the first feature map is output. , after the decoder outputs the second feature map . refer to Figure 2 As shown in the figure, the encoder-decoder architecture includes a convolution layer, a dilated spatial convolution pooling pyramid layer and a strip convolution block. The ASPP module in the figure corresponds to the dilated spatial convolution pooling pyramid layer. After the data is input, the data passes through the convolution layer of the encoder and outputs the first feature map. Then enter the dilated spatial convolution pooling pyramid layer, which is used to increase the receptive field of feature points in the first feature map and capture multi-scale features, thereby improving the connectivity of the road. The processed first feature map is then extracted by the strip convolution block to extract the linear features of the road, and the second feature map is output as the prediction result. Specifically, the number of strip convolution blocks is 4, which is used to upsample the features to an appropriate size and extract the linear features of the road. Each strip convolution block contains four strip convolution layers in different directions to capture contextual information, which is then connected to the corresponding convolution layer feature map in the encoder. After the data passes through the decoder, the second feature map is output, and the teacher model is finally output as the prediction result.

[0051] Optional, reference Figure 3 As shown in the figure, the pruned CoANet can be used as the teacher model. That is, the convolution layer, the atrous spatial convolution pooling pyramid layer, and the strip convolution block are pruned. The convolution layer is automatically pruned using the DepGraph method. The atrous spatial convolution pooling pyramid layer is replaced with the basic 1X1 convolution pool. The decoder is manually pruned, and the pruning rate is calculated using the prune function. According to the pruning rate, the number of channels of the four strip convolution blocks of the decoder is changed from 256, 512, 256, and 128 to 256, 50, 128, and 64 respectively. The pruned model is used as the teacher model, and the input data , after passing through the encoder, the first feature map is output , the data passes through the decoder and outputs the second feature map , the final output of the teacher model is as a predicted result.

[0052] Considering that the knowledge provided by the output layer of the teacher model is limited, the feature knowledge with stronger expressive power can be transferred to the student model in the middle layer of the model. The middle layer knowledge stores the high-dimensional features extracted by the middle layer components of the neural network. The middle layer knowledge of the teacher model is used to guide the student model, so that the student model can fit more quickly and correctly.

[0053] The middle layer is used for knowledge distillation, which is called isomorphic distillation. Isomorphic distillation means that the teacher model and the student model have similar architectures, and there is a one-to-one correspondence between layers or blocks, without considering the mismatch of feature map sizes. Figure 4 As shown in Figure 1, the architecture of the student model is similar to that of the teacher model, and is also an encoder-decoder structure. The encoder-decoder structure of the student model is also similar to that of the teacher model. That is, the student model is constructed using CoANet. The neural network of the student model adopts an encoder-decoder architecture. The number of layers of the student model neural network is less than that of the teacher model neural network. After the data passes through the encoder, the third feature map is output. , after the decoder outputs the fourth feature map . That is, the student model input data , the data passes through the encoder and outputs the third feature map , after the decoder outputs the fourth feature map , the final output as a predicted result.

[0054] The number of layers of the student model neural network is less than the number of layers of the teacher model neural network reference Figure 6 , Figure 7 As shown in the figure, the student model modifies the encoder network ResNet101 into the neural network ResNet-50 based on the teacher model, and the rest of the model remains unchanged. ResNet50 has 51 fewer layers in the third module than ResNet101, and has a shallower network structure than ResNet101, requiring less computing time and resources, so it is used as the backbone network of the student model. Figure 6 A x A in the above formula represents the size of the convolution kernel, and the convolution layer is represented by (convolution kernel size, number of channels); Figure 7 K represents the number of channels, S represents the stride, and P represents padding.

[0055] Compared with using only label distillation, intermediate-layer knowledge distillation can obtain richer information, greatly improve the ability of knowledge transfer, and enhance the effect of distillation training.

[0056] The distillation process consists of 2 stages:

[0057] Phase 1: Acquisition of intermediate knowledge of the student model. The intermediate knowledge of the present invention consists of two parts: the feature map in the teacher model and Using isostructural distillation, and Corresponding to the feature map in the student model and , by minimizing the loss and To make the feature map Fitting , Fitting , in order to achieve the learning of the teacher model by the middle layer of the student model;

[0058] The formula for minimizing the loss fit is as follows:

[0059]

[0060] Among them, S and T represent the image data of the student model and the image data of the teacher model respectively. Data S is an abstract symbol representing the feature map of a certain part of the output of the student model. Data T is an abstract symbol representing the feature map of a certain part of the output of the teacher network. , , , is a practical symbol. and When the loss Put it into the position of S, Substitute T into the position calculation, is a pixel in the data S, which stores a number representing the pixel value of the pixel (normalized to 0~1). is a pixel in the data T, which stores a number representing the pixel value of the pixel (normalized to 0~1). N is the feature map and The total number of elements (total pixels) in N = batch × channel × width × height, batch is the number of samples selected for one training, channel is the number of channels, width is the width, and height is the height. The value range of i is 1~N, where the formula It means that each time a point at the corresponding position of the N pixels of the feature map S and T is taken, the difference between them is calculated. Then the formula calculates the difference of all pixels from the 1st to the Nth point and then calculates their average to get the loss.

[0061] Phase 2: Acquisition of output layer knowledge of the student model. The output layer knowledge acquisition consists of two parts. The first part refers to the output layer of the student model segmentation branch learning the output layer knowledge of the teacher model segmentation branch by minimizing the binary cross entropy loss BCELoss ( )accomplish.

[0062] The formula for minimizing the binary cross entropy loss is as follows:

[0063] Where N is the same as N in the minimization loss fitting formula, The fourth characteristic graph The split branch, The second feature map The split branch, for A pixel point in the image, which stores a number representing the pixel value of the pixel point (normalized to 0~1), for A pixel point in , which stores a number representing the pixel value of the pixel point (normalized to 0~1), and the value range of i is 1~N;

[0064] The second part refers to the knowledge of labels learned by the output layer of the student model, i.e. Learn label knowledge, which includes segmentation branch and connected branch learning label knowledge. The degree of fit of segmentation branch learning is measured by DiceLoss and BCELoss. The degree of fit of connected branch learning is measured by BCELoss. The total loss Out_Loss of the student model and the label is the weighted sum of the segmentation branch loss and the connected branch loss.

[0065]

[0066] Among them, α is a bias term used to smooth the calculation results; label is the ground truth image (Ground Truth), which is the label of machine learning, i One of the pixels in the label;

[0067] The total loss of the student model and labels is as follows:

[0068]

[0069]

[0070] , where a and b are constants, and The fourth characteristic graph The connected branches of for The true value label of for The true value label of for The true value label of

[0071] The total loss of the knowledge distillation process is as follows:

[0072] MSELoss( )+MSELoss( )+ +Out_Loss;

[0073] Conduct the first target training, the first target training uses MSELoss ( , ) performs multiple iterations, and when the error is less than the specified threshold d1, performs the second target training;

[0074] The second target training uses MSELoss ( , ) performs multiple iterations, and when the error is less than the specified threshold d2, performs the third target training;

[0075] The third objective training uses c×BCELoss(S sem , T sem )+d×Out Loss, c and d are weights;

[0076] The model outputs the results after training based on the third objective.

[0077] The following is a specific data example:

[0078] 1) Dataset

[0079] The teacher network uses the pre-trained CoANet. For the training of the student model, the dataset used is the DeepGlobe road dataset, which includes 8570 RGB three-channel satellite remote sensing images. The image resolution is 1024×1024, the spatial resolution is 0.5 meters per pixel, covering a land area of ​​2220 square kilometers, covering a variety of road types in urban and rural areas. Among the 8570 RGB three-channel satellite remote sensing images, 6226 labeled images are open source. Therefore, among these 6226 labeled images, 4696 images are divided as training sets and 1530 as test sets. The training set is cropped into 512X512 size. After cropping, the total training data is 18784. At the same time, the labels corresponding to the prediction results of the connected branches of the student model are produced through the road segmentation labels of the training data set according to the neighboring pixels d=1 and d=3.

[0080] 2) Evaluation Metrics

[0081] mIoU (Intersection over Union) is the average intersection over union ratio, which calculates the average ratio of the intersection and union of all categories.

[0082]

[0083] F1 Score is the harmonic mean of precision and recall, which is used to comprehensively reflect the performance of the algorithm;

[0084] F1=2× ÷

[0085]

[0086]

[0087] Among them, K represents the number of categories, TP is the pixel point of TP, TP is the true positive, which means the number of road pixels that are correctly identified; FN is the false negative, which means the number of road pixels identified as non-road pixels. is the pixel point of FN; FP means false positive, which means the number of non-road pixels identified as road pixels. The precision rate (Precision) refers to the ratio of the number of samples correctly predicted as positive examples (TP) by the classifier to the number of all samples classified as positive examples (TP + FP). The recall rate (Recall) refers to the ratio of the number of samples correctly predicted as positive examples (TP) by the classifier to the number of all actual positive examples (TP + FN). These two evaluation indicators are used because they are widely used in the fields of computer vision and pattern recognition. The F1 indicator has good robustness to unbalanced data, and the mIoU indicator calculates the ratio of the overlapping area between the predicted result and the true label to the joint area, which can provide a global segmentation quality assessment.

[0088] 3) Implementation details

[0089] The student network was trained using the stochastic gradient descent (SGD) optimizer with momentum set to 0.9 and weight_decay set to 5×10. -4. The epoch is set to 300 and the bitch size is set to 7. The initial learning rate is set to 0.01. When the number of iterations reaches 150, 180, and 210, the learning rate is reduced to 0.1 times the original value. The deep learning framework PyTorch is used to run the model. During the training process, data enhancement methods such as random rotation, horizontal flipping, Gaussian blurring, and rescaling are used to improve the generalization ability of the model. The mean and variance of the Imagenet dataset are used to normalize the training data.

[0090] 4) Training strategy

[0091] Training goal 1: Feature map of the student model required Fit the feature map of the teacher model as closely as possible , use loss1=MSELoss( , ). After 5 iterations, the error is less than the specified threshold d1=5×10 -3 , carry out training objective 2.

[0092] Training goal 2: Feature map of the student model required Fit the feature map of the teacher model as closely as possible , using loss2 = MSELoss( , ), the error is less than the specified threshold d2=5×10 after 11 iterations. -2 , carry out training goal 3.

[0093] Training goal 3: The prediction value of the student model is required to be as consistent as possible with the prediction value and label of the teacher model, that is, Fit as much as possible and label, using loss loss3 = c × BCELoss (S sem , T sem )+d×Out Loss, c and d are weights until the training is completed. Figure 8 Output results for the trained model.

[0094] An embodiment of the present invention further provides a device for a method for extracting roads from remote sensing images based on knowledge distillation, which includes a memory and a processor. The memory is used to store an embedded software program. The processor is used to execute the embedded software program stored in the memory, and when the embedded software program is executed, the steps of the method for extracting roads from remote sensing images based on knowledge distillation described in any of the above embodiments are implemented.

[0095] One embodiment of the present invention also provides a computer-readable storage medium, on which is stored a program for implementing the remote sensing image road extraction method. The program for implementing the remote sensing image road extraction method is executed by a processor to implement the steps of the remote sensing image road extraction method based on knowledge distillation described in any of the above embodiments.

[0096] To summarize, an embodiment of the present invention provides a remote sensing image road extraction method, device and readable storage medium based on knowledge distillation. On the basis of the teacher network CoANet, a student network with fewer parameters, relatively simple network structure and faster fitting speed is established, and on the basis of the output layer knowledge distillation, intermediate layer knowledge distillation is added, which can bring higher efficiency, lower cost and less energy consumption, enhance the overall road extraction effect, solve the problems of large parameters and high computational complexity of traditional methods, and can quickly and accurately complete real-time reasoning to meet the needs of real-time road extraction.

[0097] In addition, those skilled in the art should understand that, although there are many problems in the prior art, each embodiment or technical solution of the present invention can be improved in only one or several aspects, without having to solve all the technical problems listed in the prior art or background technology at the same time. Those skilled in the art should understand that the content not mentioned in a claim should not be used as a limitation on the claim.

[0098] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for extracting roads from remote sensing images based on knowledge distillation, characterized in that: The remote sensing image road extraction method based on knowledge distillation comprises the following steps: CoANet is used to build a teacher model. The teacher model uses a road dataset and divides the dataset into a test set and a training set. The neural network of the teacher model uses an encoder-decoder architecture to learn road features. After the data passes through the encoder, the first feature map is output. , after the decoder outputs the second feature map ; CoANet is used to build a student model. The student model uses a road data set. The student model's data set contains labeled remote sensing images. Some images in the labeled remote sensing images are divided as training sets, and another part of the images are used as test sets. The training set is cropped, and labels corresponding to the prediction results of the connected branches of the student model are produced based on the road segmentation labels of the training set according to the adjacent pixels. The neural network of the student model adopts an encoder-decoder architecture. The number of layers of the student model neural network is less than the number of layers of the teacher model neural network. After the data passes through the encoder, the third feature map is output , after the decoder outputs the fourth feature map ; The knowledge distillation is performed in the middle layer, which is isomorphic distillation. The third feature map is minimized by fitting the formula of loss. Fitting the first feature map , the fourth characteristic map Fitting the second feature map ; The formula for minimizing the loss fit is as follows: Among them, S and T represent the image data of the student model and the image data of the teacher model respectively, and N is the feature map and The total number of elements in N=batch×channel×width×height, batch is the number of samples selected for one training, channel is the number of channels, width is the width, and height is the height. is a pixel in the data S, is a pixel point in data T. and When the loss Put it into the position of S, Substitute T for calculation, the value range of i is 1~N, where the formula It means that each time we take a point at the corresponding position of the N pixels of the feature map S and T, we calculate the difference between them. Then the formula calculates the difference of all pixels from the 1st to the Nth point and then calculates their average to get the loss. The output layer of the student model segmentation branch learns the output layer knowledge of the teacher model segmentation branch by minimizing the binary cross entropy loss formula, which is as follows: Where N is the same as N in the minimization loss fitting formula, The fourth characteristic graph The split branch, The second feature map The split branch, for A pixel in for A pixel point in , the value range of i is 1~N; The learning fit of the segmentation branch of the student model and the teacher model is jointly measured based on DiceLoss and BCELoss; Among them, α is the bias term, label is the ground truth image, which acts as a label, label i One of the pixels in the label; The total loss of the student model and labels is as follows: Where a and b are constants, and The fourth characteristic graph The connected branches of for The true value label of for The true value label of for The true value label of The total loss of the knowledge distillation process is as follows: MSELoss( )+MSELoss( )+ +Out_Loss; Conduct the first target training, the first target training uses MSELoss ( , ) performs multiple iterations, and when the error is less than the specified threshold d1, performs the second target training; The second target training uses MSELoss ( , ) performs multiple iterations, and when the error is less than the specified threshold d2, performs the third target training; The third objective training uses c×BCELoss(S sem , T sem )+d×Out Loss, c and d are weights; The model outputs the results after training based on the third objective.

2. The method for extracting roads from remote sensing images based on knowledge distillation according to claim 1, characterized in that: The encoder-decoder architecture includes a convolution layer, a dilated spatial convolution pooling pyramid layer and a strip convolution block. When data is input, the data passes through the convolution layer to output a first feature map, and then enters the dilated spatial convolution pooling pyramid layer. The dilated spatial convolution pooling pyramid layer is used to increase the receptive field of feature points in the first feature map and capture multi-scale features. The processed first feature map is then used by the strip convolution block to extract the linear features of the road, and the second feature map is output as a prediction result.

3. The method for extracting roads from remote sensing images based on knowledge distillation according to claim 2, characterized in that: Prune the convolutional layers, atrous spatial convolutional pooling pyramid layers, and strip convolutional blocks; Use the DepGraph method to automatically prune the convolutional layer; Replace the atrous spatial convolutional pooling pyramid layer with the basic 1x1 convolutional pooling; The decoder is manually pruned, and the pruning rate is calculated by the prune function. According to the pruning rate, the number of channels of the strip convolutional blocks of the decoder is changed from 256, 512, 256, and 128 to 256, 50, 128, and 64 respectively.

4. A device for a remote sensing image road extraction method based on knowledge distillation, characterized in that: The device comprises: A memory for storing embedded software programs; A processor is used to execute the embedded software program stored in the memory, and when the embedded software program is executed, the steps of the remote sensing image road extraction method based on knowledge distillation described in any one of claims 1 to 3 are implemented.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for implementing a remote sensing image road extraction method, and the program for implementing a remote sensing image road extraction method is executed by a processor to implement the steps of the remote sensing image road extraction method based on knowledge distillation as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Railway wagon steel floor damage detection method based on knowledge distillation

    CN116703819A

  • Road scene segmentation method, system and equipment based on knowledge distillation, and medium

    CN116977712A