‫Welcome back.
‫I hope you have installed keras and tensorflow in your system.
‫Now, as a practice project, we are going to create an image classifier.
‫We will be classifying this kind of images into ten different categories, such as T-shirts, trousers,
‫pullover dresses, bags, boots, et cetera.
‫For this, we are going to use a very famous database that is known as Fashion emnist Database.
‫Here we have around 70000 grey scale images of ten different fashion categories, objects.
‫Our training set will be of
‫60000 images which we are going to use to train our model.
‫We have an another set of 10000 images which we will be using as a test set to evaluate the performance
‫of our model.
‫These images are in a form of twenty eight by twenty eight pixel square and each pixel is represented
‫on a gray scale.
‫On a scale of 0 to 255.
‫The great thing about this database is that it is available within keras and we can directly import it from
‫Keras.
‫We don't have to upload a separate file to access this database. Here
‫You can see the ten different objects that are present in this database.
‫Now, to access this database from keras, we are first creating a fashion underscored mnist object
‫where we are calling this database and after that we are loading this database into our X and y datasets.
‫We are calling our train dataset as X underscore tarin underscore full and y underscore train
‫underscore full and our test dataset as X underscore test and y underscore test.
‫So just load this database.
‫No, we can use macplot library to view images in this database.
‫So, for example, if I want to access the first image, I can just write x underscore train underscore
‫full.
‫And we're accessing the first element.
‫That is the picture that is present at position zero.
‫You can see that this is our first image if we want to access the second image.
‫I'm just changing the location to one.
‫In this way, you can access the different images that are present in this database.
‫Now, this is our X variable.
‫This are of the pixels that we are going to use to predict the object.
‫Not to view the actual category of this object.
‫We have to call the y train dataset so you can just call the element that is present at the first
‫position.
‫So if I run this.
‫You can see that the output is zero.
‫To view the category that is responding to this zero label, we can refer this above table here, zero
‫Stands for t shirt and tops.
‫One is stands for trouser, who stands for pullover and so on.
‫So this image is of a T-shirt and the output is also representing that this is a T-shirt.
‫We just checked this for the first element.
‫You can see that this is a boot and the y label is nine.
‫If you see label 9 correspond to ankle boot.
‫So instead of referring table each time, we can create a list of class name.
‫Where
‫We have listed all the categories in the order of their labels.
‫So that if I call the first element of this list, it will directly give me the T-shirt, if I call
‫the second element.
‫It will give trousers as an output.
‫So instead of calling the labels, I can directly call
‫The description of those labels using this class name list.
‫So just check the image of object that is present location
‫10
‫Who check the y label of this object
‫I can directly call class name and then the label of the position 10.
‫You can see the class name here tshirt or top.
‫If you notice
‫Here we are using matplot to plot the data that is stored in the x train dataset, now to view the content
‫of this data.
‫You can
‫You can just write x train full and then call the object.
‫So earlier I have mentioned that this images are of 28 by 28, greyscale format.
‫So here in the data, you are seeing 28 into 28 pixel values.
‫These are the pixels that are present at the first row.
‫These are the pixels that are present at
‫The second row and so on for the 20th row. Here
‫Zero represent pure black and 255 represents white.
‫So the location of first pixel, that is the first row and the first pixel.
‫You can see it's pure black.
‫That's why we are getting zero.
‫So our data is present in this form to view the data.
‫You have to use
‫Imshow method and to get the y values the actual category of this data.
‫You have to call y train data and you can also use class name list to directly get the descriptions
‫Instead of label.
‫So this is the data that we are going to use for each record.
‫We have 28 into 28 values, that is 784 values.
‫And using these values, we are going to predict the description of this.
‫So that's all for the data.
‫You have the raw data can view this data.
‫And you have the class names.
‫Now, we have to create model on this data.
‫In the next lecture, we will normalize our dataset and further divided our train dataset into validation
‫and train set.
‫Thank you.