Models that segment street scenes are cheap to train on video-game imagery, where every pixel comes labeled for free. They then lose a large share of their accuracy on real camera frames. The usual fix is self-training: the model labels real images itself and keeps only its most confident guesses as new training targets. That fix has a known blind spot. Confident pixels are mostly road, sky and building, so thin and rare objects such as poles, traffic signs and riders get little training signal, and a model that simply never predicts them is never penalized. We propose a second, label-free check on real images, borrowed from dual learning in machine translation. A reverse model takes the predicted label map and tries to reconstruct the real image. It does this in the feature space of a frozen pretrained vision encoder rather than in pixels. If the segmenter drops a pole, the reconstruction has no pole, the real image does, and the error sends gradient back into the segmenter at exactly the missed pixels.
The idea transfers the closed-loop reconstruction of Semi-Supervised Learning for Neural Machine Translation to dense perception. In that paper, unlabeled monolingual text becomes useful because a backward model must recover it from the forward model's output. The transfer only works if it respects an asymmetry that the bidirectional literature flags. A label map cannot explain a whole image, because texture, lighting and sensor noise are lost when an image is reduced to labels. Strict invertibility therefore distorts the learning problem. The self-inverse network in Learning A Self-Inverse Network for Bidirectional Mri Image Synthesis shows this: it helps on bijective MRI contrast pairs but gains nothing on aerial-to-map, where many textures collapse onto one color block. Our core claim is that a reconstruction loss which is uncertainty-weighted, and whose uncertainty is fit on synthetic data where labels are exact, penalizes only the part of a real image that labels should explain. It thereby gives rare classes a training signal on real data that confidence-thresholded self-training cannot provide.
Core Claim
Let $x$ be a real image and $s = S(x)$ the segmenter's per-pixel class probabilities. Let $\phi(x)$ be the patch features of a frozen self-supervised encoder; we use DINO, motivated by Driving with DINO, which found these features to be a workable bridge between simulated and real driving imagery. A reverse network $R$ reads the whole label map and outputs, for each patch $p$, a predicted feature mean $\mu_p(s)$ and a variance $\sigma^2_p(s)$. The reconstruction loss is a Gaussian negative log-likelihood:
$$ \mathcal{L}_{\text{rec}}(x) = \sum_{p} \frac{\lVert \phi_p(x) - \mu_p(s) \rVert^2}{2\,\sigma^2_p(s)} + \frac{d}{2}\log \sigma^2_p(s), $$
where $d$ is the feature dimension. The variance head is trained only on synthetic pairs of ground-truth labels and features, then frozen. It therefore encodes how much of a patch's features the labels genuinely determine: little for textured vegetation, a lot for the shape of a thin pole against sky. On real images the segmenter cannot escape the loss by inflating uncertainty. The mean head is first fit on synthetic data and then adapted on real images, using the segmenter's own confident predictions as conditioning. This adaptation is the mutual part of the regularization: a better segmenter gives the reverse model cleaner conditioning, and a better-adapted reverse model gives the segmenter sharper gradients.
Two design choices separate this from existing bidirectional sim-to-real work. First, the backward direction reconstructs the real target image from predicted labels. That gives a training signal on unlabeled real data that does not depend on confidence. Second, the reverse network is contextual. It sees the whole label layout, so it can tell that a one-pixel-wide vertical "building" strip next to sky looks wrong, which a per-class prototype cannot. The soft-probability conditioning follows Maximum Expected Likelihood Estimation for Zero-resource Neural Machine Translation, which kept a latent intermediate sentence differentiable by feeding expected word embeddings.
Relation to Prior Work
The closest work is Bidirectional Learning for Domain Adaptation of Semantic Segmentation (BDL). It couples a synthetic-to-real image translator with a segmenter: the segmenter's loss on translated images flows back to keep the translator semantics-preserving, and confident real predictions above a fixed 0.9 threshold serve as pseudo-labels. In BDL the backward signal acts on the translator and is supervised by synthetic labels. On real images, the only signal is the thresholded pseudo-labels, which is exactly the rare-class weakness this proposal targets. We keep BDL's motivation that a one-way pipeline cannot correct its own errors. Our loop runs through the label space on real images instead of through a pixel translator.
StereoGAN and PixelDA likewise attach consistency terms to a generator that maps synthetic images to realistic ones. Both bear the cost that the Driving with DINO paper describes: realistic generation either keeps simulator artifacts or hallucinates structure. Because we never generate realistic pixels, we avoid that dilemma.
BCAT builds bidirectional cross-attention between source and target tokens, but only for classification and at four-branch cost. Our reverse network is a small decoder that is discarded at test time.
Unsupervised Contrastive Domain Adaptation for Semantic Segmentation aligns features to class prototypes and reports large gains on hard classes. It is the method most likely to make our proposal redundant, and we treat it that way below.
Several papers constrain the design rather than supply it. The self-inverse network's aerial-to-map result rules out strict, unweighted invertibility. The warm-start sensitivity of dual learning, documented around MELE and the multi-agent systems of Microsoft Research Asia's Systems for WMT19, means the loop must start from an already-adapted segmenter. Bidirectional pretraining in Improving Neural Machine Translation by Bidirectional Training supplies a scheduling idea we test: train the reverse model jointly for an early phase, then fine-tune the segmenter alone.
Research Program
The work has three parts.
First, we build the reverse model. It is a lightweight convolutional-plus-attention decoder from a 19-class soft label map to DINO patch features, with mean and variance heads. It is trained on GTA5 and SYNTHIA label/feature pairs. Before any adaptation, we measure how well it explains real Cityscapes features when given ground-truth Cityscapes labels, using a held-out 500 images for analysis only. This tells us how much reconstruction signal exists at all once the domain shift in the feature space is accounted for.
Second, we wire the loop. We start from a self-trained segmenter: a DeepLabv2 ResNet-101 warm-started with BDL-style pseudo-labeling. We then alternate two steps. One updates the segmenter with source cross-entropy, pseudo-label loss and $\mathcal{L}_{\text{rec}}$ on real images. The other updates the reverse mean head on real images, conditioned on detached confident predictions.
Third, we guard against the classic cycle-consistency cheat, in which the segmenter hides image information in near-uniform soft probabilities to help reconstruction. We do this by annealing the conditioning toward one-hot through a temperature schedule. We also audit for leakage directly, by comparing reconstruction quality from soft versus argmax maps.
Baselines
The naive reference point is the source-only segmenter trained on GTA5 or SYNTHIA with the same backbone. The VisDA challenge reports a source-only VisDA-S score of 21.4 mIoU, which shows how large this gap is.
The first bidirectional baseline is BDL, re-run with our backbone and schedule. Its reported result is 48.5% mIoU on GTA5→Cityscapes and 51.4% on the 13-class SYNTHIA→Cityscapes setting, against an oracle trained on real labels of about 65.1%, all from Bidirectional Learning for Domain Adaptation of Semantic Segmentation. It is the right baseline because it is the closed-loop method this work extends.
The strongest existing number in the file comes from Unsupervised Contrastive Domain Adaptation for Semantic Segmentation: 60.2% mIoU on GTA5→Cityscapes and 56.5% on SYNTHIA→Cityscapes. It is the strongest competitor because it already targets hard classes through prototypes. The file does not give its backbone, so we will both quote its reported numbers and re-run it under our backbone, iteration budget and pseudo-label pipeline. Methods outside this file may now exceed these numbers; the claim we test is additive improvement over a strong self-training base, not an absolute record.
Every method gets the same images, the same number of training iterations, and the same hyperparameter-search budget, about 20 trials tuned on a held-out split of Cityscapes train, never on val. A further control matches compute: self-training is run for the extra iterations our loop spends on the reverse model.
Two ablations isolate the key ingredient. In the first, $R$ is replaced by a per-pixel, context-free map from label to mean feature, which is prototype matching in DINO space. In the second, the frozen synthetic-fit variance is replaced by a constant, which is plain unweighted reconstruction.
Beating the baselines means two things. First, a mean-IoU gain over the re-run contrastive method and over compute-matched self-training that exceeds seed variance across three seeds. Second, a gain on the rare/thin class group (pole, traffic light, traffic sign, rider, motorcycle, bicycle, train) of at least two IoU points, with no loss on frequent classes.
Why not just…?
Why not just use class-balanced pseudo-label thresholds? Per-class thresholds address BDL's fixed 0.9 cutoff directly and are cheap, so this is a real threat. They still only redistribute confident predictions. A class the model rarely predicts at all gets few pseudo-labels at any threshold, while reconstruction penalizes omissions regardless of confidence. We include class-balanced thresholding inside our self-training base. If adding $\mathcal{L}_{\text{rec}}$ gives no further rare-class gain over it, the proposal fails.
Why not just align features to class prototypes? The contrastive method shows that prototype alignment helps hard classes, and our loss reduces to something prototype-like if the reverse model ignores context. The context-free reverse-model ablation settles this. If it matches the full contextual model, the contribution is only a reparameterization of prototype alignment, and we would say so.
Why not just train the segmenter on frozen DINO features? A domain-robust backbone may close much of the gap by itself. We therefore also run every method on a DINO-fed segmenter. The claim survives only if reconstruction helps on top of the stronger backbone. It could plausibly help less there, since the backbone and the reconstruction target would then share a feature space, and we will report that.
Why not just translate synthetic images to realistic ones, as BDL or PixelDA do? Translation fixes appearance, not the segmenter's omissions on real frames, and the Driving with DINO paper documents its trade-off between keeping layout and producing realism. The BDL comparison measures this directly, and combining BDL translation with our loss tests whether the two are complementary.
Proposed Experiments and Decisive Checks
The main benchmarks are GTA5→Cityscapes and SYNTHIA→Cityscapes (Playing for Data, SYNTHIA, Cityscapes). We report mean IoU, per-class IoU, and a small-object omission rate: the fraction of ground-truth instances of thin classes with under 10% pixel recall.
Four checks decide the outcome. The first is whether rare-class IoU rises over compute-matched, class-balanced self-training. The second is whether the contextual reverse model beats the prototype ablation. The third is whether the leakage audit stays clean: if soft-map reconstruction is much better than argmax-map reconstruction while segmentation accuracy stalls, the segmenter is hiding information in its probabilities rather than improving. The fourth is whether frozen synthetic-fit variance beats constant variance, which tests the asymmetric treatment of information that labels cannot carry. If the second and fourth checks both fail, the bidirectional idea adds nothing beyond prototypes.
We also run the BiT-style schedule from the translation work, with joint reverse-model training in the first third of iterations and segmenter-only fine-tuning afterward. Finally, as a transfer test where the information loss in real sensing is more severe, we apply the same loop to 3D-FRONT→ScanNet point-cloud segmentation. There DODA reports 51.4% mIoU, and the reverse model predicts point features from labels.
References
- Semi-Supervised Learning for Neural Machine Translation
- Learning A Self-Inverse Network for Bidirectional Mri Image Synthesis
- Driving with DINO: Vision Foundation Features as a Unified Bridge for Sim-to-Real Generation in Autonomous Driving
- Maximum Expected Likelihood Estimation for Zero-resource Neural Machine Translation
- Bidirectional Learning for Domain Adaptation of Semantic Segmentation
- StereoGAN: Bridging Synthetic-to-Real Domain Gap by Joint Optimization of Domain Translation and Stereo Matching
- Unsupervised Pixel-Level Domain Adaptation with Generative Adversarial Networks
- Domain Adaptation via Bidirectional Cross-Attention Transformer
- Unsupervised Contrastive Domain Adaptation for Semantic Segmentation
- Microsoft Research Asia's Systems for WMT19
- Improving Neural Machine Translation by Bidirectional Training
- VisDA: The Visual Domain Adaptation Challenge
- Playing for Data: Ground Truth from Computer Games
- The SYNTHIA Dataset: A Large Collection of Synthetic Images for Semantic Segmentation of Urban Scenes
- The Cityscapes Dataset for Semantic Urban Scene Understanding
- DODA: Data-Oriented Sim-to-Real Domain Adaptation for 3D Semantic Segmentation