Machine learning and advanced computer vision have revolutionized the analysis of urban traffic safety. The paper discusses the predictive performance of Random Forest and XGBoost algo-rithms in modeling pedestrian-vehicle interactions at the Panepistimiou and Vasilissis Sofias junction in Athens, Greece, with a focus on illegal crossings. Video footage from one peak hour was processed using YOLOv8 for object detection, ResNet-50 for feature extraction, and Kalman filtering for trajectory refinement. Both have been trained using features derived from pedestrian interactions in different traffic light phases and evaluated using precision, recall, and F1-score. XGBoost outperformed Random Forest, achieving superior precision and accuracy, while Ran-dom Forest demonstrated better computational efficiency. This work underlines some of the key trade-offs and strengths of those models in an ensemble learning perspective on real-time traffic safety applications, giving actionable insights that might improve urban traffic manage-ment to support global road safety goals.