- Introduced by
- Multiple (Ouali et al., Zou et al., Chen et al.)
- Year
- 2018–2020
- Type
- Semi-supervised deep learning for pixel-level classification
- Family
- Deep learning / NLP / CV
What does it do?
Semi-supervised semantic segmentation trains pixel-labeling models on a small set of fully labeled images together with a larger set of unlabeled images.
Pseudo-labeling and consistency regularization derive training signal from the unlabeled data. Whether the result approaches fully supervised accuracy depends on the dataset, the labeled split and the quality of the pseudo-labels, so it should be checked against a fully supervised baseline trained on the same labeled images.
The intuition behind the method
Pixel-by-pixel annotation is among the most expensive forms of labeling in computer vision, since a single image can take a long time to label. Semi-supervised segmentation uses unlabeled images to supplement the labeled ones. One approach is consistency: a well-trained model should produce similar segmentation maps when the input or its internal representation is perturbed, so disagreement between perturbed versions signals uncertainty and can be penalized on unlabeled data. This rests on the cluster assumption, under which the decision boundary should lie in low-density regions of the data. Ouali et al. observe that for segmentation these low-density regions are more apparent within the hidden representations than within the inputs. Another approach is pseudo-labeling: the model's own confident predictions on unlabeled images are reused as targets in later training rounds. Both act as additional training signal that does not require new human annotation, but both can reinforce the model's existing mistakes if its predictions are poor.
History
Semi-supervised semantic segmentation adapts semi-supervised learning ideas to pixel-wise prediction. Consistency training, which relies on the cluster assumption, is one such idea. Cross-Consistency Training by Ouali, Hudelot and Tami (CVPR 2020) applies it to segmentation by enforcing agreement between a main decoder and auxiliary decoders that receive perturbed encoder outputs. The authors report state-of-the-art results on several datasets.
When to use it
Choose semi-supervised segmentation when pixel-wise annotation is the bottleneck and a large pool of unlabeled images from the same distribution as the labeled set is available. Typical cases include medical images, aerial or satellite images, and driving footage, where expert annotation is costly. Do not use it when unlabeled images come from a different domain or camera than the labeled images, because pseudo-labels will then carry systematic errors. Also avoid it when a fully supervised model can be trained with the labels you can afford, since that is the simpler and more transparent baseline.
Limitations and considerations
- Pseudo-label quality depends on the supervised model trained in the first step; a weak initial model can cause errors to accumulate across iterations.
- Distribution mismatch between labeled and unlabeled images propagates noise into pseudo-labels and into the consistency targets.
- Two hyperparameters, the confidence threshold and the loss weight lambda, must be tuned, and their best values depend on the dataset.
- Each training step processes unlabeled batches as well as labeled ones, so training cost is higher than fully supervised training on the labeled set alone.
- Results depend on which images were labeled, so comparisons need several random labeled splits with reported spread.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Unlabeled images enter through an extra loss term added to the standard supervised objective, so an existing supervised training pipeline can be extended rather than replaced.
- The cross-consistency method of Ouali et al. is described by its authors as simple: it requires auxiliary decoders attached to a shared encoder.
- The cross-consistency formulation can, according to the cited abstract, be extended to use additional training signal such as image-level or pixel-level labels from other domains.
- Useful where the unlabeled images match the labeled distribution and labeling capacity is the constraint.
- The consistency formulation does not require pseudo-labels, so it can be used when a confident pseudo-label threshold is hard to set.
Applications
- Medical image segmentation (organs, lesions) where expert annotation is costly.
- Autonomous driving scene parsing using large amounts of unlabeled dashcam footage.
- Satellite and aerial image analysis for land cover or building detection.
- Industrial defect detection where defect examples are rare but normal images are plentiful.
- Natural scene parsing in robotics applications with limited labeled benchmarks.
How it works
How it works
The model is first trained on the labeled images with the standard pixel-wise cross-entropy loss. This gives an initial model whose predictions are used to generate pseudo-labels, so the quality of this step limits the quality of everything that follows.
The trained model predicts a class for each pixel of the unlabeled images. Only predictions that pass a confidence threshold are kept as pseudo-labels and used as surrogate ground truth. The threshold controls the trade-off between label noise and the amount of unlabeled data used.
In the cross-consistency approach of Ouali et al., a shared encoder feeds a main decoder and several auxiliary decoders. The auxiliary decoders receive differently perturbed versions of the encoder's output, and the penalty encourages their predictions to agree with the main decoder on unlabeled images. The perturbations are applied to feature representations rather than to the input image, which is the basis of the method's claim that low-density regions are more apparent in the hidden representations than in the inputs.
Labeled and unlabeled images are often combined in each training batch. The total loss is the supervised loss on labeled pixels plus lambda times the unsupervised loss (pseudo-label cross-entropy or consistency penalty) on unlabeled pixels. The weight lambda sets how strongly the unlabeled data influences training, and its value must be tuned.
Formula
\mathcal{L} = \mathcal{L}_{sup} + \lambda \mathcal{L}_{unsup}As training proceeds, the model's predictions on unlabeled images typically change, so pseudo-labels generated later can differ from those generated earlier. Pseudo-labels may be regenerated periodically, and the confidence threshold may be adjusted. Stopping criteria are usually set on performance on held-out labeled validation data.
Common pitfalls
- Generating pseudo-labels before the supervised model has been trained sufficiently, which produces systematically wrong supervision.
- Using unlabeled images from another domain or camera without domain adaptation, which adds noise to the pseudo-labels.
- Setting the confidence threshold too low and accepting unreliable pseudo-labels, or too high so that most of the unlabeled set is discarded.
- Reporting results on a single labeled split: one split gives one estimate and no measure of how much the result depends on which images were labeled.
- Omitting a fully supervised baseline trained on the same labeled images, which makes it impossible to tell whether the unlabeled data helped.
Frequently asked questions
How many labeled images are typically needed to start?
The cited sources give no general minimum. What matters is that the supervised model trained on the labeled images is good enough to produce reliable pseudo-labels, so check a fully supervised baseline on the same labeled set first. If that baseline is weak, the pseudo-labels derived from it are likely to be weak too.
What is the best confidence threshold for pseudo-labels?
There is no established general default. As a starting point, a value such as 0.95 can be tried: keep pixels whose top-class probability exceeds it. The best threshold is dataset-dependent and should be selected on a held-out labeled validation subset.
Can I use this with any segmentation backbone?
Pseudo-labeling is applied on top of a segmentation network's outputs, so it is not tied to one architecture in principle. The cross-consistency method of Ouali et al. adds auxiliary decoders to a shared encoder, so decoder design is part of that method. Check the cited papers for backbone-specific results.
How do I evaluate fairly?
Report mean Intersection-over-Union (mIoU) on a fixed held-out test set. Because performance depends on which labeled images are chosen, repeating the experiment over several random labeled splits is advisable, and reporting the mean and standard deviation gives a sense of that variation.
Is this the same as weakly supervised segmentation?
No. Weakly supervised segmentation uses incomplete annotations (image-level labels, bounding boxes, scribbles) for the annotated subset. Semi-supervised segmentation uses full pixel-wise labels for a small subset and no annotations at all for the rest.
Related methods
Sources
Ouali, Y., Hudelot, C., & Tami, M. (2020). Semi-Supervised Semantic Segmentation with Cross-Consistency Training. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 12674–12684.
Open DOI referenceZou, Y., Zhang, Z., Zhang, H., Li, C.-L., Bian, X., Huang, J.-B., & Pfister, T. (2020). PseudoSeg: Designing Pseudo Labels for Semantic Segmentation. International Conference on Learning Representations (ICLR 2021).
Open publication reference