- Introduced by
- Sohn et al. (STAC); Liu et al. (Unbiased Teacher)
- Year
- 2020–2021
- Type
- Semi-supervised learning for detection
- Family
- Deep learning / NLP / CV
What does it do?
Semi-supervised object detection trains a detector on a small set of bounding-box-labeled images together with a large set of unlabeled images.
A teacher model predicts boxes on the unlabeled images, and a student model learns from both the human-labeled and the pseudo-labeled data. The goal is to reduce the cost of manual box annotation while keeping accuracy close to that of a fully supervised detector.
The intuition behind the method
Drawing bounding boxes costs far more than assigning image-level labels, because each object must be localized, sized and classified. Semi-supervised object detection reuses unlabeled images by having a trained teacher predict boxes and scores on them. Confident predictions become training targets, so the student learns from the scarce human-labeled boxes and from the pseudo-labeled ones. In mean-teacher variants, the teacher is an exponential moving average (EMA) of the student's weights, so its pseudo-labels can improve as the student improves.
History
The STAC framework of Sohn et al. (2020) applied pseudo-labeling with strong data augmentation to object detection. Unbiased Teacher (Liu et al., ICLR 2021) extended this teacher-student approach by adding an exponential-moving-average (EMA) teacher and by addressing pseudo-label bias in the classification loss.
When to use it
Choose semi-supervised object detection when box annotations are expensive or scarce, for example in medical, satellite or specialized industrial imagery, and a large pool of unlabeled images from the same domain is available. The method is most useful when labeled images are a small fraction of the pool. As a rough practical guideline, this means roughly the 1–10% range. Do not use it when the unlabeled images come from a domain that differs strongly from the labeled images, because domain shift degrades pseudo-label quality. It is also a poor choice when the labeled set is already large enough for a fully supervised detector to train well, or when the compute budget cannot support two networks and strong augmentation during training.
Limitations and considerations
- Pseudo-label quality falls when labeled data is extremely scarce. With very few labeled images per class, pseudo-label noise can dominate training, and early errors can be reinforced in later rounds. Check this on your own labeled validation split.
- Training cost is much higher than supervised detection, because two networks and a strong augmentation pipeline run together.
- Results depend on the pseudo-label confidence threshold. Choosing it requires a held-out labeled validation set, which may itself be small.
- When labeled data is already abundant, the gain over a fully supervised detector is small, so the added complexity may not be justified.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Reduces the number of human-drawn boxes needed, since the unlabeled images contribute training signal through pseudo-labels.
- The gain over supervised-only training is typically largest at low label ratios and shrinks as the labeled set grows, so the method is most worth considering when labels are scarce.
- The EMA teacher produces pseudo-labels that can improve during training without a separate retraining stage.
- The teacher-student scheme does not depend on one architecture, so it can be applied to different detector families, though each needs its own handling of pseudo-labels and losses.
- Strong augmentations such as mosaic and colour jitter give the student the view difference that the consistency loss relies on.
Applications
- Medical image analysis where bounding-box annotation by clinicians is costly and limited.
- Autonomous driving perception with abundant unlabeled dashboard-camera footage.
- Satellite and aerial image analysis where labeled ground-truth is labor-intensive.
- Industrial quality control and defect detection with limited labeled defect examples.
- Wildlife monitoring using camera-trap images with only a small expert-labeled subset.
- Retail shelf detection systems where product variety makes exhaustive labeling impractical.
How it works
How it works
The detector is first trained on the labeled images alone, using the standard supervised detection loss (for example, classification and box-regression losses over anchor proposals). The result is a usable but data-limited model whose predictions on unlabeled images are reasonable and still imperfect.
The teacher, either the same network or an EMA copy of the student, runs inference on the unlabeled images under weak augmentation. Each predicted box is kept together with its class confidence score. These teacher outputs are the pseudo-labels that will supervise the student.
The student is trained jointly on labeled images with ground-truth boxes and on unlabeled images with pseudo-labels as targets. The student receives a strongly augmented view of each unlabeled image, for example with random cropping, colour jitter or mosaic, while the teacher sees the weakly augmented view. The training signal asks the student to reproduce the teacher's boxes on the harder view. In words, the total training loss is the supervised detection loss on the labeled images plus a weighted pseudo-label loss on the unlabeled images. The pseudo-label loss applies the same detection loss to the student's predictions on the strongly augmented view, using as targets only the teacher boxes that pass the confidence threshold described in the next step. The weighting coefficient is a tunable hyperparameter.
Only pseudo-boxes whose confidence score exceeds a threshold, commonly between 0.7 and 0.9, are used as training targets. This removes many noisy predictions but keeps the more reliable ones. The threshold has to be calibrated: a low value admits noisy boxes, while a high value discards much of the unlabeled data.
In EMA-based pipelines such as Unbiased Teacher, the teacher weights are updated after each training step as an exponential moving average of the student weights. In words, the new teacher weights are a weighted average of the previous teacher weights and the current student weights, where the weighting (momentum) coefficient is a tunable hyperparameter. The teacher therefore improves together with the student. The cycle of pseudo-labelling, consistency training and EMA update repeats until performance stops improving on the labeled validation set.
Common pitfalls
- Applying the same strong augmentation to teacher and student inputs removes the view difference that the consistency loss depends on, so the student has little to learn beyond copying the teacher.
- Ignoring class imbalance among pseudo-labels: frequent classes produce many more pseudo-boxes and can dominate training, leaving rare classes with little supervision.
- Skipping a separate labeled validation set for threshold calibration, which makes the chosen threshold hard to justify and can hide poor pseudo-label precision.
- Reusing a pseudo-label threshold tuned on one dataset in a new domain without recalibrating it on labeled data from that domain.
- Evaluating on images that were part of the unlabeled training pool, which can inflate mAP because the model has already been trained on those images through pseudo-labels.
Frequently asked questions
How much labeled data do I need for semi-supervised object detection to help?
The method is most useful when labeled images are a small fraction of the total image pool. As a rough guideline, this is roughly 1–10%. If there are very few labeled images per class, pseudo-label noise can dominate training, so check the benefit on your own labeled validation split. With abundant labels, a fully supervised detector is simpler and often sufficient.
What confidence threshold should I use for pseudo-boxes?
Thresholds between 0.7 and 0.9 are common starting points. Calibrate on a small held-out labeled validation set: measure the precision of pseudo-labels at several thresholds and choose the one that balances the number of boxes against their quality.
Can I use semi-supervised detection with YOLO or DETR instead of Faster R-CNN?
The teacher-student pseudo-labeling principle does not depend on a specific detector, but pseudo-label and loss handling must be adapted to each architecture. Check the paper for any specific variant you plan to use before relying on its reported behaviour, since implementation details differ.
How does this differ from weakly supervised object detection?
Weakly supervised detection uses image-level labels, without boxes, to infer object locations. Semi-supervised detection uses a small set of full bounding-box annotations together with unlabeled images. Because it starts from real box annotations, the semi-supervised approach can learn box geometry directly.
What metric should I use to evaluate semi-supervised detectors?
Use mean Average Precision (mAP) at IoU thresholds of 0.5 (mAP50) and 0.5:0.95 (mAP50-95), following the COCO protocol. Always compare against a supervised-only baseline trained on the same labeled split to quantify the gain from the unlabeled data.
Related methods
Sources
Sohn, K., Zhang, Z., Li, C.-L., Zhang, H., Lee, C.-Y., & Pfister, T. (2020). A Simple Semi-Supervised Learning Framework for Object Detection. arXiv preprint arXiv:2005.04757.
Open publication referenceLiu, Y.-C., Ma, C.-Y., He, Z., Kuo, C.-W., Chen, K., Zhang, P., Wu, B., Kira, Z., & Vajda, P. (2021). Unbiased Teacher for Semi-Supervised Object Detection. ICLR 2021.
Open publication reference