Mayank
Mayank
Project report
Submitted to D Y Patil International University, Akurdi, Pune
in partial fulfilment of full-time degree.
Submitted By:
Mayank Tripathi 20190802069
This is to certify that the project entitled ANPR using YOLO-NAS and EasyOCR submitted
by:
is the partial fulfillment of the requirements for the award of degree of Bachelor of
Technology in Computer Science and Engineering is an authentic work carried out by them
under my supervision and guidance.
Director
Dr. Bahubali Shiragapur
School of Computer Science Engineering &
Application D Y Patil International University, Akurdi
Pune, 411044, Maharashtra, INDIA
DECLARATION
We, hereby declare that the following report which is being presented in the Major Project
entitled as ANPR using YOLO-NAS and EasyOCR is an authentic documentation of our
own original work to the best of our knowledge. The following project and its report in part or
whole, has not been presented or submitted by us for any purpose in any other institute or
organization. Any contribution made to the research by others, with whom we have worked at
D Y Patil International University, Akurdi, Pune or elsewhere, is explicitly acknowledged in
the report.
i
ACKNOWLEDGEMENT
With due respect, we express our deep sense of gratitude to our respected guide and
coordinator Prof. Swet Chandan, for her valuable help and guidance. We are thankful for the
encouragement that she has given us in completing this project successfully.
It is imperative for us to mention the fact that the report of major project could not have been
accomplished without the periodic suggestions and advice of our project supervisor mentor
Prof. Swet Chandan.
We are also grateful to our respected Director, Dr. Bahubali Shiragapur and Hon’ble Vice
Chancellor, DYPIU, Akurdi, Prof. Prabhat Ranjan for permitting us to utilize all the necessary
facilities of the college.
We are also thankful to all the other faculty, staff members and laboratory attendants of our
department for their kind cooperation and help. Last but certainly not the least; we would like
to express our deep appreciation towards our family members and batch mates for providing
support and encouragement.
ii
Abstract
iii
TABLE OF CONTENTS
Declaration i
ACKNOWLEDGEMENT ii
ABSTRACT iii
LIST OF FIGURES v
LIST OF TABLES vi
1 INTRODUCTION 1
1.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Problem statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 LITERATURE REVIEW 4
2.1 Literature review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Drawbacks of existing system . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3 Gaps Identified . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 PROPOSED METHODOLOGY 11
3.1 Proposed Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Tools Used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 Advantage & Disadvantage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
6 CONCLUSION 29
7 References 30
iv
List of Figures
3.1 Block Diagram.................................................................................................................11
3.2 Data Split..........................................................................................................................12
3.3 YOLO-NAS Architecture................................................................................................13
4.1 Flow Diagram..................................................................................................................19
4.2 DFD Level 0.....................................................................................................................20
4.3 DFD Level 1.....................................................................................................................20
4.4 DFD Level 2.....................................................................................................................21
4.5 YOLO-NAS-L Architecture............................................................................................22
5.1 Training Results...............................................................................................................24
5.2 YOLO Generation Comparison.......................................................................................25
5.3 YOLO Vs Other Models..................................................................................................26
5.4 Test Image........................................................................................................................27
5.5 Video SS..........................................................................................................................28
5.6 Webcam...........................................................................................................................28
v
List of Tables
vi
1. INTRODUCTION
Automatic number plate recognition (ANPR) is a technology that uses optical character
recognition (OCR) to extract vehicle registration plates from digital images or videos. ANPR
systems are used by law enforcement agencies, toll collection agencies, and parking
enforcement agencies to track vehicles and identify violators.
ANPR systems typically work by first detecting the presence of a vehicle registration plate in
an image or video. Once a plate has been detected, the system then attempts to extract the
characters from the plate. The extracted characters are then passed to an OCR engine, which
attempts to convert them into text.
The accuracy of ANPR systems depends on a number of factors, including the quality of the
image or video, the type of plate, and the lighting conditions. ANPR systems are typically
more accurate when the image or video is of high quality and the plate is well-lit.
In recent years, there has been a growing interest in using deep learning techniques for ANPR.
Deep learning techniques have been shown to be effective for a variety of tasks, including image
classification, object detection, and natural language processing.
In this project, we will use YOLO-NAS and EasyOCR to build an ANPR system. YOLO-
NAS is a deep learning framework for object detection, and EasyOCR is an OCR engine that
uses deep learning techniques.
YOLO-NAS YOLO-NAS is a deep learning framework for object detection that was
developed by the researchers at the National University of Singapore. YOLO-NAS is a neural
architecture search (NAS) algorithm that was used to search for the best architecture for the
YOLO object detection model.
YOLO-NAS is a very efficient NAS algorithm that can search for the best architecture for a
given task in a short amount of time. YOLO-NAS has been shown to be effective for a variety
of object detection tasks, including ANPR.
EasyOCR EasyOCR is an OCR engine that uses deep learning techniques. EasyOCR is a free
and open-source OCR engine that is available for Windows, macOS, and Linux.
EasyOCR is a very accurate OCR engine that has been shown to be effective for a variety of
languages, including English, French, German, and Spanish. EasyOCR is also very fast, and it
can process images and videos at high speeds.
1
1.1. Objectives
1. Accurate ANPR system: Collect a dataset of images and videos of vehicles with their
registration plates visible. Train a YOLO-NAS model on the dataset. Evaluate the
performance of the YOLO-NAS model on a held-out test set. Fine-tune the YOLO-
NAS model to improve its performance.Deploy the YOLO-NAS model to a real-world
system.
2. Improve Accuracy: To improve the accuracy of the ANPR system by using a variety
of techniques, including data augmentation, model fine-tuning, and ensemble learning.
2
1.2. Problem statement
Traditional ANPR systems are often inaccurate and computationally expensive, making them
unsuitable for real-world applications that require high accuracy and real-time performance.
Moreover, many existing ANPR systems require a large amount of data to train, and they may
not be able to handle variations in lighting, orientation, and occlusion. To address these
challenges, this project aims to develop an efficient and accurate ANPR system using YOLO-
NAS with EasyOCR. Specifically, the project seeks to fine-tune a pre-trained YOLO-NAS-L
model on a custom dataset of license plate images. By leveraging a lightweight neural
network architecture proposed ANPR system can achieve high accuracy and real-time
performance while being deployable. The problem addressed by this project is the need for an
efficient and accurate ANPR system that can handle real-world challenges and can be
deployed on platforms. The proposed solution aims to improve the accuracy and efficiency of
ANPR systems, making them suitable for various applications, such as traffic management,
security systems, and parking management.
3
2. LITERATURE REVIEW
[1]A Review of Yolo algorithm developments — Procedia Computer Science 199 (2022):
1066-1073. YOLO (You Only Look Once) is a real-time object detection algorithm developed
by Joseph Redmon and his colleagues at the University of Washington. YOLO divides an
input image into a grid of cells and predicts bounding boxes, object classes, and confidence
scores for each cell. YOLO V2 was released in 2016 and includes several improvements over
the original YOLO algorithm, such as batch normalization, high-resolution classification, and
multi-scale training. YOLO V3 was released in 2018 and includes further improvements, such
as the use of residual connections, multi-scale feature maps, and anchor boxes. YOLO V4 was
released in 2020 and includes a number of architectural changes, such as the use of the CSP
Darknet-53 backbone, spatial pyramid pooling, and path aggregation network. YOLO-NAS
(YOLO Neural Architecture Search) is a recent extension of the YOLO algorithm that uses
neural architecture search to automatically find the best network architecture for object
detection. YOLO-NAS has been shown to achieve state-of-the-art results on a number of
object detection benchmarks, such as the COCO dataset. However, YOLO-NAS is still under
development and its performance can vary depending on the specific dataset and application.
Overall, the YOLO algorithm has been a very successful approach to object detection. It is
fast, accurate, and easy to train. YOLO-NAS has the potential to further improve the
performance of YOLO, but it is still under development.
YOLO is a single-stage object detection algorithm, which means that it predicts bounding
boxes, object classes, and confidence scores for all objects in an image in a single pass. This
makes YOLO very fast, but it can also lead to lower accuracy than two-stage object detection
algorithms, such as Faster R-CNN. YOLO V2 improves the accuracy of YOLO by using
batch normalization, high-resolution classification, and multi-scale training. Batch
normalization helps to stabilize the training process and improve the generalization
performance of the model. High-resolution classification allows YOLO to better detect small
objects. Multi-scale training allows YOLO to better detect objects of different sizes. YOLO
V3 further improves the accuracy of YOLO by using residual connections, multi-scale feature
maps, and anchor boxes. Residual connections help to improve the accuracy of the model by
allowing it to learn long-range dependencies. Multi-scale feature maps allow YOLO to better
detect objects of different sizes. Anchor boxes are pre-defined bounding boxes that are used to
predict the location and size of objects. YOLO V4 introduces a number of architectural
changes, such as the use of the CSP Darknet-53 backbone, spatial pyramid pooling, and
path aggregation
4
network. The CSP Darknet-53 backbone is a more efficient and powerful backbone than the
Darknet-19 backbone used in YOLO V3. Spatial pyramid pooling allows YOLO to better
detect objects of different sizes and aspect ratios. Path aggregation network allows YOLO to
better fuse information from different layers of the network. YOLO-NAS uses neural
architecture search to automatically find the best network architecture for object detection.
Neural architecture search is a technique that uses machine learning to search for the best
network architecture for a given task. YOLO-NAS has been shown to achieve state-of-the-art
results on a number of object detection benchmarks.
ANPR systems typically consist of three main components: an image acquisition device, an
image processing unit, and a database. The image acquisition device captures images or
videos of vehicles. The image processing unit extracts VRPs from the images or videos. The
database stores the extracted VRPs and their associated information, such as the vehicle’s
make, model, and license plate number.
There are two main types of ANPR systems: character-based and template-based. Character-
based ANPR systems extract VRPs by recognizing the individual characters in the plate.
Template-based ANPR systems extract VRPs by matching the entire plate to a stored
template.
Character-based ANPR systems are more accurate than template-based systems, but they are
also more computationally expensive. Template-based ANPR systems are less accurate than
character-based systems, but they are also less computationally expensive.
The accuracy of ANPR systems is affected by a number of factors, including the quality of the
image or video, the lighting conditions, and the type of vehicle. ANPR systems are typically
more accurate in good lighting conditions and with high-quality images or videos.
ANPR systems have a number of advantages over manual methods of VRP recognition, such
as speed, accuracy, and scalability. ANPR systems can process large volumes of images or
videos much faster than manual methods. ANPR systems are also more accurate than manual
methods, especially in poor lighting conditions. ANPR systems can be scaled to handle large
numbers of vehicles.
5
Traffic enforcement: ANPR systems can be used to automatically detect and track vehicles
that are violating traffic laws, such as speeding, running red lights, and driving without a
license. Law enforcement: ANPR systems can be used to track vehicles that are involved in
criminal activity, such as theft, drug trafficking, and terrorism. Parking management: ANPR
systems can be used to automatically track vehicles that are parked in restricted areas, such as
loading zones and handicapped parking spaces. ANPR systems are a valuable tool for a
variety of applications. They are accurate, fast, and scalable. ANPR systems are becoming
increasingly popular as the technology continues to improve.
In addition to the above, here are some other challenges and limitations of ANPR systems:
Weather conditions: ANPR systems can be affected by weather conditions, such as rain,
snow, and fog. Obstructions: ANPR systems can be affected by obstructions, such as trees,
buildings, and other vehicles. Variations in plate design: There are many different variations
in plate design, which can make it difficult for ANPR systems to recognize plates. Cost:
ANPR systems can be expensive to purchase and install. Despite these challenges, ANPR
systems are a valuable tool for a variety of applications. As the technology continues to
improve, ANPR systems are likely to become more widely used.
[3] Intelligent Image Text Reader using Easy OCR — 2022 International Conference on
Power, Energy, Control and Transmission Systems (ICPECTS). IEEE, 2022 EasyOCR is
a Python module for extracting text from images. It is a general OCR that can read both
natural scene text and dense text in documents. EasyOCR is currently supporting 80+
languages and expanding.
EasyOCR is based on the Tesseract OCR engine, but it has a number of features that make it
easier to use. For example, EasyOCR provides a simple API that allows you to extract text
from images with just a few lines of code. EasyOCR also includes a number of features that
improve the accuracy of text extraction, such as text normalization and character
segmentation.
EasyOCR is a powerful tool that can be used for a variety of applications, such as:
Document analysis, License plate recognition, Product barcode scanning, Optical character
recognition (OCR), EasyOCR is easy to use and it is available for free. If you are looking for
a powerful and easy-to-use OCR tool, then EasyOCR is a great option.
Some of the benefits of using EasyOCR: Easy to use: EasyOCR has a simple API that makes
it easy to extract text from images. Improved accuracy: EasyOCR includes a number of
features that improve the accuracy of text extraction, such as text normalization and character
segmentation. Powerful: EasyOCR is a powerful tool that can be used for a variety of
applications, such as document analysis, license plate recognition, and product barcode
6
scanning. Free: EasyOCR is available for free.
[4]CNN variants for computer vision: history, architecture, application, challenges and
future scope — Electronics. 2021 Oct 11;10(20):2470 Convolutional neural networks
(CNNs) have become the state-of-the-art for a wide variety of computer vision tasks,
including image classification, object detection, and segmentation. CNNs are able to learn
hierarchical representations of data from images, which makes them well-suited for these
tasks.
There are many different variants of CNNs, each with its own strengths and weaknesses. In
this paper, we will discuss the history, architecture, application, challenges, and future scope
of CNN variants.
History of CNNs
The first CNNs were developed in the 1960s by researchers at Bell Labs. These early CNNs
were used for image classification tasks. However, they were not very successful because they
were computationally expensive and difficult to train.
In the 1980s, CNNs experienced a resurgence of interest due to the development of new
algorithms for training them. These new algorithms made it possible to train CNNs on large
datasets of images, which led to significant improvements in their performance.
In the 1990s, CNNs were used for a variety of computer vision tasks, including object
detection and segmentation. However, they were still not as widely used as other machine
learning algorithms, such as support vector machines (SVMs).
In the 2000s, CNNs began to gain popularity due to the development of deep learning. Deep
learning is a type of machine learning that uses artificial neural networks with multiple layers.
Deep learning has led to significant improvements in the performance of CNNs, which has
made them the state-of-the-art for a wide variety of computer vision tasks.
Architecture of CNNs
CNNs are composed of a number of layers, each of which performs a different task. The first
layer is the convolutional layer, which performs convolution operations on the input data. The
convolutional layer is followed by a pooling layer, which reduces the size of the feature maps.
This process is repeated several times, until the desired level of abstraction is reached. The
final layer is the fully connected layer, which classifies the input data.
Application of CNNs
CNNs have been successfully applied to a wide variety of computer vision tasks, including:
7
Image classification: CNNs can be used to classify images into different categories, such as
cats, dogs, and cars. Object detection: CNNs can be used to detect objects in images, such as
faces, cars, and traffic lights. Segmentation: CNNs can be used to segment images into
different regions, such as foreground and background. Challenges of CNNs
Data scarcity: CNNs require large datasets of labeled data to train. This can be a challenge for
some tasks, such as medical image analysis, where labeled data is scarce. Overfitting: CNNs
can easily overfit to the training data, which can lead to poor performance on new data. This
can be addressed by using regularization techniques, such as dropout and L2 regularization.
Computational complexity: CNNs are computationally expensive to train and deploy. This
can be a challenge for some applications, such as real-time object detection. Future scope of
CNNs
CNNs are still a relatively new technology, and there is a lot of room for improvement. In the
future, we can expect to see CNNs that are:
More efficient: CNNs will become more efficient, which will make them easier to train and
deploy. More robust: CNNs will become more robust to noise and other distortions, which
will improve their performance on real-world data. More versatile: CNNs will be able to
perform a wider variety of tasks, such as natural language processing and speech recognition.
Overall, CNNs are a powerful tool for computer vision tasks. They have already achieved
state-of-the- art results on a wide variety of tasks, and they are still under development. In the
future, we can expect to see CNNs being used in even more applications.
8
2.2. Drawbacks of existing system
While voice assistants utilizing Natural Language Processing (NLP) have gained popularity
and offer numerous benefits, they also have some drawbacks. Here are a few drawbacks of
voice assistants using NLP:
1. Weather conditions: ANPR systems can be affected by weather conditions, such as rain,
snow, and fog. This is because the systems rely on being able to see the license plate clearly
in order to read it. In bad weather conditions, the license plate may be obscured or the image
may be too blurry for the system to read.
2. Obstructions: ANPR systems can also be affected by obstructions, such as trees, buildings,
and other vehicles. This is because the systems need to be able to see the entire license plate
in order to read it. If the license plate is obstructed by an object, the system may not be able to
read it.
3. Variations in plate design: There are many different variations in license plate design around
the world. This can make it difficult for ANPR systems to read plates from other countries.
For example, some countries have plates with different font sizes, colors, and layouts. This
can make it difficult for the system to recognize the characters on the plate.
4. Cost: ANPR systems can be expensive to purchase and install. This can be a barrier for
some organizations that are considering using ANPR technology.
5. Maintenance: ANPR systems require regular maintenance to ensure that they are
functioning properly. This can add to the cost of ownership for ANPR systems.
6. Privacy concerns: Some people have privacy concerns about the use of ANPR systems. They
worry that the data collected by ANPR systems could be used to track their movements or to
identify them without their consent.
7. Security concerns: There are also security concerns about the use of ANPR systems.
Some people worry that the data collected by ANPR systems could be hacked or stolen. This
could allow criminals to track people’s movements or to identify them without their consent.
8. Interoperability: ANPR systems from different manufacturers may not be compatible with
each other. This can make it difficult to share data between different organizations that are
using ANPR technology.
9. Data accuracy: ANPR systems are not always 100 percent accurate. This is because the
systems are relying on software to recognize characters on a license plate. Software can make
mistakes, and this can lead to errors in the data that is collected by ANPR systems.
9
10. Training requirements: ANPR systems require training to be effective. This training can
be expensive and time-consuming.
These are just some of the drawbacks of existing ANPR systems. As the technology continues
to develop, some of these drawbacks may be addressed. However, it is important to be aware
of these drawbacks before considering using ANPR technology.
It’s important to note that these drawbacks are not universal, and ANPR technology continues
to improve over time with advancements in deep learning and machine learning techniques.
1: The accuracy of the license plate detection and recognition could be improved. YOLO-
NAS is a powerful object detection model, but it is not perfect. There may be cases where it
fails to detect the license plate or misidentifies the characters. EasyOCR is a good OCR
engine, but it can also make mistakes. We may need to fine-tune the model parameters or use a
different OCR engine to improve the accuracy.
2: The project could be made more robust to different lighting conditions and occlusions.
License plates can be difficult to read in low-light conditions or when they are partially
obscured by other objects. You may need to train the model on a dataset of images that
includes a variety of lighting conditions and occlusions to improve its robustness.
3: The project could be made more efficient. The YOLO-NAS model is a large and complex
model, which can make it slow to run. We may be able to improve the efficiency of the
project by using a smaller model or by using a different optimization technique.
1
3. PROPOSED METHODOLOGY
The main procedure involved in this research is the training and testing process, as illustrated
in Figure 3.1. We performed training using 900 images of vehicle license plates . We proceeded by
annotating the images, creating bounding boxes. The total number of characters for OCR was
801, belonging to 36 different class labels. These labels consist of letters (A-Z) and numbers
(0-9).
On the other hand, the testing phase will employ 25 sets of vehicle license plate data. These
datasets contain both clean data without any noise and data with two types of noise. The noise
introduced in the dataset includes variations in color intensity, both added and reduced, to
simulate changes in lighting conditions commonly encountered in the field, such as brightness
fluctuations. In the subsequent sections, we will provide detailed descriptions of the processes
to be conducted at each stage.
1
1. Data Design: Collecting a dataset of 900 images containing vehicle license plates. The
images should have a variety of backgrounds, lighting conditions, and license plate
styles to ensure a diverse training set. Ensuring that the dataset represents a balanced
distribution of license plate types, such as different regions, countries, or styles. Spliting
the dataset into training and testing sets for evaluation (Fig 3.2).
2. Data Preprocessing: Resizing all the images to a consistent size suitable for training
and testing. This step ensures that the input images have a uniform shape, which is
essential for training the model. Normalizing the pixel values of the images to a
common scale, typically between 0 and 1. This normalization step improves convergence
during training.
3. Data Annotation: Annotate the license plate regions in each image by drawing
bounding boxes around them. Label each bounding box with the corresponding license
plate characters using EasyOCR or a similar optical character recognition (OCR) tool.
Assign class labels to each character, including both letters (A-Z) and numbers (0-9)
4. YOLO-NAS: Implement the YOLO-NAS (You Only Look Once - Neural Architecture
Search) algorithm, which is an automated process to discover the optimal network
architecture for object detection tasks. Use the YOLO-NAS approach to automatically
search for the most suitable neural network architecture for license plate detection in
your dataset. The YOLO-NAS algorithm optimizes the architecture by exploring
different combinations of convolutional layers, feature extractors, and other components
to improve detection accuracy.
1
5. Network Architecture: The YOLO-NAS network architecture is composed of three
main parts: the backbone, the neck, and the head (Fig 3.3). The backbone is responsible
for extracting features from the input image. The neck is responsible for fusing the
features from the backbone and the head is responsible for classifying the features and
predicting the coordinates of the license plate.
6. Detection on Three Scales: YOLO-NAS can detect license plates on three different
scales. The first scale is used to detect large license plates, the second scale is used to
detect medium license plates, and the third scale is used to detect small license plates.
This allows YOLO-NAS to detect license plates of all sizes.
7. Anchor Box based on YOLO-NAS: YOLO-NAS uses anchor boxes to detect license
plates. Anchor boxes are predefined boxes that are used to predict the coordinates of the
license plate. YOLO-NAS uses a variety of anchor boxes to detect license plates of all
1
sizes.
9. Number Plate Recognition: Once the license plate has been detected, it can be
recognized using a character recognition algorithm. The character recognition algorithm
uses a neural network to classify the characters on the license plate.
1
3.2. Tools Used
Software Tools
Hardware Tools
• Laptop Webcam
• 512 Mb Sandisk SSD
• Intel i5 9th Gen
• Microsoft Windows 10
1
3.3. Advantage & Disadvantage
ANPR systems have become increasingly popular in recent years and offer a range of
advantages and disadvantages.
Advantages:
1. High accuracy: The YOLO-NAS model is known for its high accuracy in detecting
and recognizing license plates. In your project, you used 900 images to train the model,
which helped to improve its accuracy.
2. Real-time detection: The YOLO-NAS model can detect and recognize license plates
in real time. This makes it ideal for applications such as traffic monitoring and law
enforcement.
3. Scalable: The YOLO-NAS model is scalable, which means that it can be used to
process large amounts of data. This makes it ideal for applications that require the
processing of high-volume data, such as traffic cameras.
4. Cost-effective: The YOLO-NAS model is a cost-effective solution for ANPR. This
is because it can be trained on a relatively small dataset of images, and it does not
require specialized hardware.
5. Easy to use: The YOLO-NAS model is easy to use. This is because it is a pre-trained
model that can be easily integrated into existing applications.
1
Disadvantages:
1. Weather conditions: The YOLO-NAS model can be affected by weather conditions
such as rain, snow, and fog. This can reduce the accuracy of the model.
2. Obstructions: The YOLO-NAS model can be affected by obstructions such as trees,
buildings, and other vehicles. This can also reduce the accuracy of the model.
3. Difficult to read plates: The YOLO-NAS model can have difficulty reading license
plates that are damaged, dirty, or obscured. This can also reduce the accuracy of the
model.
4. Privacy concerns: Some people may have privacy concerns about the use of ANPR
systems. This is because ANPR systems can be used to track people’s movements.
Overall, while ANPR systems can provide numerous benefits, users should be aware of
the potential drawbacks and take steps to protect their privacy and maintain a healthy
relationship with technology.
1
4. ANALYSIS AND DESIGN
We used Roboflow’s api to import our dataset in Google Colab for training the model.
The trained weights and deployed on PyCharm for the final ouptut. The algorithm is as
follows:
4.1. Algorithm
(a) Load the YOLO-NAS model: The YOLO-NAS model is a deep learning model
that is trained to detect objects in images or videos. The YOLO-NAS model can
be loaded using a variety of deep learning frameworks, such as TensorFlow or
PyTorch. The model can be downloaded from the YOLO-NAS website.
(b) Preprocess the image: . The image must be preprocessed before it can be input
to the YOLO-NAS model. This typically involves resizing the image to a standard
size, converting the image to a grayscale image, and normalizing the image. The
size and shape of the image can be adjusted to improve the accuracy of the
detection. The image can be converted to a grayscale image to reduce the amount
of data that needs to be processed by the model. The image can be normalized to
improve the performance of the model.
(c) Running the YOLO-NAS model on the image: The YOLO-NAS model will
output a list of bounding boxes, each of which contains a detected object. The
number of bounding boxes that are output will depend on the configuration of the
YOLO-NAS model.
(d) Filtering the bounding boxes:The bounding boxes must be filtered to remove
any that do not contain a license plate. This can be done by checking the size and
shape of the bounding boxes, as well as the confidence level of the detection. The
size of the bounding boxes can be checked to ensure that they are large enough to
contain a license plate. The confidence level of the detection can be checked to
ensure that it is high enough to be confident that the object in the bounding box is
a license plate.
(e) Recognizing the license plates using EasyOCR: The license plates in the filtered
bounding boxes can be recognized using the EasyOCR library. The EasyOCR
library uses a deep learning model to recognize text in images. The library can be
installed using pip.
(f) Outputting the license plate numbers: The license plate numbers can be output
as a list of strings. The license plate numbers can be saved to a file or displayed on
a screen.
1
4.2. Flow diagram
The execution code will start, as illustrated in Fig 4.1 , and it will use the vehicle’s
image data as an input. The data is predicted using trained weights. The detected ROI is
sent to EasyOCR for reading the number plate. The OCR text is printed on the output
along with the detected bounding box.
1
4.3. Data flow diagram
A data flow diagram (DFD) is a graphical representation of how data flows through a
system, modeling its inputs, outputs, and processes. It is a type of structured analysis
and design tool that is used to describe and analyze the flow of data within an
organization or system. A DFD consists of a set of interconnected data flow diagrams
that show the flow of data through different processes within the system. Each process
in the diagram represents a specific activity or operation that transforms the input data
into output data. The input and output data are represented as data flows, and they are
connected to the processes using arrows.
DFD LEVEL 0
DFD LEVEL 1
2
DFD LEVEL 2
2
4.4. Model Architecture
2
5. RESULTS AND DISCUSSIONS
The summary of epoch 30 shows that the model is still improving, but the rate of
improvement is slowing down. The training loss is slightly lower than the previous
epoch. The precision score is slightly higher than the previous epoch, and the recall
score is still 1.0.
Overall, the model is still improving, but the rate of improvement is slowing down.
1. Ppyoloeloss/loss: This is a general loss metric, representing the overall loss value
during training.
2. Ppyoloeloss/loss cls: This metric specifically measures the loss contribution from
classification during training. It indicates how well the model is performing in
classifying objects.
3. Ppyoloeloss/loss dfl: This metric represents the loss contribution from distance
feature learning (DFL) during training. DFL is a technique used to improve the
localization accuracy of object detection models.
4. Ppyoloeloss/loss iou: This metric measures the loss contribution from the
intersection over union (IoU) calculation during training. IoU is used to evaluate the
overlap between predicted and ground truth bounding boxes.
5. [email protected]: F1 score is a measure of the model’s accuracy, combining precision and
recall. It is calculated at a specific IoU threshold of 0.50.
6. [email protected]: Mean Average Precision (mAP) is a commonly used evaluation metric
for object detection models. It measures the average precision across different IoU
thresholds, with 0.50 being one of them.
7. [email protected]: Precision represents the ratio of correctly predicted positive
samples to the total predicted positive samples. This metric is calculated at an IoU
threshold of 0.50.
8. [email protected]: Recall represents the ratio of correctly predicted positive samples to
the total actual positive samples. This metric is calculated at an IoU threshold of 0.50.
2
Figure 5.1: Training Results
2
5.2. Model Comparison
2
Figure 5.3: YOLO Vs Other Models
2
5.3. Inference
2
Figure 5.5: Video SS
2
6. CONCLUSION
In this project, we have developed an ANPR system using YOLO-NAS and EasyOCR.
The system is able to detect and recognize license plates in real time. The system was
trained on a dataset of images of license plates, and it was able to achieve a high
accuracy on the test set. The system was also able to run at a fast speed, making it
suitable for real-time applications.
The system has a number of potential applications. It could be used to track vehicles, to
identify vehicles that have been involved in crimes, or to collect data on traffic patterns.
The system could also be used to improve the security of parking garages and other
facilities.
The system is still under development, and there are a number of areas where it could
be improved. For example, the system could be made more robust to variations in
lighting and weather conditions. The system could also be made more accurate at
recognizing license plates from different countries.
Overall, the system is a promising development in the field of ANPR. It is able to detect
and recognize license plates in real time, and it has the potential to be used in a variety
of applications.
Here are some of the challenges that were encountered during the development of the
system:
The difficulty of collecting a large dataset of images of license plates. The difficulty of
training a model that is able to generalize to different types of license plates. The difficulty
of making the system run at a fast speed.
Despite these challenges, the system was able to achieve a high accuracy on the test set
and run at a fast speed. This is a significant achievement, and it demonstrates the
potential of YOLO-NAS and EasyOCR for ANPR applications.
In the future, the system could be improved by:
Collecting a larger dataset of images of license plates from different countries. Using a
more complex model that is able to better generalize to different types of license plates.
Using a more efficient hardware platform that can run the system at an even faster
speed. With further development, the system has the potential to become a powerful
tool for ANPR applications.
2
7. References
[1] : Jiang, P., Ergu, D., Liu, F., Cai, Y., Ma, B. (2022). A Review of Yolo algorithm
developments. Procedia Computer Science, 199, 1066-1073.
[2] : Patel, C., Shah, D., Patel, A. (2013). Automatic number plate recognition system
(anpr): A survey. International Journal of Computer Applications, 69(9).
[3] : Jeeva, C., Porselvi, T., Krithika, B., Shreya, R., Priyaa, G. S., Sivasankari, K.
(2022, December). Intelligent Image Text Reader using Easy OCR, NRCLex NLTK.
In 2022 International Conference on Power, Energy, Control and Transmission Systems
(ICPECTS) (pp. 1-6). IEEE.
[4] : Bhatt, Dulari, Chirag Patel, Hardik Talsania, Jigar Patel, Rasmika Vaghela, Sharnil
Pandya, Kirit Modi, and Hemant Ghayvat. ”CNN variants for computer vision: history,
architecture, application, challenges and future scope.” Electronics 10, no. 20 (2021):
2470.
[5] : Kochale, M. T. S. A., Ashutosh Khemariya, and Mrs Aditi Tiwari. ”Real time
automatic vehicle (license) recognition identification system with the help of opencv
easyocr model.” International Journal of Research, Science, Technology, and
Management 23.3: 11-15.
[6] : Chua, Leon O., and Tamas Roska. ”The CNN paradigm.” IEEE Transactions on
Circuits and Systems I: Fundamental Theory and Applications 40.3 (1993): 147-156.
[7] : Chua, Leon O. ”CNN: A vision of complexity.” International Journal of Bifurcation
and Chaos 7.10 (1997): 2219-2425.
[8] : Zou, Z., Chen, K., Shi, Z., Guo, Y., Ye, J. (2023). Object detection in 20 years: A
survey. Proceedings of the IEEE.
[9] : Padilla, Rafael, Sergio L. Netto, and Eduardo AB Da Silva. ”A survey on
performance metrics for object-detection algorithms.” 2020 international conference on
systems, signals and image processing (IWSSIP). IEEE, 2020.
[9]: Padilla, Rafael, Sergio L. Netto, and Eduardo AB Da Silva. ”A survey on
performance metrics for object-detection algorithms.” 2020 international conference on
systems, signals and image processing (IWSSIP). IEEE, 2020.