ARTIFICIAL NEURAL NETWORKS FOR THE COMPUTATION OF TRAFFIC QUEUES Pedro Hernández-Arauzo, Secundino López-García, Antonio Bahamonde Centro de Inteligencia Artificial. Universidad de Oviedo at Gijón Campus de Viesques. E-33271 Gijón, Spain email: {pedro, secun, antonio}@aic.uniovi.es http://ntserver.aic.uniovi.es ABSTRACT In this paper we present the results of our experimentation with artificial neural networks for computing traffic queues. These results are compared with the performance of other training methods. The neural scores are slightly better than those obtained by symbolic procedures. But a deeper analysis suggests the convenience of a hybrid device to try to get the best outcomes from each method in each situation. INTRODUCTION Adaptive urban traffic controllers (AUTC) are systems that calculate and implement signal timings in an attempt to optimize vehicle flow according to the latest traffic situation measured in the streets. To do this, the system's eyes are loop detectors usually placed in the roads upstream of the traffic flow; in this way it is possible to gather the recent history of vehicles crossing the detector site. The problem faced in this work is how to compute the number of stationary vehicles in a traffic queue waiting for a green signal. In fact, queues are the most important parameters used to improve traffic n an urban network. In Figure 1 we sketch the overall architecture of an AUTC emphasizing the queue management module.
Users Other transport management systems Interface Timing Management Implementation in the network Queue management Other demand Indicators Detectors Urban Network Figure 1 Architecture of an adaptive urban traffic controller When detectors provide a faithful image of what is going on in the streets, in order to compute the queue, we only need to know the number of vehicles crossing the stop line per time unit in green phases; this is a statistically found data of the studied lane. Therefore, in this case, we can calculate the number of stationary vehicles in front of a red signal since we know how many vehicles are in the waiting area (the region between the loop detector and the stop line). Difficulties arise when vehicles in a queue in a given lane reach the loop detector. Then the traffic trying to approach the stop line cannot be measured since they have not crossed the loop yet because of the queue. Unfortunately, we do not have several detectors in each lane nor can we place them behind the entry to the lane. Thus we should try to provide the control system with an accurate estimation of the queue even in this case. In fact, our only opportunity to compute the queue is to wait until cars begin to move in the next green phase and then try to figure out which of the cars detected by the loop was the last in the queue. This paper is concerned with a method for obtaining an effective and efficient device to discover which was the last car in a queue as it passes over a loop detector buried in the lane. We use an artificial neural network which was trained with data from a simulator built specially for this purpose [Hernández-Arauzo, 96]. The behavior of the simulator has been induced from real data obtained in the city of Oviedo (Spain) with the facilities of an AUTC constructed by our team [Bahamonde et al., 92]. The final section is devoted to comparing the results thus obtained with those produced by other training methods used to synthesize an algorithm to compute queues. Here we include symbolic machine learning using Quinlan's C4.5 [Quinlan,
93]. In all cases we present the results compared with training data and actual data obtained from street observations. Both situations show similar, successful results with our neural approach; slightly better than those obtained by symbolic procedures. At the same time, we indirectly show the accurateness of our simulator. ACCOUNTANCY OF VEHICLES IN THE QUEUE Traffic management is based on a cyclic idea. At junctions green and red phases split up a given amount of seconds (cycle time) after which the same signal arrangement starts again. Thus, data provided by detectors are collected in integer arrays called profiles. In fact there are two kinds of profiles: flow and occupancy. The former counts the number of vehicles crossing the loop each time unit (usually 5 seconds). On the other hand, occupancy profiles components record for how long the vehicles were passing over the detector. To compute the number of vehicles stopped in front of a red signal, we can start by taking it for granted that profiles data are an accurate and reliable representation of street traffic flow. In which case, the queue in a time t can be computed by queue(t) = queue (t- ) + vehicles_in (t-, t) - vehicles_out (t-, t) We are mainly interested in queues at two singular instants of the cycle for a given lane: red and green starts. Thus, if we have some data about traffic behavior in the area, such as average vehicle length and speed, it will be not difficult to compute the number of vehicles entering the queue. The queue output calculation is usually based on a statistically found data called saturation flow: the mean number of vehicles escaping from a queue per time unit. But, as was stated in the Introduction, the problem arises when the queue reaches the detector (see Figure 2). vehicles in waiting area Detector vehicles in queue behind the detector vehicle queue Figure 2. The queue goes beyond the detector
The problem is that profiles measured by detectors with a stationary vehicle on them lose their effectiveness since they do not count vehicles approaching the lane stop line. Figure 3 represents a pair of flow and occupancy profiles reported by a stepped detector. Here, from the first measure instant of the cycle we have full occupancy (5 out of the 5 seconds time measure unit) without any crossing car, so we must infer that the queue goes farther back than the detector. Later, once the green is open (second 70), traffic begins to be counted: flow becomes not null while occupancy is smaller than 5 each time unit. The queue goes beyond the detector 5 4 3 2 1 0 5 15 25 35 45 55 65 75 85 95 105 115 Flow Occupancy Green time Figure 3. Profiles reported by a detector with a stationary vehicle on it However, we should stress that flows reported from second 70 until 100 do not represent vehicles approaching the stop line; they are the vehicles in the queue behind the detector (see Figure 2). Thus, if we try to apply the conventional formulas for faithful flow profiles, the results will be totally erroneous. Figure 4 shows queue lengths during cycle time computed this way and compared with real ones reported by our simulator. Vehicles in queue 16 14 12 10 8 6 4 2 0 0 120 Time Simulator queue Flow profile queue Figure 4 Therefore, in the cycle recorded in the profiles of Figure 3, the answer about the queue that we would want to give should look like this: the queue can be summed up by queue = vehicles between the stop line and detector (waiting area) +
vehicles counted in flow profile from second 70 until 100 To reach this solution, we should be able to separate the platoon of vehicles in the queue from any other group or individuals. Given that we know when the platoon starts to be reported, we should concentrate on discovering when the last vehicle in the queue is crossing the detector. The main goal of our approach to computing queues is to focus on this point. In the next section, we will present an experimental method to compute said time. THE EXPERIMENTS According to the remarks of the previous section, we should compute a function like the following: last_vehicle_in_queue? (measure_instant): truth_value. That is, given a measure instant, we must state whether or not it corresponds with the passing over the detector of a vehicle which was the last one in the queue waiting for the green signal. Nevertheless, this decision does not depend only on one measure instant, but also on its neighborhood. To be precise, we take a window of 3 values in each profile (flow and occupancy). Thus, every measure instant will be analyzed with its flow, occupancy, and those of the previous and next instants. Given a pair of flow and occupancy profiles where the queue went beyond the detector, we can obtain an estimation of the queue if we test all possible ends of queue with the function last_vehicle_in_queue? until we obtain a positive answer. That is, we must decide where the end of the queue platoon is in order to add up their members, as we pointed out in the previous section. We use the functions where_is_queue_end (flow_profile, occupancy_profile): integer compute_queue (flow_profile, occupancy_profile): integer to compute the measure instant where the queue ends and the number of vehicles in queue, respectively. To start the experiment, we generated 597 double profiles (flow and occupancy) in different traffic situations. In all of them the queue end went beyond the detector. Attached to the profiles, we recorded when the actual last vehicle in the queue crossed the detector. With this data, we built 3142 training instances with the following syntax: -1, occupancy i - 1,, occupancy i, +1, occupancy i + 1, detector_position, class The ANN used for this purpose was a simple 3-layared feedforward network with 7 input units according to the input file syntax, 1 output unit and 15 hidden units. The reference to the detector position must describe if it is placed before or after the stop line.
The training was carried out with the SNNS [SNNS, 95] system. The method used was standard backpropagation with a learning rate of 0.2 and a maximum error allowed in output of 0.05. COMPARISON OF ANN RESULTS WITH THOSE OBTAINED BY OTHER METHODS In [Hernández-Arauzo, 96] and [Hernández-Arauzo, 95] another two methods have been used to determine algorithms allowing us compute the function last_vehicle_in_queue?, and hence the functions where_is_queue_end and compute_queue. The first method is an explicit knowledge machine learning system. We used C4.5 [Quinlan, 93] to synthesize a set of clasification rules. In the training examples file, each entry describes the neighborhood of a measure instance taken from the same original profiles used to train the above mentioned ANN. Since the expressive power of rule conditions do not capture the sequential idea of previous and next data, we defined a set of attributes that capture the core of them. Here we took into account our experiences and field trials in real urban networks. To be precise, we used the following set of attributes: occupancy i = 0 and occupancy i = 0 > occupancy i + 1 > occupancy i +1 + 1 = 0 and occupancy i + 1 = 0 + + 1-1 + + + 1 > occupancy i + occupancy i + 1-1 / occupancy i - 1 / occupancy i + 1 / occupancy i + 1 The training material was separated into two blocks: those proceeding from detectors placed before the stop line and after the stop line. In this way, we generated a set of 10 rules to compute the predicate last_vehicle_in_queue? in all circumstances. The second method to compute queues (called segmentation) was borrowed from image data processing. We assign to every pair of flow and occupancy some kind of membership degree to a queue state. These degrees can be seen as gray levels in a one dimensional image whose borders correspond to the start and end of a platoon moving over the detector. In the training process here, we just try to figure out good degrees for flow-occupancy pairs. The chosen option was simply the frequency of pairs in observed queues in training profiles. As before, we first separated the original data according to the relative situation of the detector. Although the function last_vehicle_in_queue? is an essential tool for determining when the last vehicle in the queue is crossing the stop line and therefore for evaluating errors produced by all the methods, we should emphasize that what is
really important for our purpose are the errors in computing the functions where_is_queue_end and compute_queue. In the following tables we present the scores computed for the 3 methods, adding up the results for profiles from detectors placed before and after the stop line. In the first column we give the average difference between the computed measure instant and the actual one. In the second one, we show the relative errors found in the number of vehicles in the queue. The first table presents the results obtained by the 3 methods in training cases where_is_queue_end compute_queue METHOD (absolute error) (relative errors) Symbolic Rules 1.54 4.16% Data Segmentation 1.32 6% ANN 1.24 4.12% Results in training cases generated by our simulator where_is_queue_end compute_queue METHOD (absolute error) (relative errors) Symbolic Rules 1.72 5.42% Data Segmentation 1.38 5.2% ANN 1.27 3.65% Results in real cases taken from the streets In order to formalize these results from a statistical viewpoint, we collected a new sample of 232 profiles drawn from the simulator. Functions where_is_queue_end and compute_queue were computed for each profile in the sample and for each method. Finally, 95% Confidence Intervals for population mean when population standard deviation is unknown were constructed for each method and function. The following table shows the results:
where_is_queue_end compute_queue METHOD lower bound upper bound lower bound upper bound Symbolic Rules -0.20 0.01 0.38 0.73 Data Segmentation -0.44-0.22 0.96 1.29 ANN 0.47 0.70 0.21 0.56 An analogous proccess was followed with the set of real profiles. The results were: where_is_queue_end compute_queue METHOD lower bound upper bound lower bound upper bound Symbolic Rules -0.77 0.16 0.37 1.44 Data Segmentation -0.37 0.48 0.44 1.48 ANN 0.22 0.74-0.21 0.62 Thus we can conclude that errors in the function where_is_queue_end were lower than 1 at confidence coefficient 0.95 for all methods. Errors in the function compute_queue were 1 at most for the ANN method and 2 at most for the remaining ones. Moreover, it should be emphasized that intervals derived from the ANN method are significantly shorter and nearer to 0, thus providing the most accurate estimation method. In the same way we have constructed 95% Confidence Intervals for differences of population means with unequal variances between real and simulated profiles, obtaining the following results:
where_is_queue_end compute_queue METHOD lower bound upper bound lower bound upper bound Symbolic Rules 0.05 0.69-0.91 0.21 Data Segmentation -0.82 0.05-0.38 0.71 ANN -0.39 0.19-0.63 0.26 All the methods produce 95% Confidence Intervals whose bounds are 1 unit at most from 0 and therefore we can estimate the functions where_is_queue_end and compute_queue for the real profiles using methods trained with the simulated profiles with an error lower than 1. In other words, profiles provided by the simulator are very reliable for evaluating queues. As before, the lengths of intervals associated with the ANN method are significantly shorter than those obtained from the other methods. CONCLUSIONS Traffic queue computation relies on too much unreliable data about traffic behavior. We have to know fuzzy things like average speed or rate of vehicles escaping from a queue per time unit. Environmental aspects such as the weather or the state of the road make these parameters vary. On the other hand, flow profiles, when the queue goes beyond their placement, present puzzling measures. To avoid this, we have devised an experiment to estimate traffic queues. Using a simulator we gathered together a large amount of traffic problems and then trained an ANN to solve them. To test the algorithm thus obtained, we used both artificial training problems and some real ones taken from the street. Since the performance is quite similar, we indirectly conclude that our simulator is a faithful one and provides realistic profiles. However, the main result of the experiments reported in this paper is that it is possible to compute queues by means of a trained ANN with errors smaller than 0.62 vehicles 95% of times. Additionally, we have compared these results with those obtained with another two methods. Although the performance of the neural method is slightly better, we have observed that each method has some typical problems where they usually to fail in computing an accurate queue. This suggests the convenience of a hybrid device to try to get the best outcomes from each method in each situation.
BIBLIOGRAPHY BAHAMONDE, A., LÓPEZ-GARCÍA, S., HERNÁNDEZ-ARAUZO, P., BILBAO, A., VELA, C.R., ITACA: An Intelligent Urban Traffic Controller, Proceedings of IFAC Symposium on Intelligent Components and Instruments for Control Applications, SICICA'92, p. 787-792, Málaga, 1992. HERNÁNDEZ ARAUZO, P., BAHAMONDE, A., LÓPEZ GARCÍA, S., Sobre la Calculabilidad del tiempo de desalojo de una cola de vehiculos. Proceedings of VI Conferencia de la Asociación Española para la Inteligencia Artificial, CAEPIA-95, p. 449-458. Alicante, Spain, 1995. HERNÁNDEZ-ARAUZO, P., Traffic queues computation. A virtual problems model, p. 104 + ii. Ph. D. dissertation. Universidad de Oviedo at Gijón. Nov. 1996. QUINLAN, J. R.: C4.5: Programs for Machine Learning, p. x+302, Morgan Kaufmann Publishers, San Mateo (California), 1993. ZELLA, A. et al., SNNS: Stuttgart Neural Network Simulator. User Manual, Version 4.1. Institute for Parallel and Distributed High Performance Systems, Technical Report No. 6/95. 1995.