[BACK]
Computers, Materials & Continua
DOI:10.32604/cmc.2021.018732
images
Article

Driving Style Recognition System Using Smartphone Sensors Based on Fuzzy Logic

Nidhi Kalra1,*, Raman Kumar Goyal1, Anshu Parashar1, Jaskirat Singh1 and Gagan Singla2

1Department of Computer Science and Engineering, Thapar Institute of Engineering and Technology, Patiala, 147001, Punjab, India
2Computer Science and Engineering, University Institute of Engineering and Technology, Panjab University, 160014, Chandigarh, India
*Corresponding Author: Nidhi Kalra. Email: nidhi.kalra@thapar.edu
Received: 19 March 2021; Accepted: 21 April 2021

Abstract: Every 24 seconds, someone dies on the road due to road accidents and it is the 8th leading cause of death and the first among children aged 15–29 years. 1.35 million people globally die every year due to road traffic crashes. An additional 20–50 million suffer from non-fatal injuries, often resulting in long-term disabilities. This costs around 3% of Gross Domestic Product to most countries, and it is a considerable economic loss. The governments have taken various measures such as better road infrastructures and strict enforcement of motor-vehicle laws to reduce these accidents. However, there is still no remarkable reduction in the number of accidents. To ensure driver safety and achieve vision of zero accidents, there is a great need to monitor drivers’ driving styles. Most of the existing driving behavior monitoring solutions are based on expensive hardware sensors. As most people are using smartphones in the modern era, a system based on mobile application is proposed, which can reduce the cost for developing intelligent transport systems (ITS) to a large extent. In this paper, we utilize the accelerometer sensor data and the global positioning system (GPS) sensor deployed in smartphones to recognize driving and speeding events. A driving style recognition system based on fuzzy logic is designed to classify different driving styles and control reckless driving by taking the longitudinal/lateral acceleration and speed as input parameters. Thus, the proposed system uses fuzzy logic rather than taking the crisp values of the sensors. Results indicate that the proposed system can classify reckless driving based on fuzzy logic and, therefore, reduce the number of accidents.

Keywords: Fuzzy logic; accelerometer; global positioning system; driving style

1  Introduction

The 2030 agenda for sustainable development formulated by United Nations sets an ambitious target that the number of deaths and injuries caused by road crashes should be decreased by half by 2020. This target hasn’t been met yet. Nowadays, vehicular traffic is a vital part of our day-to-day lives. India is a large developing country. In India, for the last 50 years, the number of automobiles has grown by 170 times, while the road infrastructure has grown by only nine times [1,2]. The vehicle population in India is over 55,000,000 and growing by 500,000 per year. In developing countries like India, the road quality tends to be variable, and bumpy roads, as well as potholes, are found in many places, even in the core of cities. The flow of traffic is also chaotic. People drive recklessly without obeying the traffic rules, overtaking others, often honking, etc. Heterogeneous vehicles (i.e., ranging from two-wheelers to four-wheelers) all travel on the same road. Therefore, monitoring these roads and vehicular conditions is of great importance. Studies reveal [3,4] that driver behavior is relatively safe if it is adequately monitored.

1.1 Motivation and Our Contribution

Prior work in monitoring driver behavior or road conditions has focused on the developed world, where the road conditions are good, the vehicles travel in an orderly manner, and there are proper lane systems. To monitor traffic, road, and driver behavior, the Intelligent Transportation System (ITS) [5] has been developed. It involves deploying dedicated sensors on roads and vehicles (e.g., GPS-based tracking units, traffic cameras, Doppler radar, etc.). It is less valuable due to its high cost. Our newly developed system is implemented on a smartphone, and it is less expensive compared to the ITS. Second, the proposed system is featured with fuzzy logic to overcome the limitation that strict limits are defined for driving event detection in the system proposed by Kalra et al. [6].

1.2 Prior Work

Previously, various researchers have monitored driving style using specialized hardware sensors deployed inside the vehicle or smartphone. Singh et al. [7] developed an Android application to detect driving patterns using the combined data obtained from the accelerometer sensor, GPS sensor, and audio sound of the microphone sensor. They observed various driving patterns, including speed breaker, lane change left/right, left/right turn, sudden braking, and sudden acceleration. Furthermore, they correlated accelerometer and microphone sensor events. One such event is ‘if lane change turns are not accompanied by sound, it means rash driving’.

