A class-incremental semantic segmentation method based on contrastive knowledge distillation

By employing a contrastive knowledge distillation-based approach, densely aligned knowledge distillation, and asymmetric latent space region contrastive learning strategies, this method addresses the issues of high storage requirements, catastrophic forgetting, and semantic drift in incremental category segmentation, achieving efficient incremental category learning.

CN115661450BActive Publication Date: 2026-11-27BEIHANG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211267862.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-17
Publication Date
2026-11-27
Estimated Expiration
2042-10-17

AI Technical Summary

Technical Problem

Existing incremental semantic segmentation methods suffer from high storage requirements and catastrophic forgetting and semantic drift problems, especially when there is a lack of old category data, making it difficult for the model to effectively learn new categories.

Method used

We employ a contrastive knowledge distillation approach, which utilizes a densely aligned knowledge distillation strategy, an asymmetric latent space region contrastive learning strategy, and a category-aware pseudo-label generation strategy to construct knowledge distillation loss and contrastive learning loss. This approach enhances the model's ability to distinguish new categories and reduces catastrophic forgetting and semantic drift.

Benefits of technology

Without storing old category data, it effectively solves the problems of catastrophic forgetting and semantic drift, improves the model's ability to learn new categories and make classification predictions, and saves storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115661450B_ABST
    Figure CN115661450B_ABST
Patent Text Reader

Abstract

The application discloses a kind of class incremental semantic segmentation methods based on contrastive knowledge distillation, it is related to computer vision and pattern recognition technical field, for catastrophic forgetting problem, old model is regarded as teacher model, new model is regarded as student model, the knowledge distillation strategy between teacher-student network is constructed, dense knowledge alignment is carried out from intermediate feature layer and output layer, the training of new model is constrained from neural network deep feature expression and output layer prediction probability, the inheritance of old model knowledge and the compatibility to new knowledge are realized;For semantic drift problem, in the asymmetric hidden space of high-dimensional feature distribution between old model and new model, the known class is regarded as anchor class, the corresponding feature embedding of corresponding positive sample class and negative sample class is selected, region-level positive sample pair and region-level negative sample pair are constructed, and three tuple contrastive learning loss is designed to constrain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision and pattern recognition technology, and more specifically to a category incremental semantic segmentation method based on contrastive knowledge distillation. Background Technology

[0002] Semantic segmentation is a task that assigns a label to each pixel in an image to classify the image content at the pixel level. Currently, most deep learning-based semantic segmentation methods are isolated learning methods, meaning they are trained and tested on closed datasets. When using neural networks to learn sequence tasks, the model may suffer from catastrophic forgetting after learning new tasks, causing it to perform poorly on older tasks, making continuous learning extremely difficult.

[0003] Category incremental learning is a typical task of continuous learning. Existing category incremental semantic segmentation algorithms have two main problems: First, deep learning-based semantic segmentation methods require large-scale expert annotation, and when learning new categories, both old and new category data need to be involved simultaneously, resulting in significant storage overhead. Second, most existing category incremental semantic segmentation methods require storing representative old data; otherwise, catastrophic forgetting and semantic drift problems are highly likely. Catastrophic forgetting refers to the phenomenon where, without old category data participating in model training, the model almost completely forgets the previously trained content after learning new knowledge. Semantic drift refers to the confusion between known and new categories caused by changes in model parameters after incremental learning, leading to pixel misclassification.

[0004] Therefore, how to solve the problems of catastrophic forgetting and semantic drift in the category incremental semantic segmentation task is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of this, the present invention provides a category incremental semantic segmentation method based on contrastive knowledge distillation, which eliminates the need to store representative data of old categories, saves storage space, and solves the problems of catastrophic forgetting and semantic drift.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A category-incremental semantic segmentation method based on contrastive knowledge distillation includes:

[0008] Step 1: Construct an incremental learning strategy and set the total learning category C. T Set up the incremental learning process {Step} 0 Step 1 Step T}, set in the incremental learning step Step tIn the training set, D t In the category incremental semantic segmentation task, when in D t When training the model, it is impossible to obtain the labeled data of the old categories, and only the current category C is available. t Corresponding annotations;

