arXiv:2611.08703cs.LGNov 2026

Manuscript Offprint

arXiv:2611.08703

Foundation-Model Residuals as Signals of Urban Bus Irregularity

Csaba I. Sidló, Jamil J. Ghazal, Domonkos Rózsay, Rita Rónai, András J. Molnár

CSABA I. SIDLÓ¹,*, JAMIL J. GHAZAL¹, DOMONKOS RÓZSAY¹, RITA RÓNAI¹, AND ANDRÁS J. MOLNÁR¹

¹Institute for Computer Science and Control, Hungarian Research Network, Hungary *sidlo@sztaki.hu

Pretrained trajectory models encode mobility patterns learned across cities, but their errors when transferred to a new city are usually treated only as performance limitations. We instead ask whether these residuals reveal systematic local conditions. Architectures such as UniTraj [1] and TrajFM [2] learn transferable trajectory representations, although cross-context transfer remains challenging [3]. Using the NetMob26 bus location, ticketing, weather, network, and socioeconomic data for Niterói [4], we analyze spatial and travel-time residuals of these recent trajectory foundation models. We test whether high residuals concentrate spatially, whether spatial and travel-time residuals overlap, and which urban-context variables explain their distribution.

We interpret high residuals as candidate proxy signals of transit irregularity rather than direct evidence of service disruption, and analyze their contextual associations using Explainable AI (XAI) [5]. Insights into such varied environments are increasingly valuable for evaluating new urban paradigms; for instance, the 15-minute-city perspective [6] serves as a key motivation for our approach, guiding our methods and expanding the analysis beyond standard mobility metrics.

1. DATA AND ANALYTICAL METHODOLOGY

We first process and extend the NetMob dataset, then generate behavioral benchmarks using pretrained foundation models, and subsequently apply XAI to analyze the systemic drivers behind the prediction residuals.

The Niterói dataset contains GPS traces, ticketing, route, weather, and socioeconomic data for spatial cells. Points-of-interest (POIs) are added with 15-minute-city indicators, counting POI categories within 15-minute walk. Schedule-based metrics are omitted due to widespread data gaps.

For comparison, we trained task-matched local baselines exclusively on the Niterói data. For trajectory reconstruction we used linear regression, Ridge and Lasso models based on recent spatial coordinates, with and without temporal features. For travel-time prediction we used the same locally trained regression family. Default hyperparameters were used, as these models serve as simple local references.

Pretrained TrajFM [2] is evaluated for travel-time estimation, with errors measured in minutes. We evaluate both zero-shot and locally fine-tuned UniTraj [1] for spatial trajectory reconstruction. Comparative testing between sliding-window prefix continuation and masked segment reconstruction showed that the masked approach yielded superior performance. The final setup used windows with 200 locations, 30 points masked or predicted. Figure 1 illustrates the setup: UniTraj reconstructs a hidden segment of an observed bus trajectory, and the residual distance becomes the local irregularity signal.

Features and predictions are aggregated to 1,236 distinct spatial H3 resolution-9 hexagonal cells (with H3 resolution 10 used for sensitivity analysis). After filtering out unique identifiers, target variables, raw counts, center-distance proxies, and uninformative generic aggregates, the final explanatory model retains

Figure

Fig. 1. Example UniTraj masked-segment imputation.

39 contextual features with five distinct thematic families: transit demand and rider composition, localized speed and congestion, road network geometry, 15-minute city accessibility indicators, and census-derived socioeconomic status (SES).

We explain per-cell errors with XGBoost using urban features as inputs and aggregated model error as target. SHAP values [5] provide global importance and, for each cell, the dominant feature family behind the local irregularity score. We sum absolute SHAP contributions within predefined feature families and assign each mapped cell to the family with the largest total absolute contribution. This way we visualize local explanatory context, not only a citywide ranking. To reduce target circularity, we omit closely related speed-derived variables from one explanatory specification; remaining speed/congestion features are operationally useful but are treated as associative rather than independent causal evidence.