0% found this document useful (0 votes)
53 views

Road Accident Forecasting With Machine Learning: A Minor Project On

This document is a project report on road accident forecasting using machine learning. It was submitted by 4 students - J. Vamshi Reddy, D. Angel Jasmine, Y. Rishitha, and M. Sravan - to partial fulfillment of their master's degree in computer science and engineering at Sree Dattha Institute of Engineering and Science. The project was done under the guidance of Mr. S.Krishna Reddy. The report includes an introduction, system analysis, architecture, implementation details, screenshots of the system, testing approach, and conclusion.

Uploaded by

gurramvital1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Road Accident Forecasting With Machine Learning: A Minor Project On

This document is a project report on road accident forecasting using machine learning. It was submitted by 4 students - J. Vamshi Reddy, D. Angel Jasmine, Y. Rishitha, and M. Sravan - to partial fulfillment of their master's degree in computer science and engineering at Sree Dattha Institute of Engineering and Science. The project was done under the guidance of Mr. S.Krishna Reddy. The report includes an introduction, system analysis, architecture, implementation details, screenshots of the system, testing approach, and conclusion.

Uploaded by

gurramvital1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 39

DDDD

A MINOR PROJECT ON

ROAD ACCIDENT FORECASTING WITH MACHINE LEARNING


A report Submitted in partial fulfillment of the academic Requirement for the award of a degree of
MASTER OF TECHNOLOGY
IN
Computer Science and Engineering

Submitted By

J. Vamshi Reddy 20E41A0538


D. Angel Jasmine 20E41A0548
Y. Rishitha 20E41A0520
M. Sravan 20E41A0519

Under the Guidance of

Mr. S.Krishna Reddy


Assistant Professor, Department of CSE

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

SREE DATTHA INSTITUTE OF ENGINEERING AND SCIENCE

(Accrediated by NAAC, Affiliated to JNTUH, Approved by AICTE, New Delhi)

Recognised under section 2(f) of the UGCAct.1956,

Sheriguda (V), Ibrahimpatnam (M), Ranga Reddy – 501510.


2020-24

I
DDDD

SREE DATTHA INSTITUTE OF ENGINEERING &SCIENCE


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

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.

Dr.S.Venkata Achutha Rao Dr S Venkateswarlu

HOD Principal

Mr S. Krishna Reddy
Internal Guide External Examiner

Submitted for viva voice Examination held on ___________________

II
DDDD

III
DDDD

SREE DATTHA INSTITUTE OF ENGINEERING &SCIENCE


DEPARTMENT OF COMPUTER SCIENCE AND
ENGINEERING

DECLARATION

I, Name of the Student (Roll Number) hereby declare


that the project report titled “Project Title” under the guidance of MR.S.KRISHNA
REDDY, Sree Dattha Institute of Engineering and Science, Ibrahimpatnam is
submitted in partial fulfillment of the requirement for the award of the degree of M.
Tech. In Computer Science and Engineering is a record of bonafide work carried out by
me and the results embodied in this project have not been reproduced or copied from
any source.

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.

Name of the Student

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.

We are also thankful to Dr. S. Venkata Achutha Rao, Head, Department of


Computer Science and Engineering for providing encouragement and support for
completing this project successfully.

We are obliged to Dr. S. Venkata Achuta Rao, Dean and S Venkateswarlu,


Principal for being cooperative throughout this project. We would like to express
our sincere gratitude to Dr. GNV Vibhav Reddy, Vice-Chairman and Sri. G.
Panduranga Reddy, Chairman for providing excellent infrastructure and a nice
atmosphere throughout this project.

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

FIGURE NO FIGURE NAME PAGE NO

Figure 3.1 Project Architecture 9

Figure 3.2 Use case diagram 11

Figure 3.3 State Chart 12

Figure 3.4 Activity diagram 13

VI
DDDD

LIST OF SCREENSHOTS

SCREENSHOT NO. SCREENSHOT NAME PAGE NO


Screenshot 5.1 Percentage of total offenders and victims who 19
died in accidents

Screenshot 5.2 Percentage of deaths occurring due to non- 19


