Smart Traffic Light Design Based on Histogram of Oriented Gradient 
and Support Vector Machine 
Yuliadi Erdani, Hendy Rudiansyah and Zahra Dhiyah Nafisa 
Politeknik Manufaktur Bandung, Jalan Kanayakan 21, Dago, Coblong, Bandung, Indonesia 
Keywords:  Traffic Light, HOG, SVM, Webster, NodeMCU. 
Abstract:  Traffic congestion is one of the frequent problems in big cities, especially at intersections. Congestion occurs 
because the setting time of traffic lights installed still using the fixed timing without consider to the ups and 
downs of vehicle density that have the potential to cause congestion. To reduce these problems, the traffic 
light timing system must be in accordance with the circumstances in each intersection path. In this study, a 
traffic  light  simulation  was  made  using  the  Histogram  of  Oriented  Gradient  (HOG)  and  Support  Vector 
Machine (SVM) methods to detect vehicles that would determine the level of vehicle density. Webster method 
used to determine the duration of the traffic light based on the parameters of the density of vehicle. The output 
of this simulation is in the form in traffic light prototype that is controlled by NodeMCU and monitored by 
an application.
1  INTRODUCTION 
Traffic congestion is one of the problems  that  often 
occurs  in  big  cities  and  generally  occurs  at  road 
intersections. The number of vehicles that continues 
to increase from year to year, the growing population, 
the  imbalance  between  traffic  demand  and 
transportation  infrastructure,  and  the  inability  of 
traffic management to control and reduce traffic flow 
are one of the main causes of congestion. (Hartanti et 
al., 2019). The right way to control traffic congestion 
is by using traffic lights. (Mohanaselvi & Shanpriya, 
2019).  However,  the  use  of  traffic  lights  does  not 
always  solve  traffic  congestion  problems.  In  one 
situation, the traffic light will be very helpful in the 
smooth flow of traffic, but in another situation, it will 
make  the  traffic  jam  worse.  (Toar-lumimuut  et  al., 
2015). A common example is congestion during peak 
hours,  i.e.  in  the  morning  and  evening.  This 
congestion  occurs  because  the  traffic  light  timing 
settings used today still apply a conventional or fixed- 
cycle  traffic  light  (FCTL)  timing  system  or 
fixed/static  red  and  green  light  durations  without 
considering real-time road conditions, such as vehicle 
density in each lane of the intersection. (Ng & Kwok, 
2020), (Siswipraptini et al., 2018). Such timing will 
lead to the accumulation of vehicles on one side of the 
intersection and is very prone to causing congestion. 
With the different density levels at the intersection, a 
smart  traffic  light  cycle  timing  system  is  needed, 
which can adjust the cycle time automatically. 
Several studies have been conducted to overcome 
these problems. Fibrilianty et.al, have made a traffic 
light  timing  system  based  on  vehicle  density 
detection using the Histogram of Oriented Gradient 
(HOG)  method.  The  output  of  this  simulation  is  a 
Traffic  Light  prototype  that  has  been  designed  on 
Arduino  which  is  connected  to  a  program  that  has 
been designed in Matlab. Simulation of Trafic light 
timings  designed  to  get  more  efficient  system 
performance  results compared  to  traffic  lights  with 
automatic  timers  in  general.  (Fibriliyanti  et  al., 
2017). Another study designed an application using 
MATLAB  2009a  Software  and  Digital  Camera  as 
processing and input of traffic light images to detect 
density using the bwarea method. The results of this 
system  can  determine  the  length  of  time  the  green 
light is on based on the density of the road section. 
(Toar- 
lumimuut  et  al.,  2015).  Noval,  C.  et.al  have 
conducted 
research on traffic light optimization using 
the  webster  method.  In  this  study,  the  webster 
method is able to optimize traffic cycle time based on 
vehicle  density  detection  using  infrared  sensors. 
(Noval et al., 2018). 
The  purpose  of  this  research  is  to  create  a 
simulation  of  a  miniature  traffic  light  that  works 
adaptively,  namely  a  traffic  light  that  adjusts  the