Adaptive Traffic Controller Based On Pre-Timed System

Adaptive traffic controller systems based on image processing have been developed widely. Nevertheless, in a developing country, the systems often could not be easily applied because all types of vehicle use the same road. Therefore, to overcome the problem, the new concept of the systems is proposed. The systems were developed from a pre-timed traffic controller system that based on AVR microcontroller. By default, the systems use the signal-timing plans to control the vehicle flow. To accommodate the traffic variations, a new method of vehicle detection has been built. The method calculated an intensity histogram standard deviation of the image representing a detection area to determine traffic density of each intersection lane. The systems modified the green-time of each lane based on the traffic density. The method could detect all types of vehicles and work properly in a day and a night time.


Introduction 1.Background of the Problem
A traffic jam is a daily phenomenon in every big city in the world. It commonly happens at an intersection controlled by a conventional traffic controller. One of the weaknesses of the conventional traffic controller is unable to accommodate the traffic volume varieties because it uses a fixed-timed system. It means that the systems have a same green time all day. This can cause a heavy traffic jam in peak hours because of the long vehicles queue and there is wasting time in off peak hours because only a few vehicles pass the intersection. That phenomenon becomes the major factor of causing a traffic jam in some intersections.
One method to overcome this problem is to use adaptive traffic controller systems. The systems control the vehicles flow based on the real time traffic density. In developed countries, the systems have been developed widely. Usually, the systems use several sensors, such as inductive loop detector, infrared, or camera to detect the vehicle and then calculate traffic density. By doing so, it can reduce the air pollutant by minimizing the amount of acceleration and braking of the vehicle [1].
One of the vehicle detection methods that has been developed rapidly is using a real time video and image processing. The detection uses one or several cameras to detect the vehicles such as car, truck, bus, or tractor on every intersection lane. The system is now commonly used in the developed countries that the road is intended for motorized vehicles only.
Unfortunately, most roads in developing country like in Indonesia are intended for all kinds of motorized and non-motorized vehicles. The vehicle detection applied in the developed countries can not detect the non-motorized vehicles such as bicycles, padicabs or rickshaws. The adaptive traffic controller based on the vehicle detection like in the developed country could not be properly applied in the developing country. Up to now, most intersections in the country use the fixed-timed traffic controller systems, thus the traffic jam becomes one of the serious problems.

Related Research Studies
Many research studies have been conducted to improve the adaptive traffic controller based on an image processing. The common image processing method to detect vehicles is using edge detection. Hongjin Zhu presented a moving vehicle detection that comprised a horizontal edge detection method and auto correlation. It is possible to detect each individual vehicle even if the vehicles are overlapping [2]. Fazli obtained vehicles classification based on neural networks for an adaptive traffic controller system [3]. Khan and Askerzade implemented an image processing and fuzzy logic control, and then sent the result to a microcontroller to drive the traffic signal [4]- [5]. After that, Sutjiadi [6] tried to extract the background using Gaussian Mixture Models Algorithm in order to detect the vehicles.
The advantage method of vehicle detection is using Cascade Haar. Chirag and Ripal implemented the method by training the classifier for 15 stages, 17 kinds of Haar features, and a size image of 35 × 20 pixels. The detection results can be improved by training the classifier on the largest set of samples [7]. The traffic density can be calculated by comparing the real time frame of live video by reference image and searching vehicles-only on the road area [8]. The vehicle detection and tracking can be done by extracting the video frame sequence [9].
Some research studies have been conducted to meet the traffic characteristics in Indonesia. Jatmiko presented the architecture of decentralized self-organizing traffic control system in real situation even on non-structure intersection like in Jakarta [10]. Kurniawan developed a pre-timed and coordinated traffic controller systems based on AVR Microcontroller. The systems manage the vehicle flow based on signal-timing plans [11].
Almost none of the vehicle detection methods based on image processing can be properly applied in the developing country. They can not detect all types of vehicles. According to Haar Cascade method, the various types of vehicles can be classified, but they need huge sample classifiers and increase computational load significantly. An adaptive traffic controller system based image processing like applied in developed countries is not reliable applied in the developing country. To overcome the problem, a new concept of the adaptive traffic controller system is proposed. The system is based on pre-timed system in the previous research [11]. To accommodate the traffic variations, the systems determine the traffic density from an intensity histogram standard deviation of an image representing the lane and modify the green-time of each intersection lane.

