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

Paper 1

Uploaded by

raajanraaj867
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)
27 views6 pages

Paper 1

Uploaded by

raajanraaj867
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

Proceedings of the Fourth International Conference on Electronics and Sustainable Communication Systems (ICESC-2023)

IEEE Xplore Part Number: CFP23V66-ART; ISBN: 979-8-3503-0009-3

AI based Real-Time Traffic Signal Control


System using Machine Learning
2023 4th International Conference on Electronics and Sustainable Communication Systems (ICESC) | 979-8-3503-0009-3/23/$31.00 ©2023 IEEE | DOI: 10.1109/ICESC57686.2023.10193319

C.Heltin Genitha A.S. Hepsi Ajibah A. Angeline Valentina Sweety


Department of Information Technology Department of Information Technology Department of Computer Science and
St. Joseph's College of Engineering St. Joseph's College of Engineering Engineering Chennai,
Chennai, India Chennai, India St. Joseph’s Institute of Technology
[email protected] [email protected] Chennai, India
[email protected]
S. Abishek Danny S. Aravint
Department of Information Technology Department of Information Technology
St. Joseph's College of Engineering St. Joseph's College of Engineering
Chennai, India Chennai, India
[email protected] [email protected]

Abstract— This study presents a novel system that utilizes Deep learning can also be used to detect anomalies in the
computer vision and machine learning approaches to address traffic data. For instance, if traffic on a specific road suddenly
the problem of traffic congestion in urban areas. The proposed increases, the system can detect this and adjust the timing of
system leverages the advanced object detection algorithm, You the traffic lights accordingly. This helps to ensure that traffic
Only Look Once (YOLO), to detect and track vehicles in live is flowing smoothly and efficiently at all times. Hence, it is an
camera footage from traffic junctions. The system then effective solution to traffic congestion.
calculates the traffic density in real-time by analyzing the
number and speed of vehicles passing through the intersection. II. LITERATURE SURVEY
The proposed system utilizes an intelligent algorithm that
optimizes traffic flow by switching traffic lights based on the A system that uses AI and image processing approaches to
calculated traffic density. This approach reduces congestion and estimate traffic density from real-time images captured by
minimizes delays, resulting in faster transit times and reduced cameras at intersections [1]. In order to reduce the traffic
fuel consumption and air pollution. To assess the performance congestion, it also concentrates on algorithms for changing
of the proposed system, experiments are carried on real- world traffic signals based on density of the vehicles. This allows
traffic data. The results demonstrate that the system can people to move more quickly and reduce pollution. The
accurately detect and track vehicles with high precision and captured images have been processed in real-time using an
recall rates. The real-time traffic density calculations produced image-processing toolkit YOLO. To estimate the density of
by the system were found to be highly reliable, and the traffic vehicle traffic in all four directions, several parameters have
light switching algorithm led to a significant reduction in traffic been determined. However, it does not address the issue of
congestion and improved traffic flow. The proposed system has preventing starvation of a particular lane due to the lack of
several advantages over traditional traffic management minimum or maximum green signal time.
systems, including lower implementation and maintenance
costs, improved accuracy and efficiency, and the ability to adapt Nazarov et al., proposed a system, which uses the YOLO
to changing traffic conditions in real-time. object detection technique to find and track the objects on
different frames of the video. After the object detection step,
Keywords— Object Detection, You Only Look Once a standard mathematical procedure is used to count the
(YOLO), Traffic Control number of intersections between the vehicles’s current and
previous frame positions. However, accuracy drops when
I. INTRODUCTION vehicles are closer together, dark vehicles and night scenes are
AI based real-time traffic signal control system using challenging [2].
machine learning is a traffic control system that uses artificial Anand and Neethidevan proposed a methodology that uses
intelligence to adjust the timing of traffic lights in order to Darkent architecture with the YOLO algorithm to find every
minimize the congestion and optimize the traffic flow. It object in a video stream that was obtained from a Webcam [3].
employs deep learning algorithms to analyze real-time traffic The Nonmax suppression technique will get a single
data. The algorithm then modifies the traffic light timing prediction per object. The advantage of using YOLOv3 is that
based on the data it has collected, allowing for a more efficient it can able to process 67 frames per second. It is observed that
flow of traffic. This can help reduce traffic delays, improve air the accuracy rate of object detection is improved in the
quality, reduce fuel consumption, and improve safety. proposed method. However, it was only an experimental
This system is being increasingly implemented in cities comparison of various object detection techniques and did not
around the world, as it provides an effective solution to traffic consider the real-world situations.
congestion. The system works by first collecting data from Four types of vehicles such as buses, motor cycles,
traffic cameras located along roads and intersections. This automobiles and trucks are detected and tracked by analyzing
data is then, fed into a deep learning system, which uses the the video footage on road crossing [4]. It is observed that the
data to create an "intelligent" agent that can recognize patterns vehicle route accounting method is quite promising, with
in the traffic flow. This agent then predicts the optimal timing positive outcomes in different scenarios. However, to make
for traffic signals, taking into account multiple variables such these systems robust to occlusions and other unforeseen
as the amount of traffic on the road, and the speed of vehicles. events, considerably more study is required.
The system then adjusts the traffic lights accordingly in order
to optimize traffic flow.

