Road Accident Forecasting With Machine Learning: A Minor Project On
Road Accident Forecasting With Machine Learning: A Minor Project On
A MINOR PROJECT ON
Submitted By
I
DDDD
CERTIFICATE
This is to certify that the project entitled “ROAD ACCIDENT FORECASTING WITH
MACHINE LEARNING” is being submitted by J. VAMSHI REDDY (20E41A0538), D.
ANGEL JASMINE (20E41A0548), Y. RISHITHA (20E41A0520), M.SRAVAN
(20E41A0519), in partial fulfilment of the requirements for the award of the degree of
B.Tech in Computer Science and Engineering to the Jawaharlal Nehru Technological
University Hyderabad, is a record of bonafide work carried out by him/her under our
guidance and supervision during the year 2023-24.
The results embodied in this thesis have not been submitted to any other University or
Institute for the award of any degree or diploma.
HOD Principal
Mr S. Krishna Reddy
Internal Guide External Examiner
II
DDDD
III
DDDD
DECLARATION
The results embodied in this project report have not been submitted to any other
University or Institute for the award of any Degree or Diploma.
IV
DDDD
ACKNOWLEDGEMENT
Apart from our efforts, the success of any project depends largely on the
encouragement and guidelines of many others. We take this opportunity to express
our gratitude to the people who have been instrumental in the successful
completion of this project.
We take this opportunity to express my profound gratitude and deep regard for my
guide S. Krishna Reddy, Assistant Professor for his exemplary guidance,
monitoring and constant encouragement throughout the project work. The blessing,
help and guidance given by him shall carry us a long way in the journey of life on
which we are about to embark.
The guidance and support were received from all the members of Sree Dattha
Institute of Engineering and Science who contributed to the completion of the
project. We are grateful for their constant support and help.
Finally, we would like to take this opportunity to thank our family for their
constant encouragement, without which this assignment would not be completed.
We sincerely acknowledge and thank all those who gave support directly and
indirectly in the completion of this project
V
DDDD
LIST OF FIGURES
VI
DDDD
LIST OF SCREENSHOTS
VII
DDDD
TABLE OF CONTENTS
ABSTRACT iv
LIST OF FIGURES v
LIST OF SCREENSHOTS vi
1. INTRODUCTION 1
1.1 PROJECT SCOPE 2
1.2 PROJECT PURPOSE 2
1.3 PROJECT FEATURES 2
2. SYSTEM ANALYSIS 3
2.1 PROBLEM DEFINITION 4
2.2 EXISTING SYSTEM 4
2.2.1 LIMITATIONS OF THE EXISTING SYSTEM 5
2.3 PROPOSED SYSTEM 5
2.3.1 ADVANTAGES OF PROPOSED SYSTEM 5
2.4 FEASIBILITY STUDY 5
2.4.1 ECONOMIC FESIBILITY 6
2.4.2 TECHNICAL FEASIBILITY 6
2.4.3 BEHAVIORAL FEASIBILITY 6
2.5 HARDWARE & SOFTWARE REQUIREMENTS 6
2.5.1 HARDWARE REQUIREMENTS 6
2.5.2 SOFTWARE REQUIREMENTS 7
3. ARCHITECTURE 8
3.1 PROJECT ARCHITECTURE 9
3.2 DESCRIPTION 10
3.3 USECASE DIAGRAM 11
3.4 STATE CHART 12
3.5 ACTIVITY DIAGRAM 13
4. IMPLEMENTATION 14
4.1 SAMPLE CODE 15-17
5. SCREENSHOTS 18-23
6. TESTING 24
1
DDDD
2
DDDD
ABSTRACT
Road accidents pose a significant threat to public safety and are a major concern
for governments and transportation authorities worldwide. Timely and accurate
prediction of road accidents can help mitigate their impact by allowing for
proactive measures to be taken. This project aims to leverage the power of
machine learning (ML) to develop a road accident forecasting system that can
predict the likelihood of accidents occurring in specific areas and under various
conditions.
The project focuses on the collection and analysis of historical accident data, as
well as various environmental and traffic-related features, such as weather
conditions, road type, traffic density, and time of day. Utilizing a diverse dataset,
machine learning algorithms, including but not limited to decision trees, random
forests, and neural networks, will be employed to build predictive models.
3
DDDD
1.INTRODUCTION
4
DDDD
INTRODUCTION
The purpose of the project is to use computers to predict when and where road
accidents are likely to happen. This helps make roads safer by giving people
and authorities a heads-up to be more careful in those areas and at those times,
hopefully reducing accidents and keeping people safer on the road.
5
DDDD
2. SYSTEM ANALYSIS
6
DDDD
SYSTEM ANALYSIS
1. SYSTEM ANALYSIS
The existing system for "Road accident forecasting" relies on manual analysis of
historical accident data, occasional use of traffic cameras and sensors for
monitoring, and reactive measures like public awareness campaigns and accident
response. It lacks predictive capabilities and real-time integration. Transitioning to
a machine learning-based system would enable proactive accident prediction,
leveraging historical and real-time data to enhance road safety and resource
allocation.
7
DDDD
To avoid all these limitations and make the working more accurately
the system need the implemented efficiently.
The aim of proposed system for road accident forecasting utilizes data
integration, machine learning, and real-time monitoring to transition from a
reactive to a proactive approach to road safety. It integrates historical and real-
time data sources, deploys machine learning models for predictive analysis, and
offers early warnings and forecasts to prevent accidents. Resource allocation is
optimized, weather data is integrated, and public awareness campaigns are data-
driven. Enhanced accident reporting and consistent data collection practices
ensure efficiency, and ongoing performance evaluation maintains system
accuracy and effectiveness in accident prediction and safety enhancement.
The system is very simple in design and to implement. The system requires
very low system resources and the system will work in almost all configurations.
It has got following features
• Ensure data accuracy’s.
• Minimum time needed for the various processing.
• Greater efficiency.
• Better service.
• User friendliness and interactive.
The feasibility of the project is analyzed in this phase and business proposal is put
forth with a very general plan for the project and some cost estimates. During system
analysis the feasibility study of the proposed system is to be carried out. This is to
ensure that the proposed system is not a burden to the company. Three key
considerations involved in the feasibility analysis are
• Economic Feasibility
• Technical Feasibility
• Social Feasibility
8
DDDD
The developing system must be justified by cost and benefit. Criteria to ensure that
effort is concentrated on project, which will give best, return at the earliest. One of
the factors, which affect the development of a new system, is the cost it would
require.
The following are some of the important financial questions asked during
preliminary investigation:
Since the system is developed as part of project work, there is no manual cost to
spend for the proposed system. Also all the resources are already available, it give an
indication of the system is economically possible for development.
This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on
the available technical resources. The developed system must have a modest
requirement, as only minimal or null changes are required for implementing this
system.
The project would be beneficial because it satisfies the objectives when developed
and installed. All behavioral aspects are considered carefully and conclude that the
project is behaviorally feasible.
9
DDDD
10
DDDD
3. ARCHITECTURE
11
DDDD
3. ARCHITECTURE
Feature
Data Collection Data Processing
Engineering
Hyperparameter
Model Selection Model Training
Tuning
Real-time
integration and
deployment
12
DDDD
3.2 DESCRIPTION
i) Data Collection.
ii) Data Processing
iii) Feature Engineering
iv) Hyperparameter Tuning
v) Model Training
vi) Model Selection
vii) Real -Time integration and deployment
3. UML Diagrams:
(i) Use Case Diagram: Defines system functionalities, communicates with stakeholders,
gathers requirements, and aids in testing scenarios.
ii) State Chart: Models component behaviour, visualizes system states and
identifies error handling.
13
DDDD
14
DDDD
15
DDDD
16
DDDD
4. IMPLEMENTATION
5. IMPLEMENTATION
17
DDDD
Sample Code:
18
DDDD
data = {
'Weather': ['Clear', 'Rain', 'Snow', 'Clear', 'Rain', 'Clear', 'Snow', 'Clear', 'Rain',
'Rain'],
'Road_Condition': ['Dry', 'Wet', 'Icy', 'Dry', 'Wet', 'Wet', 'Icy', 'Wet', 'Icy', 'Wet'],
'Speed_Limit': [50, 40, 30, 50, 40, 45, 35, 55, 40, 45],
'Accident': [0, 1, 1, 0, 1, 1, 1, 0, 0, 1]
}
Result:
19
DDDD
20
DDDD
5. SCREENSHOTS
5. SCREENSHOTS
21
DDDD
22
DDDD
23
DDDD
Fig.5.7 Total number of accidents, injuries, and deaths caused due to defects in road
conditions per 1L people of that state
24
DDDD
25
DDDD
2014, 2016
6. TESTING
26
DDDD
6 TESTING
White Box Testing is a testing in which in which the software tester has knowledge of the inner
workings, structure and language of the software, or at least its purpose. It is purpose. It is used to
test areas that cannot be reached from a black box level.
Black Box Testing is testing the software without any knowledge of the inner workings,
structure or language of the module being tested. Black box tests, as most other kinds of tests, must
be written from a definitive source document, such as specification or requirements document, such
as specification or requirements document. It is a testing in which the software under test is treated,
as a black box. you cannot “see” into it. The test provides inputs and responds to outputs without
considering how the software works.
System testing ensures that the entire integrated software system meets requirements. It tests a
configuration to ensure known and predictable results. An example of system testing is the
configuration-oriented system integration test. System testing is based on process descriptions and
flows, emphasizing pre-driven process links and integration points.
27
DDDD
7.CONCLUSION
&
FUTURE SCOPE
28
DDDD
In conclusion, this project lays the foundation for a proactive approach to road
safety through machine learning.
By forecasting accidents based on historical data, we aim to contribute to a safer and more
secure road environment.
The successful implementation of this model opens doors to future enhancements and
collaborations, fostering a continuous effort towards minimizing accidents, saving lives,
and optimizing traffic management.
As we move forward, the insights gained from this project provide a valuable resource for
stakeholders and authorities to make informed decisions and implement preventive
measures effectively
Once our project is up and running, We might make the predictions happen in real-time,
so we can act quickly. We could team up with traffic systems to make our roads safer.
Imagine using more smart devices to get even better data. We could also try fancier
techniques to make our predictions super accurate. Working with local authorities, we
could put our findings into action and even create apps to keep people informed about
safety.
29
DDDD
8. BIBLIOGRAPHY
30
DDDD
8. BIBLIOGRAPHY
8.1 REFERENCES
[1]Zheng, Y., & Liu, L. (2019). Big data in transportation engineering: A survey.
Transportation Research Part C: Emerging Technologies, 96, 95-112.
[3] Ma, J., & Zhang, J. (2018). Review of the applications of big data in traffic
engineering. Advances in Mechanical Engineering, 10(12), 1687814018811402.
[4] Elhawary, H., & Al-Assadi, M. (2019). Accident prediction system using artificial
intelligence techniques: A review. In 2019 International Conference on Innovative Trends
in Communication and Computer Engineering (ITCE) (pp. 175-179). IEEE.
[5] Pulugurtha, S. S., & Sambhara, V. R. (2015). Road accident prediction models: A
review. Transportation Research Part C: Emerging Technologies, 57, 325-337.
[6] Zheng, Z., & Liu, X. (2018). Development of a real-time traffic accident prediction
model. In 2018 IEEE International Conference on Internet of Things (iThings) and IEEE
Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social
Computing (CPSCom) and IEEE Smart Data (SmartData) (pp. 663-669). IEEE.
[7] Pulugurtha, S. S., & Sambhara, V. R. (2015). Road accident prediction models: A
review. Transportation Research Part C: Emerging Technologies, 57, 325-337.
[8] Tay, R., & Ong, Z. (2019). Predicting road accidents in Singapore using a random
forest model. Accident Analysis & Prevention, 123, 85-95.
[9] Lai, L. S., Chen, C. F., & Hu, Y. C. (2013). Development of real-time accident risk
assessment model incorporating weather effect. Journal of Transportation Engineering,
139(1), 1-9.
[10] Borzacchiello, M. T., Cafiso, S., & Persaud, B. (2015). Evaluating the safety
performance of urban intersections in adverse weather conditions using artificial neural
31
DDDD
32