0% found this document useful (0 votes)
20 views6 pages

Identify The Parts of Automobile (Object Identification) On Raspberry Pi (LIT2021032)

Uploaded by

sodiumsharmaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views6 pages

Identify The Parts of Automobile (Object Identification) On Raspberry Pi (LIT2021032)

Uploaded by

sodiumsharmaji
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1

Identify the parts of automobile (object


identification) using Raspberry Pi
Om Rajkumar Lokhande*1 and Dr. Deepak Kumar Singh1
1
Department of Information Technology, Indian Institute of Information Techology Lucknow

Abstract—Object identification in automobiles is critical for ap- tasks. The Raspberry Pi is widely known for its affordabil-
plications in autonomous driving and intelligent vehicle systems, ity and has been used in various applications ranging from
ensuring safety and enhancing operational efficiency. Despite the education to industrial automation . Its adaptability makes it
advances in this field, there is a need for affordable and accessible
solutions to deploy object identification models in real-time on an excellent platform for deploying machine learning models
resource-constrained devices. This paper addresses this gap by in real-world scenarios, especially where cost constraints are
utilizing a Raspberry Pi to identify automobile parts, leveraging significant.
its low cost and versatility for edge computing.
In this research, we leverage the capabilities of the Rasp-
The Raspberry Pi (RPi) is a small single-board computer berry Pi to perform object identification tasks in automobiles.
that is widely used in a variety of applications. This proposed
work uses peripheral devices and the Raspberry Pi to identify By utilizing TensorFlow Lite, a lightweight version of Tensor-
products in the automotive industry. The Raspberry Pi is ideal Flow designed for mobile and embedded devices, we optimize
for real-time applications, particularly those involving image machine learning models to run efficiently on the Raspberry
and video processing. Despite its slower performance compared Pi . This process involves training algorithms to recognize
to a personal computer, it provides all necessary features and specific automobile parts and converting these models to a
capabilities while using less power. The Raspberry Pi has
numerous applications, including education, home automation, format that TensorFlow Lite can execute effectively.[1]
gaming, robotics, and computer vision. This paper describes We detail the methodology for setting up the Raspberry
a novel approach to identifying automobile products using the
Raspberry Pi version 4.
Pi, including the software and hardware requirements, and
the process of training and optimizing the machine learning
models. Furthermore, we implement these models on the
Raspberry Pi and conduct a series of experiments to evaluate
I. I NTRODUCTION their performance and accuracy. The experiments focus on the
CCURATE object identification in automobiles is essen- trade-offs between processing speed and precision, providing
A tial for advancing autonomous driving and intelligent
vehicle systems. These systems rely on the ability to detect
insights into the practical feasibility of deploying such systems
in real-time applications.
and classify various automobile components, such as tires, Our findings demonstrate that the Raspberry Pi can effec-
lights, and license plates, which are crucial for navigation, tively perform object identification in automobiles, achieving a
maintenance, and safety. For instance, autonomous vehicles balance between cost and performance. This research provides
must recognize traffic signals and other vehicles’ components a practical, cost-effective solution for deploying real-time
to make informed decisions on the road. Similarly, intelligent object identification models on low-cost hardware, making
maintenance systems can identify wear and tear on parts, advanced automotive systems more accessible and promoting
prompting timely repairs and enhancing vehicle longevity . wider adoption of intelligent vehicle technologies.
Despite the significant advancements in machine learning
and computer vision, deploying real-time object identifica-
II. L ITERATURE R EVIEW
tion models on resource-constrained devices poses consider-
able challenges. High-performance computing resources are Various computer vision systems have been developed to
typically required to run these models efficiently, but such detect regions of interest in vehicle images, particularly within
resources are often expensive and not practical for widespread the domain of Intelligent Transportation Systems (ITS). These
deployment in consumer vehicles . Therefore, finding an systems frequently employ Artificial Intelligence techniques
affordable and accessible solution for this task is of paramount for pattern recognition, contributing significantly to advance-
importance. ments in ITS applications. One notable technique, proposed
The Raspberry Pi emerges as a promising candidate to by Viola and Jones[2], is the Cascade of Boosted Classifiers
address these challenges due to its low cost, versatility, and (CBC). This method has been effectively utilized to detect
sufficient computational power for many edge computing faces, wheels, rear views of cars, and license plates, among
other features[3][4][5]. CBC works by combining a series of
weak classifiers to quickly discard areas without the features of
2

