When your labels are scarce, train a critic to fake it
A 2018 PyTorch implementation that uses adversarial training to squeeze more segmentation accuracy out of limited labeled data.

What it does
This is the reference PyTorch code for a BMVC 2018 paper on semi-supervised semantic segmentation. It trains a DeepLabv2-ResNet101 segmenter on partial Pascal VOC2012 labels, using a discriminator network to push the segmenter toward more realistic outputs on unlabeled images. The authors provide pretrained models for 1/8, 1/4, and 1/2 labeled data fractions, plus a fully supervised baseline.
The interesting bit
The trick is the adversarial hinge: the discriminator learns to distinguish real ground-truth segmentations from the model’s predictions, and the segmenter gets penalized for fooling it. This creates a pressure toward plausible label maps even where no labels exist. The README notes the code is “heavily borrowed” from an existing DeepLab implementation — this is research scaffolding, not a from-scratch rebuild.
Key highlights
- Baseline (full supervision): 73.6% mIOU on VOC2012 val; semi-supervised with 1/8 labels: ~68.8%
- Pretrained models auto-download via evaluation script (
semi0.125,semi0.25,semi0.5,advFull) - Requires augmented VOC labels (SegmentationClassAug) for training
- Hyperparameters map directly to Table 5 in the paper
- Evaluation script saves both colorized outputs and per-class IOU breakdown
Caveats
- PyTorch version is pinned to the 0.2–0.4 era; the README promises a 0.4 migration that apparently never landed
- OpenCV 3.3 specifically causes GPU memory leaks in the multithreaded dataloader
- No training data augmentation or CRF post-processing, so numbers sit below contemporary fully-supervised SOTA
Verdict
Worth a look if you’re reproducing 2018 semi-supervised segmentation baselines or studying how GAN-style losses behave on structured prediction. Skip it if you need production-ready training code or modern PyTorch compatibility.