0% found this document useful (0 votes)
58 views6 pages

Paper 10

ieee paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views6 pages

Paper 10

ieee paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Mediterranean Smart Cities Conference (MSCC 2024)

2-4 May, 2024, Martil, Morocco

Enhancing Road Safety: Automated Traffic


Violation Detection and Counting System Using
YOLO Algorithm
2024 Mediterranean Smart Cities Conference (MSCC) | 979-8-3503-7400-1/24/$31.00 ©2024 IEEE | DOI: 10.1109/MSCC62288.2024.10697076

Ayoub Charef Zahi Jarir Mohamed Quafafou


LAMIGEP Research Laboratory EMSI Laboratory of Computer Systems Department of Computer Science
Moroccan School of Engineering Engineering (LISI) University of Aix-Marseille
Sciences Marrakech, Morocco Cadi Ayyad University Marrakech Marseille, France
[email protected], Marrakech, Morocco [email protected]
[email protected] [email protected]

Abstract—Ensuring compliance with traffic regulations, within the city [2]. Motorcycles, known for their
such as wearing helmets and obeying traffic signals, is crucial maneuverability and agility in navigating congested urban
for enhancing road safety, particularly among motorcycle streets, have become an integral part of Marrakech's
riders. In this study, we propose an automated approach for transportation landscape. However, their presence also
detecting helmet wearing and traffic light violations using poses unique challenges, including increased vulnerability
computer vision techniques. Our methodology involves to accidents and violations of traffic regulations.
leveraging the YOLO-v8 object detection model pretrained on
the COCO dataset to identify motorcycles, persons, traffic One of the most pressing issues associated with the
lights, and helmets in video footage captured at intersections rising number of motorcycles in Marrakech is the problem
in Marrakech. We conducted manual counting as a of traffic violations, particularly concerning helmet usage
benchmark for evaluating the performance of our automated and adherence to traffic signals. Non-compliance with
system. Our results demonstrate a strong alignment between helmet-wearing regulations not only poses a risk to the
our automated approach and manual counting for both safety of motorcycle riders but also undermines efforts to
helmet detection and traffic light violations. However, improve road safety outcomes in the city. Additionally,
occasional discrepancies were observed, particularly during violations such as running red lights or disobeying traffic
specific time slots characterized by high motorcycle speeds. signals contribute to traffic congestion and disrupt the
Contextual factors such as traffic density and vehicle speed
smooth flow of traffic, further exacerbating the challenges
were identified as influencing factors. Despite these
challenges, our automated system shows promise as a valuable
of urban mobility in Marrakech [3].
tool for monitoring and enforcing traffic regulations. Ongoing The main contribution of this paper lies in the empirical
refinement and optimization are essential to address these analysis of motorcycle violations, focusing on helmet non-
challenges and enhance the accuracy and reliability of compliance and traffic light infractions, through the
automated detection systems. Our study highlights the application of computer vision technology using YOLO-v8.
potential of automated technologies in improving road safety By leveraging this approach, we provide accurate detection
measures and underscores the importance of considering and counting of violations, offering valuable insights into
contextual factors in interpreting detection results.
the prevalence and patterns of motorcycle-related traffic
Keywords— Traffic safety; Helmet detection; Traffic light violations. This research not only enhances our
violations; Automated detection; Computer vision. understanding of traffic safety issues but also presents a
scalable and efficient method for monitoring and enforcing
I. INTRODUCTION traffic regulations in urban environments.
This With the rapid urbanization and economic This paper is structured into five main sections to
development witnessed in Marrakech, Morocco, over recent provide a comprehensive analysis of motorcycle safety and
years, there has been a notable increase in the number of traffic management in urban environments, with a focus on
motorcycles on the city's roads. This surge in motorcycle Marrakech. The "Literature Review" section offers an
ownership and usage reflects not only the city's growing overview of existing research on motorcycle safety and
population but also the increasing demand for affordable helmet detection systems, setting the context for the
and convenient modes of transportation in urban areas. proposed approach. In "Data Collection," the methodology
However, along with the proliferation of motorcycles comes for gathering real-time data on motorcycle behavior,
a host of challenges, particularly concerning traffic safety including helmet usage, is outlined. The "Proposed
and congestion [1]. Approach" details the development and implementation of
The influx of motorcycles in Marrakech has brought a YOLO-v8-based framework for motorcycle detection and
about significant changes in the dynamics of traffic flow helmet classification, along with any enhancements made to

