SOCIAL NETWORK OF SAFE VEHICLES Project Report Submitted in partial fulfillment for the award of the degree of BACHELOR OF TECHNOLOGY In COMPUTER SCIENCE & ENGINEERING (VII th Semester) 2015 - 2019 Batch APJ Abdul Kalam Technological University By ABIJITH C G (SHR15CS002) AJITH K ASHOK (SHR15CS004) AKSHAY B NAIR (SHR15CS007) NOVEMBER 2018 DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING SAHRDAYA COLLEGE OF ENGINEERING AND TECHNOLOGY, KODAKARA, THRISSUR BONAFIDE CERTIFICATE This is to certify that the project report titled ”SOCIAL NETWORK OF SAFE VE- HICLES” is bonafide work of ABIJITH C G (SHR15CS002), AJITH K ASOK (SHR15CS004) & AKSHAY B NAIR(SHR15CS007 ) during their VII th semester B.Tech in partial fulfillment of the requirements of the APJ Abdul Kalam Tech- nological University, under our supervision. COORDINATOR PROJECT GUIDE & HEAD OF THE DEPARTMENT Ms. Priya K V Mr. Krishnadas J Assistant Professor Assistant Professor Kodakara 26-11-2018 ACKNOWLEDGMENT We would like to express our immense gratitude and profound thanks to all those who helped us to make this project a great success. We express our gratitude to the almighty God for all the blessings endowed on us. We take this opportunity to express our sincere thanks to our Executive Director Rev. Fr. George Pareman and Principal Dr. Nixon Kuruvila for providing us with such a great opportunity. We also convey our gratitude to our Head of the Department Mr. Krishnadas J for having given us a constant inspiration and suggestion. We extend our deep sense of gratitude to our project coordinator Ms. Priya K V , Assistant Professor of Com- puter Science & Engineering Department for providing and enlightening guidance through the project. We can hardly find words to express our deep appreciation for the help and warm encouragement that We have received from our project guide Mr. Krishnadas J , Assistant Professor of Computer Science & Engineering Depart- ment for his whole-hearted support. It was their encouragement that helped us to complete the project. We can hardly find words to express our deep appreciation of the help and warm encouragement that We received from our parents. We are extremely thankful and indebted to our friends who supported us in all aspects of the project work. i INSTITUTIONAL VISION To train the youth to be the leaders of tomorrow with apt skills, deep rooted sense of social responsibility, strong ethical values and with a global outlook to face the challenges of changing world. INSTITUTIONAL MISSION With a high calibre faculty and an excellent infrastructure, we promote academic excellence, absolute discipline and sound practical exposure. QUALITY POLICY We at Sahrdaya are committed to provide Quality Technical Education through con- tinual improvement and by inculcating Moral & Ethical values to mould into Vibrant Engineers with high Professional Standards. We impart the best education through the support of competent & dedicated facul- ties, excellent infrastructure and collaboration with industries to create ambience of excellence. ii DEPARTMENTAL VISION To evolve as a national level Center of Excellence in academics and to research with the aim of imparting contemporary knowledge in the field of Computer Science and Engineering. DEPARTMENTAL MISSION 1. Have state of art infrastructure and resources for teaching and research. 2. Impart relevant technical knowledge,skills and attributes along with values and ethics. 3. Enhance research quality and creativity through innovative teaching learn- ing methodologies. 4. Mold Computer Science Engineering Professionals in synchronization with the dynamic industry requirements, worldwide. 5. Inculate essential leadership qualities coupled with commitment to the so- ciety. PROGRAMME EDUCATIONAL OBJECTIVES (PEOS) PEO1 Take up challenging careers in suitable corporate, business or ed- ucational sectors across the world, in multi-cultural work environ- ment. PEO2 Continuously strive for higher achievements in life keeping moral and ethical values such as honesty, loyalty, good relationship and best performance, aloft. PEO3 Be knowledgeable and responsible citizens with good team-work skills, competent leadership qualities and holistic values. iii PROGRAMME SPECIFIC OBJECTIVES (PSOS) PSO1 To nurture students with technically inquisitive attitude so that any real- world problem could be tackled with a problem solving per- spective, finding a suitable mathematical model with strong funda- mental technological concepts to solve and apply to rapid growing arena of computer technology. PSO2 To develop professionals with excellent exposure to the latest tech- nologies to design high quality products unique in innovation, tech- nology, software, security, hardware and usefulness; making high impact on society, business and technology. PSO3 To enhance knowledge in practical implementation of technology with regard to parallelism, virtualization of networks, scientific analysis and modeling, visualization, natural language processing, digital synthesis of data and its manipulation, wireless and mobile communication, storage and retrieval of huge amount of data etc. PROGRAMME OUTCOMES (POS) PO1 Engineering knowledge: Apply the knowledge of mathematics, sci- ence, engineering fundamentals, and an engineering specialization to the solution of complex engineering problems. PO2 Problem analysis: Identify, formulate, review research literature, and analyze complex engineering problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering sciences. PO3 Design/development of solutions: Design solutions for complex engineering problems and design system components or processes that meet the specified needs with appropriate consideration for the public health and safety, and the cultural, societal, and environmen- tal considerations. iv PO4 Conduct investigations of complex problems: Use research-based knowledge and research methods including design of experiments, analysis and interpretation of data, and synthesis of the information to provide valid conclusions. PO5 Modern tool usage: Create, select, and apply appropriate tech- niques, resources, and modern engineering and IT tools including prediction and modeling to complex engineering activities with an understanding of the limitations. PO6 The engineer and society: Apply reasoning informed by the con- textual knowledge to assess societal, health, safety, legal and cul- tural issues and the consequent responsibilities relevant to the pro- fessional engineering practice. PO7 Environment and sustainability: Understand the impact of the pro- fessional engineering solutions in societal and environmental con- texts, and demonstrate the knowledge of, and need for sustainable development. PO8 Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of the engineering practice. PO9 Individual and team work: Function effectively as an individual, and as a member or leader in diverse teams, and in multidisciplinary settings. PO10 Communication: Communicate effectively on complex engineering activities with the engineering community and with society at large, such as, being able to comprehend and write effective reports and design documentation, make effective presentations, and give and receive clear instructions. PO11 Project management and finance: Demonstrate knowledge and un- derstanding of the engineering and management principles and ap- ply these to one’s own work, as a member and leader in a team, to manage projects and in multidisciplinary environments. PO12 Life-long learning: Recognize the need for, and have the prepara- tion and ability to engage in independent and life-long learning in the broadest context of technological change. v COURSE OBJECTIVES To develop skills in doing literature survey, technical presentation and report prepa- ration. COURSE OUTCOMES The student will be able to CO1 Analyze a current topic of professional interest and present it before an audience CO2 Identify an engineering problem, analyze it and propose a work plan to solve it. CO3 Design a model with respect to recent technologies in the field of computer science. CO4 Describe, compare and evaluate different technologies CO-PO MAPPING PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 CO1 3 3 CO2 3 2 2 CO3 3 2 CO4 2 #1 – Weak correlation 2- Moderate correlation 3- Substantial correlation CO-PSO MAPPING PSO1 PSO2 PSO3 CO1 2 CO2 3 CO3 3 CO4 2 3 #1 – Weak correlation 2- Moderate correlation 3- Substantial correlation vi PROJECT OUTCOMES PR1 Use acquired knowledge to examine solutions to Pothole Identifica- tion & Reduction. PR2 Distinguish and Integrate differing forms of knowledge. PR3 Apply the use of a Machine Learning to meet identified challenges. PR4 Apply principles of ethics and respect in interaction with others. MAPPING OF PRS WITH COS CO1 CO2 CO3 CO4 PR1 2 1 PR2 3 PR3 1 3 1 PR4 3 #1 – Weak correlation 2- Moderate correlation 3- Substantial correlation MAPPING OF SRS WITH POS PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PR1 1 1 2 PR2 2 1 2 PR3 1 1 3 2 3 PR4 2 3 1 1 1 #1 – Weak correlation 2- Moderate correlation 3- Substantial correlation MAPPING SR WITH PSOS PSO1 PSO2 PSO3 PR1 2 PR2 3 PR3 2 2 PR4 1 #1 – Weak correlation 2- Moderate correlation 3- Substantial correlation vii ABSTRACT A significant percentage of road accidents happening in India are mainly caused by poor road infrastructure. Potholes, cracks, uneven road-surfaces, unaware speed bumps and bad weather conditions all are dangerous traps which increases the possi- bility for an accident. Motorcycles are on the top of the list of vehicles that gets into deathly hazards due to these reasons. These problems are also have a deteriorating effect on the chassis of the vehicle. The driver, being unaware of the traps ahead can’t do much in order to escape from them. The current proposal is to warn the drivers about the poor road conditions ahead, by giving them enough time to take necessary action to prevent the hazard. The system also proposes to send the infor- mation regarding the bad conditions of the road to the respected authorities such as National Highways Authority, Public Works Department etc. Irrespective of their actions, the system will continue giving warnings,until the repairs are done. Once the necessary steps are taken, it will be automatically detected and corrected in the system. The information about the road conditions will be collected by analyzing the movements of the suspension systems of automobiles.Data from each vehicle will be collected and sent to the cloud where they will be analyzed, processed and optimized. Once the data is optimized, each vehicle will be safe to go, being alert about the possible hazards that awaits them in the future roads. viii CONTENTS ACKNOWLEDGMENT . . . . . . . . . . . . . . . . . . . . . . . . . . i INSTITUTIONAL VISION, MISSION AND QUALITY POLICY . . ii DEPARTMENTAL VISION, MISSION, PEOs ,PO AND PSOs . . . . iii ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi LIST OF ABREVIATIONS . . . . . . . . . . . . . . . . . . . . . . . . . xii 1 INTRODUCTION 1 1.1 General Background . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Problem Definition . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.4 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 LITERATURE SURVEY 5 2.1 Vehicle Data Crowd sourcing . . . . . . . . . . . . . . . . . . . . . 5 2.2 Pothole Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.3 Road Bank and Incline Angles . . . . . . . . . . . . . . . . . . . . 7 3 SYSTEM ANALYSIS 8 3.1 Existing System . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2 Proposed System . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4 DESIGN AND DEVELOPMENT 12 4.1 Module Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.2 Module Description . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4.3 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.4 Flow Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.5 Data Flow Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 18 5 TECHNOLOGY DESCRIPTION 20 5.1 Hardware Specifications . . . . . . . . . . . . . . . . . . . . . . . 20 5.1.1 Accelerometer . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.1.2 Gyroscope . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.1.3 Ultrasonic Sensor . . . . . . . . . . . . . . . . . . . . . . . 21 ix 5.1.4 Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.2 Machine Learning Algorithms . . . . . . . . . . . . . . . . . . . . 22 5.2.1 C4.5 decision tree Classifier . . . . . . . . . . . . . . . . . 23 5.2.2 SVM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.2.3 Naive Bayes . . . . . . . . . . . . . . . . . . . . . . . . . . 28 5.3 Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6 RESULTS & PRESENT STATUS 33 7 CONCLUSION & FUTURE WORK 37 REFERENCES 38 APPENDIX xiv I Base Paper 1 xiv II Base Paper 2 xxix III Base Paper 3 xxxviii LIST OF FIGURES 3.1 Pothole Patrol road monitoring architecture. . . . . . . . . . . . . . 9 4.1 Modular design diagram of proposed model . . . . . . . . . . . . . 13 4.2 Block diagram of proposed model . . . . . . . . . . . . . . . . . . 15 4.3 Flow chart 1 of proposed model . . . . . . . . . . . . . . . . . . . . 16 4.4 Flow chart 2 of proposed model . . . . . . . . . . . . . . . . . . . . 17 4.5 Level 0 DFD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.6 Level 1 DFD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.1 Example of a decision tree in flowchart form. . . . . . . . . . . . . 25 5.2 An example of a two-class problem with two separating hyperplanes, B1 and B2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 6.1 Decision Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 6.2 Test Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 xi LIST OF ABBREVIATIONS ABBREVIATION DESCRIPTION WHO World Health Organisation SVM Static Vector Machine GPS Global Positioning System MEMS Micro-electromechanical System ANN Artificial Neural Networks LogR Logistic Regression CSV Comma Separated Values xii CHAPTER 1 INTRODUCTION Dangerous road surface conditions are major distractions for safe and comfortable transportation. Both drivers and road maintainers are interested in fixing them as soon as possible. However, these conditions have to be identified first. According to statistics provided by World Health Organization (WHO), road accidents have become one of the top 10 leading causes of death in the world. Specifically, road accidents claimed nearly 1.25 million lives per year (2015). Studies in show that most road accidents are caused by poor condition of roads. Bad roads are a big problem for vehicles and drivers, this is because the deterioration of roads leads to more expensive maintenance, not only for the road itself but also for vehicles. Accordingly, road surface condition monitoring systems are very important solutions to improve traffic safety, reduce accidents and protect vehicles from damage due to bad roads. Both road managers and drivers are interested in having sufficient information concerning road infrastructure quality (safe or dangerous road). 1.1 GENERAL BACKGROUND One approach to road damage detection is to use human reports to central authori- ties. While it has the highest accuracy, assuming that people are fair, it also has the most human interaction and is not comprehensive. Statistical analysis can be used to estimate damage probabilities of road segments based on their usage intensity. The simplest method might be to collect photos of road damage and hazards taken by the participants and to upload them to a central server. However, this requires strong participation and interaction from the users as well as manual image analysis. We believe that an automated approach for detecting potholes with little or no human interaction is more promising. This would ensure more comprehensive survey data with less errors caused by human factors than generated by mere enthusiasm of the participants. SOCIAL NETWORK OF SAFE VEHICLES An automated survey approach could be carried out by either customized embedded sensing devices or smart-phones. While the former has more sensing ca- pabilities and adaptation potential, the popularity of smart-phones makes the latter approach very appealing in terms of practical usability. To create a successful road surface monitoring system accepted by wide user community, it is important to make it attractive for the users, to provide added value without a significant process over- head. Therefore we envision our system as a service, which is added as a layer to existing navigation systems, such as Waze, which use real-time traffic information, collected by participatory sensing approach. Although contemporary smart-phones have high processing power and considerable memory, the detection system is rec- ommended to avoid resource-intensive detection methods and to preserve initial user interface responsiveness. In this ever fast moving world everyone looks to reach their destinations as early as possible. The major limitation to this dream is the improper, irregular roads. The drivers are unable to drive the vehicle with a regular speed due to the sudden existence of hazardous pothole and humps on the road. This also causes severe damage to the vehicle. Current road surface monitoring uses human effort to check the condition and quality of the road which makes the process more time consuming and less efficient. An automatic system which is capable of detecting road anomalies without any human effort may completely transform the current road transportation system efficiency. Identification of pavement distress such as potholes and humps not only helps drivers to avoid accidents or vehicle damages, it also helps authorities to keep track of the road conditions for its better maintenance. 1.2 PROBLEM DEFINITION The importance of the road infrastructure for the society could be compared with importance of blood vessels for humans. To ensure road surface quality it should be monitored continuously and repaired as necessary. The optimal distribution of resources for road repairs is possible providing the availability of comprehensive and objective real time data about the state of the roads. Participatory sensing is a promising approach for such data collection. Monitoring the road condition has acquired a critical significance during recent years. There are different reasons behind broadening research on this field: to start with, it will guarantee safety and comfort to different road users; second, smooth streets will cause less damage to the car. Our motivation is to create a real- time Application System that automatically predicts the quality of the road based on tri-axial accelerometer, gyroscope and ultrasonic sensors, show the road location trace on a geographic map using GPS and save all recorded workout entries. Sahrdaya College of Engineering & Technology, Kodakara 2 SOCIAL NETWORK OF SAFE VEHICLES C4.5 Decision tree classifier is applied on training data to classify road segments and to build our model. Using this approach, we expect to visualize a road quality map of a selected region. Hence, we can provide constructive feedback to drivers and local authorities. Besides, Road Manager can benefit from this system to evaluate the state of their road network and make a checkup on road construction projects, whether they meet or not the required quality. 1.3 MOTIVATION Nowadays various piece of data can be used to acquire necessary information. Par- ticularly we refer to processing of road data collected from 3-axis acceleration sensor and GPS (Global Positioning System). This technical data provides important clues which serve to understand different patterns occurred during the driving. As a goal we set to study distinct behaviors of accelerometer records with respect to road con- ditions and some particular driving events. Given research facilitates road quality identification. As a matter of fact, the problem of quality of roads still remains open. The maintenance of roadways calls for regular monitoring of road degrees, which can be classified as smooth and non-smooth. Smooth roads are divided into several types such as perfectly flat surface, smooth but rough and smooth road with some anomalies. These anomalies are damaged parts like pits and potholes. Some physical damages can be caused because of the weather conditions. Non-smooth is also defective type of the road which comprises uneven surface, poorly paved and non-paved roads. The latter one we also name as off-roads. Most of these road issues have their impacts on state of the vehicles. Especially they deteriorate the chassis (vehicle frame) of an automobile. They can also result in defects of the car. To prevent something like this, drivers need to be notified about bad road or abnormality so they can bypass them. In order to reconstruct damaged part of the road in a short period of time maintenance services must be informed of them instantly. Such awareness can be achieved through the system which will automatically analyze road condition. To offer the solution one need to understand specificity of different patterns on the road. Precisely we only need to explore 3-axis accelerometer values and GPS coordinates provided by sensors built into a device which is attached inside the vehicle. So the idea is that acceleration changes can give distinguishable data in various situations. Using GPS coordinates we store traveling position and calculate average speed at a certain time. Regardless of the practical information we still face some challenging patterns and noisy data. Sahrdaya College of Engineering & Technology, Kodakara 3 SOCIAL NETWORK OF SAFE VEHICLES 1.4 OBJECTIVES The objectives of this work are: • The primary objective is to ensure safety of passengers, improve the road con- ditions and adapt to the changing conditions quickly as possible by informing the authorities. • Reduce the number of accidents that happen due to poor road condition. • Make drivers alert of the road infrastructure and weather condition, so as to take decision on what route to proceed with. • Prevent deterioration of vehicle’s chassis, caused by deep potholes and uneven road surfaces. • Alert authorities about the critical maintenance’s. • Make night drives hassle-free. Sahrdaya College of Engineering & Technology, Kodakara 4 CHAPTER 2 LITERATURE SURVEY In recent years, road condition monitoring has become a popular research area. There has been some considerable works done in this field. 2.1 VEHICLE DATA CROWD SOURCING Crowd sourcing information, and the architectural design of such systems [7], has been investigated in prior works for multiple vehicular purposes. Examples include locating available road-side parking spots [8], estimating travel time and mapping GPS traces to road segments [9], identifying anomalous traffic states from GPS trace data [10], generating digital maps from vehicle GPS traces and distinguishing be- tween one-way and two-way roads , and using GPS data to identify traffic lights and stop signs . In some of these scenarios, the vehicle sensors are able to directly mea- sure the feature-of-interest (e.g., travel time, direction of travel). They therefore do not consider the different possible mappings from sensor data to an event that may occur, such as in our work where different accelerometer patterns from different ve- hicles all correspond to the same pothole. There is an increased challenge in crowd sourced detection when the mapping from the observed signals to the detected fea- ture is not identical for all vehicles. Methods of aggregating heterogeneous or conflicting information have been in- vestigated. The work in uses a Time-Decay Sequential Hypothesis Testing algorithm to aggregate and disseminate road information to and from multiple vehicles. How- ever, at low sampling rates this relies on aggregating decisions from weak classifiers instead of using the collected raw data. Each weak classifier is unreliable due to its limited access to data, which results in inaccurate detection’s when aggregating the decisions. SOCIAL NETWORK OF SAFE VEHICLES 2.2 POTHOLE DETECTION Pothole detection systems have been the focus of previous works, however the sensor device has generally been a smart phone instead of embedded vehicle sen- sors. We use embedded sensors since they are standardized across vehicles and are integrated within the controls and communications systems. This distinction is fun- damental to this work since smart phones generally have a much higher sensor op- erating frequency (300+ Hz) than embedded vehicle sensors. These higher frequen- cies allow for a detection system to measure the full dynamic motion of the vehicle caused by road features. This differs from the low frequency acceleration signals in our work where some of the signal properties that distinguish pothole regions in a single vehicle are lost since so little data is available. Signal under sampling has been shown to be problematic for other vehicular applications such as speed estimation . It is therefore difficult to perform any comparison between these methods since, as will be shown, the sampling frequency is a principal dictator in the types of available features. Regarding these existing pothole detection methods, the Pothole Patrol system uses speed, high-pass, and vertical and lateral acceleration filters to identify potholes from test signals from Boston taxis. Road bumps are detected in by examining the peak vertical acceleration and the duration for which the acceleration dips below a heuristically defined threshold. Gaussian Mixture Models are used in on aggregated data to determine potholes from 100 taxis in Shenzhen, China by examining z-scores of the listed Pothole Patrol features . A linear model for speed using 38 Hz sensors was constructed to try to eliminate the speed dependence in, however the vertical acceleration, which is used to create most of the features, can deviate significantly from the linear model. Since these works use non-embedded high-frequency sensors, they rely on only one vehicle for detection. They therefore ignore problems resulting from GPS error, which increases classification difficulty. This is particularly problematic when ag- gregating data from multiple vehicles with different dynamics as the exact ordering of the measurements cannot be determined. These, and previous works which use crowd sourcing detection techniques for pothole detection , do not consider multi- lane scenarios where GPS position error obfuscates the pothole data with normal road data from adjacent lanes. We also address the issue of finely localizing the pot- hole longitudinally on the road, which has not been addressed in previous works. There are other systems which attempt to help drivers by pre-detecting potholes in real-time by using images from vehicle-mounted cameras instead of accelerome- ters. Sahrdaya College of Engineering & Technology, Kodakara 6