OK, so now let's start building our first CNN model.
We will be using the same data that we use for classification problem in in in here.
Their task is to identify the fashion article name depending on their images.
We have 10 categories of different objects.
We have T-shirts, trousers, Bullo words.
And for all of these articles we have, they are 28 by 28 pixel gray scale images.
We have already created a neural network model for this classification problem.
Now we are going to add convolutional layer with over and then more than.
So let's just start by importing some of the important libraries.
We are importing them by pandas.
And my Lord.
Then we are also importing tens of flow and get us.
Then, as I have told you earlier, we will be using fashion amnesty data.
This data is available in cadeaux datasets.
For more information, you can click on this link.
Here we have around 60000 images as our training data and another 10000 images as of our test data.
We have 10 different categories.
All these categories are labeled from zero to nine.
And this is this index.
We are going to use to import fashion and this data.
We have already done this in our Hénin tutorial.
So I'm not going to spend our time on this.
So we're importing our data and do X train full, Y train full X test and Y test variables.
Let's just run this now since we have labels for all these articles.
We are going to clear the list with their description so that we can refer this list whenever we get
a class label.
So let's create a last name list also.
Now we have to do Boota reshaping this donly change we are going to do in preprocessing of convolutional
neural network as compared to.
And then.
If you remember four and then we converted a what do these images into a single one dimensional array?
Losing light and function.
But for CNN, we need a three dimensional array as input.
We need height, weight.
And also another dimension.
Four channels.
Currently, we have our X data in the form of this 2D images.
There is no another dimension for channels since these are simple grayscale images.
But by default for CNN layers, we need a two dimensional images.
So we are going to reshape what extrem data and we are going to add another dimension to our data.
So earlier we were using 28 by 28 pixel images.
Now we are shipping it in to 28 and to 28.
And to one one it stands for Channel.
And again, we have 60000 images in our training dataset and 10000 images in our test dataset.
So before doing this, we ship the shape of our extranet fully.
Dataset was 60000, cross 28, cross 28, Norfork Convolutional Neural Network.
We are adding another dimension for channel as well.
So we are just adding another dimension to make it four dimensional.
Just on this now we have reshaped our data.
The next step is to normalize the data.
So all over pixel values are between zero to 255.
So we are just going to divide over an entire dataset by 255.
In that way, all lower values will lie between zero and one.
We already did the similar thing for a word and then model as well.
So I'm going to spend much time here.
Similarly, we are going to split over dataset and do screen and validation sites.
We are keeping 55000 images for our training, the desert and dress of 5000 images for our validation
dataset.
So Lurdes, just on this as well.
So first, 5000 are going into validation and from 5000 to 60000 are going into training data.
Now, let's say the seed for over 10 sort of flow and number so that we get the same result every time
we run this code.