979-8-3503-7400-1/24/$31.00 ©2024 IEEE


Authorized licensed use limited to: American International University Bangladesh. Downloaded on November 28,2024 at 04:32:28 UTC from IEEE Xplore. Restrictions apply.
the architecture. "Results and Discussion" presents the While the aforementioned studies make significant
findings of the study, including the accuracy and contributions to safety violation detection and counting,
effectiveness of the helmet detection models, and discusses they exhibit certain limitations and areas for enhancement.
their implications for motorcycle safety and traffic Notably, some studies rely on outdated object detection
management. Finally, the "Conclusion" section summarizes frameworks like YOLOv5, potentially overlooking recent
the key findings, suggests avenues for future research, and advancements in accuracy and speed. Moreover, the
recommends strategies for implementing motorcycle safety absence of real-time detection capabilities in certain studies
measures in urban environments like Marrakech. may restrict their practical utility, particularly in dynamic
settings such as road traffic management. Additionally, the
lack of real-world data from field environments like
II. LITERATURE REVIEW signalized intersections or construction sites raises concerns
regarding the generalizability and effectiveness of proposed
The related work in the field of traffic violation detection methods in real-world scenarios. Hence, future research
and motorcycle safety encompasses various approaches and endeavors should focus on addressing these limitations by
methodologies. Notable studies include a system employing integrating state-of-the-art detection frameworks, enabling
the YOLO algorithm for traffic violation detection, real-time detection, and leveraging diverse and
achieving high accuracy rates in detecting violations, representative datasets from actual field environments to
particularly focusing on license plate recognition ensure the robustness and reliability of safety violation
[4].Additionally, research efforts aimed to automate the detection and counting systems.
detection of motorcyclist violations and plate recognition
using Deep Learning algorithms, showcasing effectiveness III. DATA COLLECTION
in real-time surveillance video analysis [5].Furthermore, For the data collection phase of our study, we selected
advancements in Computer Vision and Deep Learning intersections in Marrakech as our primary observation sites.
techniques have led to the development of systems capable Marrakech, being a vibrant city with a diverse mix of road
of automatically detecting helmet usage by motorcycle users, offers an ideal setting to investigate motorcycle
riders from video data, offering promising solutions for violations, particularly regarding helmet use and adherence
improving road safety and reducing fatalities in traffic to traffic signals.
accidents [6] [7].
Our data collection strategy involved utilizing phone
In countries like India, where two-wheeler vehicles cameras to record video footage at selected intersections
dominate transportation but safety remains a concern, during three distinct time periods across three days of the
there's a need for robust measures to enforce traffic laws and week. Specifically, we conducted observations during the
ensure rider safety. However, the lack of detailed data on morning rush hour (9:00 - 9:30), the midday period (12:00 -
critical safety metrics like helmet usage hinders effective 12:30), and the afternoon rush hour (3:00 - 3:30). These time
policymaking and outreach campaigns [8], [9]. To address slots were chosen to capture variations in traffic volume and
this, we developed a deep learning model utilizing behavior during different times of the day when motorcycle
Convolutional Neural Networks (CNN) to automatically violations might occur. In total, we gathered 1,250 unique
detect motorcycle riders and their helmet usage from video instances of traffic violations, including both helmet and
data. With helmet usage reducing the risk of fatal injury by traffic light violations, which were meticulously analyzed to
42%, our model aims to enhance road safety by accurately ensure a comprehensive representation of traffic patterns.
identifying helmet-wearing riders. Experimental results
demonstrate an 85% accuracy in helmet detection, offering To ensure comprehensive data collection, we
a promising solution to improve motorcycle safety and implemented this observation schedule on Monday,
prevent fatalities in traffic accidents [10]. Thursday, and Sunday. These days were chosen
strategically to represent both weekdays and weekends,
Automated detection of traffic rule violations, considering potential differences in traffic patterns and
particularly helmet non-usage by motorcycle riders, is compliance with traffic regulations on different days of the
crucial for enhancing road safety in densely populated week. Regarding the technical setup, the video data were
countries like India. This paper presents a framework
collected using high-definition phone cameras mounted at
utilizing YOLOv3 for motorcycle rider detection and a strategic locations. The data were then processed using a
Convolutional Neural Network (CNN) for helmet detection. dedicated workstation equipped with an NVIDIA GTX
The proposed model shows promising results in accurately 1080 Ti graphics card, 32 GB of RAM, and an Intel i7-
identifying single or multiple riders traveling without 8700K CPU. This setup ensured efficient handling and
helmets in traffic videos, offering a valuable tool for processing of the video data for training and testing the
enforcing safety regulations and reducing the risk of head YOLO-v8 model, facilitating robust real-time detection and
injuries in motorcycle accidents [11][12]. analysis capabilities.
This paper presents a novel framework for video
surveillance-based automatic detection of motorcycle
helmet usage, aiming to strengthen road safety initiatives.
Unlike existing methods, our framework focuses on
individual motorcycles and accurately differentiates
between riders and passengers regarding helmet usage. The
proposed classification approach showcases improved
efficiency, evident in its exceptional accuracy score of
0.7754 on the AI City 2023 Challenge Track 5 public
leaderboard [13].

