Automatic Number Plate Detection for Motorcyclists Riding Without Helmet

. The increased usage of motorcycles in recent times has resulted in a rise of road accidents and injuries, with the absence of helmets being a major contributing factor. The current process of physically checking helmet usage at junctions or using CCTV footage to detect motorcyclists without helmets is time-consuming and requires human intervention. To address this issue, a computerized model is proposed to automatically detect motorcycle riders wearing helmets from images. The proposed model utilizes the You Only Look Once (YOLO) Darknet deep learning framework, which is customized to detect riders with and without helmets. The model also automates an alert to the rider found without a helmet. The dataset consists of a large collection of images with 80 different object categories, covering a wide range of real-world scenarios. The solution has the potential to enhance the capabilities of ANPR systems for traffic management, parking management, law enforcement etc.


Introduction
The number plates of moving objects are automatically collected and read using a computer vision approach called an Automatic Number Plate Recognition (ANPR) system.The system is designed to precisely recognize and process the registration numbers of vehicles traveling through a particular location.A helmet detection system use computer vision to detect and identify whether people are wearing helmets.It is commonly used in applications involving safety enforcement, such as monitoring traffic on the highways, working on construction sites, or watching sporting events.ANPR systems are valuable tools for increasing productivity, increasing security, and optimizing a variety of activities related to vehicle identification and management because to their adaptability and precision.The Helmet Detection System analyses photos or video frames to determine whether people are wearing helmets.It does this by using image processing and machine learning techniques.
YOLOv5 is a sophisticated object detection technique that has achieved widespread acceptance in the computer vision community.YOLOv5, which will be released in May 2020 by Ultralytics, builds on the success of previous versions in the YOLO series, which revolutionized real-time object identification.The framework of YOLOv5 is built upon deep learning principles and relies on convolutional neural networks (CNNs) to learn and predict object bounding boxes and class probabilities.It leverages advancements in network architecture, multi-scale predictions, and feature pyramid networks to enhance accuracy and detection capabilities.
Pytesseract is a potent optical character recognition (OCR) tool that uses the Tesseract OCR engine to extract and recognize text from photos.Developers can incorporate OCR capabilities into their Python apps and extract text from different kinds of photos using Pytesseract.The Pytesseract tool makes it simple to extract text from scanned documents, photos with embedded text, or screenshots.Object detection methodologies are as follows: • Object Detection: This module can be used to detect the presence of a person and a vehicle in the image or video frame.Alert Generation a database of phone numbers connected with vehicle owners is used to enhance the system's functionality.The extracted text from the number plate, which is treated as a license plate number, is used to search the database and retrieve the vehicle owner's phone number.Finally, the PyWhatKit library is used to deliver WhatsApp alerts to the riders.Using the vehicle owner's phone number, the system may programmatically compose and send an alert message to the rider's WhatsApp number.The message can inform the rider about the violation of not wearing a helmet, emphasizing the importance of safety and compliance with regulations.

Existing methods
Automatic Number Plate Detection for Motorcyclists Riding Without Helmet" involves the implementation of computer vision and machine learning techniques to capture real-time images or video frames of motorcyclists on roads, detecting their presence, assessing whether they are wearing helmets, and extracting license plate information.This technology combines object detection, helmet detection, and optical character recognition (OCR) to identify helmetless motorcyclists and record their license plate data for potential enforcement or alert generation, contributing to road safety and compliance with helmet usage regulations.
Authors [13] highlighted the significance of ML in prediction, pattern recognition and error reduction across diverse fields, emphasizing the impact of AI in broad domain.Author [14] presented text classification algorithms for various applications and explores the use of machine learning in detecting phishing attacks.Image restoration is to enhance images by removing noise and restoring them to their original quality.The present approach explored various methods in both frequency and spatial domains, followed by analysing their performance using simulations [15].Authors [16] discussed the use of machine learning and neural networks, especially CNN, for recognizing handwriting patterns, with a focus on Telugu film industry names, achieving high accuracy (98.3%).Authors [17] emphasized the significance of feature selection in classification for accuracy and efficiency.It investigates combining features from different methods, demonstrating improved precision, contingent on dataset, algorithm, and metrics used.Author [18] explored the application of Transfer Learning (TL) in automated medical image analysis, highlighting its effectiveness in various tasks.TL models like AlexNet, ResNet, VGGNet, and GoogleNet prove valuable for enhancing medical image analysis.