979-8-3503-0009-3/23/$31.00 ©2023 IEEE 1613


Authorized licensed use limited to: Zhejiang University. Downloaded on August 25,2024 at 17:37:15 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Electronics and Sustainable Communication Systems (ICESC-2023)
IEEE Xplore Part Number: CFP23V66-ART; ISBN: 979-8-3503-0009-3

Detect the Calculate the Scheduling of


Capture Image Calculate the
vehicles using Green Signal Green Signal
using CCTV Traffic Density
CNN Algorithm Timer Timer
Camera

Figure 1 Methodology diagram of traffic signal control system

YOLO, an object detection technique is used to measure III. METHODOLOGY


the traffic volume and operate a situation-cognitive traffic
light control system that modifies the intervals between traffic Figure 1 shows the methodology diagram of traffic signal
signals based on the volume of traffic [5]. The algorithm control system. It involves capturing images with CCTV
assists for the smooth flow of traffic and thus, reduces the cameras at traffic signals, detecting vehicles using image
stress of the driver. However, the parameters for calculating processing, calculating traffic density, sending the data to a
green light signal timing is not adequate. server to calculate the green signal timer, updating the traffic
signal timer based on the calculated time, and optimizing
An image processing, embedded board, cloud, and YOLO traffic flow at the traffic signals.
v4 algorithm-based real-time traffic control system was
proposed by Prathap et al. [6]. The vehicle detection, vehicle A. Vehicle Detection Module
count, and vehicle classification are computed by this system. Figure 2 shows the flow diagram of vehicle detection
The traffic density is estimated from vehicle count. YOLO v4 module. First, collect a large dataset of images that includes
network retains its accuracy, recall, and F-score in terms of vehicles. Annotate the images with bounding boxes around
traffic control and vehicle detection. The performance of the the vehicles. Divide the training dataset and validation dataset
proposed system is better than that of the existing systems. from the given data. Then, resize the images in to a uniform
However, its implementation is so complex and not cost size. Convert the images to a suitable format for deep learning
effective. (e.g. JPEG, PNG). Normalize the pixel values between 0 and
1. Apply data augmentation techniques, such as random
Jian-Da Wu et al., carried out a study that uses YOLO cropping, rotation, and flipping, to increase the variability of
algorithm to identify the vehicle types. This study uses traffic the dataset.
data, which are captured from the surveillance cameras
installed at higher places. Vehicle count and vehicle type Initialize the YOLO model architecture and pre-train the
identification are carried out in this study for different type of model to obtain feature representations on a large dataset.
roads. The proposed system is validated by comparing the Fine-tune the model on the vehicle detection dataset using the
number of vehicles measured by the system with the actual annotated images and the corresponding bounding boxes.
number of vehicles on the road. It is observed that the accuracy Train the model using a loss function that penalizes incorrect
of the proposed system is higher [7]. predictions of class and bounding box coordinates. Measure
the trained model's recall, F1 score and precision using a
On the basis of traffic flow, Shinde et al. suggested a real- different test dataset to determine its accuracy. Adjust the
time traffic light control system using deep Convolutional model's parameters to optimize performance if necessary.
Neural Networks (YOLO). The phases of traffic signal are Filter out false positive predictions using a confidence
optimized based on the collected data, such as queue density threshold. Refine the bounding box coordinates using non-
and waiting time per vehicle to allow more vehicles to pass maximum suppression (NMS). Integrate the trained model
safely with minimum amount of waiting time. Transfer with other systems.
learning technique can be used to implement YOLO on
embedded controller. Hence, limited hardware resources are B. Signal Switching Algorithm
required to perform operations on a Deep Neural Network. The Signal Switching Algorithm utilizes the traffic density
The advantage of the system is that the system is scalable and calculated from the vehicle detection module to set the green
reliable to implement in real time traffic environment. signal timer and to update the red signal timers of other
However, many advanced and new algorithms are developed signals. The algorithm periodically and cyclically switches
which are fined tuned as per updated requirement [8]. between the signals based on their respective timers. Vehicle
Many researchers have carried out various works related detection information is provided as input to the algorithm in
to real-time traffic signal control system using computer JSON format, with confidence and coordinates as values and
vision [9], artificial intelligence [10], video processing [11], object label serves as key. The total number of vehicles of each
IoT [12] etc. It has its own advantages and disadvantages. class is calculated from this input by parsing the information.
Here, in this study, AI based real-time traffic signal control Subsequently, the green signal time is determined and
system can be used to detect patterns in traffic flow and adjust assigned to the corresponding signal, and adjust the red signal
the timing of signals accordingly. This could be done through times of other signal accordingly. The Green Signal Timer
the use of computer vision techniques to detect the number of (GST) is calculated as
traffic at an intersection to identify traffic patterns. 𝑁𝑜.𝑜𝑓 𝑣𝑒ℎ𝑖𝑐𝑙𝑒𝑠∗𝐴𝑣𝑒𝑟𝑎𝑔𝑒 𝑡𝑖𝑚𝑒𝑜𝑓 𝑣𝑒ℎ𝑖𝑐𝑙𝑒𝑠
𝐺𝑆𝑇 = ∑𝑐𝑙𝑎𝑠𝑠𝑒𝑠 (1)
Additionally, deep learning techniques can be used to model 𝑖=1 𝑁𝑜.𝑜𝑓 𝑙𝑎𝑛𝑒𝑠+1
the behavior of drivers to predict their responses to traffic The Signal Switching Algorithm operates as follows:
signals and making them more efficient.
1. Initially, default times are set for all signals.