Authorized licensed use limited to: American International University Bangladesh. Downloaded on November 28,2024 at 04:32:28 UTC from IEEE Xplore. Restrictions apply.
Figure 1: Study Locations - Intersection Map of Marrakech [14].

By recording video footage at multiple intersections during


various times of the day and days of the week, we aimed to
obtain a holistic understanding of motorcycle violations in
Marrakech. This approach allowed us to gather rich
observational data that could reveal insights into the
frequency, nature, and contributing factors of violations
related to helmet use and traffic signal adherence among
motorcycle riders at intersections in the city.
Figure 2: Architecture of the Proposed Approach for Motorcycle
This figure 1 illustrates the selected intersections in Detection and Violation Counting [17]
Marrakech where data collection for the study was
conducted. Figure 2 illustrates the architecture of our proposed
approach for the detection and counting of motorcycles, as
The intersections were selected based on criteria such as well as violations related to helmet wearing and traffic light
traffic volume, diversity of road users, and relevance to the infractions. The process begins with input video footage
study's focus on motorcycle violations, including helmet captured from intersections in Marrakech. This footage
non-compliance and traffic signal infractions. undergoes preprocessing to enhance quality and standardize
IV. PROPOSED APPROACH format for compatibility with the subsequent stages.
Subsequently, the preprocessed video frames are fed into
In our proposed approach, we aim to leverage the the YOLO-v8 model, which performs object detection.
advanced capabilities of the YOLO-v8 [15](You Only Look Specifically, the model identifies motorcycles, helmets, and
Once version 8) model, combined with pretraining on the traffic lights within the video frames. For traffic lights, an
COCO [16] (Common Objects in Context) dataset, to detect additional step of color detection is applied to determine
motorcycles, persons, traffic lights, and helmets in the video whether the light is green or red (including orange,
footage collected from intersections in Marrakech. YOLO- representing the transitional phase). The output of the model
v8 is renowned for its efficiency in real-time object includes the detection results, including the number of
detection tasks, making it a suitable choice for our study, motorcycles and any violations detected, such as instances
where prompt and accurate identification of relevant objects of helmet non-compliance and traffic light infractions.
is crucial. By utilizing the COCO dataset for pretraining, our These results are then aggregated to provide counts of
model benefits from a diverse range of annotated images motorcycles and their respective violations, facilitating a
containing various objects, including motorcycles, persons, comprehensive analysis of intersection activity and
traffic lights, and helmets, thereby enhancing its ability to compliance with traffic regulations.
recognize these objects in different contexts and under
varying environmental conditions. A. Helmet Detection

The proposed approach involves adapting the pretrained


