Employing Real-Time Object Detection for Traffic Monitoring

The population rate in India is increasing at a fast pace. Also, this increasing number is the main driver of various issues, one of which is rise in traffic in the past few decades, prompting to inadequately managed traffic checking thus leading to imprudent drivers. Controlling such a high density of traffic, halting the defaulters and fining each one of them would end up being a very challenging piece of work, given that such an activity has to be performed with exactness is difficult. It would require an enormous number of personnel, who can instead be deployed for better and more demanding undertakings, to reach a high precision. When we discuss precision and speed in connection with unpredictability, we can place some confidence in machines and for undertakings of higher nature which require recognition of objects, highlight extraction and prediction, we can set ourselves towards deep learning. This paper proposes a brilliant traffic monitoring framework, intended to call attention to the defaulters, and fine them as per the standard they break. The TensorFlow library, later integrated with the Keras library, provides multiple types of layers of neural networks for differently demanding tasks. Our model utilizes the TensorFlow library for deep learning and the OpenCV library for the vision. In order to perform object detection, image cropping and return the bounding boxes, our model employs the YOLOv4 algorithm. When the step of sifting the regions of interest is done, these regions are now sent to the different classification models in order to be used for performing classification between the defaulters and the non-defaulters. LeNet and AlexNet have been utilized as they give a reliable performance in the grouping of small images of low resolution as they were initially worked upon to classify penmanship styles. The LeNet has been used to group the bikers not wearing head protectors from bikers wearing head protectors and the AlexNet has been used to distinguish the drivers with the safety belts on from drivers without the safety belts on. The model that arranges bikers wearing or not wearing helmets utilizes the LeNet classifier while the model that groups the car drivers with their safety belts on from the car drivers without the safety belts on employs the AlexNet architecture as it is a marginally more precise model as mentioned above and results in higher classification accuracy of the lower quality car driver pictures. Our model has been trained utilizing Mini-Batch Gradient Descent using the Adam optimizer with a batch size of 10 with the division of the dataset using five-fold method where the training set constitutes 80% of the dataset while the testing set constitutes rest of the 20% of the dataset. The dataset for training the LeNet architecture constitutes 300 images of bikers with and without helmets in a ratio of 1:1 while the dataset that has been used to train the AlexNet classifier consists of 300 images of drivers with and without their seatbelts on also in a ratio of 1:1. The AlexNet shows an accuracy of 93.6% while the LeNet design gives an accuracy of 94.7%. The scripts which utilize the model to recognize the objects and provide class of the objects that are a necessity in building a traffic monitoring system such as helmet on a motorist’s head or a safety belt for a car driver have been written in python. The recognized image category is extracted and stored. This system can successfully provide information about detected entities and thus ensure proper traffic maintenance. Therefore, the developed system provides aid in proper traffic management and giving its part in order to lead us towards becoming a more technologically developed society using real-time object detection and identification technology.