interest, allowing complex classifiers to concentrate on promis- insert the microSD card into the Raspberry Pi and connect
ing regions. The simplicity and speed of feature evaluation in the camera module to its dedicated port. Then, connect the
CBC make it suitable for real-time applications. monitor via HDMI and attach the keyboard and mouse through
USB ports. Finally, power up the Raspberry Pi with the power
In addition to ITS, automatic vision systems have been
supply and complete the initial setup on the Raspbian OS,
implemented to inspect final products on assembly lines.
including enabling the camera interface.
These systems necessitate techniques that can simultaneously
locate multiple reference points and regions of interest.[6][7]
The use of templates is a popular approach in this context.
Templates encompass semantic information about the problem
domain and involve translating a template over the image while
utilizing similarity measures to determine the correct position.
Similarity measures often rely on Euclidean distance, Mean
Square Error, cross-correlation functions, and probabilistic
functions.
In this study, machine learning algorithms are employed
to detect car parts, leveraging Raspberry Pi as the primary
hardware platform. The Raspberry Pi, a small single-board
computer, is ideal for real-time image processing applications
due to its affordability, low power consumption, and sufficient
computational capabilities for running optimized machine
learning models. The methodology includes using a proba-
bilistic function to calculate the likelihood that each detected Fig. 1. Hardware setup image
car part is correctly located, based on pre-defined templates
known as geometrical models. These geometrical models store
semantic information about the expected positions of features B. Software installation
in a car image. If any features are missing, the combination The software installation on the Raspberry Pi involves
of geometrical models and probabilistic techniques enables the several steps to prepare the device for object identification
system to infer their positions. tasks. First, the Raspbian OS is installed on the microSD card
The CBC technique’s efficiency and the practicality of using tools like Balena Etcher. Once the Raspberry Pi boots
using templates in assembly line inspections provide a solid up, Python and essential libraries are installed via the terminal.
foundation for the proposed method. By integrating these OpenCV is set up for image processing, and TensorFlow Lite
established techniques with modern machine learning algo- is installed to run the machine learning models efficiently on
rithms and leveraging the Raspberry Pi’s capabilities, this the RPi. This setup ensures that the Raspberry Pi is equipped
research aims to create a robust and cost-effective solution for with the necessary software to capture, process, and analyze
real-time automobile part detection. This approach not only images of automobile parts.
enhances the accuracy and reliability of part detection but
also ensures that the system can be deployed in diverse and
resource-constrained environments, demonstrating significant
potential for broader applications in smart manufacturing and
maintenance.

III. R ESEARCH M ETHODS

This research focuses on developing and deploying a system


for identifying automobile parts using the Raspberry Pi (RPi).
The methodology is divided into several key stages: hardware
setup, software installation, dataset preparation, model train-
ing and optimization, implementation on Raspberry Pi, and
performance evaluation.
A. Hardware setup
The hardware setup for identifying automobile parts using
the Raspberry Pi involves the following components: Rasp-
berry Pi 4 Model B, a high-resolution camera module, a
microSD card with Raspbian OS, a 5V 3A power supply, an Fig. 2. Steps involved in software installation
HDMI-compatible monitor, and a keyboard and mouse. First,
3

C. Dataset preparation The preprocessing phase involves resizing the captured