YOLO-v8 model to our specific task of detecting
motorcycle violations, such as helmet non-compliance and
traffic light infractions, in Marrakech intersections. This
adaptation may include fine-tuning the model parameters,
adjusting the input data preprocessing pipeline, and possibly
incorporating additional training data specific to our study
context. Through this process, we aim to optimize the
model's performance and ensure its effectiveness in
accurately detecting motorcycles, persons, traffic lights, and
helmets from the video footage captured at the selected
intersections.

Figure 3: Example of Helmet Wearing Detection in Motorcycle Riders

Authorized licensed use limited to: American International University Bangladesh. Downloaded on November 28,2024 at 04:32:28 UTC from IEEE Xplore. Restrictions apply.
In the process of helmet detection, we initially employ The comparison between our automated approach and
YOLO to detect motorcycles and persons within the manual counting for helmet detection, as presented in
captured video frames. Once these objects are identified, Figure 5, illustrates a notable alignment between the two
bounding boxes are drawn around them to delineate their methods across various days and time slots. For example,
spatial extent accurately. Subsequently, we focus on the during the morning period on Monday (09:00 - 09:30), our
region within these bounding boxes, which represents both automated approach detected six instances of helmet
the motorcycles and their riders. Utilizing this cropped wearing, closely matching the manual count of five. This
image, we employ a secondary detection mechanism to consistency extends to different days and times, such as the
identify helmets specifically. This involves applying a morning slot on Thursday (09:00 - 09:30), where both
helmet detection algorithm to the extracted regions of methods recorded four instances of helmet usage.
interest, aiming to accurately discern whether motorcycle
riders are wearing helmets. By segmenting the image into
relevant subsets corresponding to motorcycles and their
riders and then specifically targeting the detection of
helmets within these subsets, our approach ensures a
focused and precise analysis of helmet compliance among
motorcycle riders figure 3.
B. Traffic signal infractions
In our approach to detecting traffic signal infractions, we
utilize YOLO to initially identify motorcycles and persons
within the captured video frames. Following this detection,
bounding boxes are applied around these objects to
precisely delineate their spatial extents. Concurrently, we
employ a separate module to detect and isolate the traffic
light within the video frame. Once the traffic light is
identified, its bounding box is sent to a color detector,
which discerns whether the signal is emitting a green, red,
or orange hue. If the detected color corresponds to red or Figure 5: Comparison between Automated Approach and Manual
orange, indicative of a stop signal, and a motorcycle fails Counting for Helmet Detection
to halt, this is flagged as a traffic light violation, indicating However, discrepancies were observed in certain
that the motorcycle has run the red light or disregarded the instances, notably during the afternoon period on Sunday
stop signal, thus constituting a violation figure 4. (12:00 - 12:30). Here, our approach detected 11 motorcycles
without helmets, while manual counting reported only 9
instances. A similar discrepancy arose during the 03:00 -
03:30 time slot. Upon scrutinizing the video footage, we
identified a contributing factor to these differences:
motorcycles tended to accelerate during these time slots due
to reduced traffic volume, making it more challenging for
our automated system to accurately detect helmet usage.
These findings underscore the importance of
considering contextual factors, such as traffic density and
vehicle speed, when interpreting automated detection
results. While our approach generally exhibits strong
alignment with manual counting, occasional discrepancies
may occur due to such factors. Thus, ongoing refinement
and optimization of our automated system remains crucial
for ensuring reliable and precise detection of helmet
compliance among motorcycle riders.
Figure 4: Example of Traffic Light Violation (Running Red or Orange
Light)

V. RESULT AND DISCUTION


In order to assess the effectiveness and accuracy of our
proposed approach, we conducted manual counting for
helmet wearing and instances of traffic light running. This
manual counting served as a benchmark against which we
compared the results obtained through our automated
detection and analysis system. By comparing the outputs of
our approach with the manually counted data, we were able
to evaluate the performance and reliability of our
methodology in detecting helmet wearing and traffic light
violations.

