Semi-Supervised Semantic Segmentation via Gentle Teaching Assistant
Anonymous Author(s)
AfﬁliationAddress email
Abstract
Semi-Supervised Semantic Segmentation aims at training the segmentation modelwith limited labeled data and a large amount of unlabeled data.
To effectively leverage the unlabeled data, pseudo labeling, along with the teacher-student framework,is widely adopted in semi-supervised semantic segmentation.
Though proved tobe effective, this paradigm suffers from incorrect pseudo labels which inevitablyexist and are taken as auxiliary training data.
To alleviate the negative impactof incorrect pseudo labels, we delve into the current Semi-Supervised Semantic
Segmentation frameworks.
We argue that the unlabeled data with pseudo labelscan facilitate the learning of representative features in the feature extractor, butit is unreliable to supervise the mask predictor.
Motivated by this consideration,we propose a novel framework, Gentle Teaching Assistant (GTA-Seg) to disentangle the effects of pseudo labels on feature extractor and mask predictor of thestudent model.
Speciﬁcally, in addition to the original teacher-student framework,our method introduces a teaching assistant network which directly learns frompseudo labels generated by the teacher network.
The gentle teaching assistant(GTA) is coined gentle since it only transfers the beneﬁcial feature representationknowledge in the feature extractor to the student model in an Exponential Moving
Average (EMA) manner, protecting the student model from the negative inﬂuencescaused by unreliable pseudo labels in the mask predictor.
The student model isalso supervised by reliable labeled data to train an accurate mask predictor, furtherfacilitating feature representation.
Extensive experiment results on benchmarkdatasets validate that our method shows competitive performance against previousmethods.
We promise to release our code towards reproducibility.
Introduction
The rapid development in deep learning has brought signiﬁcant advances to semantic segmentation [25,4, 47] which is one of the most fundamental tasks in computer vision.
Existing methods often heavilyrely on numerous pixel-wise annotated data, which is labor-exhausting and expensive.
Towardsthis burden, great interests have been aroused in Semi-Supervised Semantic Segmentation, whichattempts to train a semantic segmentation model with limited labeled data and a large amount ofunlabeled data.
The key challenge in semi-supervised learning is to effectively leverage the abundant unlabeled data.
One widely adopted strategy is pseudo labeling [23].
As shown in Figure 1, the model assigns pseudolabels to unlabeled data based on the model predictions on-the-ﬂy.
These data with pseudo labelswill be taken as auxiliary supervision during training to boost performance.
To further facilitatesemi-supervised learning, the teacher-student framework [37, 41, 38] is incorporated.
The teachermodel, which is the Exponential Moving Average (EMA) of the student model, is responsible for
[Figure]
design the representation knowledge transmission between the student the negative caused by unreliable pseudo labels generating smoothly updated pseudo labels.
Via jointly supervised by limited data with ground-truthlabels and abundant data with pseudo labels, the student model can learn more representative features,leading to signiﬁcant performance gains.
Although shown to be effective, the pseudo labeling paradigm suffers from unreliable pseudo labels,leading to inaccurate mask predictions.
Previous research work alleviates this problem by ﬁlteringout predictions that are lower than a threshold of classiﬁcation scores [2, 34, 45].
However, thismechanism can not perfectly ﬁlter out wrong predictions, because some wrong predictions may havehigh classiﬁcation scores, named over-conﬁdence or mis-calibration [15] phenomenon.
Moreover, ahigh threshold will heavily reduce the number of generated pseudo labels, limiting the effectivenessof semi-supervised learning.
Towards the aforementioned challenge, it is necessary to propose a new pseudo labeling paradigmthat can learn representative features from unlabeled data as well as avoid negative inﬂuences causedby unreliable pseudo labels.
Delving into the semantic segmentation framework, it is composedof a feature extractor and a mask predictor.
Previous works ask the feature extractor and the maskpredictor to learn from both ground-truth labels and pseudo labels simultaneously.
As a result, theaccuracy of the model is harmed by incorrect pseudo labels.
To better leverage the unlabeled datawith pseudo labels, a viable solution is to let the feature extractor learn feature representation fromboth ground-truth labels and pseudo labels, while the mask predictor only learns from ground-truthlabels to predict accurate segmentation results.
Accordingly, we propose a novel framework, Semi-Supervised Semantic Segmentation via Gentle Teaching Assitant (GTA-Seg) , which attaches an additional gentle teaching assistant (GTA)module to the original teacher-student framework.
Figure 1 compares our method with previousframeworks.
In our method, the teacher model generates pseudo labels for unlabeled data and thegentle teaching assistant (GTA) learns from these unlabeled data.
Only knowledge of the featureextractor in the gentle teacher assistant (GTA) is conveyed to the feature extractor of the studentmodel via Exponential Moving Average (EMA).
We coin this process as representation knowledgetransmission .
Meanwhile, the student model also learns from the reliable ground-truth labels tooptimize both the feature extractor and mask predictor.
The gentle teaching assistant (GTA) is calledgentle since it not only transfers the beneﬁcial feature representation knowledge to the student model,but also protects the student model from the negative inﬂuences caused by unreliable pseudo labels inthe mask predictor.
Furthermore, a re-weighting mechanism is further adopted for pseudo labels tosuppress unreliable pixels.
Extensive experiments have validated that our method shows competitive performance on mainstreambenchmarks, proving that it can make better utilization of unlabeled data.
In addition, we can observefrom the visualization results that our method boasts clearer contour and more accurate classiﬁcationfor objects, which indicates better segmentation performance.
Related Work
Semantic Segmentation Semantic Segmentation, aiming at predicting the label of each pixel inthe image, is one of the most fundamental tasks in computer vision.
In order to obtain the densepredictions, FCN [25] replaces the original fully-connected layer in the classiﬁcation model withconvolution layers.
The famous encoder-decoder structure is borrowed to further reﬁne the pixel-leveloutputs [29, 1].
Meanwhile, intensive efforts have been made to design network components that aresuitable for semantic segmentation.
Among them, dilated convolution [43] is proposed to enhancereceptive ﬁelds, global and pyramid pooling [24, 4, 47] are shown to be effective in modeling contextinformation, and various attention modules [46, 48, 12, 19, 36] are adopted to capture the pixelrelations in images.
These works mark milestones in this important computer vision task, but theypay rare attention to the data-scarce scenarios.
Semi-Supervised Learning Mainstream methods in Semi-Supervised Learning [50] (SSL) fallinto two lines of work, self-training [14, 23] and consistency reguralization [22, 33, 28, 40, 37].
Thecore spirit of self-training is to utilize the model predictions to learn from unlabeled data.
Pseudo
Labeling [23], which converts model predictions on unlabeled data to one-hot labels, is a widely-usedtechnique [2, 34, 45] in semi-supervised learning.
Another variant of self-training, entropy minimization [32], is also proved to be effective both theoretically [39] and empirically [14].
Consistency
Regularization [33, 40] forces the model to obtain consistent predictions when perturbations areimposed on the unlabeled data.
Some recent works unveil that self-training and consistency regularization can cooperate harmoniously.
MixMatch [2] is a pioneering holistic method and boasts remarkableperformance.
On the basis of MixMatch, Fixmatch [34] further simplify the learning process while
FlexMatch [45] introduces a class-wise conﬁdence threshold to boost model performance.
Semi-Supervised Semantic Segmentation Semi-Supervised Semantic Segmentation aims at pixellevel classiﬁcation.
Borrowing the spirit of Semi-Supervised Learning, self-training and consistencyregularization gives birth to various methods.
One line of work [51, 6, 18, 38] applies pseudo labelingin self-training to acquire auxiliary supervision, while methods based on consistency pursue stableoutputs at both feature [21, 49] and prediction level [31].
Apart from them, Generative Adversarial
Networks (GANs) [13] are often leveraged to provide additional supervision in relatively earlymethods [35, 27, 20].
Some recent works [44] unveil another interesting phenomenon that the mostfundamental training paradigm, equipped with strong data augmentations, can serve as a simple yeteffective baseline.
In this paper, we shed light on semi-supervised semantic segmentation based onpseudo labeling and strives to alleviate the negative inﬂuence caused by noisy pseudo labels.
Method
3.1 Preliminaries
Semi-Supervised Semantic Segmentaion In Semi-Supervised Semantic Segmentation, wetrain a model with limited labeled data D l = { x li , y li } N l
i
=1 and a large amount of unlabeled data
D u = { x ui , y ui } N u i =1 , where N u is often much larger than N l .
The semantic segmentation network iscomposed of the feature extractor f and the mask predictor g .
The key challenge of Semi-Supervised
Semantic Segmentation is to make good use of the numerous unlabeled data.
And one commonsolution is pseudo labeling [23, 42].
Pseudo Labeling Pseudo Labeling is a widely adopted technique for semi-supervised segmentation,which assigns pseudo labels to unlabeled data according to model predictions on-the-ﬂy.
Assumingthere are K categories, considering the j th pixel on the i th image, the model prediction p uij and the will be
[Equation]
where larger c uij indicates that the model is more certain on this pixel, which is consequently, moresuitable for generating pseudo labels.
Speciﬁcally, we often keep the pixels whose conﬁdence valueis greater than one threshold, and generate pseudo labels as
[Equation]
where γ t is the conﬁdence threshold at the t iteration.
We note that γ t can be a constant or a variedvalue during training.
The j th pixel on i th image with a conﬁdence value larger than γ t will beassigned with pseudo label ˆ y uij .
The unlabeled data that are assigned with pseudo labels will be takenas auxiliary training data, while the other unlabeled data will be ignored.
Teacher-Student Framework Teacher-Student [37, 38] framework is a currently widely appliedparadigm in Semi-Supervised Segmentation. This framework consists of one teacher model and onestudent model.
The teacher model is responsible for generating pseudo labels while the student modellearns from both the ground-truth labels and pseudo labels.
Therefore, the loss for the student modelis
[Equation]
In Semi-Supervised Semantic Segmentation, L l and L u are the cross-entropy loss on labeled dataand unlabeled data with pseudo labels, respectively [38], and µ is a loss weight to adjust the trade-offbetween them.
The optimization of the student model can be formulated as
[Equation]
where λ denotes the learning rate.
In the Teacher-Student framework, after the parameters of thestudent model are updated, the parameters of the teacher model will be updated by the studentparameters in an Exponential Moving Average (EMA) manner.
[Equation]
where θ teacher ( t ) and θ student ( t ) denote the parameters of the teacher and student model at t -thiteration, respectively.
α is a hyper-parameter in EMA, where α ∈ [0 , 1] .
3.2 Gentle Teaching Assistant
In this section, we will introduce our Gentle Teaching Assistant framework for semi-supervisedsemantic segmentation (GTA-Seg), as shown in Figure 2, which consists of the following three steps.
Step 1: Pseudo Label Generation and Re-weighting.
Similar to previous work [38], the teachermodel is responsible for generating pseudo labels.
A conﬁdence threshold is also adopted to ﬁlter outthe pseudo labels with low conﬁdence.
For the kept pixels, instead of treating all of them equally, wepropose a re-weighting mechanism according to the conﬁdence of each pixel as follows,
[Equation]
In our re-weighting strategy, the pixel with higher conﬁdence will be highlighted while the other willbe suppressed.
As a result, the negative inﬂuence caused by unreliable pseudo labels can be furtheralleviated.
We adopt Laplace Smoothing [26] to avoid over penalization where τ is a predeﬁnedcoefﬁcient.
With this re-weighting mechanism, the unsupervised loss on unlabeled data becomes
FeatureExtractor
FeatureExtractor FeatureExtractor
Predictor Predictor
Predictor
CrossEntropy
Re-weightedpseudolabel
Backward Forward
Student
Teaching Assistant Teacher
Pseudo Label
EMA EMA
EMA
Ground Truth Label
Unlabeled Data
Labeled Data
Unlabeled Data ① ② ③ ③ ①
Representation Knowledge Transmission ③ ② Gentle Teaching Assistant 𝜃 !"
#$ 𝜃 ""#$
Student 𝜃 !
#&’()# 𝜃 "%#&’()#
Teacher 𝜃 !
#($*+(, 𝜃 "#($*+(,
[Equation]
from the unlabeled data and only transfers thebeneﬁcial feature representation knowledge to the student model, protecting the student model fromthe negative inﬂuences caused by unreliable pseudo labels.
After optimized on unlabeled data as in Eq.
8, the gentle teaching assistant model is required toconvey the learned representation knowledge in feature extractor to the student model via Exponential Moving Average (EMA) as in Eq.
[Equation]
[Equation]
where θ gta ( t ) is the parameters of the gentle teaching assistant model at t -th iteration, θ student ( t ) isthe parameters of the student model at t -th iteration, and θ f denotes the parameters of the feature extractor.
Through our representation knowledge transmission, the unlabeled data is leveraged tofacilitate feature representation of the student model, but it will not train the mask predictor.
Step 3:
Optimize student model with ground truth labels and update teacher model.
With thegentle teaching assistant module, the student model in our framework is only required to learn fromthe labeled data,
[Equation]
[Equation]
Here, the whole model, including the feature extractor as well as the mask predictor, is updatedaccording to the supervised loss computed by the ground-truth labels of labeled data.
Then the teacher model is updated by taking the EMA of the student model according to the traditionalparadigm in the teacher-student framework.
[Equation]
[Equation]
Finally, the teacher model, which absorbs the knowledge of both labeled and unlabeled data from thestudent model, will be taken as the ﬁnal model for inference.
Experiment
4.1 Datasets
We evaluate our method on 1) PASCAL VOC 2012 [9]: a widely-used benchmark dataset for semanticsegmentation, with 1464 images for training and 1449 images for validation.
Some researches [6, 42]augment the training set by incorporating the 9118 coarsely annotated images in SBD [16] to theoriginal training set, obtaining 10582 labeled training images, which is called the augmented trainingset.
In our experiments, we consider both the original training set and the augmented training set,taking 92 , 183 , 366 , 732 , and 1464 images from the 1464 labeled images in the original training set,and 662 , 1323 and 2645 images from the 10582 labeled training images in the augmented training set.
2) Cityscapes [7], a urban scene dataset with 2975 images for training and 500 images for validation.
We sample 100 , 186 , 372 , 744 images from the 2975 labeled images in the training set.
We take thesplit in [51] and report all the performances in a fair comparison. [Table] [Table] [Table]
4.2 Implementation Details
We take ResNet-101 [17] pre-trained on ImageNet [8] as the network backbone and DeepLabv3+ [5]as the decoder.
The segmentation head maps the 512-dim features into pixel-wise class predictions.
We take SGD as the optimizer, with an initial learning rate of 0.001 and a weight decay of 0.0001 for
PASCAL VOC.
The learning rate of the decoder is 10 times of the network backbone.
On Cityscapes,the initial learning rate is 0.01 and the weight decay is 0.0005.
Poly scheduling is applied to thelearning rate with lr = lr init · (1 − tT ) 0 .
9 , where lr init is the initial learning rate, t is the currentiteration and T is the total iteration.
We take 4 GPUs to train the model on PASCAL VOC, and8 GPUs on Cityscapes.
Following previous works, input images are center cropped in PASCAL
VOC during evaluation, while on Cityscapes, sliding window evaluation is adopted.
The mean of
Intersection over Union (mIoU) measured on the validation set serves as the evaluation metric.
4.3 Experimental Results
PASCAL VOC
We ﬁrst evaluate our method on the original training set of PASCAL VOC2012.
The results in Table 1 validate that our method surpasses previous methods by a large margin.
Speciﬁcally, our method improves the supervised-only (SupOnly) model by 24 .
24 , 9 . 69 , 6 . 68 ,7 . 97 in mIoU
when 0 .
9% of the data is labeled, respectively.
Whencompared to the readily strong semi-supervised semantic segmentation method, our method stillsurpasses it by 13 .
32 , 6 . 32 respectively.
We note that in the original training set, theratio of labeled data is relatively low ( 0 . 9% to 13 .
Therefore, the results verify that our methodis effective in utilizing unlabeled data in semi-supervised semantic segmentation.
We further compare our method with previous methods on the augmented training set of PASCAL
VOC 2012, where the annotations are relatively low in quality since some of labeled images comefrom SBD [16] dataset with coarse annotations.
We can observe from Table 2, our method consistentlyoutperforms the previous methods in a fair comparsion.
[Table] [Table]
[Table]
[Table]
Cityscapes For Cityscapes, as shown in Table 3, our method still shows competitive performanceamong previous methods, improving the existing state-of-the-art method by 1 . 80 , 1 . 64 , 1 . 57 , 2 . 19 inmIoU when 3 . 3% , 6 . 25% , 12 .
5% , 25 . 0% of the data is labeled.
4.4 Analyses
Component Analysis We analyze the effectiveness of different components in our method, i.e. , theoriginal teacher-student framework, gentle teaching assistant and re-weighted pseudo labeling as in
Table 4.
According to the results in Table 4, the carefully designed gentle teaching assistant mechanism (the third row) helps our method outperform the previous methods, pushing the performanceabout 13 .
1 higher than the original teacher-student model (the second row).
Further, the re-weightedpseudo labeling brings about 1 .
1 performance improvements.
With all of these components, ourmethod outperforms the teacher-student model by over 14 . 0 and SupOnly by over 18 .
in mIoU.
Gentle Teaching Assistant As mentioned in Table 4, our proposed gentle teaching assistantframework brings about remarkable performance gains.
Inspired by this, we delve deeper into thegentle teaching assistant model in our framework.
We ﬁrst consider the representation knowledgetransmission mechanism.
In Table 5, we compare our mechanism with other methods such as theoriginal EMA [37] that updates all of the parameters via EMA and Unbiased ST [3] that introducesan additional agent to convey representation knowledge.
We can observe that all these mechanismsboost SupOnly remarkably, while our mechanism is superior to other methods.
We next pay attention to the three models in our framework, i.e. gentle teaching assistant model,student model, and teacher model.
Table 6 reports the evaluation performance of them.
All of themshow relatively competitive performance.
For the teacher assistant model, it is inferior to the studentmodel.
This is reasonable since it is only trained on pseudo labels, while the student model inheritsthe representation knowledge of unlabeled data from the gentle teaching assistant as well as trainedon labeled data.
In addition, the teacher model performs best, which agrees with previous works [37].
Re-weighted Pseudo Labeling In our method, we design the re-weighting strategy for pseudolabels as Eq. 6, which contains 1) conﬁdence-based re-weighting, 2) Laplace Smoothing.
Here weconduct further ablation study on our design.
Table 7 shows that though effective in other tasks suchas semi-supervised object detection [41], in our framework, adopting conﬁdence-base re-weighting isharmful, dropping the performance from 72 .
10 to 70 .
On the contrary, our strategy, with the helpof Laplace Smoothing [26] which alleviates over-penalization, pushes the readily strong performanceto a higher level.
Visualization Besides quantitative results, we present the visualization results to further analyzeour method.
We note that the model is trained on as few as 183 labeled samples and about {+
 [Figure] unlabeled+} samples.