[0009] Step 2: Set the basic training categories and match the image samples with the annotations. The data is fed into the constructed feature extraction network to train the base model M. 0 Accordingly, the model obtained from the incremental learning training at step t is denoted as M. t ;

[0010] Step 3: Incremental learning step t t Let M be the model obtained by incremental learning in step t-1. t-1 As the teacher model T, the model M obtained by incremental learning in step t is used. t As the student model S, a knowledge distillation loss is constructed using the built dense alignment knowledge distillation strategy, transferring feature extraction capabilities to the student model S; a contrastive learning loss is constructed using the built asymmetric latent space region contrastive learning strategy, improving model M. t The ability to distinguish between known categories and newly added categories; the constructed category-aware pseudo-labeling generation strategy is used to feed the training samples into model M. t-1 We obtain pseudo-labels for known categories and fuse them pixel-level with the manually labeled labels obtained in the t-th incremental learning step to supervise M. t The training process;

[0011] Step 4: Based on the content described in Step 3, utilize the training set D t Incremental learning is performed to train the model M at step t. t ;

[0012] Step 5: Iterate through steps 3 and 4 until the number of categories learned incrementally reaches the set total number of learning categories C. T .

[0013] Preferably, the construction of knowledge distillation loss specifically includes:

[0014] Incremental learning steps at step t t In the process, the input images are fed into model M in step t-1. t-1 And the model M at step t t Extracting deep features {f l t-1 ,f l t},l∈N lWhere l represents the current feature layer of the feature extraction network, and N l This represents the total number of layers in the feature extraction network;

[0015] For the intermediate feature layer {l1,l2,l3}, feature responses of features at different scales are calculated based on the hollow spatial pooling pyramid.

[0016]

[0017]

[0018] Where Λ represents the operation of converting depth features into a one-dimensional tensor after void space pyramid pooling;

[0019] For the characteristic distillation of the intermediate layer, the distance between tensors is calculated using KL divergence:

[0020]

[0021] Where d D (·) represents the KL divergence distance. and Representing M respectively t-1 and M t For the predicted class probability of pixel i, W' and H' are the height and width of the feature embedding, respectively;

[0022] For the output layer {l out}, computational model M t-1 and model M t Feature representation after nonlinear activation layer feature tensor Similarity between Constrained output layer feature distillation;

[0023] Constructing decaying layer-aware weights:

[0024]

[0025] Where α is the initial distillation weight, and n l and N l These represent the current feature layer depth and the total number of feature layers, respectively. γ is a positive constant coefficient less than 1, and n... e and N e These represent the nth training round and the total number of training rounds, respectively.

[0026] The intermediate layer feature distillation is guided by a decaying layer-aware weight, and the intermediate layer distillation loss is:

[0027]

[0028] The output layer distillation loss is:

[0029]

[0030] Based on the intermediate layer distillation loss L IL-D With output layer distillation loss L OL-D The loss function L of the dense alignment-based knowledge distillation strategy is calculated. DADA :

[0031] L DADA =L IL-D +λL OL-D

[0032] Where λ is a constant coefficient used to balance the contributions of the intermediate feature layer and the output layer in knowledge distillation.

[0033] Preferably, the specific steps of the asymmetric latent space region contrastive learning strategy are as follows:

[0034] Construct a category-aware mask M for category k k :

[0035]

[0036]

[0037] Where m ij For matrix M k The element in the i-th row and j-th column, where H' and W' are the height and width of the feature embedding, respectively. p represents a real matrix space of dimension H′×W′. ij The category to which the pixel in the i-th row and j-th column belongs in the model prediction results;

[0038] Calculate the anchor category embedding of a specified category i based on a category-aware mask. Positive sample class embedding and negative sample class embedding

[0039]

[0040]

[0041]

