PHOEBE R&D Blog

The PHOEBE Project R&D blog serves as a platform for sharing insights, updates, and breakthroughs related to the PHOEBE Project. It focuses on innovative research and development in road safety and features articles written by team members, showcasing ongoing studies, methodologies, and findings.
Click on the following links to jump to the latest blogpost!

News Items

14.10.2024: Detection of Traffic Violations in Urban Environments Using Video Analysis and Machine Learning: A Case Study in Athens

If you have further questions about the content or would like to learn more about this R&D aspect, please contact: shanna.lucchesi@irap.org

Summary of the experiment

Traffic violations such as speeding, illegal crossings, and jaywalking pose significant risks in urban environments. A comprehensive approach to detecting and analysing these violations using video recordings and machine learning techniques has been implemented in the context of the PHOEBE project. Focusing on eight critical locations in Athens, Greece, 64 hours of video data during peak and off-peak hours have been collected and processed, which was done by utilising YOLOv8 object detection algorithm and ResNet50 features.

ResNet-50 is a convolutional neural network (CNN) that can dissect a picture, identify objects and scenes within it, and categorize them accordingly. The solution is part of a wider series of models designed to address the challenges associated with training deep neural networks. For the PHOEBE tests, it was used to assess the video footage to track and clarify pedestrians and vehicles accurately.  

The implementation of Kalman filters and Savitzky-Golay filters enhanced the accuracy of object trajectories and reduced noise in the data. Whereas the Kalman filter provided predictions of object positions in subsequent frames, the Savitzky-Golay Filters were applied to reduce noise in the data by smoothing the object trajectories without distorting the signal’s tendency.

The results demonstrate the effectiveness of the proposed method in identifying traffic violations and offer insights for improving urban traffic management.

Introduction

Urban areas worldwide grapple with traffic violations that compromise road safety and efficiency. In cities like Athens, issues such as speeding, illegal crossings, and jaywalking can lead to accidents and congestion. Traditional methods of monitoring traffic violations are often labour-intensive and limited in scope (Forero et al., 2019). Advances in computer vision and machine learning offer new opportunities for automated, scalable detection of traffic infractions (Shivanna et al., 2024).

This research aims to develop an automated system for detecting traffic violations using video data and advanced machine learning algorithms. By focusing on specific high-risk locations in Athens, we seek to provide actionable insights that can inform policy decisions and improve road safety.

Site Selection and Data Collection

Eight locations have been identified as critical in Athens known for frequent traffic violations, including the intersection of Vasilissis Sofias Avenue and Panepistimiou Street, an area adjacent to the Athens Great Walk. The selection was based on historical data and expert knowledge of local traffic patterns, as well as the study areas covered by the PHOEBE project. Video recordings were conducted over two weeks at the end of June. For each location, we captured:

  • One hour during peak traffic time.
  • One hour during off-peak time.
  • On two working days: Tuesday and Thursday.

This resulted in approximately 8 hours of video per location, totaling 64 hours of data. Due to constraints in obtaining aerial permissions, cameras were installed at ground level, which introduced certain challenges, including frequent inquiries from local police, as well as people moving in front of the cameras and blocking the video view, among other obstructions.

Illegal Pedestrian Crossing

 

 Preprocessing and Object Detection

The video data underwent preprocessing to enhance quality and prepare for analysis. We employed the YOLOv8 (You Only Look Once version 8) object detection algorithm for its real-time detection capabilities. To improve detection accuracy, especially in crowded scenes, we integrated additional features:

  • ResNet50: A deep residual network used for feature extraction, aiding in distinguishing between different object classes.
  • ReID (Re-Identification) Features: Enabled consistent tracking of objects across frames by assigning unique IDs.

Tracking and Noise Reduction

 To maintain accurate tracking of pedestrians and vehicles, we implemented the following:

  • Kalman Filters: These are commonly used in object tracking algorithms because they predict the future position of objects based on their previous motion. This is particularly helpful in situations where the objects become temporarily obscured or occluded (e.g., when a vehicle moves behind a bus). In this way, Kalman filters allow us to continue tracking objects smoothly across frames even when visual data is partially missing.
The Kalman Filter Prediction and Correction (Source: Kalman Filter Part I – Machine Learning TV)
  • Savitzky-Golay Filters:
    These filters are used to reduce the “noise” or random variations in the object trajectories without distorting the overall motion patterns. Noise can result from various factors, such as camera shake or minor inconsistencies in the video data. The Savitzky-Golay filter smooths the data, ensuring that we accurately follow the true path of vehicles and pedestrians while filtering out any erratic movements that may not reflect reality.

Tracking and Noise Reduction

 To maintain accurate tracking of pedestrians and vehicles, we implemented the following:

  • Kalman Filters: These are commonly used in object tracking algorithms because they predict the future position of objects based on their previous motion. This is particularly helpful in situations where the objects become temporarily obscured or occluded (e.g., when a vehicle moves behind a bus). In this way, Kalman filters allow us to continue tracking objects smoothly across frames even when visual data is partially missing.
  • Savitzky-Golay Filters:
    These filters are used to reduce the “noise” or random variations in the object trajectories without distorting the overall motion patterns. Noise can result from various factors, such as camera shake or minor inconsistencies in the video data. The Savitzky-Golay filter smooths the data, ensuring that we accurately follow the true path of vehicles and pedestrians while filtering out any erratic movements that may not reflect reality.

Coordinate Transformation and Analysis