Fazeen et al. [8] designed an application using smartphone sensors deployed inside the vehicle to monitor driver style. They used the X- and Y-axis of the accelerometer to measure driver control on steering and brakes. Johnson et al. [9] designed a Mobile-Sensor-Platform system for Intelligent Recognition of Aggressive Driving (MIROAD). They utilized the data taken from various sensors (accelerometer, gyroscope, magnetometer, GPS, and video) and converted the data into a single value using a dynamic time warping algorithm. Chigrurupati et al. [10] developed an Android application to rate the driver using the accelerometer sensor, GPS sensor, and video. Sharma et al. [11] proposed a novel method to detect driver behavior using multiple unmanned aerial vehicles (UAV) vehicular networks. Ryder et al. [12] designed a system that can warn the driver about accidental hotspots through their journey based on their current location. Papadimitriou et al. [13] exploited machine learning approaches to identify the driver distractions mainly caused by using the mobile phone. Tang et al. [14] proposed a novel lane change detection mechanism called FCMNN, which is based on the combination of Fuzzy C-means clustering algorithm and adaptive neural network.

Kamaruddin et al. [15] detected the driver behavior based on emotions collected from speech using a combination of MFCC and MLP. Hu et al. [16] identified the driver activities such as using a mobile phone, talking with passengers, and smoking from still images using a deep learning multi-stream convolutional neural network approach. Zhao et al. [17] proposed a sensor-based head tracking system for monitoring driver behavior. Kalra et al. [18] conducted a survey on various smartphone sensors and methodologies for monitoring driver behavior. Kalra et al. [6] recognized the patterns of various driving events and road events using the accelerometer sensor of a smartphone. The recognized driving patterns include the left turn, right turn, sudden braking andsudden forward acceleration, and the recognized road events patterns include the potholes, bumps, and rough patches. The major limitation of their work is that they defined strict limits for the detection of events. For example, if the acceleration value of the accelerometer sensor is −1 to −3 g at the Y-axis, they denoted it as an abnormal braking event; otherwise, if the acceleration value of the accelerometer sensor is less than −3 g at the Y-axis, they denoted it as a sudden braking event. The difference of 0.1 g in acceleration value is not sufficient to differentiate between normal and reckless driver behavior. Kalra et al. [19] extended the work of Kalra et al. [6] for recognizing the patterns of various driving events using the accelerometer sensor of a smartphone. As an extension, they used a machine learning model (decision tree) to characterize and classify various driving events, such as the left turn, right turn, sudden braking, and sudden forward acceleration.

The paper is organized as follows. Section 1 describes the need forvarious driving style recognition problems and prior work. Section 2 describes the data collection method. In Section 3, various patterns of driving events are described. Section 4 presents a driving style recognition system based on fuzzy logic, and finally, we conclude in Section 5.

2  Data Collection

In this section, the data collection mechanism using asmartphone as the platform is introduced. Meanwhile, the accelerometer sensor and GPS sensor are used for the data collection.

i. Accelerometer:An accelerometer is a sensor used in mobile phones for measuring the tilting and orientation motion of the mobile phone. It is also used to measure the turning events (left turn and right turn) and acceleration events (acceleration and braking). It is an energy-efficient sensor that consumes 1/10 the energy of other sensors in the mobile phone. It is an electromechanical device for measuring acceleration forces. Acceleration forces can be static or dynamic [20]. Static acceleration forces can be measured by Z-axis, like a constant gravitational force. In contrast, dynamic acceleration forces are measured by X- and Y-axis, which are caused by moving or vibrating the accelerometer [21]. Its unit is m/s2. Data is collected from the accelerometer sensor using the Android application “Accelerometer analyzer” in smartphone (shown in Fig. 1). All the values (x, y, and z) of the accelerometer sensor are obtained from the smartphone’s internal hardware sensor. The sampling rate of data collection is five readings per second, i.e., a time interval of 200 ms.

To collect data, the smartphone is placed at a fixed location at the dashboard of a car in portrait mode. The orientation of the X-axis (points toward the right along the smaller side), Y-axis (points up along longer edge), and Z-axis (points towards the sky perpendicular to the plane of the front face of the screen) are shown in Fig. 2. The raw values of the X-, Y- and Z-axis collected from the accelerometer sensorare stored in the smartphone memory in .txt format.

images

Figure 1: The user interface of the data collection application “Accelerometer analyzer” [22]

images

Figure 2: Orientation of smartphone axis

ii. Global positioning system (GPS): It is a satellite-based navigation tracking sensor [23]. GPS sensor gives us the value of longitude and latitude for determining the exact location on the map. It is also used in smartphones to determine the location, route to the destination, and speed of the vehicle. In the proposed driving style recognition model, only speed is taken as an input parameter of the GPS, and other parameters are determined by other sensors deployed in the mobile phone. GPS sensor data is collected from the Android application named “Speedometer GPS” [24], as shown in Fig. 3.

