Real Time Traffic Signal Violation using Artificial Intelligence and Machine Learning

DOI : 10.17577/IJERTCONV10IS12013

Download Full-Text PDF Cite this Publication

Text Only Version

Real Time Traffic Signal Violation using Artificial Intelligence and Machine Learning

Ajit Chaurasiya1, Atul Kumar Jha2, Dibyanshu Jha3, Jitendra Kumar Yadav4, Prof. Imran Ulla Khan5

1,2 CSE Department, Sri Krishna Institute of Technology, B lore-560090, India

3ISE Department, Sri Krishna Institute of Technology, B lore-560090, India

4 Faculty CSE Department, Sri Krishna Institute of Technology, B lore-560090, India

Abstract:- This Research focus on an automated Real-Time Traffic Signal Violation Detection using Artificial Intelligence and Machine learning the aim of the Project is to detect all the violation that takes place on a traffic signal .As we know in this new evolving world traffic violation is the major issue and is increasing day by day .so this project mainly focuses on how to tackle the evolving traffic problem where we use automated software which detects the violations The principal objective of this project is to control the traffic rule violations accurately and cost effectively. The present model includes an automated system with the use of IR sensors and camera based on Raspberry PI to capture video. The project deals with finding Automatic Number Plate Recognition (ANPR) techniques and other image manipulation techniques for plate location and character recognition which makes it faster and easier to identify the number plates. And we also have a module which is a message based module in which after recognizing vehicle number plate. The person who violates the signal gets automatic SMS from RTO which contains message of type of violation performed.