Using homography transformations, we converted the camera perspective to a top-down  2D  static overhead view. This facilitated the calculation of accurate trajectories and speeds. We defined specific regions of interest (ROIs) corresponding to crosswalks and traffic signals to assess legal and illegal crossings. The ROIs were defined based 4 points from the map for the crosswalks and regarding the traffic signals a color id was also included in order to integrate the red and green traffic light and in this way address the illegal or illegal crossing.

Speed and Time-to-Collision Calculations

We calculated the speed of each tracked object using frame-to-frame displacement combined with time stamps. The time-to-collision (TTC) metric was computed based on the relative positions and velocities of objects approaching potential collision points. While effective, this calculation faced challenges due to varying object sizes and the reliance on centroid positions.

This algorithm successfully detected and classified pedestrians, and vehicles in the video data. Key findings include:

  • Illegal Crossing Detection: Identified numerous instances of pedestrians crossing outside designated areas or against traffic signals.
  • Speed Analysis: Recorded vehicle speeds, highlighting instances of speeding in the monitored areas.
  • Time-to-Collision Alerts: Calculated TTC values, identifying potential collision risks between pedestrians and vehicles.

The integration of Kalman and Savitzky-Golay filters significantly improved the accuracy of object tracking and speed calculations. Additionally, the overhead view transformation allowed for precise mapping of trajectories within the traffic environment.

The study demonstrates the potential of combining advanced object detection algorithms with traditional filtering techniques for traffic violation detection. Despite the challenges posed by ground-level camera placement and the dynamic nature of urban traffic, the system performed robustly.

However, certain limitations were noted:

  • Time-to-Collision Accuracy: The TTC calculations were less accurate for larger vehicles due to centroid-based measurements not accounting for object dimensions.
  • Camera Perspective: Ground-level cameras introduced occlusions and perspective distortions that could affect detection accuracy.

Future work should consider the following:

  • Calibration Enhancements: Implementing calibration techniques to adjust for camera perspective and object size variations.
  • Permission for Elevated Cameras: Securing permissions for elevated camera placement to improve the field of view and reduce occlusions.
  • Real-Time Processing: Optimizing the algorithms for real-time analysis to enable live monitoring and immediate interventions.

 

Conclusion

This research presents a viable approach to automated traffic violation detection using video analysis and machine learning. The successful application in Athens underscores the method’s adaptability to complex urban environments. By providing detailed insights into traffic behaviors, the system can serve as a valuable tool for city planners and law enforcement agencies aiming to enhance road safety and efficiency.

Forero A. and F. Calderon, “Vehicle and pedestrian video-tracking with classification based on deep convolutional neural networks,” 2019 XXII Symposium on Image, Signal Processing and Artificial Vision (STSIVA), Bucaramanga, Colombia, 2019, pp. 1-5, doi: 10.1109/STSIVA.2019.8730234.

Shivanna V Malligere , Guo J-I. Object Detection, Recognition, and Tracking Algorithms for ADASs—A Study on Recent Trends. Sensors. 2024; 24(1):249.

27.09.2024: Analysing Speed Profiles for Fatality and Serious Injury (FSI) Score Calculation in the West Midlands

If you have further questions about the content or would like to learn more about this R&D aspect, please contact: shanna.lucchesi@irap.org

Introduction

Speed is a critical factor in road safety, directly influencing the likelihood and severity of traffic accidents. Traditional approaches to calculating the Fatality and Serious Injury (FSI) score often rely on average speed data, which may not adequately capture the complexities of speed distribution in different traffic environments. This research aims to explore the nuances of speed profiles considering as the use case the West Midlands regions and their implications for calculating the FSI score, with a focus on the B4114 corridor.

Research question: How can speed profiles be used to improve the accuracy of FSI estimations, and what challenges arise when applying these metrics in urban areas with low speed limits?

Methodology

The research focuses on the B4114 corridor in the West Midlands. Speed data was collected using the Floow telematics system, which provides detailed speed profiles at various times of the day. The key metrics analysed were the 50th and 85th percentile speeds, during different time periods: morning peak, afternoon peak, midday, daily average, and nighttime

Results & Findings

The analysis of the B4114 corridor revealed several key findings:

  1. Low Speeds in Urban Areas: The West Midlands region, particularly in dense urban areas with high pedestrian activity, exhibited generally low speeds. Even the 85th percentile speeds did not exceed the posted speed limit of 20 mph, indicating a compliance with speed regulations in these areas.

  2. Challenges in Defining Speeding: Given the low speed limits and the narrow range of observed speeds, traditional definitions of speeding (e.g., exceeding the speed limit) may not fully capture the risk posed by speed variations in these environments.

  3. Need for Alternative Metrics: The study highlighted the potential limitations of using percentile speeds alone to calculate the FSI score. In environments where speed limits are low, and speeds are uniformly distributed, the difference between maximum and mean speeds, or other statistical measures, may provide a better indication of vehicles that pose a higher risk.

Discussion & Conclusions

The research underscores the complexity of using speed profiles to calculate the FSI score in urban environments with low speed limits. While percentile speeds are a useful metric, they may not adequately capture the risk associated with speed variability, particularly in areas where speeds are uniformly low. The findings suggest that alternative metrics, such as speed variability or the difference between maximum and mean speeds, should be explored to enhance the accuracy of FSI calculations.

Further research is needed to refine these metrics and test their applicability in different traffic environments. Additionally, the study highlights the importance of considering the specific characteristics of each corridor when applying these metrics, as a one-size-fits-all approach may not be appropriate in areas with diverse traffic patterns.

Learn More: