Data-Driven Safe Deliveries: The Synergy of IoT and Machine Learning in Shared Mobility
Abstract
:1. Introduction
- Design and develop a shared mobility framework.
- Design and develop the hardware and software components that can be added to a shared mobility vehicle.
- Design and implement a practical solution for shared mobility for delivery service case study that continuously records the riding behavior and detects accidents.
- Implement a machine learning model that detects the dangerous behavior of the rider.
- Evaluate the accuracy of the detected dangerous behavior of the riders.
2. Literature Review
3. Methodology and Proposed Approach
- Collect the required data representing the physical shared mobility environment, including readings from the accelerometer, gyroscope, GPS, ultrasonic, and video of the surrounding environment. The design shall accommodate the addition of new sensors within the environment.
- Transform the collected data to make meaningful insights related to the safety of the riders.
- Expose functionalities for the riders and administrators to view the driving and safety behavior of the shared mobility. Those functionalities must have a modular design for future extensions to the framework.
- Automate the system’s decision component to maximize the riders’ safety to avoid and identify accidents and misuse of the vehicles.
- Locate and track vehicles.
3.1. Physical Layer
- Shared Vehicles: Contains the physical vehicles to be used within the infrastructure.
- Edge Computing Device: used to process the collected data from the vehicle node at the edge.
- GPS Module: Tracks location for localization purposes.
- Ultrasonic Sensor: Measures the distance between the vehicle and nearby objects. It offers non-contact distance measurement functionality from 2 to 400 cm and has a range accuracy that can reach up to 3 mm [29]. The ultrasonic sensor was interfaced with the edge computing device’s digital Input/Output ports.
- Force-sensing resistor: Detects if the vehicle faced any impact force caused by another object. The force range detected is 0 to 100 Newtons. This sensor was interfaced with the digital Input/Output ports of the edge computing device.
- Accelerometer and gyroscope sensor: Collects a 6-axis motion tracking. The sensor is interfaced with the edge computing unit using serial communication ports. This work used it to measure the vehicle’s x, y, and z acceleration and angular velocities.
- Camera: Records the video footage of the trips while on the move. It is interfaced with the edge computing unit using the Universal Serial Bus (USB) protocol.
- Communication module: Transmits the data to the cloud services through adequate modules connected with the edge device. The communication module choice depends on the appropriate technology specified by the communication layer (discussed in Section 3.2).
3.2. Communication Layer
3.3. Control and Management Layer
3.3.1. Data Access and Integration Module
3.3.2. Shared Mobility Inventory Management
3.3.3. User Management and Tracking Module
3.3.4. Map Module
3.3.5. Rules Module
3.3.6. Decision Module
3.4. Security Layer
3.5. Operation Continuity Layer
4. System Design and Implementation
4.1. Component Design
4.1.1. Physical Layer
- Data Collection Component: It is responsible for collecting driving parameters, location data, and other relevant information from motorcycles equipped with sensors.
- Vehicle Registration Component: It ensures proper registration of vehicles, verifies their status, and checks the functionality of sensor devices.
4.1.2. Control and Management Layer
- Behavior Monitoring and Tracking Component: It analyzes data collected by the Data Collection Component using predefined rules to track and monitor vehicle behavior. It depends on the Rides Management Component to update vehicle statuses.
- Decision-Making Model Component: It utilizes the analyzed data from the Behavior Monitoring and Tracking Component as input for machine learning models, facilitating behavior classification.
- Rides Management Component: It records ride details, including analyzed data and decisions made during trips. It also maintains a comprehensive history of all rides and associated vehicle behavior analysis. It depends on the Vehicle Management Component to update vehicle statuses.
- User Management Component: It manages the user usage of vehicles, recording decisions made, ride reports, and the vehicles used by each user. It relies on the Users Database Component to store and retrieve user data.
- Vehicle Management Component: It manages vehicle-related data, including registration details, sensor status, and availability. It interfaces with the Vehicle Database Component to update and retrieve vehicle data. It depends on the Rides Management Component to keep track of vehicle statuses during rides.
- Rides Database Component: It stores and retrieves ride information and generates reports, supporting historical analysis and reporting.
- Users Database Component: It stores and retrieves user data, enabling user management functionalities.
- Vehicle Database Component: It stores and manages vehicle-related data, including registration details, sensor status, and availability.
4.1.3. Interface Layer
- Admin Portal Component: It provides administrators with an intuitive interface to oversee and manage the overall shared mobility platform. It interfaces with the User Management and Rides Management Components in the Control and Management Layer.
- User Portal Component: It offers regular users an accessible interface to access services, rent motorcycles, and track their activities. It interfaces with the User Management Component in the Control and Management Layer.
4.2. System Deployment
4.2.1. Physical Layer
- Raspberry Pi (RPi) 4: The RPi 4 served as the edge computing device in the implementation, acting as the data collection component. It featured a 64-bit CPU running at 1.4 GHz, 4 GB of RAM, a 64 GB SD memory card, 4 USB ports, Ethernet and Wi-Fi access points, Bluetooth connections, 26 GPIO pins, and SPI, SCI, and I2C communication interfaces. The RPi 4 interfaced with various sensors is installed on the motorcycles, collecting driving parameters, location data, and relevant information during trips.
- Sensing Unit: The sensing unit consists of several sensors, enhancing the data collection capabilities of the motorcycles. The following key sensors are used:
- HC-SR04 Ultrasonic Distance Module: It is utilized for non-contact distance measurement between the motorcycle and nearby objects, with a range accuracy of up to 3 mm and a measurement range from 2 to 400 cm.
- Force-Sensing Resistor (FSR): It is used for detecting impact force on the motorcycle caused by other objects with a resistance range from infinite/open circuit to 100 KΩ and a force range of 0 to 100 Newtons.
- MPU-6050 Accelerometer and Gyroscope Module: It is employed for providing 6-axis motion tracking, capturing x, y, and z acceleration in addition to the angular velocities of the motorcycle during rides.
- Arducam USB Camera: It is deployed for the video recording of rides, offering a 4K 8MP IMX219 autofocus capability with a resolution of 1080P.
4.2.2. Control and Management Layer
- Edge Rule-Based Monitoring: A program was developed using Python to compare the readings collected from the sensors in the physical layer to preset values to detect irregular changes in acceleration, approaching nearby objects, and physical impacts on the bike. This program was deployed on the RPi 4 discussed in the physical layer to ensure immediate action is taken, such as sending warnings to the rider’s mobile phone or contacting emergency contacts in case of accidents.
- Application Servers: The application services were developed as Java-based microservices. The microservices were classified as riders’ management, vehicle management, and user management, and each of them were deployed on a cloud-based server. They received data from the edge computing device, processed events, and facilitated communication between different components of the system. Additionally, they provided user management, rides management, vehicle management, and decision-making functionalities.
- NoSQL Database System: A NoSQL database system was utilized to store and retrieve various data related to trips, sensor faults, registrations, reports, emergency contacts, and user information. The database system was used to store the rides, vehicles, and users’ databases.
- Machine Learning Server: The dedicated machine learning server integrated machine learning capabilities into the system. The machine learning model was trained and integrated into a Flask web service deployed on a cloud. It processed the sensor data collected during trips and classified maneuvers based on predefined patterns and algorithms. By analyzing driving behavior, the machine learning server identified risky instances, such as sudden acceleration or harsh braking, contributing to the decision-making process.
4.2.3. Communication Layer
- MQTT Broker: Utilizing the MQTT protocol, the MQTT broker served as a messaging intermediary between the edge computing unit (RPi 4) and the mobile unit. It ensured reliable and low-latency communication, allowing the RPi 4 to send warnings and accident notifications, receive trip instructions, and synchronize data with the mobile unit.
- Standard HTTP Requests: HTTP requests were employed to facilitate the communication between the servers and the edge computing unit. They facilitated the exchange in vehicle, sensor, rides, and user data between the different system modules.
4.2.4. Interface Layer
- Frontend Server: The frontend server hosted the user interface, allowing users to interact with the system and access relevant information. It served the ReactJS application, providing a user-friendly interface for users and admins to view trip details, access reports, and manage user information.
- Client Device: The client device represented any thin client that accessed the frontend web interface of the system. Through the frontend server, users and admins could interact with the ReactJS application, access trip details, generate reports, and manage user information through a web browser.
- Mobile Application: The mobile application was developed for Android 10 smartphones. It connected to the MQTT broker to receive warnings and accident notifications from the RPi 4 and sent trip instructions to start and end trips. Furthermore, the mobile app retrieved the details of emergency contacts in case of an accident and provided the ability to view trip information.
5. Results and Discussion
5.1. Edge Monitoring
5.2. Classification Model
5.2.1. Dataset Selection
5.2.2. Data Preprocessing and Feature Extraction
- (a)
- Kinematic Features
- (b)
- Statistical Features
- (c)
- Rotational Features
5.2.3. Model Training and Selection
5.3. Overall System Performance
6. Conclusions and Future Work
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Shaheen, S.A.; Martin, E.; Bansal, A. Peer-to-Peer (P2P) Carsharing: Understanding Early Markets, Social Dynamics, and Behavioral Impacts; Transportation Sustainability Research Center: UC Berkeley, CA, USA, 2018; Available online: https://escholarship.org/uc/item/7s8207tb (accessed on 30 August 2023).
- Furuhata, M.; Dessouky, M.; Ordóñez, F.; Brunet, M.-E.; Wang, X.; Koenig, S. Ridesharing: The state-of-the-art and future directions. Transp. Res. Part B Methodol. 2013, 57, 28–46. [Google Scholar]
- Guyader, H. No one rides for free! Three styles of collaborative consumption. J. Serv. Mark. 2018, 32, 692–714. [Google Scholar]
- Santos, D.; Xavier, E. Dynamic Taxi and Ridesharing: A Framework and Heuristics for the Optimization Problem. In Proceedings of the Twenty-Third International Joint Conference on Artificial Intelligence, Beijing, China, 3–9 August 2013; pp. 2885–2891. [Google Scholar]
- Huang, Y.; Bastani, F.; Jin, R.; Wang, X.S. Large Scale Real-Time Ridesharing with Service Guarantee on Road Networks. Proc. VLDB Endow. 2014, 7, 2017–2028. [Google Scholar] [CrossRef]
- Ma, S.; Zheng, Y.; Wolfson, O. T-Share: A Large-Scale Dynamic Taxi Ridesharing Service. In Proceedings of the 2013 IEEE 29th International Conference on Data Engineering (ICDE), Brisbane, QLD, Australia, 8–11 April 2013; pp. 410–421. [Google Scholar] [CrossRef]
- Ma, S.; Zheng, Y.; Wolfson, O. Real-Time City-Scale Taxi Ridesharing. IEEE Trans. Knowl. Data Eng. 2015, 27, 1782–1795. [Google Scholar] [CrossRef]
- Pelzer, D.; Xiao, J.; Zehe, D.; Lees, M.H.; Knoll, A.C.; Aydt, H. A Partition-Based Match Making Algorithm for Dynamic Ridesharing. IEEE Trans. Intell. Transp. Syst. 2015, 16, 2587–2598. [Google Scholar] [CrossRef]
- Schreieck, M.; Safetli, H.; Siddiqui, S.A.; Pflügler, C.; Wiesche, M.; Krcmar, H. A Matching Algorithm for Dynamic Ridesharing. Transp. Res. Procedia 2016, 19, 272–285. [Google Scholar] [CrossRef]
- Guo, Y.; Zhang, Y.; Boulaksil, Y. Real-Time Ride-Sharing Framework with Dynamic Timeframe and Anticipation-Based Migration. Eur. J. Oper. Res. 2021, 288, 810–828. [Google Scholar] [CrossRef]
- O’Mahony, E.; Shmoys, D. Data Analysis and Optimization for (Citi)Bike Sharing. In Proceedings of the AAAI Conference on Artificial Intelligence, Austin, TX, USA, 25–30 January 2015; Volume 29. [Google Scholar] [CrossRef]
- Liu, J.; Sun, L.; Chen, W.; Xiong, H. Rebalancing Bike Sharing Systems. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016. [Google Scholar] [CrossRef]
- Ritzinger, U.; Puchinger, J.; Hartl, R.F. A Survey on Dynamic and Stochastic Vehicle Routing Problems. Int. J. Prod. Res. 2015, 54, 215–231. [Google Scholar] [CrossRef]
- Nazari, M.; Oroojlooy, A.; Snyder, L.; Takac, M. Reinforcement Learning for Solving the Vehicle Routing Problem. Available online: https://proceedings.neurips.cc/paper/2018/hash/9fb4651c05b2ed70fba5afe0b039a550-Abstract.html (accessed on 30 August 2023).
- Du, B.; Hu, X.; Sun, L.; Liu, J.; Qiao, Y.; Lv, W. Traffic Demand Prediction Based on Dynamic Transition Convolutional Neural Network. IEEE Trans. Intell. Transp. Syst. 2021, 22, 1237–1247. [Google Scholar] [CrossRef]
- Yang, J.; Guo, B.; Wang, Z.; Ma, Y. Hierarchical Prediction Based on Network-Representation-Learning-Enhanced Clustering for Bike-Sharing System in Smart City. IEEE Internet Things J. 2021, 8, 6416–6424. [Google Scholar] [CrossRef]
- Turoń, K.; Czech, P.; Tóth, J. Safety and Security Aspects in Shared Mobility Systems. Sci. J. Silesian Univ. Technol. Ser. Transp. 2019, 104, 169–175. [Google Scholar] [CrossRef]
- Agarwal, N.; Singh, A.K.; Singh, P.P.; Sahani Dfa, R. Smart helmet. Int. Res. J. Eng. Technol. 2015, 2, 19–22. [Google Scholar]
- Jesudoss, A.; Vybhavi, R.; Anusha, B. Design of Smart Helmet for Accident Avoidance. In Proceedings of the 2019 International Conference on Communication and Signal Processing (ICCSP), Melmaruvathur, India, 4–6 April 2019; pp. 0774–0778. [Google Scholar]
- Srithar, S.; Venkata Suvathe, V.S.; Vijay Pandi, S.; Mounisha, M. Implementation of Smart Secure System in Motorbike using Bluetooth Connectivity. Int. Res. J. Eng. Technol. 2019, 6, 4817–4821. [Google Scholar]
- Mohd, A.; Madzhi, N.K.; Johari, J. Smart Helmet with Sensors for Accident Prevention. In Proceedings of the 2013 International Conference on Electrical, Electronics and System Engineering (ICEESE), Selangor, Malaysia, 4–5 December 2013; pp. 21–26. [Google Scholar]
- Swathi, S.J.; Raj, S.; Devaraj, D. Microcontroller and Sensor Based Smart Biking System for Driver’s Safety. In Proceedings of the 2019 IEEE International Conference on Intelligent Techniques in Control, Optimization and Signal Processing (INCOS), Tamilnadu, India, 11–13 April 2019; pp. 1–5. [Google Scholar]
- Lai, P.C.; Huang, H.Z.; Sheu, M.H.; Wu, C.M.; Le, J.T.; Chen, T.H. Bike Sensor System Design for Safety and Healthy Riding. In Proceedings of the 2018 IEEE International Conference on Consumer Electronics-Taiwan (ICCETW), Taichung, Taiwan, 19–21 May 2018; pp. 1–2. [Google Scholar]
- Islam, M.M.; Ridwan, A.E.M.; Mary, M.M.; Siam, M.F.; Mumu, S.A.; Rana, S. Design and Implementation of a Smart Bike Accident Detection System. In Proceedings of the 2020 IEEE Region 10 Symposium (TENSYMP), Dhaka, Bangladesh, 5–7 June 2020; pp. 386–389. [Google Scholar]
- Tashfia, S.S.; Islam, R.; Sultan, S.I.; Rahman, M.W.; Habib, A.; Pinky, L.Y. Intelligent Motorcycle Monitoring Scheme Using IoT with Expert System in Bangladesh. In Proceedings of the 2020 23rd International Conference on Computer and Information Technology (ICCIT), Dhaka, Bangladesh, 19–21 December 2020; pp. 1–6. [Google Scholar]
- Nuswantoro, F.M.; Sudarsono, A.; Santoso, T.B. Abnormal Driving Detection Based on Accelerometer and Gyroscope Sensor on Smartphone using Artificial Neural Network (ANN) Algorithm. In Proceedings of the 2020 International Electronics Symposium (IES), Surabaya, Indonesia, 29–30 September 2020; pp. 356–363. [Google Scholar]
- Raheel, A.; Ehatisham-ul-Haq, M.; Iqbal, A.; Ali, H.; Majid, M. Driving Activity Recognition of Motorcyclists Using Smartphone Sensor. In Proceedings of the International Conference on Intelligent Technologies and Applications INTAP 2019, Bahawalpur, Pakistan, 6–8 November 2019; pp. 684–694. [Google Scholar]
- Lu, D.-N.; Nguyen, D.-N.; Nguyen, T.-H.; Nguyen, H.-N. Vehicle Mode and Driving Activity Detection Based on Analyzing Sensor Data of Smartphones. Sensors 2018, 18, 1036. [Google Scholar] [CrossRef]
- HC-SR04 Sensor Datasheet Pdf—Ultrasonic Sensor. Equivalent, Catalog. Available online: https://datasheetspdf.com/pdf/1380136/ETC/HC-SR04/1 (accessed on 30 August 2023).
- Aburukba, R.; Al-Ali, A.R.; Riaz, A.H.; Al Nabulsi, A.; Khan, D.; Khan, S.; Amer, M. Fog Computing Approach for Shared Mobility in Smart Cities. Energies 2021, 14, 8174. [Google Scholar] [CrossRef]
- Boubezoul, A.; Dufour, F.; Bouaziz, S.; Larnaudie, B.; Espié, S. Dataset on Powered Two Wheelers Fall and Critical Events Detection. Data Brief 2019, 23, 103828. [Google Scholar] [CrossRef] [PubMed]
Maneuver Type | Number of Samples | Percentage |
---|---|---|
Acceleration on a curve | 3803 | 4.20% |
Acceleration on a straight line | 10,975 | 12.13% |
Fall-like maneuver | 32,520 | 35.94% |
Harsh braking on a straight line | 8846 | 9.78% |
Degraded track | 10,480 | 11.58% |
Fall in a curve | 6226 | 6.88% |
Fall in the roundabout | 5266 | 5.82% |
Fall on a slippery section | 5875 | 6.49% |
Fall with leaning of the motorcycle | 6480 | 7.16% |
Ref No. | Sensors Used to Detect Maneuver | Number of Maneuvers Identified | Maneuver Types Identified | Best Average Accuracy |
---|---|---|---|---|
[26] | Mobile phone accelerometer and gyroscope | 9 | Normal, zigzag, sleepy, turn right, turn left, U-turn, sudden braking, sudden acceleration, and speed bumps | ANN: 96.2% |
[27] | Mobile phone gyroscope | 4 | Left turn, right turn, U-turn, and a straight path | RF: 86.51% |
[28] | Mobile phone accelerometer, gyroscope and magnetometer | 4 | Left turn, right turn, stopping, and going straight | RF: 98.95% |
Proposed System | Discrete accelerometer and gyroscope | 9 | Acceleration on a curve, acceleration on a straight line, fall-like maneuver, harsh braking on a straight line, degraded track, fall in a curve, fall in the roundabout, fall on a slippery straight line, and fall with leaning of the motorcycle | DT: 91.59% |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Elwy, F.; Aburukba, R.; Al-Ali, A.R.; Nabulsi, A.A.; Tarek, A.; Ayub, A.; Elsayeh, M. Data-Driven Safe Deliveries: The Synergy of IoT and Machine Learning in Shared Mobility. Future Internet 2023, 15, 333. https://doi.org/10.3390/fi15100333
Elwy F, Aburukba R, Al-Ali AR, Nabulsi AA, Tarek A, Ayub A, Elsayeh M. Data-Driven Safe Deliveries: The Synergy of IoT and Machine Learning in Shared Mobility. Future Internet. 2023; 15(10):333. https://doi.org/10.3390/fi15100333
Chicago/Turabian StyleElwy, Fatema, Raafat Aburukba, A. R. Al-Ali, Ahmad Al Nabulsi, Alaa Tarek, Ameen Ayub, and Mariam Elsayeh. 2023. "Data-Driven Safe Deliveries: The Synergy of IoT and Machine Learning in Shared Mobility" Future Internet 15, no. 10: 333. https://doi.org/10.3390/fi15100333
APA StyleElwy, F., Aburukba, R., Al-Ali, A. R., Nabulsi, A. A., Tarek, A., Ayub, A., & Elsayeh, M. (2023). Data-Driven Safe Deliveries: The Synergy of IoT and Machine Learning in Shared Mobility. Future Internet, 15(10), 333. https://doi.org/10.3390/fi15100333