0% found this document useful (0 votes)
12 views30 pages

Final Presentation

Uploaded by

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

Final Presentation

Uploaded by

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

Prepared by group 4

Project - Image
Classification using
SEP 738 - Artificial Intelligence Methods in Advanced
CNN Manufacturing
Team Members

Mohammad Pourshahadi Stuart Burns Nehaa Vijayakumar Gowri Menon


400610474 400128668 400607375 400608195
Introduction

The project focuses on building an efficient Convolutional Neural


Network (CNN)-based model to classify grayscale industrial
component images into six distinct categories​.
The emphasis lies in evaluating how preprocessing steps and
hyperparameter choices affect classification accuracy.
Methodology

Pre-processing
Cropped the images from given
dataset and assigned labels for Effect of changing
each image for classification in parameters on model
excel Modified
accuracy the code to change
parameters like learning rate,
kernel size, epoch size, optimizer
& activation function choice,
Default parameter and choice to add hidden layer &
Made a classification CNN model
model batch normalization.
with one convolution block and
one hidden layer.
Pre-processing
Assigning labels

Saving the names as a list and in one column


of excel file and then according to the name
of the images we divide them in 6 different
classes based on if the part is powder coated
or with part and 3 different lighting
conditions.
Pre-processing
Location for cropping

A code that loads an image, resizes it for


better visibility on a laptop screen, and
allows users to click and drag to select a
cropping area. Once the selection is made,
the script will provide the approximate
coordinates of the cropped region.
Pre-processing
Cropping images

Adjusting the location to get a cropped


image with equal dimension the code starts
cropping each image and saving in another
folder.
Model workflow
• Define Variables – Set key parameters like image size, Extracting data from folder

batch size, and number of epochs for flexibility.


Defining variables to change parameter
• Downsize Data – Select a subset of the dataset if needed

to reduce computation time and overfitting risks.


Downsizing data to subset
• Split Data – Divide the dataset into training, validation,

and test sets for proper model evaluation.


Split into Train – Validation – Test
• Normalize & Distribute – Scale pixel values (e.g., 0-1 or -1

to 1) and balance class distribution to improve learning. Normalizing and distributing data

• Define CNN – Construct a convolutional neural network

• Train Model – Feed training data into the CNN. Defining CNN architecture

• Calculate F1 Score – Measure model accuracy considering


Training model and calculating F1-score
both precision and recall for balanced evaluation.
• Visualize Results – Plot loss, accuracy trends, sample
Visualize Results
predictions, confusion matrix.
Defining variables
Parameter Value
Epoch 12
Batch size 16
Learning Rate 0.00001
Kernel Size 3x3
Optimizer Adam
Activation function of CNN Relu
First drop out 0.25
Final drop out 0.5
Number of kernel and neuron for (64, 64, 128)
1st, 2nd and dense layer
Image size 128x128
Reducing dataset

So, we get 1050 images from originally 1500


images
Ensuring each class
has 165 images
Saving split image
index to a file
Train - Validation –
Test split
Normalization and data
summary function
Normalize data and loading
to train-val-test
CNN Architecture
CNN Architecture
Continued
Training our model
Confusion matrix
Visualize prediction
Classification report
Training over time
graph
Default parameters
These are the default values which are used while testing different parameters

Parameter Value
Accuracy of the model – 74.50%
Epoch 12

Batch size 16

Learning Rate 0.00001

Kernel Size 3x3

Optimizer Adam

Activation function of CNN Relu

First drop out 0.25

Final drop out 0.5

Number of kernel and neuron for 1st, (64, 64, 128)


2nd and dense layer
Image size 128x128
Effect of Epoch and Batch size

Figure 1 Effect of epoch on model accuracy Figure 2 Effect of batch size on model accuracy
Epoch Accuracy 82.00%
100.00% 67.79%
8
12 74.50% 80.00%
95.00%
30 86.58%
90.00% 50 92.62% 78.00%
80 95.97%
85.00% 150 95.30% 76.00%

Accuracy
Accuracy

74.00%
80.00%

72.00%
75.00%
Batch size Accuracy
8 81.21% 70.00%
70.00%
16 74.50%
68.00%
65.00% 32 80.54%
64 71.14%
66.00%
60.00% 128 72.48% 0 50 100 150 200 250 300
0 20 40 60 80 100 120 140 160
256 77.18%
No. of Epoch Batch size
Effect of Learning rate and
Kernel size
Figure 3 Effect of learning rate on model accurancy Figure 4 Effect of Kernel size on model accuracy
90.00% Learning rate Accuracy 88.00%
0.000001 53.02%
85.91%
85.00% 0.000005 71.81% 86.00%
0.000009 87.25% 84.00%
80.00% 0.00001 74.50%
0.00002 72.48% 82.00%
80.54%
75.00% 0.00005 52.35% 80.00%

Accuracy
Accuracy

70.00% 78.00%

76.00% 75.17%
65.00% 74.50%
Kernel size Accuracy 74.00%
3x3 74.50%
60.00%
5x5 75.17% 72.00%
7x7 80.54% 70.00%
55.00%
9x9 85.91%
68.00%
50.00% 3x3 5x5 7x7 9x9
0 0.00001 0.00002 0.00003 0.00004 0.00005 0.00006
Kernel size
Learning rate
Effect of Optimizer and
Activation function
Figure 5 Effect of optimizer on model accuracy Figure 6 Effect of activation function on model ac-
100.00% Optimizer Accuracy curacy
SGD 64.43%
87.92% 80.00%
90.00% AdamW 70.47% 78.52%
RMSprop 87.92% 78.00% 77.85%
80.00%
74.50% Adam 74.50%
70.47%
70.00% 76.00%
64.43%
74.50%
60.00% 74.00% 73.83%
Accuracy

50.00%

Accuracy
72.00%
40.00%
70.00% 69.13%
30.00% Activation Accuray
function
68.00%
20.00% leakyReLU 69.13%
elu 73.83% 66.00%
10.00%
tanh 78.52%
0.00% swish 77.85% 64.00%
SGD AdamW RMSprop Adam leakyReLU elu tanh swish Relu
Relu 74.50%
Optimizer Activation Function
Effect of 1 drop out and Final st

drop out
Figure 7 Effect of first drop out on model accuracy
Figure 8 Effect of final drop out on model accuracy
90.00% First drop out Accuracy
0.1 64.43% 100.00%
85.00% 0.2 55.70%
90.00%
0.25 74.50%
80.00% 0.3 76.51% 80.00%
0.5 85.91% 70.00%
75.00% 0.7 62.42%
60.00%
Accuracy

Accuracy
70.00% 50.00%
40.00%
65.00%
Final drop out Accuracy 30.00%
60.00% 0.1 91.28%
20.00%
0.25 91.28%
55.00% 0.5 74.50% 10.00%
0.75 18.79% 0.00%
50.00% 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
Final drop out
First droup out
Effect of no. of layers and
Image size
Epoch Accuracy
8 67.79%
12 74.50%
30 86.58%
50 92.62%
80 95.97%
150 95.30%

Batch size Accuracy


8 81.21%
16 74.50%
32 80.54%
64 71.14%
128 72.48%
256 77.18%
Future scope

1. Implementing object detection or segmentation techniques (e.g.,


U-Net, Faster R-CNN) to pinpoint the exact location of defects
within an image.
2. Expanding the model to not only identify defective samples but
also classify them into specific defect types for better quality
control.
Thank
you

You might also like