images

Figure 3: The user interface of data collection application “Speedometer GPS” [24]

3  Pattern Analysis of Driving Events

In this section, the pattern of various driving events such as left turn, right turn, forward acceleration, and braking are analyzed.

i. Left Turn: It is determined by the X-axis of the accelerometer deployed in a smartphone. If there is a quick decrease in the magnitude of the X-axis in the negative direction, it indicates the occurrence of left-turn [6]. The pattern observed in the accelerometer application for the left turn is shown in Fig. 4.

images

Figure 4: Left turn event pattern

ii. Right Turn: It is also determined by the X-axis of the accelerometer deployed in a smartphone. If there is a quick increase in the magnitude of the X-axis in the positive direction, it indicates the occurrence of right-turn [6]. The pattern observed in the accelerometer application for right-turn is shown in Fig. 5.

images

Figure 5: Right turn event pattern

iii. Forward Acceleration: It is determined by the Y-axis of the accelerometer deployed in a smartphone. If there is aquick increase in the magnitude of the Y-axis in the positive direction, and correspondingly there is a little deflection in the X- and Z-axis, it indicates the occurrence of forward acceleration [6]. The pattern observed in the accelerometer application is shown in Fig. 6.

iv. Braking: It is determined by the Y-axis of the accelerometer present in a smartphone. If there is a quick decrease in the magnitude of the Y-axis in the negative direction, and correspondingly there is a little deflection in the X- and Z-axis, it indicates the occurrence of braking events [6]. The pattern observed in the accelerometer application is shown in Fig. 7.

images

Figure 6: Forward acceleration event pattern

images

Figure 7: Braking event pattern

4  Fuzzy Logic Based Driving Style Recognition System

In this section, a system for categorizing driving style using fuzzy logic is designed. The driving style can be divided into four categories: below mild, mild, reckless, and very reckless drivers.

4.1 Fuzzy Logic System

The fuzzy logic system maps the input to the output through combination rules, which is not possible through classical binary logic. When there are no extreme boundaries, the need for representation through fuzzy logic arises. With fuzzy logic, it is possible to implement the rules of the form: if(A&B)C, where A, B, and C can be represented in natural language [25]. The following are the basic three steps in fuzzy logic [25]:

•   Fuzzification: In fuzzification, all input variables are converted into linguistic variables. Various functions, such as the triangular and trapezoidal membership functions,are used for fuzzification.

•   Fuzzy inference: In fuzzy inference, various inference rules are used to calculate the fuzzy output.

•   Defuzzification: It is a process for converting fuzzy output to crisp output.

4.2 Fuzzy Logic Based System for Driving Style Recognition

To ensure the safety of drivers, we designed a driving recognition system based on fuzzy logic. The selection of inputs and outputs is determined by performing various real-life experiments. The fuzzy-based driving style inference system is shown in Fig. 8.

images

Figure 8: The proposed driving style recognition system based on fuzzy logic

Accelerometer sensor and GPS sensor data are used as inputs. The sampling rate of data is five readings per second, i.e., atime interval of 200 ms. It is found that 800 ms is large enough to capture the inherent characteristics of aleft turn, right turn, braking detection, and forward acceleration detection because these events last only for a short period of time. From each of the 800 ms windows, the extracted pattern is used as input to the fuzzy inference system. The average acceleration value is taken as input for four windows, i.e., 800 ms, and we use the average value as a single data point.

The accelerometer sensor provides the first input “acceleration” value. This value is used to determine straight driving, turns (left or right), and acceleration events (forward acceleration or braking). The lateral acceleration is used to determine turning events, and longitudinal acceleration is used to determine acceleration events. The corresponding membership values of acceleration events are defined as {straight, mild, reckless}. The value of lateral and longitudinal acceleration ranges from −1.5 to +6 g on X-axis and Y-axis. Fig. 9 plots the acceleration events using the triangular membership function.

images

Figure 9: Triangular membership function of accelerometer data

GPS sensor provides the second input, i.e., “speed” value. The corresponding membership values of speed events are defined as slow, normal, fast, very fast. The value of GPS speed ranges from 0 to 160 km/hr. Fig. 10 plots the speed events using the triangular membership function.

images

Figure 10: Triangular membership function of GPS data

The output “Driving Style” is categorized into four classes defined as: {below mild driver, mild driver, reckless driver, very reckless driver}. The driving style rating ranges from 1 to 10, where 1 indicates the below mild driver and 10 indicates the very reckless driver. Fig. 11 plots the driver’s driving style using the triangular membership function.