[0042] Where M i Used to filter the feature embedding of class i in the latent space. Step represents the incremental learning step t-1. t-1 The category-aware mask for embedding the i-th type of features. and Step represents the incremental learning step t.t The category-aware mask for the embedding of features of class i and class k; ⊙ represents the element-wise multiplication of matrices. Represents from M t-1 The anchor point feature embedding for class i is obtained from the latent space. and Representing from M t The positive and negative sample feature embeddings of class i are obtained from the latent space; C 1:t-1 Step represents the incremental learning step t-1. t-1 The categories already learned in C t Step represents the incremental learning step t. t The categories learned in the text, where k is the category number and k≠i;

[0043] Embed the above features Transform into a one-dimensional tensor

[0044]

[0045] in represent The minimum length in;

[0046] Construct positive sample pairs and negative sample pairs And the contrastive learning loss is calculated based on the triplet function:

[0047]

[0048] Where L ARCL N represents the contrastive learning loss. c The number of categories in the dataset is represented by d(·), which is the Euclidean distance metric function, and m is a constant.

[0049] Preferably, the specific steps of the category-aware pseudo-label generation strategy are as follows:

[0050] For the t-th incremental learning step Step t The category-aware dynamic threshold is:

[0051]

[0052]

[0053] Where ξ is the initial threshold used to avoid thresholds. If the value is too small, Γ is a constant used to filter out categories with high confidence to generate the category-aware threshold.

[0054] The calculated segmentation map has the same size as the input image.

[0055]

[0056] Where argmax represents the set of points with the maximum value of the independent variable, upsample represents the upsampling operation, and Φ(f) p [p,c]) represents the probability that the model predicts the class of pixel p to be c in image I, f p The depth feature representation of pixel p;

[0057] Calculate pseudo-labeled images for each known category using category-aware dynamic thresholding and segmentation maps:

[0058]

[0059] Where L t pl,c This represents a pseudo-labeled image generated for a known category c. This represents the confidence level in predicting pixel i as category c; This represents the process of traversing the segmentation map pixel by pixel, where H and W are the segments of the image, respectively. Height and width;

[0060] Step t, the incremental step t In the middle, calculate the current model M t Supervisory information

[0061]

[0062] in This represents the image fusion process. L represents the result of image fusion of pseudo-labeled images for all known categories. t This indicates the current incremental learning step regarding category C. t Manual annotation;

[0063] Based on the supervision information constructed above, the pixel-level prediction loss for image I can be calculated using the cross-entropy function:

[0064]

[0065] Where L Seg Represents pixel prediction loss. p represents the annotation category to which pixel i belongs in the current incremental learning step. ik This represents the probability that pixel i belongs to the k-th class in the model's prediction results.

[0066] Preferably, based on pixel prediction loss L Seg Loss L of densely aligned knowledge distillation strategyDADA Comparative learning loss L ARCL Calculate the loss function L of the model total :

[0067] L total =L Seg +L DADA +L ARCL .

[0068] As can be seen from the above technical solution, compared with the prior art, this invention discloses a category incremental semantic segmentation method based on contrastive knowledge distillation, which does not require storing representative data of the old categories. Addressing the catastrophic forgetting and semantic drift problems in existing category incremental learning, this invention specifically designs a dense alignment-based knowledge distillation strategy, an asymmetric latent space region contrastive learning strategy, and a category-aware pseudo-label generation strategy. With relatively low resource requirements and consumption, it achieves compatibility with new categories while retaining the classification and prediction capabilities of the old model. Furthermore, by using incremental learning methods, it is possible to better understand and mimic the learning methods of the human brain and the structural mechanisms of biological neural networks at the system level, providing a technical foundation for developing new computational models and effective learning algorithms. Attached Figure Description

[0069] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0070] Figure 1 The attached figure is a block diagram illustrating the principle of a category incremental semantic segmentation method based on contrastive knowledge distillation provided by the present invention.

[0071] Figure 2 The attached figure is a schematic diagram of the dense alignment-based knowledge distillation strategy provided by the present invention.

