ConvNeXt-V2 + UPerNet — DistMap Auxiliary Regression (Cityscapes, full-res)
19-class semantic segmentation of urban street scenes on Cityscapes, trained at full resolution (1024×2048) with a ConvNeXt-V2-Base backbone (ImageNet-22k pretrained) and a UPerNet head, BF16, 160 epochs. This repository ships the converged (epoch-160) weights of a controlled loss ablation — variants A (CE), B (CE+Dice), C' (CE+Dice+DistMap), D' (CE+DistMap) — across 3 seeds (42, 123, 456).
mIoU is the official
cityscapesScriptsvalue (bit-exact) on the 500-image validation split. All confidence intervals use Student-tt(0.975, df=2) = 4.303(n = 3, explicitly underpowered); the primary significance test is a paired image-bootstrap over the 500 val images (B = 10 000, Holm).
Variant singletons (mean over 3 seeds)
| loss | mIoU | Boundary F1 | Trimap IoU | fragments/img | |
|---|---|---|---|---|---|
| A | CE | 81.28 | 77.24 | 52.17 | 734.4 |
| B | CE+Dice | 81.09 | 76.39 | 53.82 | 615.3 |
| C' | CE+Dice+DistMap | 80.89 | 76.43 | 53.84 | 630.5 |
| D' | CE+DistMap | 81.64 | 77.17 | 52.32 | 759.5 |
D' (CE+DistMap, no Dice) reaches the highest mIoU (81.64) and beats B and C' on the primary paired image-bootstrap test (D'−B Δ+0.55, Holm p=0.046; C'−D' Δ−0.75, p=0.001). Unlike an explicit boundary loss, the DistMap auxiliary head does not harden contours (Boundary F1 of D' < A) — its mIoU gain comes from representation shaping, not edge sharpening. The canonical connected-component consensus veto C'⊘B removes −18.1 % of spurious fragments at zero mIoU cost and contour-neutral — the 2-D analogue of the BRATS DistMap⊘Baseline result.
Connected-component consensus matrix (mIoU + fragments)
The parameter-free CC-consensus veto reassigns any connected component of the generalist that has
no same-class overlap in the baseline B (CE+Dice); thin classes (pole, traffic light/sign, fence) are
exempt and a max_drop_size cap restricts removal to genuine fragments. It is a spatial-coherence
tool, not an mIoU gain (mIoU is blind to fragmentation).
| pairing | mIoU | Δ mIoU | Δ fragments |
|---|---|---|---|
| C'⊘B (canonical) | 81.01 | +0.124 pp | −18.1 % |
| D'⊘B (contrast) | 81.65 | +0.005 pp | −18.7 % |
| C'⊘A | 81.15 | +0.262 pp | −7.7 % |
| D'⊘A | 81.74 | +0.097 pp | −13.8 % |
Files
<variant>/seed<NN>/model.safetensors # model_state_dict, fp32, weights-only (no optimizer)
<variant>/seed<NN>/metadata.json # official val mIoU / Boundary F1 / Trimap + per-class IoU + config
README.md
Usage
import torch
from safetensors.torch import load_file
from huggingface_hub import hf_hub_download
repo_id = "guillaume-cassez/cityscape-distmap-aux-regression"
# pick a variant key (see the folders) and a seed
weights = hf_hub_download(repo_id=repo_id, filename="Dprime_distmap/seed42/model.safetensors")
state_dict = load_file(weights)
# Rebuild the ConvNeXt-V2-Base + UPerNet model from the companion code, then:
# model.load_state_dict(state_dict)
# Model definition, configs and the full inference pipeline (full-res sliding window,
# official mIoU) live in the GitHub repository below.
The auxiliary head used during training is dropped at inference — these weights are the plain segmentation network, so the four variants share an identical architecture and are drop-in comparable.
Companion artefacts
- 📄 Paper — Distance-Map Auxiliary Regression for Full-Resolution Cityscapes Segmentation: When Dice Helps and When It Doesn't · Zenodo concept DOI 10.5281/zenodo.21006235
- 💻 Code (model, configs, official metrics, consensus) — https://github.com/guillaume-cassez/cityscape-distmap-aux-regression
- 🌐 Project page — https://guillaume-cassez.fr/voiture-autonome/cityscapes/distmap-aux-regression/
License
MIT (weights and code). The raw Cityscapes imagery is not redistributed (Cityscapes license); download it from https://www.cityscapes-dataset.com/.
Citation
@misc{cassez2026distmap,
title = {Distance-Map Auxiliary Regression for Full-Resolution Cityscapes Segmentation: When Dice Helps and When It Doesn't},
author = {Cassez, Guillaume},
year = {2026},
doi = {10.5281/zenodo.21006235},
url = {https://github.com/guillaume-cassez/cityscape-distmap-aux-regression}
}