Index Terms- Traffic violation, Image processing, Helmet- detection, Triple Riding, Number plate detection, No Parking Detection, Signal jump detection, SMS Module.


    As we know about the recent world there is vast rapidly increase in vehicles and maintaining the traffic is one of the very tough task though we have traffic police but it is also very difficult for them to work manually and is one of the most tedious jobs. Finding about the solution of these problem. we came out with the automated detection of traffic violation in which we have a camera con ected to the signal and which looks after all the rule violation detection it starts from capturing the vehicle and detecting number plate and if any violation is done by that vehicle there is an automated SMSbased module which gives message to the owner of vehicle about violation done. Automation has gained importance in day-to- day life in recent years. As we know the number of accidents taking place on the roads is due to the Traffic rule violations such as not following traffic signals, over speeding, driving on wrong sides not giving way to pedestrians etc. To avoid such traffic violations, traffic police on signal have to look after and be present on the road and has to continuously check for the vehicle which is violating the rule.

    A certain automated solutions were developed to eliminate problem of violations however each of them had certain limitations, like the video capturing cameras abolish need of an authority that need to be present to check rule violation. Automatic Traffic monitoring and surveillance are important for road operation and maintenance.

    Traffic parameter estimation has been an active exploration area for the development of Intelligent Transportation Systems (ITS). For ITS operations Traffic information needs to be collected and distributed. Sensor detectors have been employed to estimate Traffic parameters for revise Traffic information .the most used technologies is magnet loop detectors , but the problem is the installation and maintenance is very inconvenient and might became incompatible for future ITS infrastructure.

    It is well known that vision-based camera system is

    one of more versatile for traffic parameter estimation. In addition to quantitative description of road congestion image dimensions can give quantitative description of traffic flow. In the present work the designed status of Traffic including speeds of the vehicle, vehicle counts, vehicle number plate and quantitative traffic parameter can give us complete information about traffic flow, which fulfils the ne d of traffic management theory. Image tracking of moving vehicles on road can give system aims to achieve the following things.

    • Differentiate the presence and absence image of vehicle in road.

    • When the road is empty, Signal the traffic light to go red.

  2. BACKGROUND STUDY (LITERATURE) The main goal of this review study was to discover solutions given by other writers and evaluate the limits of their methodology after examining all options the best solution wi l be implemented.

    In [1] During hurry hours, emergency vehicles like Ambulances, Police cars and Fire Brigade trucks get stuck in jams due to traffic. Because of these, emergency vehicles are not able to reach their destinations in right time, resulting into a loss of human lives and substance. We have developed a system which is used to provide clearance to any emergency vehicle stuck in jam by turning all the red lights to green on the way of the emergency

    vehicle, hence providing a complete green wave to the desired vehicle so that it becomes easy to reach their destination.

    In [2] a 'green wave' in traffic signal is the synchronization of the green phase of traffic signals. In addition to the path of green wave, the system will track a stolen vehicle or terrorist vehicle when it passes through a traffic light. It is an autonomous 2-tier system which will help in the identification of emergency vehicles passing the path.

    In [3] Traffic congestion is one of the major problem in cities of developing Countries like India. As there is Growth in urban population and the middle-class segment which result to the rising Number of vehicles in the cities. Congestion on roads eventually causes in slow moving of vehicle in Traffic, causing Jams, which increases the time of travel, thus be notable as one of the major issues in Metropolitan cities.

    In [4] as we are familiar with the problem of urban traffic congestion spreads, there is a pressing need for the introduction of advanced technology and equipment which will improve the state of-the-art of traffic control. Traffic problems nowadays are rapidly increasing because of the growing number of vehicles in the globe and the limited resources provided by current infrastructures. The simplest way for controlling a traffic light can be done by using the timer for each phase. Another way is to make the use of electronic sensors which works in detecting vehicles and produce signal that cycles.

    In [5] A Technology called Swarm Technology is basica ly a system which works on real time conditions and the members present in the group interact with each other in a decentralized manner to achieve a particular objective via self -organization. Some of Natural examples are ant colonies, schooling of fishes, etc. Swarm inte ligence is defined as a field of artificial intelligence. Artificial Intelligence of machine or software is one which studies and develops intelligent machine and software to make day to day life of humans much convenient. Swarm behavior is a collective behavior provided by similar types of species which all together perform a particular task. Till date swarm technology has been used only for robot -to robot implementation.

    In [6] Advanced systems required for tracking and identifying stolen, unauthorized vehicles are based on automated number plate recognition technology. The two type of algorihm named Genetic and HOUGH algorithms are used.

    In [7] The LPR system consist of core OCR. In this work, a hardware based OCR system has been implemented. Supervised learning algorithm is used.

    In [8] Work deals with a painted lines and road boundaries detection for intelligent and autonomous vehicles. Advanced computer vision algorithm used. Robust against

    external perturbations and different constraints, but it is good enough to control the vehicle with a simple couple of fuzzy logic laws.

    In [9] Effective and first computing methodology is used for associating number plate of vehicle. Computationally it need veritably lower capitalist as compared with utmost of the conventional styles known. The automatic number plate recognition system uses a system of image capturing and processing technology for searching of the vehicles. This system handed can be used in largely areas which are more weakened and largely defined areas to fluently identify marketplace rule violated vehicles in the road using algorithm called OCR


    1. Input image from webcam. Capture image from webcam.

    2. Convert image into binary.

      • Identify the intensity of the image. Calculate appropriate threshold value for the image.

      • Using the calculated threshold the

      • Image is converted into binary image.

    3. Detect area of number plate. Determine width and height of the image.

      Fill small holes including numbers of Number plate so that number plate area will be large to isolate from figure and convenient.

    4. Segmentation.

      • From the Image Filter the noise level present in it.

      • Clip the plate area in such a way that only area of numbers plate area extracted.

    5. Number identification

      • From the stored template images create the template file.

      • Resize image which obtained from segmentation to the size of template.

    6. Then Save the file in given format Open a text file in writing mode.

    Store the character obtained from the number identification process to text file in given format present.


    motion, the differences of the profiles are larger than the case when there is no motion. By selecting a threshold value the motion can be detected.


    A vehicle detection operation is applied on the profile of the unprocessed image. The method used here is based on applying edge detector operators to a profile of the image edges which are less sensitive to the variation of ambient lighting evolved and are used in full frame applications (identification)


    first step to measure the TMJ parameters using the key region method which is used it cover the boundary of the junction by a polygon sides in such a way that all the entry and exit paths of the junction cross the polygon. However, the polygon should not cover the pedestrian marked lines which is used for walking. This step used is shown in the figure provided below. The second step of the algorithm is

    to define a minimum number of key regions inside the boundary covering the junction, of polygon.


    TESSERACT OCR : Number Plate Recognition Gaussian Blur Algorithm

    Canny Edge Detection : Edge Detection

    CNN (Convolutional neural network)


    for Customized Object Detection.

    Tesseract OCR: The number plate recognition uses Tesseract OCR starts with image acquisition, then the image is being processed so that it remove any distortions present and noise from the image. Then number plate then made to localized to the irrelevant part and characters in the number plate present are segmented and then the recognized and output is given.

    Gaussian Blur system Gray scaling and blurring As the part of pre-processing the input frame or image got from the CCTV footage, the image captured is Gray gauged and is blurred with Gaussian Blur system. The Image corruption

    is the process of partitioning a digital image into multiple piece (Sets of pixels, also known as objects of image). The thing of corruption is to modify it to simple or change the representation of an image into commodity that's further meaningful and accessible and easier to dissect and accessible.

    Gray scaling is the process of converting a nonstop- tone image to an image that a computer can convert or manipulate While argentine scaling is an enhancement over snap giving clear image, it needs larger quantities of memory the reason beside this is that each fleck is represented by bits 4 to 8


    Design is the key phase of any project. It is the first step in moving from the problem domain. The input to the design phase provided is the specifications of the system to design. Before on going to the implementation of package, this has to be carried out thoroughly to illuminate any bug, error which may be present. The project designed has to be submitted for system design. The output obtained of the top level designs such as architectural design, or the system design for software system to be built. A design should be very clear, verifiable, understandable, complete, efficient, and simple Firstly video is taken from a camera, and then each frame of the video is processed as the image. In this stage the license plate position from the given image is located and isolated. Quality obtained from the image plays an important part hence prior to this stage pre-processing of the image is necessary.

    So first each frame pre-processed by binarization, noise reduction and edge detection of the image. Then, the license plate is located by different image processing technique and gets captured. firstly the image is captured and then the captured image is input into a image processing using Raspberry PI and after that the violation is checked and then the number plate detection is done the violation consist of number plate and helmet detection secondly about triple riding detection and it checks for the signal jump and lastly about the no parking violation after the violation is captured then a information about the violation is sent to the owner using SMS.


  • First of all the traffic will be controlled automatically and it has many benefits including it need less manual attention and the detection done once will be recorded.

  • It would be easy for looking after the emergency situation and making an easiest way for emergency vehicle by providing them the way.

  • It becomes very obvious to get caught after violating traffic signal as it is automated.

  • It also provide instant message of violation automatically which makes person follow the rules of traffic

  • A motorbike trespasser with triple riding and no helmet is also detected automatically as a traffic violation

  • An automated traffic control encourages the people to wear helmet and follow the rules

  • It first detects the number plate of all vehicles and if someone try to stole the vehicle and pass the signal its image gets captured and would be easy to find the lost vehicle

  • It helps in reducing traffic congestion and reducing the chance of road accidents.

  • Though, the system is good but it still needs some improvement to achieve a hundred percent accuracy