[0072] Figure 3 The attached figure is a schematic diagram of the asymmetric latent space region contrastive learning strategy provided by the present invention. In the figure, bg, motorbike, person, and plant represent the four categories (background, motorcycle, person, and plant) in the Pascal VOC 2012 dataset. In this example, only the bg, motorbike, and person classes are available at step t-1, and the plant class is added at step t.

[0073] Figure 4The attached figure shows the results of the category incremental semantic segmentation based on contrastive knowledge distillation provided by this invention. In the figure, GT represents the manually labeled ground truth image, and Step-0, etc., represent the corresponding incremental learning steps. For the VOC 15-1 task, there are a total of 6 incremental steps (Step-0 to Step-5); for the ADE 100-10 task, there are a total of 6 incremental steps (Step-0 to Step-5); and for the ISPRS 2-1 task, there are a total of 4 incremental steps (Step-0 to Step-3). Detailed Implementation

[0074] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0075] This invention discloses a category incremental semantic segmentation method based on contrastive knowledge distillation, such as... Figure 1 As shown, for the image and annotation input in the t-th incremental learning step, they are respectively fed into M. t-1 and M t Among them, M t-1 Parameter freezing means that parameters are not updated during training; M t The parameters are trainable. Using M t-1 For M t Perform knowledge distillation and construct a knowledge distillation loss to help improve M. t The ability to classify existing categories. Specifically for M. t-1 and M t For the deep features extracted from the input at step t, a category-aware mask is used to filter feature tensors belonging to the same category and feature tensors belonging to different categories. Based on this, positive and negative sample pairs are constructed. A contrastive learning loss is constructed with the optimization objective of "pulling in similar categories and pushing away dissimilar categories" to alleviate the semantic drift problem in the incremental learning process. Finally, the knowledge distillation loss, the contrastive learning loss, and the pixel prediction loss from the semantic segmentation task are added together to achieve end-to-end model training.

[0076] Specifically, the following steps are included:

[0077] Step 1: Construct an incremental learning strategy and set the total learning category C. T Set up the incremental learning process {Step} 0 Step 1 Step T}, set in the incremental learning step Step tIn the training set, D t In the category incremental semantic segmentation task, when in D t When training the model, it is impossible to obtain the labeled data of the old categories, and only the current category C is available. t Corresponding annotations;

[0078] Step 2: Set the basic training categories and match the image samples with the annotations. The data is fed into the constructed feature extraction network to train the base model M. 0 Accordingly, the model obtained from the incremental learning training at step t is denoted as M. t ;

[0079] Step 3: Incremental learning step t t Let M be the model obtained by incremental learning in step t-1. t-1 As the teacher model T, the model M obtained by incremental learning in step t is used. t As the student model S, a knowledge distillation loss is constructed using the built dense alignment knowledge distillation strategy, transferring feature extraction capabilities to the student model S; a contrastive learning loss is constructed using the built asymmetric latent space region contrastive learning strategy, improving model M. t The ability to distinguish between known categories and newly added categories; the constructed category-aware pseudo-labeling generation strategy is used to feed the training samples into model M. t-1 We obtain pseudo-labels for known categories and fuse them pixel-level with the manually labeled labels obtained in the t-th incremental learning step to supervise M. t The training process;

[0080] Step 4: Based on the content described in Step 3, utilize the training set D t Incremental learning is performed to train the model M at step t. t ;

[0081] Step 5: Iterate through steps 3 and 4 until the number of categories learned incrementally reaches the set total number of learning categories C. T .

[0082] Furthermore, in the intensive prediction task of semantic segmentation, since each pixel needs to be assigned a category label, the utilization of contextual semantic information is particularly important. Therefore, densely aligned knowledge distillation helps the new model inherit the feature extraction and classification capabilities of the old model for existing categories. To address the catastrophic forgetting problem in incremental semantic segmentation, this invention proposes a densely aligned knowledge distillation strategy (DADA). This strategy performs knowledge distillation simultaneously from the intermediate feature layers and the output layer of the feature extraction network. By considering both the details of shallow features and the semantic expression of deep features, it improves the robustness of knowledge distillation in intensive prediction tasks like semantic segmentation. Figure 2 As shown, intensive knowledge distillation uses a ResNet residual network as the feature extraction network, which contains four feature layers {l1, l2, l3, l...} out Incremental learning step t. t In the process, the input images are sent to M in batches. t-1 and M t Extracting deep features {f l t-1 ,f l t},l∈N l For the intermediate feature layers {l1, l2, l3}, Atrous Spatial Pyramid Pooling (ASPP) is used to calculate the feature responses of features at different scales.

