Mobile app-based study of driving behaviors under the influence of cannabis
WINLAB, Department of Electrical and Computer Engineering, Rutgers University, New Brunswick, NJ, USA
Department of Computer Science, New Jersey Institute of Technology, Newark, NJ, USA
Department of Computer and Information Sciences, Temple University, Philadelphia, PA, USA
Robert Wood Johnson Medical School, Rutgers University, New Brunswick, NJ, USA
Abstract
Cannabis use has become increasingly prevalent due to evolving legal and societal attitudes, raising concerns about its influence on public safety, particularly in driving. Existing studies mostly rely on simulators or specialized equipment, which do not capture the complexities of real-world driving and pose cost and scalability issues. In this paper, we investigate the effects of cannabis on driving behavior using participants’ smartphones to gather data in natural settings. Our method focuses on three critical behaviors: weaving & swerving, wide turning, and hard braking. We propose a two-step segmentation algorithm for processing continuous motion sensor data and use threshold-based methods for efficient detection. A custom application autonomously records driving events during actual road scenarios. On-road experiments with 9 participants who consumed cannabis under controlled conditions reveal a correlation between cannabis use and altered driving behaviors, with significant effects emerging approximately 2∼3 h after consumption.
Untitled section
Keywords: Mobile computing, Cannabis-influenced driving behavior
Article notes
Untitled section
Issue date 2025 Jun.
1.Introduction
Cannabis has become widely used in recent years due to changing legal and social attitudes toward its use. As of 2024, 39 states in the United States allow the medical use of cannabis, while 24 states make it legal for recreational use. Despite its benefits, the psychoactive compound tetrahydrocannabinol (THC) in cannabis is known to affect brains by disrupting central nervous system functions, resulting in impairments such as reduced attention, altered perception of distance and time, and slower reaction speeds. While researchers have been exploring the effects of cannabis on human behaviors such as walking, food intake, work performance, and psychological states (Volkow et al., 2016), the specific influence of cannabis use on driving behaviors remains unclear.
Existing studies on cannabis-influenced driving behaviors mainly rely on simulators to evaluate driving performance (Hartman, Brown, Milavetz, Spurgin, Pierce, Gorelick, Gaffney, & Huestis, 2015). For instance, Hartman et al. (2015) analyzed the relationship between blood cannabis concentration and driving impairment using a driving simulation. However, simulations often fail to capture the complexities of real-world driving environments (e.g., road texture, weather conditions, and ambient noise) or dynamic events (e.g., sudden lane changing of other vehicles and unexpected obstacles), leading to discrepancies in driving behaviors observed in simulators versus on-road studies (Klüver, Herrigel, Heinrich, Schöner, & Hecht, 2016). Recognizing these limitations, a few works (Arkell et al., 2020; Ramaekers, Robbe, & O’Hanlon, 2000) have shifted to on-road study. However, these approaches require installing specialized hardware (e.g., camera and optical device) inside vehicles, increasing the cost and complexity of deployment.
In this paper, we design a low-cost and scalable method leveraging smartphone motion sensors to study cannabis-influenced driving behaviors in real-world driving. Smartphones are ubiquitous and equipped with motion sensors capable of detecting driving patterns, making them ideal for real-world behavioral studies. Our empirical study finds that cannabis use can result in characteristics in three types of driving behaviors (i.e., driving straight, turning, and braking). Focusing on these unique, critical driving behaviors, we conduct the first smartphone-based cannabis-influenced driving behavior study to understand the extent of driving behaviors associated with cannabis use. We illustrate our study methodology in Fig. 1. Compared to previous works using motion sensors in smartphones to detect general driving behaviors (Chen, Yu, Zhu, Chen, & Li, 2015), our work is unique and innovative because it is the first to leverage smartphone motion sensor data to study on-road driving behaviors under the influence of cannabis.
Real-world driving behavior analysis using smartphones presents several practical challenges. First, the motion sensor data is influenced by the smartphone’s placement and orientation within the vehicle, potentially obscuring distinct patterns linked to cannabis-influenced driving. To address this, we extend existing methods (Wang et al., 2013) to automatically align the smartphone’s coordinate system with that of the vehicle, regardless of its placement. Second, continuous motion sensor data contains a mix of driving behaviors, necessitating a robust segmentation method to isolate individual actions for meaningful analysis. We tackle this by developing a two-step segmentation algorithm that isolates specific behaviors — such as driving straight, turning, and braking — potentially influenced by cannabis. Third, designing an effective algorithm to determine these behaviors is critical for obtaining reliable results. We therefore propose a hierarchical behavior identification algorithm that efficiently extracts features corresponding to these three driving actions. We summarize our main contributions as follows:
- We conduct the first smartphone-based study for cannabis-influenced driving behaviors in real-world scenarios. Our system leverages the motion sensors in smartphones, facilitating scalable analysis among real cannabis users.
- We design a two-step segmentation algorithm to process continuous motion sensor data, isolating distinct driving behavior types influenced by cannabis.
- We develop a threshold-based hierarchical algorithm to efficiently identify and analyze features indicative of cannabis-influenced driving behaviors. It is lightweight and suitable for real-time processing on smartphones.
- We conduct extensive on-road experiments involving 9 participants with diverse cannabis usage patterns and driving routes. Our study finds that the influence of cannabis is associated with specific driving behaviors (i.e., weaving & swerving and wide turning), with the most significant influence within 2∼3 h after cannabis use.
2.Preliminary study
The consumption of cannabis affects cognitive functionalities in several key ways, such as attention and reaction time (Ramaekers, Berghaus, van Laar, & Drummer, 2009). To study how cannabis use influences driving behaviors, we focus on examining the correlative relationship between driving performance and cannabis use in terms of driving straight, turning, and braking. Specifically, we investigate three critical driving behaviors potentially influenced by cannabis use: weaving & swerving, wide turning, and hard braking (Stuster et al., 1993). (i) Weaving is defined as the vehicle moving laterally within its designated traffic lane, creating a zigzag or meandering pattern. Swerving refers to sudden and sharp lateral movements within the vehicle’s lane. (ii) Wide turning implies that the vehicle is executing a turn without being slowed down which causes a larger-than-usual turning radius. (iii) Hard braking refers to the act of rapidly and forcefully stepping on the brake pedal in a vehicle, resulting in a sudden and significant reduction in speed.
We conduct preliminary experiments that use smartphones to monitor driving behaviors by analyzing accelerometer and gyroscope data. We observe slight fluctuations in the acceleration around the x-axis caused by the turning behavior, whereas there are two fluctuations in opposite directions on the angular velocity around the z-axis. The wide turning behavior is conducted with a high vehicle speed without slowing down. For hard braking, we find a clear and sudden decrease in acceleration along the y-axis, reaching a significant negative value and remaining negative, while the accelerations along the x- and z-axes remain stable. In contrast, there are no significant changes in angular velocity. The studies show that three different driving behaviors lead to distinguishable patterns in motion sensor readings.
3.System overview
The basic idea of our system is to analyze accelerometer and gyroscope reading changes caused by cannabis-influenced driving behaviors (i.e., weaving & swerving, wide turning, and hard braking). Design such a smartphone-based system faces the challenges of aligning the coordinate system of the smartphone, segmenting the continuous motion sensor data into separate driving behaviors, and measuring specific driving behavior type. To address the above challenges, we design three procedures in our system, as illustrated in Fig. 2. In Driving Data Acquisition, We develop a prototyped App which can detect driving events and collect motion sensor data automatically. The Motion Sensor Data Preprocessing mechanism processes raw data into behavior segments, aligning with the vehicle’s coordinate system. The Driving Performance Assessment compares extracted features them with thresholds to assess driving behaviors associated with an episode of cannabis use.
4.Data preprocessing
4.1.Coordinate alignment
Motion sensor data cannot derive vehicle dynamics directly since the coordinate system of the smartphone is not aligned with the vehicle’s. Wang et al. (2013) used a coordinate alignment scheme to align the smartphone coordinate system with the vehicle’s. However, the method (Wang et al., 2013) requires selecting the vehicle’s stationary and acceleration or deceleration periods manually, which cannot be used for efficient online analysis. To solve this challenge, we design a method to automatically select data durations when the vehicle is stationary, accelerating in a straight line, or decelerating in a straight line. To capture the data duration when the vehicle is stationary, we set a filter to make sure the accelerometer and gyroscope readings are kept close to 0. In order to determine the coordinate rotation, a period with gyroscope readings close to 0 while accelerometer readings on the y-axis changing obviously is required.
4.2.Driving behavior segmentation
The motion sensor data is continuous and multiple driving behaviors are mixed together. To identify separate driving behaviors associated with cannabis use, we propose a two-step segmentation method to determine the beginning and ending points of each driving behavior. We propose an adaptive threshold method to determine the beginning and ending of a driving behavior for both steps.
In step 1, we define rotation-based behaviors to be those that have obvious gyroscope readings (i.e., turning, weaving & swerving) and segment out all the rotation-based behaviors leveraging gyroscope readings. Rotation-based behaviors can be easily segmented based on gyroscope readings. When a driving behavior begins, the standard deviation of gyroscope readings around z-axis sharply rises to a greater value than the threshold until the end of the behavior. To avoid segmenting one behavior into multiple ones, we calculate the simple moving average (SMA) of gyroscope readings around z-axis. Large SMA values reflect manipulating the steering wheel within a short time duration. When standard deviation and SMA are smaller than the thresholds and , we consider that the behavior ends.
In step 2, after segmenting all rotation-based behaviors, we focus on non-rotation-based behaviors (i.e., straight driving and braking). As these behaviors do not involve any steering operations, we calculate the magnitude of acceleration on y-axis. If the magnitude of the acceleration is greater than the threshold , we determine the beginning of a non-rotation-based behavior. Then, if the magnitude is smaller than the threshold , the behavior ends.
5.Driving performance assessment
We extract representative statistical features according to the analysis in Section 2. Accelerometer readings on y-axis are used for identify braking behaviors. To determine the rotation-based behaviors, gyroscope readings around z-axis and accelerometer readings on x- and y-axes are utilized.
Driving Behavior Type Identification.
We use threshold-based methods on accelerometer and gyroscope readings to determine driving behavior types (i.e., driving straight, turning, and braking). If the range of gyroscope around z-axis is smaller than the threshold , there is no wheel turning action and the potential behavior types are straight driving or braking. If the maximum absolute acceleration on y-axis is greater than , there is a deceleration action and behavior type is braking. When there are some wheel turning actions, if the number of inverted points on the gyroscope reading pattern around the z-axis is smaller than 3, the behavior type is identified as turning. Otherwise, the behavior type is determined as driving straight.
Critical Driving Behavior Determination.
To determine weaving & swerving behaviors, the algorithm analyzes the accelerometer readings on x-axis and gyroscope readings around z-axis. A typical gyroscope reading pattern is shown in Fig. 3(a). If the range of accelerometer readings is smaller than the threshold and the range of gyroscope readings is smaller than the threshold , there is no wheel turning action. Otherwise, the algorithm examines the number of inverted points of gyroscope readings. If there are more than 2 inverted points, the behavior is determined as weaving & swerving. To identify weaving behaviors with tiny changing gyroscope readings around the z-axis, we calculate the mean crossing rate (MCR). In typical straight driving, the gyroscope readings around z-axis have a mean value close to 0 and exhibit multiple frequent small changes around the mean value, resulting in a high MCR. When the MCR is smaller than the threshold , the behavior is identified as weaving & swerving.
In wide turning identification, we first calculate the range of gyroscope readings around z-axis, as shown in Fig. 3(b). If the range is greater than the threshold , the vehicle may have a few turning actions, indicating potential wide turning behaviors. Then we extract the standard deviation of acceleration on x-axis. If it is greater than the threshold there are multiple turning attempts, and the behavior is identified as a wide turning.
To identify hard braking, the maximum absolute acceleration value on y-axis is analyzed, as shown in Fig. 3(c). If the maximum absolute acceleration on y-axis exceeds the threshold , the vehicle has a large braking acceleration, and the behavior is identified as a hard braking. If the maximum absolute acceleration on y-axis is smaller than the threshold the jerk value (i.e., the changing rate of acceleration with respect to time) is calculated. A greater jerk value than a threshold indicates that the driver slams on the brake pedal and performs a hard braking.
6.Evaluation
6.1.Experiments setup
Our datasets include data from 9 participants across various genders and ages collected in 6 months. Each participant will take several surveys to record the amount and timing of cannabis consumption every day. The average number of days for data collection is 13.8 days per participant.
To ensure a secure and reliable on-road driving data collection and reduce user interactions, we develop an Android app that can detect driving events and start data collection automatically without requiring any user interaction beyond the app installation. All participants install our data collection app on their smartphones, which are placed in a phone mount in the vehicle. The app automatically detects driving events and records data without requiring any manual operations from the participants, which avoids introducing any distractions during driving. The data collected by the smartphone is uploaded to a cloud server for subsequent analysis. All our data collection procedures were approved by our university’s Institutional Review Board (IRB).
We quantify the influence of cannabis through self-reported highness ratings. Most of the impairing psychomotor effects of cannabis consumption (e.g., slowed reaction time) occur in the first 2 h of use (Neavyn, Blohm, Babu, & Bird, 2014), and last 3∼4 h (Ramaekers et al., 2009). Therefore, we focus on driving behavior analysis considering four time intervals: within 1 h, 1∼2 h, 2∼3 h, and more than 3 h. We define driving behavior as unaffected if no cannabis was used within 6 h before driving (Ogourtsova, Kalaba, Gelinas, Korner-Bitensky, & Ware, 2018).
6.2.Evaluation metrics
We evaluate driving performance using the percentage of critical driving behaviors (i.e., weaving & swerving, wide turning, and hard braking) in one trip (i.e., the driving event between a driving start and end) as a key metric. Both the percentage in a specific driving behavior type and the overall percentage across all types are calculated.
We also employ the one-way Analysis of Variance (ANOVA) method to analyze the differences in mean values across groups to determine the correlation between cannabis use and driving performance. In this analysis, the F-statistic is a key metric that quantifies the ratio of variance between groups to variance within groups. A larger F-statistic value f indicates that the differences between groups are more significant compared to the differences within groups.
6.3.Influence of cannabis use over time
Fig. 4 illustrates the influence of cannabis use on driving behaviors over time. The baseline is the critical driving behavior percentage without cannabis use. To ensure similar cannabis influence on human feelings, data samples with highness ratings from 7∼9 are selected.
The results indicate that the overall percentage of critical driving behaviors is influenced over time intervals after cannabis use. Within the first hour of cannabis consumption, participants’ critical driving behaviors show limited differences compared to the baseline. However, as time increases, they exhibit increasing percentages, peaking 2∼3 h after cannabis use. This finding aligns with the results presented in Ramaekers et al. (2009), where the percentage of impacted psychomotor is highest after 1~3 h of cannabis oral intake. Ogourtsova et al. (2018) shows similar results that when a participant conducts a strange driving task, 3 h after cannabis use has the most significant influence on driving performance, compared to no cannabis use or 1 h after taking cannabis. Furthermore, the influence of cannabis over time varies depending on the specific type of driving behavior. Cannabis use has an obvious influence on driving straight and turning behavior types, leading to more weaving & swerving and wide turning behaviors, with the most significant influence occurring 2∼3 h after consumption. In contrast, braking performance is slightly influenced by cannabis use.
6.4.Correlation analysis with driving
In this subsection, we apply the one-way ANOVA to examine the correlation between critical driving behavior percentages and highness ratings induced by cannabis use at various time intervals after consumption. The highness ratings are categorized into four groups: 0 (baseline), 1∼3,4∼6, and 7∼9. As shown in Table 1, the statistical correlation between highness ratings and the overall percentage of critical driving behaviors increases over time after cannabis use, as reflected in the progressively higher f (rising from 0.54 to 6.42), peaking between 2 and 3 h. During this interval, there is a statistically significant difference across different highness ratings, with a p-value of 0.01, indicating that highness ratings have a significant influence on the driving performance. More than 3 h after cannabis use, f drops to 1.49, with a p-value of 0.22. This suggests that the influence of cannabis on driving performance is no longer statistically significant.
| Time intervals after cannabis use | Different critical driving behavior percentages; correlation coefficient | |||
|---|---|---|---|---|
| Weaving & swerving percentage | Wide turning percentage | Hard braking percentage | Overall percentage | |
| <1 h | f = 0.49, p = 0.69 | f = 0.97, p = 0.41 | f = 0.39, p = 0.76 | f = 0.54, p = 0.65 |
| 1–2 h | f = 2.47, p = 0.05 | f = 3.55, p = 0.03 | f = 0.51, p = 0.68 | f = 2.43, p = 0.07 |
| 2–3 h | f = 2.17, p = 0.07 | f = 4.66, p = 0.01 | f = 0.32, p = 0.81 | f = 6.42, p = 0.01 |
| >3 h | f = 0.89, p = 0.45 | f = 1.86, p = 0.14 | f = 0.43, p = 0.73 | f = 1.49, p = 0.22 |
7.Conclusion
In this paper, we study the influence of cannabis on on-road driving behaviors. Particularly, we design a low-cost on-road test method that utilizes readily available motion sensors in the smartphone inside the vehicle. Our method uses a two-step segmentation algorithm to process continuously collected motion sensor data into separate driving behaviors. After that, we design a threshold-based behavior identification algorithm to identify cannabis-impaired driving behaviors. We develop a prototyped app for data collection and recruit cannabis users to conduct extensive practical experiments. The results show that cannabis use is associated with specific driving behaviors (i.e., weaving & swerving and wide turning), with the most significant influence within 2∼3 h after cannabis use, reaching a peak at around 3 h.
Acknowledgments
This work was supported by the National Institutes of Health, United States Grant R21DA054614 and the National Science Foundation, United States Grants CNS2120396, CCF2211163, IIS2311596, CNS2120276, CNS2145389, IIS2311597, CNS2329279, DGE2414365, DGE2414366.
Footnotes
Footnote Group
Data availability
The data that has been used is confidential.
References
Untitled section
References
- Arkell Thomas R, Vinckenbosch Frederick, Kevin Richard C, Theunissen Eef L, McGregor Iain S, & Ramaekers Johannes G (2020). Effect of cannabidiol and 𝛥9-tetrahydrocannabinol on driving performance: a randomized clinical trial. Jama, 324(21), 2177–2186.
- Chen Zhongyang, Yu Jiadi, Zhu Yanmin, Chen Yingying, & Li Minglu (2015). D 3: Abnormal driving behaviors detection and identification using smartphone sensors. In 2015 12th annual IEEE international conference on sensing, communication, and networking (pp. 524–532). IEEE.
- (2015). Cannabis effects on driving lateral control with and without alcohol. Drug and Alcohol Dependence, 154, 25–37.
- Klüver Malte, Herrigel Carolin, Heinrich Christian, Schöner Hans-Peter, & Hecht Heiko (2016). The behavioral validity of dual-task driving performance in fixed and moving base driving simulators. Transportation Research Part F: Traffic Psychology and Behaviour, 37, 78–96.
- Neavyn Mark J., Blohm Eike, Babu Kavita M., & Bird Steven B. (2014). Medical marijuana and driving: a review. Journal of Medical Toxicology, 10, 269–279.
- Ogourtsova Tatiana, Kalaba Maja, Gelinas Isabelle, Korner-Bitensky Nicol, & Ware Mark A. (2018). Cannabis use and driving-related performance in young recreational users: a within-subject randomized clinical trial. Canadian Medical Association Open Access Journal, 6(4), E453–E462.
- Ramaekers Johannes G, Berghaus Günter, van Laar MargrietW, & Drummer Olaf H (2009). Dose related risk of motor vehicle crashes after cannabis use: an update. Drugs, Driving and Traffic Safety, 477–499.
- Ramaekers Johannes Gerardus, Robbe HWJ, & O’Hanlon JF12404625 (2000). Marijuana, alcohol and actual driving performance. Human Psychopharmacology: Clinical and Experimental, 15(7), 551–558.
- Stuster Jack, et al. (1993). The detection of DWI motorcyclists: Technical report, United States: National Highway Traffic Safety Administration.
- Volkow Nora D, Swanson James M, Evins A Eden, DeLisi Lynn E, Meier Madeline H, Gonzalez Raul, et al. (2016). Effects of cannabis use on human behavior, including cognition, motivation, and psychosis: a review. JAMA Psychiatry, 73(3), 292–297.
- Wang Yan, Yang Jie, Liu Hongbo, Chen Yingying, Gruteser Marco, & Martin Richard P (2013). Sensing vehicle dynamics for determining driver phone use. In Proceeding of the 11th annual international conference on mobile systems, applications, and services (pp. 41–54).
Associated Data
Data Availability Statement
The data that has been used is confidential.