Road Accident Detection and Prediction System

DOI : 10.17577/IJERTV12IS030124
Download Full-Text PDF Cite this Publication

Text Only Version

 

Road Accident Detection and Prediction System

Asma Pathan 1, Siddhant Chhajed 2 , Utkarsh Shap , Sparsh Shah 4, Dr. Poonam Lambhate 5

1Asma Pathan, Dept. of Computer Engineering, Pune, Maharashtra, India 2Siddhant Chhajed, Dept. of Computer Engineering, Pune, Maharashtra, India 3Utkarsh Shah, Dept. of Computer Engineering, Pune, Maharashtra, India 4Sparsh Shah, Dept. of Computer Engineering, Pune, Maharashtra, India

5Dr. Poonam Lambhate, Dept. of Computer Engineering, Pune, Maharashtra, India

Abstract:- Traffic Hazards are one of the major problems facing across the world. The dense population and growing number of vehicles on the road are significant factors contributing to traffic hazards. Road accidents are a leading cause of death worldwide, and addressing traffic hazards is a significant challenge. Hence there is a need to provide better transportation facilities that can reduce the ratio of road accidents and save lives of people.

The project aims to develop an accident detection and prediction system using OpenCV and machine learning techniques. The system will utilize a camera to capture real-time video of the road, and OpenCV will be used to process the video and detect any potential accidents. Machine learning algorithms will then be applied to analyse the data and predict the likelihood of an accident occurring. The system will also have the capability to alert nearby emergency services in the event of an accident. The goal of the project is to improve road safety by providing advanced warning of potential accidents and enabling a quicker response time for emergency services.

