﻿# Cityscapes: avoid city and sequence leakage

Preserve Cityscapes city-level partitions, keep neighboring video frames together and convert training IDs back to evaluation labels.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/data-guide-cityscapes-city-sequence-split/
Language: en

## Preserve the published city assignment

Cityscapes evaluates semantic and instance labeling of urban scenes. The [dataset paper](https://arxiv.org/html/1604.01685v2) explicitly partitions data at city level: a city belongs entirely to one split. This design balances geographic and seasonal properties without randomly scattering frames. Keep the published training, validation and test lists when reporting benchmark results. A new city holdout can answer a different research question, but it needs a separate name and cannot inherit the original benchmark's comparability. See [split isolation](/journal/document-level-data-split-leakage/) for the underlying distinction.

## Attach neighboring frames to the annotated scene

The [official overview](https://www.cityscapes-dataset.com/dataset-overview/) includes preceding and trailing frames, stereo views and vehicle metadata alongside annotated images. These are correlated observations, not fresh independent samples. The [owner scripts](https://github.com/mcordts/cityscapesScripts) encode city, sequence and frame in file names and distinguish image modalities from annotation types. Use that tuple to join data and propagate split membership. A crop, right-camera view or nearby frame must not enter training merely because its own file name is absent from the validation annotation list. Additional context can otherwise reveal nearly the same scene.

## Name fine and coarse supervision separately

The owner describes fine polygons and an additional coarse collection. The scripts distinguish gtFine from gtCoarse and identify train_extra as additional training material. Coarse boundaries deliberately trade detail for annotation speed; treating them as equivalent fine targets changes the supervision. Report whether training used either type or both. Availability of coarse annotations for a validation image does not make that scene eligible for training while retaining the same validation claim. Store the annotation-type join in [dataset provenance](/journal/document-markdown-json-provenance/).

## Translate model targets back to official IDs

The [label definitions](https://raw.githubusercontent.com/mcordts/cityscapesScripts/master/cityscapesscripts/helpers/labels.py) distinguish id, trainId, categoryId, hasInstances and ignoreInEval. Multiple original labels may share a training target. The scripts expressly require original IDs for evaluation-server output. A compact network head therefore needs a documented inverse mapping, while void pixels must follow evaluation semantics rather than becoming an ordinary predicted class. Instance eligibility also differs across labels: semantic correctness alone does not establish a valid instance submission.

## Interpret boundaries within the capture domain

The overview describes daytime recording in good or medium weather. It also defines a foreground policy for mixed or transparent regions, such as vegetation against buildings and car windows. A visually plausible alternative contour can disagree with that annotation policy. Evaluate decoded masks under the official rules before attributing differences to model quality. Results on this acquisition domain do not measure night, severe-weather or every geographic condition; such comparisons require separately identified data and conditions.
