A Real-Time Autonomous Highway Accident Detection Model Based on Big Data Processing and Computational Intelligence
A. Murat Ozbayoglu Gokhan Kucukayan Erdogan Dogdu
cs.AI stat.ML 68TXX












































A Real-Time Autonomous Highway Accident Detection Model Based on Big Data Processing and Computational Intelligence
    
Murat Ozbayoglu 
Computer Engineering Department

TOBB Univ. of Economics and Tech.

Ankara, Turkey

Email: mozbayoglu@etu.edu.tr
Gokhan Kucukayan
Computer Engineering Department

TOBB Univ. of Economics and Tech.

Ankara, Turkey

Email: gokhankucukayan@gmail.com
Erdogan Dogdu
Computer Engineering Department

TOBB Univ. of Economics and Tech.

Ankara, Turkey

Email: erdogandogdu@gmail.com

    December 30, 2023
=============================================================================================================================================================================================================================================================================================================================================================================================================







Due to increasing urban population and growing number of motor vehicles, traffic congestion is becoming a major problem of the 21st century. One of the main reasons behind traffic congestion is accidents which can not only result in casualties and losses for the participants, but also in wasted and lost time for the others that are stuck behind the wheels. Early detection of an accident can save lives, provides quicker road openings, hence decreases wasted time and resources, and increases efficiency. In this study, we propose a preliminary real-time autonomous accident-detection system based on computational intelligence techniques. Istanbul City traffic-flow data for the year 2015 from various sensor locations are populated using big data processing methodologies. The extracted features are then fed into a nearest neighbor model, a regression tree, and a feed-forward neural network model. For the output, the possibility of an occurrence of an accident is predicted. The results indicate that even though the number of false alarms dominates the real accident cases, the system can still provide useful information that can be used for status verification and early reaction to possible accidents.











Traffic flow, big data, accident detection, intelligent transportation systems, neural networks, nearest neighbor, regression tree, computational intelligence, machine learning, IoT, sensors.

















§ INTRODUCTION


Disruption of normal traffic flow results in wasted time, higher fuel costs and lost productivity. Officials are working around the clock to finish the regular maintenance activities as quickly as possible to keep the roads open and provide safe traffic flow. Meanwhile, traffic accidents are among the most important causes that disrupt the normal traffic flow. 

Preventing an accident is important, however it is very difficult, if not impossible to provide an accident-free road vehicle transportation system. Even though it may not be possible to avoid accidents altogether, early detection of and reaction to accidents are very important in saving lives and reducing accident-related costs. This study aims to provide such a system where real-time traffic-flow data is monitored and the occurrence of accidents is predicted before any official accident notification arrives from the scene. This can for example help city governments to dispatch emergency teams to prospective accident-prone areas, prevent accidents by taking extra-measures, manage costs efficiently, and be well prepared for future events in general.

After this brief introduction, the rest of the paper is as follows. In Section 2, the related studies regarding traffic flow, traffic accident detection using different approaches, methodologies are provided. The data, domain and big data processing techniques used in this study are explained in Section 3 followed by Section 4 that gives the data analysis and feature extraction details. The results and the discussions are provided in Section 5. We conclude and provide open problems and future direction in Section 6.
























































































§ PREVIOUS WORK


There are a lot of studies about traffic and transportation systems; however most of them are concentrated on infrastructure development, enhancements on physical infrastructures, etc. Meanwhile some studies focus on some particular intelligent transportation system components such as the topics of accident prevention, traffic flow estimation, event detection, route optimization, etc. These aforementioned studies are mostly of our concern.

In one study, Lee concentrated on analyzing traffic data quality collected through various road sensors and observed the difficulties of obtaining error-free, reliable data <cit.>. He provided methods for detecting some of these errors and tested these models using real data. Wang suggested using Road Traffic Microwave Sensors (RTMS) for more reliable traffic data for Traffic Management Systems and covered some examples that are being used in Ontario <cit.>. 