Keywords:- OpenCV, Machine Learning, Accident, Random Forest, Convolutional Neural Network, Artificial Intelligence, Prediction, Detection, Fast R-CNN.

  1. INTRODUCTION

    Statistics show that the leading cause of death by injury is road traffic accidents. There are a number of causes for which an accident can occur, some of them are; use of mobile phones while driving, unskilled drivers, driving while intoxicated, bad road condition, overloading, and poor traffic management.

    Accident detection [1] and prediction systems have the potential to significantly improve road safety by detecting and predicting potential accidents in real-time. These systems utilize a combination of sensors and machine learning techniques to gather information about the environment and the vehicles or pedestrians within it. The goal of this system is to provide timely aid to the accident victims and reduce the number of accidents on the road by providing advanced warning to drivers, enabling them to take appropriate actions.

    In this paper, we propose and evaluate an accident detection and prediction system to be used as a mobile application, we will explore the various technologies and techniques that are used for detection and prediction. The system utilizes data from camera to detect and track vehicles, and uses machine learning algorithms to estimate the likelihood of potential accidents. The system’s performance is evaluated in a variety of test scenarios, including different lighting and weather conditions.

  2. LITERATURE SURVEY

    Rutik Desai [1] et al proposed a paper Accident Detection Using ML and AI Techniques, The objective of this project is to identify car crash accidents in videos through a multi-step process. Initially, a convolutional neural network known as YOLO algorithm is employed to locate cars in the video. Then, a tracker is utilized to keep an eye on each individual car. In the last stage, for every car, the Violent flow (VIF) descriptor in conjunction with a Support Vector Machine (SVM) is utilized to detect car crashes, resulting in an accuracy rate of around 89%.

    Kelvin Rinaldi [2] da Luz et al proposed a paper RoadLytics: Road Accidents Analytics Using Artificial Intelligence in which they used Machine learning Random Forest model for analysis of road accidents. Accuracy of the system was 85%. Afreen Fathima [3] et al proposed a paper Accident detection and alerting system. In which they built an Arduino based vehicle accident alert system using GPS, GSM and accelerometer. Accelerometer detects the sudden change in the axes of vehicle and GSM modules end the alert message on your Mobile Phone with the location of the accident. The coordinates of the accident site are provided via a Google Maps link, derived from the latitude and longitude from GPS module.

    Tejal Lengare [4] et al proposed a paper Accident Detection

    & Avoidance System in Vehicles in which their main idea was to avoid collision by sending alert to the used based on distance between him and obstacle, they used GPS and SMS module to detect location and provide alert.

    Farman Ali et al proposed Traffic accident detection and condition analysis based on social networking data they used various network-based and real time monitoring techniques to perform accident detection and traffic analysis. Their system outperforms state-of-the-art methods and achieves accuracy of 97 %.

  3. MOTIVATION AND PROBLEM DEFINITION

    As the number of vehicles on the road increases at a faster rate than population growth and economic development, the number of accidents and resulting deaths, particularly involving two-wheeled vehicles, are also rising alarmingly. Many deaths from these accidents occur due to the lack of prompt medical assistance, particularly on expressways. A system that can quickly alert nearby medical facilities of an accident and its severity could greatly reduce fatalities. This is the idea behind a detection and prediction system that detects accidents and sends notifications to nearby emergency centre to dispatch ambulances or other medical aid to the scene as well as it predicts potential accidents.

  4. DESIGN AND METHODLOGY

    An accident detection system uses CCTV cameras to capture footage of the road. The system then processes the video by breaking it down into individual frames for analysis. If an accident is detected, the system will identify the location of the accident and send an alert to rescue systems through an application. In addition, the system will also save the location data, video, and images for future use in accident prediction and analysis.

    Fig 1. System Architecture

    1. DETECTION

      For accident detection using OpenCV, the CCTV footage would be fed into the system and processed using OpenCV libraries. The video would be broken down into individual frames, and each frame would be analysed for any signs of an accident such as sudden changes in motion or unusual activity. [3] The OpenCV algorithms would then be used to identify and analyse specific features in the frames such as vehicles, pedestrians, and road signs. If an accident is detected, the system would use the OpenCV libraries to determine the location of the accident. This location information would then be sent to rescue systems through an application.

      Fig 2. Detection using OpenCV

      Fig 3. Accident Frame

    2. PREDICTION

      For accident prediction, the system will use the data that has been collected and saved from previous accidents, as well as real-time data such as weather conditions, traffic patterns, and road conditions. The system will use machine learning algorithms to analyse this data and identify patterns or trends that indicate a high likelihood of an accident occurring in a certain area or under certain conditions. This information can then be used to issue warnings or alerts to authorities and individuals in the area, as well as to adjust traffic flow or other measures to mitigate he risk of an accident. Additionally, the system may also use historical data to train the predictive model and making it better in predicting future accident with high accuracy.

    3. ALGORITHMS USED
      1. Fast R-CNN: Fast R-CNN is a method for object detection in images or videos, which is a type of deep learning algorithm. It can be used in accident detection to detect and classify objects such as vehicles, pedestrians, and road signs in real-time video feeds from cameras mounted on vehicles or along the road. The model can be trained on a dataset of images of accidents to improve its ability to detect and classify objects in new images. The output of the model can then be used to trigger automatic alerts or to assist human operators in monitoring traffic and identifying potential accidents.

        Fig 4. Fast R-CNN

      2. Logistic Regression: In the context of accident prediction, logistic regression can be used to model the relationship between a binary outcome variable (e.g.,

        whether an accident occurred or not) and one or more predictor variables (e.g., weather conditions, road conditions, time of day, etc.). [2] By analysing historical data on accidents and their associated predictor variables, a logistic regression model can be trained to predict the probability of an accident occurring given a set of predictor variable values. The logistic regression model can be used to identify factors that are most likely to contribute to accidents, such as poor weather conditions or reckless driving behaviour. It can also be used to make predictions about the likelihood of accidents occurring in the future, which can inform decisions about traffic safety and infrastructure improvements.

        The basic working of logistic regression is as follows:

        • The logistic regression model takes one or more predictor variables (also known as independent variables) and uses them to predict a binary outcome variable (also known as the dependent variable).
        • The logistic regression model uses the logistic function (also known as the sigmoid function) to model the probability of the outcome variable being a certain class. The logistic function transforms an input value into a probability value between 0 and 1, indicating the likelihood or chance of an event occurring.
        • The logistic regression model estimates a set of parameters (also known as coefficients) for each predictor variable. These parameters indicate the strength and direction of the relationship between each predictor variable and the outcome variable.
        • The logistic regression model uses the estimated parameters and the predictor variable values to make predictions about the outcome variable. For example, given a set of predictor variable values, the model can predict the probability of an accident occurring.
        • The logistic regression model is trained using a dataset of historical observations. The parameters are estimated by finding the values that maximize the likelihood of the observed data, given the model.
        • Once we train the model, it can be used to make predictions new data. The model can be used for both linear and non-linear classification problems, and it can handle both continuous and categorical predictor variables.
        • The performance of the model can be evaluated by various metrics such as accuracy, precision, recall, f1- score, ROC AUC, etc. Based on the evaluation metric, the model can be fine-tuned by adjusting the parameters and regularization term.
      3. Random Forest: Random Forest is an ensemble machine learning algorithm that can be used in accident detection and prediction systems. It is an extension of

        the decision tree algorithm and combines multiple decision trees to improve the accuracy of predictions. Random Forest can be used in accident detection and prediction systems in a similar way to decision trees. The algorithm is trained on historical accident data, where each data point is represented by a set of features such as time of day, weather conditions, road conditions, and a corresponding outcome or class such as whether or not an accident occurred. The algorithm then uses the learned model to predict the outcome for new, unseen data points.

        Fig 5. Random Forest

        The following steps explain the working of Random Forest Algorithm:

        • Randomly select samples from the training set: The Random Forest algorithm starts by randomly selecting samples (with replacement) from the given training data to create a subset of the original data. This is known as bootstrap aggregating or “bagging.”
        • Construct decision trees: For each subset of data, the algorithm constructs a decision tree. A decision tree is a type of supervised learning algorithm that makes a decision based on a series of yes/no questions about the features of the data.
        • Voting or averaging: Once the decision trees are constructed, they each make a prediction based on the features of the input data. The predictions from each tree are combined through a process called voting or averaging, where the algorithm takes the most common or average prediction from all the decision trees.
        • Final prediction: The most common or average prediction from all the decision trees is then

          chosen as the final prediction. This process helps to reduce the risk of overfitting, which is when the model performs well on the training data but poorly on new, unseen data.

      4. Decision Trees: Decision Trees can be used in accident detection and prediction systems by analysing historical accident data. [2] The algorithm can be trained to identify patterns and relationships between different factors, such as time of day, weather conditions, road conditions, and vehicle types, and the likelihood of an accident occurring.
  5. EVALUATIONS AND RESULTS

    The proposed programmed accident detection system can be a rescuer of life for people who met with accidents. The proposed system is exceptionally easy to understand and even a non-specialized Person can use it without any problem. The system consists of equipment and programming segments. The equipment system consists of a camera, and a CPU to use as a controller, and the programming segment part is an application introduced in driver’s Smartphones that is used to get the point- by-point map.

    Detection: The Fast R-CNN algorithm detects the vehicles and obstacles with almost 95% accuracy and hence increases the overall accuracy of the accident detection.

    Fig 6. Different Object Detection Techniques

    Prediction: Machine learning algorithms like [2] Random Forest and Decision trees work together and use the dataset to predict the potential accidents. The accuracy of accident prediction using a random forest model can vary depending on the specific dataset and parameters used. In our system random forest algorithm is able to achieve high accuracy rates when predicting accidents. However, accuracy alone is not always the best metric to evaluate the performance of a model, especially in safety-critical applications like accident prediction. Other factors like precision, recall, and F1 score are also quite satisfactory. Our system achieves following scores: Precision = 0.91, Recall = 0.85 and F1-Score = 0.88.

    Fig 7. Accident Detection Result 1

    Fig 7 shows the analysis of traffic on the road and check the percentage of accident and dense traffic detected. Here in this image since no accident has occurred so percentage

    is 9.411% , and the traffic is dense.

    Fig 8. Accident Detection Result 2

    In fig 8 the accident is detected therefore the system shows percentage of accident detection as 99.94%.

    Fig 9. SMS Alert

    SMS ALERT: Fig 9 shows the sent SMS which contains the location where accident has occurred.

    Fig 10. Accidents by area.

    Fig 10 shows the insights which includes the percentage of accidents occurring in urban and rural areas.

  6. CONCLUSION

    In conclusion, this study has proposed and evaluated a road accident detection and prediction system using machine learning techniques. The system utilizes data from cameras to detect and track vehicles and pedestrians, and uses prediction algorithms to estimate the likelihood of potential accidents. The results of the evaluation indicate that the system is able to accurately detect and predict accidents in a variety of test scenarios, with a high accuracy, low false positive rate, and low false negative rate.

    Additionally, the results show that the system is able to perform well in different environments, including different lighting and weather conditions. However, it’s important to note that this system is not able to handle all cases and further research and development are needed in order to improve the systems robustness and reliability.

    Future work includes incorporating additional sensors such as radar, and testing the system in different types of vehicles and infrastructure. Additionally, incorporating more sophisticated machine learning techniques, such as deep learning, could improve the accuracy and robustness of the system. Overall, the proposed accident detection and prediction system using machine learning has the potential to significantly improve road safety and reduce the number of accidents on our roads.

  7. REFERENCES
