Tom Driessen, Lokin Prasad, Pavlo Bazilinskyy, Joost De Winter (2022). Identifying Lane Changes Automatically using the GPS Sensors of Portable Devices. In: Human Factors in Transportation. AHFE Open Access, vol. 60, pp. 50–59. https://doi.org/10.54941/ahfe1002433
Department of Cognitive Robotics, Faculty of Mechanical, Maritime and Materials, Engineering, Delft University of Technology, Mekelweg 2, 2628 CD Delft, The Netherlands ↗
Mobile applications that provide GPS-based route navigation advice or driver diagnostics are gaining popularity. However, these applications currently do not have knowledge of whether the driver is performing a lane change. Having such information may prove valuable to individual drivers (e.g., to provide more specific navigation instructions) or road authorities (e.g., knowledge of lane change hotspots may inform road design). The present study aimed to assess the accuracy of lane change recognition algorithms that rely solely on mobile GPS sensor input. Three trips on Dutch highways, totaling 158 km of driving, were performed while carrying two smartphones (Huawei P20, Samsung Galaxy S9), a GPS-equipped GoPro Max, and a USB GPS receiver (GlobalSat BU343-s4). The timestamps of all 215 lane changes were manually extracted from the forward-facing GoPro camera footage, and used as ground truth. After connecting the GPS trajectories to the road using Mapbox Map Matching API (2022), lane changes were identified based on the exceedance of a lateral translation threshold in set time windows. Different thresholds and window sizes were tested for their ability to discriminate between a pool of lane change segments and an equally-sized pool of no-lane-change segments. The overall accuracy of the lane-change classification was found to be 90%. The method appears promising for highway engineering and traffic behavior research that use floating car data, but there may be limited applicability to real-time advisory systems due to the occasional occurrence of false positives.
Systems capable of detecting lane changes, such as lane departure warning systems, have become common in new cars. These systems usually rely on cameras to detect lane boundaries (e.g., Toyota, 2022; Volkswagen, 2021). Less common are methods that identify lane changes without using cameras. Such methods could be relevant for three reasons.
The first reason is that, even though modern cars are equipped with cameras, it may take many years before this technology is commonplace.
Identifying Lane Changes Automatically using the GPS Sensors of Portable Devices 51
Young drivers, for example, often buy their vehicles second-hand and thus have to rely on safety systems in old models, yet it can be argued that this is the group most in need of modern safety systems (Lee, 2007). The widespread availability of smartphones may provide such an opportunity. If lane depar- ture warning systems became available on smartphones, they could provide safety alerts and lane-level navigation assistance to virtually all drivers.
A second motivation for developing cameraless methods of lane change detection lies in their potential for traffic behavior research and road design. The increasing availability of floating car data allows for studying traffic with more detail than traditional, hardware-intensive methods of data collection such as induction loops and traffic cameras (e.g., Arman and Tampère, 2021). Floating car data can reveal how groups of drivers perform maneuvers on specific sections, which may inform the design of highways (Vos et al., 2021).
Thirdly, knowledge on where, how often, or how aggressively drivers change lanes can serve as input for driving style recognition algorithms, which are used in smartphone applications that give drivers feedback and coaching about their driving style (for reviews, see Michelaraki et al., 2021; Singh and Kathuria, 2021). Such applications are increasingly used by vehicle insura- nce companies to offer discounted premiums to drivers that adopt non-risky driving styles (Baecke and Bocca, 2017; Tselentis et al., 2017).
Related Work
The accuracy of consumer-grade and smartphone-based GPS receivers is in the range of 3–13 meters (Merry and Bettinger, 2019; Izet-Ünsalan and Ünsa- lan, 2020; Wing et al., 2005), which is too low to estimate the receiver’s location on a lane-level resolution. However, as the error in the measure- ments is largely caused by atmospheric disturbances or signal reflections on surrounding structures, it is expected to remain relatively constant on open highways (Sanz Subirana, 2011; Izet-Ünsalan and Ünsalan, 2020). This means that relative changes in the GPS trajectory may be indicative of cer- tain highway maneuvers. When combined with information about the road trajectory, changes in the lateral distance between the road and the vehi- cle’s trajectory may be used to identify lane changes. Sekimoto et al. (2012) demonstrated this by plotting the lateral distance to the road centerline of six lane changes. Their results showed that lane changes were visually discrimi- nable from straight driving, but a formal assessment was lacking. A further evaluation of this concept was performed by Faizan et al. (2019). By calcula- ting the difference in heading angle between the vehicle’s trajectory and the road trajectory and multiplying its sine with the traveled distance since the last observation, they obtained the “instantaneous lateral distance,” which is, in fact, a measure of lateral velocity. They then integrated this variable by summing up subsequent values, obtaining the “accumulative lateral dista- nce.” When this lateral drift exceeded a threshold of 1.5, it would present an alarm. They reported high detection accuracies, but it should be noted they relied on a GPS device that sampled at 10 Hz, whereas most smartphones typically operate at sampling rates of 1 Hz.
Figure 1: Route (blue) with excluded section from Trip 1 after a wrong exit (red).
Aim The literature to date suggests that it is feasible to detect lane changes based solely on GPS signals. However, in the existing analyses we found, detail was missing on how such algorithms perform on highway sections that contain many irregularities such as curves and on- and off-ramps, and how performance varies between devices. The current paper describes the design and evaluation of a lateral-distance-based algorithm on ‘easy’ roads (a straight highway section leading from Delft to Rotterdam) and on a more difficult highway (Rotterdam’s ring road). Furthermore, we investigated if performance varies between four portable devices.
METHOD
Data Collection Data were collected during three trips from the city of Delft (exit “Zuid”), via the A13 to the Rotterdam Ring Road, making a full lap on the Ring, and back to Delft-Zuid over the A13 (Figure 1). The total distance traveled during the three trips, excluding the Beneluxtunnel and an accidental detour in Trip 1, was 158 km. The first trip was on June 4, 2021, in a 2018 Peugeot 108 (915 kg), and the second and third trips were on October 21, 2021, in a 2021 KIA Picanto (974 kg), both small city cars. The first author drove the car and changed lanes whenever it was judged safe and unobtrusive to other traffic. This resulted in 215 lane changes (110 right, 105 left). The lane width on the route was 3.5 m. The speed limit was 100 km/h, which was also the target speed of the driver. The speed varied somewhat due to occasional busy segments on the Rotterdam Ring road.
GPS data were recorded at a frequency of 1 Hz on a Samsung Galaxy S9 and a Huawei P20 Lite (using the Android app “GPS Logger” by BasicAir- Data, 2022), on a GlobalSat BU343-s4 USB GPS receiver, and on a GoPro Max. The GoPro recorded GPS at 18 Hz, which was downsampled to 1 Hz for comparability with the other signals by taking the last entry of every
Identifying Lane Changes Automatically using the GPS Sensors of Portable Devices 53
Figure 2: GoPro’s view at the moment a lane change was annotated.
18 instances. The smartphones were mounted to the dashboard using stan- dard car phone holders, whereas the GlobalSat’s antenna was magnetically attached to the top of the car. The GoPro was mounted facing forward beh- ind the windshield in the middle of the dashboard. Besides recording GPS, the GoPro made video recordings which were later used to manually annotate the moments the car changed lanes. Lane change timestamps were annotated when the GoPro’s view was visually centered with a lane boundary marking (Figure 2). Double lane changes were annotated when the car drove on the middle of the center lane and were treated the same as single-lane change events in the analysis.
Data Processing The road geometry was obtained by snapping the GoPro’s GPS recordings to OpenStreetMap’s road network using Mapbox Map Matching API v5. For each GPS coordinate, the lateral distance to the road’s trajectory was calculated. The distance was given a positive sign when the GPS coordinate was on the right side of the road (when facing in the direction of travel) and a negative sign when it was on the left side of the road. This resulted in a signal representing the lateral position of each GPS coordinate with respect to the road. Figure 3 shows an example of a recorded lane change and its lateral position signal during the lane change.
Analysis We developed an algorithm that discriminates segments with a lane change from segments without a lane change. Therefore, we first created two classes consisting of isolated segments with a window size W of data points.
The positive class contained segments during which a lane change occur- red. A segment was created for each lane change annotation timestamp by extracting the W data points with timestamps nearest to the lane change timestamp. As the sampling frequency of each device was 1 Hz, the duration of each extracted segment (the time between the first and last element) was W −1 seconds. The lateral position values of all left lane changes were mul- tiplied by −1. This way, lane changes in both directions can be recognized by the same algorithm.
Figure 3: a: Map view of road section with a lane change. b: Lateral distance of the GPS points relative to the road during the lane change (in meters). c, d, e: Video segments of the lane change from the perspective of the ego vehicle, where panel (d) shows the moment the lane change was manually annotated (the camera view is visually centered with the lane boundary).
The negative class consisted of segments during which no lane change was performed. These segments were obtained by splitting up segments during which no lane change annotation was present into non-overlapping intervals of W −1 seconds. Only segments were included that were at least 5 seconds removed from any lane change annotation. This procedure resulted in a larger pool of negative segments than positive intervals (more time is spent dri- ving without changing lanes). To create classes of equal size, samples were randomly drawn from this pool without replacement.
The difference between the first and the last element was computed for each segment. This value represented the accumulated lateral translation during a segment. If this value exceeded a threshold T, the segment was classi- fied as a lane change; if this value did not exceed T, the segment was classified as no lane change. The first step of the evaluation was to find the threshold values T and window size W that gave the best classification accuracy for all devices.
For the remainder of the analysis, we fixed the values of T and W to those that gave the highest classification accuracy. Next, using the same procedure as above, we evaluated the classification accuracy between the devices and between the A13 section and the Rotterdam Ring section.
RESULTS
Figure 4 shows lateral position data for all segments and devices combined when using a window size W of 8 data points. It can be seen that, on a group level, lane-change segments are distinguishable from no-lane-change segments.
Identifying Lane Changes Automatically using the GPS Sensors of Portable Devices 55
Figure 4: Left: Lateral position relative to the segment’s mean for all lane changes and all four devices (n = 215 lane changes × 4 devices −1 missing segment = 859). The lane change took place at Time = 0 s. Right: Lateral position relative to the segment’s mean for segments in which no lane change took place.Table 1. Classification accuracy when varying the lateral translation threshold T for a fixed window size W = 8.
Table 1 shows the effect of the lateral translation threshold T for a fixed window size of W = 8 seconds. It can be seen that, as the threshold increa- ses, the number of true positives (TP) and false positives (FP) monotonically decrease, whereas the number of true negatives (TN) and false negatives (FN, i.e., misses) monotonically increase. Note that the true positive rate (TPR) is defined as TP/(TP + FN), whereas the false positive rate (FPR) is defined as FP/(FP+TN).
The combination of W and T that yielded maximal classification accuracy was found by varying the window size W from 2 to 8 data points and by varying the threshold T with increments of 0.1 m for each window size W. Table 2 shows that the highest accuracy (0.905) was achieved using a window size of 6 and a lateral translation threshold of 1.5 m, with accuracy defined as (TP + TN)/(TP + FP + TN + FN). Of note, classification accuracy was still
Table 2. Optimal lateral translation thresholds for varying window size W.
Table available in the original PDF paper.
Window size W Threshold T (m) Accuracy TP FP TN FN TPR FPR
high (0.868) for a window size of 2, i.e., when the lateral position difference between only two data points was used.
The above parameter values (W = 6, T = 1.5 m) were used to compare the devices (Table 3) and the two highway segments (Table 4). It can be seen that the four GPS devices yielded similar accuracies, with the GoPro Max coming out slightly better than the other three devices. Accuracy was considerably worse on the Ring Rotterdam than the relatively straight and uncluttered A13 highway.
A Closer Examination of False Predictions A visual inspection of falsely classified segments revealed that incorrect pre- dictions tended to be caused by road geometry definitions. We found this to be the case occasionally on curved sections, under overpasses, and at secti- ons with lane splits. Figure 5 shows two relatively straight sections where all four recording devices gave an incorrect prediction. The first segment shows a scenario where a lane change was made, but it was not identified (false negative) as the road geometry moves in the lane change direction. In the bottom example, no lane change was performed, but as the road definition jumped sideways, it decreased the lateral threshold, resulting in an incorrectly flagged fragment (false positive).
Identifying Lane Changes Automatically using the GPS Sensors of Portable Devices 57
Figure 5: Examples of a false negative (top) and a false positive (bottom). In these figures, the vehicles travel from left to right.
DISCUSSION
This study examined whether lane changes can be identified using GPS posi- tion data for different off-the-shelf devices and different highway sections. The results showed an overall true positive rate of 89% and a false positive rate of 8%. It was found that the GPS devices yielded similar classification performance. Furthermore, it was shown that the false positive rate was 3% on straight highway roads, while it was 10% on the more cluttered ring road consisting of curves, exits, lane splits, etc.
The development of a real-time warning system, such as a drowsiness dete- ction system that measures if the vehicle drifts out of the lane, would require further investigation. The findings of the current study suggest that this may be hard to achieve using only GPS. In the current evaluation, balanced classes were created. In reality, there will be proportionally more segments without lane change, meaning that the number of false positives per minute of driving will be high (8% for every 5 seconds totals approximately 1 false alarm per minute). Systems that frequently provide false warnings tend to be turned off by drivers (Reagan et al., 2018). Although the false alarm rate can be decre- ased by increasing the detection threshold, this would go at the cost of the ability to correctly predict lane changes. Another factor is that lane changes in the positive class were centered around the lane changes. For real-time applications, a rolling window approach will have to be used. In our study, lane changes were detected after allowing some time for the lateral position to accumulate, which might not occur fast enough for lane drift warnings. Also, it is noted that our current method detects lane changes, not the lane on which the car was driving.
On the other hand, the obtained accuracy may be high enough for driving style recognition algorithms which aim to establish whether the driver is a frequent lane changer or not (if only road segments free of irregularities such as exits or curves are considered). Such driving style recognition algorithms could benefit from further information such as traffic density or from geo- specific approaches that compare the driver with other drivers driving on the same road at the same time of day. Our study focused on detecting the occur- rence of a lane change. Future research could try to infer the aggressiveness of the lane change, for example, by incorporating lateral velocity information. It is also expected that our method is useful for road design applications, for example by determining ‘lane change hotspots’ based on floating car data.
The collected data were limited to driving by the first author, who chan- ged lanes whenever this was deemed safe. The classification results reported in this paper should be validated on naturalistic driving data from a more diverse pool of drivers, vehicles, devices, roads, and weather conditions. The present study used GPS signals to detect lane changes. Future research could use gyroscopes and accelerometers, which are available in smartphones as well. This approach has been tried by Ramah et al. (2021), who observed that lane-change detection using these sensors alone is difficult if a lane change is gentle. Future research could use sensor fusion of smartphone GPS and IMU data (and see Islam and Abdel-Aty, 2021).
In conclusion, this study established the feasibility of detecting lane chan- ges using portable GPS devices. Lane change information based on floating car data may be useful for road design and traffic flow management.
ACKNOWLEDGMENT
This research is funded by Transitions and Behaviour grant 403.19.243 (“Towards Safe Mobility for All: A Data-Driven Approach”), provided by the Netherlands Organization for Scientific Research (NWO).
SUPPLEMENTARY MATERIAL The code and data are maintained on https://github.com/tomdries/gps-lane- changes and https://doi.org/10.4121/19170302.
REFERENCES
Arman, M.A. and Tampère, C.M.J. (2021) ‘Lane-level routable digital map reconstruction for motorway networks using low-precision GPS data’, Transportation Research Part C: Emerging Technologies, 129, 103234. https://doi.org/10.1016/j. trc.2021.103234 Baecke, P. and Bocca, L. (2017) ‘The value of vehicle telematics data in insurance risk
selection processes’, Decision Support Systems, 98, pp. 69–79. https://doi.org/10. 1016/j.dss.2017.04.009 BasicAirData (2022) ‘BasicAirData GPS Logger’. Available at: https://www.basicairdata.eu/projects/android/android-gps-logger (Accessed: February 14, 2022). Faizan, M., Hussain, S. and Hayee, M.I. (2019) ‘Design and development of invehicle lane departure warning system using standard global positioning system receiver’, Transportation Research Record: Journal of the Transportation Resea- rch Board, 2673, pp. 648–656. https://doi.org/10.1177/0361198119844751 Islam, Z. and Abdel-Aty, M. (2021) ‘Real-time vehicle trajectory estimation based
on lane change detection using smartphone sensors’, Transportation Research Record, 2675, pp. 137–150. https://doi.org/10.1177%2F0361198121990681 Izet-Ünsalan, K. and Ünsalan, M. (2020). ‘Classroom study of GNSS position accuracy using smartphones’, Scientific Bulletin of Naval Academy, XXIII, pp. 83–89. Lee, J.D. (2007) ‘Technology and teen drivers’, Journal of Safety Research, 38,
pp. 203–213. https://doi.org/10.1016/j.jsr.2007.02.008 Mapbox Map Matching API v5 (2022). https://docs.mapbox.com/help/glossary/mapmatching-api/ (Accessed: January 28, 2022)
Identifying Lane Changes Automatically using the GPS Sensors of Portable Devices 59
Merry, K. and Bettinger, P. (2019) ‘Smartphone GPS accuracy study in an urban environment’, PLOS ONE, 14, e0219890. https://doi.org/10.1371/journal.pone .0219890 Michelaraki, E. et al. (2021) ‘Post-trip safety interventions: State-of-the-art, chal-
lenges, and practical implications’, Journal of Safety Research, 77, pp. 67–85. https://doi.org/10.1016/j.jsr.2021.02.005 Reagan, I.J., Cicchino, J.B., Kerfoot, L.B. and Weast, R.A. (2018) ‘Crash avoidance and driver assistance technologies–Are they used?’, Transportation Research Part F, 52, pp. 176–190. https://doi.org/10.1016/j.trf.2017.11.015 Ramah, S.-E., Bouhoute, A., Boubouh, K. and Berrada, I. (2021) ‘One step fur-
ther towards real-time driving maneuver recognition using phone sensors’, IEEE Transactions on Intelligent Transportation Systems, 22, pp. 6599–6611. https: //doi.org/10.1109/TITS.2021.3065900 Sanz Subirana, J., Juan Zornoza, J.M. and Hernández-Pajares, M. (2011) Multipath
- Navipedia, European Space Agency. Available at: https://gssc.esa.int/navipedia// index.php/Multipath (Accessed: January 28, 2022). Sekimoto, Y., Matsubayashi, Y., Yamada, H., Imai, R., Usui, T. and Kanasugi, H. (2012) ‘Lightweight lane positioning of vehicles using a smartphone GPS by monitoring the distance from the center line’, 15th International IEEE Confe- rence on Intelligent Transportation Systems (ITSC 2012), Anchorage, AK, USA, pp. 1561–1565. https://doi.org/10.1109/ITSC.2012.6338737 Singh, H. and Kathuria, A. (2021) ‘Analyzing driver behavior under naturalistic
driving conditions: A review’. Accident Analysis and Prevention, 150, 105908. https://doi.org/10.1016/j.aap.2020.105908 Toyota (2022) ‘Toyota 2022 Corolla Owner’s Manual’. Available at: https://www.
toyota.com/owners/resources/warranty-owners-manuals.corolla.2022 (Accessed: February 15, 2022). Tselentis, D.I., Yannis, G. and Vlahogianni, E.I. (2017) ‘Innovative motor insurance schemes: A review of current practices and emerging challenges’, Accident Analysis and Prevention, 98, pp. 139–148. https://doi.org/10.1016/j.aap.2016.10. 006 Volkswagen (2021) ‘Owner’s Manual Golf, Golf GTI, U.S. Edition, Model Year
2021’. Vos, J., Farah, H. and Hagenzieker, M. (2021) ‘Speed behaviour upon approaching freeway curves’, Accident Analysis and Prevention, 159, 106276. https://doi.org/ 10.1016/j.aap.2021.106276 Wing, M.G., Eklund, A. and Kellogg, L.D. (2005) ‘Consumer-grade global positio-
ning system (GPS) accuracy and reliability’, Journal of Forestry, 103, pp. 169–173. https://doi.org/10.1093/jof/103.4.169
LISTED IN THE AHFE DIGITAL BOOKSTORE CATALOGUE
Explore the complete digital volume
Human Factors in Transportation
Read this individual research paper free through the original publisher, or explore the full digital proceedings book.
ISBN 978-1-958651-36-0
Explore this ISBN in the AHFE Bookstore ↗Listed in the July 2026 bookstore catalogue; search by ISBN to confirm current availability · Digital book purchase optional