Authorized licensed use limited to: American International University Bangladesh. Downloaded on November 28,2024 at 04:32:28 UTC from IEEE Xplore. Restrictions apply.
of our system are essential to address challenges such as
variations in lighting conditions and vehicle speed.
Overall, our study underscores the importance of
considering contextual factors when interpreting automated
detection results. By leveraging advanced technologies and
methodologies, we can continue to improve the accuracy
and reliability of automated systems for monitoring and
enforcing traffic regulations, ultimately contributing to safer
road environments for all road users.
REFERENCE
[1] A. Charef, Z. Jarir, and M. Quafafou, “Optimizing Traffic Flow and
Pedestrian Safety: The Role of Crosswalk Distance in Roundabout
Design,” 2024 International Conference on Global Aeronautical
Engineering and Satellite Technology (GAST), pp. 1–6, Apr. 2024,
doi: 10.1109/GAST60528.2024.10520741.
[2] R. George, Pikala Bikes, Marrakesh, Morocco: a social
entrepreneurship company. Edward Elgar Publishing, 2024.
Figure 6: Comparison between Automated Approach and Manual Accessed: Feb. 15, 2024. [Online]. Available:
Counting for Traffic Light Violations (Running) https://www.elgaronline.com/edcollchap/book/9781803923857/boo
k-part-9781803923857-20.xml
The figure 6 provides a comparison between our
[3] A. Charef, Z. Jarir, and M. Quafafou, “Smart System for Emergency
automated approach and manual counting for traffic light Traffic Recommendations : Urban Ambulance Mobility,” IJACSA)
violations (running) across different intersections and times International Journal of Advanced Computer Science and
of the day. The figures indicate the number of traffic signal Applications, vol. 13, no. 10, p. 2022, Accessed: Dec. 19, 2023.
infractions detected by both methods for each time slot on DOI: 10.14569/IJACSA.2022.0131005
Monday, Thursday, and Sunday. [4] R. Ferdian and T. P. Sari, “Identification of Motorcycle Traffic
Violations with Deep Learning Method,” Proceeding - 2022
Upon analysis, it's evident that there is a close alignment International Symposium on Information Technology and Digital
between the results obtained through our automated Innovation: Technology Innovation During Pandemic, ISITDI 2022,
pp. 146–149, 2022, doi: 10.1109/ISITDI55734.2022.9944502.
approach and those derived from manual counting. For [5] A. Afzal, H. U. Draz, M. Z. Khan, and M. U. G. Khan, “Automatic
instance, during the morning time slot (09:00 - 09:30) on Helmet Violation Detection of Motorcyclists from Surveillance
Monday, both methods detected five instances of traffic Videos using Deep Learning Approaches of Computer Vision,”
light violations. Similarly, for the same time slot on 2021 International Conference on Artificial Intelligence, ICAI 2021,
Thursday and Sunday, the counts obtained through our pp. 252–257, Apr. 2021, doi: 10.1109/ICAI52203.2021.9445206.
[6] A. Goyal, D. Agarwal, A. Subramanian, C. V. Jawahar, R. K.
approach closely matched those from manual counting. Sarvadevabhatla, and R. Saluja, “Detecting, Tracking and Counting
Overall, the comparison demonstrates the reliability and Motorcycle Rider Traffic Violations on Unconstrained Roads.” pp.
4303–4312, 2022. Accessed: Feb. 15, 2024. [Online]. Available:
accuracy of our automated approach in detecting traffic light https://github.com/iHubData-Mobility/public-motorcycle-
violations. The minor discrepancies observed between the violations
two methods can be attributed to factors such as variations [7] M. M. Bachtiar, A. R. Mawardi, and A. R. A. Besari, “Vehicle
in lighting conditions, occlusion of traffic signals by other Classification and Violation Detection on Traffic Light Area using
objects, or differences in the interpretation of video footage BLOB and Mean-Shift Tracking Method,” 3rd International
Conference on Applied Science and Technology, iCAST 2020, pp.
between automated and manual analyses. However, these 94–98, 2020, doi: 10.1109/ICAST51016.2020.9557628.
differences are relatively small and do not significantly [8] M. M. Bachtiar, A. R. Mawardi, and A. R. A. Besari, “Vehicle
affect the overall agreement between the two methods. Classification and Violation Detection on Traffic Light Area using
BLOB and Mean-Shift Tracking Method,” 3rd International
VI. CONCLUSION Conference on Applied Science and Technology, iCAST 2020, pp.
94–98, 2020, doi: 10.1109/ICAST51016.2020.9557628.
Our study demonstrates the effectiveness and [9] A. Charef, Z. Jarir, and M. Quafafou, “The Impact of Motorcycle
reliability of our proposed automated approach for detecting Positioning on Start-Up Lost Time: The Empirical Case Study of
helmet wearing and traffic light violations among Signalized Intersections in Marrakech using VISSIM,” Engineering,
motorcycle riders. Through manual counting, we Technology & Applied Science Research, vol. 14, no. 3, pp. 14313–
established benchmarks against which we compared the 14318, Jun. 2024, doi: 10.48084/ETASR.7141.
[10] D. A. Naik, P. Naik, and S. O. Reddy, “Traffic Rule Violation
results obtained from our automated detection system. Detection System using Surveillance Videos in real-time,” Ann Rom
While our approach generally showed strong alignment Soc Cell Biol, vol. 25, no. 6, pp. 17865–17873, Jul. 2021, Accessed:
with manual counting, occasional discrepancies were Feb. 15, 2024. [Online]. Available:
observed, particularly during specific time slots where https://www.annalsofrscb.ro/index.php/journal/article/view/9150
motorcycles tended to accelerate due to reduced traffic [11] M. Dasgupta, O. Bandyopadhyay, and S. Chatterji, “Automated
volume. helmet detection for multiple motorcycle riders using CNN,” 2019
IEEE Conference on Information and Communication Technology,
Despite these minor discrepancies, our automated CICT 2019, Dec. 2019, doi: 10.1109/CICT48419.2019.9066191.
[12] T. Waris et al., “CNN-Based Automatic Helmet Violation Detection
system proved to be a valuable tool for monitoring and of Motorcyclists for an Intelligent Transportation System,” Math
enforcing helmet compliance and traffic regulations at Probl Eng, vol. 2022, 2022, doi: 10.1155/2022/8246776.
intersections. The close alignment between our automated [13] N.-N. Duong et al., “Robust Automatic Motorcycle Helmet
approach and manual counting highlights the potential of Violation Detection for an Intelligent Transportation System.” pp.
automated detection systems in enhancing road safety 5341–5349, 2023.
measures. However, ongoing refinement and optimization [14] A. Charef, Z. Jarir, and M. Quafafou, “Assessing the driving
behaviour of motorcyclists to improve road safety,” JUCS - Journal