wearing helmets between male and female

Screenshot 5.3 Number of Accidents for 1,2,3,4 LANE 20


per 1L of respective states

Screenshot 5.4 Total Number of injured, killed, Road 20


accidents per 1L population of respective
states

Screenshot 5.5 Number of people killed for each different 21


reason per 1L population of that state

Screenshot 5.6 Total number of accidents, injuries, deaths 21


due to fault of driver ’s from other vehicles
per 1L people of that state

Screenshot 5.7 Total number of accidents, injuries, deaths 22


caused due to defects in road conditions
per 1L people of that state

Screenshot 5.8 Number of total accidents for each vehicle 22


type per 1L people of that state

Screenshot 5.9 Line chart showing flow of number of 23


accidents happening at day and night time
for 2014 and 2016

Screenshot 5.10 Number of accidents happening in day and 23


night time for 2014, 2016

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

6.1 TYPES OF TESTING 25


6.1.1 UNIT TESTING 25
6.1.2 WHITE BOX TESTING 25
6.2.3 BLACK BOX TESTING 25
6.2 SYSTEM TEST 25
7. CONCLUSION & FUTURE SCOPE 26
7.1 PROJECT CONCLUSION 27
7.2 FUTURE SCOPE 27
8. BIBLIOGRAPHY 28

8.1 REFERENCES 29-30

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

1.1 PROJECT SCOPE

This project is titled as “Road Accident Forecasting With Machine Learning


“.The project aims to develop a machine learning system for predicting road
accidents using historical data and relevant influencing factors. This
forecasting system will be designed to enhance road safety and reduce
accidents by providing accurate predictions.

1.2 PROJECT PURPOSE

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.

1.3 PROJECT FEATURES

Road Accident Forecasting with Machine Learning uses historical accident


data and various factors like weather and traffic patterns to predict accident
likelihood and severity. It employs machine learning algorithms for
predictions, utilizes real-time data, and offers early warning systems and
interactive tools to enhance road safety. Continuous data updates and
collaboration with stakeholders are essential for improving safety and resource
optimization.

5
DDDD

2. SYSTEM ANALYSIS

6
DDDD

SYSTEM ANALYSIS

1. SYSTEM ANALYSIS

A Road Accident Forecasting system with machine learning aims to


improve road safety by predicting accidents. It starts with data collection
and preprocessing, followed by model selection and training. After
rigorous testing, the model is deployed in a production environment with
monitoring and maintenance. User training, security, and privacy are vital
considerations, and feedback drives ongoing improvements. Regulatory
compliance and cost analysis ensure the system's effectiveness while
adhering to standards and budget constraints. In summary, the system
utilizes machine learning to predict accidents and contributes to safer roads
through data-driven insights and preventive measures.

2.1 PROBLEM DEFINITION

The objective of "Road accident forecasting with machine learning" is to create a


predictive model that can anticipate the likelihood of road accidents in specific areas or
on particular road segments at given times. This prediction is based on a combination of
historical accident data, real-time information, and various influencing factors, such as
weather conditions, road type, time of day, and traffic volume. By collecting and
analyzing historical data and integrating real-time sources, the machine learning model
can provide valuable insights into accident risks. The model's accuracy and performance
are evaluated through training and validation, using metrics like accuracy, precision, and
recall. Once deployed, the model can offer real-time or near-real-time accident forecasts,
enabling authorities to allocate resources efficiently and inform motorists about potential
hazards, ultimately working to enhance road safety and reduce accidents.

2.2 EXISTING SYSTEM

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

2.2.1 LIMITATIONS OF EXISTING SYSTEM

o Lack of Predictive Capability


o Inefficiency in Resource Allocation
o Limited Use of Real-Time Data
o Reliance on Human Reporting
o Inadequate Weather Prediction

To avoid all these limitations and make the working more accurately
the system need the implemented efficiently.

2.3 PROPOSED SYSTEM

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.

2.3.1 ADVANTAGES OF THE PROPOSED SYSTEM

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.

2.4 FEASIBILITY STUDY

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

