A deep three-network semi-supervised semantic segmentation method and system
Pseudo labels are generated through the alternating training and voting mechanism of the deep three-network model, which solves the unreliability problem of pseudo labels in the existing technology and improves the reliability and accuracy of semantic segmentation.
Patent Information
- Application Number
- CN202210273143.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-03-18
AI Technical Summary
Existing semi-supervised semantic segmentation methods are difficult to prevent prediction errors during pseudo label generation, resulting in low reliability of semantic segmentation networks.
Using a deep three-network model training framework, three semantic segmentation networks with the same structure but different initialization parameters are alternately trained, and a preset voting mechanism is used to generate pseudo labels, and filtered according to the consistency rate of the pseudo labels to ensure the accuracy of the pseudo labels. reliability.
It significantly improves the accuracy of pseudo-labels, avoids the semantic segmentation network from collapsing with each other due to unreliable pseudo-labels, deeply optimizes the semantic segmentation network, and improves the reliability and accuracy of the semantic segmentation process.
Smart Images

Figure CN114742999B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer vision technology, and more specifically, to a deep three-network semi-supervised semantic segmentation method and system. Background Art
[0002] Semantic segmentation is a difficult task aimed at scene understanding. As a core problem of computer vision, scene understanding has been widely used in today's information society. These applications include: autonomous driving, human-computer interaction, computer photography, image search engines, and augmented reality. These problems have been tried to be solved using a variety of computer vision and machine learning methods. Semi-supervised semantic segmentation is usually trained in two stages. First, a Teacher model is trained with (smaller-scale) labeled data, and then the Teacher model is used to predict pseudo-labels for (larger-scale) unlabeled data as training data for the Student model.
[0003] Previous semi-supervised semantic segmentation methods usually obtain pseudo-labels from a single network and jointly train two semantic segmentation networks through cross-consistency constraints. However, these methods are difficult to prevent prediction errors during pseudo-label generation, which makes it easy for semantic segmentation networks to collapse with each other due to unreliable pseudo-labels.
[0004] Therefore, how to avoid prediction errors in the pseudo-label generation process and thus improve the reliability of the semantic segmentation process is a technical problem that needs to be solved. Summary of the invention
[0005] The present invention provides a deep three-network semi-supervised semantic segmentation method to solve the technical problems in the prior art that it is difficult to prevent prediction errors in the pseudo-label generation process and the reliability of the semantic segmentation process is low.
[0006] The method is applied to a model training framework including three semantic segmentation networks, each of which has the same structure and different initialization parameters, and includes:
[0007] Selecting one of the semantic segmentation networks as the current network, inputting the labeled data randomly sampled from a preset labeled data set into the current network, generating a first classification score according to the output of the current network, and determining the supervision loss of the current network according to the first classification score and the label of the labeled data;
[0008] Inputting unlabeled data randomly sampled from a preset unlabeled data set into each of the semantic segmentation networks, generating a second classification score according to the output of the current network, and fusing the outputs of the other two semantic segmentation networks according to a preset voting mechanism to generate a pseudo label, and determining the unsupervised loss of the current network based on the second classification score and the pseudo label;
[0009] Based on the supervised loss of the current network and the unsupervised loss of the current network, the parameters of the current network are updated, and based on the supervised losses and the unsupervised losses corresponding to the other two semantic segmentation networks, the parameters of the other two semantic segmentation networks are updated respectively, so as to train the semantic segmentation networks;
[0010] Based on each trained semantic segmentation network, semantic segmentation is performed on the image to be segmented and a semantic segmentation image is generated;
[0011] Among them, the preset voting mechanism is to fuse the probability vectors of each pixel output by each semantic segmentation network participating in the voting according to different networks to generate a fusion vector of each pixel, and generate a hard label based on each fusion vector. The hard label is used as the pseudo label in the training stage.
[0012] In some embodiments of the present application, semantic segmentation is performed on the image to be segmented based on each trained semantic segmentation network and a semantic segmentation image is generated, specifically:
[0013] Inputting the images to be segmented into the trained semantic segmentation networks respectively;
[0014] The output results of each trained semantic segmentation network are fused according to the preset voting mechanism to generate the semantic segmentation image.
[0015] In some embodiments of the present application, after the outputs of the other two semantic segmentation networks are fused according to a preset voting mechanism to generate pseudo labels, the method further includes:
[0016] Determining a consistency rate according to an overlap rate between a first hard label and a second hard label corresponding to the pseudo label;
[0017] If the consistency rate is lower than a preset threshold, deleting the pseudo-label and inputting new unlabeled data into the other two semantic segmentation networks to generate new pseudo-labels;
[0018] The first hard label and the second hard label are generated based on outputs of the other two semantic segmentation networks respectively.
[0019] Accordingly, the present invention also proposes a deep three-network semi-supervised semantic segmentation system, which is applied to a model training framework including three semantic segmentation networks, each of which has the same structure and different initialization parameters. The system includes:
[0020] A first determination module is used to select one of the semantic segmentation networks as a current network, input the labeled data randomly sampled from a preset labeled data set into the current network, generate a first classification score according to the output of the current network, and determine the supervision loss of the current network according to the first classification score and the label of the labeled data;
[0021] A second determination module is used to input unlabeled data randomly sampled from a preset unlabeled data set into each of the semantic segmentation networks, generate a second classification score according to the output of the current network, and fuse the outputs of the other two semantic segmentation networks according to a preset voting mechanism to generate a pseudo label, and determine the unsupervised loss of the current network based on the second classification score and the pseudo label;
[0022] A training module, used to update the parameters of the current network based on the supervised loss of the current network and the unsupervised loss of the current network, and to update the parameters of the other two semantic segmentation networks based on the supervised losses and the unsupervised losses corresponding to the other two semantic segmentation networks, so as to train the semantic segmentation networks;
[0023] A generation module, used for performing semantic segmentation on the image to be segmented based on each trained semantic segmentation network and generating a semantic segmentation image;
[0024] Among them, the preset voting mechanism is to fuse the probability vectors of each pixel output by each semantic segmentation network participating in the voting according to different networks to generate a fusion vector of each pixel, and generate a hard label based on each fusion vector. The hard label is used as the pseudo label in the training stage.
[0025] In some embodiments of the present application, the generating module is specifically used to:
[0026] Inputting the images to be segmented into the trained semantic segmentation networks respectively;
[0027] The output results of each trained semantic segmentation network are fused according to the preset voting mechanism to generate the semantic segmentation image.
[0028] In some embodiments of the present application, the system further includes a filtering module for:
[0029] Determining a consistency rate according to an overlap rate between a first hard label and a second hard label corresponding to the pseudo label;
[0030] If the consistency rate is lower than a preset threshold, deleting the pseudo-label and inputting new unlabeled data into the other two semantic segmentation networks to generate new pseudo-labels;
[0031] The first hard label and the second hard label are generated based on outputs of the other two semantic segmentation networks respectively.
[0032] By applying the above technical scheme, in a model training framework including three semantic segmentation networks, each of the semantic segmentation networks has the same structure and different initialization parameters. During the training process, the three semantic segmentation networks are trained alternately and jointly in combination with a preset voting mechanism, and the accuracy of pseudo-labels is significantly improved, thereby avoiding the semantic segmentation networks from collapsing with each other due to unreliable pseudo-labels, thereby deeply optimizing the three semantic segmentation networks and improving the reliability of the semantic segmentation process. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 A schematic diagram of a process flow of a deep three-network semi-supervised semantic segmentation method proposed in an embodiment of the present invention is shown;
[0035] Figure 2 A schematic diagram showing the principle of a deep three-network semi-supervised semantic segmentation method proposed in another embodiment of the present invention is shown;
[0036] Figure 3 The algorithm principle diagram of the DTT framework in an embodiment of the present invention is shown;
[0037] Figure 4 A structural schematic diagram of a deep three-network semi-supervised semantic segmentation system proposed in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] An embodiment of the present application provides a deep three-network semi-supervised semantic segmentation method based on a model training framework including three semantic segmentation networks, each of which has the same structure and different initialization parameters. During the training process, combined with a preset voting mechanism, the three semantic segmentation networks are alternately trained together to deeply optimize the three semantic segmentation networks.
[0040] like Figure 1 As shown, the method comprises the following steps:
[0041] Step S101, select one of the semantic segmentation networks as the current network, input the labeled data randomly sampled from the preset labeled data set into the current network, generate a first classification score according to the output of the current network, and determine the supervision loss of the current network according to the first classification score and the label of the labeled data.
[0042] In this embodiment, in the semi-supervised semantic segmentation task, two data sets are included, namely a preset labeled data set with labels and a preset unlabeled data set without labels. A semantic segmentation network is selected from three semantic segmentation networks as the current network, and labeled data is randomly sampled from the preset labeled data set. The labeled data is input into the current network for prediction, and a first classification score is generated according to the output of the current network. Then, the supervision loss of the current network is determined according to the first classification score and the label of the labeled data.
[0043] Typically, the amount of data in the preset labeled data set is smaller than the amount of data in the preset unlabeled data set, and technicians in this field can flexibly set the data ratio of the preset labeled data set and the preset unlabeled data set according to actual needs.
[0044] In order to reliably determine the supervision loss of the current network, in some embodiments of the present application, the supervision loss of the current network is L s (F(X l θ α ), Y l ), let the first classification score F(X l θ α )=S,Y l =Y, determine the supervision loss of the current network according to Formula 2, which is specifically:
[0045]
[0046] Among them, X l and Y l For D l The randomly sampled input images and corresponding labels, D lis the preset labeled dataset, X is the image input to the semantic segmentation network, H is the height of X, W is the width of X, p is the pixel position, θ α is the parameter of the current network, s p and p are the classification score vector and ground truth one-hot vector of position p, respectively, and CrossEntropy is the cross entropy.
[0047] In this embodiment, the output of the semantic segmentation network can be divided into soft labels and hard labels. The soft label is the classification score output from the semantic segmentation network, which consists of the probability of each pixel and has a dimension of H×W×N, where N is the number of categories; the hard label is the single heat map (i.e., onehot encoded label map) corresponding to the soft label.
[0048] It should be noted that the solution in the above embodiment is only a specific implementation solution proposed in this application, and the method of determining the supervision loss of the current network according to the first classification score and the label of the labeled data belongs to the protection scope of this application.
[0049] Step S102, inputting the unlabeled data randomly sampled from the preset unlabeled data set into each of the semantic segmentation networks, generating a second classification score according to the output of the current network, and fusing the outputs of the other two semantic segmentation networks according to a preset voting mechanism to generate a pseudo label, and determining the unsupervised loss of the current network based on the second classification score and the pseudo label.
[0050] In this embodiment, a preset voting mechanism is used to generate pseudo labels. The preset voting mechanism is to fuse the probability vectors of each pixel output by each semantic segmentation network participating in the voting according to different networks to generate a fusion vector of each pixel, and generate a hard label based on each fusion vector, wherein the hard label is used as a pseudo label during the training stage.
[0051] The unlabeled data randomly sampled from the preset unlabeled dataset is input into each semantic segmentation network for training. The second classification score is generated according to the output of the current network. Then, the outputs of the other two semantic segmentation networks are fused according to the preset voting mechanism to generate a pseudo label. The unsupervised loss of the current network is determined based on the second classification score and the pseudo label.
[0052] In order to prevent model degradation caused by unreliable pseudo labels, in some embodiments of the present application, after the outputs of the other two semantic segmentation networks are fused according to a preset voting mechanism to generate pseudo labels, the method further includes:
[0053] Determine a consistency rate according to an overlap rate between a first hard label and a second hard label output by other two semantic segmentation networks corresponding to the pseudo label;
[0054] If the consistency rate is lower than a preset threshold, deleting the pseudo-label and inputting new unlabeled data into the other two semantic segmentation networks to generate new pseudo-labels;
[0055] In this embodiment, the first hard label and the second hard label are generated based on the outputs of the other two semantic segmentation networks, respectively. The consistency rate is determined according to the overlap rate of the first hard label and the second hard label. If the consistency rate is lower than the preset threshold, it means that the current training batch is contaminated. At this time, the pseudo-label is deleted and the new unlabeled data is input into the other two semantic segmentation networks to generate new pseudo-labels, thereby filtering out training samples with low consistency rates and ensuring the good performance of the learning model.
[0056] In order to reliably determine the consistency rate, in some embodiments of the present application, the consistency rate is determined according to Formula 1, and Formula 1 is specifically:
[0057]
[0058] Where r is the consistency rate, H is the height of the image input to the semantic segmentation network, W is the width of the image input to the semantic segmentation network, p is the pixel position, and y βp is the pseudo label vector at position p in the first hard label, y γp is the pseudo label vector at position p in the second hard label.
[0059] In order to reliably determine the unsupervised loss, in some embodiments of the present application, the unsupervised loss of the current network is L u (F(X u θ α ), Y * ), let the second classification score F(X u θ α )=S, and determine the unsupervised loss of the current network according to Formula 3, which is specifically:
[0060]
[0061] Among them, Y * is the pseudo label, X u For D u The input image is randomly sampled from θ α is the parameter of the current network, D u is the preset unlabeled dataset, X is the image input to the semantic segmentation network, H is the height of X, W is the width of X, p is the pixel position, s p is the classification score vector of position p, y * p Represents Y *The pseudo label vector corresponding to the p position in , CrossEntropy is the cross entropy.
[0062] It should be noted that the solution in the above embodiment is only a specific implementation solution proposed in this application, and other methods of determining the unsupervised loss of the current network based on the second classification score and the pseudo-label are within the protection scope of this application.
[0063] In order to reliably generate hard labels, in some embodiments of the present application, pseudo labels are generated according to the fusion vectors, specifically:
[0064] Generate a fused soft label according to each of the fused vectors, and perform an Argmax operation on the fused soft label to obtain the pseudo label;
[0065] The fusion vector is expressed based on Formula 4, which is:
[0066]
[0067] Among them, V * is the fusion vector, K is the number of semantic segmentation networks participating in the voting, is the probability that the categories of a specific pixel in the i-th semantic segmentation network are 1-N respectively.
[0068] In this embodiment, the semantic segmentation task can be regarded as a classification problem of classifying each pixel in the image X. Assuming there are N categories, the semantic segmentation network will output a probability vector V of length N for each pixel:
[0069] V=(v1,v2,...,v N ).
[0070] Therefore, the category of the pixel is estimated according to the maximum value in v. In the preset voting mechanism, there are K different semantic segmentation networks, each of which will generate a probability vector for a specific pixel, namely:
[0071]
[0072] Assume these vectors to get a fusion vector:
[0073]
[0074] In this embodiment, the soft label is generated by collecting the fusion vector of each pixel. Therefore, the soft label of the semantic segmentation network participating in the voting can be fused according to the result S * Get the hard label (i.e. single heat map) Y *, and are used as pseudo labels during the training phase. In this way, the fusion process implicitly transfers the knowledge of different models, which is beneficial to the coupling of models in training and prevents the networks from collapsing with each other due to unreliable training data.
[0075] Step S103, updating the parameters of the current network based on the supervised loss of the current network and the unsupervised loss of the current network, and updating the parameters of the other two semantic segmentation networks based on the supervised losses and the unsupervised losses corresponding to the other two semantic segmentation networks, so as to train each semantic segmentation network.
[0076] In this embodiment, the three networks are trained alternately together in combination with a voting mechanism, the parameters of the current network are updated based on the supervised loss of the current network and the unsupervised loss of the current network, the current network is trained, and then the other two semantic segmentation networks are used as new current networks in turn, and the supervised losses and unsupervised losses corresponding to the other two semantic segmentation networks are determined according to steps S101 and S102, and the parameters of the other two semantic segmentation networks are updated to train the other two semantic segmentation networks.
[0077] Step S104: semantically segment the image to be segmented based on each trained semantic segmentation network and generate a semantic segmentation image.
[0078] In this embodiment, each semantic segmentation network has been trained, and semantic segmentation is performed on the image to be segmented based on each trained semantic segmentation network to generate a semantic segmentation image.
[0079] In the testing phase, because different learning models usually focus on different input views, the results generated from a single model also lack accuracy. In order to further improve the accuracy of semantic segmentation, in some embodiments of the present application, semantic segmentation is performed on the image to be segmented based on each trained semantic segmentation network and a semantic segmentation image is generated, specifically:
[0080] Inputting the images to be segmented into the trained semantic segmentation networks respectively;
[0081] The output results of each trained semantic segmentation network are fused according to the preset voting mechanism to generate the semantic segmentation image.
[0082] In this embodiment, during the testing phase, the output results of each trained semantic segmentation network are fused based on a preset voting mechanism, thereby further improving the accuracy of semantic segmentation.
[0083] It is understandable that the order of step S101 and step S102 can be interchanged or performed simultaneously.
[0084] By applying the above technical solution, in a model training framework including three semantic segmentation networks, each semantic segmentation network has the same structure and different initialization parameters, a semantic segmentation network is selected as the current network, the labeled data randomly sampled from a preset labeled data set is input into the current network, and a first classification score is generated according to the output of the current network, and the supervision loss of the current network is determined according to the first classification score and the label of the labeled data; the unlabeled data randomly sampled from a preset unlabeled data set is input into each semantic segmentation network, a second classification score is generated according to the output of the current network, and the outputs of the other two semantic segmentation networks are fused according to a preset voting mechanism to generate a pseudo label, and the supervision loss of the current network is determined based on the second classification score and the pseudo label. Unsupervised loss; updating the parameters of the current network based on the supervised loss of the current network and the unsupervised loss of the current network, and updating the parameters of the other two semantic segmentation networks based on the supervised losses and unsupervised losses corresponding to the other two semantic segmentation networks, so as to train each semantic segmentation network; performing semantic segmentation on the image to be segmented and generating a semantic segmentation image based on each trained semantic segmentation network, the accuracy of the pseudo-label is significantly improved, and the semantic segmentation networks are prevented from collapsing with each other due to unreliable pseudo-labels, thereby deeply optimizing the three semantic segmentation networks, improving the reliability of the semantic segmentation process, and obtaining the prediction results by voting through the three well-trained semantic segmentation networks in the test phase, thereby further improving the accuracy of semi-supervised semantic segmentation.
[0085] In order to further explain the technical idea of the present invention, the technical solution of the present invention is now described in combination with specific application scenarios.
[0086] The DTT framework proposed in the embodiment of the present application includes three networks, namely, α, β and γ, which are initialized with the same structure and different parameters, respectively denoted as F(θ α )、F(θ β ) and F(θ γ ). θ represents the parameters of the corresponding network, which is updated alternately with labeled data and unlabeled data.
[0087] In the semi-supervised semantic segmentation task, there are always two datasets, one with labels D 1 , and another one without label D u . D 1 contains a limited number of images and corresponding labels, while D u It only contains many images. Let the classification score (i.e. soft label) output by the network be S = F(X, θ), where X represents the input image. By merging the soft label S * Performing Argmax operation can get the predicted single heat map Y * .
[0088] like Figure 2 As shown, when F(θ k ) as the current network, for labeled data, the supervision loss L is used s To train the semantic segmentation network F(θ k ). A standard pixel-level cross entropy loss is used here, which can be calculated as:
[0089]
[0090] Among them, s p and p are the classification score vector and ground truth one-hot vector at position p, respectively; |D 1 | indicates the number of images.
[0091] For unlabeled data, use the pseudo hard label Y * To guide the training process. The loss function L u is defined as:
[0092]
[0093] Among them, y * p Represents Y * The pseudo label vector corresponding to the p position in .
[0094] Specifically, when updating α, the supervised loss L is directly calculated using the labeled data s (F(X l θ α ), Y l ), where X 1 and Y 1 For D 1 The input images and corresponding labels are randomly sampled from . For the unlabeled data X u , pseudo label Y * is given by F(θ β ) and F(θ γ ) votes to generate. Therefore, the unsupervised loss can be obtained as L u (F(X u θ α ), Y * ).
[0095] It is understandable that when updating β, the supervision loss L is directly calculated using the labeled data s (F(X l θ β ), Y l ). For the unlabeled data X u , pseudo label Y * is given by F(θ α ) and F(θγ ) votes to generate. Therefore, the unsupervised loss can be obtained as L u (F(X u θ β ), Y * ); When updating γ, the supervised loss L is directly calculated using the labeled data s (F(X l θ γ ), Y l ). For the unlabeled data X u , pseudo label Y * is given by F(θ α ) and F(θ β ) votes to generate. Therefore, the unsupervised loss can be obtained as L u (F(X u θ γ ), Y * ).
[0096] In order to prevent model degradation caused by unreliable pseudo labels, the contaminated training batches are filtered using the consistency rate of the pseudo labels generated by the two semantic segmentation networks. Assume that Y β and Y γ F(θ β ) and F(θ γ ) The consistency rate r is obtained by calculating the overlap rate of two hard labels:
[0097]
[0098] Filter out training samples with low consistency rates to ensure good performance of the learning model. Figure 3 As shown, Algorithm 1 details the workflow of DTT.
[0099] Practical experiments show that the proposed preset voting mechanism has two advantages. First, in the training phase, the accuracy of pseudo labels is significantly improved, ensuring better training results; second, in the testing phase, the prediction results obtained by voting by multiple well-trained models usually show better accuracy.
[0100] The present application also proposes a deep three-network semi-supervised semantic segmentation system, which is applied to a model training framework including three semantic segmentation networks, each of which has the same structure and different initialization parameters, such as Figure 4 As shown, the system comprises:
[0101] A first determination module 201 is used to select one of the semantic segmentation networks as the current network, input the labeled data randomly sampled from a preset labeled data set into the current network, generate a first classification score according to the output of the current network, and determine the supervision loss of the current network according to the first classification score and the label of the labeled data;
[0102] A second determination module 202 is used to input unlabeled data randomly sampled from a preset unlabeled data set into each of the semantic segmentation networks, generate a second classification score according to the output of the current network, and fuse the outputs of the other two semantic segmentation networks according to a preset voting mechanism to generate a pseudo label, and determine the unsupervised loss of the current network based on the second classification score and the pseudo label;
[0103] A training module 203 is used to update the parameters of the current network based on the supervised loss of the current network and the unsupervised loss of the current network, and to update the parameters of the other two semantic segmentation networks based on the supervised losses and the unsupervised losses corresponding to the other two semantic segmentation networks, so as to train the semantic segmentation networks;
[0104] A generation module 204, configured to perform semantic segmentation on the image to be segmented based on each trained semantic segmentation network and generate a semantic segmentation image;
[0105] Among them, the preset voting mechanism is to fuse the probability vectors of each pixel output by each semantic segmentation network participating in the voting according to different networks to generate a fusion vector of each pixel, and generate a hard label based on each fusion vector. The hard label is used as the pseudo label in the training stage.
[0106] In the specific application scenario of the present application, the generation module 204 is specifically used to:
[0107] Inputting the images to be segmented into the trained semantic segmentation networks respectively;
[0108] The output results of each trained semantic segmentation network are fused according to the preset voting mechanism to generate the semantic segmentation image.
[0109] In the specific application scenario of the present application, the system further includes a filtering module for:
[0110] Determining a consistency rate according to an overlap rate between a first hard label and a second hard label corresponding to the pseudo label;
[0111] If the consistency rate is lower than a preset threshold, deleting the pseudo-label and inputting new unlabeled data into the other two semantic segmentation networks to generate new pseudo-labels;
[0112] The first hard label and the second hard label are generated based on outputs of the other two semantic segmentation networks respectively.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A deep three-network semi-supervised semantic segmentation method, It is characterized in that Applied to a model training framework including three semantic segmentation networks, each of which has the same structure and different initialization parameters, the method includes: Selecting one of the semantic segmentation networks as the current network, inputting the labeled data randomly sampled from a preset labeled data set into the current network, generating a first classification score according to the output of the current network, and determining the supervision loss of the current network according to the first classification score and the label of the labeled data; The unlabeled data randomly sampled from the preset unlabeled data set is input into each of the semantic segmentation networks, a second classification score is generated according to the output of the current network, and the outputs of the other two semantic segmentation networks are fused according to a preset voting mechanism to generate a pseudo label, and the consistency rate is determined according to the overlap rate of the first hard label and the second hard label corresponding to the pseudo label; if the consistency rate is lower than a preset threshold, the pseudo label is deleted and the new unlabeled data is input into the other two semantic segmentation networks to generate a new pseudo label; wherein the first hard label and the second hard label are generated based on the outputs of the other two semantic segmentation networks, respectively, and the unsupervised loss of the current network is determined based on the second classification score and the pseudo label; The consistency rate is determined according to Formula 1, which is specifically: Where r is the consistency rate, H is the height of the image input to the semantic segmentation network, W is the width of the image input to the semantic segmentation network, p is the pixel position, and y βp is the pseudo label vector at position p in the first hard label, y γp is the pseudo label vector at position p in the second hard label; Based on the supervised loss of the current network and the unsupervised loss of the current network, the parameters of the current network are updated, and based on the supervised losses and the unsupervised losses corresponding to the other two semantic segmentation networks, the parameters of the other two semantic segmentation networks are updated respectively, so as to train the semantic segmentation networks; Based on each trained semantic segmentation network, semantic segmentation is performed on the image to be segmented and a semantic segmentation image is generated; The preset voting mechanism is to fuse the probability vectors of each pixel output by each semantic segmentation network participating in the voting according to different networks to generate a fusion vector of each pixel, and generate a hard label according to each fusion vector, and the hard label is used as the pseudo label in the training stage; Generating a hard label according to each of the fusion vectors is specifically: generating a fused soft label according to each of the fusion vectors, and performing an Argmax operation on the fused soft label to obtain the pseudo label; wherein the fusion vector is represented based on formula 4, and the formula 4 is: Among them, V * is the fusion vector, K is the number of semantic segmentation networks participating in the voting, is the probability that the categories of a pixel in the i-th semantic segmentation network are 1-N respectively.
2. The method according to claim 1, It is characterized in that Based on each trained semantic segmentation network, the image to be segmented is semantically segmented and a semantic segmentation image is generated, specifically: Inputting the to-be-segmented images into the trained semantic segmentation networks respectively; The output results of each trained semantic segmentation network are fused according to the preset voting mechanism to generate the semantic segmentation image.
3. The method according to claim 1, It is characterized in that The supervision loss of the current network is L s (F(X l θ α ),Y l ), let the first classification score F(X l ; θ α )=S,Y I =Y, determine the supervision loss of the current network according to Formula 2, which is specifically: Among them, X l and Y l For D l The randomly sampled input images and corresponding labels, D l is the preset labeled dataset, X is the image input to the semantic segmentation network, H is the height of X, W is the width of X, p is the pixel position, θ α is the parameter of the current network, s p and p are the classification score vector and ground truth one-hot vector of position p, respectively, and CrossEntropy is the cross entropy.
4. The method according to claim 1, It is characterized in that The unsupervised loss of the current network is L u (F(X u θ α ),Y * ), let the second classification score F(X u ; θ α )=S, and determine the unsupervised loss of the current network according to Formula 3, which is specifically: Among them, Y * is the pseudo label, X u For D u The input image is randomly sampled from θ α is the parameter of the current network, D u is the preset unlabeled dataset, X is the image input to the semantic segmentation network, H is the height of X, W is the width of X, p is the pixel position, s p is the classification score vector of position p, y * p Represents Y * The pseudo label vector corresponding to the p position in , CrossEntropy is the cross entropy.
5. A deep three-network semi-supervised semantic segmentation system, It is characterized in that Applied to a model training framework including three semantic segmentation networks, each of which has the same structure and different initialization parameters, the system includes: A first determination module is used to select one of the semantic segmentation networks as a current network, input the labeled data randomly sampled from a preset labeled data set into the current network, generate a first classification score according to the output of the current network, and determine the supervision loss of the current network according to the first classification score and the label of the labeled data; The second determination module is used to input the unlabeled data randomly sampled from the preset unlabeled data set into each of the semantic segmentation networks, generate a second classification score according to the output of the current network, and generate a pseudo label after fusing the outputs of the other two semantic segmentation networks according to a preset voting mechanism, and determine the consistency rate according to the overlap rate of the first hard label and the second hard label corresponding to the pseudo label; if the consistency rate is lower than a preset threshold, delete the pseudo label and input the new unlabeled data into the other two semantic segmentation networks to generate a new pseudo label; wherein the first hard label and the second hard label are generated based on the outputs of the other two semantic segmentation networks respectively, and the unsupervised loss of the current network is determined based on the second classification score and the pseudo label; the consistency rate is determined according to formula 1, and the formula 1 is specifically: Where r is the consistency rate, H is the height of the image input to the semantic segmentation network, W is the width of the image input to the semantic segmentation network, p is the pixel position, and y βp is the pseudo label vector at position p in the first hard label, y γp is the pseudo label vector at position p in the second hard label; A training module, used to update the parameters of the current network based on the supervised loss of the current network and the unsupervised loss of the current network, and to update the parameters of the other two semantic segmentation networks based on the supervised losses and the unsupervised losses corresponding to the other two semantic segmentation networks, so as to train the semantic segmentation networks; A generation module, used for performing semantic segmentation on the image to be segmented based on each trained semantic segmentation network and generating a semantic segmentation image; The preset voting mechanism is to fuse the probability vectors of each pixel output by each semantic segmentation network participating in the voting according to different networks to generate a fusion vector of each pixel, and generate a hard label according to each fusion vector, and the hard label is used as the pseudo label in the training stage; generate a hard label according to each fusion vector, specifically: generate a fused soft label according to each fusion vector, and perform an Argmax operation on the fused soft label to obtain the pseudo label; wherein the fusion vector is represented based on formula 4, and the formula 4 is: Among them, V * is the fusion vector, K is the number of semantic segmentation networks participating in the voting, is the probability that the categories of a pixel in the i-th semantic segmentation network are 1-N respectively.
6. The system according to claim 5, It is characterized in that The generation module is specifically used for: Inputting the to-be-segmented images into the trained semantic segmentation networks respectively; The output results of each trained semantic segmentation network are fused according to the preset voting mechanism to generate the semantic segmentation image.
Citation Information
Patent Citations
Image processing method and related equipment
CN112669323A
Semi-supervised polarimetric SAR image classification method based on multi-branch network
CN113869136A
Image processing method, electronic device, and storage medium
WO2020052668A1
Method and apparatus for training semantic segmentation network, image processing method and apparatus based on semantic segmentation network, and device and storage medium
WO2020156303A1
Method and system for constructing semi-supervised image segmentation framework
WO2022041307A1