Authorized licensed use limited to: American International University Bangladesh. Downloaded on November 28,2024 at 04:32:28 UTC from IEEE Xplore. Restrictions apply.
of Universal Computer Science 30(5): 617-644, vol. 30, no. 5, pp.
617–644, May 2024, doi: 10.3897/JUCS.108550.
[15] J. Terven, D.-M. Córdova-Esparza, and J.-A. Romero-González, “A
Comprehensive Review of YOLO Architectures in Computer
Vision: From YOLOv1 to YOLOv8 and YOLO-NAS,” Machine
Learning and Knowledge Extraction 2023, Vol. 5, Pages 1680-1716,
vol. 5, no. 4, pp. 1680–1716, Nov. 2023, doi:
10.3390/MAKE5040083.
[16] Z. Ge, S. Liu, F. Wang, Z. Li, and J. Sun, “YOLOX: Exceeding
YOLO Series in 2021,” vol. 5, p. 12, Jul. 2021, Accessed: Feb. 15,
2024. [Online]. Available: https://arxiv.org/abs/2107.08430v2
[17] A. Charef, Z. Jarir, and M. Quafafou, “Impact of Motorcycle
Placement on Travel Time and Traffic Dynamics at Urban
Intersections,” pp. 1–5, Jun. 2024, doi:
10.1109/IRASET60544.2024.10549511.

Authorized licensed use limited to: American International University Bangladesh. Downloaded on November 28,2024 at 04:32:28 UTC from IEEE Xplore. Restrictions apply.

You might also like