A semi-supervised semantic segmentation method guided by high-density representative prototypes
Through the method of high-density representative prototype guidance, labeled and unlabeled data are used for strong and weak augmented consistency training and Gaussian model transformation, which solves the problem of confirmation bias in semi-supervised semantic segmentation and achieves high performance with a small amount of labels. semantic segmentation effect.
Patent Information
- Application Number
- CN202311765725.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2043-12-21
AI Technical Summary
Existing semi-supervised semantic segmentation methods are prone to confirmation bias and cannot effectively utilize unlabeled data, causing the model to be unable to correct misjudgments and strengthen misunderstandings.
Using the method guided by high-density representative prototypes, by obtaining labeled data and unlabeled data with pixel-level annotations, warm-up training and strong-weak augmentation consistency training are performed, and a mixed Gaussian model and a normalized flow model are constructed to extract High-density prototypes use contrastive learning to optimize feature clustering, and combine pseudo-labels and real labels for supervised training to reduce confirmation bias.
It achieves a high-performance semantic segmentation model with a small amount of annotated data, improves the model's generalization ability and segmentation accuracy, significantly alleviates confirmation bias, and improves the overall performance of the segmentation task.
Smart Images

Figure CN117437426B
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and machine learning, and more specifically, to a semi-supervised semantic segmentation method guided by high-density representative prototypes. Background Art
[0002] Semi-supervised semantic segmentation is a computer vision technique that combines supervised and unsupervised learning methods to understand and classify each pixel in an image. This technique was proposed to solve a major problem in fully supervised semantic segmentation: fully supervised learning requires a large amount of annotated data, which is usually time-consuming and costly to obtain.
[0003] In semi-supervised semantic segmentation, a small amount of labeled data and a large amount of unlabeled data are used. The advantage of this method is that it can utilize the potential information of unlabeled data, thereby reducing the dependence on a large amount of labeled data while maintaining high segmentation accuracy.
[0004] The current mainstream practices include:
[0005] Self-training: This method first uses labeled data to train the model, and then uses this model to predict unlabeled data to generate pseudo labels. Then, the model is trained by combining the real labels and pseudo labels. The key to this method is how to generate high-quality pseudo labels and reduce noise.
[0006] Consistency Regularization: This method relies on the assumption that the model should be invariant to small changes in the input. That is, even if the input image is slightly perturbed, the output of the model should remain consistent. This can be achieved by applying slight changes to the unlabeled data and ensuring that the model output is consistent. The above methods are all trying to exploit the potential of unlabeled data and reduce the need for a large amount of manually labeled data while maintaining or improving segmentation accuracy. However, in the above methods, the models all rely on their own judgment for training, which is prone to confirmation bias, resulting in the model being unable to correct its own wrong judgments and continuing to strengthen the wrong cognition. Confirmation bias refers to the bias caused by the tendency to find, interpret, and focus on information consistent with the pre-assumptions during model training, while ignoring or underestimating evidence that contradicts it. Specifically, in self-training, the model relies on its own knowledge to generate pseudo-labels on unlabeled data for self-supervision, thereby strengthening its own mistakes and being unable to correct them. Summary of the invention
[0007] In order to solve at least one of the above technical problems, the present invention proposes a semi-supervised semantic segmentation method guided by high-density representative prototypes.
[0008] The first aspect of the present invention provides a semi-supervised semantic segmentation method guided by a high-density representative prototype, comprising:
[0009] S1, obtain a data set, which includes a labeled segmentation data set with pixel-level annotations and a large number of unlabeled data sets, initialize the model with random parameters, and warm up the model with the labeled segmentation data set;
[0010] S2, perform strong and weak augmentation transformation on the unlabeled data, obtain pseudo labels on the weak augmentation data, use the pseudo labels to supervise the prediction of strong augmentation samples, and perform consistency training on strong and weak augmentation of the model;
[0011] S3, constructing a mixed Gaussian model as the target distribution, and using the normalized flow model to map the data features to the target Gaussian distribution through maximum likelihood calculation;
[0012] S4, extract the mean feature of each Gaussian model, use the normalized flow model to perform inverse transformation, and project the mean feature back to the original feature distribution as a high-density prototype for each category;
[0013] S5, using contrastive learning to reduce the distance between features of the same category and the high-density prototype of the category, and increase the distance between features of the same category and prototypes of other categories, increase the density of feature clustering; improve the pixel classification performance of the segmentation model decoder;
[0014] S6, extract the test image features, obtain the segmentation decoder prediction, and compare the image features with the high-density prototype to obtain a second set of predictions; the two sets of predictions are fused to obtain the final segmentation result.
[0015] In a preferred embodiment of the present invention, a data set is obtained in step S1, and the data set includes a labeled segmentation data set with pixel-level annotations and a large number of unlabeled data sets, specifically including:
[0016] The labeled segmentation dataset is denoted as The unlabeled dataset is denoted as Where x is the image data and y is the mask containing pixel-level annotations;
[0017] The pixel-level annotation is the classification mask of the image, which is equal to the size of the image; each position in the mask is set with a number representing the category, corresponding to the classification label of the image pixel at that position; the labeled data is the image with the annotated mask, which is used for the supervised training part of the model;
[0018] The unlabeled data only contains input images, which are used for self-training and augmented consistency training based on pseudo-labels.
[0019] In a preferred embodiment of the present invention, the model is a segmentation network, and the segmentation network includes a backbone network and a decoder; the backbone network is pre-trained by ImageNet to initialize parameters, and the segmentation decoder parameters are randomly initialized;
[0020] The backbone network encodes the input image to obtain a feature vector; the decoder processes the feature vector to obtain the segmentation prediction result;
[0021] The feature vector is used as the input data of the normalized flow model to learn the feature density.
[0022] In a preferred embodiment of the present invention, the segmentation network is warmed up on a labeled data set and supervised by using a pixel-level cross entropy function. The supervised loss function of the training is:
[0023]
[0024] Where N is the number of pictures, HW is the picture size, l ce is the cross entropy function.
[0025] In a preferred embodiment of the present invention, the augmented consistency training step in step S3 is as follows:
[0026] The network trained by warm-up is used in the unlabeled dataset D u Perform category prediction for unlabeled data Perform strong and weak augmentation respectively to obtain different augmented versions;
[0027] Use the model to predict different augmented versions and get the category probability.
[0028] The pseudo-labels are obtained by weakly augmented probability prediction through one-hot encoding, and the label filtering mechanism is used to filter out low-confidence pseudo-labels;
[0029] Use pseudo labels to supervise the training of strong augmented sample predictions;
[0030] The training objective function is:
[0031]
[0032] Where N is the number of images, HW is the image size, and τ is the confidence threshold, which is set to 0.95; l ce is the cross entropy function; is the model's prediction of the jth pixel on the i-th strongly augmented image; is the model's prediction of the jth pixel on the i-th weakly augmented image; is the pseudo label obtained by weak augmentation prediction; represents the indicator function, when When the conditions are met, The value is 1; when When the conditions are not met, The value is 0;
[0033] The formula for calculating the class probability is:
[0034]
[0035] in is the image strong augmentation strategy, It is a weak image augmentation strategy.
[0036] In a preferred embodiment of the present invention, the mixed Gaussian model is a joint model including multiple individual Gaussian models, and the features of each category correspond to an individual Gaussian model; the number of individual Gaussian models is consistent with the number of categories in the training set, and the specific form of the mixed Gaussian model is:
[0037]
[0038] Where z is the feature transformed by the normalized flow model, K is the total number of feature categories, μ k ,∑ k is the mean and covariance matrix of the kth Gaussian.
[0039] In a preferred embodiment of the present invention, the training method for the normalized flow model is as follows:
[0040] Get the real label and pseudo label, and establish a connection between the feature and the corresponding Gaussian model through the real label and pseudo label;
[0041] Calculate the likelihood of labeled features and unlabeled features. The specific form is:
[0042]
[0043] in, is the normalized flow model;
[0044] The parameters of the normalized flow model are learned through the maximum likelihood objective function, and the connection between the image features of each category and the corresponding Gaussian distribution is established;
[0045] The objective function formula of maximum likelihood is as follows:
[0046]
[0047] Among them, a total of M feature label data pairs with real labels are collected, is the mth real label data pair; a total of N feature label data pairs with reliable pseudo labels are collected, is the nth pseudo-label data pair.
[0048] In a preferred embodiment of the present invention, in the transformed feature space, the mean of the Gaussian model is the area with the highest Gaussian density. The Gaussian mean can be projected back to the original feature space through the inverse transformation of the normalized flow model to obtain the prototype feature of the category. The formula is as follows:
[0049]
[0050] where c k is the prototype feature in the kth category.
[0051] In a preferred embodiment of the present invention, when constructing contrastive learning for the k-th feature, a high-density representative prototype c k As positive samples, other category features are used as negative samples;
[0052] By reducing the distance between similar features and the corresponding high-density prototypes and increasing the distance between features and negative samples, the feature clustering of each category is made more compact, thereby optimizing the classification boundary; the contrastive learning loss function is:
[0053]
[0054] Where h is the characteristic decoder and α is the temperature coefficient.
[0055] In a preferred embodiment of the present invention, the process of obtaining the segmentation result is as follows:
[0056] Use encoder g to extract the test image The pixel position of is the feature of j, recorded as:
[0057] Using a decoder Segment and decode the extracted features to obtain the classification probability vector of each pixel
[0058] Each pixel feature Compare with the high-density prototype of each category to obtain the category prediction vector based on the high-density prototype The kth element in the vector is It represents the probability of category prediction being k, which can be calculated as:
[0059]
[0060] Where K is the total number of categories;
[0061] The decoder prediction and the high-density prototype prediction are fused by the weight coefficient. The fusion calculation formula is as follows:
[0062]
[0063] The final segmentation result is predicted as:
[0064]
[0065] in, represents the i-th test image; g represents the segmentation model encoder; h represents the segmentation model decoder; represents the normalized flow model; c represents the high-density prototype, c k Indicates that category k corresponds to a high-density prototype.
[0066] The above technical solution of the present invention has the following advantages compared with the prior art:
[0067] The semantic segmentation method of the present invention utilizes a portion of labeled data in combination with another portion of unlabeled data for training to achieve training results close to the case where all images are labeled, thereby achieving a high-performance model with a small amount of image annotation. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, some of the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0069] Figure 1 is a schematic diagram of a semi-supervised semantic segmentation method guided by high-density representative prototypes according to an embodiment of the present invention;
[0070] Figure 2 It is a normalized flow model and feature transformation flow chart of an embodiment of the present invention. DETAILED DESCRIPTION
[0071] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0072] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0073] Embodiment 1
[0074] See also Figure 1 As shown, the present invention proposes a semi-supervised semantic segmentation method guided by a high-density representative prototype, comprising:
[0075] S1, obtain a data set, which includes a labeled segmentation data set with pixel-level annotations and a large number of unlabeled data sets, initialize the model with random parameters, and warm up the model with the labeled segmentation data set;
[0076] S2, perform strong and weak augmentation transformation on the unlabeled data, obtain pseudo labels on the weak augmentation data, use the pseudo labels to supervise the prediction of strong augmentation samples, and perform consistency training on strong and weak augmentation of the model;
[0077] Specifically, augmented consistency training is an important technique in semi-supervised learning. By making the model maintain consistent output on unlabeled samples with different perturbations, the model's utilization of unlabeled samples is improved, while the generalization performance of the model is enhanced.
[0078] S3, constructing a mixed Gaussian model as the target distribution, and using the normalized flow model to map the data features to the target Gaussian distribution through maximum likelihood calculation;
[0079] S4, extract the mean feature of each Gaussian model, use the normalized flow model to perform inverse transformation, and project the mean feature back to the original feature distribution as a high-density prototype for each category;
[0080] S5, using contrastive learning to reduce the distance between features of the same category and the high-density prototype of the category, and increase the distance between features of the same category and prototypes of other categories, increase the density of feature clustering, and improve the pixel classification performance of the segmentation model decoder;
[0081] S6, extract the test image features, obtain the segmentation decoder prediction, and compare the image features with the high-density prototype to obtain a second set of predictions; fuse the two sets of predictions to obtain the final segmentation result; use the high-density prototype to optimize the pixel classification result of the segmentation decoder.
[0082] It should be noted that the semantic segmentation task involves pixel-level classification of images; semantics refers to the meaning of the category or object represented by each pixel in the image, such as people, vehicles, trees, etc.
[0083] Pulling closer means reducing the distance between all features of the same category and the prototype features (cosine distance) through the contrast learning loss function; pulling away means increasing their distance. In training, there are generally dozens of category labels, and the features of the corresponding category and the prototype features of the category can be extracted. For a certain category, the features that are inconsistent with its category label are other categories.
[0084] According to an embodiment of the present invention, a data set is obtained in step S1, and the data set includes a labeled segmentation data set with pixel-level annotations and a large number of unlabeled data sets, specifically including:
[0085] The labeled segmentation dataset is denoted as The unlabeled dataset is denoted as Where x is the image data and y is the mask containing pixel-level annotations;
[0086] The pixel-level annotation is the classification mask of the image, which is equal to the size of the image; each position in the mask is set with a number representing the category, corresponding to the classification label of the image pixel at that position; the labeled data is the image with the annotated mask, which is used for the supervised training part of the model;
[0087] The unlabeled data only contains input images, which are used for self-training and augmented consistency training based on pseudo-labels.
[0088] According to an embodiment of the present invention, the model is a segmentation network, and the segmentation network includes a backbone network and a decoder; the backbone network is pre-trained by ImageNet to initialize parameters, and the segmentation decoder parameters are randomly initialized;
[0089] The backbone network encodes the input image to obtain a feature vector; the decoder processes the feature vector to obtain the segmentation prediction result;
[0090] The feature vector is used as the input data of the normalized flow model to learn the feature density.
[0091] It should be noted that feature space density estimation: use the normalized flow model combined with maximum likelihood optimization to learn feature density. First, use the backbone network to extract features and obtain the labeled data features. Among them, g is the process of extracting features from the backbone network, and at the same time obtaining the features of unlabeled data Normalized flow model The original feature v can be transformed to obtain Normalized flow model and feature transformation process Figure 2 shown.
[0092] According to an embodiment of the present invention, the segmentation network is warmed up on a labeled data set and simultaneously supervised by using a pixel-level cross entropy function. The supervised loss function of the training is:
[0093]
[0094] Where N is the number of pictures, HW is the image size, l ce is the cross entropy function.
[0095] According to an embodiment of the present invention, the augmented consistency training steps in step S3 are as follows:
[0096] The network trained by warm-up is used in the unlabeled dataset D u Perform category prediction for unlabeled data Perform strong and weak augmentation respectively to obtain different augmented versions;
[0097] Use the model to predict different augmented versions and get the category probability;
[0098] The pseudo-labels are obtained by weakly augmented probability prediction through one-hot encoding, and the label filtering mechanism is used to filter out low-confidence pseudo-labels;
[0099] Use pseudo labels to supervise the training of strong augmented sample predictions;
[0100] The training objective function is:
[0101]
[0102] Where N is the number of images, HW is the image size, and τ is the confidence threshold, which is set to 0.95; l ce is the cross entropy function; is the prediction of the model on the strongly augmented data; is the prediction of the model on the weakly augmented data; is the pseudo label obtained by weak augmentation prediction;
[0103] The formula for calculating the class probability is:
[0104]
[0105] in is the image strong augmentation strategy, It is a weak image augmentation strategy.
[0106] It should be noted that the weak augmentation strategy includes: image flipping and scaling. The strong augmentation strategy includes: Gaussian blur, color jittering, and grayscale transformation. In the augmentation consistency training strategy, the cross entropy loss function is used to make the model's prediction of the strongly augmented image consistent with the prediction of the weakly augmented image. The prediction of the category probability is the original output of the model, which is the model's judgment on which category a certain pixel belongs to. The confidence of the prediction can be obtained by predicting the category probability, that is, the higher the prediction probability, the more certain the model's judgment that the pixel belongs to the category, and the more reliable the judgment.
[0107] If the model prediction confidence is low, the prediction of the pixel is judged to be unreliable and the pixel will be discarded in consistency training. Pseudo-labeling is to convert all reliable predictions of the model on unlabeled data into labels as supervision signals to supervise the strong augmentation samples.
[0108] According to an embodiment of the present invention, the mixed Gaussian model is a joint model including multiple individual Gaussian models, and the features of each category correspond to a separate Gaussian model; the number of separate Gaussian models is consistent with the number of categories in the training set, and the specific form of the mixed Gaussian model is:
[0109]
[0110] Where z is the feature transformed by the normalized flow model, K is the total number of feature categories, μ k ,∑ k is the mean and covariance matrix of the kth Gaussian.
[0111] According to an embodiment of the present invention, in the transformed feature space, the mean of the Gaussian model is the area with the highest Gaussian density. The Gaussian mean can be projected back to the original feature space through the inverse transformation of the normalized flow model to obtain the prototype feature of the category:
[0112]
[0113] where c k is the prototype feature in the kth category.
[0114] It should be noted that the original features refer to the features that have not been transformed by the normalized flow model, which are directly extracted from the input image by the backbone network; the prototype features refer to the most representative features of each category, which are obtained by the normalized flow model through inverse transformation.
[0115] According to an embodiment of the present invention, when constructing contrastive learning for the k-th feature, a high-density representative prototype c k As positive samples, other category features are used as negative samples;
[0116] By reducing the distance between similar features and the corresponding high-density prototypes and increasing the distance between features and negative samples, the feature clustering of each category is made more compact, thereby optimizing the classification boundary; the contrastive learning loss function is:
[0117]
[0118] Where h is the characteristic decoder and α is the temperature coefficient.
[0119] It should be noted that the original classification boundary is established by the self-training and consistency training mentioned above. Feature clustering adjusts the parameters of the backbone network through contrastive learning, making the feature clustering tighter and indirectly moving the classification boundary away from the feature clustering, thereby optimizing the classification boundary.
[0120] According to an embodiment of the present invention, the training method for the normalized flow model is as follows:
[0121] Get the real label and pseudo label, and establish a connection between the feature and the corresponding Gaussian model through the real label and pseudo label;
[0122] Calculate the likelihood of labeled features and unlabeled features. The specific form is:
[0123]
[0124] The parameters of the normalized flow model are learned through the maximum likelihood objective function, and the connection between the image features of each category and the corresponding Gaussian distribution is established;
[0125] The objective function formula of maximum likelihood is as follows:
[0126]
[0127] Among them, a total of M feature label data pairs with real labels are collected, is the mth real label data pair; a total of N feature label data pairs with reliable pseudo labels are collected, is the nth pseudo-label data pair.
[0128] According to an embodiment of the present invention, the process of obtaining the segmentation result is as follows:
[0129] Use encoder g to extract the test image The pixel position of is the feature of j, recorded as:
[0130] Use decoder h to segment and decode the extracted features to obtain the classification probability vector of each pixel
[0131] Each pixel feature Compare with the high-density prototype of each category to obtain the category prediction vector based on the high-density prototype The kth element in the vector is It represents the probability of category prediction being k, which can be calculated as:
[0132]
[0133] Where K is the total number of categories;
[0134] The decoder prediction and the high-density prototype prediction are fused by the weight coefficient. The fusion calculation formula is as follows:
[0135]
[0136] The final segmentation result is predicted as:
[0137]
[0138] in, represents the i-th test image, g represents the segmentation model encoder, h represents the segmentation model decoder, represents the normalized flow model, c represents the high-density prototype, and c k Indicates that category k corresponds to a high-density prototype.
[0139] This method uses the density information of the feature space to provide supervision, and the confirmation bias of the model can be significantly alleviated. This method is applied to the Pascal VOC 2012 dataset for verification to show the effect of this method. All methods use the same model settings, namely ResNet101 and DeepLabV3+, as shown in Table 1. Table 1 shows the mIoU (%) performance of each semi-supervised segmentation method in the semi-supervised segmentation task of Pascal VOC 2012; this method can achieve excellent mIoU performance under different proportions of labeled data. Specifically, with only 366 labeled images and the remaining unlabeled data for training, this method is 0.84% higher than the previous best performing algorithm in mIoU, and 0.57% higher under 1464 labeled data.
[0140] Table 1
[0141]
[0142] "This method" in Table 1 is the semi-supervised segmentation method provided in the present invention.
[0143] "Limited supervised training" is a baseline result that does not use semi-supervised methods but only supervises training on a small amount of labeled data. MT proposes the Mean Teacher method that uses an average model to provide pseudo labels.
[0144] CutMix proposed a data augmentation method for image splicing for semi-supervised segmentation training. U2PL proposed a semi-supervised method for contrastive learning using low-confidence labels.
[0145] ST++ proposes a semi-supervised segmentation method with multi-stage self-training pseudo-label iterative improvement.
[0146] In summary, the semantic segmentation method of the present invention utilizes a part of the labeled data and combines it with another part of the unlabeled data for training to achieve a training result close to that when all images are labeled, thereby achieving a high-performance model with a small amount of image annotation.
[0147] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0148] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
[0149] Various modifications to the above-described 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.
[0150] Therefore, the present invention will not be limited to the above embodiments shown herein but will be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0151] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A semi-supervised semantic segmentation method guided by high-density representative prototypes, characterized in that: include: S1, obtain a data set, which includes a labeled segmentation data set with pixel-level annotations and a large number of unlabeled data sets, initialize the model with random parameters, and warm up the model with the labeled segmentation data set; S2, perform strong and weak augmentation transformation on the unlabeled data, obtain pseudo labels on the weak augmentation data, use the pseudo labels to supervise the prediction of strong augmentation samples, and perform consistency training of strong and weak augmentation of the model; S3, construct a mixed Gaussian model as the target distribution, and use the normalized flow model to map the data features to the target Gaussian distribution through maximum likelihood calculation; S4, extract the mean feature of each Gaussian model, use the normalized flow model to perform inverse transformation, and project the mean feature back to the original feature distribution as a high-density prototype for each category; S5, using contrastive learning to reduce the distance between features of the same category and the high-density prototype of the category, and increase the distance between features of the same category and prototypes of other categories, increase the density of feature clustering, and improve the pixel classification performance of the segmentation model decoder; S6, extracting test image features, obtaining segmentation decoder predictions, and comparing the image features with the high-density prototype to obtain a second set of predictions; fusing the two sets of predictions to obtain the final segmentation result; The mixed Gaussian model is a joint model containing multiple individual Gaussian models. The features of each category will correspond to a separate Gaussian model. The number of separate Gaussian models is consistent with the number of categories in the training set. The specific form of the mixed Gaussian model is: Where z is the feature transformed by the normalized flow model, K is the total number of feature categories, μ k ,∑ k is the mean and covariance matrix of the kth Gaussian; The training method for the normalized flow model is as follows: Get the real label and pseudo label, and establish a connection between the feature and the corresponding Gaussian model through the real label and pseudo label; Calculate the likelihood of labeled features and unlabeled features. The specific form is: The parameters of the normalized flow model are learned through the maximum likelihood objective function, and the connection between the image features of each category and the corresponding Gaussian distribution is established; The objective function formula of maximum likelihood is as follows: Among them, a total of M feature label data pairs with real labels are collected, is the mth real label data pair; a total of N feature label data pairs with reliable pseudo labels are collected, is the nth pseudo-label data pair; In the transformed feature space, the mean of the Gaussian model is the area with the highest Gaussian density. The Gaussian mean can be projected back to the original feature space through the inverse transformation of the normalized flow model to obtain the prototype feature of the category. The formula is as follows: where c k is the prototype feature in the kth category; The process of obtaining segmentation results is as follows: Use encoder g to extract the test image The pixel position of is the feature of j, recorded as: Use the decoder to segment and decode the extracted features to obtain the classification probability vector of each pixel Each pixel feature Compare with the high-density prototype of each category to obtain the category prediction vector based on the high-density prototype The kth element in the vector is It represents the probability of category prediction being k, which can be calculated as: Where K is the total number of categories; The decoder prediction and the high-density prototype prediction are fused by the weight coefficient. The fusion calculation formula is as follows: The final segmentation result is predicted as: in, represents the i-th test image; g represents the segmentation model encoder; h represents the segmentation model decoder; represents the normalized flow model; c represents the high-density prototype, c k Indicates that category k corresponds to a high-density prototype.
2. The semi-supervised semantic segmentation method guided by high-density representative prototypes according to claim 1, characterized in that: In step S1, a data set is obtained, which includes a labeled segmentation data set with pixel-level annotations and a large number of unlabeled data sets, specifically including: The labeled segmentation dataset is denoted as The unlabeled dataset is denoted as Where x is the image data and y is the mask containing pixel-level annotations; The pixel-level annotation is the classification mask of the image, which is equal to the size of the image; each position in the mask is set with a number representing the category, corresponding to the classification label of the image pixel at that position; the labeled data is the image with the annotated mask, which is used for the supervised training part of the model; The unlabeled data only contains input images, which are used for self-training and augmented consistency training based on pseudo-labels.
3. The semi-supervised semantic segmentation method guided by high-density representative prototypes according to claim 2 is characterized in that ,The model is a segmentation network, which includes a backbone network and a decoder; the backbone network is pre-trained with ImageNet for parameter initialization, and the parameters of the segmentation decoder are randomly initialized; The backbone network encodes the input image to obtain a feature vector; the decoder processes the feature vector to obtain the segmentation prediction result; The feature vector is used as the input data of the normalized flow model to learn the feature density.
4. The semi-supervised semantic segmentation method guided by high-density representative prototypes according to claim 3, characterized in that: The segmentation network is warmed up on the labeled dataset and supervised by using the pixel-level cross entropy function. The supervised loss function is: Where N is the number of pictures, HW is the picture size, is the cross entropy function.
5. The semi-supervised semantic segmentation method guided by high-density representative prototypes according to claim 1, characterized in that: The augmented consistency training steps in step S3 are as follows: The network trained by warm-up is used in the unlabeled dataset D u Perform category prediction for unlabeled data Perform strong and weak augmentation respectively to obtain different augmented versions; Use the model to predict different augmented versions and get the category probability. The pseudo-labels are obtained by weakly augmented probability prediction through one-hot encoding, and the label filtering mechanism is used to filter out low-confidence pseudo-labels; Use pseudo labels to supervise the training of strong augmented sample predictions; The training objective function is: Where N is the number of images, HW is the image size, and τ is the confidence threshold, which is set to 0.95; is the cross entropy function; is the model's prediction of the jth pixel on the i-th strongly augmented image; is the model's prediction of the jth pixel on the i-th weakly augmented image; is the pseudo label obtained by weak augmentation prediction, represents the indicator function, when When the conditions are met, The value is 1; when If the conditions are not met, The value is 0; The formula for calculating the class probability is: in is the image strong augmentation strategy, It is a weak image augmentation strategy.
6. The semi-supervised semantic segmentation method guided by high-density representative prototypes according to claim 1, characterized in that: When constructing contrastive learning for the k-th feature, the high-density representative prototype c k As positive samples, other category features are used as negative samples; By reducing the distance between similar features and the corresponding high-density prototypes and increasing the distance between features and negative samples, the feature clustering of each category is made more compact, thereby optimizing the classification boundary; the contrastive learning loss function is: Where h is the characteristic decoder and α is the temperature coefficient.
