Authors: Ian Marsh, Ahmad Al-Shishtawy, Cosar Ghandeharioon (KTH) and Björn Bjurling (RISE SICS)
Venue: European Conference on Data Analysis (ECDA), Paderborn, 2018; Archives of Data Science, Series A (KIT Scientific Publishing)
Year: 2018
Topic: Big data and analytics
Project: BADA, Big Automotive Data Analytics (FFI/Vinnova 2016-02207)
Paper (PDF) · Slides · BADA project · Traffic replay demo
Summary
Road authorities know long-term demand on their roads well. Short-term prediction, where a queue will form in the next 15 minutes and where it will end, is still a research problem. This paper applies big-data tools to 12 years of data from the Swedish Transport Administration (Trafikverket) to find queues around Stockholm.
The main points:
- Density is a better congestion signal than speed or flow. Flow (vehicles per minute) is the same in light traffic and in a jam that is just moving. Density (vehicles per km) separates the two.
- File format matters at this scale. Parquet stored one month of data in 3% of the CSV size and ran queries up to 7 times faster.
- Simple, explainable models do well. An ARIMA model and an LSTM network both predicted speeds well. ARIMA is easier to explain and probably the better choice for a deployed system.
What is a queue?
There is no single definition. "More than 100 vehicles in a 1 km section", "lanes more than two-thirds occupied" and "this trip is taking an hour longer than usual" are all plausible. Traffic theory gives a sharper one: a queue is where density has passed the critical point and adding vehicles lowers the flow (the falling side of the fundamental diagram).
Knowing where a queue ends matters for more than route advice. A haulage company signs off a consignment when its last truck arrives, so knowing that a truck is about to enter a queue, and how fast that queue will clear, is worth money.
The data
| E4N, 1 month | All roads, 1 month | All roads, 12 years | |
|---|---|---|---|
| Period | Nov 2016 | Nov 2016 | Jan 2004–Dec 2016 |
| Size on disk | 1 GB | 5 GB | 390 GB |
| Rows | 20 million | 88 million | 7 billion |
| Detectors | 147 | 2,040 | 2,059 |
Traffic data from Trafikverket's Motorway Control System (MCS).
Radar detectors on overhead gantries report flow and average speed for each lane every minute. The study road is the E4 northbound through Stockholm: 50 km, 1–4 lanes, 147 detectors.


Two more sources joined the flow data. Location: detector coordinates came from Trafikverket's GIS in SWEREF99 and were converted to WGS84 for mapping. Weather: SMHI's open-data REST API, CC BY 4.0, with almost 300 kinds of weather condition.
The data ran on Hops (Hopsworks), a Hadoop and Spark platform at RISE's data centre in Luleå, chosen for its "dataset as a service", GPU support and multi-tenancy.
File formats
| Format | Size (MB) | % of CSV | Query 1 (s) | Query 2 (s) |
|---|---|---|---|---|
| CSV | 5,064 | 100% | 23 | 29 |
| Zipped CSV | 480 | 10% | – | – |
| JSON | 20,919 | 413% | 95 | 101 |
| Parquet | 175 | 3% | 3 | 13 |
One month of data on a single Spark server. Parquet is columnar, binary and compressed, and can be split for parallel reading. Zip and gzip cannot.
Density and queues
Density is not measured directly, but follows from the fluid model of traffic: density = flow ÷ speed. Watching density rise along consecutive detectors shows where a queue forms and which way its tail is moving.

Lane speeds behave differently too. The inside lane is the slowest and the outside lane the fastest, and the spread of speeds across lanes narrows as congestion builds.

Prediction
Two models predicted speed a few minutes ahead: a classic ARIMA time-series model and an LSTM neural network. The LSTM followed the daily dips well, with a root mean square error of 7.1 km/h.

Discussion
The deep model predicts well, but it cannot explain itself. A traffic operator who closes a lane or changes a speed limit on its advice needs to know why. ARIMA performs almost as well and can be explained, so it is the better choice for a live system. The LSTM is useful offline, to show how much better prediction could get.
Several factors were left out: weather (the data was collected but not yet in the model), on- and off-ramps (the study used simple points, not junctions), incidents and roadworks.
Twelve years of data are needed because patterns repeat on different time scales: hours within a day, weekdays against weekends, holidays within a month, and seasons within a year. One-off days such as Black Friday can only be predicted from earlier years' Black Fridays.
Future work
- Add weather, incidents and ramp flows to the models.
- Combine the fixed radar with floating-car data (INRIX) to cover roads without gantries. That became the Data-driven traffic flow work in the TENS project.
- Predict on a graph of the whole road network rather than one road at a time, as later KTH theses did with graph partitioning and recurrent networks.
- Move from offline batch to stream processing, so queue warnings reach vehicles within seconds.
The EU perspective
Europe now requires much of this data to be open and shared:
- ITS Directive 2010/40/EU, revised by Directive (EU) 2023/2661, and its delegated regulations on real-time traffic information ((EU) 2015/962, replaced by (EU) 2022/670) and safety-related traffic information ((EU) No 886/2013). Road authorities must publish traffic data through a National Access Point. Sweden's is run by Trafikverket.
- DATEX II (CEN/TS 16157) is the European standard format for exchanging road traffic data.
- The Open Data Directive (EU) 2019/1024 and the High-Value Datasets Implementing Regulation (EU) 2023/138 list mobility as one of six high-value categories that must be free and machine-readable through APIs.
- The Common European Mobility Data Space (EMDS) aims to link these national access points with private data such as floating-car data.
- The AI Act (EU) 2024/1689 treats AI used as a safety component in managing road traffic as high-risk (Annex III). The explainability argument for ARIMA over LSTM above now carries legal weight.
References
- I. Marsh, A. Al-Shishtawy, C. Ghandeharioon and B. Bjurling, "12 years of mining road traffic data," ECDA 2018 / Archives of Data Science, Series A.
- E. Horvitz, J. Apacible, R. Sarin and L. Liao, "Prediction, expectation, and surprise: methods, designs, and study of a deployed traffic forecasting service," UAI, 2005 (Microsoft ClearFlow).
- N. Polson and V. Sokolov, "Deep learning for short-term traffic flow prediction," Transportation Research Part C 79, 2017.
- Z. Abbas, A. Al-Shishtawy, S. Girdzijauskas and V. Vlassov, "Short-term traffic prediction using long short-term memory neural networks," IEEE BigData Congress, 2018.
- M. J. Lighthill and G. B. Whitham, "On kinematic waves II: a theory of traffic flow on long crowded roads," Proc. Royal Society A 229, 1955.
- Directive (EU) 2023/2661 amending Directive 2010/40/EU on Intelligent Transport Systems.
- Commission Implementing Regulation (EU) 2023/138 on high-value datasets.
Citation
Ian Marsh, Ahmad Al-Shishtawy, Cosar Ghandeharioon and Björn Bjurling, 12 years of mining road traffic data, European Conference on Data Analysis (ECDA), 2018. Paper.
BibTeX
@inproceedings{marsh2018twelve,
title = {12 years of mining road traffic data},
author = {Marsh, Ian and Al-Shishtawy, Ahmad and Ghandeharioon, Cosar and Bjurling, Bj{\"o}rn},
booktitle = {European Conference on Data Analysis (ECDA)},
year = {2018}
}
More in Big data and analytics: ← Dimensionality reduction in (large) measurement datasets | Exploring communication and mobility behaviour of 3G network users →