Modeling Traffic Information using Bayesian Networks

Dutch freeways suffer from severe congestion during rush hours or incidents. Research shows that 64% of congested traffic during rush hour consists of commuter traffic [30]. A traffic congestion increases travel time, resulting in a delay for travelers. Reliable travel time predictions are essential for Dynamic Routing, in which travelers can be rerouted to avoid congestions. Travel times can be calculated from vehicle speed [41] in case of free flowing traffic. In case of congestion, we will make an estimation error regarding the travel time. Therefore, an accurate speed prediction model is necessary. In this thesis, the predictability of the average vehicle speed by Bayesian Networks is investigated. A case study is conducted where several Bayesian Network models we propose are evaluated for a well known traffic bottleneck in the Netherlands. We show that Bayesian Networks are capable of predicting the start or end of a congestion at the bottleneck reasonably accurate for a prediction horizon until 30 minutes. Further, we propose a prediction model based on historical data, which is able to predict the average vehicle speed at the bottleneck location for longer prediction horizons. In the end, we propose a hybrid model which combines our Bayesian Network and our prediction model based on historical data. This hybrid model is able to predict a traffic congestion with an accuracy of 85% for a prediction horizon of 2.5 hours. The results of our case study show that modeling traffic using Bayesian Networks is promising. Our models can form the input for a travel time prediction model for Dynamic Routing.


INTRODUCTION
Many highways in the Netherlands suffer from severe congestion at some times of the day.Regular congestions can be anticipated, but incidental congestions will increase people's travel time and raise frustration.Travel times are important for travelers, as well as for road managers.Accurate travel time predictions give travelers or road managers the ability to anticipate road congestion and to estimate their arrival time.
Travel time  for a certain route can be computed as follows: , where denotes the distance and denotes the travel speed on subsection i respectively and .The fact that speed is actually a function of time is disregarded for convenience purposes at this moment.There are different approaches for traffic prediction: an instantaneous approach, a model based approach, or data driven approaches.Instantaneous approaches assume that traffic conditions remain stationary for the time the prediction holds (van Lint, 2004).In general, traffic does not remain stationary if time passes (Lindveld & Thijs, 1999).Most congestion occurs during the morning or evening rush hours.Therefore, accurate speed predictions for these periods are essential.About 64% of the traffic during congestion consists of commuter traffic (Rijkswaterstaat, 2006).This group of travelers certainly benefits from accurate travel time predictions to plan their day.
Traffic propagates in space and time and is influenced by its context, such as weather, events, accidents, road works, or other incidents which makes traffic an uncertain domain.Bayesian Networks allow us to reason about an uncertain domain (Korb & Nicholson, 2004).We believe that there are strong correlations between traffic measurements such as speed or density at different locations.Furthermore, we have to deal with missing values, which are a common problem in traffic research (van Lint, 2004).Bayesian Networks can handle incomplete datasets and allow one to learn about causal relationships (Heckerman, 1995).
Traffic speed, density, and intensity represent traffic situations.Only two of these variables need to be known to be able to calculate the other.The Bayesian Network we propose in this paper incorporates density and speed measurements.Figure 1a shows a combined graph of speed and density from a morning rush hour at one location of the A4 highway in the Netherlands.This figure shows a switch point, where the speed decreases and the density increases.Figure 1b shows a combined data plot of intensity and density measurements on the same location at the A4 motorway.This figure shows that the intensity (flow) decreases when the density increases.There is an unstable traffic situation just before the congestion.We expect that congestion cannot be seen in these graphs a few hours beforehand, and therefore we combine our Bayesian Network with a historical data model in a hybrid model (Van Den Haak et al. 2010).
The outline of this paper is as follows.Section 2 details related work.In Section 3 we present our models.A description of the data is given in Section 4, and this data is used in our experiment which is described in Section 5.In Section 6 we present the results of our experiment and in Section 7 we present our conclusions and discussion.