[1] Rutik Desai, Akash Jadhav, Suraj Sawant , Neha Thakur “Accident Detection Using ML and AI Techniques” 2021 IEEE.

[2] Kelvin Rinaldi da Luz, João Elison da Rosa Tavares, Jorge Luis Victória RoadLytics: Road Accidents Analytics Using Artificial Intelligence Engpaper Journal 2021.

[3] Afreen Fathima, Samreen Jameel, Pathan Ahmed Accident detection and alerting system Engpaper Journal.

[4] Tejal Lengare, Pallavi Sonawane, Prachi Gunjal, Shubham Dhire Accident Detection & Avoidance System in Vehicles Engpaper Journal.

[5] Farman Ali, Amjad Ali, Muhammad Imran, Kyung-SupKwak “Traffic accident detection and condition analysis based on social networking data ScienceDirect 2020.

[6] V. Machaca, Arceda E., Laura Riveros. Fast Car Crash Detection in Video. Oct-2018.

[7] Deeksha Gour, Amit Kanskar. Automated AI based road traffic Accident alert system. Sep-2019.

[8] Vaishnavi Ravindran, Lavanya Vishwanathan, Dr. Shanta Rangaswamy. A novel approach to Automatic Road Accident detection using machine vision techniques.

[9] Sreyan Ghosh, Sherwin Joseph Sunny, Rohan Roney. Accident Detection using Convolutional Neural Network.

