CIFAR-10 Image Classification
- vrk6637
- Nov 1, 2021
- 3 min read
Updated: Nov 2, 2021
Challenge:
The competition is simple: we use the cipar -10 data set to predict the image with correct label. so here we have to find the average accuracy of each class and also the accuracy of the total network.
What is cipar - 10 classifier?

CIFAR-10 is an image dataset which can be downloaded from here. It contains 60000 tiny color images with the size of 32 by 32 pixels. The dataset consists of 10 different classes (i.e. airplane, automobile, bird, cat, deer, dog, frog, horse, ship and truck), in which each of those classes consists of 6000 images. [1]
There are two sets of data that we use here
1. Training set : contains the data that we use for the training being our training dataset
2. Testing set : contain the subset of data for testing. We use this test data set to find the accuracy of the model
For Training an image classifier we will do the following steps:
1.Load and normalize the CIFAR 10 training and test datasets 2.Define a Convolutional Neural Network 3.Define a loss function 4.Train the network on the training data 5.Test the network on the test data
Load and normalize the data
we are using keras libraries[2] to load and normalize data.
import required libraries


Create a Convolution Neural Network model :
what is CNN?
CNN is a Deep Learning algorithm which can take in an input image, assign importance (learnable weights and biases) to various aspects/objects in the image and be able to differentiate one from the other. [4]
What is Relu?
The rectified linear activation function or ReLU[5] for short is a piecewise linear function that will output the input directly if it is positive, otherwise, it will output zero. It has become the default activation function for many types of neural networks because a model that uses it is easier to train and often achieves better performance.
Max pooling is a pooling operation that selects the maximum element from the region of the feature map covered by the filter. Thus, the output after max-pooling layer would be a feature map containing the most prominent features of the previous feature map.
we have used keras library for implementing this model. I have implemented 3 models experimenting with different hyperparameters for the cypher 10 classification
Convolution Model 1:
Six convolution layers with 2 fully connected dense layers at end.
Two convolution layers with 32 filters each with 3*3 kernel size with activation function as relu which is further connected with the max pool layer.
Next 2 convolution layer with 64 filters each with 3*3 kernel size with relu activation which is further connected with the max pool layer
The final 2 layers are with 128 filters each with 3*3 kernel size with relu activation and which is connected with the max pool layer.
And then we have flatten the layer that we have built till now and then it is connected to 2 dense layers are with 128 and 10 neurons.
Then we have used Stochastic Gradient Descent algorithm with the learning rate of 0.001 and momentum of 0.9 for minimizing the cross entropy loss for improving the accuracy of the model.
After all the execution, the average accuracy of the model is : 72%

Convolution Model 2:
In this model, it is implemented almost same as the model 1. but, we have added constant drop out parameter 50% between the convolution layers and kept the epoch as 100 with batch size 64 and finding the accuracy of the model.
After all the execution, the average accuracy of the model is : 79%

Convolution Model 3:
In this model, it is implemented same as the model 2. but, started with 20% drop out value and then increased till 40% till end of each convolution layer and kept the epoch as 200 this time with batch size 64 and finding the accuracy of the model.
After all the execution, the average accuracy of the model is : 81 %

Find the test results of all the three models here
Jupyter Notebook
Graphs
Graph against accuracy and Models

2. Graph plotted against accuracy and time for training duration

My Contribution
I have researched different articles and papers mentioned above in the blog page
and able to 3 CNN models with different hyper parameter's
Experimented number of neurons per layer
Experimented with number of layers
Experimented epoch values
Experimented with shape of conv2d .
Made use of drop out layer which helped in increasing the accuracy of the model
Challenges Faced and Solution for them
Finding the right parameters to increase the accuracy of the model was challenging.
I managed to high accuracy by experimenting the above mentioned parameters in the My contribution section.
Algorithms Used
I have used CNN algorithm for implementing the image classification
it an efficient recognition algorithm which is widely used in pattern recognition and image processing. It has many features such as simple structure, less training parameters and adaptability.



Comments