NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Towards Good Practices of U-Net for Traffic Forecasting

Jingwei Xu, Jianjin Zhang, Zhiyu Yao, Yunbo WangarXiv 2020

Abstract

This technical report presents a solution for the 2020 Traffic4Cast Challenge. We consider the traffic forecasting problem as a future frame prediction task with relatively weak temporal dependencies (likely due to stochastic urban traffic dynamics) and strong prior knowledge, i.e., the roadmaps of the cities. For these reasons, we use the U-Net as the backbone model and propose a roadmap generation method to make the predicted traffic flows more rational. Additionally, we employ a fine-tuning strategy based on the validation set to prevent overfitting and adapt to seasonal shifts. We further discuss approaches for future exploration, including harnessing seasonality and distilling common knowledge across cities, while analyzing the validity of the evaluation metric.

Introduction

Predicting urban traffic flow is a complex challenge due to high-dimensional spatial data and the inherent randomness of traffic dynamics. In the 2020 Traffic4Cast Challenge, this is framed as a video prediction task: given a sequence of past frames representing traffic speed and volume, the model must predict future states.

A significant hurdle in this competition is the temporal distribution shift; training data covers the first half of the year (January to June), while testing occurs in the second half. Seasonal variations cause models trained on early-year data to struggle with later-year patterns. Furthermore, standard video prediction models lack spatial constraints, often predicting traffic in geographically impossible locations like buildings or bodies of water.

Methodology

The proposed solution utilizes a U-Net architecture as the backbone. U-Net was selected over recurrent models like LSTMs for its superior memory efficiency and faster training times. The network consists of 8 dense blocks and 7 transpose convolutional layers, utilizing shortcut connections to preserve high-resolution spatial details.

The U-Net architecture employed, featuring dense blocks and deconvolutional layers with skip connections.

To improve performance, two model-agnostic strategies were introduced:

  1. Roadmap Mask Generation: To ensure predictions adhere to physical road networks, a static binary mask is generated for each city. Pixels with an average speed greater than zero across the training set are marked as valid roads (1), and all others are masked (0). This mask is multiplied by the model's output to filter out impossible driving areas.
  2. Two-Stage Training Strategy: To address seasonal drift, the model is first pre-trained on the large training set for 5 epochs. It is then fine-tuned for 1 epoch on the validation set, which shares the seasonal distribution of the test set (July to December).

Dataset and Task

The models were evaluated on data from Berlin, Moscow, and Istanbul. Each frame represents a 100m × 100m area with 9 channels (speed and volume in four directions, plus events). The task involves taking 12 frames (1 hour) as input to predict 6 future frames at 5, 10, 15, 30, 45, and 60-minute intervals.

Results

An ablation study demonstrates the efficacy of the proposed methods using Mean Squared Error (MSE) as the primary metric. Both the roadmap mask and the fine-tuning strategy independently improved performance, with their combination yielding the lowest error.

Model Configuration MSE
Baseline U-Net 0.00119438
U-Net + Roadmap Mask 0.00117991
U-Net + Two-stage Training 0.00117037
Final Model (Combined) 0.00116868

Discussion and Limitations

While the proposed U-Net approach is effective, several challenges remain. The authors note that MSE is a flawed evaluation metric for traffic video prediction. As shown in Figure 6, predictions can achieve low MSE scores while failing to capture the dynamic disappearance of traffic features seen in the ground truth, resulting in a "blurry" or static-looking output.

Comparison between Ground Truth and Prediction over time. Despite low MSE values, the model struggles to capture the temporal decay of traffic features.

Other areas for future work include:

  • Knowledge Transfer: Attempts to use Transferable Memory Units (TMU) to share knowledge between cities were hindered by unique road topologies.
  • Seasonality Modeling: While fine-tuning helps, explicitly modeling seasonal patterns remains difficult for cities with milder climates compared to those with extreme weather like Moscow.

In conclusion, incorporating domain-specific priors like roadmap masks and leveraging validation data for domain adaptation are "good practices" that significantly enhance U-Net performance in urban traffic forecasting.

Summary updated

BibTeX
@misc{xu2020towards,
  author = {Jingwei Xu and Jianjin Zhang and Zhiyu Yao and Yunbo Wang},
  title = {{Towards Good Practices of U-Net for Traffic Forecasting}},
  year = {2020},
  eprint = {2012.02598},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2012.02598},
}
Figure