Source-linked AI summary
Ring-based Spatial Transformer: Learning Non-linear Spatial Interactions between Building Distribution and Pedestrian Flow
Shun Nakayama, Takahiro Kanamori, Wanglin Yan
TL;DR
Pedestrian flow around railway stations may depend on nonlinear relationships among building uses distributed across different distances, a limitation of conventional approaches. The study therefore models concentric station zones as spatial tokens and uses Self-Attention to learn their interactions. Across 30 trials, the SpatialTransformer outperformed GWR, while interpretation indicated that prediction depended more on mid-to-outer zones and cross-catchment relationships than on the nearest zone alone.
Problem
Existing approaches lack a mechanism for learning how building uses at different spatial positions relate to one another in regulating station-catchment pedestrian flow.
Method
The study represents eight 100-meter distance zones around each of 100 sampled Tokyo stations as spatial tokens and applies Self-Attention to 120 building-use features, using GPS-derived trip counts and GWR as the baseline.
Results
Across 30 trials, the SpatialTransformer achieved mean test R² of 0.152±0.652 versus −5.486±5.209 for GWR.
Takeaways & Limitations
Features from the 0-100m zone were largely absent from the top SHAP rankings, while attention patterns indicated that distance zones most strongly referenced spatially distant zones.
Takeaways & Limitations
The study cannot definitively explain why the most strongly attended zone contributes little to the final prediction, because attention and SHAP may measure different aspects of the model.
Abstract
from arXiv · showhide
This study proposes a ring-based SpatialTransformer to learn how building uses at different distances from a railway station interact to generate pedestrian flow. Concentric ring buffers at 100-meter intervals up to 800 meters were defined around 100 randomly selected stations in Tokyo, treating each ring as a spatial token. Self-Attention was applied to learn inter-zone interactions directly from data, without prior structural assumptions. GPS-derived walking trip counts served as the target variable and Geographically Weighted Regression as the baseline. Across 30 independent trials, the SpatialTransformer consistently outperformed GWR in predictive accuracy. SHAP analysis revealed that mid-to-outer distance zone features dominate pedestrian flow prediction, while features from the 0-100m zone contributed little. The attention matrix showed that each distance zone attends most strongly to spatially distant zones, demonstrating that pedestrian flow is regulated by structural interactions across the entire catchment area rather than by any single zone in isolation. These findings challenge the compact city assumption that station-proximate development maximizes pedestrian flow, and suggest that land use distribution across the full walkable catchment area deserves greater consideration in urban planning practice.
1. Introduction
The study addresses the difficulty of explaining pedestrian flow through simple linear relationships by proposing a model that learns interactions among building uses across station-distance zones. It asks which spatial configurations regulate pedestrian flow and what they imply for compact-city assumptions.
- Policy context: Population decline and aging motivate a shift toward compact, transit-oriented urban forms in Japan.The policy context emphasizes mobility preservation, infrastructure costs, and environmental burdens.
- Policy context: Tokyo’s station-centered redevelopment guidelines assume that building floor-area and land-use distributions shape pedestrian activity within walking distance.The guidelines seek to revitalize pedestrian activity around major railway stations.
- Research gap: Prior machine-learning studies indicate nonlinear built-environment relationships, including threshold effects and location-dependent influences on pedestrian activity.Reported examples include declining pedestrian volume beyond a building-density threshold and varying effects of commercial and leisure uses across locations.
- Research gap: Existing machine-learning approaches cannot directly capture interactions in which building uses at different station distances jointly generate pedestrian flow.The study motivates Self-Attention as a mechanism for learning relational structure among spatial zones.
- Proposed approach: The proposed approach represents concentric station zones as spatial tokens so Self-Attention can learn cross-zone relationships directly from data.This enables interactions such as commercial uses near a station relating to residential uses farther away.
2. Methodology
The methodology constructs distance-based building-use features around sampled Tokyo railway stations and applies a SpatialTransformer to learn interactions among spatial tokens. GPS-derived pedestrian trips provide the target, while the model uses positional encoding, Self-Attention, robust loss, and comparative evaluation.
- Data: 100 railway stations were randomly sampled from 606 Tokyo metropolitan stations, using GPS-derived trips within each station’s 800-meter catchment as the target.Only trips completed entirely within the catchment were included; counts ranged from 111 to 29,847 per station.
- Feature construction: Eight concentric ring buffers were generated at 100-meter intervals up to 800 meters, reflecting distance-based pedestrian movement around stations.Each zone aggregates building floor area by use category.
- Feature construction: The resulting feature matrix contains 120 values per station from 8 distance zones and 15 building-use categories.All stations had complete coverage across the eight zones, while 28.34% of the 12,000 total elements were zero.
- SpatialTransformer: Self-Attention learns relationships among all distance-zone tokens directly from data without predefined structural connections.The input tensor has shape (N, 8, 15), and each zone vector is projected into a 64-dimensional latent space.
- SpatialTransformer: Physical distance is encoded explicitly before the embedded tokens pass through three multi-head Self-Attention layers with eight heads.The positional encoding uses zone distance rather than ordinary token index.
- Training: Huber loss with δ=1.0 was selected to balance squared-error behavior for small residuals with absolute-error robustness for large residuals.This choice addresses the right-skewed trip-count distribution.
- Evaluation: Model performance was assessed against GWR across 30 independent train/test trials using test R², RMSE, and MAE.Both models were evaluated on the same log1p-transformed and standardized scale.
3. Results
Across 30 trials, the SpatialTransformer outperformed GWR in predictive accuracy, although its test performance varied substantially across splits. Attention and SHAP analyses indicate that pedestrian-flow predictions depend on interactions and influential features spanning multiple distance zones.
- Predictive Accuracy: The SpatialTransformer outperformed GWR in both mean and best-trial test performance across 30 independent train/test splits.Mean test R² was 0.152±0.652 for SpatialTransformer versus −5.486±5.209 for GWR; the best-trial R² values were 0.835 and −0.382, respectively.
- Predictive Accuracy: The 30-trial average test R² of 0.152±0.652 indicates substantial variability across trials and inconsistent stable generalization.Each trial used a different random split and evaluated 20 test stations.
- Attention Weight Analysis: Each distance zone attended most strongly to a spatially distant zone rather than consistently to itself.Examples include 0-100m attending most strongly to 700-800m with weight 0.191 and 700-800m attending most strongly to 400-500m with weight 0.177.
- SHAP Analysis: The strongest SHAP-ranked features were concentrated in mid-to-outer distance zones, especially 700-800m and 400-500m.The top feature was 700-800m_Commercial (0.0810), followed by 400-500m_Commercial (0.0619).
4. Discussions
The SpatialTransformer captures long-range interactions among distance zones that conventional local models cannot represent, but its predictive interpretation is complicated by instability and disagreement between attention and SHAP analyses.
- Predictive performance: The best SpatialTransformer trial reached test R² 0.835, compared with GWR’s −0.382 under the same conditions.Across 30 trials, mean test R² was 0.152±0.652 for the SpatialTransformer and −5.486±5.209 for GWR.
- Predictive performance: Test-set variability limited stable generalization because each trial used only 20 stations and trip counts varied from 111 to 29,847.The resulting R² denominator could change substantially when high-flow stations entered or left the test set.
- Spatial interactions: The SpatialTransformer learns mutual references among multiple distance zones, rather than treating each zone independently.The model directly learns spatially distant interactions through Self-Attention.
- Interpretability: Attention and SHAP produced conflicting interpretations: the 0-100m zone received the strongest attention but contributed little to predictions according to SHAP.The cause of this discrepancy remains unresolved, consistent with broader questions about interpreting Transformer attention.
5. Conclusion
The study uses a ring-based SpatialTransformer to learn interactions among building-use distributions across station catchments. It finds that mid-to-outer zones dominate prediction and that land-use planning should consider the full walkable catchment rather than station-front development alone.
- Approach: The model represents eight 100-meter distance zones around 100 Tokyo railway stations as spatial tokens and learns their interactions with Self-Attention.Building floor area by use category produces a 120-dimensional feature set per station, with GWR as the baseline.
- Findings: 700-800m Commercial ranked first and 400-500m Commercial ranked second among features predicting pedestrian flow.Industrial factories and government facilities also appeared prominently across multiple distance zones.
- Findings: Features from the 0-100m zone were largely absent from the top SHAP rankings, and feature importance did not decline monotonically with distance.These results do not support the assumption that station-proximate development most strongly regulates pedestrian flow.
- Policy implications: Land-use distribution across the entire walkable catchment area warrants greater attention than concentrating development at the station front alone.This policy implication follows from the observed prominence of mid-to-outer distance features.