[0083]

[0084] Where Λ represents the operation of transforming depth features into a one-dimensional tensor after voided spatial pyramid pooling. For distillation of intermediate feature layers, the distance between tensors is calculated using Kullback-Leibler (KL) divergence:

[0085]

[0086] Where d D (·) represents the KL divergence distance. and Representing M respectively t-1 and M t For the predicted class probability of pixel i, W' and H' are the height and width of the feature embedding, respectively.

[0087] For the output layer {l out}, calculate M t-1 and M t Feature representation after nonlinear activation layer feature tensor Knowledge distillation is constrained by the similarity between the components. Specifically, the calculation method is as follows:

[0088] Because the feature representations of different layers in a deep neural network are specifically different—shallow layer features focus on expressing image texture, grayscale, and other detailed features, while deep layer features focus on expressing image semantics—this invention designs a decaying layer-aware weight as follows:

[0089]

[0090] Where α is the initial distillation weight, and n l and N l Representing the current feature layer depth and the total number of feature layers respectively, γ is a positive constant coefficient less than 1, and n e and N e Let represent the nth training epoch and the total number of training epochs, respectively. The intermediate layer feature distillation is guided by the aforementioned decaying layer-aware weights, and its loss function is:

[0091]

[0092] The output layer distillation loss is:

[0093]

[0094] In summary, the loss function L of the above-mentioned dense alignment-based knowledge distillation strategy... DADA L lost due to intermediate layer distillation IL-D With output layer distillation loss L OL-D composition:

[0095] L DADA =L IL-D +λL OL-D (6)

[0096] Where λ is a constant coefficient used to balance the contributions of the intermediate feature layer and the output layer in knowledge distillation.

[0097] Furthermore, to address the semantic drift problem in incremental semantic segmentation, this invention proposes an Asymmetric Region-wise Contrastive Learning (ARCL) strategy within an asymmetric latent space, such as... Figure 3As shown, the core idea of ​​this method is to narrow the distribution distance between feature embeddings of the same class and widen the distribution distance between feature embeddings of different classes in the high-dimensional latent space of the feature embedding distribution, thereby improving the separability of features. Since the number of classes included in step t of incremental learning is different from that in step t-1, the latent spaces of their high-dimensional feature embedding distributions are asymmetric. This method can alleviate the semantic drift problem in incremental semantic segmentation, thereby reducing pixel misclassification.

[0098] First, in each incremental learning step, due to the lack of labeled data for known categories and the existence of only labeled data for the current category, the background category in the current step implicitly includes both known and unknown categories. To improve the model's ability to extract and discriminate features from known, current, and unknown categories, the following region-level feature embedding contrastive learning method within an asymmetric latent space is constructed:

[0099] like Figure 3 As shown, based on M t-1 Output depth features f t-1 Obtain the feature embeddings of anchor categories, based on M t Output depth features f t Obtain the feature embeddings of the positive and negative sample classes, f t-1 yes The unified representation of f t yes A unified representation. To achieve this goal, a category-aware mask M is constructed for category k. k as follows:

[0100]

[0101] Where m ij For matrix M k The element in the i-th row and j-th column, where H' and W' are the height and width of the feature embedding, respectively, p ij Let M be the category of the pixel in the i-th row and j-th column of the model prediction result. Apply the above category-aware mask M... k Applied to {M t-1 M t The deepest feature of} in N d W d and H d These are the deepest features. The number of channels, width, and height; the deepest feature is the output of the deepest feature layer of the feature extraction network.

[0102] For a given category i, its anchor category embedding Positive sample class embedding and negative sample class embedding The generation method is as follows:

[0103]