[10] Akbarzhon Madaminov, Recommendation Systems, Engpaper Journal

[11] Rania Fernando, IoT based Street Light Controlling System,

Engpaper Journal

[12] K. SAI BHARGAV, V. RAJENDRA, Study on Data Structures for Machine Learning, Engpaper Journal

[13] GOV.BR. Open Data – Federal Highway Police. http://portal.prf.gov.br/dados-abertosacidentes, 2020. Access date: February 2021.

[14] SP, I. Deaths by traffic cars accident growing in the São Paulo state. www.infosiga.sp.gov.br/, 2021. Access date: March 2021.

[15] Inada, H.; Ashraf, L.; Campbell, S. COVID-19 lockdown and fatal motor vehicle collisions due to speed-related traffic violations in Japan: a time-series study. Injury Prevention 2021, 27, 98100. doi:10.1136/injuryprev-2020-043947.

[16] Andrade, F.R.d.; Antunes, J.L.F. Trends in the number of traffic accident victims on Brazils federal highways before and after the start of the Decade of Action for Road Safety. Cadernos de Saúde Pública [online] 2019, 35. doi:doi.org/10.1590/0102-311X00250218.

[17] WHO. Road traffic injuries. www.who.int/news-room/fact- sheets/detail/road-traffic-injuries, 2020. Access date: March 2021.

