ConvNeXt-V2 + UPerNet — Kervadec Boundary-Loss Ablation (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+Kervadec), D (CE+Kervadec) — 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+Kervadec | 81.23 | 76.50 | 53.87 | 595.3 |
| D | CE+Kervadec | 81.69 | 77.32 | 52.25 | 782.6 |
D (CE+Kervadec, no Dice) reaches the highest mIoU (81.69) and the best Boundary F1 (77.32) — the image-bootstrap test establishes D > A (Δ+0.40, Holm p=0.043) and D > B (Δ+0.59, p=0.032); the seed test establishes D > C (Holm p=0.042). The 10→160-epoch crossover inverts the ranking a short pilot would have picked. The canonical consensus veto C⊘B removes −18.7 % of spurious fragments at zero mIoU cost and contour-neutral (the BRATS analogue); D⊘B prunes equally but Dice-shifts the contours.
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.24 | +0.010 pp | −18.7 % |
| D⊘B (2-D finding) | 81.65 | −0.033 pp | −18.6 % |
| C⊘A | 81.31 | +0.085 pp | −8.5 % |
| D⊘A | 81.82 | +0.137 pp | −15.6 % |
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-boundary-loss-kervadec"
# pick a variant key (see the folders) and a seed
weights = hf_hub_download(repo_id=repo_id, filename="D_boundary/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 — Boundary Loss Ablation for Full-Resolution Cityscapes Segmentation: When Dice Helps and When It Doesn't · Zenodo concept DOI 10.5281/zenodo.20528680
- 💻 Code (model, configs, official metrics, consensus) — https://github.com/guillaume-cassez/city-scape
- 🌐 Project page — https://guillaume-cassez.fr/voiture-autonome/cityscapes/boundary-loss-kervadec/
License
MIT (weights and code). The raw Cityscapes imagery is not redistributed (Cityscapes license); download it from https://www.cityscapes-dataset.com/.
Citation
@misc{cassez2026boundary,
title = {Boundary Loss Ablation for Full-Resolution Cityscapes Segmentation: When Dice Helps and When It Doesn't},
author = {Cassez, Guillaume},
year = {2026},
doi = {10.5281/zenodo.20528680},
url = {https://github.com/guillaume-cassez/city-scape}
}