Problem statement
Need of an effective system that can accurately detect and recognize both the license plate and the helmet of motorcyclists in real-time using computer vision and deep learning techniques.The system ought to be able to process video frames taken from cameras positioned in various places, like parking lots, junctions, or checkpoints, and offer trustworthy data on licence plates and helmet use Traditional manual procedures for verifying the use of helmets and licence plates are time-consuming, prone to error, and susceptible to bias.These restrictions can be solved by an automated system, which will deliver reliable findings.

Objectives
• To effectively detect the presence of helmets and recognize the number plate of motorcyclists using deep learning and computer vision approaches.A computer vision technique known as an Automatic Number Plate Recognition (ANPR) system automatically collects and reads the number plates of moving objects.The system, which commonly makes use of a camera and specialised software, is created to precisely recognise and process the registration numbers of vehicles travelling through a specific region.The optical character recognition (OCR) technology used by the ANPR system transforms the image of the licence plate into a machine-readable format.Overall, promoting safety, enforcing laws, streamlining traffic management, and assisting law enforcement activities are the main goals of ANPR systems and helmet detection systems.Both systems use computer vision and image processing methods to accomplish their goals and improve security and safety on the road.

Architecture of the proposed method
The Picture below shows the architecture of automatic number plate detection for motorcyclists riding without helmet.Once the helmet detection is performed, the focus shifts to extracting text from number plates using the pytesseract OCR library.OCR algorithms are employed to analyse images and recognize characters, allowing the system to extract the alphanumeric information present on the number plate.By applying pytesseract OCR to the region containing the detected number plate, the system can extract the text from the number plate.To further enhance the functionality of the system, a database of phone numbers associated with vehicle owners is utilized.• Region of Interest (ROI) Extraction: Once the person and the vehicle are detected, this module can be used to extract the regions of interest (ROI) containing the head and number plate regions.• Pre-processing: This module can be used to pre-process the extracted ROIs by resizing the images, converting them to grayscale, and applying various filters such as Gaussian blur, morphological operations, etc. • Optical Character Recognition (OCR): Once the number plate is localized, this module can be used to recognize the characters on the number plate.Tesseract OCR can be used to achieve this.• Number Plate Verification: In this module, the recognized number plate is verified against a database of registered number plates to find the corresponding mobile numbers.• Alert Generation: If the helmet is not detected, or if it is found to be improperly worn, or if the number plate is not recognized, an alert can be generated to notify the concerned motorcyclists.The Common Objects in Context (COCO) dataset is a popular dataset in computer vision and machine learning, particularly for object detection and segmentation.It is used to evaluate the performance of various methods and models.The dataset is made up of many photos, each tagged with extensive information about the objects in the scene.The COCO dataset is useful for creating and fine-tuning object detection models in the context of YOLOv5.Each object category is assigned a unique class ID from 1 to 80.As the model learns to associate specific visual patterns with corresponding object categories.Annotations play a crucial role in the COCO dataset.Each image is annotated with bounding boxes and segmentation masks for the objects present.

Bounding boxes around ROIs
The figure 4 depicts the detection of regions of interests i.e., riders, helmet, and number plate.The region of interests is enclosed in bounding boxes with their respective confidence score.

Location of ROIs
The figure 5 depicts the location of regions of interests i.e., riders, helmet, and number plate along the location in terms of x and y coordinates.

Image pre-processing of number plate-image resizing
The figure 6 depicts the use of the cv2.resize function to scale down the image file by a factor of 2 in both the horizontal and vertical dimensions.

Image pre-processing of number plate-converting to gray-scale
The figure 7 depicts the enhancement of image.To enhance detection and facilitate the recognition of license plates, we convert the resized image file to grayscale.This conversion simplifies the image by significantly reducing the number of colors present, thereby optimizing the detection process.

Image pre-processing of number plate-Denoising the image
The figure 8 depicts denoising of image using gaussian blur.Gaussian Blur is an image denoising technique that improves the clarity and smoothness of edges, resulting in enhanced readability of characters.

Alert generation
The figure 9 depicts the alert generation using Pywhatkit.It is a Python library that provides a simple and convenient way to send WhatsApp alerts or messages programmatically.