RELATED WORK
Different approaches on modeling traffic with Bayesian Networks can be found in literature (Sun et al. 2004), (Sun et al. 2005), (Sun et al. 2006), (Yu & Cho, 2008).These approaches only include one traffic variable in their network, either traffic flow or traffic speed.Figure 2 shows a road network and the corresponding Bayesian Network model developed by Sun et al. (Sun et al. 2004) for predicting traffic flow with incomplete data.Each circle is a node where travelers can change direction.This model predicts traffic flow (intensity) at D d and it is assumed that flow measurements at D d for previous times influence the prediction.Furthermore, upstream links C e , C g , and C h for different time instants also influence the prediction.Yu et al. (Yu et al. 2008) propose a Bayesian Model which includes upstream links as well as downstream links.
Our Bayesian Model differs since it includes speed as well as density measurements combined with historical data predictions in a hybrid model.

PREDICTION MODELS
We propose a Bayesian Network which incorporates speed and density measurements for multiple locations and multiple time instants.Figure 3 shows a graphical representation of this model for locations and i time instants.We have used GeNIe & SMILE from the Decision Systems Laboratory of the University of Pittsburgh to model, train and test our Bayesian Model.If multiple locations and time instants are incorporated, the model quickly becomes complex and computationally expensive to train.To cope with this problem, our Bayesian Network is kept simple and is connected to an adaptive prediction model which is based on historical data in a hybrid model.

a. Bayesian model
At this stage of research, we propose a simplified version of our general Bayesian Model for our experiment.This model incorporates speed and density measurements for three different locations at the A4 highway in the Netherlands.The causal nodes take speed and density measurements at time .This model is trained for different prediction horizons T, where .We expect that this Bayesian model is able to predict short term congestion.In this paper, short term predictions lie in the range from 5 to 30 minutes.4) Holiday, and the raw data which is not clustered.These clusters have been found during an explorative data analysis for homogeneous clusters in the traffic data.Figure 4a and Figure 4b show examples of the models for speed and density respectively.Our prediction model based on historical data is adaptive since it is able to find the best fitting clustered model when new data becomes available.It also tries to find a best fitting day in the total data which is not clustered.This dataset is likely to contain typical days containing accidents, extreme weather, or other incidents.Therefore, our model is able to adapt to new situations continuously.We expect that our adaptive prediction model based only on historical data is able to predict congestion for longer prediction horizons.

c. Hybrid model
We propose a hybrid model, in which we use historical data in our adaptive prediction model to compute initial predictions for speed and density for a prediction horizon .These initial predictions are the input for the three locations in our Bayesian Model.Our Bayesian Model then predicts for a horizon of , based on these initial predictions from the historical data of our adaptive learning prediction model.In total, we have a prediction horizon . We expect that traffic congestion is not visible in the data a few hours ahead, and therefore we first conduct a prediction based on historical data for several locations.These initial predictions are given to our Bayesian Network which is able to model the relations between the locations on the road.We therefore expect our hybrid model to predict traffic congestion for long prediction horizons (from 60 to 150 minutes) accurately.

INDUCTIVE DUAL LOOP DETECTOR DATA
Real traffic data is one of the most important elements in analyzing and improving traffic systems.Real data gives us a better representation of the situation compared to simulated data.Traffic flow is often measured by inductive loop detectors (ILD) because of their widespread availability (Vanajakshi, 2004).The Dutch freeway system is equipped with inductive dual loop detectors, which are capable of measuring speed and intensity per lane.An example of an ILD can be found in Figure 6.The data of these detectors are collected in the Monitoring Casco (MONICA) data system, managed by the Dutch Ministry of Transport, Public Works, and Water Management.
In general, the MONICA data systems contains on average 12% missing values (van Lint, 2004), due to maintenance, accidents, and power or communication failures.To decrease the size of the dataset and the number of missing data points, our dataset has been aggregated from lane data to road data.This aggregation procedure takes the harmonic average over the lane measurements.We choose to take the harmonic mean, because speed measurements are used as a rate when calculating travel times.More details about computing the average of vehicle speed can be found in (van Lint, 2004).The intensity value for a road is the summation of the intensities per lane.The missing values in our data are filled in by the Treiber and Helbing filter (Treiber & Helbing, 2002), which reconstructs the spatioand temporal traffic characteristics.