[18] Gopalakrishnan, S. A public health perspective of road traffic accidents. Journal of family medicine and primary care 2012, 1, 144 150. 24479025[pmid], doi:10.4103/2249-4863.104987.

[19] da Rosa Tavares, J.E.; Victória Barbosa, J.L. Apollo SignSound: an intelligent system applied to ubiquitous healthcare of deaf people. Journal of Reliable Intelligent Environments 2021, 7, 157170. doi:10.1007/s40860-020-00119-w.

[20] Benbarrad, T.; Salhaoui, M.; Kenitar, S.B.; Arioua, M. Intelligent Machine Vision Model for Defective Product Inspection Based on Machine Learning. Journal of Sensor and Actuator Networks 2021, 10. doi:10.3390/jsan10010007.

[21] Aranda, J.A.S.; Bavaresco, R.S.; Carvalho, J.V.D.; Yamin, A.C.; Tavares, M.C.; Barbosa, J.L.V. A computational model for adaptive recording of vital signs through context histories. Journal of Ambient Intelligence and Humanized Computing 2021. doi:10.1007/s12652- 021-03126-8.

[22] Barbosa, J.; Tavares, J.; Cardoso, I.; Alves, B.; Martini, B. TrailCare: An indoor and outdoor Context-aware system to assist wheelchair users. International Journal of Human-Computer Studies 2018, 116, 1

14. doi:https://doi.org/10.1016/j.ijhcs.2018.04.001.

[23] Tavares, J.; Barbosa, J.; Cardoso, I.; Costa, C.; Yamin, A.; Real, R. Hefestos: an intelligent system applied to ubiquitous accessibility. Universal Access in the Information Society 2016, 15, 589607. doi:10.1007/s10209-015-0423-2.

[24] Lopes, H.; Pires, I.M.; Sánchez San Blas, H.; García-Ovejero, R.; Leithardt, V. PriADA: Management and Adaptation of Information Based on Data Privacy in Public Environments. Computers 2020, 9. doi:10.3390/computers9040077.

[25] Leithardt, V.; Santos, D.; Silva, L.; Viel, F.; Zeferino, C.; Silva, J. A Solution for Dynamic Management of User Profiles in IoT Environments. IEEE Latin America Transactions 2020, 18, 11931199. doi:10.1109/TLA.2020.9099759.

[26] Ministry, H. Health Portal – SUS. http://www2.datasus.gov.br, 2021.

Access date: April 2021.

[27] Cartus, A.R.; Bodnar, L.M.; Naimi, A.I. The Impact of Undersampling on the Predictive Performance of Logistic Regression and Machine Learning Algorithms: A Simulation Study. Epidemiology 2020, 31.

[28] Mokoatle, M.; Marivate, V. Collision Course: Challenges with Road Traffic Accident Data in South Africa. 2018 International Conference on Advances in Big Data, Computing and Data Communication Systems (icABCD), 2018, pp. 16.

doi:10.1109/ICABCD.2018.8465419.

[29] Mazouri, F.Z.E.; Abounaima, M.C.; Najah, S.; Zenkouar, K. Data mining for road accident analysis in a big data context. EAI, 2019. doi:10.4108/eai.24-4-2019.2284124.

[30] Chen, C. Analysis and Forecast of Traffic Accident Big Data. ITM Web Conf. 2017, 12, 04029. doi:10.1051/itmconf/20171204029.