Significance of the proposed work
Helmet and number plate detection using YOLOv5 and computer vision techniques hold significant importance in various domains, including road safety, law enforcement, and traffic management.These technologies provide efficient and automated solutions for monitoring and ensuring compliance with safety regulations.Here are the key significance of helmet and number plate detection using YOLOv5 and computer techniques.• Potential for Integration with Smart City Initiatives: Helmet and number plate detection systems can be integrated with smart city initiatives to create more efficient and connected urban environments.For example, the data collected from these systems can be for traffic flow optimization, congestion management, or accident analysis.

Conclusion and future enhancements
In conclusion, the integration of helmet and number plate detection using YOLOv5, number plate extraction using Tesseract OCR, and sending alerts to riders without helmets using the PyWhatKit library provides a robust and effective solution for promoting road safety and enforcing regulations.The advanced capabilities of YOLOv5 enable accurate and real-time detection of helmets on motorcyclists and bicyclists.Through automated messages sent to their mobile numbers, riders are promptly reminded to wear their helmets, promoting compliance with safety regulations.The combined system significantly reduces the reliance on manual inspections, enhancing operational efficiency and accuracy.Future Enhancements: There are potential future advances geared specifically at addressing the problem of triple riding to improve the current capabilities of identifying helmets and number plates.Algorithms and models will be developed to recognize cases in which three people ride on a two-wheeler designed for just two users.This entails examining the spatial relationships of sensed objects and recognizing uncommon arrangements that suggest triple riding.

Figure 1
Figure 1 represents the architecture diagram and the working of model is given below.The input frames in ANPR (Automatic Number Plate Recognition) are the specific video frames that provide scenes or views of automobiles with clearly visible number plates.Once the helmet detection is performed, the focus shifts to extracting text from number plates using the pytesseract OCR library.OCR algorithms are employed to analyse images and recognize characters, allowing the system to extract the alphanumeric information present on the number plate.By applying pytesseract OCR to the region containing the detected number plate, the system can extract the text from the number plate.To further enhance the functionality of the system, a database of phone numbers associated with vehicle owners is utilized.

Figure 2 Fig. 2 .
Figure 2 depicts all the stages in a sequential flow.• Input module: This user module consists of the input video; the system analyses this video in the form of frames which are specific still photos or video frames that provide scenes or views of automobiles with clearly visible number plates.• Object Detection: This module can detect the presence of people and vehicles in an image or video frame.It is a popular approach in computer vision for object detection because of its efficiency and precision.

Figure 3
Figure 3 depicts the user interface created using Tkinter to upload the video.

•
Road Safety Enhancement: Helmet detection plays a vital role in promoting road safety.By employing YOLOv5 and computer vision algorithms, it becomes possible to automatically detect and identify whether motorcyclists and bicyclists are wearing helmets.• Real-time Monitoring and Alerts: With YOLOv5 and computer vision techniques, helmet and number plate detection can be performed in real-time.This enables instant monitoring and alerts for non-compliance, allowing immediate action to be taken when violations occur.Real-time detection ensures proactive intervention, enabling authorities to promptly address safety concerns and potential traffic offenses.• Enhanced Safety Measures: The foremost advantage is the improved safety measures it provides.Helmet detection using YOLOv5 ensures that motorcyclists and bicyclists comply with safety regulations by wearing helmets.• Automation and Reduction of Human Error: By automating the detection process, the reliance on human judgment and manual inspections is reduced.This minimizes the , 010 (2023) E3S Web of Conferences ICMPC 2023 https://doi.org/10.1051/e3sconf/20234300103838 430 chances of human error or bias in identifying violations.The use of YOLOv5 and computer techniques ensures consistent and objective detection, enhancing the overall accuracy and reliability of the system.

•
Region of Interest (ROI) & Extraction:Once the person and the vehicle are detected, this module can be used to extract the regions of interest (ROI) containing the head and number plate regions.•Pre-processing: The number plate these pre-processing processes enhance photographs by improving their quality, legibility, and consistency, making them more suitable for use with future recognition algorithms.
• Optical Character Recognition (OCR): Once the number plate is localized, this module can be used to recognize the characters on the number plate.Optical character recognition is known as OCR.A computer can recognize and extract text from photographs or scanned documents using this technique.

•
To identify the rider without helmet and automate an alert to the registered mobile number.•To promote helmet use and to serve as a reminder to all riders about the importance of wearing a helmet.