[0104] Where M i Used to filter the i-th type of feature embedding in the latent space, where ⊙ denotes element-wise multiplication of matrices. Represents from M t-1 The anchor point feature embedding for class i is obtained from the latent space. and Represents from M t The feature embeddings of positive and negative samples of class i are obtained from the latent space. Specifically, since M... t The training process faces the problem of catastrophic forgetting of known categories, therefore, from M... t-1 Obtain from the hidden space This is to improve the accuracy of anchor point category feature embedding. Furthermore, to efficiently calculate intra-class aggregation and inter-class drift, the above features are embedded... Transform into a one-dimensional tensor:

[0105]

[0106] in represent The minimum length in the [process]. The above feature embedding selection mechanism is applied to each image batch during model training to construct positive sample pairs. and negative sample pairs Calculate the contrastive learning loss using the triplet function:

[0107]

[0108] Where L ARCL N represents the contrastive learning loss. c The number of categories in the dataset is represented by d(·), which is the Euclidean distance metric function, and m is a constant.

[0109] Furthermore, the category incremental method proposed in this invention does not require storing old data; instead, it uses a pseudo-label generation method to obtain supervision information for known categories. This invention designs a category-aware pseudo-label generation strategy based on a dynamic threshold. The design principle is that pseudo-labels for simple categories with high prediction scores have high confidence, while pseudo-labels for difficult categories with low prediction scores have low confidence. Compared to pseudo-label generation methods with fixed thresholds, the designed category-aware pseudo-label generation strategy can adaptively adjust the confidence threshold for categories of different difficulty levels, thereby effectively alleviating the semantic drift problem of background categories during incremental learning. Specifically, for the t-th incremental learning step... tThe category-aware dynamic threshold is:

[0110]

[0111]

[0112] Where ξ is the initial threshold used to avoid thresholds. If the value is too small, Γ is a constant used to filter out categories with high confidence to generate the category-aware threshold. Because... Therefore when At lower A high threshold is used, and vice versa. Specifically, the model outputs a segmentation map of the same size as the input image. Its generation method can be expressed as:

[0113]

[0114] Where argmax represents the set of points with the maximum value of the independent variable, and upsample represents the upsampling operation. Φ(f p [p,c]) represents the probability that the model predicts the class of pixel p to be c in image I, f p This represents the depth features of pixel p. The pseudo-label generation method for each known category is as follows:

[0115]

[0116] Where L t pl,c This represents a pseudo-labeled image generated for a known category c. This represents the confidence level for predicting pixel i as category c. This represents the process of traversing the segmentation map pixel by pixel, where H and W are the segments of the image, respectively. The height and width.

[0117] For the pseudo-labeled images generated for the known category c, each pseudo-labeled image is fused together to obtain... Simultaneously utilize The operation performs pixel-level fusion of the fused pseudo-annotated image with the manually annotated image of the current category to obtain the supervision information for the t-th incremental step.

[0118]

[0119] in This represents the image fusion process. Based on the supervision information constructed above, the pixel-level prediction loss for image I can be calculated using the cross-entropy function:

[0120]

[0121] Where L Seg Represents pixel prediction loss. p represents the annotation category to which pixel i belongs in the current incremental learning step. ik This represents the probability that pixel i belongs to the k-th class in the model's prediction results.

[0122] Furthermore, the model's loss function L total It consists of three parts, namely the pixel prediction loss L Seg Knowledge distillation loss L DADA Comparative learning loss L ARCL :

[0123] L total =L Seg +L DADA +L ARCL (16)

[0124] To demonstrate the superiority of the method of the present invention, the following experiments were conducted:

[0125] The effectiveness of the proposed incremental semantic segmentation method was verified on three general semantic segmentation datasets: Pascal VOC 2012, ADE20K, and ISPRS. Pascal VOC 2012 contains 20 classes, ADE20K contains 150 classes, and ISPRS contains 5 classes. For these datasets, the incremental semantic segmentation settings were 15-1, 100-10, and 2-1, respectively. The meaning of these settings is as follows: for VOC 15-1, the first step learns 15 classes, and then each incremental learning step learns 1 class, for a total of 6 incremental learning steps; for ADE 100-10, the first step learns 100 classes, and then each incremental learning step learns 10 classes, for a total of 6 incremental learning steps; for ISPRS 2-1, the first step learns 2 classes, and then each incremental learning step learns 1 class, for a total of 4 incremental learning steps. Ablation experiments were conducted on these three semantic segmentation datasets, using the average intersection-union ratio (OCU) as the evaluation metric. The results are shown in Table 1. Experimental results show that, compared with traditional isolated learning methods, the knowledge distillation strategy, contrastive learning strategy, and category-aware pseudo-label generation strategy proposed in this invention can all effectively improve the performance of category-increment semantic segmentation tasks. The semantic segmentation results are shown in the figure below. Figure 4 As shown.

[0126] Table 1. Experimental results of category-increment semantic segmentation ablation based on contrastive knowledge distillation.

[0127]

[0128] Among them, fine-tuning represents isolated learning, that is, training only using the current category label; IL-D represents intermediate layer knowledge distillation; OL-D represents output layer knowledge distillation; ARCL represents asymmetric latent space region contrastive learning; CPL represents category-aware pseudo-label generation; and all represents the average intersection-union ratio of all categories.

[0129] Example 2:

[0130] Performance verification was conducted on the ISPRS semantic segmentation dataset under three categories of incremental semantic segmentation settings (4-1, 2-3, 2-1). Experimental results show that the method proposed in this invention has a comprehensive performance advantage in terms of average intersection-union ratio compared with four existing representative similar methods (EWC, ILT, MiB, PLOP).

[0131] Table 2 Performance comparison of the segmentation method of this invention with four existing similar methods

[0132]

[0133]

[0134] Here, "offline" represents the traditional deep learning training method, which means that all categories of annotations can be obtained in a single training session. This setting can be used as the performance ceiling for semantic segmentation models.

