Metamorphic Testing of Learned Spatial Surrogates for Transit Accessibility

Till Zacher, Markus LienkamparXiv 2026

TL;DR

Designing a city’s bus network requires evaluating thousands of candidate layouts, and neural "surrogate" models can speed up slow transit simulations by orders of magnitude. However, a surrogate with low average prediction error can still fail basic common-sense physics—like hallucinating accessibility gains from a bus stop with no bus routes connected to it. This paper introduces an automated "metamorphic testing" suite to catch these structural blind spots before an optimizer exploits them, showing how targeted training examples can patch specific failures while improving overall accuracy.

What Problem Does This Paper Address?

Transport planners measure accessibility—how easily residents can reach jobs, schools, and shops within a reasonable travel time. When an optimization algorithm designs a new bus network, it needs to test thousands of candidate routes. Running full multimodal routing calculations inside that loop is prohibitively slow.

The standard workaround is to train a fast neural network—a surrogate model—to approximate the expensive routing calculation. Here lies the trap: low average error on a passive test set does not make a model safe to put inside an optimizer. Optimizers actively hunt for high scores, meaning they will happily exploit regions where the neural network makes favorable mistakes. If a surrogate mistakenly predicts "phantom" accessibility gains around an isolated, disconnected bus stop, the optimizer might litter the map with useless stops. Average error hides these structural failures.

Figure 1: From reference accessibility calculations to a fast design objective. Paired calculations train a surrogate that can score candidate networks during optimization. Metamorphic tests expose violations of specified structural relations.

Methods

The authors train spatial encoder–decoder networks to predict the change in accessibility across $21\text{ km} \times 21\text{ km}$ map tiles ($200 \times 200$ pixels) when a candidate bus network is added to a fixed city context (existing rail service and local points of interest). To keep memory and training manageable, the 105 destination categories are compressed via PCA into 32 channels during training, then projected back to the 105 original channels for evaluation.

Figure 2: One routing-derived training tile. The candidate bus design and fixed context predict the bus-induced accessibility change.

What is novel here is how they test, structure, and repair these surrogates:

  • Automated Metamorphic Testing: Borrowed from software engineering, metamorphic testing checks relationships between outputs when you make controlled tweaks to inputs, rather than checking exact values. The authors built a suite of eight spatial probes—testing, for instance, whether deleting all bus routes from a stop drops its added accessibility to zero ("isolated stop"), or whether scaling raster pixel values artificially inflates predictions ("intensity saturation").
  • Stream-Separated Architectures: They compare standard early-fusion models (U-Net, ResU-Net) against capacity-matched Dual-stream (separating the variable bus design from fixed city context) and Triple-stream (further splitting rail and opportunities) architectures (~100M parameters).
  • Failure-Directed Training: They test a cumulative ladder of targeted synthetic training examples—such as feeding the model disconnected stops paired with zero-gain targets—to see if specific blind spots can be taught away.

Datasets

  • Geographic Supervised Dataset: Built from OpenStreetMap street/POI data and GTFS transit schedules across Germany, comprising 14,488 training, 1,610 validation, and 818 test tiles. Each tile tracks 105 layers (97 point-of-interest categories and 8 workplace layers). To prevent spatial data leakage, test sets withhold an urban catchment (Munich) and a rural region (Mecklenburg-Vorpommern) separated from training data by a $25.5\text{ km}$ buffer.
  • Synthetic Metamorphic Suite: A newly introduced benchmark of 50 procedurally generated scenario sets (containing reference, modified, and control scenes) parameterized from training distributions to systematically probe the eight structural relations.

Key Insights and Ideas

  • Predictive skill masks basic connectivity failures: Models that comfortably beat baseline predictors on held-out map tiles can fail nearly 100% of the time when tested on whether an isolated bus stop should yield zero accessibility gain.
  • Targeted negative examples work—selectively: Adding training examples of isolated stops with zero targets dramatically fixes connectivity tests and boosts held-out predictive accuracy. However, there is no silver bullet: trying a similar trick for truncated "stub edges" fails to fix the target issue and destabilizes other learned behaviors.
  • Separating design from context curbs input-scaling quirks: Multi-stream models that encode the variable bus network separately from fixed city context are much less sensitive to artificial $4\times$ pixel-intensity scaling than single-stream U-Nets, even at matched parameter counts.
  • Aggregate metrics hide massive category gaps: Models predict common, evenly distributed amenities (like fire stations or schools) remarkably well, while failing on sparse or low-variance categories (like workplaces, wineries, or greenhouses).

Key Results

  • Massive Speedup: A full GPU surrogate evaluation takes $40\text{--}54\text{ ms}$ ($612\text{--}632\text{ ms}$ on CPU) versus $113\text{--}129\text{ s}$ for the reference routing calculation—a ~1,850$\times$ to 2,360$\times$ speedup.
  • Fixing Connectivity: Without targeted data, Dual- and Triple-stream models achieve positive predictive skill ($0.407$ and $0.298$) but score near zero ($0.002$ and $0.003$) on the isolated-stop test. Adding isolated-stop negatives vaults Triple-stream pass rates to $0.877$ (and rail-context sensitivity to $0.909$) while lifting predictive skill to $0.488$. Dual-stream reaches $0.568$ skill and a $0.791$ pass rate.
  • Architecture vs. Saturation: At ~100M parameters, Dual- and Triple-stream models pass the intensity-saturation test at $0.975$ and $0.972$, cleanly outperforming capacity-matched U-Net ($0.459$) and ResU-Net ($0.637$).
  • Category Disparity: For the top-performing Dual-stream model, median per-channel $R^2$ is $0.418$ across 97 opportunity channels (peaking at $0.884$ for fire stations), but drops to $-0.823$ across the 8 workplace layers.

Limitations and Future Work

  • Surrogate vs. Reality: Targets come from a deterministic routing calculation with fixed operating assumptions (ignoring timetable frequencies or real ridership), so evaluations measure agreement with the simulator, not observed human travel.
  • Limited Geographic Scope: Held-out testing covers only two German regions, limiting broader geographic transfer claims.
  • No Closed-Loop Optimizer Proof Yet: Passing a finite test suite and running $2,000\times$ faster does not guarantee better transit designs in practice. Future work must place these surrogates inside an actual optimization loop—with defined route constraints and search budgets—to verify whether behavioral repairs translate into superior transit networks.

Summary updated

Abstract

Transit-network design requires evaluating many candidates, but detailed accessibility calculations are too slow to repeat inside an optimization loop. We therefore train a neural surrogate to approximate them. Given a candidate bus network and fixed information about rail service and nearby opportunities, it predicts the calculated spatial change in accessibility. We compare its predictions with routing-derived targets in geographically held-out regions and test specified qualitative relations under controlled input changes. Reference calculations on constructed networks assess the applicability of relations that have a routing-level counterpart. Models with positive predictive skill can still fail basic connectivity tests. One targeted intervention substantially increases pass rates for two connectivity relations while predictive skill also improves. Average prediction error is therefore insufficient when a learned model becomes an optimization objective. Predictive agreement and controlled behavioral tests should be reported separately.
BibTeX
@misc{zacher2026metamorphic,
  author = {Till Zacher and Markus Lienkamp},
  title = {{Metamorphic Testing of Learned Spatial Surrogates for Transit Accessibility}},
  year = {2026},
  eprint = {2611.32373},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.32373},
}
Figure