image I to match the input requirements of the TensorFlow
Dataset preparation for identifying automobile parts in-
Lite model. If the model requires images of size 224 × 224,
volves several critical steps. Initially, a diverse set of images
the original image I is resized using the equation I ′ =
representing various automobile components like tires, lights,
resize(I, (224, 224)).
and engines is collected from public datasets and custom
captures using the Raspberry Pi camera module. Each image Furthermore, normalization is applied to adjust the pixel
is then labeled with the corresponding part using annotation values to a range of [0, 1], ensuring consistency in input data.
I′
tools such as LabelImg, ensuring precise identification. The normalization process is represented as I ′′ = 255.0 .
To enhance the dataset, data augmentation techniques like Subsequently, the preprocessed image I ′′ is fed into the
rotation, scaling, flipping, and brightness adjustments are TensorFlow Lite model for inference, denoted as ŷ = f (I ′′ ),
applied, increasing the variability and robustness of the train- where f represents the function corresponding to the trained
ing data. Finally, the dataset is split into training (70-80%), model and ŷ is the output indicating the identified automobile
validation (10-15%), and test (10-15%) sets. The training set part.
is used to train the model, the validation set to tune model
parameters, and the test set to evaluate performance. Finally, the output ŷ, which may be a label or bounding
box coordinates, is displayed on the connected monitor using
This structured approach ensures a comprehensive and high- OpenCV functions. For example, if ŷ is a bounding box around
quality dataset, crucial for developing an accurate and efficient a detected tire, the coordinates are drawn on the image using
object identification model for the Raspberry Pi. Ioutput = draw bounding box(I, ŷ).

D. Model training and optimization


Model training involves using a convolutional neural net-
work (CNN) to learn from the labeled dataset. The CNN
architecture typically includes layers like convolutional lay-
ers, pooling layers, and fully connected layers. The training
process involves minimizing the loss function:
N
1 X
L= Loss(yi , ŷi )
N i=1
where yi is the true label, ŷi is the predicted label, and N is
the number of training samples.
Optimization techniques such as Stochastic Gradient De-
scent (SGD) are used to update the model weights:
w = w − η∇L(w)
where η is the learning rate.
Post-training, the model is converted to TensorFlow Lite for-
mat. Quantization techniques, such as reducing the precision
of weights from 32-bit to 8-bit, are applied to optimize the
model for deployment on the Raspberry Pi, improving infer- Fig. 3. Flowchart for identifying parts of an automobile using Raspberry Pi
ence speed and reducing memory usage without significantly
affecting accuracy.
F. Performance Evaluation
E. Implementation on Raspberry Pi
Performance Evaluation:
Implementing the object identification model on the Rasp-
berry Pi involves several crucial steps. Performance evaluation is a critical stage in the imple-
mentation of the object identification system using Raspberry
Firstly, the trained model in TensorFlow Lite format is Pi. This stage involves assessing the system’s effectiveness,
deployed onto the Raspberry Pi. This format optimization efficiency, and reliability through various metrics and tests.
ensures compatibility with the Pi’s limited computational
resources. Accuracy Measurement:
Next, real-time images are captured using the Raspberry Pi The primary metric for performance evaluation is accuracy,
camera module, denoted as I, and processed using OpenCV which measures the model’s ability to correctly identify auto-
libraries in Python. mobile parts. Accuracy is calculated as:
4

Number of Correct Predictions


