top of page
Writer's pictureBarak Or

Learning Car Speed Using Smartphone Sensors

Updated: Oct 29

CarSpeedNet is a deep learning model developed to estimate car speed solely from three-axis accelerometer data collected via smartphones. Our research involved 13 hours of data collection from various roads, and CarSpeedNet effectively models the relationship between smartphone acceleration and car speed, achieving high precision with an error margin of less than 0.72 m/s. Importantly, the model functions independently of GPS, making it a robust solution for real-time speed estimation during extended driving tests.





Introduction

Accurate car speed estimation is essential for modern traffic management and navigation systems. Traditional methods, relying on car sensors like odometers, lack real-time data-sharing capabilities, which are increasingly vital. The shift towards data-driven solutions is reshaping this landscape, with smartphones emerging as a promising tool due to their built-in sensors, such as accelerometers. These sensors provide high-frequency data, capturing fine details of car dynamics, making them suitable for speed estimation.

The challenge lies in converting raw accelerometer data into reliable speed estimates. Deep learning (DL), known for handling complex data patterns, offers a solution by modeling the intricate relationship between acceleration and speed. This research introduces CarSpeedNet, a DL model designed to estimate car speed using only smartphone accelerometer data, bypassing the need for additional sensors like gyroscopes.

CarSpeedNet’s architecture capitalizes on the ubiquitous nature of smartphone sensors, ensuring broad applicability across various devices. The model's two-phase process includes comprehensive data collection and a supervised learning approach to train the DL model, achieving high accuracy.

Our study highlights how DL models like CarSpeedNet can effectively interpret complex accelerometer signals for real-time speed estimation, paving the way for more accessible and precise traffic management solutions.


 From Data Collection to Model Training

To develop CarSpeedNet, our team collected 13.2 hours of accelerometer data from a Samsung Galaxy smartphone, recorded at 500 Hz, during car rides on various roads in Israel. The data, split into training, validation, and testing subsets, was carefully processed, downsampling accelerometer data to 20 Hz, while maintaining 1 Hz for GPS-based ground truth speed. This ensured accurate and noise-reduced inputs for model training.

The core of our learning approach was optimizing CarSpeedNet through exploration of five deep learning (DL) architectures, including DNN, LSTM, WaveNet, Bi-LSTM, and ResNet-inspired models. Each model was trained using smartphone accelerometer data only, with CarSpeedNet emerging as the most effective.

CarSpeedNet processes 3-axis accelerometer data over 4-second intervals and leverages bidirectional LSTM layers and Conv1D layers to capture both temporal and spatial patterns. The final architecture includes 178,169 trainable parameters and was trained using the Adam optimizer with an adaptive learning rate to ensure efficiency and accuracy. This architecture enables CarSpeedNet to model the complex relationship between car acceleration and speed, delivering high-precision estimates.


Results and Performance Evaluation

We evaluated CarSpeedNet's performance using two key error metrics: Root Mean Square Error (RMSE) and Mean Absolute Error (MAE). These metrics highlight the model’s accuracy, with RMSE emphasizing large errors and MAE reflecting average error magnitudes. CarSpeedNet achieved an RMSE of 2.9 m/s and MAE of 1.3 m/s, outperforming other models like LSTM and WaveNet, which had higher errors and latencies (for 1 second window / 20 samples).

Additionally, we explored how input size affects performance. Increasing the input window size to 4 seconds (window size of 80 samples) improved accuracy, lowering the RMSE to 1.8 m/s and MAE to 0.72 m/s, but with a slight increase in latency.

Notably, CarSpeedNet demonstrates high precision at lower speeds and accurately detects stationary conditions, crucial for real-time speed estimation across varied driving scenarios.

This combination of accuracy and efficiency, particularly in detecting slow speeds and stationary states, makes CarSpeedNet a robust model for real-time car speed estimation using smartphone accelerometers. The figure below shows the predicted and true car speed over time (4 seconds window size)

Conclusions

CarSpeedNet is a deep learning model that accurately estimates car speed using only smartphone accelerometer data, achieving errors below 0.72 m/s. This eliminates the need for traditional car-based sensors, making it widely accessible. While larger data windows improve accuracy, they introduce slight latency. CarSpeedNet’s real-time precision makes it ideal for applications in traffic management, safety monitoring, and autonomous vehicle systems, enabling intelligent transportation solutions using everyday smartphones. This scalable approach opens new opportunities for enhancing road safety and optimizing traffic flow through existing mobile technology.

24 views0 comments

Recent Posts

See All

Comments


bottom of page