images

Figure 11: Triangular membership function of the output variable “driving style”

The fuzzy inference rules for predicting a driver’s driving style are described in Tab. 1. In this model, all rules have been assigned the weight of 1.

images

The whole mapping process for determining driving style by taking longitudinal/lateral acceleration and speed as input parameters after defuzzification is shown in Figs. 12a and 12b.

Fig. 12a shows the driving style map, taking the longitudinal/lateral acceleration and speed as input parameters after defuzzification. The number of rows in Fig. 12a shows the number of inference rules described in Tab. 1. The first row of Fig. 12acorresponds to the first row describing the inference rule in Tab. 1. Similarly, the second row of Fig. 12b corresponds to the second row describing the inference rule in Tab. 1, and so on. The output variable DRIVERSTYLE shows how the rules are applied to the output variable. The bottom plot of the output variable DRIVERSTYLE shows how each rule’s output is combined to obtain the aggregate output of the defuzzified value. The red line in the bottom right plot defines the defuzzified value. In the MATLAB fuzzy toolbox, we can alter the red lines of the first two columns to change the input values and generate a new output response. Fig. 12a shows that if the accelerometer value is 2.38 and the GPS speed is 80, then the driver style value is 6.5, which indicates the driver is reckless. Fig. 12b describes the driving style’s surface map, taking the longitudinal/lateral acceleration and speed as input parameters to output the DRIVERSTYLE after defuzzification. Fig. 12b shows a very high value for the DRIVERSTYLE output parameter if the acceleration values and GPS speed sensor values are very high (i.e., it depicts that the driver’s driving style is very reckless). If the acceleration values and GPS speed sensor values are high, it indicates that the driver’s driving style is reckless. Fig. 12b shows the average value for the DRIVERSTYLE output parameter if the acceleration values and GPS speed sensor values are averaged (i.e., it corresponds to a mild driving style). If both parameters acceleration values and GPS speed sensor values are very low, it indicates that the driving style is below mild.

images

Figure 12: (a) The mapping process for determining driving style by taking longitudinal/lateral acceleration and speed as input parameter after defuzzification. (b) The mapping process for determining driving style by taking longitudinal/lateral acceleration and speed as input parameter after defuzzification

5  Conclusion

In this paper, we exploit the data obtained from the accelerometer sensor and GPS sensor deployed in a smartphone for recognizing the driving and speeding events. Various driving event patterns have been analyzed, such as the left turn, right turn, acceleration, and braking. We have classified various driving styles and designed a driving style recognition system based on fuzzy logic, taking the longitudinal/lateral acceleration and speed as input parameters. The proposed model is implemented in MATLAB [26] and fuzzy logic is exploited to recognize the driving style. In contrast to previous research on driving style recognition, our system is implemented entirely on a mobile device without using external hardware. Our proposed system is also a system based on fuzzy logic rather than the one using crisp values. The experimental results show that our system can recognize various types of driving styles, including reckless driving.

The limitation of our proposed approach is that this approach only works when the phone is placed at a fixed location on the dashboard of a vehicle in portrait mode. In the future, we will try to conduct a virtual reorientation of the mobile phone to matchthe phone’s axis. Future researches can also incorporate other sensors of mobile phones for better results.

