Paper Title: Spatial–temporal machine learning for traffic violation type prediction: a case study in Qatar
Authors: Mohammed Alshriem, Yin Yang
Corresponding Author: Mohammed Alshriem (malshriem@hbku.edu.qa)/Qatar
Abstract
Although traffic violations are among the most significant factors contributing to road accidents, little research has focused on predicting specific types of traffic violations in Qatar and the Gulf region, where the number of vehicles has increased significantly in recent years. This work addresses this gap by proposing a machine-learning framework to solve fine-grained, multi-class prediction of traffic violation types on a large-scale dataset from Qatar. The dataset is extremely imbalanced and has a high-dimensional categorical space, with 97 original violation classes. We created a preprocessing pipeline to address these issues by filtering the 97 original codes to nine well-represented violation types while retaining 99.6% of the records. The final model uses 18 spatiotemporal features, including our zone violation entropy measure, which captures violation diversity in each enforcement zone. Five classifiers are evaluated with a strict temporal train–validation–test split, training-based encoding (to avoid temporal leakage), and balanced class weighting. Random forest’s macro F1 score is 0.6184 and balanced accuracy is 0.7064, outperforming the linear and neural baselines. SHAP analysis shows that location-derived features account for ~74% of the model’s predictive importance, while temporal features account for ~25%. The results indicate that violation type is more strongly associated with location than with time, and they provide implications for targeted enforcement by location. The suggested framework provides a reproducible way to predict violation types in a multi-class setting. It shows that enforcement information alone can support predictive analysis without using road topology or sensor data.