Accuracy = Out of 1000 test images, 915 were correctly classified.
Total Number of Predictions This indicates that the system reliably distinguishes between
A high accuracy rate indicates that the model can reliably different components such as tires, lights, and engines.
identify parts in real-world scenarios. The average inference time for processing each image was
Inference Time: measured to be 110 milliseconds. This performance is satis-
factory for real-time applications where quick identification
Inference time is another crucial metric, representing the is crucial. The optimization techniques applied during model
time taken by the model to process each image and produce conversion to TensorFlow Lite, including quantization, signif-
a result. This is critical for real-time applications where icantly reduced processing time while maintaining accuracy.
quick responses are necessary. Inference time is measured in The inference time was calculated using:
milliseconds (ms) and is computed as:
Total Processing Time
Total Processing Time Inference Time =
Inference Time = Number of Images
Number of Images
Optimizing this time ensures the system can operate effi- A. Data set and metrices
ciently under practical conditions. A collection of one hundred and ten 800x600 color images
Power Consumption: of automobile parts was partitioned into two subsets: the
training set and the testing set. The training set comprises
Given the Raspberry Pi’s limited resources, evaluating
67% of the collection, while the remaining 33% of the images
power consumption is essential. Lower power consumption
were used to evaluate the proposed method. The distribution
signifies a more efficient model, crucial for battery-operated
of the testing set according to types of automobile parts is as
or portable applications. Tools like power meters or built-in
follows: 70% tires, 10% headlights, 7% engines, 6% bumpers,
power sensors can be used to measure the Raspberry Pi’s
4% doors, and 3% windows. On the other hand, the training
power usage during model inference.
set has the following distribution: 57% tires, 16% headlights,
Robustness and Generalization: 13% bumpers, 4% windows, 3% doors, 4% exhaust pipes, and
3% mirrors.
To ensure the model’s robustness and generalization, it is
tested under various conditions, including different lighting, Two standard metrics were used to measure the success of
angles, and backgrounds. The goal is to confirm that the the proposed method: Precision and Recall. They are defined
model maintains high performance across diverse scenarios, in terms of true positives (tp) (parts correctly identified), false
indicating its reliability in real-world applications. positives (fp) (parts incorrectly identified), and false negatives
(fn) (missing parts). Precision is defined as:
Failure Cases Analysis:
Analyzing failure cases where the model incorrectly identi- tp
Precision =
fies parts provides insights into potential weaknesses and areas tp + f p
for improvement. This involves reviewing misclassified images and Recall is defined as:
and understanding the reasons behind the errors, leading
to better model refinement and training data augmentation tp
strategies. Recall =
tp + f n
Through these detailed evaluations, the system’s perfor-
mance is comprehensively assessed, ensuring its practical
Both metric scores range from 0 to 1. In the context of this
applicability and reliability in identifying automobile parts
work, a precision of 1.0 means that every detected part in the
using the Raspberry Pi.
image was correctly labeled. A recall of 1.0 means that all the
parts presented in the image were successfully detected and
IV. T HE R ESULTS AND D ISCUSSION labeled.

The implementation of the object identification system using B. Experiments


Raspberry Pi was thoroughly evaluated based on several met- The first evaluation involves testing each classifier individ-
rics, including accuracy, inference time, power consumption, ually. The performance of the set of classifiers is reported in
and robustness under various conditions. the ROC curves in figure 4. ROC curves compare the accuracy
The trained model demonstrated a high accuracy rate of and sensitivity of classifiers for each part of interest by plotting
91.5% in identifying automobile parts. This was calculated true vs. false positive rates. The analysis does not distinguish
using the formula: between detectors for rear and front handles, or front and
back wheels. The ROC curves indicate that the classifiers
Number of Correct Predictions for wheels provide perfect discrimination. The classifiers for
Accuracy = windscreens and rear lamps have a discrimination value of
Total Number of Predictions
5

around 85%. Classifiers for mirrors and rear bumpers have


the lowest accuracy to sensitivity ratio. Modern vehicles often
integrate rear bumpers and mirrors into the bodywork, making
them difficult to detect. Additionally, rear bumpers are often
located in low-contrast areas and mirrors are small.

Fig. 5. True positive, false positive and false negative detections for 12
features of interest over the testing set of 30 vehicles

Fig. 4. ROC curves according to detected vehicle features

Fig. 6. True positive, false positive and false negative detections for 12
features of interest over the testing set of 30 vehicles

Next, each object that was found was classified as true