[0135] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0136] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A category incremental semantic segmentation method based on contrastive knowledge distillation, characterized in that, include: Step 1: Construct an incremental learning strategy and set the total learning categories. Set up an incremental learning process Set in incremental learning steps In the training set, In the category incremental semantic segmentation task, when in When training the model, it is impossible to obtain the labeled data of the old categories, and only the current category is available. Corresponding annotations; Step 2: Set the basic training categories and match the image samples with the annotations. The data is fed into the constructed feature extraction network to train the base model. Accordingly, the model obtained from the incremental learning training at step t is denoted as... ; Step 3: Incremental learning step t Let the model obtained by incremental learning in step t-1 be denoted as As the teacher model T, the model obtained from the incremental learning training at step t. As the student model S, a knowledge distillation loss is constructed using the built dense alignment knowledge distillation strategy, transferring feature extraction capabilities to the student model S; a contrastive learning loss is constructed using the built asymmetric latent space region contrastive learning strategy to improve the model. The ability to distinguish between known categories and newly added categories; the constructed category-aware pseudo-labeling generation strategy is used to feed the training samples into the model. We obtain pseudo-labels for known categories and fuse them pixel-wise with the manually labeled labels obtained in the t-th incremental learning step for supervision. The training process; Step 4: Based on the content described in Step 3, utilize the training set Incremental learning is performed to train the model at step t, resulting in a well-trained model. ; Step 5: Iterate through steps 3 and 4 until the number of categories learned incrementally reaches the set total number of learning categories. ; The specific loss from constructing knowledge distillation includes: Incremental learning steps at step t In this process, the input images are fed into the model in step t-1. and the model at step t Extracting depth features ;in This represents the current feature layer of the feature extraction network. This represents the total number of layers in the feature extraction network; For intermediate feature layers Calculating feature responses at different scales based on void space pooling pyramid : in, This represents the operation of converting depth features into a one-dimensional tensor after void space pyramid pooling. For the characteristic distillation of the intermediate layer, the distance between tensors is calculated using KL divergence: in Let KL be the divergence distance. and Represent and For the predicted class probability of pixel i, and These are the height and width of the feature embedding, respectively; For the output layer Computational model and model Feature representation after nonlinear activation layer feature tensor similarity between Constrained output layer feature distillation; Constructing decaying layer-aware weights: in To initialize distillation weights, and These represent the current feature layer depth and the total number of feature layers, respectively. For positive constant coefficients less than 1, and These represent the nth training round and the total number of training rounds, respectively. The intermediate layer feature distillation is guided by a decaying layer-aware weight, and the intermediate layer distillation loss is: The output layer distillation loss is: Based on intermediate layer distillation loss With output layer distillation loss Compute the loss function of the dense alignment-based knowledge distillation strategy : in The constant coefficient is used to balance the contributions of the intermediate feature layer and the output layer in knowledge distillation; the specific steps of the asymmetric latent space region contrastive learning strategy are as follows: Construct a category-aware mask for category k : in For matrix The Middle i Line number j Column elements, and These represent the height and width of the feature embedding, respectively. Representative dimension is The real matrix space, The first in the model prediction results i Line number j The category to which the column pixels belong; Calculate the specified category based on a category-aware mask. Anchor category embedding Positive sample class embedding and negative sample class embedding : in Used for filtering in the implicit space i Class feature embedding, This represents the incremental learning step at step t-1. Regarding the first i Category-aware masks with class feature embeddings and These represent the t-th incremental learning steps, respectively. Regarding the first i Class and First k Category-aware masks with class feature embedding; This indicates element-wise multiplication of matrices. Representative from The information about the first obtained from the hidden space i Class anchor feature embedding, and Representing from The information about the first obtained from the hidden space i Positive sample feature embedding and negative sample feature embedding of the class; Represents the incremental learning step at step t-1. The categories already learned in the course, Represents the t-th incremental learning step Categories of learning in China k For category number and k≠i, These represent category-aware masks. Applied to the model , The deepest feature; Embed the above features Transform into a one-dimensional tensor : in represent The minimum length in; Construct positive sample pairs and negative sample pairs And the contrastive learning loss is calculated based on the triplet function: in Represents the contrast learning loss. Represents the number of categories in the dataset. It is a Euclidean distance metric function. It is a constant; The specific steps of the category-aware pseudo-label generation strategy are as follows: For the t-th incremental learning step Category-aware dynamic threshold for: in Initialize the threshold to avoid threshold The value is too small. A constant is used to filter out categories with high confidence to generate a category-aware threshold. ; The calculated segmentation map has the same size as the input image. : Where argmax represents the set of points with the maximum value of the independent variable, and upsample represents the upsampling operation. This represents the probability that the model predicts the class of pixel p to be c in image I. The depth feature representation of pixel p; Calculate pseudo-labeled images for each known category using category-aware dynamic thresholding and segmentation maps: in This represents a pseudo-labeled image generated for a known category c. Indicates pixels i The confidence level for predicting class c; This represents the process of traversing the segmentation map pixel by pixel, where H and W are the segments of the image, respectively. Height and width; Incremental step at step t In the middle, calculate the current model Supervisory information : Where ⊕ represents the image fusion process, This represents the result of image fusion of pseudo-labeled images for all known categories. This indicates the category in the current incremental learning step. Manual annotation; Based on the supervisory information constructed above, for images The pixel-level prediction loss can be calculated using the cross-entropy function: in Represents pixel prediction loss. Representing pixels i The annotation category in the current incremental learning step. The pixel in the representative model prediction result i Belongs to the k The probability of a class.

2. The category incremental semantic segmentation method based on contrastive knowledge distillation according to claim 1, characterized in that, Based on pixel prediction loss Loss of densely aligned knowledge distillation strategy Comparative learning loss Calculate the loss function of the model : 。

Citation Information

Patent Citations

  • Super-resolution model compression and acceleration method based on self-distillation contrast learning

    CN113538233A

  • Continuous learning method, system and equipment for image semantic segmentation network and storage medium

    CN114332466A

  • Human body behavior recognition method based on consistent semi-supervised deep learning

    CN115188022A