Research Method 2.1. The Development of the Pre-timed Systems
The system is a development of the pre-timed traffic controller system. As mentioned in the [11], the system uses ATmega128A microcontroller as the heart of controlling traffic as shown in Figure 1. By default, the systems control the vehicle flow based on the signal-timing plans. In the plan, a day is segmented into ten time slots. There are three plans available that can be allocated to several types of day: weekdays, Saturdays, and Sundays. The plans comprising green, yellow, and red-clearance time of all lanes are stored in the EEPROM of the microcontroller. The operator can modify the plan from the Traffic Management Center program to meet the characteristics of the traffic by reffering the statistic result .  Each camera captures the entire vehicle waiting area, but the program only detects the vehicle in the vehicle detection area. On lane 2 and 4, the area is slightly shifted to the center of the lane because there is a turn-left priority. The camera sends a real-time video surveillance with its resolution of 320 × 240 to a computer via a wi-fi router with a frame rate of 7 frames per second. The detection is performed at the last frame.

Determine the Traffic Density using Histogram
The systems detect all objects in the vehicle detection area as shown in Figure 2. The area is divided into three regions of interest (ROIs). The detection is only performed in ROIs. For saving the computation, the color image is transformed into a gray image.
It can be concluded from the previous research that the existence of vehicle would make on obvious difference between the vehicle and the background color [12] [13]. This would make the standard deviation of the intensity histogram higher. A lane with no vehicle will result a histogram with its low standard deviation. Otherwise, a lane containing a lot of vehicles will result a histogram with its high standard deviation. The determining traffic density is done by calculating an intensity histogram of all ROIs. After that, the systems calculate the standard deviation of the histogram. If the value is less than a low threshold, the systems conclude that the traffic density is low. In this case, the systems shorten the green-time. Otherwise, if the value is higher than a high threshold, the systems conclude that the traffic density is high, and then the systems extend the green-time. Determining traffic density is only performed for a lane.  The first step of the algorithm is to calculate the intensity histogram.
denotes the intensity histogram of the pixels in all ROIs at the lane , denotes the gray level (0, 1, 2, ... 255), and denotes the number of gray level . After that, in line 2, systems calculate the mean of the histogram ( ). In the equation, denotes the number of pixels in all ROIs. And then line 3 calculates the standard deviation of the histogram . In line 4, if the value is less than the low threshold ( _ ), the systems conclude that the traffic density is low. Therefore, systems shorten the green time by doing the following steps: (a) calculate a difference between current countdown number and five (∆ ), (b) set the countdown number ( ) to five, and (c) subtract the countdown number of red-time of the other lanes (r j , for ) by ∆ . Otherwise, in line 5, the systems extend the green-time. This case can be done if some parameters meet the requirement: (a) is less than eight, (b) the addition of that has been done ( _ ) is less than the maximum number of green-time addition ( _ ), and (c) the standard deviation is greater than the high threshold ( _ ). The system will extend the greentime by increasing the three parameters: (a) current countdown number ( ), (b) the green-time addition value ( _ ), and (c) the current countdown number of red-time of the other lanes ( , for ). In this case, all countdown numbers do not appear to change because they also decrease every second.

The Standard Deviation of the Histogram
Several experiments have been conducted to determine the low and high threshold.   Figure 4(c). The mean and the standard deviation of the intensity histogram are 127 and 51. The mean of the histogram may change with a variation of the sun light intensity over the horizon and weather, but the standard deviation does not significantly change. The intensity histogram varies with the variation of the vehicle. The higher the traffic density of the detection area and the higher the percentage the road are occupied by the vehicle and the higher the intensity histogram standard deviation.