979-8-3503-0009-3/23/$31.00 ©2023 IEEE 1614


Authorized licensed use limited to: Zhejiang University. Downloaded on August 25,2024 at 17:37:15 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Electronics and Sustainable Communication Systems (ICESC-2023)
IEEE Xplore Part Number: CFP23V66-ART; ISBN: 979-8-3503-0009-3

Feature Vehicle Traffic Density


Training data Pre-processing Detection using is calculated
Extraction
CNN

Test data

Figure 2 Flow Diagram of Vehicle Detection Module

2. The time module manages the current signal's timer, while 3. When the green light time of the current signal reaches 5
the vehicle detection module is responsible for detecting seconds, the vehicle detection module takes a snapshot of the
vehicles. next direction.

(i) (ii)

(iii) (iv)

(v) (vi)
Figure 3 Results of Vehicle Detection Module (i) Input images (ii) Output images

979-8-3503-0009-3/23/$31.00 ©2023 IEEE 1615


Authorized licensed use limited to: Zhejiang University. Downloaded on August 25,2024 at 17:37:15 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Electronics and Sustainable Communication Systems (ICESC-2023)
IEEE Xplore Part Number: CFP23V66-ART; ISBN: 979-8-3503-0009-3

4. The resulting data is parsed, and the green signal timer is model. Then, modified the configuration of the .cfg file used
set accordingly. for training to match the specifications of our model. To
ensure that the model could detect all the required classes, we
5. Once the green timer of the current signal reaches zero, the adjusted the 'classes' variable by setting the number of output
next signal is activated and it becomes green, and sets it's neurons in the last layer equal to the number of classes.
corresponding signal timer.
The model was trained until the loss was significantly less
This algorithm is designed to be highly scalable and can be after making these configuration adjustments. The weights
easily adapted to handle any number of signals at an were now updated and adjusted according to our
intersection. Signals switch in a cyclic manner, rather than specifications. These weights were given as input for the
based on the density of traffic in a particular direction. detection of vehicles using OpenCV library. A threshold is set
IV. RESULTS & DISCUSSION for successful detection of vehicles. After the image is loaded
in to the model, it outputs the results in a JSON format i.e., in
A. Experiments on Vehicle Detection Module the form of key-value pairs (labels and co-ordinates). From the
The vehicle detection module is implemented using the labels and co-ordinates, bounding boxes on the images are
YOLO algorithm, which provides the better processing time drawn by using OpenCV.
and accuracy. Figure 3 shows the input and output images of Since, YOLO is a real-time object detection algorithm that
the vehicle detection module. Vehicle detection module was offers fast and accurate object detection in images. In our
trained using a customized YOLO model, which can identify proposed system, we chose the YOLO model because of its
a variety of vehicles including bikes, rickshaws, trucks and ability to detect and track vehicles in real-time, allowing us to
buses. The dataset was prepared by scraping images from efficiently process the live camera feed and make timely
google and manually labelling them using a graphical image decisions for traffic signal control. YOLO is specifically
annotation tool, LabelIMG. The pre-trained weights
downloaded from the YOLO website were used to train the