As shown in Figure 3, facing such limited labeled data, training the modelmerely in the supervised manner (SupOnly) appears to be vulnerable.
Under some circumstances,the model is even ignorant of the given images (the third and the fourth row).
While methods thatutilize unlabeled data (teacher-student model and our method), show stronger performance.
Further,compared with the original teacher-student model, our method shows a stronger ability in determininga clear contour of objects (the ﬁrst row) and recognizing the corresponding categories (the secondrow).
Our method is also superior to previous methods in distinguishing objects from the background (the third and fourth row).
Limitations Comparing the performance of our method on the original (Table 1) and augmented(Table 2) training set of PASCAL VOC 2012, our method outperforms previous methods by aremarkable margin in the original set, while the superiority is relatively slight in the augmented set.
We conjecture that this phenomenon can be attributed to the low-quality labeled data in the augmentedset where some of the images come from the coarse annotations in SBD [16] dataset.
This indicatesone limitation of our method that it only attempts at making better use of the unlabeled data, but littleattention has been paid to the labeled data.
We consider it promising to conduct research on howto better leverage the labeled data in semi-supervised semantic segmentation, especially when theannotations are also noisy.
Conclusion
In this paper, we propose a novel framework, Gentle Teaching Assistant, for semi-supervised semanticsegmentation (GTA-Seg).
Concretely, we attach an additional teaching assistant module to disentanglethe effects of pseudo labels on the feature extractor and the mask predictor.
GTA learns representationknowledge from unlabeled data and conveys it to the student model via our carefully designedrepresentation knowledge transmission.
Through this framework, the model optimizes representationwith unlabeled data, as well as prevents it from overﬁtting on limited labeled data.
A conﬁdencebased pseudo label re-weighting mechanism is applied to further boost the performance.
Extensiveexperiment results prove the effectiveness of our method.
Checklist
The checklist follows the references.
Please read the checklist guidelines carefully for information onhow to answer these questions.
For each question, change the default [TODO] to [Yes] , [No] or[N/A] .
You are strongly encouraged to include a justiﬁcation to your answer , either by referencingthe appropriate section of your paper or providing a brief inline description.
For example:
• Did you include the license to the code and datasets?
[Yes] See Section ?? .•
Did you include the license to the code and datasets?
[No] The code and the data areproprietary.•
Did you include the license to the code and datasets?
[N/ A]
Please do not modify the questions and only use the provided macros for your answers.
Note that the
Checklist section does not count towards the page limit.
In your paper, please delete this instructionsblock and only keep the Checklist section heading above along with the questions/answers below.
For all authors...
(a) Do the main claims made in the abstract and introduction accurately reﬂect the paper’scontributions and scope?
[Yes](b) Did you describe the limitations of your work?
[Yes] See Section 4.
(c) Did you discuss any potential negative societal impacts of your work?
[N/A]
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes]
If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results?
[N/A]
(b) Did you include complete proofs of all theoretical results?
[N/A]
If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[No] We promise torelease the code and models upon the paper accepted.(b)
Did you specify all the training details (e g., data splits, hyperparameters, how theywere chosen)?
[Yes] See Section 4.2(c)
Did you report error bars (e g., with respect to the random seed after running experiments multiple times)?
[No]
(d) Did you include the total amount of compute and the type of resources used (e g., typeof GPUs, internal cluster, or cloud provider)?
[Yes] See Section 4.24.
If you are using existing assets (e g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators?
[Yes] See Section 4.
(d) Did you discuss whether and how consent was obtained from people whose data you’re
[Table]
using/curating?
[No]
[Table] (e) Did you discuss whether the data you are using/curating contains personally identiﬁable [Table]
information or offensive content?
[No]
[Table]
If you used crowdsourcing or conducted research with human subjects...
[Table] Did you include the full text of instructions given to participants and screenshots, if [Table]
applicable
N A]
[Table] you describe any potential participant risks, with links to Institutional Review [Table]
Board ) approvals,
[Table]
you include the estimated hourly wage paid to participants and the total amount
[Table]
spent on participant compensation?
[N/A]
[Table]