Driver behaviors have a lot of effects in many fields. The bad driver has a negative impact on safety for the human soul if this person was another drive or a passer. Also, in the economy. The bad driver damages cars or buses. and he reduces its life span Which means a lot of cost for the Maintenance and the replacement. and for The environment, destroyed cars and its parts are a big problem for its recycling or at least Get rid of it. Our idea aims to measure driver behavior based on artificial intelligence (AI), to provide a fair rating for companies to track drivers'behaviors to save human souls and preserve the life of their car. This leads to preserving the environment.
The general objective is to help drivers to develop their skills to save humans life, reduce the cost for companies and rescue the environment from rubbish.
- Provide a fair rate for driver behavior to help companies to choose the
best driver for their services.
- Provide a Full report to help the driver at the Development process by
learning from his mistakes at The previous trip.
- Provide more than one model for analysis and prediction.
- Provide API to use this system with different types of Applications.
To collect data We need sensors and CPU with OS. And this may be the device's meaning.
- sensors:-
- IMU Sensor (MPU-9250) figure 1.1
- Mini PC:-
- Raspberry Pi figure 1.2
- power source:-
- Power Bank figure 1.3
- Wires:-
- JUMPERS figure 1.4
we used firebase to receive data from Raspberry Pi and store it before pass it to API.
We built several models to try to gain a lot of accuracies and choose the best model which is stable for problem-solving.
- Our Models
- Machine Learning
- Random Forest
- Logistic Regression
- Stochastic Gradient Descent
- Support Vector Machine
- Deep learning
- Artificial Neural Network
- Recurrent Neural Network
- Machine Learning
By flask we gained the ability to build a local server to load data from firebase and process it by selected model and return the result as a JSON file.
Our API run on a local server but, at last days we succeeded to provide an online host and our API is available to use widely.
Python with Tkinter library was a good partner to build an interface provide to the user to select the model and to load report (result)
During a time of data collection and uploading, we had to avoid any failure like connection lost or reach the limit of storage on firebase or any damage may happen for data during pass it to API so, we did it in two ways.
Offline backup: save a copy of data in sheet at Raspberry Pi storage Online backup: make a copy from data on firebase and store it at Google Drive.
The user loads the result as a table from Two columns The first for Title ’Event’ and The second for Value ‘Result’.
-
The rows from 1:6 are returned from API. every row act as one class and its value is the ratio for the event by the total time of the trip.
-
Row no7 ‘Rate’ is calculated from all the above values by a simple equation.
- Y=(-(e1+e2+e4+e5+e6)+4xe3+100)/500
-
Raw no8 ‘Evaluation’ is dependent on Y value it is calculated by conditions.
- Dangerous
- Less than 35%
- Bad
- 35 : 50%
- Not Bad
- 50: 65%
- Good
- 65: 85%
- Perfect
- Greater than 85%
- Dangerous
The user could choose between 5 models available now to classify driver behavior during the trip.
- Random Forest
- Logistic regression
- Stochastic gradient descent
- Support vector machine
- Neural network
- Recurrent neural network
The default model is Artificial Neural Network.
At the end of documentation and the project finally, we can monitor driver behavior.
From this project, we can collect the sensor data then upload it to the Database and analysis this data, then the company can make decisions based on our output.
1- https://github.com/jair-jr/driverBehaviorDataset
2- https://journals.plos.org/plosone/article?id=10.1371/journal.pone.017495 9
3- https://www.tensorflow.org/guide
4- https://flask.palletsprojects.com/en/1.1.x/api/
5- https://machinelearningmastery.com
7- https://www.youtube.com/channel/UCxxljM6JkSvJVSD_T90ZnMw
9- https://firebase.google.com/docs/database
10- https://www.raspberrypi.org/forums/
It has been a great opportunity to gain lots of experience in real-time projects, followed by the knowledge of how to actually design and analyse real projects. For that, we want to thank all the people who made it possible for students like us. Special thanks to the graduation project unit for the efforts they did to provide us with all useful information and making the path clear for the students to implement all the education periods in real-time project design and analysis. Furthermore, we all the professors and visiting industry for the interesting lectures they presented which had great benefit for all of us. We would like to express our deepest gratitude to our graduation project supervisor Dr. Fatma sakr for his patience and guidance throughout the semester.