Professional Documents
Culture Documents
2023-24
DEEP LEARNING
(19EC7CE2DL)
AAT REPORT ON
SUBMITTED BY:-
NAME USN
VANSH JAIN 1BM20EC183
MOHAN S 1BM21EC411
Course Instructor
Dr. Geetishree Mishra
Assistant Professor Department of
ECE, BMSCE
INDEX
SL NO TOPIC PAGE NO
1 INTRODUCTION 2
2 PROBLEM DEFINITION 3
3 PROPOSED SOLUTION 4
4 METHODOLOGY 5
5 IMPLEMENTATION 7
6 CODE 8
7 RESULT ANALYSIS 12
8 CONCLUSION 13
9 REFERENCES 14
10 RESULT PLOTS 15
FIGURES:-
1
INTRODUCTION
At present, Computer and Electronic technologies trying to find solutions for problems of many areas. One of
them is security. There is a lot of problems in security for the technology. One of these problems is traffic safety.
The control of the vehicles in the traffic; such as license plate, speed detection, license belt control, brand, model
or many different license information control is very important for both traffic safety and the city and also in the
terms of region security. One of the functions required in traffic is detection of brands and models of vehicles.
There are several reasons for this control. One of the reasons and the most important is traffic safety. Some of
the different types of vehicles in traffic may be forbidden from using some points and roads. For example; a
control point is created. The properties of the vehicles passing through the control point are detected. According
to the detected features, the passage of the vehicle can be prevented in advance. One of these reasons is the
validity of the vehicles. In other words, the brand and model of the vehicle are detected through license plate and
the actual brand and model may not match. Similarly, the more common one may be the discrepancy between
the actual color of the vehicle and the registered color of the vehicle. Especially for stolen vehicles or illegal
situations, it becomes easier to encounter such events more frequently. Many purpose or problems may occur
and vary according to the demands and needs of institutions and organizations. In order to minimize such
problems, the aim of this study is to detect the brand of vehicles by image processing methods. In this study, it is
tried to develop an algorithm that determines the brands of vehicles from vehicle images. In the study Faster-
RCNN which is the deep neural network method is used.
2
PROBLEM DEFINITION
Develop a machine learning model capable of accurately classifying the make or brand of cars based on input
images. The goal is to create a system that can automatically identify and classify various car brands from images
with a high degree of accuracy. The model should be trained to recognize a diverse range of car brands,
distinguishing between different makes such as Toyota, Ford, BMW, Mercedes-Benz, Honda, Audi, and others
commonly found in the automotive market.
Key Objectives:
1. Acquire a comprehensive and diverse dataset containing images of cars from different angles, lighting
conditions, and backgrounds.
2. Preprocess the dataset to ensure uniformity in image size, quality, and format, optimizing it for model training.
3. Explore and employ suitable deep learning architectures (such as Convolutional Neural Networks - CNNs) for
feature extraction and classification.
4. Train the model using the prepared dataset, focusing on achieving high accuracy, precision, and recall in
identifying car brands.
5. Validate the model's performance using an independent test dataset to assess its generalization and ability to
classify unseen car brands accurately.
6. Optimize and fine-tune the model parameters and architecture to enhance its performance further.
7. Develop an interface or application where users can upload images of cars, and the model can predict the
respective car brand with high confidence.
8. Evaluate the model's performance metrics such as accuracy, precision, recall, and F1-score to assess its
effectiveness and potential for real-world applications.
9. Deploy the trained model in a production environment, ensuring scalability and efficiency.
Success Criteria:
- Achieve a classification accuracy of over 90% on the test dataset.
- The model should correctly classify a diverse range of car brands from input images.
- The inference time for predicting the car brand should be within acceptable limits for real-time or near-real-
time applications.
- Develop a user-friendly interface or application for easy interaction with the model, demonstrating its practical
usability.
3
PROPOSED SOLUTION
Here's a concise version of the proposed solution for car brand classification. Gather diverse car image dataset.
Standardize image sizes, normalize pixel values, and augment data for variability. Use a pre-trained CNN
architecture (e.g., VGG, ResNet).Fine-tune the CNN on the dataset for brand classification. Split data for training,
validation, and testing. Validate model using validation set and evaluate performance metrics (accuracy,
precision, recall, F1-score) on the test set. Create a user-friendly interface allowing image uploads for brand
classification. Integrate the trained model for real-time predictions. Optimize model for speed and efficiency.
Document the entire process and set up a system for periodic model updates and improvements.
This summarized approach aims to build an accurate car brand classification system with a user-friendly interface
while ensuring ongoing model maintenance and optimization.
4
LITERATURE SURVEY
[1]. Sheng and et al. proposed vehicle detection system using neural networks. They presented a method based
on CNN. Their method consists of two steps: vehicle area detection and vehicle brand detection. They applied
Regions with Convolutional Neural Network features (RCNN), Faster RCNN, AlexNet, Vggnet, GoogLenet and
Resnet. They noted that their algorithm obtained 93.32% classification accuracy in the classification of six kinds
of vehicle models.
[2]. Watkins et al investigate whether ResNet architectures can outperform more traditional CNN on the task of
fine-grained vehicle classification. They train and test ResNet-18, ResNet-34 and ResNet-50 on the
Comprehensive Cars dataset without pre training on other datasets. They then modify the networks to use
Spatially Weighted Pooling (SWP). Finally, they add a localization step before the classification process, using
a network based on ResNet-50. They find that using SWP and localization both improve classification accuracy
of ResNet50. SWP increases accuracy by 1.5% points and localization increases accuracy by 3.4 percent points.
Using both increases accuracy by 3.7% points giving a top-1 accuracy of 96.351% on the Comprehensive Cars
dataset. Their method achieves higher accuracy than a range of methods including those that use traditional
CNNs. However, their method does not perform quite as well as pre-trained networks that use SWP.
[3]. Pan et al worked on the problem of training data which were collected by Self-driving vehicle vision systems.
Since the volume of collected data are too large it impossible to train offline. They use near-to-far labeling
strategy by first marking large, close objects in the video. They tracked marked object back in time to induce
labels on small distant presentations of these objects.
[4]. Soleimani et al investigated the problem of aerial vehicle recognition. They used a text-guided deep CNN
classifier. The inputs are an aerial images and classes. They train and test proposed model on a synthetic dataset
and classes consist of the combination of the class types and colors of the vehicles.
[5]. In study worked by Nazemi et al they formulate the vehicle make and model recognition. They used
unsupervised feature learning methods. They applied Locality constraint Linear Coding (LLC) method as a fast
feature encoder for encoding the input SIFTS features. The proposed method can perform in real environments
of different conditions. The applied their method on two datasets: Iranian on-road vehicle dataset and CompuCar
dataset. Experimental results showed superiority of the proposed framework over the state-of-the-art methods.
5
METHODOLOGY
The methodology for developing a car brand classification system involves a systematic approach with various
stages:
1. DATA COLLECTION:
Gather a diverse dataset of car images encompassing different brands, models, and variations.
Ensure a balanced representation of each brand to avoid bias in the model.
2. DATA PREPROCESSING:
Resize images to a uniform size and standardize pixel values.
Augment the dataset by applying transformations like rotation, flipping, and adjusting brightness/contrast to
increase variability.
6
6. DEPLOYMENT AND INTERFACE DEVELOPMENT:
Create a user-friendly interface enabling users to upload car images.
Integrate the trained model into the interface for predicting the car brand from the uploaded images.
Ensure the system provides clear and actionable feedback for user interactions.
This methodology follows a structured workflow, encompassing data collection, model development, validation,
deployment, optimization, and continuous maintenance to ensure the effectiveness and reliability of the car brand
classification system.
7
IMPLEMENTATION
TENSOR FLOW:- TensorFlow is an open source software library. It uses for high performance numerical
calculation. Its flexible architecture enables it to work on various platforms (CPUs, GPUs, TPUs). Enables easy
calculation from desktop computers to server clusters, mobile devices to edge devices. It is a software library
originally developed by researchers and engineers from the Google brain team within Google's AI organization,
using a flexible numerical computation core that comes with a strong support for machine learning and deep
learning and in many other scientific areas. This library, which is preferred by the companies around the world,
is also easy to use for developers who are new to deep learning.
OPEN CV:- Open Source Computer Vision Library (OpenCV) is an open source computer vision and machine
learning software library. OpenCV provides a common infrastructure for computer vision applications and
accelerates the use of machine perception in the commercial products. OpenCV is BSD-licensed product, it
makes it easy for businesses to use and modify the code. It has Python, C++, Java and MATLAB interfaces and
supports Linux, Windows, Mac OS and Android. A full-featured CUDA and OpenCL interfaces are being
actively developed now.
FASTER-RCNN NEURAL NETWORKS ALGORITHMS:- Faster R-CNN algorithm is the object detection
system composed of two modules. The first module is a deep fully convolutional network that proposes regions,
and the second module is the Fast R-CNN detector that uses the proposed regions. The entire system is a single,
unified network for object detection (Fig. 1). In the first module called RPN, an input vehicle image is passed
through convectional neural networks layers. A feature network is obtained from this stage. RPN is created using
this feature network. Region propositions are made on this network(RPN). Region propositions is resized using
RoI pooling.
8
CODE
drive.mount('/content/drive')
train_path = '/content/drive/MyDrive/Datasets/Train'
valid_path = '/content/drive/MyDrive/Datasets/Test'
# Import the Vgg 16 library as shown below and add preprocessing layer to the front of VGG
# Here we will be using imagenet weights
# Use the Image Data Generator to import the images from the dataset
from tensorflow.keras.preprocessing.image import ImageDataGenerator
# Make sure you provide the same target size as initialied for the image size
training_set = train_datagen.flow_from_directory('/content/drive/MyDrive/Datasets/Train',
target_size = (224, 224),
batch_size = 32,
class_mode = 'categorical')
test_set = test_datagen.flow_from_directory('/content/drive/MyDrive/Datasets/Test',
target_size = (224, 224),
batch_size = 32,
class_mode = 'categorical')
# save it as a h5 file
model.save('model_resnet50.h5')
y_pred = model.predict(test_set)
10
y_pred
import numpy as np
y_pred = np.argmax(y_pred, axis=1)
y_pred
model=load_model('model_resnet50.h5')
img_data
img=image.load_img('/content/drive/MyDrive/Datasets/Test/lamborghini/11.jpg',target_size=(224
,224))
x=image.img_to_array(img)
x
x.shape
x=x/255
x=np.expand_dims(x,axis=0)
img_data=preprocess_input(x)
img_data.shape
model.predict(img_data)
a=np.argmax(model.predict(img_data), axis=1)
a==1
11
RESULT ANALYSIS
After training the car brand classification model, analyzing the results involves examining various aspects to
understand its performance and potential areas for improvement. Here's an analysis framework:
1. Model Performance Metrics:
Accuracy: Overall correctness of predictions.
Precision: Proportion of true positive predictions among all positive predictions.
Recall (Sensitivity): Proportion of true positive predictions among actual positives.
F1-score:Harmonic mean of precision and recall.
4. Error Analysis:
Identify and analyze misclassified images to understand common patterns causing mispredictions. This might
reveal areas for improvement, such as additional data augmentation or fine-tuning.
By conducting a comprehensive analysis using these approaches, you can gain insights into the strengths and
weaknesses of the model, helping to refine and optimize it further.
12
CONCLUSION
Faster RCNN method is used to detection of brand. Different versions of the faster RCNN method have been
developed. In this study, “ResNet 50” version is used. The model developed at the end of the training is tested
on test datas. There are areas such as the name of the vehicle brand, the number of car brands, the number of
correct estimates, the number of false estimates, the accuracy and the error rate. In cases where the logo of the
brand cannot be detected, detected incorrectly or detected outside the region where the logo is located are marked
as false estimate. In cases the correct position of the brand logo is detected correctly on the area where the logo
is located are maked as true estimate. As can be seen from Table 3 and Fig. 4 brands have reached their correct
ratio of 90% and above and they have not reached even 10% in 2 brands. In the detection of brands, which brand
is found in the picture and which brand has detected by software are transferred to the confusion table in Fig. 4.
13
REFERENCES
[1]. M. Sheng, C. Liu, Q. Zhang, L. Lou and Y. Zheng, “Vehicle Detection and Classification Using
Convolutional Neural Networks”. 2018 IEEE 7th Data Driven Control and Learning Systems Conference
(DDCLS).
[2]. R. Watkins, N. Pears and S. Manandhar, ”Vehicle classification using ResNets, localisation and spatially-
weighted pooling, https://arxiv.org/pdf/1810.10329.pdf, last accessed, june 2019.
[3]. X. Pan, SL. Chiang and J. Canny,”Label and Sample: Efficient Training of Vehicle Object Detector from
Sparsely Labeled Data”, https://arxiv.org/pdf/1808.08603.pdf, last accessed, June 2019.
[4]. A. Soleimani, NM. Nasrabadi, E. Griffith, J. Ralph and S. Maskell, “Convolutional Neural Networks for
Aerial Vehicle Detection and Recognition”, IEEE National Aerospace and Electronics Conference, NAECON
2018.
[5]. A. Nazemi, M. Shafiee, J. Mohammad, Z. Azimifar and A. Wong, “Unsupervised Feature Learning Toward
a Real-time Vehicle Make and Model Recognition”, https://arxiv.org/pdf/1806.03028.pdf, last accessed, june
2019
14
RESULT PLOTS
15
Figure 3:- Training Loss and Validation Loss
16