Acknowledgement: We appreciate the linguistic assistance provided by TopEdit (https://www.topeditsci.com) during the preparation of this manuscript.

Funding Statement: The authors received no specific funding for this study.

Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.

References

  1. Global Status Report on Road Safety, [Online]. Available: http://morth.nic.in/ (Accessed on Dec 20, 2020).
  2. Driving Conditions in India, [Online]. Available: http://www.indiandrivingschools.com/driving-conditions-in-india.php (Accessed on Dec 22, 2020).
  3. J. S. Hickmanand and E. S. Geller, “Self-management to increase safe driving among short-haul truck drivers,” Journal of Organizational Behaviour Management, vol. 23, no. 4, pp. 1–20, 2005.
  4. How Am I Driving Bumper Stickers and Online Driver Safety Training for Employees, [Online]. Available: http://dmvreportcard.com/How-Am-I-Driving-Safety-Bumper-Stickers.html (Accessed on Dec 25, 2020).
  5. Intelligent Transportation Systems, [Online]. Available: http://www.its.dot.gov/ (Accessed on Dec 28, 2020).
  6. N. Kalra, G. Chughand and D. Bansal, “Analyzing driving and road events via smartphone,” International Journal of Computer Applications, vol. 98, no. 12, pp. 5–9, 2014.
  7. P. Singh, N. Juneja and S. Kapoor, “Using mobile phone sensors to detect driving behaviour,” in Proc. 3rd ACM Symp. on Computing for Development, Bangalore, vol. 1–53, pp. 53, 2013.
  8. M. Fazeen, B. Gozick, R. Dantu, M. Bhukhiya and M. C. González, “Safe driving using mobile phones,” IEEE Transactions on Intelligent Transportation Systems, vol. 13, no. 3, pp. 1462–1468, 2012.
  9. D. A. Johnson and M. M. Trivedi, “Driving style recognition using a smartphone as a sensor platform,” in Proc. IEEE 14th Int. Conf. on Intelligent Transportation Systems, Washington, DC, USA, pp. 1609–1615, 2011.
  10. S. Chigurupati, S. Polavarapu, Y. Kancherla and A. K. Nikhath, “Integrated computing system for measuring driver safety index,” International Journal of Emerging Technology and Advanced Engineering, vol. 2, no. 6, pp. 384–388, 2012.
  11. V. Sharma, H. C. Chen and R. Kumar, “Driver behaviour detection and vehicle rating using multi-UAV coordinated vehicular networks,” Journal of Computer and System Sciences, vol. 86, no. 1, pp. 3–32, 2017.
  12. B. Ryder, B. Gahr, P. Egolf, A. Dahlinger and F. Wortmann, “Preventing traffic accidents with in-vehicle decision support systems-the impact of accident hotspot warnings on driver behaviour,” Decision Support Systems, vol. 99, no. 1, pp. 64–74, 2017.
  13. E. Papadimitriou, A. Argyropoulou, D. I. Tselentis and G. Yannis, “Analysis of driver behaviour through smartphone data: The case of mobile phone use while driving,” Safety Science, vol. 119, no. 1, pp. 91–97, 2019.
  14. J. Tang, S. Yu, F. Liu, X. Chen and H. Huang, “A hierarchical prediction model for lane-changes based on combination of fuzzy C-means and adaptive neural network,” Expert Systems with Applications, vol. 130, no. 1, pp. 265–275, 2019.
  15. N. Kamaruddin, A. W. A. Rahman, K. I. M. Halim and M. H. I. M. Noh, “Driver behaviour state recognition based on speech,” Telkomnika, vol. 16, no. 2, pp. 852–861, 2018.
  16. Y. Hu, M. Lu and X. Lu, “Driving behaviour recognition from still images by using multi-stream fusion CNN,” Machine Vision and Applications, vol. 30, no. 5, pp. 851–865, 2019.
  17. Y. Zhao, L. Görne, I. M. Yuen, D. Cao, M. Sullman et al., “An orientation sensor-based head tracking system for driver behaviour monitoring,” Sensors, vol. 17, no. 11, pp. 2692, 20
  18. N. Kalraand and D. Bansal, “Analyzing driver behaviour using smartphone sensors: A Survey,” International Journal of Electronics and Electrical Engineering, vol. 7, no. 7, pp. 697–702, 2014.
  19. N. Kalra and D. Bansal, “Detecting and characterizing driving events via smartphone,” in Proc. of 5th Int. Conf. on Electronics Engineering & Computer Science, 2014, Kolkata: Elsevier, 2014.
  20. Accelerometer, [Online]. Available: http://en.wikipedia.org/wiki/Accelerometer (Accessed on Dec 30, 2020).
  21. DimensionEngineering, [Online]. Available: http://www.dimensionengineering.com/info/accelerometers (Accessed on Dec 30, 2020).
  22. AccelerometerAnalyzer, [Online]. Available: https://play.google.com/store/apps/details?id=com.lul.accelerometer&hl=en (Accessed on Dec 22, 2020).
  23. GPS, [Online]. Available: http://en.wikipedia.org/wiki/Global_Positioning_System (Accessed on Dec 30, 2020).
  24. SpeedometerGPS, [Online]. Available: https://play.google.com/store/apps/details?id=luo.speedometergps&hl=en (Accessed on Dec 31, 2020).
  25. D. Dorr, D. Grabengiesser and F. Gauterin, “Online driving style recognition using fuzzy logic,in Proc,” in 17th IEEE Int. Conf. on Intelligent Transportation Systems, Qingdao, pp. 1021–1026, 2014.
  26. MATLAB, [Online]. Available: https://in.mathworks.com/products/matlab/ (Accessed on Jan 2, 2021).
images This work is licensed under a Creative Commons Attribution 4.0 International License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.