Weather-Enhanced-ConvLSTM-Modeling-of-Urban-Bike-Share-Demand-in-Washington-DC

Read full text
Authors: S M REDWAN KABIR
Cited by: 0

Abstract

🚲 Beyond Proximity: Spatially Anisotropic Demand Dependencies in Urban Bike-Sharing Weather-Augmented ConvLSTM Analysis of Washington DC Capital Bikeshare Β· January 2026 πŸ“Œ Overview This repository contains the full implementation of a spatially-adapted permutation-based dependency analysis framework for urban bike-sharing demand, applied to Washington DC Capital Bikeshare trip data from January 2026. It accompanies the paper: "Beyond Proximity: Spatial Dependency in Washington DC Bike-Sharing β€” Weather-Augmented ConvLSTM Evidence"Findings Journal β€” Transport Research (Submitted 2026) The core question: do spatial dependencies in bike-sharing demand follow geographic proximity, or are they governed by functional urban linkages? We answer this by training ConvLSTM models for member and casual users separately, augmenting them with real weather data, and computing a 64Γ—64 permutation-based spatial dependency matrix Ξ¦ for each user type. 🎯 Aim & Scope Study area Washington DC, USA Data source Capital Bikeshare Open Data Period January 2026 (251,633 trips) Spatial resolution 8Γ—8 regular grid (64 cells, β‰ˆ1,500 m each) Temporal resolution 30-minute intervals User types Member (205,329 trips) and Casual (46,304 trips) Weather source Open-Meteo Historical Archive API What this project establishes: Whether spatial influence in bike-sharing conforms to the geographic proximity assumption How member and casual users differ in their spatial dependency structures Whether weather augmentation improves winter demand prediction beyond spatiotemporal models alone A replication and extension of Miao et al. (2025) from NYC to a structurally distinct city πŸ”¬ Key Findings Metric Member Casual RΒ² 0.816 0.427 MAE (pickups/cell/interval) 0.292 0.112 Mean Ξ¦ dependency 0.00819 0.00148 Max single-pair Ξ¦ 2.632 (cell 36β†’35) 0.494 Proximity–dep. correlation βˆ’0.164 βˆ’0.131 Anisotropy index 2.749 2.550 Member / Casual Ξ¦ ratio 5.52Γ— β€” πŸ“ Spatial influence does NOT follow geographic proximity. Dependencies are anisotropic, sparse, and concentrated in a downtown core cluster (cells 28, 29, 36, 37 β€” the Georgetown–Downtown–Capitol Hill corridor). Members exhibit 5.52Γ— stronger inter-cell dependencies than casual users. πŸ—‚οΈ Repository Structure πŸ“¦ bikeshare-spatial-dependency ┣ πŸ““ bikeshare_spatial_dependency.ipynb ← Main Colab notebook (run this) ┣ πŸ“„ README.md ← This file ┣ πŸ“„ requirements.txt ← Python dependencies ┣ πŸ“ outputs/ ← Generated figures and results ┃ ┣ πŸ–ΌοΈ activity_distribution.png ┃ ┣ πŸ–ΌοΈ spatial_dependencies_member.png ┃ ┣ πŸ–ΌοΈ spatial_dependencies_casual.png ┃ ┣ πŸ–ΌοΈ user_type_comparison.png ┃ ┣ πŸ–ΌοΈ training_history_member.png ┃ ┣ πŸ–ΌοΈ training_history_casual.png ┃ ┣ πŸ–ΌοΈ predictions_member.png ┃ ┣ πŸ–ΌοΈ predictions_casual.png ┃ ┣ πŸ–ΌοΈ grid_layout.png ┃ ┣ πŸ—ΊοΈ spatial_map_member.html ┃ ┣ πŸ—ΊοΈ spatial_map_casual.html ┃ ┣ πŸ”’ phi_matrix_member.npy ┃ ┣ πŸ”’ phi_matrix_casual.npy ┃ ┣ πŸ“Š spatial_influence_analysis.csv ┃ β”— πŸ“ summary_statistics.txt β”— πŸ“„ references_bikeshare.bib ← BibTeX references βš™οΈ How the Script Works The pipeline runs in 18 sequential cells in Google Colab: DATA FEATURES MODEL ANALYSIS β”‚ β”‚ β”‚ β”‚ β–Ό β–Ό β–Ό β–Ό Capital Weather API ConvLSTM Permutation Bikeshare ──► (Open-Meteo) ──► (3 layers) ──► Dependency Trip CSV + Temporal + Dense Matrix Ξ¦ Features Branch (64Γ—64 per (7 inputs) Separate user type) Member/Casual Cell-by-cell breakdown Cell Name Description 1 Install Installs TensorFlow, SHAP, Folium, GeoPandas, Plotly 2 Imports Loads all libraries and sets random seeds (42) 3 Config Defines study area bbox, grid size (8Γ—8), time interval (30 min), model hyperparameters 4 Data Extraction Extracts 202601-capitalbikeshare-tripdata.zip to CSV 5 Load & Clean Parses timestamps, removes invalid trips, filters to study area bbox 6 Weather Data Fetches hourly temperature, precipitation, wind speed, humidity from Open-Meteo API for DC (38.9Β°N, 77.03Β°W); falls back to synthetic Jan DC weather if API unavailable 7 Grid Creation Creates 8Γ—8 regular lat/lon grid; assigns each trip a start and end cell ID 8 Aggregation Aggregates pickups/dropoffs per cell per 30-min interval, split by member/casual 9 Sequence Prep Builds 4-step lookback spatiotemporal tensors + 7-feature external vectors for each user type 10 Model Build Constructs dual-input ConvLSTM: spatial branch (3 Γ— ConvLSTM2D, 64 filters) + external dense branch (32β†’64 units), merged and output via 1Γ—1 Conv 11 Training Trains member and casual models with Adam (lr=0.001), MSE loss, early stopping (patience=10), LR reduction on plateau; 80/20 temporal split 12 Ξ¦ Matrix For each of 64Γ—63=4,032 sourceβ†’target cell pairs: zeros out source cell history in 30 sampled test sequences, measures mean absolute change in target predictions β†’ Ξ¦(srcβ†’tgt) 13 Dependency Viz Plots 64Γ—64 Ξ¦ heatmap + net influence map with top-10 dependency arrows 14 Interactive Map Generates Folium maps coloured by net spatial influence per cell 15 User Comparison Side-by-side analysis: distribution histograms, proximity scatter, outward influence grids 16 Predictions Visualises actual vs predicted pickup grids for 4 random test samples per user type 17 Summary Prints all key statistics: RΒ², MAE, anisotropy index, proximity correlation, dependency ratio 18 Export Saves all outputs: .npy matrices, .csv, .png figures, .html maps πŸš€ Quick Start Option A β€” Google Colab (Recommended) Click the Open in Colab badge above Upload 202601-capitalbikeshare-tripdata.zip to /content/ when prompted in Cell 4 Run all cells: Runtime β†’ Run all Download outputs from /content/outputs/ Option B β€” Local Setup # Clone the repo git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git cd YOUR_REPO # Install dependencies pip install -r requirements.txt # Download data from Capital Bikeshare # https://capitalbikeshare.com/system-data β†’ January 2026 # Place the zip in the project root # Launch Jupyter jupyter notebook bikeshare_spatial_dependency.ipynb requirements.txt tensorflow>=2.12 shap>=0.42 pandas>=2.0 numpy>=1.24 scikit-learn>=1.3 matplotlib>=3.7 seaborn>=0.12 folium>=0.14 geopandas>=0.13 requests>=2.31 plotly>=5.15 πŸ“Š Selected Output Figures Activity DistributionMember vs. Casual pickup heatmaps Member Dependency Matrix Ξ¦64Γ—64 permutation-based influence User Type ComparisonDependency distributions + proximity scatter Training ConvergenceMSE and MAE curves for both models All figures are saved to /content/outputs/ at 300 DPI during runtime. 🧠 Model Architecture Spatial Input External Input [batch, 4, 8, 8, 2] [batch, 7] β”‚ β”‚ ConvLSTM2D (64) Dense (32, ReLU) BatchNorm + Dropout(0.2) BatchNorm β”‚ Dense (64, ReLU) ConvLSTM2D (64) β”‚ BatchNorm + Dropout(0.2) Reshape (1,1,64) β”‚ UpSampling2D (8Γ—8) ConvLSTM2D (64) β”‚ BatchNorm β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ Concatenate β”‚ Conv2D(2, 1Γ—1, ReLU) β”‚ Output [batch, 8, 8, 2] (pickups + dropoffs) Training configuration: Optimizer: Adam (lr = 0.001, reduce on plateau: factor 0.5, patience 5) Loss: Mean Squared Error Early stopping: patience = 10, restore best weights Batch size: 32 | Max epochs: 30 | Split: 80/20 temporal πŸ“ Spatial Dependency Method The Ξ¦ matrix is computed via permutation-based perturbation β€” a model-agnostic alternative to gradient-based SHAP: for each (source_cell, target_cell) pair: 1. Take 30 random test sequences 2. Zero out source_cell values in the lookback window 3. Re-run model inference 4. Ξ¦(source β†’ target) = mean |baseline_pred - perturbed_pred| This yields a 64Γ—64 directed influence matrix per user type. Key derived metrics: Outward influence: column sum of Ξ¦ β€” how much a cell drives others Inward influence: row sum of Ξ¦ β€” how much a cell is driven by others Net influence: outward βˆ’ inward Anisotropy index: CV of column-wise outward sums Proximity correlation: Pearson r(grid distance, Ξ¦)

Fields of Study & Subjects

Urban Transport and Accessibility Traffic Prediction and Management Techniques Human Mobility and Location-Based Analysis

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
15 March 2026
Language
EN
Document type
Dataset