Masters et al  <cit.> analyzed an early traffic event detection system called COMPASS, implemented in Toronto area, which was based on algorithms using density, road occupancy and velocity aiming to detect anomalies from the data.  Feng et al <cit.> used similar data to calculate the average trip time using Bayes model. Pascale et al <cit.> concentrated on road capacity calculations and suggested methods to increase efficiency. 

There are also some studies based on image and video processing techniques that rely on data obtained through CCTV cameras <cit.>. The advantage of these systems is the possibility of observing different types of vehicles and their behaviors.

Vehicle Ad Hoc Networks are also used in traffic data collection models <cit.>, but maintaining the communication and data feed is not easy under different road conditions.

Researchers also study traffic flow and event/accident detection. Baiocchi et al <cit.> suggested a traffic flow estimation system using GPS data and obtained successful results. In a similar study Terroso-Saenz et al <cit.> estimated the flow density. 

Hojati et al <cit.> provided a model for estimating the surpassed time interval between the occurrence of an accident and clearing it depending on different road conditions and infrastructure differences.   
Computational intelligence techniques have also been part of some of the proposed systems for traffic flow estimation, accident detection, etc. Neural networks <cit.>, Support Vector Machines <cit.> and Hidden Markov Model <cit.> are used in these studies. 

In this study, we propose a model for accident detection using three separate computational intelligence techniques. Moreover, the model inputs are obtained using big data processing techniques in order to have scalability and real-time implementation capability. The main motivation for this approach is to be able to provide a real-time traffic monitoring system that can detect accidents immediately after the incident in order to take the necessary precautions as early as possible.



§ DATA PROCESSING




 §.§ Traffic Data