We would like to thank our H.O.D Dr. Shantharam Nayak and Professor Imran Ulla Khan and we express our gratitude for the constant support kind guidance and moral support in the process of preparing paper.


[1] SamirA.Elsagheer Mohamed, "An Automatic Traffic Violation Recording and Reporting System is to Limit Traffic Accidents: Based on Vehicular Ad-hoc Networks (VANET)", 2019 International Conference taking place on Innovative Trends in Computer Engine ring (ITCE), pp. 254-259, 2019.

[2] Rhen Anjerome Bedruz, Aaron Christian, P. Uy, Ana Riza Quiros, Robert Kerwin Billones, Edwin Sybingco, et al., "A Robotic Model Approach of an Automated Traffic Violation Detection System with Apprehension", 2018 IE E 10th International Conference held on Humanoid Nanotechnology Information Technology Communication and Control Environment and Management (HNICEM), pp. 1-4, 2019.

[3] Mukremin Ozkul and Ilir Capuni, "Police-less multiparty traffic violation detection and reporting system with all precaution against privacy preservation", IET Intelligent Transport Systems, vol. 12, no. 5, pp. 351-358, 2018.

[4] Ayush Kumar Mittal and Deepika Bhandari Proposed, A novel

approach to implement Green wave system and detection of stolen vehicle in February 2013

[5] Geetha.E, V.Viswanadha, Kavitha.G proposed a project on An Intelligent Auto Traffic Signal Control system in July2014 .

[6] Vismay Pandit, Jinesh Doshi, Dhruv Mehta, Ashay Mhatre and Abhilash Janardhan proposed a project, Smart

[7] Traffic Control System using Image Processing technique in January February 2014 .

[8] N.Ahmed Surobhi and Abbas Jamalipour they proposed, M2M- Based Service Coverage for Mobile Users in Post-Emergency Environments in September 2014 .

[9] M.S.kanikar, S.Prabhu, Rahul Chauhan, Akhileshbhat proposed, Swarm Intelligence for Traffic Routing in 2015 of April .