EXPERIMENT
We tested our models on an important traffic bottleneck in the Netherlands at the A4 from The Hague to Amsterdam around hectometer location 23.5 at the left side.The capacity of the road decreases from 3 lanes to 2 lanes which results in traffic congestion during rush hours or incidents.Figure 7 shows a schematic overview of this test location.Location A, B and C represent the locations in our Bayesian Network model.
A dataset has been extracted out of the MONICA data system for the year 2009 for locations A, B and C. A train and a test set has been randomly selected out of the 365 days.The train set contains 80% (292 days) and the test set contains 20% (73 days) from the total set.Figure 7: Schematic overview.
The Bayesian Network is trained for different time horizons, and evaluated for the corresponding time horizon.For this paper, all our models have been evaluated.The sMAPE is used to compute the difference between the real data and the predicted data as follows: , where is the actual value and is the forecast value at time t and . Since this measure only tells us the relative distance over all time instances, we need another measure to evaluate if our models are able to detect congestion.
Therefore, we introduce a measure for false positives and false negatives.False positives denote a situation in which the prediction model predicts a congestion, while there is none.False negatives denote a situation in which the prediction model predicts no congestion, while there is one.The general aim is the keep the false negatives low, as an error here would result in unexpected congestions which is not desirable for travelers.
For comparison purposes, we introduce another model: the Naïve model.This model only takes all speed values until the current time and assumes that traffic remains stationary.This model can be expressed as follows: and will be referred to as the Naïve model.

RESULTS
The result of the sMAPE, the false positives and the false negatives percentage for the Bayesian Network model, are presented in Table 1.This table shows that our Bayesian Network has a slightly lower false negatives percentage, but is comparable to the Naïve Model.
Table 2 shows the results for our adaptive learning model based on historical data.The results show that our adaptive learning model outperforms the Naïve model when the prediction horizon increases.The results of the hybrid model are presented in Table 3.This table shows that our hybrid model clearly outperforms the Naïve model on the false negatives percentage.This means, that our hybrid model is clearly better in predicting congestion then the Naïve model.Figure 7a and Figure 7b show an example of a prediction plot for T=70 and T=145 respectively for the hybrid model.Figure 7a shows that our hybrid model is able to predict the start and end of the congestion accurately for 70 minutes ahead.In the middle of the congestion, the prediction shows stochastic behavior.Figure 7b shows that for longer prediction horizons it becomes more difficult to predict congestion.

CONCLUSIONS & DISCUSSION
In this paper we showed that our Bayesian Network is able to perform comparably to the Naïve model.The Naïve model only makes an error if the traffic changes, and therefore is shown to be a strong comparator.Our adaptive learning model is able to predict traffic congestions for longer horizons in which it outperforms the Naïve model.The combination of historical models and our Bayesian Model is shown to be a powerful one.Our hybrid model clearly outperforms the Naïve model.We show that the results of our hybrid model are promising.It would be interesting to test our models on more locations for different datasets to see if this conclusion can be drawn for other situations as well.

Figure 1a :
Figure 1a: Combined speed and density graph.Figure1b: Combined intensity and density graph.

Figure 1b :
Figure 1a: Combined speed and density graph.Figure1b: Combined intensity and density graph.
adaptive learning prediction model based on historical data.This model searches a database with traffic models of speed and density for every location.The model database contains mean patterns of four different clusters: (1) Monday-Thursday, (2) Friday, (3) Weekend and (

Figure
Figure 5a shows an example cluster of speed measurements from a location at the A4 in the Netherlands for a total dataset containing 365 days of 2009.Figure 5b shows the cluster containing only Tuesdays for the same location.This figure shows that the data becomes more homogeneous after clustering.