Congestion Control System Using Machine Learning
Abstract - In today's fast-paced world, technology and population growth are increasing at an unprecedented rate. As a result, governments are increasingly interested in managing and developing their road networks, especiallyindenselypopulatedcountrieswheretrafficisa major issue. However, traffic officers may not always be able to handle large volumes of traffic, particularly during festivals or other peak periods. Therefore, we conducted research to address these issues, specifically focusing on how to automate traffic management and how to ensure that ambulances can navigate through heavy traffic. This paper presents a solution to these road congestion problems by leveraging the new technology of Machine Learning (ML). We used ML algorithms, datasets, and mathematical calculations, programmed in Python, to conduct our research. Our focus was on developing automatedtrafficmanagementsolutionsthatcouldhandle large volumes of traffic and ensure that emergency vehicles such as ambulances can quickly move through congested roads. Python is a programming language that offers a versatile platform for performing a variety of operations, including object detection, image processing, video processing, and more We have designed some algorithms which can handles larger traffic. The design alsohassecondproposedsystemforhelmetdiscoveryand license plate recognition to detect and identify the twowheeler riders without helmet and thereby penalizing them. Object discovery utilizing YOLOV4 is the main concept.Objectdiscoveryisactedatvariouslevelstolabel theheadgearregulationlawbreakerandtheirlicenseplate number.UsingaLicensePlateRecognitionAPI,thelicense plate number is before gleaned. A database is maintained that consists of details of two- wheeler possessors. An dispatch conforming of violation details and a link to pay the penalty is transferred to the helmet law violators. An interface is developed using Tkinter that can be used by executive officer to check for the violators in the vids handedasaninputandalsotocovertheentireprocess.
Keywords: Alex Net, COCO, Python, TensorFlow, YOLO.
1.INTRODUCTION
The urban areas are equipped with advanced technology, including various electronic devices, sensors, and big data management systems. Among these technologies, the development of city roads stands out. However, the most common challenge faced by these cities is traffic
management. This is often caused by factors such as malfunctioningtrafficlightsorahighernumberofvehicles on one side of the road than the other during rush hours. Therefore, there is a need for intelligent traffic management solutions, which can be addressed using MachineLearning-basedobjectdetectiontechniques.
The statistics show that the primary obstacle faced by emergency vehicles, such as ambulances, is navigating through traffic, particularly during peak hours. Currently, there is no dedicated monitoring system in India, except for CCTV footage, and over 56% of accidents occur while transporting patients. To reduce the number of fatalities, there is a need to create a cost-effective smart traffic management system that leverages unconventional technologies. The proposed system caters to the needs of emergency vehicles, such as ambulances, fire trucks, and policevehicles,bycreatingasmarttrafficlightsystemthat cancommunicatewitheachotherthroughrelaysignalsvia microcontrollers. The system employs a Compact Prediction Tree (CPT) algorithm, which is a derivative of Deep Neural Network (DNN), to perform computations at thesamerateasregulardeeplearningalgorithms.CPTisa recurrent neural network algorithm that supports lossless compression of the training data while retaining all relevant information for each prediction. The system also aims to distinguish between riders with and without helmetsbydetectingtheirfacesinvideoframes,extracting the area of the rider's head, and classifying whether the rider is wearing a helmet. Additionally, the system proposes an automated system for detecting high-priority vehiclesandgivingthempriorityontheroad.
This paper proposes a method to detect helmetless riders usingpre-recordedvideosthatcouldbefurtherdeveloped into a continuous surveillance system for motorcyclists. Furthermore, the system proposes an automated system for detecting high-priority vehicles and providing them with priority on the road. The system also includes an algorithm for retrieving motorcycle number plates from CCTV footage, generating emails, and storing violator detailswithminimalhumanintervention.
2. LITERATURE SURVEY
[1] The objective of the paper "Employing Cyber-Physical Systems-Dynamic Traffic Light Control at Road Intersections", published in the IEEE Internet of Things
Journal, was to propose a dynamic traffic light control system for road intersections using road safety units (RSUs) and VITCO/RITCO protocols. The study found that this system could effectively manage two lanes with a car capacityofupto100andanestimatedvehiclearrival rate of90perlane, with redand greenintervalsof20seconds. However, the model's main limitation is its high hardware dependency,makingitcostlytoimplement.
[2] The aim of the paper published in the IEEE TransactionsonCircuitsandSystemsforVideoTechnology is to develop a real-time traffic light recognition system basedonsmartphoneplatforms.Toachievethis,thepaper proposes the use of an ellipsoid geometry limit displayed in the HSL shading space to extract interesting color regions. These regions are then screened with a postprocessingsteptoobtaincandidateregionsthatmeetboth color and brightness conditions. Additionally, a new bit capacity is proposed to effectively combine two heterogeneous features, HOG and LBP, to describe the candidate regions of the traffic light. A Kernel Extreme Learning Machine (K-ELM) is planned to justify these aspirant domains and together label the entertainment industryandtypeoftrafficlightsTheresultobtainedwasa visualization of a Finite Traffic system which reduces GPU dependencyoffeaturevectorfrom512to256. However,a limitation of this model is that it can handle only a single angleforHSV.
[3] The objective of the paper published in IEEE Transactions on Control Systems Technology was to develop an Adaptive quasi-dynamic traffic light control system.Toachievethis,theresearchersusedmicro-bother analysis to derive online preference estimators for a cost metric related to controllable light cycles and limit parameters. These estimators were then utilized in an online angle-based algorithm to iteratively adjust all the controllable parameters and improve the overall system performance under various traffic conditions. The result obtained was a dynamic system capable of functioning in different traffic conditions and congestion. However, a limitationofthisapproachisthatitonlyconsidersasingle lane/intersection and is therefore insufficient for complex roadnetworks.
[4] The objective of this paper, published in IEEE TransactionsonIntelligentTransportationSystems,wasto design an emergency traffic-light control system for intersections affected by accidents. The authors used deterministic and stochastic Petri nets (PNs) to structure the system and provide emergency response to manage accidents. The outcome showed an improvement in realtime accident management and traffic safety at intersections, with support for deadlock and livelock situations. However, the model did not provide evidence foraccidentprevention
[5] The aim of the article published in IEEE Transactions on Intelligent Systems was to develop a method for
identifying different car makes and models using a single traffic camera image. The proposed approach utilizes a new vision-based traffic light detection technique for autonomous vehicles, which consists of two phases: candidate extraction and recognition. The method can achieve accurate and robust detection results, and the entire system is capable of meeting real-time processing requirements, processing video sequences at around 15 framespersecond.However,thetechniqueplacesastrong emphasis on candidate extraction, and simpler feature extractionmethodscouldpotentiallybeemployed.
[6]ThegoaloftheresearchpresentedinIEEETransactions on Intelligent Transportation Systems was to develop a methodforidentifyingthemakeandmodelofacarusinga combination of neural network ensembles, linear binary patternshistograms,andHistogramofGradientclassifiers, basedonasingletraffic-cameraimage.Theresultsshowed thatbyusingfeaturestandardization,thesystem achieved a 100% accuracy rate, while without feature standardization, it achieved a precision of 99.82%. However,amajorlimitationoftheapproachisthatitisnot suitableforscalingtoacitywideimplementation.
3.PROPOSED WORK
The virtual traffic signals which comprise the four roads and four traffic lights for each. In general, 30 seconds are allottedtoeveryroadtocleartraffic.Thus,we'replanning to be covering each side of traffic by camera and with the helpofmachinelearningAcquiringimagesorlivevidsand recyclingthisbyusingapplicablelibrariesofpythonwhich is YOLO. . We have different types of vehicles. The ambulanceisoneofthem.Wecan’tstopforsignalstoclear traffic. Therefore, we need to learn our project about the difference between vehicles. For training the systems the AlexNet CNN architecture is used. Below are the given steps
1. The camera sends the images to the system in some intervalsforprocessing.
2.Thiscanbedeterminedbythedensityoftrafficfromthe roadsandbasedonthecalculationstimeofthetrafficclear ischangedwhichisshowninresult.
3.Thesystem decides whichsignal is open for whichtime andit'lltriggerthetrafficsignals.
The result can be explained in four simple way are 1.Createareal-timeimageofeachtrack.
2.Scananddeterminethetrafficdensity.
3. Enter this information into the time allocation module. Theoutputisthetimeintervalsforeachtrack,asrequired. Also, wecan reduce the number of helmet violation cases, continuous surveillance of motorcyclists without helmet, generation of email and storage of violator details with little or no manpower. In this system, videotape input is
fed to the YOLO algorithm to determine whether motorcyclists are wearing helmets or not. The object detection is performed at three situations. originally, a motorcycle(s)withapersononit'sidentifiedandalsothe helmet is detected. However, also the license plate recognitionisdone,Ifthe model identifiesthattheperson isn't wearing a helmet. All these stages are enforced using YOLOv4.Oncetheobjectdetectionprocessiscomplete, an Optical Character Recognition (OCR) API is employed to extractthenumberplateofthevehicle.TheOCRisfedwith a cropped imageofthelicense plate tocarryoutthis task. The extracted numberplate iscomparedwith information of motorcyclists stored in a database using SQL queries and an dispatch conforming of violation details and a link topaythepenaltyistransferredtotheviolator
4.REQUIREMENT ANALYSIS
SoftwareRequirements:-
-Desktop4.0AndAbove
-2GBRAM
-ProcessorSpeed1.2GHzAndAbove.
HardwareRequirements:-
-8GBRAMPC
-AtLeast2GHzProcessor
-Windows7/8/10
TechnologyUsed:-
-Python
5.RESEARCH AND METHODOLOGY
1. Google Collab: Google Collab is a cloud-based Jupyter notebookenvironmentthatisavailableforfree.Itprovides support for a wide range of popular machine learning libraries, which can be conveniently loaded into the notebookforuse.
2. Python: Python's programming style is known for its simplicity, clarity, and the availability of powerful classes. AnotheradvantageofPythonisitsabilitytointegratewith otherprogramminglanguages,suchasCorC++,makingit aversatilechoicefordevelopers.
3. OpenCV: OpenCV, short for Open Source Computer Vision, is a collection of programming functions that are primarily designed for real-time computer vision applications. It is an open-source library that is available for free under the BSD license and can be used across multiple platforms. OpenCV also provides support for several deep learning frameworks, including TensorFlow, Torch/PytorchandCaffe.
4. NumPy: Python has an array data type, which can be implemented using the NumPy library for data analysis andcomputation.BothPythonandNumPyareopen-source libraries that are freely available. NumPy is particularly useful for matrix calculations and is widely used for this purpose.
5. Pandas, Matplotlib: Pandas is a Python-based opensourcelibraryfordataanalysisandmanipulation,whichis fast, powerful, flexible, and user-friendly. Meanwhile, Matplotlib is a comprehensive Python library. With Matplotlib, simple tasks are easy to perform, and complex visualizationscanbecreatedwithease.
6. Pillow: The Python Imaging Library, commonly known as PIL, is an open-source library that provides additional support for various image file formats within the Python programming language. PIL enables the opening, editing, and saving of different types of image files. With the Python Imaging Library, users can add advanced image processing functionality to their Python interpreter. The libraryboastsextensivesupportfornumerousfileformats, high-speed data access, and robust image manipulation features. The core image library is designed to enable rapid-fire access to data stored in several introductory pixelformats,layingasolidfoundationforaproteanimage processingtool.
7. TensorFlow: TensorFlow is an open-source library usedfordataflowprogramminginvarioustasks,including machine learning applications such as neural networks. It is a symbolic math library used for both research and production at Google. Its flexible architecture allows for easy computation deployment across various platforms. Our project involves monitoring traffic using machine learning, capturing images or live videos, and processing them using relevant Python libraries such as YOLO. We need to differentiate between different types of vehicles, including ambulances, which cannot stop for signals. For thispurpose,weusetheAlexNetCNNarchitecturetotrain oursystem.
For motorcycle detection, we use a trained model with COCO Dataset, which is a large-scale object detection, segmentation, and captioning dataset. COCO defines 80 classes,andweimporttherequiredlibrariestoaccessthe dataset. The libraries help differentiate between required objects such as motorcycles and other objects, and the detected objects are assigned certain IDs for future reference. The function "Coco.getObjectIds" is used to get the IDs for differentiated objects. The accuracy of our trainedmodelformotorcycledetectionis99%.
Dataset: The quality of a model's performance in deep learningandmachinelearningreliesheavilyonthedataset used. A high-quality dataset ensures high precision and recall in the model. For object detection in images or videos, we used a manually created dataset consisting of 1,380 Emergency Vehicle Images and 1,496 NonEmergency Vehicle Images. During the training process, the dataset was divided into training and testing sets. In addition,forHelmetDetection,wecreatedacustomYolov4 Model using a dataset with over 1000 images of both helmet and non-helmet riders. The images were collected fromGoogle.
6.RESULTS
6. CONCLUSION
Our team is currently developing an advanced traffic control system that utilizes smart monitoring and detection technology to efficiently manage traffic flow. By analyzing the density of traffic, the system can make informeddecisionstooptimizetraffic controlandincrease capacity at intersections. This innovative approach not only reduces the frequency and severity of accidents, particularly right-angle collisions, but also enables continuous and steady traffic flow under favourable conditions.
Comparedtotheexistingsystem,whichisinefficientdueto the sheer volume of vehicles on the road, the proposed system addresses multiple loopholes by simultaneously detecting violations such as speeding, helmet noncompliance, triple riding, and more. With automated violation/finealerts,theproposedsystemprovidesa safer andmoreefficientalternativetothecurrenttrafficcontrol system.
ACKNOWLEDGEMENT
Itisourgreatpleasuretopresentthepaperforourproject titled "Congestion Control System Using Machine Learning" for road. We would like to express our sincere gratitude to several individuals who have been instrumentalinprovidinguswithhelpandencouragement duringtheproject'sduration.
Wearedeeplyindebtedtoourprojectguideand esteemed Head of Department for their unwavering patience, guidance, and valuable suggestions. They were a constant source of inspiration for us and supported us through all challenges. Their unrelenting support and interest in our projectweregreatlyappreciated
We would also like to acknowledge the cooperation and assistance of all the staff members who granted us permissiontoworkinthecomputerlab.
Additionally, we are grateful to all the students for their helpful advice and tremendous support. Their support madetheproject'sprogresssmoothandenjoyable.
REFERENCES
[1] Younis, O. and Moayeri, N. (2017), "Employing CyberPhysical Systems: Dynamic Traffic Light Control at RoadIntersections",Elsevier,https://doi.org/10.1109/J IOT.2017.2765243(Volume: 4, Issue: 6, December 2017)
[2] Wei Liu, Shuang Li, Jin lv, Bing Yu "Real-time Traffic Light Recognition Based on Smart Phone Platforms" IEEE Transactions on Circuits and Systems for Video Technology 27(5):1-1 DOI:10.1109/TCSVT.2016.25153382
[3] [JuliaL.Fleck,C.G.Cassandras,YanfengGeng"Adaptive Quasi-Dynamic Traffic Light Control" August 2015 Control Systems Technology, IEEE Transactions on 24(3):1-1DOI:10.1109/TCST.2015.2468181
[4] Liang Qi, Mengchu Zhou, Wenjing Luan "Emergency Traffic-Light Control System Design for Intersections Subject to Accidents" September 2015IEEE Transactions on Intelligent TransportationSystems17(1):114DOI:10.1109/TITS.2 015.2466073
[5] Zhenwei Shi; Zhengxia Zou; Changshui Zhang "RealTime Traffic Light Detection With Adaptive Background Suppression Filter" October 2015 IEEE Transactions on Intelligent Transportation Systems 17(3):1-11DOI:10.1109/TITS.2015.2481459
[6] Hongsheng He, Zhenzhou Shao, Jindong Tan "Recognition of Car Makes and Models From a Single Traffic-CameraImage"IEEETrans.Intell.Transp.Syst. 16(6):3182-3192(2015)
[7] Wang, R., Zhang, J., Ma, Y., & Lu, J. (2019). Research on helmet detection method based on YOLOv3. Journal of Physics: Conference Series, 1333, 022088. https://doi.org/10.1088/1742-6596/1333/2/022088
[8] Shaoqing Ren, Kaiming He, Ross Girshick, Jian Sun, “Fast R-CNN” (Submitted on 4 Jun 2015 (v1), last revised6Jan2016(thisversion,v3)).
[9] Tan, Y., Wang, X., Zhang, Y., & Wu, J. (2020). A fast and accurate helmet detection method based on YOLOv3. IEEE Access, 8, 212889-212897. https://doi.org/10.1109/access.2020.3040468
[10] Hirota,N.H.Tiep,L.VanKhanh,andN.Oka,Classifying Helmeted and Non-helmeted Motorcyclists. Cham: SpringerInternationalPublishing,2017,pp.81–86.
[11] MayuriLakhani, Shivansh Dave, Jignesh J.Patoliya “InternetofThingsbasedAdaptiveTrafficManagement System as a part of Intelligent Transportation System (ITS)”,IEEE2018.
[12] AditiYadav, Vaishali More, NehaShinde, ManjiriNerurkar, NitinSakhare, “Adaptive Traffic Management System Using IoT and Machine learning”, JournalofElectricalTechnology,Vol4,pp.221-226,Jan 2019.
[13] Ruben.J Franklin and Mohana, “Traffic Signal Violation Detection using Artificial Intelligence and Deep Learning, ”2020 5th International Conference on CommunicationandElectronicsSystems(ICCES),2020, PP.839-844,doi:10.1109/ICCES48766.2020.9137873.
[14] Li, L., Li, J., & Chen, L. (2021). Intelligent safety helmet detection system based on deep learning. Journal of Physics: Conference Series, 1776, 032033. https://doi.org/10.1088/1742-6596/1776/3/032033
[15] Yu,L.,Han,Z.,Liu,L.,&Yang,Y.(2020).Anovelhelmet detection algorithm based on deep learning for intelligent construction. Journal of Computing in Civil Engineering, 34(6), 04020052. https://doi.org/10.1061/(ASCE)CP.19435487.0000961