The data used in this study is provided by Istanbul Municipal Traffic Control Department[http://isbak.istanbul/intelligent-transportation-systems/]. The dataset consists of 2015 calendar year traffic flow data obtained from 7 separate RTMS (Real-Time Monitoring System) sensors on one of the major highways (TEM-Trans European Motorway). The location of the sensors can be seen in Figure <ref>. The distance between the first and the last sensor is almost 15 miles. 



There are approximately 400 sensors that feed data throughout the city area, however to implement the preliminary version of our model, we chose to isolate the data from these aforementioned sensors. The main reason for this particular choice is due to the fact that there are no traffic lights, stop signs, sharp curves, etc. on that section of the highway. Hence, our assumption was if any slowdown or stoppage is seen in the traffic, it should be due to a disruption on the road (an accident, road work, handicapped car, etc.).

The following data items are collected every 2 minutes through the sensors from each lane separately: 

    
  * Number of cars passing every 2 minutes.
    
  * Average speed of the vehicles in the last 2 minutes.
    
  * Average occupancy ratio of the lane in the last 2 minutes.
    
  * Date/Time information.


Also, from the Traffic Department Database, the information about the accidents/disruptions, etc. are extracted. In the calendar year 2015, 72 incidents (events) were observed in that particular section of the highway. Figure <ref> shows all instances in the neighborhood including the 72 incidents that are used in our study.



The event database has the date/time, the location and the basic description of the incidents including the direction and the type of incident (serious accident, minor accident, road work, handicapped car, etc.). 



 §.§ Big Data Processing


The raw data acquired from the Traffic Department is not usable in its existing format due to the amount of the data and some inconsistencies in the syntax and content.  The total amount of collected information for one year from all sensors consists of more than 100 million rows of structured and unstructured data. 

Meanwhile, a lot of preprocessing on the raw data was necessary in order to standardize the featured data. Some of the major problems that were faced during the preprocessing are due to the fact that each sensor sends its own version of data, the number of incoming and outgoing lanes were not known, etc. In addition, some of the lane data is non-existent, missing or showing 0 or NULL value from time to time. For example, there might be lane closures, the sensors might be obstructed by a leaf, paper, or the sensor might be malfunctioning. 

In order to process this type of problematic data and extract the features accordingly, big data processing techniques are adapted. The acquired raw data is passed through an ETL (Extract-Transform-Load) process through HDFS and Apache Spark. The original data is stored in SQLServer format and imported to Hadoop environment via Sqoop (Figure <ref>).



The imported data is then processed on a 10-PC cluster using Spark and HDFS. The individual lane data are averaged in order to get a single directional feature. Also the inconsistencies within the data are eliminated accordingly. 



§ DATA ANALYSIS AND FEATURE EXTRACTION


The processed data is further analyzed to utilize the daily routines, seasonal behaviors and weekday/weekend effects. Even though this particular section of the highway is not close to downtown or city center, the traffic is still congested most of the time during rush hour on weekdays. The traffic flow pattern on one of these sensors observed only for Mondays for one direction is shown in Figure <ref>.



In Figure <ref>, it can be seen that average velocity is around 110 km/h, but during rush hours (especially in the morning), it slows down considerably. Evening rush hour is not noticeable for this particular sensor, this indicates the traffic direction is mostly into the city in the mornings, but not in the evenings.

Since time of day is an important factor for traffic flow, we decided to use it for our decision model. Also, while analyzing the data we observed the average velocity drops suddenly when the traffic is congested (occupancy ratio goes higher) indicating the vehicles come to a stopping point, or the traffic is now moving very slowly. With that, the number of cars passing (every 2 minutes) goes down. In order to quantify this phenomena, we decided to include the “road capacity” factor in our model. Road capacity basically provides the maximum number of vehicles that can pass within a given time period. We used the following relational formula for road capacity:


    Road Capacity ≈# passing cars (every 2 minutes) * avg. velocity


We also observed that the average velocity is topped around 120-130 km/h regardless of the time, number of cars passing and road occupancy. As a result the road capacity is bounded. This information can be very useful for the prediction of traffic jam. 



 §.§ Feature Extraction


The data from the sensors and the event logs are combined together to extract the most appropriate features for the accident detection model. After careful analysis, we observed that the differences of velocities, number of passing cars and capacity usage between consecutive readings are more important than the actual values. As a result, we decided to use the differential feature values. The selected features are as follows:


    
  * Average Velocity difference between reading at time T and T+1.
    
  * Average Occupancy difference between reading at time T and T+1.
    
  * Average Capacity usage difference between reading at time T and T+1.
    
  * Weekday/Weekend (1 for Weekday, 0 for Weekend)
    
  * Rush Hour (1 full rush hour, 0 late night traffic, other values depend on then time of day)
    
  * Occurence of Accident/event (0 Normal traffic, 1 Accident/event)


The first 5 features are used as model inputs, the last one is the output feature that is to be classified by the selected model.



§ ACCIDENT DETECTION MODEL


Three different computational intelligence models are analyzed for accident detection. The selected models are nearest neighbor, regression tree, and feedforward neural networks. 

Nearest neighbor is one of the simplest classifiers that has been widely used for pattern recognition/classification problems <cit.>. There is actually no learning involved in the algorithm. The model uses a number of representative data points for reference purposes, then it labels the new incoming data to the class of the nearest reference point based on their proximity in the input vector space. Euclidean distance is mostly used as the metric for this model. 

Regression tree is another simple classifier that uses the entropy and/or class variance  information for machine learning problems <cit.>. The model consecutively selects the feature that best separates the classes based on minimum entropy principle. After each step, the remaining data within the branch is recursively processed through the same algorithm. As a result, a tree is formed. When a new data is introduced, the tree is traversed by answering a bunch of Yes/No questions at each step, until the corresponding class is found.

Feedforward neural networks are commonly used in complex nonlinear data mapping, function approximation, machine learning, and classification problems <cit.>. There are many different implementations of neural networks in various different application areas. The basic principle behind such a model is to find the optimum weight values between the neurons that best match the input-output relations. Backpropagation learning algorithm is by far the most widely used method in network weight update process by error minimization at the output through iterations.

In this study, these three models are used for accident detection problem. There are 72 accident/event reports available for the year 2015 for the aforementioned highway section. A total of 276,354 data points are used for the model. Since the data was highly imbalanced, we used 130 data points for training for nearest neighbor and regression tree (of which 58 of them belong to the accidents). For the feedforward neural network model we used 100 data points for training, of which 42 of them belong to the accidents, 30 data points for cross validation, of which 16 of them belong to the accidents. The remaining data was used for testing purposes, of which there were 14 accidents and 276,224 non-accidents.  The confusion matrices of the test data for each model are tabulated in the following tables. Since the number of false alarms (model predicts an accident, but  actually there is none) is a lot, different loss threshold values are selected to find a trade-off between the false alarms and actual accident cases. The Tables <ref>-<ref> represent these different cases. Table <ref> provides the performance summary of these different selections. In the table TPR=TP/(TP+FN), TNR=TN/(TN+FP), PPV=TP/(TP+FN), NPV=TN/(TN+FN), and Accuracy=(TP+TN)/(TP+TN+FP+FN) where TP is true positives (accidents predicted as accidents, FN is false negatives (accidents predicted as non-accidents), FP is false positives (non-accidents predicted as accidents), and TN is true negatives (non-accidents predicted as non-accidents). 



















The results indicate that all models are very good in catching accidents, however the number of false positives are considerably high. When we increase the bias towards reducing these false alarms, the positive recall value starts going down, that is the trade-off we need to deal with. For example the last model presented in Table <ref>, has only 580 false alarms overall, however, with that setting, more than half of the accidents were not caught by the model.

New separate features may be included in the system that might improve the overall performance. Some delay can be introduced, so the sensor readings some time after the occurrence of the accidents can  be presented to the system, it might help in prediction performance, but it also results in the more delayed response time for the officials. More analyses need to be performed to achieve the best possible outcome.

One other problem is the involvements of the human factor in such a problem. We have realized, and told by the experts, that some minor problems on the road (some slippery point on the highway that causes the vehicles to slow down, an unreported minor accident, a handicapped car, unreported road work, suddenly changed weather conditions, etc.) might cause abnormal sensor readings, even sometimes the sensor readings themselves might have problems. According to the domain experts, these problems exist in their systems and some of the false positive data can be due to these cases. It is very difficult to come up with a clean data collection system; even if we eliminate the outliers totally, we will still have a lot of unconventional data points that are different than normal traffic flow. Engineers and data scientists will be constantly working on these type of issues in order to have better classifier models. Meanwhile, our models present preliminary results, but they can still be useful in the sense that, even though there are a lot of false alarms, just checking the status does not cost anything, however if there is actually an accident, it can assist a lot of people much faster. Just an example, Model 8 catches almost half of the accidents, and by average it gives between 1.5 false alarms per day. That might be a satisfactory system that the traffic department can tolerate. 



§ CONCLUSION


In this study, we implemented an automated accident detection system based on computational intelligence techniques. The data belongs to 2015 Istanbul highway sensor readings and traffic database. The data is processed and consolidated using big data processing techniques. Several different computational intelligence models are adapted and tested. Even though the number of false alarms is considerably high, the overall accuracy of the models are mostly over 99%. This can provide early response to the accidents and save lives and valuable time/resources. The preliminary results indicate that it might be possible to use such a system in real-time at the Traffic Departments. For future work, it might be possible to add other independent features such as meteorological parameters, road topology information,relative location and/or condition of the road (direction of the sun, nearby buildings, road signs, service roads, inclination, existence of emergency lanes, etc.). Also more analyses need to be performed on the data itself, domain experts can be involved in the careful elimination of outlier points. Other machine algorithms can be adapted. The model can be represented as a time series problem, time warping can be used, recurrent neural network models can be implemented. Finally, the results from a combination of different approaches can be consolidated to have better prediction performance.














































































[
    < g r a p h i c s >
]John Doe




