The Modified Green-time
Some common cases can occur in the lane. In a normal traffic, decreases every second as shown in case 1 of Figure 5. At this case, the default green-time is 15 seconds. In the peak hour, generally the traffic volume is higher than usual. Operator should modify the greentime default to accommodate the traffic variation. However, in some cases, sometimes, the traffic volume can be higher than predicted. Case 2 in Figure 5 shows the countdown number when the traffic density is high. At this case, does not change at t = 8 until 15 seconds. Meanwhile, case 3 in Figure 5 shows a condition when the green-time is given to a lane, the traffic density is low. At this case, systems set = 5. After that, systems countdown until 'zero' and green-time runs out.  Figure 5. The counting-down process The Gondomanan intersection is controlled by fixed-time traffic controller systems that its default green-time ( ) for lane 1, 2, 3, and 4 are respectively 30, 36, 43, and 30 seconds. Those are the green-time needed at the peak hour. Meanwhile, the yellow-time ( ) and the redclearance ( ) of all lanes are 3 and 5 seconds. The preset for green, yellow, and redclearence time at day time are shown in Table 1. When the green-time is given to a lane and the countdown number decreases, vehicles start to move and leave the queue. In this case, the traffic density of the lane generally decreases, therefore, the standard deviation decreases. Figure 6 shows the intensity histogram standard deviation when a green-time is given to each lane at the day and night time. The horizontal axis of the figure is the countdown number at the pre-timed systems and the proposed systems at the day and night time. The countdown numbers at the pre-timed systems are always shown. Meanwhile, at the proposed systems, they are shown when the value of the green-time from five to zero.
The high threshold of the standard deviation for each lane ( _ ) is defined higher than the maximum value of the standard deviation that sometimes occurred, because the preset green-time has been set to the green-time needed in the peak hours. Therefore, the systems hardly ever extend the green-time. Meanwhile, the low threshold ( _ ) is defined slightly higher than the standard deviation average when there is no vehicle in the ROIs. The high and low threshold of the standard deviation for all lanes can also be shown in Table 1.  Figure 6 shows fluctuation of the intensity histogram standard deviation of all pixels in the all ROIs at the image representing the vehicle arrival of each lane when a green-time is given to the lane. In general, in day time, the green-time allows all vehicles queue to enter and pass through the intersection. Nevertheless at the end of the green-time ( = 0), there are some arrival vehicles in lane 1, 3, and 4. In this case, the standard deviation is still higher than the low threshold as shown in Figure 6(a), 6(c), and 6(d), so that the counting down goes normally for lane 1, 3, and 4.
Meanwhile, at lane 2 in Figure 6(b), the green-time also allows all vehicles queue to enter and pass through the intersection at the day time. When the countdown number of greentime is ten, there is no vehicle in all ROIs. Systems shorten the green-time by setting the current countdown number to five and then the green-time is ended in five seconds. At this case, the systems save the green-time for five seconds. Figure 7(a) shows the video surveillance when the countdown number at lane 2 goes from five to zero.
When a night time, at lane 1, all vehicles queue enter and pass through the intersection when the countdown number of the green-time is seven. As can be shown in Figure 6(a), the systems shorten the green-time and save the green-time for two seconds. This case also happens in the other lanes. It can be shown in Figure 6 When the green-time of a lane is decreased, the red-time of the other lanes will be decresed too. The red-time of the pre-timed system ( ) and the red-time of the proposed system ( ′ ) in a night time can be seen in Table 1. In this case, the red-time of all lanes can be reduced about 20%. It can also be concluded that the systems not only save the green-time, but also shorten the red-time of all lanes. In other words, the systems can reduce the vehicle waiting-time at all lanes.

Conclusion
An adaptive traffic controller based on pre-timed systems can be implemented based on an ATmega128A microcontroller. The system uses the signal-timing plans as a basis for controlling the vehicle flow. To accommodate the instantaneous traffic variation, the systems modify the current green-time of a lane according to the traffic density of the lane. The traffic density can be determined by calculating the intensity histogram standard deviation of the image representing the vehicle detection area of the lane. The methods work properly in day and night time and not only saving the waste-time at the green-time, but also reducing the waiting-time at the red-time.