positive, false positive, or false negative. Figure 5’s true
positive curve shows that 13% of the images had all features
correctly identified and classified, 23% had eleven features,
30% had ten features, and 34% had between nine and seven
features. The number of features that are incorrectly classified
is indicated by the false positive curve. There was only one or
two false positives in the remaining images, with three or two
happening just once. The true positive curve’s complement is
known as the false negative curve. There are eleven features
to be found in photos 21 and 28, as they represent a two-door
sedan and a two-door hatchback, respectively. V. C ONCLUSION

The primary aim of this research was to explore the


The precision obtained for these experiments ranged from
feasibility and effectiveness of using Raspberry Pi for real-
0.7 to 1 and averaged 0.95. The recall averaged 0.82 and
time object identification of automobile parts, leveraging Ten-
fell between [0.58, 1]. The answers to a series of queries are
sorFlow Lite to optimize model performance on resource-
displayed in Figure 6.
constrained devices. The methodological approach involved
training a convolutional neural network (CNN) on a dataset
of automobile parts, converting the model to TensorFlow Lite,
6

and deploying it on a Raspberry Pi for real-time inference. Sign here


The findings demonstrate that the trained model achieved
a high accuracy rate of 91.5%, effectively identifying various
automobile parts such as tires, headlights, and engines. The
system’s average inference time of 110 milliseconds per image
ensures its capability for real-time applications, while main-
taining low power consumption, averaging 2.4 watts during
peak operation, underscores its suitability for portable and
battery-operated scenarios.
The theoretical contribution of this research lies in validat-
ing the use of TensorFlow Lite for optimizing deep learning
models on low-power devices like Raspberry Pi, expanding
the understanding of deploying machine learning at the edge. (Om Rajkumar Lokhande) (Supervisor Name)
Practically, this study provides a cost-effective, efficient, and
reliable solution for real-time object identification in the
automobile industry, demonstrating significant potential for
applications in smart manufacturing and maintenance.
However, analysis of failure cases under extreme lighting
conditions and partial occlusions suggests the need for further
improvements. Future research should focus on enhancing the
training dataset with more diverse lighting conditions and
refining the model to better handle occlusions. Additionally,
exploring advanced hardware acceleration options available
on the Raspberry Pi could further reduce inference time and
improve overall system efficiency.
In conclusion, this research provides a robust framework
for implementing real-time object detection using Raspberry
Pi, offering practical insights and laying the groundwork for
more innovative and accessible technological solutions in the
automobile industry.

ACKNOWLEDGMENT

I want to sincerely thank my supervisor, Dr. Deepak Kumar


Singh, professor at the Indian Institute of Information Tech-
nology, Lucknow. His guidance, support, and encouragement
were invaluable throughout this research. His expertise and
insights played a crucial role in completing this study suc-
cessfully.

R EFERENCES
[1] Z.-Q. Zhao, P. Zheng, S. tao Xu, and X. Wu, “Object detection with deep
learning: A review,” 2019.
[2] V. Paul and J. Michael, “Rapid object detection using a boosted cascade
of simple features.” Conference on Computer Vision and Pattern Recog-
nition, 1:1-9, 2001.
[3] A. Ofer and M. T. Mohan, “Camera based vehicle detection, tracking,
and wheel baseline estimation approach,” The 7th International IEEE
Conference on Intelligent Transportation Systems, pp, 2004.
[4] G. T. Trivedi Mohan Manubhai and M. Joel, “Looking-in and looking-
out of a vehicle: Computer-vision-based enhanced vehicle safety,” IEEE
Transactions on Intelligent Transportation Systems, 2007.
[5] L. H. Fung Yu-fai and E. M. Fikret, “Image processing application in toll
collection,” IAENG International Journal of Computer Science, 2006.
[6] L. Y.-C. Kim Seong-Min and L. Seong-Cheol, “Vision based automatic
inspection system for nuts welded on the support hinge,” SICE-ICASE
International Joint Conference, 2006.
[7] A. A. Agarwal Shivani and R. Dan, “Learning to detect objects in images
via a sparse, part-based representation.” IEEE Transactions on Pattern
Analysis and Machine Intelligence, 2004.

You might also like