(i) (ii)
Figure 4. Results of signal switching module

(i) (ii)

(iii)
Figure 5. Results of Simulation Module

979-8-3503-0009-3/23/$31.00 ©2023 IEEE 1616


Authorized licensed use limited to: Zhejiang University. Downloaded on August 25,2024 at 17:37:15 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Electronics and Sustainable Communication Systems (ICESC-2023)
IEEE Xplore Part Number: CFP23V66-ART; ISBN: 979-8-3503-0009-3

designed for real-time object detection, making it more also updated as 5+10=15, which is the sum of the
suitable for our traffic signal control system [13]. yellow and green signal timings of TS 2. (Figure
4(ii)).
B. Experiment with Signal Switching Module
C. Experiment with Simulation Module
The results of signal switching module are shown in
Figure 4. The signal switching algorithm depends on the To simulate the real-world traffic, experiments are done
traffic density, total count of vehicles, green light duration, with the simulation module implemented from scratch using
number of lanes etc [14]. Pygame [15]. It helps in system visualization and comparison
with the existing system. There are 4 traffic signals at a 4-way
1. The red signal time of the second signal is set intersection. On top of each signal is a timer that displays the
according to yellow time and green time of first count down timer for the signal which switchers from one
signal and all other signals are loaded with default colour to another colour. Each signal maintains the number of
values (Figure 4(i)). vehicles that have been passed through the intersection. Cars,
2. The leftmost column shows the status of the signal, buses, bikes, rickshaws and trucks come from all directions. It
followed by the traffic signal number, and the current also has a timer that shows the elapsed time from the start of
timers of the signal. Here, TS 1, the first traffic simulation (Figure 5).
signal, switches from green to yellow. The output of Experiments are carried out with different traffic scenario
the vehicle detection algorithm, traffic density is and results are compared with the existing system. The
computed when the yellow timer reaches zero, and average cycle time and the delay time of the proposed and
TS 2 receives a green time of 9 seconds. The green existing system are calculated and tabulated (Table 1). The
signal time of TS 2 is set to 10 seconds because this proposed system is set with the cycle time of 90 seconds. The
number is less than the required green time of 10 cycle time and delay time are calculated for 10 different traffic
seconds. The countdown begins when the yellow scenarios. The test results shows that there is a reduction in
time of TS 1 hits 0, at which point TS 1 changes to delay time and reduction in cycle time ranging from 44.87%
red and TS 2 to green. The red signal time of TS 3 is to 83.20% and 27.78% to 74.44% respectively.
TABLE 1. RESULTS OF PROPOSED SYSTEM AND EXITING SYSTEM IN ACCORDANCE WITH DELAY TIME AND CYCLE TIME
Scenario Delay Reduction Cycle Time Reduction
No in delay in cycle
Proposed Existing System time % Proposed Existing System time %
System (Fixed Timer) System (Fixed Timer)
1 90
13.75 46.6 70.49 45 50.00
2 90
18.02 53.4 66.25 55 38.89
3 90
23.5 47.2 50.21 67 25.56
4 90
22.5 50.5 55.45 65 27.78
5 90
4.25 25.3 83.20 43 52.22
6 90
18.77 54.45 65.53 23 74.44
7 90
28.5 51.7 44.87 76 15.56
8 90
14.5 32.7 55.66 66 26.67
9 90
19.25 53.7 64.15 56 37.78
10 90
22.75 51.3 55.65 53 41.11

60
Delay Time (seconds)

50
40
30
20
10
0
1 2 3 4 5 6 7 8 9 10
Test Scenarios

Proposed System Existing System (Fixed Timer)

Figure 6. Comparison of delay time between the proposed system and the existing system

979-8-3503-0009-3/23/$31.00 ©2023 IEEE 1617


Authorized licensed use limited to: Zhejiang University. Downloaded on August 25,2024 at 17:37:15 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the Fourth International Conference on Electronics and Sustainable Communication Systems (ICESC-2023)
IEEE Xplore Part Number: CFP23V66-ART; ISBN: 979-8-3503-0009-3