2.4.1 ECONOMIC FEASIBILITY

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:

• The costs conduct a full system investigation.


• The cost of the hardware and software.
• The benefits in the form of reduced costs or fewer costly errors.
• .

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.

2.4.2 TECHNICAL FEASIBILITY

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.

2.4.3 BEHAVIORAL FEASIBILITY

This includes the following questions:

• Is there sufficient support for the users?


• Will the proposed system cause harm?

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

2.5 HARDWARE & SOFTWARE REQUIREMENTS

2.5.1 HARDWARE REQUIREMENTS

Hardware interfaces specifies the logical characteristics of each interface


between the software product and the hardware components of the system.
The following are some hardware requirements.
• Processor : Intel Dual Core@ CPU 2.90GHz.
• Hard disk : 16GB and Above.
• RAM : 4GB and Above.
• Monitor : 15 inches or above.

2.5.2 SOFTWARE REQUIREMENTS

Software Requirements specifies the logical characteristics of each


interface and software components of the system. The following are some
software requirements,

• Operating system : Windows 10, 11


• Languages : Python
• Backend : Machine Learning
• IDE : Jupyter Notebook

10
DDDD

3. ARCHITECTURE

11
DDDD

3. ARCHITECTURE

3.1 PROJECT ARCHITECTURE

Feature
Data Collection Data Processing
Engineering

Hyperparameter
Model Selection Model Training
Tuning

Real-time
integration and
deployment

Fig. 3.1 Project Architecture of Road Accident Forecasting With ML

12
DDDD

3.2 DESCRIPTION

“Project Architecture Of Road Accident Forecasting With ML“ :

1. First, we described the Project Architecture Structure with a “Neat Diagram”.

2. “Project Architecture” involves mainly Seven stages viz. respectively given


below:

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.

i) Activity Diagram: Visualizes process workflows, optimizes processes,


documents procedures
, and aids in testing and debugging.

13
DDDD

3.3 USE CASE DIAGRAM

14
DDDD

3.4 STATE CHART

3.4 State Chart

15
DDDD

3.5 ACTIVITY DIAGRAM

3.5 Activity Diagram

16
DDDD

4. IMPLEMENTATION

5. IMPLEMENTATION

17
DDDD

Sample Code:

18
DDDD

Sample Data Set:

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

Fig.5.1 Percentage of total offenders and victims


who died in accidents

Fig.5.2 Percentage of deaths occurring due to non-


wearing helmets between male and female

22
DDDD

Fig.5.3 Number of Accidents for 1,2,3,4 LANE per 1L of respective states

Fig.5.4 Total Number of injured, killed , Road accidents per 1L population of


respective
states

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

Fig.5.8 Number of total accidents for each vehicle type


per 1L people of that state

24
DDDD

Fig.5.9 Line chart showing flow of number of accidents


happening at day and night time for 2014 and 2016

Fig.5.10 Number of accidents happening in day and night time for

25
DDDD

2014, 2016

6. TESTING

26
DDDD

6 TESTING

6.1 TYPES OF TESTING

6.1.1 Unit testing


Unit testing involves the design of test cases that validate that the internal program logic is
functioning properly, and that program inputs produce valid outputs. All decision branches and
internal code flow should be validated. It is the testing of individual software units of the
application .it is done after the completion of an individual unit before integration. This is a
structural testing, that relies on knowledge of its construction and is invasive. Unit tests perform
basic tests at component level and test a specific business process, application, and/or system
configuration. Unit tests ensure that each unique path of a business process performs accurately to
the documented specifications and contains clearly defined inputs and expected results.

6.1.2 White Box 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.

6.1.3 Black Box Testing

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.

6.2 System Test

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

7. CONCLUSION & FUTURE SCOPE

7.1 PROJECT CONCLUSION

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

7.2 FUTURE SCOPE

 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.

[2] Abdelwahab, H. T., & Abdel-Aty, M. A. (2014). Developing crash prediction


models for intersections using real-time traffic data. Journal of Transportation Engineering,
140(6), 04014010.

[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

networks. Accident Analysis & Prevention, 82, 113-125.

32

You might also like