Listening to the City, Attentively: A Spatio-Temporal Attention-Boosted Autoencoder for the Short-Term Flow Prediction Problem

Stefano Fiorini, Michele Ciavotta, Andrea Maurino · DOI

TL;DR

This paper introduces STREED-Net, a novel spatio-temporal autoencoder architecture that significantly improves short-term urban vehicle flow prediction by effectively capturing complex spatial and temporal dependencies. By integrating time-distributed convolutions, cascading hierarchical units, and dual attention mechanisms, STREED-Net achieves state-of-the-art performance on real-world datasets, offering a more robust and accurate approach to understanding urban mobility.

What Problem Does This Paper Address?

Accurately predicting vehicle flow in urban environments is crucial for optimizing transportation services, managing traffic, and enhancing smart city initiatives. However, this task is inherently challenging due to the complex, non-linear interplay of spatial and temporal factors influencing mobility patterns. Traditional methods often struggle to capture these intricate dependencies, leading to suboptimal predictions. This paper aims to bridge this gap by proposing a deep learning model that can effectively learn and leverage these spatio-temporal correlations for short-term flow prediction.

Methods

The core of the proposed solution is STREED-Net, an autoencoder architecture designed to handle spatio-temporal data. Key innovations include:

  • Time-Distributed 2D Convolutions: Instead of processing each frame independently, these convolutions process sequences of frames, allowing the model to learn temporal coherence and inter-frame dynamics.
  • Cascading Hierarchical Units (CMUs): These units, inspired by Multiplicative Units (MUs) and similar to LSTM cells but without recurrent connections, explicitly model temporal dependencies by conditioning the current state on previous states, improving accuracy and reducing training time.
  • Dual Attention Mechanisms:
    • Channel Attention: Identifies and emphasizes the most relevant channels (e.g., inflow/outflow variables) within the feature maps.
  • Spatial Attention: Pinpoints and scales the contribution of the most significant spatial areas within the city grid, crucial for understanding localized traffic patterns.
  • Autoencoder Architecture: This unsupervised learning framework allows the model to learn a compressed representation of the input data, which is then used for reconstruction and prediction.
  • Residual Units: Used in both the encoder and decoder to facilitate the training of deep networks by mitigating gradient issues and improving convergence.
  • Long Skip Connections: These connections between the encoder and decoder help recover fine-grained details and speed up model convergence.
  • External Factors Integration: The model incorporates external factors like day of the week, holidays, and weather conditions to further enhance prediction accuracy.

Datasets

The paper evaluates STREED-Net on three real-world datasets:

  • BikeNYC: Bicycle sharing data from New York City (April-September 2014), with 1-hour time intervals.
  • TaxiBJ: Taxi data from Beijing, collected over four different periods between 2013 and 2016, with 30-minute time intervals.
  • TaxiNYC: Taxi data from New York City, collected from 2009 to 2014, with 1-hour time intervals. This dataset was specifically curated for this research.

All datasets were normalized using a Min-Max scaling to the range [-1, 1].

Key Insights and Ideas

  • Temporal Coherence is Key: The success of time-distributed convolutions highlights that understanding the flow of traffic over time, rather than just at discrete moments, is critical for accurate prediction.
  • Attention is Not Just for NLP: The application of both channel and spatial attention mechanisms in a traffic prediction context demonstrates their power in distilling relevant information from complex spatio-temporal data.
  • Explicit Temporal Modeling Without Recurrence: CMUs offer a compelling alternative to traditional RNNs for modeling temporal dependencies, potentially offering computational advantages and improved stability.
  • Grid Size Matters: The performance of models can be significantly influenced by the granularity of the city tessellation. Larger grids (like Beijing's 32x32) benefit more from deeper architectures and potentially reveal more significant performance gains for STREED-Net compared to smaller grids.
  • Robustness Through Attention: The ablation study shows that attention blocks not only reduce average error but also decrease the standard deviation, indicating improved model stability and reliability.

Key Results

STREED-Net consistently outperformed several state-of-the-art models across all three case studies and evaluation metrics (RMSE, MAPE, APE).

  • BikeNYC: STREED-Net achieved the best RMSE (4.67 ± 0.03), MAPE (20.85 ± 0.15), and APE (3.23 × 10⁻⁵ ± 2.31 × 10⁻⁵).
  • TaxiBJ: STREED-Net achieved the best RMSE (15.61 ± 0.11) and MAPE (14.73 ± 0.21), and was ranked second for APE. It showed a 2.9% reduction in MAPE and 2.8% in APE compared to the second-best model.
  • TaxiNYC: STREED-Net was ranked among the best models, achieving excellent RMSE and being the second-best for MAPE and APE.

The ablation study revealed that:

  • Using 4 input time points (n=4) provided the best results for BikeNYC.
  • Removing the long skip connection (NoLSC) led to a 3.64% increase in RMSE, highlighting its importance.
  • Removing attention blocks (NoAtt) resulted in a 2.36% increase in RMSE, underscoring the value of attention.
  • STREED-Net demonstrates a favorable balance between a low number of trainable parameters and computational complexity compared to many other models.

Limitations and Future Work

  • Data Granularity: The paper notes that increasing the granularity of city tessellation could further improve predictions.
  • External Factors: The authors suggest exploring the integration of additional external factors, such as territorial characteristics of geographical areas.
  • Transfer Learning: Investigating transfer learning for scenarios with limited data is proposed as a future direction.
  • Graph-Based Models: While the paper focuses on convolutional approaches, it acknowledges that graph-based models can sometimes achieve superior performance, though their preliminary experiments with graphs for this specific problem were not satisfactory.
  • Model Complexity: While STREED-Net is competitive, its computational complexity is still moderate due to its sophisticated architecture, suggesting that further optimization might be beneficial for real-time applications on resource-constrained devices.

Summary updated

BibTeX
@article{fiorini2022listening,
  author = {Stefano Fiorini and Michele Ciavotta and Andrea Maurino},
  title = {{Listening to the City, Attentively: A Spatio-Temporal Attention-Boosted Autoencoder for the Short-Term Flow Prediction Problem}},
  journal = {Algorithms},
  year = {2022},
  doi = {10.3390/a15100376},
}
Figure