Figure 6 shows the comparison of delay time between the [5] Sung-Dong Kim, “Situation-cognitive traffic light control based on
proposed system and the existing system. Figure 6 illustrates object detection using YOLO algorithm”, International Journal of
Computational Vision and Robotics, Vol. 10, No. 2, pp. 133-142, 2020.
that the delay time of proposed system is less when compared
[6] K. Sai Venu Prathap, D. Srinivasulu Reddy, S. Madhusudhan and S.
to the existing system. Mohammed Mazharr., “Intelligent Traffic Light System Using
YOLO”, Innovations in Signal Processing and Embedded Systems,
V. CONCLUSION Algorithms for Intelligent Systems. Springer, Springer, pp. 95-107,
In conclusion, utilizes an intelligent algorithm that 2023.
optimizes traffic flow by switching traffic lights based on the [7] Jian-Da Wu; Bo-Yuan Chen; Wen-Jye Shyr; Fan-Yu Shih., “Vehicle
Classification and Counting System Using YOLO Object Detection
calculated traffic density. The proposed system ensures that a Technology”, International Information and Engineering Technology
green signal is given longer duration with more traffic than the Association, Vol. 38, No. 4, pp. 1087-1093, 2021.
lesser traffic. This will reduce the traffic congestion, delay [8] Pranav Shinde, Srinandini Yadav, Shivani Rudrake, Pravin Kumbhar .,
time and waiting time, which will reduce pollution and fuel “Smart Traffic Control System using YOLO”, International Research
consumption. The cost required to install the system with Journal of Engineering and Technology, Vol. 6, No. 12, pp. 169-172,
CCTV cameras is negligible and also it does not use any 2019.
additional hardware. Hence, to assist improved traffic [9] S. Ransubhe, M. A. Mughni, C.R. Shiralkar, B. Ratnaparkhi, “Smart
Traffic Light Switching and Traffic Density Calculation Model using
management, the proposed system can be connected with the Computer Vision”. In 2023 IEEE 8th International Conference for
CCTV cameras in large cities. The system performs around Convergence in Technology, pp. 1-5, 2023.
25% better than the existing method, which is a substantial [10] M. M. Gandhi, D.S. Solanki, R. S. Daptardar and N. S. Baloorkar, “
improvement in terms of the number of vehicles crossing the Smart control of traffic light using artificial intelligence”. In 2020 5th
intersection. This system can be enhanced to perform better IEEE International Conference on Recent Advances and Innovations in
calibration using the real-world CCTV data for training the Engineering, pp. 1-6, 2020.
model. This system can also be enhanced by incorporating [11] A. Kanungo, A. Sharma and C. Singla, “Smart traffic lights switching
additional sensor data such as GPS data from connected and traffic density calculation using video processing”. In 2014 recent
advances in Engineering and computational sciences, pp. 1-6, 2014.
vehicles to provide even more accurate and detailed
[12] S. Javaid, A. Sufian, S. Pervaiz and M. Tanveer, “Smart traffic
information about traffic flow patterns. management system using Internet of Things”. In 2018 20th
international conference on advanced communication technology, pp.
REFERENCES 393-398, 2018.
[1] Soham Sawan, Shruti Londhe, Ajitametha, Ankit Kadam, Komal [13] J. Redmon, S. Divvala, R. Girshick, and Farhadi, A.,. “You only look
Mohite. “Adaptive Traffic Signal Timer”, International Research once: Unified, real-time object detection”. In Proceedings of the IEEE
Journal of Modernization in Engineering Technology and Science, Vol. conference on computer vision and pattern recognition, pp. 779-788,
4, No. 11, pp. 99-102, 2022. 2016.
[2] F. M. Nazarov , B. Sh.Eshtemirov, Sh.Sh.Yarmatov., “Technologies [14] B. Pratama, J. Christanto, M. T. Hadyantama and A. Muis, “Adaptive
For identifying Vehicles Standing at Traffic lights Based on Video traffic lights through traffic density calculation on road pattern. In 2018
Data”, Central Asian Journal of Mathematical Theory And Computer International Conference on Applied Science and Technology, pp. 82-
Sciences, Vol. 3, No. 12, pp. 52-59, 2022. 86, 2018.
[3] S. Anand, V. Neethidevan. “A Real Time Object Detection System [15] S.C. Ng, and C. P. Kwok, “An intelligent traffic light system using
Using a Web Cam with YOLO Algorithm”, Association of Cell object detection and evolutionary algorithm for alleviating traffic
Biology Romania, pp. pp.1876-1881, 2021. congestion in Hong Kong”. International Journal of Computational
[4] Durriya Bandukwala, Muskan Momin, Akmal Khan, Aasim Khan, Intelligence Systems, Vol. 13, No. 1, pp.802-809, 2020.
Lutful Islam, “Object Detection Using YOLO”, International Journal
for Research in Applied Science & Engineering Technology, Vol. 10,
No. 5, pp. 823-829, 2022.

979-8-3503-0009-3/23/$31.00 ©2023 IEEE 1618


Authorized licensed use limited to: Zhejiang University. Downloaded on August 25,2024 at 17:37:15 UTC from IEEE Xplore. Restrictions apply.

You might also like