1 00:00:00,810 --> 00:00:07,000 OK so now let's start building our first CNN model. 2 00:00:07,170 --> 00:00:16,590 We will be using the same data that we use for classification problem in and then here the task is to 3 00:00:16,590 --> 00:00:23,730 identify the fashion article name depending on their images. 4 00:00:23,730 --> 00:00:27,450 We have 10 categories of different objects. 5 00:00:27,450 --> 00:00:38,070 We have t shirts trousers words and for all of these articles we have their 28 by 28 pixel grayscale 6 00:00:38,130 --> 00:00:40,960 images. 7 00:00:41,190 --> 00:00:47,520 We have already created a neural network model for this classification problem. 8 00:00:47,520 --> 00:00:54,090 Now we are going to egg convolution a layered width of it and then more than that. 9 00:00:54,580 --> 00:00:59,630 So let's just start by importing some of the important libraries. 10 00:00:59,640 --> 00:01:08,580 We are importing numbed by a US and my Lord then we are also importing tens of law and get us 11 00:01:11,230 --> 00:01:17,770 then as I have told you earlier we will be using fashion and honest data. 12 00:01:17,770 --> 00:01:22,480 This data is available in get us datasets. 13 00:01:22,510 --> 00:01:26,870 For more information you can click on this link here. 14 00:01:27,100 --> 00:01:35,590 We have our own 60000 images as our training data and another 10000 images as of our test data. 15 00:01:35,590 --> 00:01:42,330 We have ten different categories all these categories are label from 0 to 9. 16 00:01:44,320 --> 00:01:46,300 And this is this index. 17 00:01:46,300 --> 00:01:50,170 We are going to use the import fashion amnesty data. 18 00:01:50,170 --> 00:01:53,770 We have already done this in our aim in tutorial. 19 00:01:54,010 --> 00:01:57,910 So I'm not going to spend our time on this 20 00:02:01,320 --> 00:02:10,120 so we are importing over data and to explain full why train full x test and Vi test variables. 21 00:02:10,120 --> 00:02:16,680 Let us just run this now since we have labels for all these articles. 22 00:02:16,800 --> 00:02:23,650 We are going to create a list with their description so that we can refer to this list whenever we get 23 00:02:23,650 --> 00:02:25,800 a class label. 24 00:02:25,920 --> 00:02:28,280 So let's create a class name. 25 00:02:28,290 --> 00:02:30,900 This also. 26 00:02:31,680 --> 00:02:36,330 Now we have to do better at reshaping this Donnelly change. 27 00:02:36,330 --> 00:02:42,760 We are going to do in three processing of coin delusional neural network as compared to an 28 00:02:45,540 --> 00:02:46,780 if you remember four. 29 00:02:46,820 --> 00:02:54,410 And then we convert it over to the images into a single one dimensional array losing light and function 30 00:02:55,470 --> 00:03:00,780 but for CNN we need a three dimensional array as input. 31 00:03:00,900 --> 00:03:08,180 We need height weight and also another dimension for channels. 32 00:03:08,400 --> 00:03:11,760 Currently we have our X data in the form of this. 33 00:03:11,780 --> 00:03:12,900 Good images. 34 00:03:12,900 --> 00:03:22,020 There is no another dimension for channels since these are simple grayscale images but by default for 35 00:03:22,020 --> 00:03:25,900 CNN layers we need a three dimensional images. 36 00:03:26,070 --> 00:03:34,400 So we are going to reshape what external data and we are going to add another dimension to our data. 37 00:03:34,410 --> 00:03:39,690 So earlier we were using commandeered by 20th pixel images. 38 00:03:39,690 --> 00:03:45,050 Now we are reshaping it and 228 and 228 and 2 1 1. 39 00:03:45,050 --> 00:03:54,090 It stands for channel and again we have 60000 images in our training dataset and 10000 images in the 40 00:03:54,100 --> 00:04:04,960 work as dataset so before doing this reshape the shape of our extreme full dataset was 60000 across 41 00:04:04,970 --> 00:04:11,110 28 across 28 now for convolution on neural network. 42 00:04:11,110 --> 00:04:14,050 We are adding another dimension for the channel as well. 43 00:04:14,440 --> 00:04:21,430 So we are just adding another dimension to make it four dimensional. 44 00:04:21,430 --> 00:04:24,030 Just on this. 45 00:04:24,040 --> 00:04:26,680 Now we have reshaped our data. 46 00:04:26,680 --> 00:04:36,700 The next step is to normalize the data so all lower pixel values are between 0 to 255. 47 00:04:37,600 --> 00:04:42,420 So we are just going to divide our entire dataset by 255. 48 00:04:42,460 --> 00:04:47,460 In that way all lower values will lie between 0 and 1. 49 00:04:48,100 --> 00:04:52,910 We already did the similar thing for a word and then model as well. 50 00:04:52,990 --> 00:04:56,250 So I'm not going to spend much time here. 51 00:04:57,910 --> 00:05:04,470 Similarly we are going to split our dataset and do train and validation sites. 52 00:05:04,570 --> 00:05:13,210 We are keeping 55000 images for our training the desert and dress of 5000 images for our validation 53 00:05:13,210 --> 00:05:13,750 dataset. 54 00:05:15,250 --> 00:05:17,910 So let's just on this as well. 55 00:05:19,090 --> 00:05:28,340 So first 5000 are going into validation and from 5000 to 6000 are going into training data set. 56 00:05:30,080 --> 00:05:39,310 Now let's say the seed for a word then sort of flow and number so that we get the same result every 57 00:05:39,310 --> 00:05:40,410 time we run this code.