Complex Event Processing Based Real Time Detection of Road Traffic Events 1 Sokha Y, 2 Karpjoo Jeong, 2 Jonghyun Lee, 3 Sanghyun Lee, 3 Youngmin Baek, 3 Seongwan Koo 1 Department of Advanced Technology Fusion, Konkuk University, Seoul, Republic of Korea, E-mail: ysokha.kom@gmail.com 2 Department of Advanced Technology Fusion, Konkuk University, Seoul, Republic of Korea, E-mail: jeongk@konkuk.ac.kr, lejohy@gmail.com 3 Department of Internet and Multimedia Engineering, Konkuk University, Seoul, Republic of Korea, E-mail: katoro@naver.com, {cupitmin, kusungwan}@gmail.com Abstract A road traffic incident is an event that happens on roads and affects traffic flow and human driving at a given time. Traffic incidents can result in longer travel times for commuters and cause serious dangers to drivers. APID is an algorithm designed to detect traffic incidents in various circumstances. In real time traffic event detection, vehicles and roads are monitored by sensors and streams of data from sensors are collectively analyzed to find the occurrence of abnormal events in real time manner. Complex Event Processing (CEP) is a novel technology designed to monitor streams of events and to detect user-specified patterns of events in real time manner. In this paper, we propose a CEP-based real time traffic incident detection system based on the APID algorithm. The APID algorithm is implemented in the Event Processing Language (EPL). The system is evaluated with real world road traffic data and incident reports from Korea Expressway Corporation. Keywords: Complex Event Processing (CEP), Traffic Incident Detection, the APID Algorithm, Event Processing Language. 1. Introduction In big cities such as Seoul, New York, Beijing, and Phnom Penh, traffic is a serious problem where population is very high and very concentrated. Everything which happens on roads and affects road traffic is called events. Such events as car accidents, congestions and road maintenance are considered to be important incidents which can affect traffic flow and human driving seriously. In order to deal with road traffic events efficiently, we need a traffic management system which detects those events and helps decide proper personal and administrative responses as quickly as possible. In recent years, there have been a number of researchers focusing on traffic monitoring and management systems [1]. In those systems, the detection of road traffic events is usually implemented, tightly coupled with other system components and it is very difficult to modify detection algorithms or to add new ones. However, the Complex Event Processing (CEP) technique [2] which is recently available allows us to implement road traffic events in an efficient and flexible way. By using CEP, we can implement, deploy and later modify various road event detection algorithms in a SQL-Like language called the Event Processing Language (EPL) easily. The purpose of this paper is to show how a complex event processing (CEP) system can be used to detect road traffic events by implementing an APID algorithm in the event processing language (EPL). The remainder of the paper is structured as follows. Section 2 discusses about real-time traffic event detection. Section 3 demonstrates CEP-based real time traffic event detection. Section 4 shows how an APID algorithm can be applied to CEP, and section 5 describes about our evaluation of the results. Section 6 provides conclusion, respectively. 2. Real Time Traffic Event Detection Road traffic events are monitored and detected by vehicle detection systems (VDSs) and VDS collected information on millions of vehicles. The vehicles detection systems generate information such as the total number of passing vehicles for a certain period of time, an average speed of passing vehicles in each lane, occupancy, and vehicles types in real time [3]. Research Notes in Information Science (RNIS) Volume14,June 2013 doi:10.4156/rnis.vol14.34 195
Traffic incidents are events that result in abnormal traffic flow on the road network. They are occasional events and can cause reduced road capacities for a certain amount of time. Incident detection is apparently crucial for modern traffic management. Traffic incident detection systems are widely used in highways, expressways, and similar roads. We will define three different types of incidents as following: Incident of high volume traffic flow: incidents that occur on road network with a large number of vehicles. Incident of medium volume traffic flow: incidents that occur on the road network with not large or small number of vehicles. Incident of light volume traffic flow: incidents that occur on the road network with a small number of vehicles. These are three types of incidents that must reasonably cover most traffic issues on expressways and disturb other passengers on the same section of road traffic network. We will use the historical data from the vehicles detection system to compute the APID algorithm. 3. CEP-Based Real Time Traffic Event Detection Complex event processing is a technology for analyzing and processing the complex series of related events [4]. This technology allows us to process event streams in a manner to identify and solve problems quickly and flexibly. CEP is applied to abroad spectrum of information system challenges, including business process automation, schedule and control process, network monitoring, performance prediction, active monitoring and intrusion detection [5]. The complex event processing architecture based real time detection of road traffic events is shown in Figure 1. There are four main components: Event Sources. It is generated by vehicle detection systems (VDS). Those events are inserted into the CEP system via the input adapter event manager which is called the socket input adapter. Input Event Manager. It is used to transform the road traffic events into a machineunderstandable format for the processing engine. Event Processing Service. It is a processing engine which receives events from the input event manager and then matches them against the rules in EPL. Once a rule is matched, its corresponding rule action is triggered. Rule actions are to calculate, transform or generate complex events to output adapters. Output Event Manager. It generates data for other systems and consists of output adapters such as http output adapter, JMS (Java Message Service) etc. 4. CEP-Based Incident Detection Figure 1. CEP-Based Real Time Traffic Event Detection Esper is an engine for CEP in Java. It provides an SQL-Like event processing language called EPL that defines continuous queries on stream of events. Additionally, Esper introduces the concept of slide windows which provide views on a certain number of consecutive events. It offers powerful pattern matching functions that allows complex correlation of events [6]. We implement the APID algorithm in EPL to detect road traffic incidents. 196
4.1. APID Algorithm The APID algorithm is All Purpose Incident Detection algorithms based on the California Algorithm for detecting incidents on the road network [7]. The APID algorithm is based on pattern recognition. In this paper, we use it to detect traffic patterns such as high, medium and light traffic incidents. It uses occupancy, the total number of passing vehicles, and the average speed of passing vehicles [8]. Such information is collected by vehicles detection systems (VDSs) on the road network of highways. The APID algorithm computes and uses the following variables: Upstream occupancy = OCC(i,t) Downstream occupancy: DOCC(i, t) = OCC(i+1,t) Spatial difference in occupancy: OCCDF(i, t) = OCC(i,t) - OCC(i+1,t) Relative spatial difference in occupancy: OCCRDF(i, t) = OCCDF(i,t)/OCC(i,t) Relative temporal difference in downstream occupancy: DOCCTD(i, t) = [OCC(i+1,t-2)- OCC(i+1,t)]/OCC(i+1,t-2) Relative temporal difference in speed: SPDTDF(i, t) = [SPD(i,t-2)-SPD(i,t)]/SPD(i,t-2) The APID algorithm also needs threshold values shown in Table 1 which represent the conditions of road traffic, but we failed to find appropriate threshold values for our experiments and just used threshold values proposed in previous work [9] because the main objective of our work is to show the effectiveness of CEP for road traffic incident detection, not that of the APID algorithm. Therefore, the effectiveness of those values is assumed to be limited. Table 1. Threshold values for control parameters Control Parameters Value Threshold Incident Detection1 (TH_HAV_ID1) 10.2 Threshold Incident Detection2(TH_HAV_ID2) 0.40 Threshold Incident Detection3(TH_HAV_ID3) 20.8 Threshold Medium Traffic Incident1(TH_ME_ID1) 0.40 Threshold Medium Traffic Incident2(TH_ME_ID2) 0.1 Threshold Light Traffic Incident1 (TH_LIT_ID1) 1 The incident conditions are defined and shown as follows: Incident of high volume traffic flow o OCCDF > TH_HAV_ID1 o OCCRDF > TH_HAV_ID2 o DOCC > TH_HAV_ID3 Incident of medium volume traffic flow o OCCRDF > TH_ME_ID1 o SPDTDF > TH_ME_ID2 Incident of low volume traffic flow o SPDTDF > TH_LIT_ID1 4.2. Implementation APID Algorithm in Event Processing Language The EPL rule to detect incident of high volume traffic flow on road traffic network is implemented as follows: @Name( Incident on High Volume Traffic Flow ) Insert into High Select allcurrentstreamvdsproperties, From CurrentStreamVDSID, DownStreamVDSID Where (CurrentStreamVDSID.OCC DownStreamVDSID.OCC) > TH_HAV_ID1 and (CurrentStreamVDSID.OCC DownStreamVDSID.OCC) / CurrentStreamVDSID.OCC > TH_HAV_ID2 and DownStreamVDSID.OCC > TH_HAV_ID3 197
Expressions of the EPL code mean that: (CurrrentStreamVDSID.OCC DownStreamVDSID.OCC) == (OCCDF(i,t) = OCC(i,t)- OCC(i+1,t)). ((CurrentStreamVDSID.OCC-DownStreamVDSID.OCC ) / CurrentStreamVDSID.OCC) == (OCCRDF(i,t) = (OCC (i,t) OCC(i+1,t))/ OCC (i,t)) Where i denote a VDS system ID, VDS i+1 is next to VDS i in downstream, and t denotes a time period. OCC (i+1, t) is the occupancy value which is obtained from VDS i+1 at time t. The detection of medium volume traffic flow consists of two steps: The first step is written in EPL as follows: @Name('Incient_Medium_Volume_Traffic_Flow') Insert Into SpdFilterCurrentStream Select allvdscurrentstreamproperties From CurrentStreamVDSID Match_Recognize ( Measures VDS.VDS_ID as VDS_ID, VDS. Colct_dtmc as colct_dtmc VDS.speed as speed, VDS.vol as vol, VDS. LaneVehicle as LaneVehicle, VDS.OCC as OCC Pattern (VDS) Define VDS as (Prev(VDS.speed, 2) - VDS.speed) / Prev (VDS.speed, 2) > TH_ME_ID2 ); The second step is written in EPL as follows: Insert Into Medium Select SpdFilterCurrentStream From SpdFilterCurrentStream, DownstreamVDSID Where SpdFilterCurrentStream. Colct_dtmc = DownstreamVDSID. Colct_dtmc and (SpdFilterCurrentStream.OCC DownstreamVDSID.OCC)/ SpdFilterCurrentStream.OCC >TH_ME_ID1 In the first step, we detect the event based on the speed condition whose rules are shown previously. The detected events are inserted into window stream SpdFilterCurrentStream. In the second step, after the first step is already done, we use the events from the SpdFilterCurrentStream to be joined with the next VDS s section name DownstreamVDSID with OCCRDF s condition which is already mentioned above. After the first and second steps are processed, the detected incident of medium traffic flow will be inserted into window stream Medium. The EPL rule that is used to detect incident of light volume traffic flow on road network can be expressed as follows: @Name ( Incident Light Volume Traffic Flow ) Insert Into Light Select allcurrentstreamproperties, From CurrentStreamVDSID, Match_Recognize ( Measures VDS.VDSID as ID, VDS.colct_dtmc as datetime, VDS.speed as speed, VDS.vol as volume, VDS.fillinparm as VDS_Location, VDS.Lane_Type as lanevehicle, VDS.direction as direction Vehicle, VDS.occ as Occupancy Pattern (VDS) Define VDS as ((Prev(VDS.speed, 2)-VDS.speed) / Prev (VDS.speed, 2) > TH_LIT_ID1); 198
Expression of the above EPL code means that: (prev(vds.speed,2) VDS.speed)/prev(VDS.speed, 2) == [SPDTDF(i, t)= (SPD(i,t 2) SPD(i,t))/SPD(i,t 2))]. Where i denote a VDS system ID, VDS i+1 is next to VDS i, and t denotes a time period. SPD (i, t) is the average speed of vehicles detected by VDS i at time period t. 5. Evaluation We evaluated our EPL implementation of the APID algorithm (EAPID) by using both real traffic data and incident data about the highway road section from Cheon-An IC to Dong-Tan JC which was further divided into four sections [10]. Real incident data is reports including car accidents, road maintenance, and congestions. We ran EAPID with the traffic data to detect high, medium and low traffic volume incidents. We compared the results with real traffic and incident data in the following way: For real incident data, checked if EAPID detected either medium or high traffic volume incidents. The rationale for this comparison is that real incidents such as car accidents or maintenance are most likely to slow down and to increase traffic volumes. For real traffic data with 70km/h or lower as average vehicle speeds, checked if EAPID detected either medium or high traffic volume incidents. The rationale for this comparison is that medium or high traffic volumes are likely to correspond to slow vehicle speeds. We showed the comparison results in Figure 2. The accuracy of EAPID is not high, but incident detection is known to be a challenging problem and most APID algorithms fail to produce highly accurate detection results [7]. However, the main objective of this work is not to develop an efficient and highly accurate APID algorithm implementation but to prove that EPL is effective for implementing such algorithms. Figure 2. Comparisons of EAPID results with real incident data O, DI_H, DI_M, DI_L, and V denote real incident reports, high traffic volume detection, medium traffic volume detection, low traffic volume detection, and an average vehicle speed (x: 70km/h or higher, : 70km/h or lower), respectively [11]. There are 41 incident reports tested. Only 28 incidents correspond to average vehicle speeds of 70km/h or higher. For 20 incidents out of those 28 incidents (71%), our EAPID program detected high or medium volume traffic incidents. As we can see that traffic incident reports (car accidents or road maintenances) are not exactly matched with high or medium volume traffic in Figure 2, it is very difficult to check if results of the APID algorithm are correct. Therefore, the evaluation results shown in Figure 2 should be only considered to be some indication for the correctness of the algorithm. 199
6. Conclusion The real time traffic incident detection is crucial for effective road traffic management [12]. In this paper, we presented our novel approach to real time traffic incident detection which uses Complex Event Processing (CEP) [5][13][14]. CEP allows us to implement various pattern recognition algorithms for multiple data streams in a SQL-like programming language called EPL easily and to modify them dynamically. We showed that the CEP-based approach is effective by implementing the APID algorithm in EPL. We tested the EPL implementation of the APID algorithm with real traffic data and incident reports from Korea Expressway Corporation [15]. 7. Acknowledgments This research was supported by MSIP (Ministry of Science, ICT and Future Planning), Korea, under the ITRC (Information Technology Research Center) support program (NIPA-2013-(H0301-13-1012)) supervised by the NIPA (National IT Industry Promotion Agency). We would like to thank the Expressway and Transportation Research Institute for providing us with their traffic data for this research. We would also like to thank Dr. Keun Young Lee and Milan Kang, PhD student, for checking the EPL code and reading this article. 8. References [1] http://en.wikipedia.org/wiki/intelligent transportation_system. [2] N. Museux, J. Mattioli, C. Laudy, H. Soubaras, "Complex Event Processing Approach for Strategic Intelligence" in Information Fusion, 2006 9 th International Conference on 10-13 July 2006. [3] http://www.raiproducts.com/vehicle-detection-systems.html. [4] D. Luckham: Power of Events. Addison-Wesley, Reading (2001). [5] D. Anicic, P. Fodor, R. Stuhmer, N. Stojanovic, "Event-Driven Approach for Logic-Based Complex Event Processing" in Computational Science and Engineering, CSE 9, International Conference on 29-31 Aug. 2009. [6] Esper.ESPERTECH: Esper Reference Documentation, Version 4.6.0 Technical Report: http://esper.codehaus.org/. [7] OnurDeniz, HilmiBerkCelikoglu, Gurka n EmreGurcanli "Overview to some Incident to Some Incident Detection Algorithms: A Comparative Evaluation with ISTANBul Freeway Data" Proceedings of the12 th International Conference Reliability and Statistics in Transportation and Communication (RelStat 12), 17 20 October 2012, Riga, Latvia, p. 274 284. ISBN 978-9984- 818-49-8Transport and Telecommunication Institute, Lomonosova 1, LV-1019, Riga, Latvia. [8] H. J. Payne and S. C. Tingor, "Freeway incident detection algorithm based on decision tree with states," Transportation Research Record, vol. 782, pp. 378-382, 1978. [9] H. Philip, Masters, K. Josehp, Lam and Kam Wong, " Incident Detection Algorithms for Compass An Advanced Traffic Management System" in Vehicle Navigation and Information System Conference, 1991, page 295, 310. [10] http://en.wikipedia.org/wiki/gyeongbu_expressway. [11] http://www.roadplus.co.kr/page.do?mcode=a010010. [12] Y. Shunxin, N. Fujian, W. Wei, "Freeway Incident Management System Application in Jiangsu, China" Proceedings of the 2007 IEEE "Intelligent Transportation Systems Conference" on Sept. 30- Oct. 3, Seattle, WA, USA, p.76-80. ISBN 987-1-4244-1396-6. [13] J. Dunkel, A. Fernandez, R. Ortiz, R. Ortiz, S. Ossowski, "Event-Driven Architecture for Decision Support in Traffic Management Systems". 11 th Inter. IEEE Conf. on Intelligent Transportation Systems. 2008, pp. 7-13. [14] J. Dunkel, "On Complex Event Processing for Sensor Networks in Autonomous Decentralized System International Symposium on 23-25 March 2009. [15] http://research.ex.co.kr/en/index.jsp. 200