Abstract Accurate traffic flow prediction is a cornerstone of intelligent transportation systems, yet traditional models often struggle with the non-linear disruptions caused by traffic accidents. This paper introduces STCL (Spatial-Temporal Conv-sequence Learning), a novel deep learning framework designed to capture both short-term periodicities and sudden anomalies. By integrating causal convolutions with a dedicated Accident Encoding module, STCL effectively addresses the "accident blind spot" in urban forecasting. Evaluations on large-scale New York City datasets demonstrate that STCL significantly outperforms existing state-of-the-art models in both accuracy and training efficiency.
The Challenge of Urban Traffic Forecasting
Traffic forecasting is a complex spatial-temporal puzzle. Predicting flow at a specific location requires understanding recent local trends (temporal) and the state of the surrounding network (spatial). Existing models typically suffer from three major limitations:
- Temporal Dilution: Standard RNNs and LSTMs often lose track of short-term periodic dependencies as sequences lengthen.
- Spatial Blurring: Many CNN-based approaches use global pooling, which discards vital local spatial context.
- The Accident Blind Spot: Most models assume traffic follows smooth historical patterns, failing to account for the sudden, massive congestion spikes caused by accidents.
The STCL Framework
The proposed STCL architecture utilizes an encoder-decoder structure designed to preserve local context and explicitly model anomalies. The framework is built upon several key innovations:
Spatial-Temporal Fusion Module (STFM)
To avoid the spatial blurring common in global pooling, STFM employs a spatial pooling block inspired by computer vision techniques. This allows the model to integrate high-dimensional features while retaining the local spatial relationships necessary for intersection-level accuracy.
Focused Temporal Block (FT-block)
Instead of recurrent units, STCL uses causal convolutions (1D convolutions that only look at past data). This ensures the model remains "future-blind" during training and is more effective at capturing short-range periodicities without the gradient vanishing issues associated with RNNs.
Accident Encoding
The "secret sauce" of STCL is its treatment of accident data as a semantic feature. Using a positional encoding method, the model embeds the frequency and timing of accidents into a vector. This vector is concatenated with traffic flow features, allowing the network to learn the characteristic ripple effects of a crash on urban flow.
Local Self-Attention
To improve computational efficiency and reduce noise, the model applies self-attention only to a fixed range of recent time steps. This localized focus ensures that the most relevant historical data drives the prediction without the overhead of global attention mechanisms.
Experimental Results
The model was rigorously tested using two massive NYC datasets: TaxiNYC (23 million trips) and BikeNYC (3.2 million trips), paired with roughly 8,000 monthly accident records from NYC Open Data.
- Superior Accuracy: STCL achieved the lowest Root Mean Square Error (RMSE) and Mean Absolute Error (MAE) across both datasets. On TaxiNYC inflow, STCL reached an RMSE of 16.2752, significantly outperforming the previous state-of-the-art model, STDN (16.8271).
- Ablation Insights: Removing the Accident Encoding module led to a measurable drop in performance, particularly in congested regions. This confirms that anomaly data is vital for real-world reliability.
- Efficiency: The local self-attention mechanism allowed STCL to train approximately 40 minutes faster per run than global attention counterparts on the TaxiNYC dataset.
Conclusion and Future Directions
STCL demonstrates that accidents are not just random noise but predictable disruptors whose impact can be modeled. By shifting from global to local spatial-temporal processing and explicitly encoding anomalies, the framework provides a more robust tool for urban planners. Future work will explore enriching the model with Point of Interest (POI) data—such as proximity to schools or stadiums—to further refine its understanding of urban rhythms and improve long-term prediction stability.
Summary updated